PageSourceSearch

https://penzu.com/dist/core.d1ed9df5c4e808206130.js

js penzu.com collected 2026-09-24 08:36:14 UTC 203,229 bytes, 2 lines download raw bytes

1/*! For license information please see core.d1ed9df5c4e808206130.js.LICENSE.txt */
2(globalThis.webpackChunkpenzu_legacy_frontend=globalThis.webpackChunkpenzu_legacy_frontend||[]).push([[114],{260(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{scope:{},require:"ngModel",restrict:"E",replace:"true",template:"<span class='uib-checkbox'><button type=\"button\" ng-style=\"stylebtn\" class=\"btn btn-default\" ng-class=\"{'btn-xs': size==='default', 'btn-sm': size==='large', 'btn-lg': size==='largest', 'checked': checked===true}\"><span ng-style=\"styleicon\" class=\"icon fa\" ng-class=\"{'fa-check': checked===true, 'fa-minus': checked===undefined}\"></span></button></span>",compile:function(e,t,r){return void 0!==t.ngClass&&(t.ngClass=t.ngClass.replace(/}\s*{/g,", ")),function(e,t,r,n){e.size="default",e.stylebtn={},e.styleicon={width:"10px",left:"-1px"},void 0!==r.large&&(e.size="large",e.stylebtn={"padding-top":"2px","padding-bottom":"2px",height:"30px"},e.styleicon={width:"8px",left:"-5px","font-size":"17px"}),void 0!==r.larger&&(e.size="larger",e.stylebtn={"padding-top":"2px","padding-bottom":"2px",height:"34px"},e.styleicon={width:"8px",left:"-8px","font-size":"22px"}),void 0!==r.largest&&(e.size="largest",e.stylebtn={"padding-top":"2px","padding-bottom":"2px",height:"45px"},e.styleicon={width:"11px",left:"-11px","font-size":"30px"});var o=!1;"true"===r.indeterminate&&(o=!0);var a=!0,i=!1,s=void 0;void 0!==r.ngTrueValue&&(a=r.ngTrueValue),void 0!==r.ngFalseValue&&(i=r.ngFalseValue),void 0!==r.ngIndeterminateValue&&(s=r.ngIndeterminateValue),void 0!==e.name&&(t.name=e.name),e.$watch(function(){return n.$modelValue===a||!0===n.$modelValue?n.$setViewValue(a):!0!==o||n.$modelValue!==s&&void 0!==n.$modelValue?n.$setViewValue(i):n.$setViewValue(s),n.$modelValue},function(t,r){!0===o&&n.$modelValue===s?e.checked=void 0:e.checked=n.$modelValue===a},!0),t.bind("click",function(){e.$apply(function(){!0===o?n.$modelValue===i?n.$setViewValue(a):n.$modelValue===a?n.$setViewValue(s):n.$setViewValue(i):n.$modelValue===i?n.$setViewValue(a):n.$setViewValue(i)})})}}}}},477(){},497(){"use strict";!function(e,t){function r(e,t){return typeof e===t}var n=[],o=[],a={_version:"3.3.1",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var r=this;setTimeout(function(){t(r[e])},0)},addTest:function(e,t,r){o.push({name:e,fn:t,options:r})},addAsyncTest:function(e){o.push({name:null,fn:e})}},i=function(){};i.prototype=a,(i=new i).addTest("history",function(){var t=navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&e.history&&"pushState"in e.history});var s=t.documentElement,l="svg"===s.nodeName.toLowerCase();i.addTest("localstorage",function(){var e="modernizr";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}),function(){var e,t,a,s,l,u;for(var c in o)if(o.hasOwnProperty(c)){if(e=[],(t=o[c]).name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(a=0;a<t.options.aliases.length;a++)e.push(t.options.aliases[a].toLowerCase());for(s=r(t.fn,"function")?t.fn():t.fn,l=0;l<e.length;l++)1===(u=e[l].split(".")).length?i[u[0]]=s:(!i[u[0]]||i[u[0]]instanceof Boolean||(i[u[0]]=new Boolean(i[u[0]])),i[u[0]][u[1]]=s),n.push((s?"":"no-")+u.join("-"))}}(),function(e){var t=s.className,r=i._config.classPrefix||"";if(l&&(t=t.baseVal),i._config.enableJSClass){var n=new RegExp("(^|\\s)"+r+"no-js(\\s|$)");t=t.replace(n,"$1"+r+"js$2")}i._config.enableClasses&&(t+=" "+r+e.join(" "+r),l?s.className.baseVal=t:s.className=t)}(n),delete a.addTest,delete a.addAsyncTest;for(var u=0;u<i._q.length;u++)i._q[u]();e.Modernizr=i}(window,document)},590(e,t,r){"use strict";angular.module("penzuApp").config(["$stateProvider","$urlRouterProvider","$locationProvider","AuthRedirects",function(e,t,n,o){var a,i,s,l,u,c,d,p,h,m,g,f,v,y,b,w;return n.html5Mode(!0).hashPrefix("!"),t.otherwise("/error/404"),i=["$q","Auth",function(e,t){var r;return r=e.defer(),t.isAuthed()&&!t.isTokenExpired()?r.resolve():r.reject({needsAuthentication:!0}
2),r.promise}],v=["$q","$mobile",function(e,t){var r;return r=e.defer(),t.isMobileOrTablet()?r.reject({isMobile:!0}):r.resolve(),r.promise}],f=["$q","Auth",function(e,t){var r;return r=e.defer(),t.isAuthed()?t.isTokenExpired()?r.reject({redirect:"login"}):r.reject({redirect:"journals"}):r.reject({redirect:"signup"}),r.promise}],a=["Account","$q","Auth",function(e,t,r){var n;return n=t.defer(),!r.isAuthed()||r.isTokenExpired()?n.reject({needsAuthentication:!0}):e.getSettings().then(function(e){return n.resolve(e)},function(e){var t;return null==e&&(e={}),n.reject({redirect:"404",redirectParams:{message:(null!=(t=e.error)?t.message:void 0)||null}})}),n.promise}],p=["Journals","$q","Auth",function(e,t,r){var n;return n=t.defer(),!r.isAuthed()||r.isTokenExpired()?n.reject({needsAuthentication:!0}):e.fetchJournals().then(function(e){return n.resolve(e)},function(e){var t;return null==e&&(e={}),n.reject({redirect:"404",redirectParams:{message:(null!=(t=e.error)?t.message:void 0)||null}})}),n.promise}],g=["Journals","$q","Auth","$state",function(e,t,r,n){var o;return o=t.defer(),!r.isAuthed()||r.isTokenExpired()?o.reject({needsAuthentication:!0}):e.fetchJournals().then(function(e){return e.length>1&&(e=_.sortBy(e,"last_update").reverse()),n.go("journal.entry.new",{id:e[0].id}),o.resolve()},function(e){var t;return null==e&&(e={}),o.reject({redirect:"404",redirectParams:{message:(null!=(t=e.error)?t.message:void 0)||null}})}),o.promise}],u=["Journals","$q",function(e,t){var r;return r=t.defer(),e.fetchJournals().then(function(e){return r.resolve(e[0])},function(e){var t;return null==e&&(e={}),r.reject({redirect:"404",redirectParams:{message:(null!=e&&null!=(t=e.error)?t.message:void 0)||null}})}),r.promise}],c=["Journals","Auth","$stateParams","$q",function(e,t,r,n){var o;return o=n.defer(),!t.isAuthed()||t.isTokenExpired()?o.reject({needsAuthentication:!0}):e.getJournal(r.id).then(function(e){return o.resolve(e)},function(e){var t;return null==e&&(e={}),o.reject({redirect:"404",redirectParams:{message:(null!=e&&null!=(t=e.error)?t.message:void 0)||null}})}),o.promise}],d=["Journals","Auth","$stateParams","$q",function(e,t,r,n){var o;return o=n.defer(),!t.isAuthed()||t.isTokenExpired()?o.reject({needsAuthentication:!0}):e.getJournalThemes(r.id).then(function(e){return o.resolve(e)},function(e){var t;return null==e&&(e={}),o.reject({redirect:"404",redirectParams:{message:(null!=(t=e.error)?t.message:void 0)||null}})}),o.promise}],s=["Journals","$q","Auth","$stateParams",function(e,t,r,n){var o;return o=t.defer(),!r.isAuthed()||r.isTokenExpired()?o.reject({needsAuthentication:!0}):e.fetchEntries(n.id).then(function(e){return o.resolve(e)},function(e){var t;return null==e&&(e={}),o.reject({redirect:"404",redirectParams:{message:(null!=(t=e.error)?t.message:void 0)||null}})}),o.promise}],l=["Journals","Auth","$stateParams","$q",function(e,t,r,n){var o;return o=n.defer(),!t.isAuthed()||t.isTokenExpired()?o.reject({needsAuthentication:!0}):e.getEntry(r.entryId,r.id).then(function(e){return e.locked?o.reject({redirect:"journal.entry.unlock",redirectParams:r}):o.resolve(e)},function(e){var t;return null==e&&(e={}),o.reject({redirect:"404",redirectParams:{message:(null!=(t=e.error)?t.message:void 0)||null}})}),o.promise}],m=["Journals","$stateParams","$q",function(e,t,r){var n;return n=r.defer(),e.fetchPublicEntry(t.id).then(function(e){return n.resolve(e)},function(e){var t;return null==e&&(e={}),n.reject({redirect:"404",redirectParams:{message:(null!=(t=e.error)?t.message:void 0)||null}})}),n.promise}],b=["Journals","$stateParams","$q",function(e,t,r){var n;return n=r.defer(),e.getEntry(t.entryId,t.id).then(function(e){return n.resolve(e)},function(e){var t;return null==e&&(e={}),n.reject({redirect:"404",redirectParams:{message:(null!=(t=e.error)?t.message:void 0)||null}})}),n.promise}],h=["Journals","$stateParams","$q",function(e,t,r){var n;return n=r.defer(),e.getNewEntry(t.id).then(function(e){return n.resolve(e)},function(e){var t;return null==e&&(e={}),n.reject({redirect:"404",redirectParams:{message:(null!=(t=e.error)?t.message:void 0)||null}})}),n.promise}],y=["Journals","$stateParams","$q",function(e,t,r){var n;return n=r.defer(),e.getJournalReminders(t.id).then(function(e){return n.resolve(e)},function(e){var t;return null==e&&(e={}),n.reject({redirect:"404",redirectParams:{message:(null!=(t=e.error)?t.message:void 0)||null}})}),n.promise}],w=["Auth","$stateParams","$q",function(e,t,r){var n;
2return n=r.defer(),e.validateLoginLink(t.id,t.c).then(function(e){return n.reject({redirect:"journals"})},function(e){return null==e&&(e={}),n.reject({redirect:"404",redirectParams:{message:"That link is invalid."}})}),n.promise}],e.state("autoLogin",{url:"/app/auto-login/:id?c",reloadOnSearch:!1,resolve:{validateLogin:w},options:{showFooter:!0,header:!1}}).state("index",{url:"/",resolve:{redirectLandingPage:f},options:{header:!1,showFooter:!0}}).state("journals",{url:"/journals?aul&e&show_themes",template:'<journal-index journals="ctrl.journals" account="ctrl.account"/>',controller:["journals","account",function(e,t){return console.log("journals route"),this.journals=e,this.account=t,this}],controllerAs:"ctrl",resolve:{authenticated:i,rejectMobile:v,journals:p,account:a},options:{showPromoBanner:!0}}).state("recentJournalNewEntry",{url:"/journals/new-entry",resolve:{authenticated:i,rejectMobile:v,recentJournalNewEntry:g}}).state("journal",{url:"/journals/:id?tour",template:'<single-journal journal="journal.journal"/>',controller:["journal",function(e){return this.journal=e,this}],controllerAs:"journal",headerNavigation:"entry-header",headerSearch:!1,resolve:{authenticated:i,rejectMobile:v,journal:c,journalThemes:d}}).state("journal.unlock",{url:"/unlock?entry&tour",template:'<lock-journal-view journal="ctrl.journal" />',controller:["journal",function(e){return this.journal=e,this}],controllerAs:"ctrl",headerSearch:!1,resolve:{authenticated:i}}).state("journal.entries",{url:"/entries?page&time&view&timeStart&timeEnd",template:'<entries journal="ctrl.journal" journal-ctrl="vm" entries="ctrl.entries"/>',headerNavigation:"journal-header",reloadOnSearch:!1,controller:["journal","entries",function(e,t){return this.journal=e,this.journal.entries=t,this}],controllerAs:"ctrl",resolve:{journal:c,entries:s},options:{showPromoBanner:!0}}).state("journal.entry",{abstract:!0,url:"/entry",template:'<entry-layout journal="$ctrl.journal" />',controller:["journal",function(e){return this.journal=e,this}]}).state("journal.entry.new",{url:"^/journals/:id/new",template:'<pad entry="ctrl.entry" journal="journal.journal" />',controller:["entry",function(e){return console.log("Resolved new entry: ",e),this.entry=e,this}],controllerAs:"ctrl",headerNavigation:"entry-header",headerSearch:!1,skipGlobalLoader:!0,resolve:{authenticated:i,rejectMobile:v,entry:h},options:{showPromoBanner:!0}}).state("journal.entry.unlock",{url:"^/journals/:id/:entryId/unlock",template:'<entry-locking entry="ctrl.entry" />',controller:["entry",function(e){return this.entry=e,this}],controllerAs:"ctrl",headerNavigation:"entry-header",headerSearch:!1,skipGlobalLoader:!0,resolve:{authenticated:i,rejectMobile:v,entry:b}}).state("journal.entry.show",{url:"^/journals/:id/:entryId",template:'<pad entry="ctrl.entry" journal="journal.journal" />',controller:["entry",function(e){return this.entry=e,this}],controllerAs:"ctrl",headerNavigation:"entry-header",headerSearch:!1,skipGlobalLoader:!0,resolve:{authenticated:i,rejectMobile:v,entry:l},options:{showPromoBanner:!0}}).state("index-permanent",{url:"/online-journal",template:"<index-view />",skipGlobalLoader:!0,controller:"IndexCtrl",options:{header:!1,showFooter:!0}}).state("publicEntry",{url:"/public/:id",template:'<public-entry entry="vm.entry" />',controller:["entry",function(e){return this.entry=e,this}],controllerAs:"vm",resolve:{entry:m},headerNavigation:"public-entry-header",options:{showFooter:!0,showPromoBanner:!0}}).state("disable-reminder",{url:"/app/disable-reminder/:reminderId/:userSlug",template:r(7640)(),controller:"DisableRemindersCtrl",headerNavigation:!1,options:{showFooter:!0}}).state("manage-reminders",{url:"/app/manage-reminders/:id",template:r(8744)(),controller:"ManageRemindersCtrl as vm",headerNavigation:!1,options:{showFooter:!0},resolve:{authenticated:i,journal:c,reminders:y}}).state("disable-lookingglass",{url:"/app/disable-lookingglass/:userId",template:r(9887)(),controller:"DisableLookingGlassCtrl",headerNavigation:!1,options:{showFooter:!0}}).state("exclude-lookingglass",{url:"/app/exclude-lookingglass/:entryId/:userSlug",template:r(7161)(),controller:"ExcludeLookingGlassCtrl",headerNavigation:!1,options:{showFooter:!0}}).state("export-download",{url:"/app/export-download/:token",template:'<export-download token="$ctrl.token" />',controller:["$state",function(e){return this.token=e.params.token,console.log("token: ",this.token),this}],controllerAs:"$ctrl",headerNavigation:!1,options:{showFooter:!0},resolve:{authenticated:i}}
2).state("search",{url:"/search?query&journal&field&order&tag",template:r(6410)(),controller:"SearchCtrl",headerNavigation:"journal-header",headerSearch:!1,reloadOnSearch:!1,resolve:{authenticated:i,rejectMobile:v},options:{showPromoBanner:!0}}).state("login",{url:"/app/login?after_login&message&status",template:"<login-view />",resolve:{redirectAuthed:["Auth","$state",function(e,t){var r;return e.isAuthed()&&!e.isTokenExpired()?(r=new URLSearchParams(window.location.search).get("after_login"),o.isAllowedAfterLoginRedirect(r)||(r="/journals"),window.location.pathname=r,Promise.reject()):Promise.resolve()}]},options:{showFooter:!0}}).state("signup",{url:"/app/signup?gopro&basic",template:"<signup-view />",resolve:{redirectAuthed:["Auth","$state",function(e,t){var r;return e.isAuthed()&&!e.isTokenExpired()?("/"===(r=t.params.after_login||"/journals")&&(r="/journals"),window.location.pathname=r,Promise.reject()):Promise.resolve()}]},reloadOnSearch:!1,options:{showFooter:!0}}).state("signup-pro",{url:"/app/signup-pro",template:"<signup-pro-view />",reloadOnSearch:!1,headerSearch:!1,options:{showFooter:!0}}).state("gopro",{url:"/gopro",template:"<go-pro></go-pro>",reloadOnSearch:!1,headerSearch:!1}).state("powerUserSale",{url:"/promos/power-user-sale?pc",template:r(1537)(),headerSearch:!1,reloadOnSearch:!1,options:{hidePlanSelection:!0}}).state("flashSale",{url:"/promos/flash-sale?pc",template:r(1332)(),headerSearch:!1,reloadOnSearch:!1,options:{hidePlanSelection:!0}}).state("sale",{url:"/promos/:name?pc&promo",templateUrl:function(e){return"/app/views/promos/"+e.name+".html"},headerSearch:!1,reloadOnSearch:!1}).state("unsubscribe",{url:"/unsubscribe/sponsored?email",template:r(4446)(),controller:"UnsubscribeCtrl",headerSearch:!1,reloadOnSearch:!1,options:{showFooter:!0}}).state("forgotPassword",{url:"/app/forgot-password",template:"<forgot-password-view/>",showFooter:!1,headerSearch:!1}).state("forgotPasswordConfirmation",{url:"/app/forgot-password-confirmation?code&email",template:"<forgot-password-confirmation-view/>",reloadOnSearch:!1,showFooter:!1,headerSearch:!1}).state("deleteAccountConfirmation",{url:"/app/delete-account-confirmation?status&reason",template:r(5796)(),controller:"DeleteAccountConfirmationCtrl as ctrl",headerNavigation:!1,reloadOnSearch:!1}).state("blockSharesConfirmation",{url:"/app/block-shares-confirmation?status",template:r(3344)(),controller:"BlockSharesConfirmationCtrl as ctrl",headerNavigation:!1,reloadOnSearch:!1}).state("deleteAccountConfirmationLegacy",{url:"/account/delete-account-confirmation?status&reason",redirectTo:"deleteAccountConfirmation"}).state("blockSharesConfirmationLegacy",{url:"/account/block-shares-confirmation?status",redirectTo:"blockSharesConfirmation"}).state("requestLoginLink",{url:"/app/request-login-link",template:"<request-login-link-view/>",showFooter:!1,headerSearch:!1}).state("account",{url:"/app/account?monthly_to_yearly",template:r(5452)(),controller:"AccountCtrl as account",headerNavigation:"account-header",reloadOnSearch:!1,resolve:{authenticated:i,rejectMobile:v},options:{showPromoBanner:!0}}).state("account.billing",{url:"/billing?update-payment&pc&promo",template:'<account-billing account="account" />',headerNavigation:"account-header",reloadOnSearch:!1,resolve:{authenticated:i,rejectMobile:v}}).state("account.delete",{url:"/delete",template:'<account-delete account="vm" />',headerNavigation:"account-header",reloadOnSearch:!1,resolve:{authenticated:i,rejectMobile:v}}).state("downgrade",{url:"/app/downgrade",template:r(8856)(),controller:"DowngradeCtrl",headerSearch:!1,options:{showFooter:!0}}).state("renew",{url:"/app/renew",template:"<renew></renew>",headerNavigation:!1}).state("renew-error",{url:"/app/renew-error",template:r(7755)(),controller:"RenewalErrorCtrl"}).state("support",{url:"/support",template:"<support-view />",headerNavigation:"account-header",options:{showFooter:!0,showPromoBanner:!0}}).state("onboarding",{url:"/welcome",template:'<onboarding journal="ctrl.journal"/>',controller:["journal",function(e){return this.journal=e,this}],controllerAs:"ctrl",headerNavigation:!1,resolve:{authenticated:i,rejectMobile:v,journal:u},attrs:{module:"journal",bodyClass:"_welcome"}}
2).state("onboarding.journal",{url:"/journal",template:"<onboarding-journal />",headerNavigation:!1,skipGlobalLoader:!0,resolve:{authenticated:i},attrs:{module:"journal",bodyClass:"_welcome",step:2}}).state("onboarding.customize",{url:"/customize",template:"<onboarding-customize />",headerNavigation:!1,skipGlobalLoader:!0,resolve:{authenticated:i},attrs:{module:"customize",bodyClass:"_welcome",step:3}}).state("onboarding.mobile",{url:"/mobile",template:"<onboarding-mobile />",headerNavigation:!1,skipGlobalLoader:!0,resolve:{authenticated:i},attrs:{module:"mobile",bodyClass:"_welcome",step:4}}).state("onboard",{url:"/onboarding",template:'<onboard journal="ctrl.journal"/>',controller:["journal",function(e){return this.journal=e,this}],controllerAs:"ctrl",headerNavigation:!1,resolve:{authenticated:i,rejectMobile:v,journal:u},attrs:{bodyClass:"_onboard"},options:{showFooter:!1}}).state("onboard.write",{url:"/write",template:"<onboard-write/>",skipGlobalLoader:!0,headerNavigation:!1,options:{name:"write"}}).state("onboard.entries",{url:"/entries?entryId",template:"<onboard-entries />",skipGlobalLoader:!0,headerNavigation:!1,options:{name:"entries"}}).state("onboard.journal",{url:"/journal",template:"<onboard-journal />",skipGlobalLoader:!0,headerNavigation:!1,options:{name:"journal"}}).state("mobileLogin",{url:"/mobile/login?after_login",template:"<login-view />",options:{showFooter:!0}}).state("404",{url:"/error/404?entry&type&message",template:r(8031)(),controller:"ErrorCtrl",controllerAs:"vm",headerNavigation:!1,options:{showFooter:!0}}).state("403",{url:"/error/403?entry&type",template:r(8031)(),controller:"ErrorCtrl",headerNavigation:!1,options:{showFooter:!0}}).state("redirect",{url:"/redirect?goto",controller:["$scope","$location",function(e,t){return e.$on("$stateChangeSuccess",function(e,r,n){return console.log("Hit redirect route: ",r,n),t.search("goto",null),t.path(n.goto)})}]})}])},791(){"use strict";var e,t;e=function(){return{restrict:"A",scope:{bgImage:"=bgImage"},link:function(e,t,r){var n;return n=function(e){if(e)return-1===e.indexOf(".")&&-1===e.indexOf("base64")&&-1===e.indexOf("/g/")?t.css("background",e):t.css("background-image","url("+e+")"),!0;t.css("background-image","")},e.$watch("bgImage",function(e){return n(e)})}}},t=function(){return{restrict:"A",link:function(e,t,r){var n;return n=function(e){var r,n,o,a,i,s,l;return r=t,s=t.get(0).scrollTop,i=t.get(0).scrollHeight,o=r.outerHeight(!0),a=function(){return e.stopPropagation(),e.preventDefault(),e.returnValue=!1,!1},!(l=(n="DOMMouseScroll"===e.type?-40*e.originalEvent.detail:e.originalEvent.wheelDelta)>0)&&-n>i-o-s?(r.scrollTop(i),a()):l&&n>s?(r.scrollTop(0),a()):void 0},t.on("DOMMouseScroll mousewheel",_.throttle(n,75))}}},angular.module("penzuApp").directive("bgImage",e).directive("isolateScrolling",t)},1332(e,t,r){r(7766),e.exports=function(e){return""+'<div class="sale__wrap" promos><div class="sale__banner"><img ng-src="/app/images/promos/banner_flash-sale.jpg" ng-if="!alternateFlashSaleBanner" alt="Flash Sale banner"><img ng-src="/app/images/promos/banner_flash-sale_b.jpg" ng-if="alternateFlashSaleBanner" alt="Flash Sale banner"></div><div class="gopro__form"><div class="sale__intro"><p> Welcome to the Penzu Flash Sale! We&rsquo;ll upgrade your<strong ng-show="vm.user.access_token">{{vm.user.access_token.user.email}}</strong>&nbsp;account to one year of Penzu PRO at a great price!</p></div><pro-form options="vm.options"></pro-form></div></div>'}},1405(){"use strict";angular.module("penzuApp").directive("headerNavigation",["$compile",function(e){return{template:"<div></div>",restrict:"A",link:function(t,r,n){return t.$watch("navTemplate",function(e,r){if(e!==r)return t.loadNewTemplate(e)}),t.loadNewTemplate=function(n){return r.html("<div "+n+"></div>"),e(r.contents())(t)}}}}])},1467(e,t,r){r(7766),e.exports=function(e){return""+'<span class="loader-wrap ng-hide" ng-show="loading"><span class="loader-main spinner"><span class="bounce1"></span><span class="bounce2"></span><span class="bounce3"></span></span></span>'}},1537(e,t,r){r(7766),e.exports=function(e){return""+'<div class="sale__wrap" promos>
2<div class="sale__banner"><img ng-src="{{vm.$global.IMAGE_URL}}/images/emails/banner_congratulations.png" alt="Power User Sale banner"></div><div class="gopro__form"><div class="sale__intro"><p>Congratulations on your 15th journal entry! You’re pretty much a journaling pro. To say &ldquo;thank you&rdquo; for using Penzu we&rsquo;d like to offer you<strong>&nbsp;a Penzu PRO plan for 50% off!</strong></p></div><pro-form options="vm.options"></pro-form></div></div>'}},1558(){"use strict";angular.module("penzuApp").directive("header",["$modal","$state",function(e,t){return{restrict:"A",controller:"HeaderCtrl",link:function(r,n,o){return r.isLogin=function(){return"login"===t.current.name},r.openProModal=function(){return e.openUpgradeModal({source:"header_click"}),!0}}}}])},1727(e,t,r){"use strict";var n,o=r(6999);n=function(){function e(e,t,r,n,a,i){var s;this.$uibModal=r,this.$global=t,this.Auth=n,this.$storage=a,this.$state=i,this.idleInterval=null,this.idleTime=0,this.$doc=o(document),this.skipUnloadTime=!1,e.$on("window:unload",(s=this,function(){return s.onUnload()})),e.$on("session:destroy",function(e){return function(){return e.clear(),e.$storage.clear("unload_time")}}(this)),e.$on("settings:update",function(e){return function(){return t.settings.auto_logout?e.init(t.settings):t.auto_logout&&e.idleInterval?e.clear():void 0}}(this))}return e.prototype.init=function(e,t){var r,n,o;if(null==t&&(t=!1),!this.Auth.isAuthed()||!e.auto_logout)return!1;if(console.log("Init auto logout. Pageload? ",t),t){if(n=this.$storage.get("unload_time"),this.$storage.clear("unload_time"),console.log("Autologout unload time: ",n),e.auto_logout&&e.auto_logout>0&&n&&moment(n).add(e.auto_logout,"minutes").isBefore(moment()))return console.log("This session expired while it was unloaded and needs to be closed."),this.Auth.logout({trackParams:{status:"200",message:"timeout"}}).then((o=this,function(){return o.$state.go("login")})),!1}else this.$storage.clear("unload_time");return this.clear(),this.idleInterval=setInterval(function(e){return function(){return e.timerIncrement()}}(this),6e4),r=this,this.$doc.on("mousemove.autologout keypress.autologout",function(){return r.idleTime=0})},e.prototype.clear=function(){return clearInterval(this.idleInterval),this.$doc.off("mousemove.autologout keypress.autologout"),this.idleTime=0},e.prototype.timerIncrement=function(){if(this.idleTime++,this.idleTime>this.$global.settings.auto_logout&&!this.modalInstance&&this.$global.settings.auto_logout)return this.openTimeoutModal()},e.prototype.openTimeoutModal=function(){var e;return this.modalInstance=this.$uibModal.open({template:r(9836)(),controller:"AutoLogoutCtrl",controllerAs:"vm",resolve:{autoLogout:(e=this,function(){return e})},backdrop:"static",keyboard:!1}),this.modalInstance.result.then(function(e){return function(){return e.modalInstance=null,e.init(e.$global.settings)}}(this)),this.modalInstance},e.prototype.onUnload=function(){return this.$global.settings.auto_logout&&!this.skipUnloadTime&&this.Auth.isAuthed()?this.$storage.set("unload_time",moment().toDate()):this.$storage.clear("unload_time")},e}(),angular.module("penzuApp").service("AutoLogout",["$rootScope","$global","$uibModal","Auth","$storage","$state",n])},1950(e,t,r){var n=r(1396),o=r(7474),a=r(6999);angular.module("penzuApp").factory("$oauth",["$injector","$global",function(e,t){var r;return r=null,{getHeader:function(i){var s,l,u,c,d,p,h,m;return c=(r=r||e.get("Auth")).getSessionHeaders(),p=(s=t.isLegacyUrl(i.url))?"HMAC-SHA1":"HMAC-SHA256",d=s?n.HmacSHA1:n.HmacSHA256,l=o({consumer:{key:c.clientKey,secret:c.clientSecret},signature_method:p,hash_function:function(e,t){return n.enc.Base64.stringify(d(e,t))}}),m=i.url,i.params||(i.params={}),_.isEmpty(i.params)||(m+="?"+a.param(i.params)),i.method=i.type||"post",u={url:m,method:i.method},h={key:c.token,secret:c.tokenSecret},l.toHeader(l.authorize(u,h))}}}])},2297(){"use strict";var e,t,r,n,o,a,i,s,l;i=function(){return function(e){return 10===(e=e.replace(/[^\d]+/g,"")).length&&(e="("+e.substring(0,3)+") "+e.substring(3,6)+"-"+e.substring(6,10)),e}},o=function(){return function(e){if(e)return"$"+e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}},t=function(){return function(e,t){if(e)return moment.utc(e).local().format(t)}},r=function(){return function(e,t){if(e)return moment(e,"X").local().format(t)}},a=function(){return function(e,t){var r;return r="",_.each(e,function(n,o){var a;if(a=t?n[t]:n,r+=a,o<e.length-1)return r+=", "}),r}},s=function(){return function(e,t,r){return t=t||"",r=r||"s",1===e?t:r}},e=function(){return function(e){return null==e&&(e=""),e.length?e.charAt(0).toUpperCase()+e.substr(1):e}},l=function(){return function(e){var t,r;return null==e&&(e=""),e.length?('"'===e.charAt(0)&&(e=(e="&ldquo;"+e.substr(1)).replace('"',"&rdquo;")),e.split(" - ").length>1&&(t=(r=e.split(" - ")).splice(r.length-1,1),e=r.join(" - ")+"<span class='author'>&ndash;&nbsp;"+t+"</span>"),e):e}},n=function(){return function(e){var t;return null==e&&(e=0),e?(t="",e<1024?t=e+" B":e>=1024&&(t=Math.round(e/1024*100)/100,t+=" KB"),t):"0 B"}},angular.module("penzuApp").filter("phone",i).filter("formatPrice",o).filter("dateFormat",t).filter("dateFormatUnix",r).filter("oxfordComma",a).filter("pluralize",s).filter("capitalize",e).filter("prompt",l).filter("filesize",n)},2309(e,t,r){"use strict";var n=r(6999);
2angular.module("penzuApp").run(["$rootScope","$window","$location","$state","$track","Auth","$storage","$modal","$error","$unload","Account","$global","$mobile","$experiments","$interval","AutoLogout","Themes","AuthRedirects",function(e,t,r,o,a,i,s,l,u,c,d,p,h,m,g,f,v,y){var b,w,k,P,O,j,A,T,S,E,$;return O={API_ROOT:null!=(T=null!=(S="MISSING_ENV_VAR".API_HOST_OVERRIDE)?S:"https://penzu.com")?T:window.location.origin,PROTOCOL:window.location.protocol,BACKGROUND:p.IMAGE_URL+"/images/backgrounds/wood.jpg",PAD_BACKGROUND:p.IMAGE_URL+"/images/backgrounds/pad.gif",FONT_FAMILY:"Lora",FONT_SIZE:16,IMAGE_URL:p.IMAGE_URL,SUPPORT_SITE:"http://support.penzu.com",LINKTEXTING:{LINK_ID:"4c689d5a-fb2d-4bd1-8806-bf82474e0432"},APP_UI:{HIDE_SIDEBAR:s.get("hideSidebar")||!1,SHOW_FOOTER:!1,GLOBAL_LOADER_MINTIME:750},CONNECTED:!0,BRAINTREE:{CLIENT_TOKEN:"eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiI3MWVlYzhiYzUxMWRkMjNjMjA2ZDMxNzgzNjViMzk1ZWMzNmMzYmY4NzQ4YTM2MzYxYTc5M2NlMmM4ZTA4MGQ0fGNyZWF0ZWRfYXQ9MjAxNi0wNC0xMlQxODoyMDowMC4xODc0NTYwNzArMDAwMFx1MDAyNm1lcmNoYW50X2lkPThoeDRyZGJxbXJwaHlwcGRcdTAwMjZwdWJsaWNfa2V5PTQ4dGJieHRnaDk4dHI3bngiLCJjb25maWdVcmwiOiJodHRwczovL2FwaS5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzLzhoeDRyZGJxbXJwaHlwcGQvY2xpZW50X2FwaS92MS9jb25maWd1cmF0aW9uIiwiY2hhbGxlbmdlcyI6WyJjdnYiXSwiZW52aXJvbm1lbnQiOiJwcm9kdWN0aW9uIiwiY2xpZW50QXBpVXJsIjoiaHR0cHM6Ly9hcGkuYnJhaW50cmVlZ2F0ZXdheS5jb206NDQzL21lcmNoYW50cy84aHg0cmRicW1ycGh5cHBkL2NsaWVudF9hcGkiLCJhc3NldHNVcmwiOiJodHRwczovL2Fzc2V0cy5icmFpbnRyZWVnYXRld2F5LmNvbSIsImF1dGhVcmwiOiJodHRwczovL2F1dGgudmVubW8uY29tIiwiYW5hbHl0aWNzIjp7InVybCI6Imh0dHBzOi8vY2xpZW50LWFuYWx5dGljcy5icmFpbnRyZWVnYXRld2F5LmNvbS84aHg0cmRicW1ycGh5cHBkIn0sInRocmVlRFNlY3VyZUVuYWJsZWQiOmZhbHNlLCJwYXlwYWxFbmFibGVkIjp0cnVlLCJwYXlwYWwiOnsiZGlzcGxheU5hbWUiOiJQZW56dSIsImNsaWVudElkIjoiQVExYllwOC1kV3pnRzdIZUFKM01mRmk0X01CeTJPVURaVXc4MzZGeDVVSUZZNzlCQTRGeW81UGZudWNkMEc5cUVSX1NHN25ZQWctQVRWcGUiLCJwcml2YWN5VXJsIjoiaHR0cDovL3Blbnp1LmNvbS9wcml2YWN5IiwidXNlckFncmVlbWVudFVybCI6Imh0dHA6Ly9wZW56dS5jb20vdGVybXMiLCJiYXNlVXJsIjoiaHR0cHM6Ly9hc3NldHMuYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJhc3NldHNVcmwiOiJodHRwczovL2NoZWNrb3V0LnBheXBhbC5jb20iLCJkaXJlY3RCYXNlVXJsIjpudWxsLCJhbGxvd0h0dHAiOmZhbHNlLCJlbnZpcm9ubWVudE5vTmV0d29yayI6ZmFsc2UsImVudmlyb25tZW50IjoibGl2ZSIsInVudmV0dGVkTWVyY2hhbnQiOmZhbHNlLCJicmFpbnRyZWVDbGllbnRJZCI6IkFSS3JZUkRoM0FHWER6VzdzT18zYlNrcS1VMUM3SEdfdVdOQy16NTdMallTRE5VT1NhT3RJYTlxNlZwVyIsImJpbGxpbmdBZ3JlZW1lbnRzRW5hYmxlZCI6ZmFsc2UsIm1lcmNoYW50QWNjb3VudElkIjoicGVuenVDQUQiLCJjdXJyZW5jeUlzb0NvZGUiOiJDQUQifSwiY29pbmJhc2VFbmFibGVkIjpmYWxzZSwibWVyY2hhbnRJZCI6IjhoeDRyZGJxbXJwaHlwcGQiLCJ2ZW5tbyI6Im9mZiJ9"}},console.log("globalVars:",O),p=angular.extend(p,O),angular.extend(e,O,{sanitizeOpts:function(e){return null==e&&(e={}),e.success||(e.success=angular.noop),e.error||(e.error=angular.noop),e.done||(e.done=angular.noop),e}}),A=function(e){var t,r;return t=h.isMobile()?"/mobile/login":"/app/login",r=window.location.origin+t,y.isAllowedAfterLoginRedirect(e)&&(r+="?after_login="+e),r},w=function(t,n,a){var l,u,c,d,p;return null==n&&(n={}),null==a&&(a={}),!(!(p=i.getCurrentSession())||(u=s.get("onboarding"),c={},(d=r.search()).name&&(c[d.name]=d.value),u&&(u.step&&!u.user||u.step&&u.user===p.access_token.user_id&&u.step<4)&&(l=o.href("onboarding."+u.step.module),r.search(d.name,d.value),r.path(l),console.log("Onboarding redirect: ",l),_.defer(function(){return e.$apply()}),1)))},E=function(e){var t,r,n,o,a;for(null==e&&(e={}),a=angular.copy(e),t=0,r=(o=["code","c","reset_code","forgot_password_code","confirmation_code"]).length;t<r;t++)n=o[t],null!=(null!=a?a[n]:void 0)&&(a[n]="[FILTERED]");return a},e.$on("$stateChangeStart",function(t,a,i,s,l){var u,c,d;return null==s&&(s={}),_.isEmpty(a.resolve)||a.skipGlobalLoader&&s.skipGlobalLoader||e.$broadcast("globalloader:show"),!Modernizr||Modernizr.history&&Modernizr.localstorage?a.redirectTo?(t.preventDefault(),o.go(a.redirectTo,i),!1):((null!=s&&null!=(c=s.attrs)?c.bodyClass:void 0)&&n("body").removeClass(s.attrs.bodyClass),(null!=a&&null!=(d=a.attrs)?d.bodyClass:void 0)&&n("body").addClass(a.attrs.bodyClass),!(!s.name&&!w(0,a,i)||(console.log("Starting route change: ",r.path()),0))):(u=J
2SON.stringify(window.navigator,null,2),console.log("Browser info: ",u),Modernizr.history||console.log("Browser does not support history."),Modernizr.localstorage||console.log("Browser does not support localstorage"),!1)}),e.$on("$stateChangeError",function(e,t,n,a,s,l){var u;return null==l&&(l={}),console.warn("State change error going to  ",t.url),console.log("State change error: ",t.name,E(n)),l.redirect&&o.go(l.redirect,l.redirectParams),l.needsAuthentication&&(console.log("Needs Authentication State Change Rejection"),console.log("Redirect to login: ",JSON.stringify(t),JSON.stringify(a)),u=A(r.$$url),console.log("New location: ",u),i.logout().then(function(){window.location=u})),l.isMobile?(console.log("Mobile State Change Rejection"),void(window.location=window.location.origin+"/mobile/mobile_application/splash")):(console.warn("State change error: ",l),!0)}),b=n("body"),e.$on("$stateChangeSuccess",function(t,r){var n;return b.attr("data-path",r.name),e.APP_UI.SHOW_FOOTER=!(!r.showFooter&&!(null!=(n=r.options)?n.showFooter:void 0)),e.$broadcast("globalloader:hide")}),$=r.search(),P={version:p.VERSION,platform:p.PLATFORM},$.ec&&(P.email_campaign=$.ec),a.setSuperProperties(P),e.$on("session:init",function(e,t,r){var n,o,l,c;if(null==r&&(r=!1),console.log("Session Init: ",t),c=t.access_token.user_id
2)return o="free",(l=t.access_token.user).is_pro&&l.is_pro_plus?o="plus":l.is_pro&&(o="pro"),n=angular.extend(P,{id:c,name:l.first_name+" "+l.last_name,email:l.email,has_mobile:l.has_mobile,tier:o,is_paid:l.is_pro||l.is_pro_plus,is_pro:l.is_pro,is_pro_plus:l.is_pro_plus,authed_at:t.access_token.created_at||null,$first_name:l.first_name,$last_name:l.last_name,$email:l.email}),a.setUser(c,n),u.setUser(c),t.expired_pro||i.isCurrentAuthed()&&d.getSettings().then(function(e){if(p.settings=e,console.log("Init user settings: ",e),e.auto_logout&&(console.log("init autologout"),f.init(e,r)),e.ui_theme&&"default"!==e.ui_theme&&i.isPaid()?(console.log("init ui theme"),v.set(e.ui_theme)):v.clear(),!p.PROMO.ACTIVE)return console.log("init onetime modal"),d.checkOneTimeModal({type:"flash_sale"}).then(function(e){if(console.log("ontime modal response"),e.show)return a.log("Show Flash Sale Banner"),p.PROMO={ACTIVE:!0,CODE:e.promo_code,SOURCE:"flash_sale",BANNER:{HTML:"Writer Appreciation Sale &mdash; use code <strong>"+e.promo_code+"</strong> at checkout for 50% off Penzu PRO and PRO+. Expires soon!",EMOJI_SRC:"/app/images/icons/emoji_flash.png"}}})}),!t.expired_pro&&i.isAuthed()||s.clear("unload_time"),console.log("session::init ended")}),(k=v.getCurrent())&&"default"!==k&&v.set(k),(j=function(){return i.getCurrentSession()&&i.isTokenExpired()?i.logout().then(function(){return window.location.href="/app/login"}):i.isAuthed()&&(i.initSession(function(t){return e.$broadcast("session:init",t,!0)}),i.isTokenExpiring()&&!i.isTokenExpired())?i.refreshToken():void 0})(),g(function(){if(i.isTokenExpiring()&&!i.isTokenExpired())return i.refreshToken()},3e5),t.addEventListener("offline",function(){return e.$apply(function(){return console.log("Lost internet connection."),e.CONNECTED=!1})},!1),t.addEventListener("online",function(){return e.$apply(function(){return console.log("Reconnected to internet."),e.CONNECTED=!0,j()})},!1),c.init()}]),n('[data-toggle="dropdown"]').dropdown(),n("#app-container-static a").each(function(){return n(this).attr("target","_self")})},2437(e,t,r){"use strict";var n,o,a=r(6999);o=[{name:"Default",slug:"default"},{name:"Light",slug:"light",backgroundColor:"#F8F8F9"},{name:"Dark",slug:"dark",backgroundColor:"#1e2126"},{name:"Deep Blue",slug:"deep-blue",backgroundUrl:"/images/themes/deep-blue/background_deep-blue.jpg"},{name:"Reclaimed",slug:"reclaimed",backgroundUrl:"/images/themes/reclaimed/background_reclaimed.jpg"},{name:"Architecture",slug:"architecture",backgroundUrl:"/images/themes/architecture/background_architecture.jpg"},{name:"Meadow",slug:"meadow",backgroundUrl:"/images/themes/meadow/background_meadow.jpg"},{name:"Spring Time",slug:"springtime",backgroundUrl:"/images/themes/springtime/background_springtime.jpg"}],n=function(){function e(e,t,r,n,o){this.$global=n,this.$storage=e,this.$q=t,this.$http=r,this.$track=o}return e.prototype.set=function(e){return null==e&&(e=null),e?(a("body").attr("theme",e),this.$storage.set("uitheme",e)):(a("body").removeAttr("theme"),this.$storage.clear("uitheme"))},e.prototype.save=function(e){var t,r,n;return t=this.$q.defer(),r={ui_theme:e},this.$http.put(this.$global.API_ROOT+"/api/settings/change_ui_theme",r).then((n=this,function(r){return(r=r.data).error?(console.log("Change UI Theme error: ",r),console.error("Change UI Theme error."),void t.reject(r)):(n.$global.settings=angular.extend(n.$global.settings,r),n.set(e),n.$track.log("Save UI Theme",{theme_name:e}),t.resolve(r))}),function(e,r){return console.log("Change UI Theme error: ",e),console.error("Change UI Theme error."),t.reject(e.data)}),t.promise},e.prototype.get=function(e){return o=this.getThemes(),_.find(o,{slug:e})},e.prototype.getCurrent=function(e){return null==e&&(e=!1),e&&this.$storage.get("uitheme")||this.$global.settings.ui_theme},e.prototype.getThemes=function(){var e;return e=angular.copy(o),_.each(e,function(e){return e.src="/app/images/themes/"+e.slug+"/thumb.jpg"}),angular.copy(e)},e.prototype.clear=function(){return this.set(null)},e}(),angular.module("penzuApp").service("Themes",["$storage","$q","$http","$global","$track",n])},2701(){"use strict";var e,t,r;e="/app/forgot-password-confirmation",r=function(e){var t;if(null==e&&(e=""),"string"!=typeof e)return"";t=e;try{t=decodeURIComponent(e)}catch(r){t=e}try{return new URL(t,window.location.origin).pathname}catch(e){return t.split("?")[0]}},t=function(t){var n;return n=r(t),t&&"/"!==t&&n!==e&&0!==n.indexOf(e+"/")},angular.module("penzuApp").value("$global",{settings:{date_format:"ddd. M/D/YYYY"},IMAGE_URL:"https://d3c2plo0qyv3hc.cloudfront.net",VERSION:"2.8.6",PLATFORM:"Web",PROMO:{ACTIVE:!1,CODE:"SUMMER",SOURCE:"summer_sale",BANNER:{HTML:"Summer's almost gone! Save 50% on yearly PRO and PRO+ with code <strong>SUMMER</strong> until August 23.",EXPIRATION:"Sunday, August 23",EMOJI_SRC:"/app/images/icons/emoji_summer.png"}},LEGACY_URLS:[],isLegacyUrl:function(e){var t,r,n;try{return r=window.location.origin,e.match(/^https?:\/\//)&&(r=new URL(e).origin),(r===window.location.origin||"https://penzu.com"===r)&&(n=new URL(e,r),this.LEGACY_URLS.indexOf(n.pathname.toLowerCase())>-1)}catch(r){return t=r,console.warn("isLegacyUrl could not parse url",e,t),!1}}}).constant("AuthRedirects",{forgotPasswordConfirmationPath:e,pathFromRedirectUrl:r,isAllowedAfterLoginRedirect:t}).constant("$braintree",window.braintreeDropin)},2794(e,t,r){r(7766),e.exports=function(e){return""+'<div class="alert" ng-class="{\'alert-danger\': form.message.type == \'error\'}" ng-show="form.message.visible" style="margin-bottom: 20px;" ng-bind-html="form.message.message"></div>'}},2958(e){"use strict";function t(){try{if(window.crypto&&"function"==typeof window.crypto.randomUUID)return window.crypto.randomUUID()}catch(e){}const e=new Uint8Array(16);try{window.crypto.getRandomValues(e)}catch(t){for(let t=0;t<e.length;
2t++)e[t]=Math.floor(256*Math.random())}e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=Array.from(e,e=>("0"+e.toString(16)).slice(-2)).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}const r="pz_funnel_acquisition_v1",n=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","email_campaign"],o=/^\/(?:app\/(?:login|signup|signup-pro|forgot-password|forgot-password-confirmation|auto-login|request-login-link|renew|renew-error)|mobile\/login|gopro|billing|redirect|checkout)(\/|$)/;let a;function i(){try{window.sessionStorage.setItem(r,JSON.stringify(a))}catch(e){}}function s(){if("undefined"==typeof window)return{};if(a)return a;try{const e=JSON.parse(window.sessionStorage.getItem(r)||"null");if(e&&"object"==typeof e&&!Array.isArray(e)){a={};for(const t of["landing_path","landing_referrer",...n])"string"==typeof e[t]&&(a[t]=e[t].slice(0,512));return a}}catch(e){}if(a={},window.self===window.top&&!o.test(window.location.pathname)){a.landing_path=window.location.pathname,document.referrer&&(a.landing_referrer=document.referrer.replace(/[?#].*$/,""));const e=new URLSearchParams(window.location.search);for(const t of n){const r=e.get("email_campaign"===t?"ec":t);r&&(a[t]=r.slice(0,256))}}return i(),a}e.exports={createFunnelOpening:function(){return{id:t(),events:{}}},acquisitionContext:s,clearAcquisitionContext:function(){a={},i()},emitFunnelStart:function(e,r,n,o){try{if(r.events[n])return;const a=t(),i="number"==typeof o.plan_duration?`${o.plan_duration}year`:o.plan_duration,l={...s(),...o,plan_intent:["free","pro","plus"].includes(String(o.plan_intent))?o.plan_intent:null,plan_duration:["monthly","1year","2year","3year","5year","lifetime"].includes(String(i))?i:null,client_flow:"legacy-frontend",event_schema_version:1,opening_id:r.id,event_id:a,$insert_id:a,time:Math.floor(Date.now()/1e3),device_class:"undefined"!=typeof navigator&&navigator.userAgent?/iPad|Tablet|Android(?!.*Mobile)/i.test(navigator.userAgent)||/Macintosh/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1?"tablet":/Mobi|iPhone|iPod/i.test(navigator.userAgent)?"mobile":"desktop":"unknown"};r.events[n]=l,e.trackEvent(n,l)}catch(e){}}}},3102(e,t,r){r(7766),e.exports=function(e){return""+'<div class="pro-modal"><div class="modal-dialog"><div class="modal-content"><button class="close" type="button" ng-click="vm.closeModal()">&times;</button><pro-form options="vm.options"></pro-form></div></div></div>'}},3344(e,t,r){r(7766),e.exports=function(e){return""+'<div class="account-confirmation"><div class="account-confirmation__card pz-card"><h1 class="account-confirmation__title" ng-bind="ctrl.title"></h1><p class="account-confirmation__body" ng-bind-html="ctrl.body"></p></div></div>'}},3365(){},3378(e,t,r){"use strict";!function(e,t){var r={label:"MENU",duplicate:!0,duration:200,easingOpen:"swing",easingClose:"swing",closedSymbol:"&#9658;",openedSymbol:"&#9660;",prependTo:"body",parentTag:"a",closeOnClick:!1,allowParentLinks:!1,nestedParentLinks:!0,showChildren:!1,init:function(){},open:function(){},close:function(){}},n="slicknav",o="slicknav";function a(t,o){this.element=t,this.settings=e.extend({},r,o),this._defaults=r,this._name=n,this.init()}a.prototype.init=function(){var r,n,a=this,i=e(this.element),s=this.settings;s.duplicate?(a.mobileNav=i.clone(),a.mobileNav.removeAttr("id"),a.mobileNav.find("*").each(function(t,r){e(r).removeAttr("id")})):a.mobileNav=i,r=o+"_icon",""===s.label&&(r+=" "+o+"_no-text"),"a"==s.parentTag&&(s.parentTag='a href="#"'),a.mobileNav.attr("class",o+"_nav"),n=e('<div class="'+o+'_menu"></div>'),a.btn=e(["<"+s.parentTag+' aria-haspopup="true" tabindex="0" class="'+o+"_btn "+o+'_collapsed">','<span class="'+o+'_menutxt">'+s.label+"</span>",'<span class="'+r+'">','<span class="'+o+'_icon-bar"></span>','<span class="'+o+'_icon-bar"></span>','<span class="'+o+'_icon-bar"></span>',"</span>","</"+s.parentTag+">"].join("")),e(n).append(a.btn),e(s.prependTo).prepend(n),n.append(a.mobileNav);var l=a.mobileNav.find("li");e(l).each(function(){var t=e(this),r={};if(r.children=t.children("ul").attr("role","menu"),t.data("menu",r),r.children.length>0){var n=t.contents(),i=!1;nodes=[],e(n).each(function(){if(e(this).is("ul"))return!1;nodes.push(this),e(this).is("a")&&(i=!0)});var l=e("<"+s.parentTag+' role="menuitem" aria-haspopup="true" tabindex="-1" class="'+o+'_item"/>');s.allowParentLinks&&!s.nestedParentLinks&&i?e(nodes).wrapAll('<span class="'+o+"_parent-link "+o+'_row"/>').parent():e(nodes).wrapAll(l).parent().addClass(o+"_row"),t.addClass(o+"_collapsed"),t.addClass(o+"_parent");var u=e('<span class="'+o+'_arrow">'+s.closedSymbol+"</span>");s.allowParentLinks&&!s.nestedParentLinks&&i&&(u=u.wrap(l).parent()),e(nodes).last().after(u)}else 0===t.children().length&&t.addClass(o+"_txtnode");t.children("a").attr("role","menuitem").click(function(t){s.closeOnClick&&!e(t.target).parent().closest("li").hasClass(o+"_parent")&&e(a.btn).click()}),s.closeOnClick&&s.allowParentLinks&&(t.children("a").children("a").click(function(t){e(a.btn).click()}),t.find("."+o+"_parent-link a:not(."+o+"_item)").click(function(t){e(a.btn).click()}))}),e(l).each(function(){var t=e(this).data("menu");s.showChildren||a._visibilityToggle(t.children,null,!1,null,!0)}),a._visibilityToggle(a.mobileNav,null,!1,"init",!0),a.mobileNav.attr("role","menu"),e(t).mousedown(function(){a._outlines(!1)}),e(t).keyup(function(){a._outlines(!0)}),e(a.btn).click(function(e){e.preventDefault(),a._menuToggle()}),a.mobileNav.on("click","."+o+"_item",function(t){t.preventDefault(),a._itemClick(e(this))}),e(a.btn).keydown(function(e){13==(e||event).keyCode&&(e.preventDefault(),a._menuToggle())}
2),a.mobileNav.on("keydown","."+o+"_item",function(t){13==(t||event).keyCode&&(t.preventDefault(),a._itemClick(e(t.target)))}),s.allowParentLinks&&s.nestedParentLinks&&e("."+o+"_item a").click(function(e){e.stopImmediatePropagation()})},a.prototype._menuToggle=function(e){var t=this,r=t.btn,n=t.mobileNav;r.hasClass(o+"_collapsed")?(r.removeClass(o+"_collapsed"),r.addClass(o+"_open")):(r.removeClass(o+"_open"),r.addClass(o+"_collapsed")),r.addClass(o+"_animating"),t._visibilityToggle(n,r.parent(),!0,r)},a.prototype._itemClick=function(e){var t=this,r=t.settings,n=e.data("menu");n||((n={}).arrow=e.children("."+o+"_arrow"),n.ul=e.next("ul"),n.parent=e.parent(),n.parent.hasClass(o+"_parent-link")&&(n.parent=e.parent().parent(),n.ul=e.parent().next("ul")),e.data("menu",n)),n.parent.hasClass(o+"_collapsed")?(n.arrow.html(r.openedSymbol),n.parent.removeClass(o+"_collapsed"),n.parent.addClass(o+"_open"),n.parent.addClass(o+"_animating"),t._visibilityToggle(n.ul,n.parent,!0,e)):(n.arrow.html(r.closedSymbol),n.parent.addClass(o+"_collapsed"),n.parent.removeClass(o+"_open"),n.parent.addClass(o+"_animating"),t._visibilityToggle(n.ul,n.parent,!0,e))},a.prototype._visibilityToggle=function(t,r,n,a,i){var s=this,l=s.settings,u=s._getActionItems(t),
2c=0;n&&(c=l.duration),t.hasClass(o+"_hidden")?(t.removeClass(o+"_hidden"),t.slideDown(c,l.easingOpen,function(){e(a).removeClass(o+"_animating"),e(r).removeClass(o+"_animating"),i||l.open(a)}),t.attr("aria-hidden","false"),u.attr("tabindex","0"),s._setVisAttr(t,!1)):(t.addClass(o+"_hidden"),t.slideUp(c,this.settings.easingClose,function(){t.attr("aria-hidden","true"),u.attr("tabindex","-1"),s._setVisAttr(t,!0),t.hide(),e(a).removeClass(o+"_animating"),e(r).removeClass(o+"_animating"),i?"init"==a&&l.init():l.close(a)}))},a.prototype._setVisAttr=function(t,r){var n=this,a=t.children("li").children("ul").not("."+o+"_hidden");r?a.each(function(){var t=e(this);t.attr("aria-hidden","true"),n._getActionItems(t).attr("tabindex","-1"),n._setVisAttr(t,r)}):a.each(function(){var t=e(this);t.attr("aria-hidden","false"),n._getActionItems(t).attr("tabindex","0"),n._setVisAttr(t,r)})},a.prototype._getActionItems=function(e){var t=e.data("menu");if(!t){t={};var r=e.children("li"),n=r.find("a");t.links=n.add(r.find("."+o+"_item")),e.data("menu",t)}return t.links},a.prototype._outlines=function(t){t?e("."+o+"_item, ."+o+"_btn").css("outline",""):e("."+o+"_item, ."+o+"_btn").css("outline","none")},a.prototype.toggle=function(){this._menuToggle()},a.prototype.open=function(){this.btn.hasClass(o+"_collapsed")&&this._menuToggle()},a.prototype.close=function(){this.btn.hasClass(o+"_open")&&this._menuToggle()},e.fn[n]=function(t){var r,o=arguments;return void 0===t||"object"==typeof t?this.each(function(){e.data(this,"plugin_"+n)||e.data(this,"plugin_"+n,new a(this,t))}):"string"==typeof t&&"_"!==t[0]&&"init"!==t?(this.each(function(){var i=e.data(this,"plugin_"+n);i instanceof a&&"function"==typeof i[t]&&(r=i[t].apply(i,Array.prototype.slice.call(o,1)))}),void 0!==r?r:this):void 0}}(r(6999),document,window)},3517(e,t,r){var n,o=r(6999),a=r(1396),i=r(7474);n=[],angular.module("penzuApp").factory("HttpRequestInterceptor",["$q","$injector","$global",function(e,t,r){var s,l,u;return s=null,u=function(e){return t.get("$timeout")(function(){return console.error("Response error retry: ",e.retries),t.get("$http")(e)},2e3*(e.retries||1))},l=function(){if(console.log("Online? ",navigator.onLine),navigator.onLine)return o.get("/favicon.ico").then(function(e,t,r){return console.log("Fetched Penzu favicon. Status: ",r.status)},function(e){return console.log("Could not fetch Penzu favicon. Status: ",e.status)}),o.get("https://d3c2plo0qyv3hc.cloudfront.net/favicon.ico").then(function(e,t,r){return console.log("Fetched Cloudfront Penzu favicon. Status: ",r.status)},function(e){return console.log("Could not fetch Cloudfront Penzu favicon. Status: ",e.status)})},{request:function(e){var l,u,c,d,p,h,m,g,f,v,y,b;return s=s||t.get("Auth"),g=e.oauthSessionHeaders||s.getSessionHeaders(),delete e.oauthSessionHeaders,v=(u=r.isLegacyUrl(e.url))?"HMAC-SHA1":"HMAC-SHA256",f=u?a.HmacSHA1:a.HmacSHA256,g?(p={consumer:{key:g.clientKey,secret:g.clientSecret},signature_method:v,hash_function:function(e,t){return a.enc.Base64.stringify(f(e,t))}},c=i(p),b=e.url,h=_(e.params).omitBy(_.isUndefined).omitBy(_.isNull).value(),_.isEmpty(h)||(b+="?"+o.param(h)),m={url:b,method:e.method},y={key:g.token,secret:g.tokenSecret},l=c.authorize(m,y),n.indexOf(l.oauth_nonce)>-1&&console.error("That nonce has been used!"),n.push(l.oauth_nonce),d=c.toHeader(l),e.headers=_.extend(e.headers,d)):(console.log("No session headers present. Skipped Oauth."),console.log("Authed? "+s.isAuthed()+" , Expired Token? "+s.isTokenExpired())),e},response:function(t,r){var n,o,a;return null==t&&(t={}),n=e.defer(),(null!=(o=t.data)&&null!=(a=o.error)?a.message:void 0)?n.reject(t):n.resolve(t),n.promise},responseError:function(r){var n,o,a,i,c,d,p,h;return(null!=(c=r.config)?c.skipGlobalErrorHandling:void 0)?e.reject(r):(n=n||t.get("$state"),o=o||t.get("$track"),(a=r.config).retries||(a.retries=0),console.log("Response error: ",JSON.stringify(r,null,2)),(r.status<=0||r.status>=500||!r.status)&&r.config.retries<3?(r.config.retries+=1,l(),console.log("Start timeout for retry ",r.config.retries),u(r.config)):(401===r.
2status?(s=t.get("Auth"),console.log("Received 401 response."),s.getCurrentSession()&&console.log("User token: ",JSON.stringify(s.getCurrentSession().access_token,null,2)),console.log("User is authed?",s.isAuthed()),console.log("User token expired?",s.isTokenExpired()),console.log("Redirect to login page."),s.logout({trackParams:{status:"401",message:"unauthed"}}).then(function(){var e;return e=window.location.origin+"/app/login?message=unauthed&status=401",console.log("Redirect to: ",e),window.location=e})):404===r.status&&(h="/error/404",(null!=(d=r.data)&&null!=(p=d.error)?p.message:void 0)&&(h+="?message="+r.data.error.message),i=""+window.location.origin+h,console.log("Redirect to: ",i),window.location=i),r.config.retries>=3&&o.log("Fatal response error (3 retries)",{endpoint:r.config.endpoint||r.config.url}),e.reject(r)))}}}])},3980(e,t,r){"use strict";r.r(t)},4265(){"use strict";(function(){var requirejs,require,define,__inflate;(function(e){function t(e,t){var r,n,o,a,i,s,l,u=t&&t.split("/"),c=d.map,p=c&&c["*"]||{};if(e&&"."===e.charAt(0)&&t){for(e=(u=u.slice(0,u.length-1)).concat(e.split("/")),i=0;l=e[i];i++)if("."===l)e.splice(i,1),i-=1;else if(".."===l){if(1===i&&(".."===e[2]||".."===e[0]))return!0;i>0&&(e.splice(i-1,2),i-=2)}e=e.join("/")}if((u||p)&&c)for(i=(r=e.split("/")).length;i>0;i-=1){if(n=r.slice(0,i).join("/"),u)for(s=u.length;s>0;s-=1)if((o=c[u.slice(0,s).join("/")])&&(o=o[n])){a=o;break}if(a=a||p[n]){r.splice(0,i,a),e=r.join("/");break}}return e}function r(t,r){return function(){return l.apply(e,h.call(arguments,0).concat([t,r]))}}function n(e){return function(t){u[e]=t}}function o(t){if(c.hasOwnProperty(t)){var r=c[t];delete c[t],p[t]=!0,s.apply(e,r)}if(!u.hasOwnProperty(t))throw new Error("No "+t);return u[t]}function a(e,r){var n,a,i=e.indexOf("!");return-1!==i?(n=t(e.slice(0,i),r),e=e.slice(i+1),e=(a=o(n))&&a.normalize?a.normalize(e,function(e){return function(r){return t(r,e)}}(r)):t(e,r)):e=t(e,r),{f:n?n+"!"+e:e,n:e,p:a}}function i(e){return function(){return d&&d.config&&d.config[e]||{}}}var s,l,u={},c={},d={},p={},h=[].slice;s=function(t,s,l,d){var h,m,g,f,v,_,y=[];if(d=d||t,"string"==typeof l&&(l=__inflate(t,l)),"function"==typeof l){for(s=!s.length&&l.length?["require","exports","module"]:s,_=0;_<s.length;_++)if("require"===(g=(v=a(s[_],d)).f))y[_]=r(t);else if("exports"===g)y[_]=u[t]={},h=!0;else if("module"===g)m=y[_]={id:t,uri:"",exports:u[t],config:i(t)};else if(u.hasOwnProperty(g)||c.hasOwnProperty(g))y[_]=o(g);else if(v.p)v.p.load(v.n,r(d,!0),n(g),{}),y[_]=u[g];else if(!p[g])throw new Error(t+" missing "+g);f=l.apply(u[t],y),t&&(m&&m.exports!==e&&m.exports!==u[t]?u[t]=m.exports:f===e&&h||(u[t]=f))}else t&&(u[t]=l)},requirejs=require=l=function(t,r,n,i){return"string"==typeof t?o(a(t,r).f):(t.splice||(d=t,r.splice?(t=r,r=n,n=null):t=e),r=r||function(){},i?s(e,t,r,n):setTimeout(function(){s(e,t,r,n)},15),l)},l.config=function(e){return d=e,l},define=function(e,t,r){t.splice||(r=t,t=[]),c[e]=[e,t,r]},define.amd={jQuery:!0}})(),__inflate=function(name,src){var r;return eval(["r = function(a,b,c){","\n};\n//@ sourceURL="+name+"\n"].join(src)),r},define("lib/api/events",["require","exports","module"],function(e,t,r){t.api={LOAD_PROGRESS:"loadProgress",PLAY_PROGRESS:"playProgress",PLAY:"play",PAUSE:"pause",FINISH:"finish",SEEK:"seek",READY:"ready",OPEN_SHARE_PANEL:"sharePanelOpened",CLICK_DOWNLOAD:"downloadClicked",CLICK_BUY:"buyClicked",ERROR:"error"},t.bridge={REMOVE_LISTENER:"removeEventListener",ADD_LISTENER:"addEventListener"}}),define("lib/api/getters",["require","exports","module"],function(e,t,r){r.exports={GET_VOLUME:"getVolume",GET_DURATION:"getDuration",GET_POSITION:"getPosition",GET_SOUNDS:"getSounds",GET_CURRENT_SOUND:"getCurrentSound",GET_CURRENT_SOUND_INDEX:"getCurrentSoundIndex",IS_PAUSED:"isPaused"}}),define("lib/api/setters",["require","exports","module"],function(e,t,r){r.exports={PLAY:"play",PAUSE:"pause",TOGGLE:"toggle",SEEK_TO:"seekTo",SET_VOLUME:"setVolume",NEXT:"next",PREV:"prev",SKIP:"skip"}}),define("lib/api/api",["require","exports","module","lib/api/events","lib/api/getters","lib/api/setters"],function(e,t,r){function n(e){var t,r=!1;for(t in k)if(k.hasOwnProperty(t)&&k[t]===e){r=!0;break}return r}function o(e){var t,r;for(t=0,r=T.length;t<r&&!1!==e(T[t]);t++);}function a(e){return e.contentWindow?e.contentWindow:e.contentDocument&&"parentWindow"in e.contentDocument?e.contentDocument.parentWindow:null}function i(e){var t,r=[];for(t in e)e.hasOwnProperty(t)&&r.push(e[t]);return r}function s(e,t,r){r.callbacks[e]=r.callbacks[e]||[],r.callbacks[e].push(t)}function l(e,t){var r=!0;return t.callbacks[e]=[],o(function(t){if((t.callbacks[e]||[]).length)return r=!1,!1}),r}function u(e,t,r){var n,o,i=a(r);if(!i.postMessage)return!1;n=r.getAttribute("src").split("?")[0],o=JSON.stringify({method:e,value:t}),"//"===n.substr(0,2)&&(n=window.location.protocol+n),n=n.replace(/http:\/\/(w|wt).soundcloud.com/,"https://$1.soundcloud.com"),i.postMessage(o,n)}function c(e){var t;return o(function(r){if(r.instance===e)return t=r,!1}),t}function d(e){var t;return o(function(r){if(a(r.element)===e)return t=r,!1}),t}function p(e,t){return function(r){var n=function(e){return!!(e&&e.constructor&&e.call&&e.apply)}(r),o=c(this),a=!n&&t?r:null,i=n&&!t?r:null;return i&&s(e,i,o),u(e,a,o.element),this}}function h(e,t,r){var n,o,a;for(n=0,o=t.length;n<o;n++)e[a=t[n]]=p(a,r)}function m(e,t,r){return e+"?url="+t+"&"+function(e){var t,r,n=[];for(t in e)e.hasOwnProperty(t)&&(r=e[t],n.push(t+"="+("start_track"===t?parseInt(r,10):r?"true":"false")));return n.join("&")}(r)}function g(e,t,r){var o,a,i=e.callbacks[t]||[];for(o=0,a=i.length;o<a;o++)i[o].apply(e.instance,r);(n(t)||t===O.READY)&&(e.callbacks[t]=[])}function f(e){var t,r,n,o,a;try{r=JSON.parse(e.data)}catch(e){return!1}
2return t=d(e.source),n=r.method,o=r.value,(!t||v(e.origin)===v(t.domain))&&(t?(n===O.READY&&(t.isReady=!0,g(t,S),l(S,t)),n===O.PLAY&&!t.playEventFired&&(t.playEventFired=!0),n===O.PLAY_PROGRESS&&!t.playEventFired&&(t.playEventFired=!0,g(t,O.PLAY,[o])),a=[],void 0!==o&&a.push(o),void g(t,n,a)):(n===O.READY&&A.push(e.source),!1))}function v(e){return e.replace(E,"")}var _,y,b,w=e("lib/api/events"),k=e("lib/api/getters"),P=e("lib/api/setters"),O=w.api,j=w.bridge,A=[],T=[],S="__LATE_BINDING__",E=/^http(?:s?)/;window.addEventListener?window.addEventListener("message",f,!1):window.attachEvent("onmessage",f),r.exports=b=function(e,t,r){if(function(e){return!!(""===e||e&&e.charCodeAt&&e.substr)}(e)&&(e=document.getElementById(e)),!function(e){return!!e&&1===e.nodeType&&"IFRAME"===e.nodeName.toUpperCase()}(e))throw new Error("SC.Widget function should be given either iframe element or a string specifying id attribute of iframe element.");t&&(r=r||{},e.src=m("http://wt.soundcloud.dev:9200/",t,r));var n,o,i=d(a(e));return i&&i.instance?i.instance:(n=A.indexOf(a(e))>-1,o=new _(e),T.push(new y(o,e,n)),o)},b.Events=O,window.SC=window.SC||{},window.SC.Widget=b,y=function(e,t,r){this.instance=e,this.element=t,this.domain=function(e){var t,r,n,o="";for("//"===e.substr(0,2)&&(e=window.location.protocol+e),t=0,r=(n=e.split("/")).length;t<r&&t<3;t++)o+=n[t],t<2&&(o+="/");return o}(t.getAttribute("src")),this.isReady=!!r,this.callbacks={}},(_=function(){}).prototype={constructor:_,load:function(e,t){if(e){t=t||{};var r=this,n=c(this),o=n.element,a=o.src,i=a.substr(0,a.indexOf("?"));n.isReady=!1,n.playEventFired=!1,o.onload=function(){r.bind(O.READY,function(){var e,r=n.callbacks;for(e in r)r.hasOwnProperty(e)&&e!==O.READY&&u(j.ADD_LISTENER,e,n.element);t.callback&&t.callback()})},o.src=m(i,e,t)}},bind:function(e,t){var r=this,n=c(this);return n&&n.element&&(e===O.READY&&n.isReady?setTimeout(t,1):n.isReady?(s(e,t,n),u(j.ADD_LISTENER,e,n.element)):s(S,function(){r.bind(e,t)},n)),this},unbind:function(e){var t,r=c(this);r&&r.element&&(t=l(e,r),e!==O.READY&&t&&u(j.REMOVE_LISTENER,e,r.element))}},h(_.prototype,i(k)),h(_.prototype,i(P),!0)}),window.SC=window.SC||{},window.SC.Widget=require("lib/api/api")})()},4446(e,t,r){r(7766),e.exports=function(e){return""+'<div class="unsubscribe__wrap"><div class="pz-card unsubscribe__main" ng-hide="activeTab == \'confirmation\'"><div class="loader" ng-show="ui.loading"><div class="loader-tab" loader="ui.loading"></div></div><h2>Unsubscribe from Sponsored Emails</h2><p class="p-large">Click the button below to confirm that you’d like Penzu to stop sending<span ng-if="model.email &amp;&amp; currParams.email">emails to<strong>{{model.email}}.</strong></span><span ng-if="!model.email || !currParams.email">these emails.</span></p><form class="unsubscribe__form form-default" ng-show="!currParams.email"><div class="form-group"><div class="form-controls" ng-class="{\'invalid\': errors.email}"><label for="email">Email address</label><input class="form-control" type="text" name="email" ng-model="model.email"></div></div></form><div class="unsubscribe__action"><button class="btn btn-primary btn-wide" type="button" ng-click="unsubscribe(\'sponsored\')">Unsubscribe Now</button></div></div><div class="pz-card unsubscribe__confirmation" ng-show="activeTab == \'confirmation\'"><span class="icon fa fa-check-circle"></span><h2>Success!</h2><p>You haven been permanently unsubscribed from this email list.</p><div class="unsubscribe__action"><a class="btn btn-primary btn-wide" href="/" target="_self">Navigate Home</a></div></div></div>'}},4447(e,t,r){"use strict";r(3980),r(8153),r(9244),r(497),r(8140),r(4265),r(3378),r(5807),r(8e3),r(5594),r(2701),r(590),r(2309),r(5476),r(7958),r(3517),r(1950),r(6869),r(4558),r(8058),r(6687),r(6069),r(8349),r(9604),r(7100),r(791),r(2297),r(4943),r(9434),r(8505),r(1558),r(1405),r(7782),r(7505),r(8453),r(9141),r(4728),r(8187),r(1727),r(2437)},4558(e,t,r){"use strict";var n,o;o=r(2958),n=function(){function e(e,t){var r;this.$USE_WHITELIST=!1,this.$EVENT_WHITELIST=["Signup Complete","Pro Payment Complete","Checkout Begin","Signup Begin","Pro Form View Payment","Downgrade Account","Themes Modal Open","Themes Modal Select","Init Web Session","Init Web User Session","Select Prompt Browser Prompt","Public Entry Signup Click","Show Entry Tagging","Open Export Modal","View PDF Link Download Page","Generate PDF Request","Landing Page Hit","All Entries Search","Update Entry Page Theme","Update Entry Pad Theme","Star Entry","Open Time Capsule","Created Time Capsule","Print Entry","Toggle Rich Formatting","Open Insert Image Modal","Change Entry Date","Open Zen Mode","Journal Modal Show Covers","Journal Modal Select Font","Journal Modal Select Font Size","Journal Modal Select Cover","Click Add New Reminder","Get Journal Word Count","Create Reminder","Open Tags Modal"],this.$rootScope=e,this.$state=t,this.experimentSuperProperties={},this.activeCheckout=null,this.signupOpening=null,this.routeCheckoutOpening=null,o.acquisitionContext(),e.$on("$stateChangeSuccess",(r=this,function(){return r.signupOpening=null,r.routeCheckoutOpening=null})),e.$on("$track:log",function(e){return function(t,r,n){return e.log(r,n)}}(this)),e.$on("$track:setUser",function(e){return function(t,r,n){return e.setUser(r,n)}}(this)),e.$on("$track:alias",function(e){return function(t,r){return e.alias(r)}
2}(this)),e.$on("$track:payment",function(e){return function(t,r){return e.payment(r)}}(this))}return e.prototype.log=function(e,t){var r,n,a,i,s;if(null==t&&(t={}),console.log("MIXPANEL -- log event :::::   "+e+"   ::: ",t),void 0===e)return!1;if(this.$USE_WHITELIST&&-1===this.$EVENT_WHITELIST.indexOf(e))return!1;if(void 0!==window.mixpanel)try{r={$time:new Date,source_path:(null!=(i=this.$state.current)?i.url:void 0)||void 0,state_name:this.$state.current.name,referrer:this.sanitizedReferrer(),online:navigator.onLine,source:"penzu-legacy"},a=_.extend({},o.acquisitionContext(),t,{client_flow:"legacy-frontend"}),window.mixpanel.track(e,_.defaults(a,r))}catch(t){(null!=(s=window.mixpanel)?s.__loaded:void 0)&&console.error("Could not track window.mixpanel event :::  "+e+" ")}if(void 0!==window.dataLayer)try{if("Signup Complete"===e)return n=_.defaults({event:e},_.clone(t)),window.dataLayer.push(n);if("Pro Payment Complete"===e)return this.gaPurchase(_.clone(t))}catch(t){return console.error("Could not track GA4 event :::  "+e+" ")}},e.prototype.resetUser=function(){var e,t,r;try{null!=(e=window.mixpanel)&&e.reset(),null!=(t=window.mixpanel)&&t.register(this.experimentSuperProperties),null!=(r=window.dataLayer)&&r.push({user_id:null})}catch(e){}return o.clearAcquisitionContext()},e.prototype.newOpening=function(e){var t;return null==e&&(e={}),(t=o.createFunnelOpening()).dimensions=e,t},e.prototype.begin=function(e,t,r){return null==r&&(r={}),o.emitFunnelStart({trackEvent:(n=this,function(e,t){return n.log(e,t)})},t,e,_.extend({},t.dimensions,r));var n},e.prototype.watchCheckout=function(e,t,r,n){var o,a,i,s,l,u,c,d,p,h,m;return a=null,h=!1,(i=null!=(s=null!=(l=r.funnelOpening)?l:this.activeCheckout)?s:this.routeCheckoutOpening)||(i=this.newOpening({flow:"checkout",surface:"standalone",ui_origin:null!=(u=r.source)?u:null,plan_intent:null!=(c=r.tier)?c:null,plan_duration:null!=(d=null!=(p=r.selectedLevel)?p:r.level)?d:null,experiments:n}),this.routeCheckoutOpening=i),e.funnelOpening=i,m=this,o=function(){if(!h){if(!t.is(":visible"))return a=window.requestAnimationFrame(o);m.begin("Checkout Begin",i)}},a=window.requestAnimationFrame(o),e.$on("$destroy",function(){if(h=!0,null!=a)return window.cancelAnimationFrame(a)})},e.prototype.watchSignup=function(e,t,r,n){var o,a,i,s;return a=null,i=!1,s=this,o=function(){var l,u,c;if(!i){if(t.is(":visible")){for(u=e.$parent;u&&!u.funnelOpening;)u=u.$parent;return(l=r?null!=(c=null!=u?u.funnelOpening:void 0)?c:s.activeCheckout:s.signupOpening)||(l=s.newOpening({flow:r?"checkout":"signup",surface:t.closest(".modal, .modal-wrap").length?"modal":"standalone",plan_intent:r?null:"free"}),r||(s.signupOpening=l)),void s.begin("Signup Begin",l,{experiments:n})}return a=window.requestAnimationFrame(o)}},a=window.requestAnimationFrame(o),e.$on("$destroy",function(){if(i=!0,null!=a)return window.cancelAnimationFrame(a)})},e.prototype.sanitizedReferrer=function(){if(document.referrer)return this.sanitizeRecoveryUrl(document.referrer)},e.prototype.sanitizeRecoveryUrl=function(e){var t,r,n,o,a,i;try{for(i=new URL(e,window.location.origin),r=0,n=(a=["code","c","reset_code","forgot_password_code","confirmation_code"]).length;r<n;r++)o=a[r],i.searchParams.has(o)&&i.searchParams.set(o,"[FILTERED]");return i.href}catch(e){return t=e,void console.warn("Could not sanitize referrer URL",t)}},e.prototype.setUser=function(e,t){return null==t&&(t={}),void 0!==e&&(this.setGaUser(e),this.setMixpanelUser(e,t))},e.prototype.setMixpanelUser=function(e,t){var r,n,o,a,i,s,l;null==t&&(t={}),_.isEmpty(t)&&(t=null),console.log("MIXPANEL -- set user ::::: "+e+" ",t);try{return o=String(e),a=null!=(i=null!=(s=window.mixpanel.get_property("$user_id"))?s:window.mixpanel.get_property("penzu_user_id"))?i:window.mixpanel.get_property("__alias"),r=window.mixpanel.get_distinct_id(),/^\d+$/.test(r)&&null==a&&(a=r),null!=a&&String(a)!==o&&this.resetUser(),window.mixpanel.unregister("__alias"),window.mixpanel.identify(o),window.mixpanel.register({penzu_user_id:o}),setTimeout((l=this,function(){var e,r;try{return window.mixpanel.people.set(t),l.setSuperProperties(t)}catch(n){if(e=n,window.mixpanel.__loaded)return r=JSON.stringify(t),console.error("Could not set window.mixpanel person: ",e,r)}}),1e3)}catch(e){if(n=e,window.mixpanel.__loaded)return console.error("Mixpanel identify and setuser didn't work",n)}},e.prototype.setGaUser=function(e){if(void 0!==window.dataLayer)return console.log("GA4 -- set user ::::: "+e+" "),window.dataLayer.push({user_id:e})},e.prototype.setSuperProperties=function(e){var t,r;if(null==e&&(e={}),console.log("MIXPANEL -- set super props ::::: ",e),_.isEmpty(e))return!1;for(t in e)r=e[t],0===t.indexOf("ab_")&&(this.experimentSuperProperties[t]=r);try{return window.mixpanel.register(e)}catch(e){}},e.prototype.gaPurchase=function(e){var t,r,n,o,a,i,s,l;if(console.log("GA4 -- purchase event ::::: ",e),void 0!==window.dataLayer)try{return l=(null!=(i=e.userId)?i:"U")+"-"+window.crypto.randomUUID(),n=null!=(s=e.subscription_package)?s:e.plan,t=e.promo_code_discount||0,o={event:"Pro Payment Complete",ecommerce:{transaction_id:l,value:e.payment_total,tax:0,shipping:0,currency:"USD",items:[]}},a={item_id:n,item_name:e.subscription_package||e.plan,discount:t,index:0,item_brand:"Penzu",item_category:"Subscription",price:e.payment_total-t,quantity:e.subscription_length||1},null!=e.promo_code&&(o.ecommerce.coupon=e.promo_code,a.coupon=e.promo_code),o.ecommerce.items.push(a),console.log("GA4 -- sending purchase event ::::: ",JSON.stringify(o,null,2)),dataLayer.push(o)}catch(e){return r=e,console.error("GA4 -- Purchase confirmation failed",r)}},e.prototype.payment=function(e){null==e&&(e=0),console.log("MIXPANEL -- track payment ::::: ",e);try{return window.mixpanel.people.track_charge(e)}catch(e){}},e.prototype.alias=function(e){var t;if(console.log("MIXPANEL -- alias :::: "+e),!e)return!1;try{return this.setMixpanelUser(e)}catch(e){if(t=e,window.mixpanel.__loaded)return console.error("Mixpanel alias failed: ",t)}},e}(),angular.module("penzuApp").service("$track",["$rootScope","$state",n])},4728(e,t,r){"use strict";var n=r(6999);angular.module("penzuApp").factory("Auth",["$rootScope","$q","$http","$storage","$track","$mobile","$timeout","$error","$window",function(e,t,r,o,a,i,s,l,u){var c,d,p,h;return d="logout_generation",p=o.get(d)||null,h=function(e){var t,r;return null==e&&(e={}),r=null!=(t=e.status)?t:"unknown",a.log("Logout Revoke Failed",{status:r}),l.notify(new Error("Legacy logout revocation failed"),{status:r})},e.$on("session:destroy",function(e,t){return null==t&&(t={}),c.user=null,!1!==t.trackLogout&&(t.trackParams||(t.trackParams={}),a.log("Logout",t.trackParams)),a.resetUser()}),c={user:o.get("session")||null,login:function(r,o){var i,s,l,u,c,d;return null==o&&(o={}),i=this.beginAuthentication(),o=e.sanitizeOpts(o),s=t.defer(),u={email:r.email,password:r.password,turnstile:r.turnstile,client:"penzu_web"},l=function(e){var t,r,n;return null==e&&(e={}),-1===(null!=(r=e.error)&&null!=(n=r.message)?n.indexOf("Your email or password were incorrect"):void 0)&&(t=JSON.stringify(e),console.log("User Login fail data: ",t),console.error("User login failed.")),o.done(e),o.error(e),turnstile.reset(),s.reject(e)},d=this,c=function(t){var n,u,c;return null==t&&(t={}),o.done(t),t.error?l(t):(t.access_token.user.email=r.email,u=d.parseAccessToken(t),!1===d.setSession(u,!1,i)?(n=d.staleAuthenticationError(),turnstile.reset(),o.error(n),s.reject(n),!1):t.expired_pro?(a.log("Expired Pro Login"),l={expired_pro:!0},s.reject(l),o.error(l),!0):(e.$broadcast("session:init",u),c=angular.extend({},o.trackParams),a.log("Login",c),o.success(t),s.resolve(t)))},n.ajax({type:"POST",url:e.API_ROOT+"/api/sign_ins/login",dataType:"json",contentType:"application/json; charset=utf-8",data:JSON.stringify(u),success:c,error:l}),s.promise},logout:function(n){var a,i,l,u,c,p,m;return null==n&&(n={}),this.logoutPromise||(i=t.defer(),this.logoutPromise=i.promise,n.trackParams||(n.trackParams={}),p=this.getUserId(),c=this.getSessionHeaders(),e.$broadcast("session:beforeDestroy",n.trackParams),u=(new Date).getTime()+"-"+Math.random().toString(36).slice(2),o.set(d,u),l=s((m=this,function(){var o;return o=p&&c?r.delete(e.API_ROOT+"/api/sign_ins/"+p,{oauthSessionHeaders:c,skipGlobalErrorHandling:!0,timeout:3e3}):t.when(),m.clearLocalSession(n.trackParams),o.then(function(){return null},function(e){return null==e&&(e={}),h(e),null})}),1e3),a=function(e){return function(){return i.resolve(),e.logoutPromise=null}}(this),l.then(a,a)),this.logoutPromise},logoutPromise:null,clearLocalSession:function(t,r){return null==t&&(t={}),null==r&&(r=!0),this.user=null,e.$broadcast("session:destroy",{trackLogout:r,trackParams:t}),o.clear("session"),o.clear("unload_time")},handleCrossTabLogout:function(){if(this.isAuthed())return this.clearLocalSession({status:"200",message:"cross-tab"},!1),s(function(){return u.location.href="/app/login"})},register:function(n,o){var i,s,l,u,c,d,p;return null==o&&(o={}),i=this.beginAuthentication(),o=e.sanitizeOpts(o),s=t.defer(),u={first_name:n.firstName,last_name:n.lastName,email:n.email,password:n.password,retype_password:n.password,receive_marketing_emails:n.receive_marketing_emails,turnstile:n.turnstile,client:"penzu_web"},(c=r.post(e.API_ROOT+"/api/sign_ins/signup",u)).success(function(e){return d(e)}),c.error(function(e,t){return l(e,t)}),p=this,d=function(t){var r,l,u,c,d,h;if(o.done(),null!=t&&null!=(l=t.error)?l.message:void 0)return o.error(t),s.reject(t),!1;
2if(_.isObject(t)){if(a.alias(t.access_token.user_id),t.access_token.user.email=n.email,d=p.parseAccessToken(t),!1===p.setSession(d,!1,i))return c=p.staleAuthenticationError(),o.error(c),s.reject(c),!1;e.$broadcast("session:init",d),h={source:null!=(u=o.source)?u:"penzu-legacy"},a.log("Signup Complete",h)}else r=JSON.stringify(t),console.error("Register did not work :::",r),e.$broadcast("$error:log","Register did not work ::: "+r);return o.success(d),s.resolve(d)},l=function(e,t){return o.done(e),o.error(e,t),s.reject(e,t)},s.promise},refreshToken:function(){var n,o;return this.refreshTokenPromise?this.refreshTokenPromise:(n=t.defer(),r.post(e.API_ROOT+"/api/user/refresh_token").then((o=this,function(e){var t;return null==e&&(e={}),console.log("Refreshed token: ",e),(null!=(t=e.data)?t.error:void 0)?(n.reject(e.error),!1):(o.setSession({access_token:e.data.access_token},!0),console.log("set new session: ",o.getCurrentSession()),n.resolve(e.data),o.refreshTokenPromise=null)}),function(e){return function(t){return null==t&&(t={}),console.log("Refresh token error: ",JSON.stringify(t,null,2)),console.error("Refresh token error."),n.reject(t.data),e.refreshTokenPromise=null}}(this)),this.refreshTokenPromise=n.promise,n.promise)},refreshTokenPromise:null,forgotPassword:function(n){var o,a,i,s;return o=t.defer(),i={email:n.email,turnstile:n.turnstile},a=function(e){var t,r,n;if(null==e&&(e={}),!((null!=(t=e.data)&&null!=(r=t.error)&&null!=(n=r.message)?n.indexOf("no account was found with that email address"):void 0)>-1))return console.log("Forgot password error: ",JSON.stringify(e,null,2)),console.error("Forgot password error"),o.reject(e.data);o.reject(e.data)},s=function(e){var t;return null==e&&(e={}),(null!=(t=e.data)?t.error:void 0)?(a(e),!1):(console.log("Forgot password success: ",e),o.resolve(e.data))},r.post(e.API_ROOT+"/api/account/forgot_password",i).then(s,a),o.promise},forgotPasswordConfirm:function(n){var o,s,l,u,c,d;return o=this.beginAuthentication(),s=t.defer(),n.code?(u={email:n.email,code:n.code,password:n.password,retype_password:n.passwordConfirm},l=function(e){return null==e&&(e={}),console.log("Forgot password confirmation error status: ",e.status),console.error("Forgot password confirmation error"),s.reject(e.data)},d=this,c=function(t){var r,u,c,p;return null==t&&(t={}),(null!=(r=t.data)?r.error:void 0)?(l(t),!1):(console.log("Forgot password confirmation success"),i.isMobileOrTablet()?(s.resolve(t.data),!0):(null!=(u=t.data)&&(u.access_token.user.email=n.email),p=d.parseAccessToken(t.data),!1===d.setSession(p,!1,o)?(c=d.staleAuthenticationError(),s.reject(c),!1):t.data.expired_pro?(a.log("Expired Pro Login"),l({expired_pro:!0}),!0):(e.$broadcast("session:init",p),s.resolve(t.data))))},r.post(e.API_ROOT+"/api/account/reset_password",u).then(c,l),s.promise):(console.error("Forgot password confirmation error: missing code"),s.reject({error:{message:"That reset link is invalid. Please request a new password reset email."}}),s.promise)},requestLoginLink:function(n){var o,a,i,s;return o=t.defer(),i={email:n.email,turnstile:n.turnstile},a=function(e){var t,r,n;if(null==e&&(e={}),!((null!=(t=e.data)&&null!=(r=t.error)&&null!=(n=r.message)?n.indexOf("no account was found with that email address"):void 0)>-1))return console.log("Request login link error: ",JSON.stringify(e,null,2)),console.error("Request login link error"),turnstile.reset(),o.reject(e.data);o.reject(e.data)},s=function(e){var t;return null==e&&(e={}),(null!=(t=e.data)?t.error:void 0)?(a(e),!1):(console.log("Request login link success: ",e),o.resolve(e.data))},r.post(e.API_ROOT+"/api/accounts/request_login_link",i).then(s,a),o.promise},validateLoginLink:function(n,o){var s,l,u,c,d;return s=this.beginAuthentication(),l=t.defer(),o?(u=function(e){return null==e&&(e={}),console.log("Validate login link error status: ",e.status),console.error("Validate login link error"),l.reject(e.data)},d=this,c=function(t){var r,n,o;return null==t&&(t={}),(null!=(r=t.data)?r.error:void 0)?(console.log("Validate login link response error"),u(t),!1):i.isMobileOrTablet()?(l.resolve(t.data),!0):(o=d.parseAccessToken(t.data),!1===d.setSession(o,!1,s)?(n=d.staleAuthenticationError(),l.reject(n),!1):t.data.expired_pro?(a.log("Expired Pro Login"),u({expired_pro:!0}),!0):(e.$broadcast("session:init",o),l.resolve(t.data)))},r.post(e.API_ROOT+"/api/sign_ins/"+n+"/magic_link",{c:o}).then(c,u),l.promise):(console.error("Validate login link error: missing code"),l.reject({error:{message:"That link is invali
2d."}}),l.promise)},downgrade:function(n){var o,i,s,l;return null==n&&(n={}),o=t.defer(),l={tier:null},i={client:"penzu_web"},n.options&&(l.downgrade_options=i.downgrade_options=n.options),n.comments&&(l.downgrade_comments=i.downgrade_comments=n.comments),this.isAuthed()?!1===n.free?(s=r.post(e.API_ROOT+"/api/user/plus_to_pro_downgrade",i),l.tier="pro"):(s=r.post(e.API_ROOT+"/api/user/downgrade",i),l.tier="free"):(i=angular.extend(i,{email:n.user.email,password:n.user.password}),s=r.post(e.API_ROOT+"/api/user/downgrade_logged_out",i),l.tier="loggedOut"),s.success(function(e){return console.log("Downgrade account success: ",e),_.isObject(e.error)?o.reject(e.error):(a.log("Downgrade Account",l),o.resolve(e))}),s.error(function(e,t){return console.log("Downgrade erorr: ",e),console.error("Downgrade error"),o.reject(e,t)}),o.promise},initSession:function(e){return this.user?e(this.user):this.login({},{success:function(t){return e(t)}}),this.setSessionClasses()},getCurrentSession:function(){return this.user||null},reloadSession:function(e){var t;return arguments.length<1&&(e=p),(t=o.get(d)||null)!==e?(this.user=null,o.clear("session"),this.setSessionClasses(),console.warn("Skipped stale session reload after logout."),null):(p=t,this.user=o.get("session")||null,this.setSessionClasses(),this.user)},getSessionHeaders:function(){return!(!this.user||!this.user.access_token)&&{token:this.user.access_token.token,tokenSecret:this.user.access_token.secret,clientKey:this.user.access_token.client_application.key,clientSecret:this.user.access_token.client_application.secret}},beginAuthentication:function(){return o.get(d)||null},staleAuthenticationError:function(e){return null==e&&(e="You were signed out in another tab. Please sign in again."),{code:"stale_logout_generation",error:{message:e}}},setSession:function(e,t,r){var n;return null==t&&(t=!1),arguments.length<3&&(r=p),(n=o.get(d)||null)!==r?(console.warn("Skipped stale session write after logout."),!1):(p=n,this.user=t?_.extend(this.user,e):e,this.setSessionClasses(),"cookies"===o.set("session",this.user).type&&console.error("Had to set session in cookies."),!0)},setSessionClasses:function(){var e;return(e=n("body")).removeClass("__free-user __pro-user"),this.isPro()?e.addClass("__pro-user"):e.addClass("__free-user")},parseAccessToken:function(e){return e.access_token.created_at=moment().format(),e},isAuthed:function(){return!(!this.user||this.user&&!this.user.access_token||this.user&&!this.user.access_token.user_id
2)},isCurrentAuthed:function(){return this.isAuthed()&&!this.isTokenExpired()},isPro:function(){return!(!this.user||this.user&&!this.user.access_token)&&this.user.access_token.user.is_pro&&!this.user.access_token.user.is_pro_plus},isProPlus:function(){return!(!this.user||this.user&&!this.user.access_token)&&this.user.access_token.user.is_pro_plus},isLifetime:function(){return!(!this.user||this.user&&!this.user.access_token||this.user.access_token&&!this.user.access_token.user.pro_membership)&&"ProPlusLifetime"===this.user.access_token.user.pro_membership.package_name},isPaid:function(){return!(!this.user||this.user&&!this.user.access_token)&&(this.user.access_token.user.is_pro_plus||this.user.access_token.user.is_pro)},isMonthly:function(){var e;return!(!this.user||this.user&&!this.user.access_token)&&"StandardMonthly"===(null!=(e=this.user.access_token.user.pro_membership)?e.package_name:void 0)},isExpiredPro:function(){var e;return!0===(null!=(e=this.user)?e.expired_pro:void 0)},getPlan:function(){return!0},getTier:function(){var e;return!(!this.user||this.user&&!this.user.access_token)&&(e="free",this.user.access_token.user.is_pro_plus?e="plus":this.user.access_token.user.is_pro&&(e="pro"),e)},hasMobile:function(){return!(!this.user||this.user&&!this.user.access_token)&&this.user.access_token.user.has_mobile},firstName:function(){return!this.user||this.user&&!this.user.access_token?"":this.user.access_token.user.first_name},getUser:function(){return this.user||null},getUserId:function(){return this.isAuthed()?this.user.access_token.user_id:null},isTokenExpiring:function(){var e,t;return t=this.getCurrentSession()||{},e=null,_.isObject(t.access_token)&&!_.isUndefined(t.access_token.expires_at)&&(e=t.access_token.expires_at),!(!e||0===e||!moment.unix(e)||!moment().add(336,"hours").isAfter(moment.unix(e)))},isTokenExpired:function(){var e,t;return t=this.getCurrentSession()||{},e=null,_.isObject(t.access_token)&&!_.isUndefined(t.access_token.expires_at)&&(e=t.access_token.expires_at),!e||!(!moment.unix(e)||!moment.unix(e).isBefore(moment().add(15,"seconds")))}},u.addEventListener("storage",function(t){if(t.key==="pz-"+d&&t.newValue)return e.$evalAsync(function(){return c.handleCrossTabLogout()})}),window.Auth=c,c}])},4943(){"use strict";var e,t,r,n;n=function(){return function(e){return function(){switch(e){case"Sunday":return"Sun";case"Monday":return"Mon";case"Tuesday":return"Tues";case"Wednesday":return"Wed";case"Thursday":return"Thur";case"Friday":return"Fri";case"Saturday":return"Sat"}}()}},e=function(){return function(t){var r,n;if(t)return r=moment(t),n=moment(),e=n.diff(r,"year")}},t=function(){return function(e,t){if(e)return moment(e).local().format(t)}},r=function(){return function(e){if(e)return moment(e).fromNow()}},angular.module("penzuApp").filter("truncateDay",n).filter("age",e).filter("dateFormat",t).filter("timeAgo",r)},5452(e,t,r){r(7766),e.exports=function(e){return""+'<div class="account__wrap"><div class="account__container"><div class="account__sidebar"><ul class="account__sidebar__links"><li class="account__sidebar__link home-link"><a href="" ui-sref="journals">« All Journals</a></li><li><hr></li><li class="account__sidebar__link" ng-class="{\'account__sidebar__link--active\': account.stateName == \'account\'}"><a href="" ui-sref="account">Account Settings</a></li><li class="account__sidebar__link" ng-class="{\'account__sidebar__link--active\': account.stateName == \'account.billing\'}"><a href="" ui-sref="account.billing">Plans & Billing</a></li><li class="account__sidebar__link" ng-class="{\'account__sidebar__link--active\': account.stateName == \'account.delete\'}"><a href="" ui-sref="account.delete">Delete Account</a></li></ul></div><div class="account__content"><div class="account__loader" ng-show="account.accountLoading"><div class="loader-tab" loader="account.accountLoading"></div></div><div ui-view=""><account-settings account="account"></account-settings></div></div></div></div>'}},5476(){"use strict";var e;e=function(){function e(e,t,r,n,o){var a;this.Auth=e,this.$modal=r,this.$state=n,this.$global=o,t.$on("$stateChangeSuccess",(a=this,function(e,t){var r;if(!1===(null!=(r=t.options)?r.header:void 0))return a.hideHeader=!0}))}return e.prototype.showPromoBanner=function(){var e;return this.$global.PROMO.ACTIVE&&!this.Auth.isPaid()&&(null!=(e=this.$state.current.options)?e.showPromoBanner:void 0)},e.prototype.openSaleBannerUpgrade=function(){return this.$modal.openUpgradeModal({source:"newyear_sale_banner"})},e}(),angular.module("penzuApp").controller("AppCtrl",["Auth","$scope","$modal","$state","$global",e])},5594(){"use strict";angular.module("penzuApp").config(["$httpProvider","$urlMatcherFactoryProvi
2der","uiSelectConfig",function(e,t,r){return e.interceptors.push("HttpRequestInterceptor"),t.strictMode(!1),r.theme="selectize"}])},5796(e,t,r){r(7766),e.exports=function(e){return""+'<div class="account-confirmation"><div class="account-confirmation__card pz-card"><h1 class="account-confirmation__title" ng-bind="ctrl.title"></h1><p class="account-confirmation__body" ng-bind-html="ctrl.body"></p></div></div>'}},5807(e,t,r){"use strict";r(6999);var n,o,a,i,s,l=r(6999);n=function(){var e={},t=new RegExp("{{([^}]+)}}","g");return e.parse=function(e){for(var r={inpts:{},chars:{}},n=function(e){for(var r,n=[];r=t.exec(e);)n.push(r);return n}(e),o=e.length,a=0,i=0,s=0,l=function(e){for(var t=e.length,n=0;n<t;n++)r.inpts[i]=e.charAt(n),i++;a++,s+=e.length+4-1};s<o;s++)a<n.length&&s===n[a].index?l(n[a][1]):r.chars[s-4*a]=e.charAt(s);return r.mLength=s-4*a,r},e}(),o=function(){var e={};return"undefined"!=typeof navigator&&navigator.userAgent,e.extend=function(e){for(var t=1;t<arguments.length;t++)for(var r in arguments[t])e[r]=arguments[t][r];return e},e.addChars=function(e,t,r){return e.substr(0,r)+t+e.substr(r,e.length)},e.removeChars=function(e,t,r){return e.substr(0,t)+e.substr(r,e.length)},e.isBetween=function(e,t){return t.sort(function(e,t){return e-t}),e>t[0]&&e<t[1]},e.addListener=function(e,t,r){return void 0!==e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent("on"+t,r)},e.preventDefault=function(e){return e.preventDefault?e.preventDefault():e.returnValue=!1},e.getClip=function(e){return e.clipboardData?e.clipboardData.getData("Text"):window.clipboardData?window.clipboardData.getData("Text"):void 0},e.getMatchingKey=function(e,t,r){for(var n in r){var o=r[n];if(e===o.which&&t===o.keyCode)return n}},e.isDelKeyDown=function(t,r){return e.getMatchingKey(t,r,{backspace:{which:8,keyCode:8},delete:{which:46,keyCode:46}})},e.isDelKeyPress=function(t,r){return e.getMatchingKey(t,r,{backspace:{which:8,keyCode:8,shiftKey:!1},delete:{which:0,keyCode:46}})},e.isSpecialKeyPress=function(t,r){return e.getMatchingKey(t,r,{tab:{which:0,keyCode:9},enter:{which:13,keyCode:13},end:{which:0,keyCode:35},home:{which:0,keyCode:36},leftarrow:{which:0,keyCode:37},uparrow:{which:0,keyCode:38},rightarrow:{which:0,keyCode:39},downarrow:{which:0,keyCode:40},F5:{which:116,keyCode:116}})},e.isModifier=function(e){return e.ctrlKey||e.altKey||e.metaKey},e.forEach=function(e,t,r){if(e.hasOwnProperty("length"))for(var n=0,o=e.length;n<o&&!1!==t.call(r,e[n],n,e);n++);else for(var a in e)if(e.hasOwnProperty(a)&&!1===t.call(r,e[a],a,e))break},e}(),a=function(e,t){return function(r){var n=[],o=[];return t.forEach(r,function(r){t.forEach(r,function(t,r){var a,i=e.parse(t),s="*"===(a=r)?/.*/:new RegExp(a);return n.push(s),o.push(i),!1})}),{getPattern:function(e){var r;return t.forEach(n,function(t,n){if(t.test(e))return r=n,!1}),void 0===r?null:o[r]},patterns:o,matchers:n}}}(n,o),i=function(e,t,r){var n={persistent:!1,repeat:!1,placeholder:" "},o={9:/[0-9]/,a:/[A-Za-z]/,"*":/[A-Za-z0-9]/};function a(t,o){var a=this;if(a.el=t,!a.el)throw new TypeError("Must provide an existing element");if(a.opts=r.extend({},n,o),void 0!==a.opts.pattern&&(a.opts.patterns=a._specFromSinglePattern(a.opts.pattern),delete a.opts.pattern),void 0===a.opts.patterns)throw new TypeError("Must provide a pattern or array of patterns");a.patternMatcher=e(a.opts.patterns),a._updatePattern(),a.hldrs={},a.focus=0,r.addListener(a.el,"keydown",function(e){a._keyDown(e)}),r.addListener(a.el,"keypress",function(e){a._keyPress(e)}),r.addListener(a.el,"paste",function(e){a._paste(e)}),a.opts.persistent&&(a._processKey("",!1),a.el.blur(),r.addListener(a.el,"focus",function(e){a._focus(e)}),r.addListener(a.el,"click",function(e){a._focus(e)}),r.addListener(a.el,"touchstart",function(e){a._focus(e)}))}return a.addInptType=function(e,t){o[e]=t},a.prototype.resetPattern=function(r){this.opts.patterns=r?this._specFromSinglePattern(r):this.opts.patterns,this.sel=t.get(this.el),this.val=this.el.value,this.delta=0,this._removeChars(),this.patternMatcher=e(this.opts.patterns);var n=this.patternMatcher.getPattern(this.val);this.mLength=n.mLength,this.chars=n.chars,this.inpts=n.inpts,this._processKey("",!1,!0)},a.prototype._updatePattern=function(){var e=this.patternMatcher.getPattern(this.val);e&&(this.mLength=e.mLength,this.chars=e.chars,this.inpts=e.inpts)}
2,a.prototype._keyDown=function(e){var t=e.which||e.keyCode;if(t&&r.isDelKeyDown(e.which,e.keyCode))return this._processKey(null,t),r.preventDefault(e)},a.prototype._keyPress=function(e){var t,n;if(t=e.which||e.keyCode,n=r.isSpecialKeyPress(e.which,e.keyCode),!r.isDelKeyPress(e.which,e.keyCode)&&!n&&!r.isModifier(e))return this._processKey(String.fromCharCode(t),!1),r.preventDefault(e)},a.prototype._paste=function(e){return this._processKey(r.getClip(e),!1),r.preventDefault(e)},a.prototype._focus=function(){var e=this;setTimeout(function(){var r=t.get(e.el),n=r.end>e.focus,o=0===r.end;(n||o)&&t.set(e.el,e.focus)},0)},a.prototype._processKey=function(e,n,o){if(this.sel=t.get(this.el),this.val=this.el.value,this.delta=0,this.sel.begin!==this.sel.end)this.delta=-1*Math.abs(this.sel.begin-this.sel.end),this.val=r.removeChars(this.val,this.sel.begin,this.sel.end);else if(n&&46===n)this._delete();else if(n&&this.sel.begin-1>=0)this.val=r.removeChars(this.val,this.sel.end-1,this.sel.end),this.delta-=1;else if(n)return!0;n||(this.val=r.addChars(this.val,e,this.sel.begin),this.delta+=e.length),this._formatValue(o)},a.prototype._delete=function(){for(;this.chars[this.sel.begin];)this._nextPos();this.sel.begin<this.val.length&&(this._nextPos(),this.val=r.removeChars(this.val,this.sel.end-1,this.sel.end),this.delta=-1)},a.prototype._nextPos=function(){this.sel.end++,this.sel.begin++},a.prototype._formatValue=function(e){this.newPos=this.sel.end+this.delta,this._removeChars(),this._updatePattern(),this._validateInpts(),this._addChars(),this.el.value=this.val.substr(0,this.mLength),void 0!==e&&!1!==e||t.set(this.el,this.newPos)},a.prototype._removeChars=function(){this.sel.end>this.focus&&(this.delta+=this.sel.end-this.focus);for(var e=0,t=0;t<=this.mLength;t++){var n,o=this.chars[t],a=this.hldrs[t],i=t+e;i=t>=this.sel.begin?i+this.delta:i,n=this.val.charAt(i),(o&&o===n||a&&a===n)&&(this.val=r.removeChars(this.val,i,i+1),e--)}this.hldrs={},this.focus=this.val.length},a.prototype._validateInpts=function(){for(var e=0;e<this.val.length;e++){var t=this.inpts[e],n=!o[t],a=!n&&!o[t].test(this.val.charAt(e)),i=this.inpts[e];(n||a)&&i&&(this.val=r.removeChars(this.val,e,e+1),this.focusStart--,this.newPos--,this.delta--,e--)}},a.prototype._addChars=function(){if(this.opts.persistent){for(var e=0;e<=this.mLength;e++)this.val.charAt(e)||(this.val=r.addChars(this.val,this.opts.placeholder,e),this.hldrs[e]=this.opts.placeholder),this._addChar(e);for(;this.chars[this.focus];)this.focus++}else for(var t=0;t<=this.val.length;t++){if(this.delta<=0&&t===this.focus)return!0;this._addChar(t)}},a.prototype._addChar=function(e){var t=this.chars[e];if(!t)return!0;r.isBetween(e,[this.sel.begin-1,this.newPos+1])&&(this.newPos++,this.delta++),e<=this.focus&&this.focus++,this.hldrs[e]&&(delete this.hldrs[e],this.hldrs[e+1]=this.opts.placeholder),this.val=r.addChars(this.val,t,e)},a.prototype._specFromSinglePattern=function(e){return[{"*":e}]},a}(a,{get:function(e){if("number"==typeof e.selectionStart)return{begin:e.selectionStart,end:e.selectionEnd};var t=document.selection.createRange();if(t&&t.parentElement()===e){var r=e.createTextRange(),n=e.createTextRange(),o=e.value.length;return r.moveToBookmark(t.getBookmark()),n.collapse(!1),r.compareEndPoints("StartToEnd",n)>-1?{begin:o,end:o}:{begin:-r.moveStart("character",-o),end:-r.moveEnd("character",-o)}}return{begin:0,end:0}},set:function(e,t){if("object"!=typeof t&&(t={begin:t,end:t}),e.setSelectionRange)e.focus(),e.setSelectionRange(t.begin,t.end);else if(e.createTextRange){var r=e.createTextRange();r.collapse(!0),r.moveEnd("character",t.end),r.moveStart("character",t.begin),r.select()}}},o),s="formatter",l.fn[s]=function(e){return"object"==typeof e&&this.each(function(){l.data(this,"plugin_"+s)||l.data(this,"plugin_"+s,new i(this,e))}),this.resetPattern=function(e){return this.each(function(){var t=l.data(this,"plugin_"+s);t&&t.resetPattern(e)}),this},this},l.fn[s].addInptType=function(e,t){i.addInptType(e,t)}},6069(){"use strict";var e,t,r;t=[{name:"pro_form_carousel",started:"Tue Dec 26 2023 13:00:00 UTC",version:1,status:"enabled",groups:[{name:"a",description:"Carousel is presented as usual"},{name:"b",description:"Carousel is never presented"}]},{name:"checkout_iframe_flow",started:"Sun Jan 12 2025 00:00:00 UTC",version:1,status:"enabled",groups:[{name:"a",description:"Control: Uses existing in-app upgrade modal"},{name:"b",description:"Variant: Uses external iframe checkout flow"}]}],r=function(e,t){return t+=1,Math.floor(Math.random()*(t-e))+e},e=function(){function e(e,t,r){this.Auth=e,this.$track=t,this.$storage=r,this.experiments=null,this.all()}return e.prototype.all=function(){var e,r,n;return this.experiments||(e=t.map((n=this,function(e){return n.find(e.name)})),this.Auth.isAuthed()&&this.Auth.setSession({experiments:e},!0),r=e.reduce(function(e,t){return e["ab_"+t.name]=t.assignedGroup.name+" (v"+t.version+")",e},{}),this.$track.setSuperProperties(r),this.experiments=e),this.experiments},e.prototype.assignments=function(){return this.all().map(function(e){return{name:e.name,version:e.version,variant:e.group.name}})},e.prototype.find=function(e){var r;return null==e&&(e=null),this.experiments,(r=_.find(t,{name:e}))&&!r.assignedGroup&&(r.assignedGroup=this._assignGroup(r),r.group=this._getEffectiveGroup(r)),r},e.prototype._assignGroup=function(e){var t,n,o;return(null!=e?e.name:void 0)?(t=null,(o=this.$storage.get("ab_"+e.name))?t=_.find(e.groups,{name:o}):(n=r(0,e.groups.length-1),t=e.groups[n],this.$storage.set("ab_"+e.name,t.name)),t):null},e.prototype._getEffectiveGroup=function(e){return this._getForcedGroup(e)||("disabled"===e.status?e.groups[0]:e.assignedGroup)},e.prototype._getForcedGroup=function(e){var t;return(null!=e?e.name:void 0)&&(t=this.$storage.get("ab_force_"+e.name))?_.find(e.groups,{name:t}):null},e}(),angular.module("penzuApp").service("$experiments",["Auth","$track","$storage",e])},6410(e,t,r){r(7766),e.exports=function(e){return""+'<div class="search__wrap"><div class="content-container search__container" search-results=""><div class="search-box"><div class="container"><div class="search__back" ng-show="route.original.url"><a class="back" href="" ng-click="navigateOriginal()"><span class="icon fa fa-chevron-left"></span>            Back</a></div><form class="form-default" ng-submit="submitSearch()"><div class="search-input__wrap"><span class="icon fa fa-search"></span><input class="search__input input-clear" type="text" placeholder="Search" ng-model="search.query"><button class="btn btn-clear submit" type="submit" pz-tooltip="Search"><span class="fa fa-arrow-circle-o-right"></span></button></div><div class="search-box__controls" ng-hide="!Auth.isPaid()"><div class="search-box__filters"><p>Searching</p><div class="filters-dropdown dropdown"><a class="dropdown-link nav-link" href="" data-toggle="dropdown">{{filters.type || \'Everything\'}}<span class="icon fa fa-caret-down"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="" ng-click="setTypeFilter()">Everything</a></li><li><a href="" ng-click="setTypeFilter(\'Tags\')">Tags</a></li><li><a href="" ng-click="setTypeFilter(\'Entries\')">Entries</a></li></ul></div><p>in</p><div class="journals-dropdown dropdown"><a class="dropdown-link nav-link" href="" data-toggle="dropdown">
2{{filters.journal.name || \'All Journals\'}}<span class="icon fa fa-caret-down"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="" ng-click="setJournalFilter(null)">All Journals</a></li><li ng-repeat="journal in journals track by journal.id" ng-class="{                  \'active\': filter.journal.id == journal.id                  }"><a href="" ng-click="setJournalFilter(journal)">{{journal.name}}</a></li></ul></div></div><div class="search-box__actions"></div></div></form></div></div><div class="results__content"><div class="container"><div class="results-list__wrap" ng-hide="!results"><div class="results-section results-list--tags" ng-hide="!results.tags.length || filters.type == \'Entries\'" ng-cloak=""><div class="results-list__title"><h2>Tags</h2></div><ul class="results-list tags-list"><li class="tags-list__item" ng-repeat="tag in results.tags"><a href="" ng-click="navigateToTag($event, tag)">{{tag.name}}</a></li></ul></div><div class="results-section results-list--entries" ng-hide="!results.entries.entries.length || filters.type == \'Tags\'" ng-cloak=""><div class="results-list__title"><h2>Entries</h2><div class="results-list__filters"><p>Sort by</p><div class="sort-dropdown dropdown"><a class="dropdown-link nav-link" href="" data-toggle="dropdown">{{filters.sortField || \'Relevance\'}}<span class="icon fa fa-caret-down"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="" ng-click="setEntriesFilter(null)">Relevance</a></li><li><a href="" ng-click="setEntriesFilter(\'Date Created\')">Date Created</a></li></ul></div></div></div><ul class="results-list entries-list__list"><li class="entries-list__item" ng-repeat="entry in results.entries.entries"><div class="title item__cell"><a href="/journals/{{entry.journal.id}}/{{entry.id}}" ng-click="navigateToEntry($event, entry)"><h3><span class="icon fa fa-lock" ng-show="entry.is_locked"></span>                      {{entry.title || \'Untitled Entry\'}}<span class="journal-title"><span class="icon fa fa-lock" ng-show="entry.journal.lock_type_id &gt; 1"></span>                        {{entry.journal.name}}</span></h3></a><p ng-hide="!entry.excerpt.length || entry.journal.lock_type_id &gt; 1 || entry.is_locked">{{entry.excerpt}}</p><p class="empty" ng-show="!entry.excerpt.length &amp;&amp; entry.journal.lock_type_id == 1 &amp;&amp; !entry.is_locked">No entry content</p><p class="empty" ng-show="entry.excerpt.length &amp;&amp; (entry.journal.lock_type_id &gt; 1 || entry.is_locked)">Entry content hidden</p></div><div class="date item__cell"><p>{{entry.created | dateFormatUnix:dateFormat}} at {{entry.created | dateFormatUnix:\'h:mma\'}}</p></div></li></ul></div></div><div class="tag-results__wrap" ng-class="{\'tag-results--open\': tag.id}"><div class="tag-results"><div class="results-list__title"><h2><a class="clear-tags" href="" ng-click="clearTagSearch()"><span class="icon fa fa-arrow-left"></span></a>
2                Viewing entries tagged<span class="entry-tag">{{tag.name}}</span></h2><div class="results-list__filters"><p>Sort by</p><div class="sort-dropdown dropdown"><a class="dropdown-link nav-link" href="" data-toggle="dropdown">{{filters.sortField || \'Relevance\'}}<span class="icon fa fa-caret-down"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="" ng-click="setTagFilter(null)">Relevance</a></li><li><a href="" ng-click="setTagFilter(\'Date Created\')">Date Created</a></li></ul></div></div></div><ul class="results-list entries-list__list"><li class="entries-list__item" ng-repeat="entry in tagEntries.entries"><div class="title item__cell"><a href="/journals/{{entry.journal.id}}/{{entry.id}}" ng-click="navigateToEntry($event, entry)"><h3><span class="icon fa fa-lock" ng-if="entry.is_locked"></span>                      {{::entry.title || \'Untitled Entry\'}}<span class="journal-title"><span class="icon fa fa-lock" ng-if="entry.journal.lock_type_id &gt; 1"></span>                        {{::entry.journal.name}}</span></h3></a><p ng-hide="!entry.excerpt.length || entry.journal.lock_type_id &gt; 1 || entry.is_locked">{{::entry.excerpt}}</p><p class="empty" ng-if="!entry.excerpt.length &amp;&amp; (entry.journal.lock_type_id == 1 || !entry.locked)">No entry content</p><p class="empty" ng-if="entry.excerpt.length &amp;&amp; (entry.journal.lock_type_id &gt; 1 || entry.locked)">Entry content hidden</p></div><div class="date item__cell"><p>{{::entry.created | dateFormatUnix:dateFormat}} at {{::entry.created | dateFormatUnix:\'h:mma\'}}</p></div></li><li class="entries-list__empty" ng-show="!tagEntries.entries.length"><p>There are no entries with this tag.</p></li></ul></div></div><div class="search-error search-error--no-results" ng-show="!search.searching &amp;&amp; search.searched &amp;&amp; !results.tags.length &amp;&amp; !results.entries.entries.length" ng-cloak=""><h2>We’re sorry, your search did not return any results.</h2><p>Please note that you are searching within a single journal. You can try making the same search in<a href="" ng-click="searchAllJournals()">all of your journals</a>.</p><a class="btn btn-default btn-slim btn-wide" href="/journals">Back to Journals</a></div><div class="search-error search-error--no-search" ng-show="!search.searching &amp;&amp; !search.searched" ng-cloak=""><h2>Enter a search term to begin searching your entries and tags.</h2></div><div class="results__loader" loader="search.searching" ng-cloak=""></div></div></div></div></div>'}},6687(){"use strict";var e;e=function(){function e(){}return e.prototype.isMobile=function(){var e,t;return e=!1,t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
2sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),e},e.prototype.isMobileOrTablet=function(){var e,t;return e=!1,t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),e},e}(),angular.module("penzuApp").service("$mobile",e)},6869(){"use strict";var e;e=function(){function e(e){this.$cookies=e}return e.prototype.set=function(e,t){var r;return Modernizr.localstorage&&e?(r=JSON.stringify(t),window.localStorage.setItem("pz-"+e,r),{type:"localStorage"}):!Modernizr.localstorage&&e?(this.$cookies.set(e,t),{type:"cookies"}):void 0},e.prototype.get=function(e){var t;return Modernizr.localstorage?(t=angular.fromJson(window.localStorage),e?angular.fromJson(t.getItem("pz-"+e)):t):Modernizr.localstorage?void 0:this.$cookies.get(e)},e.prototype.clear=function(e){return Modernizr.localstorage&&e?(angular.fromJson(window.localStorage),window.localStorage.removeItem("pz-"+e)):Modernizr.localstorage?void 0:this.$cookies.destroy(e)},e}(),angular.module("penzuApp").service("$storage",["$cookies",e])},7100(e,t,r){"use strict";angular.module("penzuApp").directive("loader",function(){return{template:r(1467)(),restrict:"A",scope:{loader:"="},link:function(e,t,r){return e.$watch("loader",function(t){return e.loading=!!t})}}}).directive("pzLoader",["$timeout","$global","$track",function(e,t,r){return{restrict:"A",link:function(n,o,a){var i,s,l,u;return n.globalLoading=!0,s=t.APP_UI.GLOBAL_LOADER_MINTIME,l=moment().toDate(),u=null,i=null,n.$on("globalloader:show",function(e,t){return null==t&&(t=!0),n.loaderShow(t),_.defer(function(){return n.$apply()})}),n.$on("globalloader:hide",function(){return n.loaderHide(),_.defer(function(){return n.$apply()})}),n.loaderHide=function(t){var r,o;return u&&e.cancel(u),i&&e.cancel(i),t=void 0===t?s:void 0,o=moment().toDate(),r=moment(o).diff(l,"milliseconds")-t,u=e(function(){return n.globalLoading=!1},r>=0?0:-r)},n.loaderShow=function(t){return null==t&&(t=!0),u&&e.cancel(u),i&&e.cancel(i),t&&(i=e(function(){return r.log("Global loader took too long, reload."),console.warn("Global loader took too long, reload."),window.location.reload()},15e4)),l=moment().toDate(),n.globalLoading=!0}}}}])},7161(e,t,r){r(7766),e.exports=function(e){return""+'<div class="exclude-lookingglass__wrap"><div class="pz-card" ng-hide="activeTab == \'confirmation\'"><div class="lookingglass__loader" ng-show="ui.loading"><div class="loader-tab" loader="ui.loading"></div></div><h2>Exclude Looking Glass Entry</h2><p class="p-large">Click below to confirm, and we’ll exclude this entry from all future Looking Glass emails.</p><hr><form class="form-default" ng-submit="excludeLookingGlass()" novalidate="" pz-form=""><div pz-form-alert=""></div><div class="exclude-lookingglass__actions"><button class="btn btn-warning btn-block" type="submit">Permanently exclude entry</button></div></form></div><div class="pz-card" ng-show="activeTab == \'confirmation\'"><h2>Entry Excluded</h2><p class="p-large">This entry has been excluded from future Looking Glass emails. You will now be redirected to the journals page.</p></div></div>'}},7505(e,t,r){"use strict";var n,o,a,i=r(6999);n=function(){function e(e,t,r,n,o,a){this.$rootScope=e,this.$http=t,this.$q=r,this.Auth=n,this.$storage=o,this.$track=a}return e.prototype.setSession=function(e,t){return e=this.Auth.parseAccessToken(e),!1!==this.Auth.setSession(e,!1,t)&&e},e.prototype.submit=function(e,t){var r,n,o,i,s,l,u,c,d,p,h,m,g,f,v,y;return null==e&&(e={}),null==t&&(t={}),n=this.$q.defer(),s={loggedOut:!1},t=_.defaults(t,s),r=this.Auth.beginAuthentication(),i={existing:1,client:"penzu_web"},e.payment.nonce?i.payment_method_nonce=e.payment.nonce:e.payment.id&&(i.payment_method_id=e.payment.id),i=a(e.model,i),v=this.$rootScope.API_ROOT+"/api/user/go_pro_logged_in",!this.Auth.isAuthed()&&e.model.user&&(v=this.$rootScope.API_ROOT+"/api/user/go_pro_logged_out",i.user||(i.user={}),i.user.email=e.model.user.email,i.user.plain_password=e.model.user.password,i.user.turnstile=null!=(l=
2document.querySelector('[name="cf-turnstile-response"]'))?l.value:void 0),!this.Auth.isPaid()||this.Auth.isProPlus()||"plus"!==e.model.tier||this.Auth.isExpiredPro()?this.Auth.isPaid()&&(v=this.$rootScope.API_ROOT+"/api/account/manual_renew",m=!0):v=this.$rootScope.API_ROOT+"/api/account/pro_plus_conversion",e.model.promo_code&&(v+="/"+e.model.promo_code),f={payment_total:(null!=(u=e.model.promo)&&null!=(c=u.current)?c.total:void 0)||(null!=(d=e.model.plan)?d.price:void 0)||null,payment_type:e.payment.type||e.payment.payment_type||null,subscription_package:i.membership_package_name,subscription_length:i.subscription,renewal:!!m,tier:e.model.tier||null,plan:e.model.tier+" "+e.model.level,isPromo:!!e.model.promo_code,promo_code:null!=(p=e.model.promo_code)?p:null,promo_code_discount:null!=(h=e.model.promo_code_discount)?h:null},t.trackParams&&(f=_.extend(f,t.trackParams)),f.source_path||(f.source_path=window.location.pathname),this.$track.log("Pro Payment Submit",f),y=this,g=function(e){var t,a,i;if(null==e&&(e={}),!(null!=(t=e.data)?t.error:void 0))return y.$track.log("Pro Payment Complete",f),f.renewal&&y.$track.log("Pro Renewal",f),!1===(i=y.setSession(e.data,r))?(a=y.Auth.staleAuthenticationError("Your payment completed, but you were signed out in another tab. Please sign in again."),void n.reject(a)):(_.defer(function(){return y.$rootScope.$broadcast("session:update",i)}),n.resolve(i));o(e)},o=function(e){return function(t){var r,o,a,i;return null==t&&(t={}),(null!=t?t.data:void 0)?console.log("Pro payment error: ",t.status,JSON.stringify(t.data,null,2)):console.error("Pro payment error"),(null!=(a=t.data)&&null!=(i=a.error)?i.message:void 0)&&(f.message=t.data.error.message),e.$track.log("Pro Payment Error",f),(r=t.data).error||(r.error={}),(o=t.data.error).message||(o.message="An unkown error occurred while submitting your payment. Please check your payment info and try again."),n.reject(t.data,t.status)}}(this),this.$http.post(v,i).then(g,o),n.promise},e.prototype.getStored=function(){var e,t,r;return e=this.$q.defer(),t=function(t){return null==t&&(t={}),console.log("Get stored payments error: ",JSON.stringify(t,null,2)),console.error("Get stored payments error"),e.reject(t.data)},r=function(r){var n;return null==r&&(r={}),(null!=(n=r.data)?n.error:void 0)?(t(r),!1):e.resolve(r.data)},this.$http.get(this.$rootScope.API_ROOT+"/api/account/get_payment_methods").then(r,t),e.promise},e.prototype.update=function(e){var t,r,n,o;return t=this.$q.defer(),r=function(e){return null==e&&(e={}),console.log("Update payment error: ",JSON.stringify(e,null,2)),console.error("Update payment error"),t.reject(e.data)},o=this,n=function(e){var n,a,i;return null==e&&(e={}),(null!=(i=e.data)?i.error:void 0)?(r(e),!1):(a=(n=e.data).payment_info.paypal_email?"paypal":"credit",o.$track.log("Update Payment Info",{paymentType:a}),t.resolve(n))},this.$http.post(this.$rootScope.API_ROOT+"/api/account/edit_payment_info",e).then(n,r),t.promise},e.prototype.validatePromoCode=function(e){var t,r;return t=this.$q.defer(),r={promo_code:e.promo_code,price:e.pro_rated_price||e.price||null},r=a(e,r),this.$http.post(this.$rootScope.API_ROOT+"/api/validate_promo_code",r).then(function(e){var r;return null==e&&(e={}),(null!=(r=e.data)?r.error:void 0)?t.reject(e.data):t.resolve(e.data)},function(e){return null==e&&(e={}),t.reject(e.data)}),t.promise},e.prototype.checkProratedPrice=function(e){var t;return t=this.$q.defer(),this.$http.get(this.$rootScope.API_ROOT+"/api/account/get_pro_rated_price?"+i.param(e)).then(function(e){var r;return null==e&&(e={}),(null!=(r=e.data)?r.error:void 0)?t.reject(e.data):t.resolve(e.data)},function(e){return null==e&&(e={}),t.reject(e.data)}),t.promise},e.prototype.checkRefundAmount=function(){var e;return e=this.$q.defer(),this.$http.get(this.$rootScope.API_ROOT+"/api/user/get_refund_amount").then(function(t){var r;return null==t&&(t={}),(null!=(r=t.data)?r.error:void 0)?e.reject(t.data):e.resolve(t.data)},function(t){return null==t&&(t={}),e.reject(t.data)}),e.promise},e.prototype.getExpiredDowngradePromoCode=function(){var e,t,r;return e=this.$q.defer(),t=function(t){return null==t&&(t={}),console.log("Get downgrade promo code error: ",JSON.stringify(t,null,2)),console.error("Get downgrade promo code error"),e.reject(t.data)},r=function(r){var n;return null==r&&(r={}),(null!=(n=r.data)?n.error:void 0)?(t(r),!1):e.resolve(r.data)},this.$http.get(this.$rootScope.API_ROOT+"/api/subscription/expired_downgrade_offer").then(r,t),e.promise},e.prototype.getPlans=function(e){var t;return e?(t="plus"===e,_.map(o,function(e){return{name:e.name,value:e.value,level:e.level,price:t?e.plusPrice:e.price,fullPrice:t?e.fullPlusPrice:e.fullPrice,savings:t?e.plusSavings:e.savings}})):o},e}(),o=[{name:"Monthly",value:"monthly",level:"monthly",price:4.99,plusPrice:9.99},{name:"1 Year",value:"1year",level:1,price:19.99,plusPrice:49.99,savings:"only $1.66 / month!",plusSavings:"only $4.16 / month!"},{name:"2 Years",value:"2year",level:2,price:29.99,plusPrice:74.99,savings:"only $1.25 / month!",plusSavings:"only $3.12 / month!"},{name:"3 Years",value:"3year",level:3,price:39.99,plusPrice:99.99,savings:"only $1.11 / month!",plusSavings:"only $2.77 / month!"},{name:"5 years",value:"5year",level:5,price:59.99,plusPrice:149.99,savings:"only $1.00 / month!",plusSavings:"only $2.50 / month!"}
2,{name:"Lifetime",value:"lifetime",level:"lifetime",plusPrice:199.99}],a=function(e,t){switch(e.level){case"monthly":t.subscription=1,t.membership_package_name="standardmonthly";break;case"1year":t.subscription=1,t.membership_package_name="standard";break;case"2year":t.subscription=2,t.membership_package_name="standard";break;case"3year":t.subscription=3,t.membership_package_name="standard";break;case"5year":t.subscription=5,t.membership_package_name="standard";break;case"lifetime":t.subscription=1,t.membership_package_name="ProPlusLifetime"}return"plus"===e.tier&&"standardmonthly"===t.membership_package_name?t.membership_package_name="proplusmonthly":"plus"===e.tier&&"standard"===t.membership_package_name&&(t.membership_package_name="proplus"),t},angular.module("penzuApp").service("Payments",["$rootScope","$http","$q","Auth","$storage","$track",n])},7640(e,t,r){r(7766),e.exports=function(e){return""+'<div class="disable-reminder__wrap"><div class="pz-card" ng-hide="activeTab == \'confirmation\'"><div class="reminder__loader" ng-show="ui.loading"><div class="loader-tab" loader="ui.loading"></div></div><h2>Remove this reminder from your journal</h2><p class="p-large">We’ll remove this reminder from this journal. You can add new reminders by going to the journal settings from your all journals page.</p><hr><form class="form-default" ng-submit="disableReminder()" novalidate="" pz-form=""><div pz-form-alert=""></div><div class="disable-reminder__actions"><button class="btn btn-warning btn-block" type="submit" ng-click="deleteReminder()">Permanently disable this reminder</button></div></form></div><div class="pz-card" ng-show="activeTab == \'confirmation\'"><h2>Reminder Removed</h2><p class="p-large">This reminder has been removed from your journal. You will now be redirected to the journals page.</p></div></div>'}},7755(e,t,r){r(7766),e.exports=function(e){return""+'<div class="renew__wrap renew-error"><div class="renew__header pz-card"><h1>We could not process your payment at this time.</h1><p>Please try again. If you continue to have issues with your account upgrade or renewal, please contact our<a href="mailto:[email protected]" target="_blank">support team</a> for further assistance.</p><a class="btn btn-block btn-primary" href="/app/renew?hidemessage=true" target="_self">Renew / Upgrade</a></div></div>'}},7782(e,t,r){"use strict";var n,o=r(6999);n=function(){function e(e,t,r,n,o){this.$uibModal=e,this.Auth=t,this.$experiments=r,this.$iframeCheckout=n,this.$track=o,this.$el=null}return e.prototype.open=function(e,t){var r,n,a;return null==t&&(t={}),this.$el=o("#modal-wrap"),this.$el.hasClass("modal--open")&&(this.$el=o("#modal-2-wrap")),!!(r=angular.element(this.$el).scope())&&(r.modal.loadNewTemplate(e),n=null,_.defer((a=this,function(){n=angular.element(a.$el.children().eq(0)).scope(),t.model&&n&&n.$apply(function(){return n.modal||(n.modal={}),n.modal.model=t.model}),t.modalOptions&&n&&n.$apply(function(){return n.modal||(n.modal={}),n.modal.options=t.modalOptions}),setTimeout(function(){var e;return e=n.modalOptions||{},r.modal.showModal(e)},100)})))},e.prototype.openUpgradeModal=function(e){var t,r,n;return null==e&&(e={}),n="b"===(null!=(t=this.$experiments.find("checkout_iframe_flow"))&&null!=(r=t.group)?r.name:void 0),this._shouldDisableIframe(e)&&(n=!1),n?this._openIframeCheckout(e):this._openLegacyModal(e)},e.prototype._shouldDisableIframe=function(e){return!!this.Auth.isPaid()},e.prototype._openIframeCheckout=function(e){var t,r,n;if(t={source:null!=(r=e.source)?r:"upgrade_modal",experiments:this.$experiments.assignments()},e.tier)switch(e.tier){case"pro":t.tier="pro";break;case"plus":t.tier="proplus";break;default:t.tier=e.tier}return{result:this.$iframeCheckout.open(t),close:(n=this,function(){return n.$iframeCheckout.close()}),dismiss:function(e){return function(){return e.$iframeCheckout.close()}}(this)}},e.prototype._openLegacyModal=function(e){var t,n,o,a,i,s,l,u,c;return n=this.$experiments.assignments(),a=this.$track.newOpening({flow:"checkout",surface:"modal",source:null!=(i=e.source)?i:"unknown",tier:null!=(s=e.tier)?s:"unspecified",is_paid_user:this.Auth.isPaid(),ui_origin:null!=(l=e.source)?l:null,plan_intent:null!=(u=e.tier)?u:null,plan_duration:null,experiments:n}),this.$track.activeCheckout=a,e=_.extend({},e,{funnelOpening:a}),(o=this.Auth.isPaid()?this.$uibModal.open({template:r(7810)(),controller:"RenewModalCtrl",controllerAs:"vm",windowClass:"renew-modal-modal",resolve:{options:function(){return e}}}):this.$uibModal.open({template:r(3102)(),controller:"ProModalCtrl",controllerAs:"vm",windowClass:"pro-modal-modal",resolve:{options:function(){return e}}})).rendered.then((c=this,function(){return c.$track.begin("Checkout Begin",a)}),angular.noop),t=function(e){return function(){if(e.$track.activeCheckout===a)return e.$track.activeCheckout=null}}(this),o.result.then(t,t),o},e}(),angular.module("penzuApp").service("$modal",["$uibModal","Auth","$experiments","$iframeCheckout","$track",n])},7810(e,t,r){r(7766),e.exports=function(e){return""+'<div class="renew-modal"><div class="modal-dialog"><div class="modal-content"><button class="close" type="button" ng-click="vm.closeModal()">&times;</button><renew-form options="vm.options"></renew-form></div></div></div>'}},7958(e,t,r){"use strict";var n=r(6999);angular.module("penzuApp").factory("$cookies",function(){return{set:function(e,t,r){var o;return null==r&&(r={}),r=_.defaults(r,{path:"/",expires:30}),(o=this.get()||{})[e]=t,o=JSON.stringify(o),n.cookie("penzuapp",o,r)},get:function(e){var t,r;return(t=n.cookie("penzuapp"))&&e?(null!=(r=JSON.parse(t))?r[e]:void 0)?r[e]:null:t?JSON.parse(t):null},destroy:function(e){return e?this.set(e,null):n.cookie("penzuapp",null,{path:"/",expires:30})}}})},8e3(e,t,r){"use strict";r.r(t);var n=r(260);angular||window.location.reload(),angular.module("ui.checkbox",[]).directive("uibCheckbox",n.default),angular.module("penzuApp",["ngCookies","ngResource","ngSanitize","ui.router","ngAnimate","ui.select","ui.checkbox","ui.bootstrap"])},8031(e,t,r){r(7766),e.exports=function(e){return""+'<div class="error__wrap"><div class="error-container"><div class="error-container_wrapper"><div class="error-container_header"><h1 ng-show="!vm.message">Sorry, the {{vm.target}} you were looking for was not found.</h1><h1 ng-show="vm.message">{{vm.message}}</h1><ul class="error-container_top-nav"><li><a target="_self" ng-href="{{vm.$global.SUPPORT_SITE}}">Help</a> |</li><li><a target="_self" href="/journals">Home</a></li></ul></div><div class="error-container_body"><p ng-bind-html="vm.description"></p><div class="error__actions"><a class="btn btn-primary" href="/" target="_self">Return Home</a><a class="btn btn-default" ng-href="{{vm.$global.SUPPORT_SITE}}" target="_blank">View Help Articles</a></div></div></div></div></div>'}},8058(){"use strict";angular.module("penzuApp").factory("$unload",["$window","$rootScope",function(e,t){return{init:function(){return e.addEventListener("beforeunload",(t=this,function(e){t.onUnload()}));var t},onUnload:function(){return t.$broadcast("window:unload")}}}])},8140(e,t,r){"use strict";var n,o,a=r(6999);n=a,(o=function(e){this.origHtmlMargin=parseFloat(n("html").css("margin-top")),this.options=n.extend({},n.smartbanner.defaults,e);var t=navigator.standalone,r=navigator.userAgent;if(this.options.force?this.type=this.options.force:null!=r.match(/iPhone|iPod/i)||r.match(/iPad/)&&this.options.iOSUniversalApp?null!=r.match(/Safari/i)&&(null!=r.match(/CriOS/i)||window.Number(r.substr(r.indexOf("OS ")+3,3).replace("_","."))<6)&&(this.t
2ype="ios"):r.match(/\bSilk\/(.*\bMobile Safari\b)?/)||r.match(/\bKF\w/)||r.match("Kindle Fire")?this.type="kindle":null!=r.match(/Android/i)?this.type="android":null!=r.match(/Windows NT 6.2/i)&&null!==r.match(/Touch/i)&&(this.type="windows"),this.type&&!t&&!this.getCookie("sb-closed")&&!this.getCookie("sb-installed")){this.scale="auto"==this.options.scale?n(window).width()/window.screen.width:this.options.scale,this.scale<1&&(this.scale=1);var o=n("android"==this.type?'meta[name="google-play-app"]':"ios"==this.type?'meta[name="apple-itunes-app"]':"kindle"==this.type?'meta[name="kindle-fire-app"]':'meta[name="msApplication-ID"]');0!=o.length&&("windows"==this.type?(this.pfn=n('meta[name="msApplication-PackageFamilyName"]').attr("content"),this.appId=o.attr("content")[1]):this.appId=/app-id=([^\s,]+)/.exec(o.attr("content"))[1],this.title=this.options.title?this.options.title:o.data("title")||n("title").text().replace(/\s*[|\-·].*$/,""),this.author=this.options.author?this.options.author:o.data("author")||(n('meta[name="author"]').length?n('meta[name="author"]').attr("content"):window.location.hostname),this.iconUrl=o.data("icon-url"),this.price=o.data("price"),this.create(),this.show(),this.listen())}}).prototype={constructor:o,create:function(){var e,t=this.options.url?this.options.url:("windows"==this.type?"ms-windows-store:PDP?PFN="+this.pfn:"android"==this.type?"market://details?id=":"kindle"==this.type?"amzn://apps/android?asin=":"https://itunes.apple.com/"+this.options.appStoreLanguage+"/app/id")+this.appId,r=this.price||this.options.price,o=r?r+" - "+("android"==this.type?this.options.inGooglePlay:"kindle"==this.type?this.options.inAmazonAppStore:"ios"==this.type?this.options.inAppStore:this.options.inWindowsStore):"",a=null===this.options.iconGloss?"ios"==this.type:this.options.iconGloss;this.options.url?t=this.options.url:"android"==this.type?(t="market://details?id="+this.appId,this.options.GooglePlayParams&&(t=t+"&referrer="+this.options.GooglePlayParams)):t="https://itunes.apple.com/"+this.options.appStoreLanguage+"/app/id"+this.appId;var i='<div id="smartbanner" class="'+this.type+'"><div class="sb-container"><a href="#" class="sb-close">&times;</a><span class="sb-icon"></span><div class="sb-info"><strong>'+this.title+"</strong><span>"+this.author+"</span><span>"+o+'</span></div><a href="'+t+'" class="sb-button"><span>'+this.options.button+"</span></a></div></div>";this.options.layer?n(this.options.appendToSelector).append(i):n(this.options.appendToSelector).prepend(i),this.options.icon?e=this.options.icon:this.iconUrl?e=this.iconUrl:n('link[rel="apple-touch-icon-precomposed"]').length>0?(e=n('link[rel="apple-touch-icon-precomposed"]').attr("href"),null===this.options.iconGloss&&(a=!1)):n('link[rel="apple-touch-icon"]').length>0?e=n('link[rel="apple-touch-icon"]').attr("href"):n('meta[name="msApplication-TileImage"]').length>0?e=n('meta[name="msApplication-TileImage"]').attr("content"):n('meta[name="msapplication-TileImage"]').length>0&&(e=n('meta[name="msapplication-TileImage"]').attr("content")),e?(n("#smartbanner .sb-icon").css("background-image","url("+e+")"),a&&n("#smartbanner .sb-icon").addClass("gloss")):n("#smartbanner").addClass("no-icon"),this.bannerHeight=n("#smartbanner").outerHeight()+2,this.scale>1&&(n("#smartbanner").css("top",parseFloat(n("#smartbanner").css("top"))*this.scale).css("height",parseFloat(n("#smartbanner").css("height"))*this.scale).hide(),n("#smartbanner .sb-container").css("-webkit-transform","scale("+this.scale+")").css("-msie-transform","scale("+this.scale+")").css("-moz-transform","scale("+this.scale+")").css("width",n(window).width()/this.scale)),n("#smartbanner").css("position",this.options.layer?"absolute":"static")},listen:function(){n("#smartbanner .sb-close").on("click",n.proxy(this.close,this)),n("#smartbanner .sb-button").on("click",n.proxy(this.install,this))},show:function(e){var t=n("#smartbanner");t.stop(),this.options.layer?t.animate({top:0,display:"block"},this.options.speedIn).addClass("shown").show():n.support.transition?(t.animate({top:0},this.options.speedIn).addClass("shown"),n("html").addClass("sb-animation").one(n.support.transition.end,function(){n("html").removeClass("sb-animation"),e&&e()}).emulateTransitionEnd(this.options.speedIn)):t.slideDown(this.options.speedIn).addClass("shown")},hide:function(e){var t=n("#smartbanner");t.stop(),this.options.layer?t.animate({top:-1*this.bannerHeight*this.scale,display:"block"},this.options.speedIn).removeClass("shown"):n.support.transition?(t.css("top",-1*this.bannerHeight*this.scale).removeClass("shown"),n("html").addClass("sb-animation").one(n.support.transition.end,function(){n("html").removeClass("sb-animation"),e&&e()}).emulateTransitionEnd(this.options.speedOut)):t.slideUp(this.options.speedOut).removeClass("shown")},close:function(e){e.preventDefault(),this.hide(),this.setCookie("sb-closed","true",this.options.days
2Hidden)},install:function(e){this.options.hideOnInstall&&this.hide(),this.setCookie("sb-installed","true",this.options.daysReminder)},setCookie:function(e,t,r){var n=new Date;n.setDate(n.getDate()+r),t=encodeURI(t)+(null==r?"":"; expires="+n.toUTCString()),document.cookie=e+"="+t+"; path=/;"},getCookie:function(e){var t,r,n,o=document.cookie.split(";");for(t=0;t<o.length;t++)if(r=o[t].substr(0,o[t].indexOf("=")),n=o[t].substr(o[t].indexOf("=")+1),(r=r.replace(/^\s+|\s+$/g,""))==e)return decodeURI(n);return null},switchType:function(){var e=this;this.hide(function(){e.type="android"==e.type?"ios":"android";var t=n("android"==e.type?'meta[name="google-play-app"]':'meta[name="apple-itunes-app"]').attr("content");e.appId=/app-id=([^\s,]+)/.exec(t)[1],n("#smartbanner").detach(),e.create(),e.show()})}},n.smartbanner=function(e){var t=n(window),r=t.data("smartbanner"),a="object"==typeof e&&e;r||t.data("smartbanner",r=new o(a)),"string"==typeof e&&r[e]()},n.smartbanner.defaults={title:null,author:null,price:"FREE",appStoreLanguage:"us",inAppStore:"On the App Store",inGooglePlay:"In Google Play",inAmazonAppStore:"In the Amazon Appstore",inWindowsStore:"In the Windows Store",GooglePlayParams:null,icon:null,iconGloss:null,button:"VIEW",url:null,scale:"auto",speedIn:300,speedOut:400,daysHidden:15,daysReminder:90,force:null,hideOnInstall:!0,layer:!1,iOSUniversalApp:!0,appendToSelector:"body"},n.smartbanner.Constructor=o,void 0===n.support.transition&&(n.fn.emulateTransitionEnd=function(e){var t=!1,r=this;return n(this).one(n.support.transition.end,function(){t=!0}),setTimeout(function(){t||n(r).trigger(n.support.transition.end)},e),this},n(function(){n.support.transition=function(){var e=document.createElement("smartbanner"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var r in t)if(void 0!==e.style[r])return{end:t[r]};return!1}()}))},8153(){"use strict";var e;window.console||(window.console={}),window.location.origin||(e=window.location.port?":"+window.location.port:"",window.location.origin=window.location.protocol+"//"+window.location.hostname+e)},8187(){"use strict";angular.module("penzuApp").factory("Account",["$rootScope","$injector","$q","$http","$track","$global",function(e,t,r,n,o,a){var i,s,l,u,c;return s=s||t.get("Auth"),c=["ddd M/D/YYYY","dddd M/D/YYYY","ddd D/M/YYYY","dddd D/M/YYYY","ddd MMM D, YYYY","ddd D MMM, YYYY","MMMM D, YYYY","D MMMM, YYYY","M/D/YYYY","D/M/YYYY"],i={getTimeFormats:function(){return angular.copy(c)},getProfile:function(){var t,o,a;return t=r.defer(),o=function(e){return null==e&&(e={}),console.log("Fetch profile error: ",JSON.stringify(e,null,2)),console.error("Fetch profile error"),t.reject(e.data)},a=function(e){var r;return null==e&&(e={}),(null!=(r=e.data)?r.error:void 0)?(o(e),!1):t.resolve(e.data)},n.get(e.API_ROOT+"/api/account/profile").then(a,o),t.promise},getSettings:function(){var t,o,a,i;return this.getSettingsPromise?this.getSettingsPromise:(t=r.defer(),i=this,o=function(e){return null==e&&(e={}),console.log("Fetch settings error: ",JSON.stringify(e,null,2)),console.error("Fetch settings error"),t.reject(e.data),i.getSettingsPromise=null},a=function(e){return function(r){var n;return null==r&&(r={}),(null!=(n=r.data)?n.error:void 0)?(o(r),!1):(t.resolve(r.data),e.getSettingsPromise=null)}}
2(this),n.get(e.API_ROOT+"/api/settings").then(a,o),this.getSettingsPromise=t.promise,t.promise)},getSettingsPromise:null,getBilling:function(){var t,o,a,i;return this.getBillingPromise?this.getBillingPromise:(t=r.defer(),i=this,o=function(e){return null==e&&(e={}),console.log("Fetch billing error: ",JSON.stringify(e,null,2)),console.error("Fetch billing error"),i.getBillingPromise=null,t.reject(e.data)},a=function(e){return function(r){var n;return null==r&&(r={}),(null!=(n=r.data)?n.error:void 0)?(o(r),!1):(e.getBillingPromise=null,t.resolve(r.data))}}(this),n.get(e.API_ROOT+"/api/account/billing").then(a,o),this.getBillingPromise=t.promise,t.promise)},getBillingPromise:null,getOrders:function(){var t,o,a;return t=r.defer(),o=function(e){return null==e&&(e={}),console.log("Fetch orders error: ",JSON.stringify(e,null,2)),console.error("Fetch orders error"),t.reject(e.data)},a=function(e){var r,n;return null==e&&(e={}),(null!=(n=e.data)?n.error:void 0)?(o(e),!1):(r=u(e.data),t.resolve(r))},n.get(e.API_ROOT+"/api/account/orders").then(a,o),t.promise},updateProfile:function(t){var a,i,l,u;return a=r.defer(),l={first_name:t.firstName,last_name:t.lastName,new_email:t.email,retype_email:t.confirmEmail},i=function(e){return null==e&&(e={}),console.log("Update profile error: ",JSON.stringify(e,null,2)),console.error("Update profile error"),a.reject(e.data)},u=function(e){var t,r;return null==e&&(e={}),(null!=(t=e.data)?t.error:void 0)?(i(e),!1):(o.log("Update Profile"),(r=s.getCurrentSession()).access_token.user=angular.extend(r.access_token.user,e.data),s.setSession(r),a.resolve(r.access_token.user))},n.put(e.API_ROOT+"/api/account/update_profile",l).then(u,i),a.promise},updateSettings:function(t){var n,o;return n=r.defer(),o=[],t.timeZone&&o.push(this.updateTimezone(t.timeZone)),t.journalOrder&&o.push(this.updateJournalOrder(t.journalOrder)),t.notifications&&o.push(this.updateNotifications(t.notifications)),void 0!==t.receiveMarketingEmails&&o.push(this.updatePromotionalEmails(t.receiveMarketingEmails)),t.dateFormat&&o.push(this.updateEntryDateFormat(t.dateFormat)),_.isUndefined(t.showPodcast)||o.push(this.updateShowPodcast(t.showPodcast)),_.isUndefined(t.autoLogout)||o.push(this.updateAutoLogout(t.autoLogout)),r.all(o).then(function(t){var r;return console.log("Updated settings: ",t),t[t.length-1]&&_.isObject(t[t.length-1].error)?n.reject(t[t.length-1].error):(r=t[t.length-1],a.settings=angular.extend(a.settings,r),e.$emit("settings:update",a.settings),n.resolve(r))},function(e,t){return n.reject(e,t)}),n.promise},updateTimezone:function(t){var a,i,s,l;return a=r.defer(),s={timezone:t},i=function(e){return null==e&&(e={}),console.log("Update timezone error: ",JSON.stringify(e,null,2)),console.error("Update timezone error"),a.reject(e.data)},l=function(e){var r;return null==e&&(e={}),(null!=(r=e.data)?r.error:void 0)?(i(e),!1):(o.log("Update Timezone",{timezone:t}),a.resolve(e.data))}
2,n.put(e.API_ROOT+"/api/settings/change_timezone",s).then(l,i),a.promise},updateShowPodcast:function(t){var a,i,s,l;return a=r.defer(),s={show_podcast:t},i=function(e){return null==e&&(e={}),console.log("Update show podcast error: ",JSON.stringify(e,null,2)),console.error("Update show podcast error"),a.reject(e.data)},l=function(e){var r;return null==e&&(e={}),(null!=(r=e.data)?r.error:void 0)?(i(e),!1):(o.log("Update Podcast Preference",{isVisible:t}),a.resolve(e.data))},n.put(e.API_ROOT+"/api/settings/set_show_podcast",s).then(l,i),a.promise},updateAutoLogout:function(t){var a,i,s,l;return a=r.defer(),s={logout_time:t},i=function(e){return null==e&&(e={}),console.log("Update auto logout error: ",JSON.stringify(e,null,2)),console.error("Update auto logout error"),a.reject(e.data)},l=function(e){var r;return null==e&&(e={}),(null!=(r=e.data)?r.error:void 0)?(i(e),!1):(o.log("Update Auto Logout Preference",{timeout:t}),a.resolve(e.data))},n.put(e.API_ROOT+"/api/settings/set_auto_logout",s).then(l,i),a.promise},updateJournalOrder:function(t){var a,i,s,l;return a=r.defer(),s={order:t},i=function(e){return null==e&&(e={}),console.log("Update journal order error: ",JSON.stringify(e,null,2)),console.error("Update journal order error"),a.reject(e.data)},l=function(e){var t;return null==e&&(e={}),(null!=(t=e.data)?t.error:void 0)?(i(e),!1):(o.log("Update Journal Order",{order:s.order}),a.resolve(e.data))},n.put(e.API_ROOT+"/api/settings/change_journal_order",s).then(l,i),a.promise},updateEntryDateFormat:function(t){var a,i,s,l;return a=r.defer(),s={format:t},i=function(e){return null==e&&(e={}),console.log("Update time format error: ",JSON.stringify(e,null,2)),console.error("Update time format error"),a.reject(e.data)},l=function(e){var r;return null==e&&(e={}),(null!=(r=e.data)?r.error:void 0)?(i(e),!1):(o.log("Update Entry Time Format",{format:t}),a.resolve(e.data))},n.put(e.API_ROOT+"/api/settings/change_date_format",s).then(l,i),a.promise},updateNotifications:function(t){var a,i,s,l;return a=r.defer(),(s=t).share_level=s.receive_shares?0:64,i=function(e){return null==e&&(e={}),console.log("Update notifications error: ",JSON.stringify(e,null,2)),console.error("Update notifications error"),a.reject(e.data)},l=function(e){var t;return null==e&&(e={}),(null!=(t=e.data)?t.error:void 0)?(i(e),!1):(o.log("Update Notifications",s),a.resolve(e.data))},n.put(e.API_ROOT+"/api/settings/change_notifications",s).then(l,i),a.promise},updatePromotionalEmails:function(t){var a,i,s,l;return null==t&&(t=!0),a=r.defer(),s={receive_marketing_emails:t},i=function(e){return null==e&&(e={}),console.log("Update promotional notifications error: ",JSON.stringify(e,null,2)),console.error("Update promotional notifications error"),a.reject(e.data)},l=function(e){var t;return null==e&&(e={}),(null!=(t=e.data)?t.error:void 0)?(i(e),!1):(o.log("Update Promotional Email Settings",s),a.resolve(e.data))},n.put(e.API_ROOT+"/api/settings/toggle_receive_marketing_emails",s).then(l,i),a.promise},updatePassword:function(t){var a,i,l,u;return a=r.defer(),l={current_password:t.oldPassword,new_password:t.newPassword,retype_password:t.newPasswordConfirm,client:"penzu_web"},i=function(e){var t;return null==e&&(e={}),delete(t=angular.copy(e)).data,console.log("Update password error: ",JSON.stringify(t,null,2)),console.error("Update password error"),a.reject(e.data)},u=function(e){var t;return null==e&&(e={}),(null!=(t=e.data)?t.error:void 0)?(i(e),!1):(o.log("Change Password"),s.setSession(e.data),a.resolve(e.data))},n.put(e.API_ROOT+"/api/account/change_password",l).then(u,i),a.promise},disableRenew:function(){var t,a,i,l,u,c,d,p,h,m,g;return t=r.defer(),g=s.getUser(),m={package_name:(null!=g&&null!=(i=g.access_token)&&null!=(l=i.user)&&null!=(u=l.pro_membership)?u.package_name:void 0)||null,subscription_length:(null!=g&&null!=(c=g.access_token)&&null!=(d=c.user)&&null!=(p=d.pro_membership)?p.subscription_length:void 0)||null},a=function(e){return null==e&&(e={}),console.log("Disable autorenew error: ",JSON.stringify(e,null,2)),console.error("Disable autorenew error"),t.reject(e.data)},h=function(e){var r;return null==e&&(e={}),(null!=(r=e.data)?r.error:void 0)?(a(e),!1):(o.log("Disable Autorenew",m),t.resolve(e.data))},n.put(e.API_ROOT+"/api/account/disable_auto_renew").then(h,a),t.promise},enableRenew:function(){var t,a,i,l,u,c,d,p,h,m;return t=r.defer(),null!=(m=s.getUser())&&null!=(i=m.access_token)&&null!=(l=i.user)&&null!=(u=l.pro_membership)&&u.package_name,null!=m&&null!=(c=m.access_token)&&null!=(d=c.user)&&null!=(p=d.pro_membership)&&p.subscription_length,a=function(e){return null==e&&(e={}),console.log("Enable autorenew error: ",JSON.stringify(e,null,2)),console.error("Enable autorenew error"),t.reject(e.data)},h=function(e){var r;return null==e&&(e={}),(null!=(r=e.data)?r.error:void 0)?(a(e),!1):(o.log("Enable Autorenew",formData),t.resolve(e.data))},n.put(e.API_ROOT+"/api/account/enable_auto_renew").then(h,a),t.promise},deleteAccount:function(){var t,a,i;return t=r.defer(),a=function(e){return null==e&&(e={}),console.log("Delete account error: ",JSON.stringify(e,null,2)),console.error("Delete account error"),t.reject(e.data)},i=function(e){var r;return null==e&&(e={}),(null!=(r=e.data)?r.error:void 0)?(a(e),!1):(o.log("Delete Account"),t.resolve(e.data))},n.get(e.API_ROOT+"/api/user/delete_request").then(i,a),t.promise},downgradeAccount:function(e){return s.downgrade(e)},checkOneTimeModal:function(t){var o,a,i;return null==t&&(t={}),o=r.defer(),t=_.extend({},t),a=function(e){return null==e&&(e={}),console.log("Check one time modal error: ",JSON.stringify(e,null,2)),console.error("Check one time modal error"),o.reject(e.data)},i=function(e){var t;return null==e&&(e={}),(null!=(t=e.data)?t.error:void 0)?(a(e),!1):o.resolve(e.data)},n.get(e.API_ROOT+"/api/user/one_time_modal",{params:t}).then(i,a),o.promise},disableOneTimeModal:function(t){var a,i,s;return null==t&&(t={}),a=r.defer(),t=_.extend({},t),i=function(e){return null==e&&(e={}),console.log("Disable one time modal error: ",JSON.stringify(e,null,2)),console.error("Disable one time modal error"),a.reject(e.data)},s=function(e){var r;return null==e&&(e={}),(null!=(r=e.data)?r.error:void 0)?(i(e),!1):(o.log("Disable One Time Modal",{type:t.type}),a.resolve(e.data))},n.put(e.API_ROOT+"/api/user/one_time_modal",t).then(s,i),a.promise}},u=function(e){var t;return t=[],_.each(e,function(e){return t.push(l(e))}),t},l=function(e){return e.order},i}])},8349(e,t,r){"use strict";var n=r(6999);angular.module("penzuApp").directive("pzModal",["$compile",function(e){return{template:"<div></div>",restrict:"A",scope:!0,link:function(t,r,o){var a;return t.modal||(t.modal={}),t.modal.$el=r,t.modal.isModal=!0,(a=function(){return r.off("show.bs.modal hide.bs.modal hidden.bs.modal"),r.on("show.bs.modal",function(){return r.addClass("modal--open")}),r.on("hide.bs.modal",function(){return r.removeClass("modal--open")}),r.on("hidden.bs.modal",function(){var e;return(e=angular.element(r.children().eq(0)).scope()).$destroy(),e.$apply(),r.removeAttr("data-keyboard data-backdrop"),t.$apply(function(){return t.modal.newTemplate=null,t.modal.activeTab="default",t.modal.model=null}),t.$emit("modal.close"),a()})})(),t.$watch("modal.newTemplate",function(e,r){if(e)return e!==r&&t.modal.loadNewTemplate(e),setTimeout(function(){var e,r;return e=(null!=(r=t.modal.scope)?r.modalOptions:void 0)||{},t.modal.showModal(e)},100)}),t.modal.loadNewTemplate=function(n){return r.html("<div "+n+" class='modal-directive-wrap'></div>"),e(r.contents())(t),t.modal.scope=angular.element(r.contents()).scope()},t.modal.showModal=function(e){null==e&&(e={}),r.modal(e)},t.modal.close=function(){r.modal("hide")},t.modal.activeTab="default",t.modal.isActiveTab=function(e){return e===t.modal.activeTab},t.modal.setActiveTab=function(e){return t.modal.activeTab=e},t.$watch("modal.loading",function(e,o){var a;if(e!==o&&!t.modal.noButtons)return a=r.find("[data-loading-text], [loading-text]"),!0===e?a.each(function(){return n(this).button("loading")}):a.each(function(){return n(this).button("reset")})})}}}]).directive("pzOpenModal",function(){return{restrict:"A",scope:{model:"=",modalOptions:"="},link:function(e,t,r){var o,a;return o=n("#modal-wrap"),a=angular.element(o).scope(),t.on("click",function(t){return t.preventDefault(),a.$apply(function(){return a.modal||(a.modal={}),a.modal.newTemplate=r.pzOpenModal,_.defer(function(){var t;if(t=angular.element(o.children().eq(0)).scope())return t.$apply(function(){if(t.modal||(t.modal={}),e.model&&(t.modal.model=e.model),e.modalOptions)return t.modal.options=e.modalOptions})})})})}}}).directive("pzPhotoModal",function(){return{restrict:"A",scope:{photo:"=pzPhotoModal"},link:function(e,t,r){var o,a;return o=n("#modal-wrap"),a=angular.element(o).scope(),t.on("click",function(t){return t.preventDefault(),a.$apply(function(){return a.modal||(a.modal={}),a.modal.newTemplate="view-photo-modal",_.defer(function(){var t;if(t=angular.element(o.children().eq(0)).scope())return t.$apply(function(){return t.photo=e.photo})})})})}}})},8453(e,t,r){"use strict";var n,o,a=r(6999);o=function(e){try{return new URL(e).origin}catch(e){return null}}("https://penzu.com/checkout"),n=function(){function e(e,t,r,n,o){this.$q=e,this.$timeout=t,this.Auth=r,this.$rootScope=n,this.$track=o,this.$overlay=null,this.$iframe=null,this.messageHandler=null,this.deferred=null,this.loadTimeoutPromise=null,this.options=null,this.successPayload=null,this.authenticationGeneration=null}return e.prototype.open=function(e){var t,r,n,o,a,i;if(null==e&&(e={}),this.deferred)return console.warn("Checkout already open, ignoring open() call"),this.$q.reject({error:"checkout_already_open"});this.deferred=this.$q.defer(),this.options=e,this.authenticationGeneration=this.Auth.beginAuthentication(),(r=this.$track.newOpening()).experiments=null!=(o=e.experiments)?o:[],this.analyticsOpeningId=r.id;try{window.sessionStorage.setItem("pz_checkout_opening:"+r.id,JSON.stringify(r))}catch(e){}return n=["embedded=true","funnel_opening="+r.id],e.tier&&n.push("tier="+encodeURIComponent(e.tier)),e.period&&n.push("period="+encodeURIComponent(e.period)),e.source&&n.push("source="+encodeURIComponent(e.source)),t="https://penzu.com/checkout?"+n.join("&"),this._createOverlay(t),this._attachMessageListener(),this._startLoadTimeout(),this.$track.log("Checkout Iframe Opened",{source:null!=(a=e.source)?a:"unknown",tier:null!=(i=e.tier)?i:"unspecified"}),this.deferred.promise},e.prototype._createOverlay=function(e){return this.$overlay=a("<div>").attr("id","checkout-iframe-overlay").css({position:"fixed",top:"0",left:"0",width:"100%",height:"100%","z-index":"10000",background:"transparent"}),this.$iframe=a("<iframe>").attr({id:"checkout-iframe",src:e,allow:"payment",title:"Penzu Checkout"}).css({width:"100%",height:"100%",border:"none"}),this.$overlay.append(this.$iframe),a("body").append(this.$overlay)},e.prototype._attachMessageListener=function(){var e;return this.messageHandler=(e=this,function(t){var r,n,a;if(t.origin===o&&t.source===(null!=(n=e.$iframe)&&null!=(a=n[0])?a.contentWindow:void 0)&&(r=t.data||{}).type&&"string"==typeof r.type)return e._handleMessage(r.type,r.payload)}),window.addEventListener("message",this.messageHandler)},e.prototype._startLoadTimeout=function(){return this.loadTimeoutPromise=this.$timeout((e=this,function(){var t;return console.error("Checkout iframe load timeout"),e.$track.log("Checkout Iframe Timeout",{source:null!=(t=e.options)?t.s
2ource:void 0}),e._rejectAndClose({error:"load_timeout",message:"Checkout failed to load"})}),15e3);var e},e.prototype._cancelLoadTimeout=function(){if(this.loadTimeoutPromise)return this.$timeout.cancel(this.loadTimeoutPromise),this.loadTimeoutPromise=null},e.prototype._handleMessage=function(e,t){var r,n,o,a;switch(this._cancelLoadTimeout(),e){case"checkout:ready":break;case"checkout:authenticated":if(a=this.Auth.reloadSession(this.authenticationGeneration))return this.$rootScope.$broadcast("session:init",a);break;case"checkout:success":if(this.$track.log("Checkout Iframe Success",{tier:null!=t?t.tier:void 0,source:null!=(r=this.options)?r.source:void 0}),this.successPayload=t,a=this.Auth.reloadSession(this.authenticationGeneration))return this.$rootScope.$broadcast("session:update",a);break;case"checkout:close":return this.$track.log("Checkout Iframe Closed",{source:null!=(n=this.options)?n.source:void 0}),this.successPayload?this._resolveAndClose(this.successPayload):this._rejectAndClose({dismissed:!0});case"checkout:error":return console.error("Checkout error:",t),this.$track.log("Checkout Iframe Error",{message:null!=t?t.message:void 0,source:null!=(o=this.options)?o.source:void 0})}},e.prototype._resolveAndClose=function(e){return this.deferred&&this.deferred.resolve(e),this.close()},e.prototype._rejectAndClose=function(e){return this.deferred&&this.deferred.reject(e),this.close()},e.prototype.close=function(){this._cancelLoadTimeout(),this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.$iframe&&(this.$iframe.attr("src","about:blank"),this.$iframe=null),this.$overlay&&(this.$overlay.remove(),this.$overlay=null);try{this.analyticsOpeningId&&window.sessionStorage.removeItem("pz_checkout_opening:"+this.analyticsOpeningId)}catch(e){}return this.analyticsOpeningId=null,this.deferred=null,this.options=null,this.successPayload=null,this.authenticationGeneration=null},e.prototype.isOpen=function(){return null!==this.deferred},e}(),angular.module("penzuApp").service("$iframeCheckout",["$q","$timeout","Auth","$rootScope","$track",n])},8505(e,t,r){"use strict";var n=r(6999);angular.module("penzuApp").controller("HeaderCtrl",["$scope","$state","Journals","Auth","$global","$track",function(e,t,r,o,a,i){return e.journals=null,e.journal=null,e.Auth=o,e.user=null,e.$global=a,n("#app-container-static").length&&n(".header").find("a[href]").each(function(){var e;if((e=n(this)).attr("href").length)return e.attr("target","_self")}),e.clickHeaderLogo=function(e){if(t.current.name.indexOf("onboard")>-1)return i.log("Onboarding Skip")},e.showSearch=function(){return o.isAuthed()&&!1!==e.navTemplate&&"account-header"!==e.navTemplate},e.showStaticButtons=function(){return!o.isAuthed()&&!o.isPaid()},e.$watchCollection("Auth.user",function(t){return e.user=t}),e.$on("$stateChangeSuccess",function(){var n,o;return e.journal=r.journal,e.journals=r.journals,(null!=t&&null!=(n=t.current)?n.headerNavigation:void 0)?e.navTemplate=t.current.headerNavigation:!1===(null!=t&&null!=(o=t.current)?o.headerNavigation:void 0)?e.navTemplate=!1:e.navTemplate=null,e.headerSearch=t.current.headerSearch}),e.logout=function(e){if(e.preventDefault(),window.confirm("Are you sure you want to log out?"))return o.logout({trackParams:{status:"200",message:"click"}}).then(function(){return setTimeout(function(){return window.location.pathname="/app/login"},0)})}}])},8744(e,t,r){r(7766),e.exports=function(e){return""+'<div class="manage-reminder__wrap"><div class="pz-card" ng-hide="activeTab == \'error\'"><div class="reminder__loader" ng-show="vm.loading"><div class="loader-tab" loader="vm.loading"></div></div><h2>Manage reminders for&nbsp;<strong ng-show="vm.journal.id">{{vm.journal.name}}</strong></h2><hr><form class="form-default" novalidate="" pz-form=""><div class="reminder-container form-group vertical reminders"><div class="reminders__content"><ul class="reminders__list"><li class="reminders__list-item" ng-repeat="reminder in vm.reminders"><p>{{::reminder.text}}</p><a class="delete" href="" ng-click="vm.deleteReminder(reminder)" pz-tooltip="Stop reminder">
2<span class="icon fa fa-trash"></span></a></li><li class="reminders__list-item add-reminder" ng-hide="vm.showAddReminder"><a href="" ng-click="vm.clickAddReminder()">+ Add new reminder</a></li></ul><div class="reminders__add" ng-show="vm.showAddReminder" ng-cloak><label for="">Add New Reminder</label><a class="cancel" href="" ng-click="vm.cancelReminder()">Cancel</a><div class="form-group"><div class="form-controls"><ui-select name="reminders" ng-model="vm.model.reminders.frequency" search-enabled="false"><ui-select-match placeholder="When should we reminder you?"><span ng-bind="$select.selected.name"></span></ui-select-match><ui-select-choices repeat="option.value as option in vm.frequencyOptions"><span>{{option.name}}</span></ui-select-choices></ui-select></div></div><div class="form-group" ng-show="vm.model.reminders.frequency == \'weekly\'"><div class="form-controls">                     <ui-select name="time" ng-model="vm.model.reminders.weekday" search-enabled="false"><ui-select-match placeholder="What day do you want your reminders?"><span ng-bind="$select.selected.name"></span></ui-select-match><ui-select-choices repeat="option.value as option in vm.weekdayOptions"><span>{{option.name}}</span></ui-select-choices></ui-select></div></div><div class="form-group" ng-show="vm.model.reminders.frequency == \'monthly\'"><div class="form-controls"><ui-select name="time" ng-model="vm.model.reminders.day" search-enabled="false"><ui-select-match placeholder="What day do you want your reminders?"><span ng-bind="$select.selected.name"></span></ui-select-match><ui-select-choices repeat="option.value as option in vm.monthDayOptions"><span>{{option.name}}</span></ui-select-choices></ui-select></div></div><div class="form-group" ng-show="vm.model.reminders.frequency &amp;&amp; vm.model.reminders.frequency != \'never\'"><div class="form-controls" ng-class="{\'reminders__is-free-user\': !vm.Auth.isPaid()}"><ui-select name="time" ng-model="vm.model.reminders.time" search-enabled="false" ng-change="selectReminderTime(vm.model.reminders.time)"><ui-select-match placeholder="What time do you want your reminders?"><span ng-bind="$select.selected.name"></span></ui-select-match><ui-select-choices repeat="option.value as option in vm.generalTimeOptions"><span>{{option.name}}</span></ui-select-choices></ui-select></div></div><div class="form-group time-selection" ng-show="vm.model.reminders.time == \'specific\' &amp;&amp; vm.Auth.isPaid()"><div class="form-controls"><label for="hour">What time?</label><div class="controls"><div class="control"> <ui-select name="hour" ng-model="vm.model.reminders.hour" search-enabled="false"><ui-select-match placeholder="hour"><span ng-bind="$select.selected.name"></span></ui-select-match><ui-select-choices repeat="option.value as option in vm.hourOptions"><span>{{option.name}}</span></ui-select-choices></ui-select></div><div class="control"><ui-select name="minute" ng-model="vm.model.reminders.minute" search-enabled="false"><ui-select-match placeholder="minute"><span ng-bind="$select.selected.name"></span></ui-select-match><ui-select-choices repeat="option.value as option in vm.minuteOptions"><span>{{option.name}}</span></ui-select-choices></ui-select></div><div class="control"><ui-select name="am" ng-model="vm.model.reminders.am" search-enabled="false"><ui-select-match placeholder="am/pm"><span ng-bind="$select.selected.name"></span></ui-select-match><ui-select-choices repeat="option.value as option in vm.ampmOptions"><span>{{option.name}}</span></ui-select-choices></ui-select></div></div></div></div></div></div></div></form></div><div class="form-actions"><button class="btn btn-primary btn-block" type="submit" ng-click="vm.createReminder()">Add reminder</button></div><div class="pz-card manage-reminders__error" ng-show="activeTab == \'error\'"><h2>Journal Not Found</h2><p>Oops. We couldn’t find that journal in your account. Are you sure you logged into the right Penzu account?</p><a class="btn btn-primary" ui-sref="login">Back to login</a></div></div>'}},8856(e,t,r){r(7766),e.exports=function(e){return""+'<div class="renew__wrap downgrade__wrap"><div class="renew__downgrade pz-card" ng-hide="activeTab == \'confirmation\'"><div class="downgrade__loader" ng-show="ui.loading"><div class="loader-tab" loader="ui.loading"></div></div><h2>Downgrade your account</h2><p class="p-large">Downgrade your account&nbsp;<span ng-show="user.access_token.user.email">associated with<strong>&nbsp;{{user.access_token.user.email}}&nbsp;</strong></span>from Penzu PRO to a free Penzu plan.</p><hr><div class="downgrade__info"><p><span style="color: #F12E29; font-weight: bold;">Fair warning:</span>&nbsp;if you decide to downgrade your PRO account, it will be reverted back to Penzu Basic, which means your entries will be combined into one journal and you will lose all of your PRO customizations.</p><p><strong>Any encryption locked journals must be unlocked if you would like them to be available after downgrading.</strong></p></div><div class="renew_offer" ng-show="showRenewOffer()"><div class="badge">LIMITED OFFER</div><div class="title">
2Having second thoughts?</div><div class="text">Renew now and get&nbsp;<span style="font-weight: bold;">two extra years</span>&nbsp;for free!</div><a class="btn btn-primary claim" ng-click="showRenewModal()">Claim offer</a></div><form class="form-default" ng-submit="downgrade()" novalidate="" pz-form=""><div pz-form-alert=""></div><div class="user-login" ng-show="!Auth.isAuthed()"><h3>Login Info</h3><div class="form-group"><div class="form-controls" ng-class="{\'invalid\': formErrors.email}"><input class="form-control" type="text" name="email" ng-change="clearValidationErrors(\'email\')" ng-model="model.user.email" placeholder="Email Address"></div></div><div class="form-group"><div class="form-controls" ng-class="{\'invalid\': formErrors.password}"><input class="form-control" type="password" name="password" ng-change="clearValidationErrors(\'password\')" ng-model="model.user.password" placeholder="Password"></div></div></div><div class="form-group"><div class="form-controls"><label for="downgrade">Type \'Downgrade\' to confirm downgrade action</label><input class="form-control" type="text" name="downgrade" ng-change="testDowngrade()" ng-model="model.downgrade" ng-required="true"></div></div><div class="downgrade__actions"><button class="btn btn-warning btn-block" type="submit" ng-disabled="!downgradeValid">Downgrade Now</button></div></form></div><div class="downgrade__confirmation" ng-show="activeTab == \'confirmation\'"><div class="pz-card"><h2>Downgrade Success</h2><p class="disclaimer">Your account has been successfully downgraded. You will now be redirected to the login page.</p><a class="btn btn-primary btn-block" href="/app/login" target="_self" ng-cloak="">Okay, got it.</a></div></div></div>'}},9141(e,t,r){"use strict";var n,o=r(6999);n=function(e,t,r,a,i,s,l,u){var c,d;return c=[1,2,3,5],d=function(e){return null==e&&(e={}),e.success||(e.success=angular.noop),e.error||(e.error=angular.noop),e.done||(e.done=angular.noop),e},{journals:[],tags:null,pageThemes:[],padThemes:[],journalThemes:{},JOURNAL_COVER_OPTIONS:["bluecheetah","bwfeather","composition","flowers","geometric","kraft","leather","reddiamond","teallines","whitekraft","bluewaves","chevrons","redtriangles","woodpaneling"],JOURNAL_COVER_COLORS:["blue","green","orange","red"],SIZES:[6,7,8,9,10,12,14,16,18],opts:{entryLimit:10},fetched:[],hasFetched:function(e){return this.fetched.indexOf(e)>-1},addFetched:function(e){if(-1===this.fetched.indexOf(e))return this.fetched.push(e)},getJournals:function(e){var r,n;return null==e&&(e={}),r=t.defer(),(null!=(n=this.journals)?n.length:void 0)&&this.hasFetched("journals")?r.resolve(angular.copy(this.journals)):this.fetchJournals(e).then(function(e){return r.resolve(e)},function(e){return r.reject(e)}),r.promise},getJournal:function(e,r){var n,o,a,i;if(null==r&&(r={}),n=t.defer(),e=parseInt(e),i=function(e){return n.resolve(angular.copy(e))},a=_.find(this.journals,{id:e}))i(a);else{if(o={},r.entries&&(o.entries=r.entries),!_.isFinite(parseInt(e)))return s.track("Id is NaN on getJournal()"),!1;this.fetchJournal(e,o).then(function(e){return i(e)},function(e){return n.reject(e)})}return n.promise},getLocalJournal:function(e){return e=parseInt(e),_.find(this.journals,{id:e})||!1},fetchJournals:function(o){var a,i;return null==o&&(o={}),a=t.defer(),r.get(e.API_ROOT+"/api/journals").then((i=this,function(e){return null==e&&(e={}),"string"==typeof e.data||e.data.error?(console.log("Fetch journals error: ",JSON.stringify(e,null,2)),console.error("Fetch journals error."),a.reject(e.data),!1):(n=i.parseJournals(e.data),i.journals=n,i.addFetched("journals"),a.resolve(n))}),function(e){return null==e&&(e={}),a.reject(e.data,e.status)}),a.promise},fetchJournal:function(n,o){var a,i,l;return null==o&&(o={}),a=t.defer(),_.isFinite(parseInt(n))?(i=function(e){return a.resolve(e)},r.get(e.API_ROOT+"/api/journals/"+n,{endpoint:"fetchJournal"}).then((l=this,function(e){var t,r,s;return null==e&&(e={}),(null!=(r=e.data)?r.error:void 0)?(console.log("Fetch Journal Error: ",JSON.stringify(e,null,2)),console.error("Fetch Journal Error"),a.reject(e.data),!1):((null!=(s=(t=l.parseJournal(e.data)).compose_setting)?s.id:void 0)&&(t.compose_setting=l.parseComposeSettings(t.compose_setting)),l.updateLocalJournal(n,t),o.entries?l.fetchEntries(n).then(function(e){return t.entries=e,i(t)}):i(t))}),function(e){return null==e&&(e={}),a.reject(e.data)}),a.promise):(s.track("Id is NaN on fetchJournal()"),!1)},lockJournal:function(n,o,a){var i,s,u,c;return null==a&&(a={}),a=d(a),i=t.defer(),s={},o.unlock?(s.unlock=1,s.plain_password=o.password):(o.use_stored_password?(s.use_stored_password=!0,s.remember_password=!0):(s.plain_password=o.password,s.password_hint=o.password_hint,s.retype_password=o.retype_password,s.remember_password=o.remember_password),s.lock=1,s.auto=o.auto,o.encryption&&(s.lock_type="encrypt",s.remember_password=null,s.auto=null)),(u=r.put(e.API_ROOT+"/api/journals/"+n,s)).success((c=this,function(e){var t,r,u;return e.error?(a.done(e),a.error(e)):(r={lockType:s.lock_type||"default",rememberPassword:o.remember_password,autoLock:o.auto},o.unlock?l.log("Unlock Journal",r):l.log("Lock Journal",r),u={lock_type_id:s.unlock?1:2,password_hint:o.password_hint||""},void 0!==o.remember_password&&(u.remember_password=o.remember_password),void 0!==o.auto&&(u.auto=o.auto),t=c.parseJournal(e),t=_.extend(u,t),t=c.updateLocalJournal(n,t),a.done(t),a.success(t),i.resolve(t))})),u.error(function(e,t){return a.done(e),a.error(e,t),i.reject(e)}),i.promise},autolockJournalPromise:null,autolockJournal:function(e,t){var r,n;return null==t&&(t={}),this.autlockJournalPromise?this.autlockJournalPromise:(t=d(t),l.log("Autolock Journal"),r={use_stored_password:!0,auto:!0},this.autolockJournalPromise=this.lockJournal(e,r,t).then((n=this,function(){return n.autolockJournalPromise=null})))}
2,createJournal:function(n,o){var a,i,s;return null==o&&(o={}),o=d(o),a=t.defer(),i={name:n.name},n.color||n.photo||(n.color="blue"),r.post(e.API_ROOT+"/api/journals",i,{endpoint:"createJournal"}).then((s=this,function(e){var t,r;return null==e&&(e={}),o.done(),(null!=(r=e.data)?r.error:void 0)?(console.log("Create Journal Error: ",JSON.stringify(e,null,2)),console.error("Create Journal Error"),o.error(e.data),a.reject(e.data),!1):(l.log("New Journal"),t=s.parseJournal(e.data),s.journals.unshift(t),o.success(t),a.resolve(t))}),function(e){return null==e&&(e={}),o.done(),console.log("Create Journal Error: ",JSON.stringify(e,null,2)),console.error("Create Journal Error"),o.error(e.data,e.status),a.reject(e.data)}),a.promise},updateJournal:function(n,o,a){var i,s,u;return null==a&&(a={}),a=d(a),i=t.defer(),s={name:n.name},_.isUndefined(a.initial_naming)||(s.initial_naming=!0),_.isUndefined(n.auto)||(s.auto=n.auto),r.put(e.API_ROOT+"/api/journals/"+o,s,{endpoint:"updateJournal"}).then((u=this,function(e){var t,r;return null==e&&(e={}),a.done(),(null!=(r=e.data)?r.error:void 0)?(console.log("Update Journal Error: ",JSON.stringify(e,null,2)),console.error("Update Journal Error"),a.error(e.data),i.reject(e.data),!1):(l.log("Update Journal Settings"),t=u.parseJournal(e.data),u.updateLocalJournal(t.id,t),a.success(t),i.resolve(t))}),function(e){return null==e&&(e={}),a.done(e.data),console.log("Update Journal Error: ",JSON.stringify(e,null,2)),console.error("Update Journal Error"),a.error(e.data,status),i.reject(e.data)}),i.promise},deleteJournal:function(n,o){var a,i;return null==o&&(o={}),o=d(o),a=t.defer(),r.delete(e.API_ROOT+"/api/journals/"+n).then((i=this,function(e){var t,r;return null==e&&(e={}),o.done(),(null!=(r=e.data)?r.error:void 0)?(console.log("Delete Journal Error: ",JSON.stringify(e,null,2)),console.error("Delete Journal Error"),o.error(e.data),a.reject(e.data),!1):(l.log("Delete Journal"),t=_.map(i.journals,"id").indexOf(n),i.journals.splice(t,1),o.success(),a.resolve())}),function(e){return null==e&&(e={}),o.done(e.data),console.log("Delete Journal Error: ",JSON.stringify(e,null,2)),console.error("Delete Journal Error"),o.error(e.data,e.status),a.reject(e.data)}),a.promise},resetJournalPassword:function(n){var o,a;return o=t.defer(),(a=r.get(e.API_ROOT+"/api/journals/"+n+"/request_unlock_link")).success(function(t){return t.error?(o.reject(t),!1):(e.$broadcast("$track:log","Reset Journal Password"),o.resolve(t))}),a.error(function(e,t){return o.reject(e)}),o.promise},getJournalTotalPages:function(e){return e?Math.ceil(e/this.opts.entryLimit):0},updateLocalJournal:function(e,t){var r,n,o;return e=parseInt(e),(n=_.find(this.journals,{id:e}))||this.journals.push(t),-1!==(r=n?_.indexOf(this.journals,n):this.journals.length-1)&&n?(o=angular.extend(this.journals[r],t),this.journals.splice(r,1,o),o):t},getJournalWordCount:function(n){var o,a;return o=t.defer(),(a=r.get(e.API_ROOT+"/api/journals/"+n+"/word_count")).success(function(e){return e.error?(console.log("Get journal word count failed: ",error),console.error("Get journal word count failed"),o.reject(e),!1):(l.log("Get Journal Word Count"),o.resolve(e))}),a.error(function(e,t){return console.log("Get journal word count failed: ",e),console.error("Get journal word count failed"),o.reject(e)}),o.promise},disableAutolock:function(n){var o,a,i;return o=t.defer(),(a=r.put(e.API_ROOT+"/api/journals/"+n+"/disable_auto_lock")).success((i=this,function(e){var t;return e.error||!e.success?(console.log("Disable autolock failed: ",error),console.error("Disable autolock failed"),o.reject(e),!1):(t=i.parseJournal(e),o.resolve(t))})),a.error(function(e,t){return console.log("Disable autolock failed: ",e),console.error("Disable autolock failed"),o.reject(e)}),o.promise},createJournalCover:function(t,n,o){var a,i,s;return null==o&&(o={}),o=d(o),a={name:n.color||"blue"},(i=r.post(e.API_ROOT+"/api/journals/"+t+"/journal_cover",a)).success((s=this,function(e){var r;return r=s.updateLocalJournal(t,e),o.done(r),o.success(r)})),i.error(function(e,t){return o.done(e),o.error(e,t)})},updateJournalCover:function(n,o,a,i){var s,u,c,p;return null==i&&(i={}),s=t.defer(),i=d(i),u={name:a.name||null,normal_url:a.theme||a.image||null},(c=r.put(e.API_ROOT+"/api/journals/"+n+"/journal_cover/"+o,u)).success((p=this,function(e){var t,r;
2return t=name||"custom",l.log("Update Journal Cover",{cover:t}),r=p.updateLocalJournal(n,e),i.done(r),i.success(r),s.resolve(r)})),c.error(function(e,t){return i.done(e),i.error(e,t),s.reject(e)}),s.promise},getJournalThemes:function(e,r){var n,o,a,i,s,l,u;return null==r&&(r={}),(r=d(r)).local||(r.local=!1),n=t.defer(),o=String(e),this.journalThemes[o]?(r.done(),r.success(this.journalThemes[o]),n.resolve(this.journalThemes[o]),n.promise):(a=this.getLocalJournal(e),(l=this.journalThemes[o]?this.journalThemes[o]:{}).pageThemes||(l.pageThemes=[]),l.padThemes||(l.padThemes=[]),l.composeSettings||(l.composeSettings={}),(null!=a?a.id:void 0)&&(l.composeSettings=this.parseComposeSettings(a.compose_setting)),s=this.fetchJournalPageThemes(e),i=this.fetchJournalPadThemes(e),t.all([s,i]).then((u=this,function(e){return l.pageThemes=e[0],l.padThemes=e[1],u.journalThemes[o]=l,r.done(),r.success(l),n.resolve(l)}),function(e){return n.reject(e)}),n.promise)},getPadTheme:function(e,r,n){var o,a,i,s,l;return null==n&&(n={}),_.isUndefined(r)?(n.error(),o.reject("Pad theme missing."),o.promise):(o=t.defer(),n=d(n),l=this,a=function(){return l.fetchPadTheme(e,r).then(function(e){return n.done(),n.success(e),o.resolve(e)},function(e){return o.reject(e)})},(i=this.journalThemes[String(e)])&&(s=_.find(i.padThemes,function(e){return String(e.id)===String(r)}))?(n.done(),n.success(s),o.resolve(s)):a(),o.promise)},getPageTheme:function(e,r,n){var o,a,i,s,l;return null==n&&(n={}),n=d(n),o=t.defer(),l=this,a=function(){return l.fetchPageTheme(e,r).then(function(e){return n.done(),n.success(e),o.resolve(e)},function(e){return o.reject(e)})},(i=this.journalThemes[String(e)])&&(s=_.find(i.pageThemes,function(e){return String(e.id)===String(r)}))?(n.done(),n.success(s),o.resolve(s)):a(),o.promise},fetchJournalPageThemes:function(n,o){var a,i,s,l;return null==o&&(o={}),a=t.defer(),i=function(e){return null==e&&(e={}),console.log("Fetch page themes error: ",JSON.stringify(e,null,2)),console.error("Fetch page themes error"),a.reject(e.data)},l=this,s=function(e){var t,r;return null==e&&(e={}),(null!=(t=e.data)?t.error:void 0)?(i(e),!1):(r=l.parsePageThemes(e.data),a.resolve(r))},r.get(e.API_ROOT+"/api/journals/"+n+"/page_themes?public=true",{endpoint:"fetchPageThemes"}).then(s,i),a.promise},fetchJournalPadThemes:function(n,o){var a,i,s,l;return null==o&&(o={}),a=t.defer(),i=function(e){return null==e&&(e={}),console.log("Fetch pad themes error: ",JSON.stringify(e,null,2)),console.error("Fetch pad themes error"),a.reject(e.data)},l=this,s=function(e){var t,r;return null==e&&(e={}),(null!=(t=e.data)?t.error:void 0)?(i(e),!1):(r=l.parsePadThemes(e.data),a.resolve(r))},r.get(e.API_ROOT+"/api/journals/"+n+"/pad_themes",{endpoint:"fetchPadThemes"}).then(s,i),a.promise},fetchPadTheme:function(n,o,a){var i,s,l;return null==a&&(a={}),a=d(a),i=t.defer(),o=parseInt(o),isNaN(n)&&console.error("journalId is NaN while fetching pad theme"),o||(o=1),(s=r.get(e.API_ROOT+"/api/journals/"+n+"/pad_themes/"+o)).success((l=this,function(e){return a.done(),e=l.parsePadTheme(e),a.success(e),i.resolve(e)})),s.error(function(e,t){return a.done(e),a.error(e,t),console.log("Error fetching pad theme: ",e),console.error("Error fetching pad theme."),i.reject(e)}),i.promise},fetchPageTheme:function(n,o,a){var i,s,l;return null==a&&(a={}),a=d(a),i=t.defer(),isNaN(n)&&console.error("journalId is NaN while fetching page theme"),o||(o=1),(s=r.get(e.API_ROOT+"/api/journals/"+n+"/page_themes/"+o)).success((l=this,function(e){return a.done(),e=l.parsePageTheme(e),a.success(e),i.resolve(e)})),s.error(function(e,t){return a.done(e),a.error(e,t),console.log("Error fetching page theme: ",e),console.error("Error fetching page theme."),i.reject(e)}),i.promise},updateJournalComposeSettings:function(n,o,a,i){var l,u,c,p;return null==i&&(i={}),i=d(i),l=t.defer(),u={font:n.fontFamily,font_size:n.fontSize,display_date_method:"created_at",default_pad_theme_id:n.default_pad_theme_id?n.default_pad_theme_id:1,default_page_theme_id:n.default_page_theme_id?n.default_page_theme_id:1},(c=r.put(e.API_ROOT+"/api/journals/"+a+"/compose_setting/"+o,u)).success((p=this,function(t){var r;return i.done(),t.error?(s.track("Update journal compose settings error. Compose settings: ["+o+"], Journal Id: ["+a+"]"),i.error(t),!1):(e.$broadcast("$track:log","Update Journ
2al Compose Settings"),t=p.parseComposeSettings(angular.copy(t)),r=String(a),p.journalThemes[r].composeSettings=t,i.success(t),l.resolve(t))})),c.error(function(e,t){return i.done(e),i.error(e,t),l.reject(e)}),l.promise},createJournalReminders:function(n,o,i){var s,u,c,p,h;return null==i&&(i={}),s=t.defer(),i=d(i),c={general_time:n.time||"morning",frequency:n.frequency},a.isPaid()&&("morning"===c.general_time?(delete c.general_time,c.hour=7):"noon"===c.general_time?(delete c.general_time,c.hour=12):"evening"===c.general_time&&(delete c.general_time,c.hour=19)),"specific"===c.general_time&&(n.hour&&(delete c.general_time,c.hour=parseInt(n.hour),"pm"===n.am&&(c.hour+=12)),c.minute=n.minute||"0"),"weekly"===c.frequency?c.weekday=void 0!==n.weekday?n.weekday:1:"monthly"===c.frequency&&(c.day=void 0!==n.day?n.day:1),console.log("Create reminder: ",c,n),u=function(e){return null==e&&(e={}),i.done(),i.error(e.data,e.status),console.log("Create Reminder Error",JSON.stringify(e,null,2)),console.error("Create Reminder Error"),s.reject(e.data)},h=this,p=function(e){var t,r,o;return null==e&&(e={}),i.done(),(null!=(t=e.data)?t.error:void 0)?(u(e),!1):(o=c.frequency+" ("+(n.time||"morning")+")",l.log("Create Reminder",{time:o,source_path:window.location.pathname}),r=h.parseReminder(e.data),i.success(r),s.resolve(r))},r.post(e.API_ROOT+"/api/journals/"+o+"/reminders",c).then(p,u),s.promise},getJournalReminders:function(n){var o,a,i,s;return o=t.defer(),s=this,i=function(e){var t;return e.error?(a(e),!1):(t=s.parseReminders(e.data),o.resolve(t))},a=function(e){return o.reject(e)},r.get(e.API_ROOT+"/api/journals/"+n+"/reminders").then(i,a),o.promise},deleteJournalReminder:function(n,o){var a,i;return a=t.defer(),(i=r.delete(e.API_ROOT+"/api/journals/"+n+"/reminders/"+o)).success(function(t){return console.log("Deleted journal reminder"),e.$broadcast("$track:log","Delete Reminder",{authed:!0}),a.resolve(t)}),i.error(function(e,t){return a.reject(e,t)}),a.promise},deleteJournalReminderUnauthed:function(n,o){var a,i;return a=t.defer(),(i=r.get(e.API_ROOT+"/api/dr/"+n+"?rid="+o)).success(function(t){return console.log("Deleted journal reminder"),e.$broadcast("$track:log","Delete Reminder",{authed:!1}),a.resolve(t)}),i.error(function(e,t){return a.reject(e,t)}),a.promise},toggleLookingGlass:function(n,o){var a,i,s;return null==o&&(o=!0),a=t.defer(),(i=r.put(e.API_ROOT+"/api/journals/"+n+"/toggle_journal_looking_glass",{})).success((s=this,function(t){return t.error?(a.reject(t),!1):(e.$broadcast("$track:log","Toggle Looking Glass",{value:o}),s.updateLocalJournal(n,{looking_glass_status:o?"On":"Off"}),a.resolve(t))})),i.error(function(e,t){return a.reject(e)}),a.promise},disableLookingGlass:function(n){var o,a;return o=t.defer(),(a=r.put(e.API_ROOT+"/api/dlg/"+n,{})).success(function(t){return t.error?(o.reject(t),!1):(e.$broadcast("$track:log","Disable Looking Glass"),o.resolve(t))}),a.error(function(e,t){return o.reject(e)}),o.promise},excludeLookingGlass:function(n,o){var a,i;return a=t.defer(),(i=r.put(e.API_ROOT+"/api/elg/"+n,{eid:o})).success(function(t){return t.error?(a.reject(t),!1):(e.$broadcast("$track:log","Exclude Looking Glass Entry"),a.resolve(t))}),i.error(function(e,t){return a.reject(e)}),a.promise},getEntry:function(e,r,n){var o,a;return null==n&&(n={}),n=d(n),o=t.defer(),e=parseInt(e),r=parseInt(r),this.fetchEntry(e,r).then((a=this,function(e){return a.returnEntry(e,r,n).then(function(e){return o.resolve(e)})}),function(t){return console.error("Could not fetch entry with id of "+e+" in journal with i
2d of "+r),n.error(),o.reject(t)}),o.promise},getEntries:function(e,r){var n,o,a;return null==e&&(e=[]),n=t.defer(),o=[],_.each(e,(a=this,function(e){return o.push(a.getEntry(e,r))})),t.all(o).then(function(e){return n.resolve(e)},function(e){return n.reject(e)}),n.promise},returnEntry:function(e,r,n){var o,a,i,s;return null==n&&(n={}),n=d(n),i=t.defer(),_.isFinite(parseInt(r))?(s=this,o=function(e){var n,o,a;return o=t.defer(),(null!=(a=e.pad_theme)?a.id:void 0)?o.resolve(e):isNaN(parseInt(e.pad_theme_id))?(n=e.default_pad_theme_id||0,s.getPadTheme(r,n).then(function(t){return e.default_pad_theme=t,o.resolve(e)})):s.getPadTheme(r,e.pad_theme_id).then(function(t){return e.pad_theme=t,o.resolve(e)}),o.promise},a=function(e){return function(n){var o,a;return o=t.defer(),(null!=(a=n.page_theme)?a.id:void 0)?o.resolve(n):n.page_theme_id?e.getPageTheme(r,n.page_theme_id).then(function(e){return n.page_theme=e,o.resolve(n)}):e.getPageTheme(r,n.default_page_theme_id).then(function(e){return n.default_page_theme=e,o.resolve(n)}),o.promise}}(this),this.setDefaultEntryThemes(e,r).then(function(e){return function(s){var l,u;if((null!=(l=s.original_journal_settings)&&null!=(u=l.compose_setting)?u.id:void 0)&&(s.original_journal_settings.compose_setting=e.parseComposeSettings(s.original_journal_settings.compose_setting)),t.all([o(s),a(s)]).then(function(e){return s=angular.extend(e[0],e[1]),n.success(s),i.resolve(s)},function(e){return console.log("Error parsing entry: ",e),i.reject(e)}),s.id&&e.fetchEntryPhotos(r,s.id,{success:function(t){var r;return s.photos=t,s.id&&(null!=(r=e.entry)?r.id:void 0)===s.id&&(e.entry.photos=t),s}}),s.id)return e.fetchEntryTags(s.id,{success:function(t){var r;return s.tags=t,s.id&&(null!=(r=e.entry)?r.id:void 0)===s.id&&(e.entry.tags=t),s}})}}(this),function(e){return console.log("Set default entry themes error: ",e),i.reject(e)}),i.promise):(console.error("journalId is NaN on returnEntry()"),!1)},getNewEntry:function(e,r){var n,o,a;return null==r&&(r={}),r=d(r),n=t.defer(),o={title:"",body:"",created_at:moment().toDate(),journal:{id:e}},this.fetchEntries(e,{limit:10}).then((a=this,function(t){return o.previous=t.entries,o.next=[],a.returnEntry(o,e,r).then(function(e){return n.resolve(e)},function(e){return console.log("Return entry error: ",e),n.reject(e)})})),n.promise},getEntryFromJournal:function(e,t,r){var n,o;return null==r&&(r={}),r=d(r),!!(null!=e&&null!=(o=e.entries)?o.entries:void 0)&&!!(n=_.find(e.entries.entries,function(e){return e.id===t}))&&(n=this.parseEntry(n),angular.copy(n))},fetchEntryPromise:{entryId:null,promise:null},fetchEntry:function(n,o){var a,i,l,u,c;return(null!=(l=this.fetchEntryPromise)?l.entryId:void 0)===n?this.fetchEntryPromise.promise:(a=t.defer(),this.fetchEntryPromise={entryId:n,promise:a.promise},_.isFinite(parseInt(n))||(console.log("Entry is NaN: ",n),s.track("Entry is NaN on fetchEntry()")),i=function(e){return null==e&&(e={}),console.log("Fetch Entry Error: ",JSON.stringify(e,null,2)),console.error("Fetch Entry Error"),this.fetchEntryPromise={entryId:null,promise:null},a.reject(e.data)},c=this,u=function(e){var t,r;return null==e&&(e={}),(null!=(r=e.data)?r.error:void 0)?i(e):(c.fetchEntryPromise={entryId:null,promise:null},t=c.parseEntry(e.data),a.resolve(t))},r.get(e.API_ROOT+"/api/journals/"+o+"/entries/"+n,{params:{previous:10,next:10}}).then(u).catch(i),a.promise)},fetchEntriesPromise:{journalId:null,promise:null},fetchEntries:function(n,a){var i,l,u,c,d,p,h;return null==a&&(a={}),(null!=(c=this.fetchEntriesPromise)?c.journalId:void 0)===n?this.fetchEntriesPromise.promise:(i=t.defer(),this.fetchEntriesPromise={journalId:n,promise:i.promise},u={limit:this.opts.entryLimit||25},a.params&&(u=_.extend(u,a.params)),u.since&&(u.since=o.param({since:u.since}).replace("since=","")),_.isFinite(parseInt(n))||s.track("Entry is NaN on fetchEntries()"),h=this,l=function(e){return console.log("Fetch Entries Error: ",JSON.stringify(e,null,2)),console.error("Fetch Entries Error"),h.fetchEntriesPromise={journalId:null,promise:null},i.reject(e.data)},d=function(e){return function(t){var r,n;return(null!=(n=t.data)?n.error:void 0)?l(t):(r=e.parseEntries(t.data),e.fetchEntriesPromise={journalId:null,promise:null},i.resolve(r))}}(this),p=e.API_ROOT+"/api/journals/"+n+"/entries",r.get(p,{params:u,endpoint:"fetchEntries"}).then(d).catch(l),i.promise)},updateEntry:function(n,a,i,s){var u,c,p,h,m,g;return null==s&&(s={}),u=t.defer(),s=d(s),p={journal_id:i,entry_id:a,modified:moment().unix()},n.title&&(p.title=n.title),n.created_at&&(p.created=moment(n.created_at).unix()),(null!=(h=n.prompt)?h.id:void 0)&&(p.prompt_id=n.prompt.id),n.body&&(p.richtext_body=this.sanitizeEntryHtml(n.body)),_.isUndefined(n.starred)||(p.starred=n.starred),void 0!==n.page_theme_id&&(p.page_theme_id=0===n.page_theme_id?1:n.page_theme_id),void 0!==n.pad_theme_id&&(p.pad_theme_id=0===n.pad_theme_id?1:n.pad_theme_id),p.richtext_body&&p.richtext_body.length||(console.log("model.body: ",n.body),console.log("parsed formdata body: ",p.richtext_body),console.log("CKEDITOR content: ",CKEDITOR.instances.editor.getData()),console.log("CKEDITOR DOM content: ",o(".cke_wysiwyg_div").html()),console.warn("Saving entry with no body")),c=function(e){return null==e&&(e={}),console.log("Update entry error: ",JSON.stringify(e,null,2)),console.error("Update entry error."),l.log("Entry Update Error"),u.reject(e.data)},g=this,m=function(e){var t,r;return null==e&&(e={}),console.log("Entry update response: ",e),(null!=(r=e.data)?r.error:void 0)||!_.isObject(e)?(c(e),!1):e.data&&204!==e.status?(t=g.parseEntry(e.data),s.success(t),u.resolve(t)):(l.log("Entry Update 204 Response"),console.log("Empty update entry response."),u.resolve(),!0)},r.put(e.API_ROOT+"/api/journals/"+i+"/entries/"+a,p,{endpoint:"updateEntry"}).then(m,c),u.promise},activateEntry:function(t,n,o){var a,i;return null==o&&(o={}),o=d(o),(a=r.put(e.API_ROOT+"/api/journals/"+n+"/entries/"+t,{status_id:1})).success((i=this,function(e){var t,r,a;if(o.done(),!e.error)return t=i.parseEntry(e),(null!=(r=i.entry)?r.id:void 0)===t.id&&(i.entry=_.extend(i.entry,t)),i.journals&&(a=i.updateEntryInLocalJournal(t,n)),!1===a&&console.log("Entry did not update in local journal."),o.success(t);o.error(e)})),a.error(function(e,t){return o.done(e),o.error(e,t)})},moveEntries:function(n,o,a,i){var s,u,c;return null==i&&(i={}),s=t.defer(),u={new_journal_id:n,entry_ids:o=_.isArray(o)?o:[o]},i.moveAll&&(u.all_entries=!0),i.since&&(u.since=i.since),r.put(e.API_ROOT+"/api/journals/"+a+"/entries/move",u).then((c=this,function(e){return(e=e.data).error?(console.log("Move entries error: ",e),console.error("Move entries error."),void s.reject(e)):(l.log("Move Entry"),e.moved=c.parseEntries(e.moved),_.each(e.moved.entries,function(e){return c.updateEntryInLocalJournal(e,a)}),s.resolve(e))}),function(e,t){return console.log("Move entries error: ",e),console.error("Move entries error."),s.reject(e)}),s.promise},unlockEntry:function(n,o,a,i){var s,u,c,d,p;return null==i&&(i={}),s=t.defer(),c={unlock:!0,plain_password:n.password},p=this,d=function(e){var t;return null==e&&(e={}),e.data.error?(u(e),!1):(l.log("Unlock Entry"),t=p.parseEntry(e.data),!1===p.updateEntryInLocalJournal(t,a)&&console.warn("Entry not found in local journal."),s.resolve(t))},u=function(e){return s.reject(e.data),!1},r.put(e.API_ROOT+"/api/journals/"+a+"/entries/"+o,c).then(d,u),s.promise},lockEntry:function(n,o,a,i){var s,u,c,d,p;return null==i&&(i={}),s=t.defer(),c={lock:!0,plain_password:n.password,retype_password:n.passwordConfirm,password_hint:n.hint},p=this,d=function(e){var t;return null==e&&(e={}),e.data.error?(u(e),!1):(l.log("Lock Entry"),t=p.parseEntry(e.data),!1===p.updateEntryInLocalJournal(t,a)&&console.warn("Entry not found in local journal."),s.resolve(t))},u=function(e){return s.reject(e.data),!1},r.put(e.API_ROOT+"/api/journals/"+a+"/entries/"+o,c).then(d,u),s.promise},createEntry:function(n,o,a){var i,s,u,c;return null==a&&(a={}),i=t.defer(),a=d(a),s={journal_id:o,title:n.title,richtext_body:n.body,created_at:n.created_at},a.trackParams||(a.trackParams={}),angular.extend({},{word_count:n.body.split(" ").length},a.trackParams),(null!=(u=n.prompt)?u.id:void 0)&&(s.prompt_id=n.prompt.id),s.richtext_body=this.sanitizeEntryHtml(s.r
2ichtext_body),r.post(e.API_ROOT+"/api/journals/"+o+"/entries",s,{endpoint:"createEntry"}).then((c=this,function(e){var t,r,n;return null==e&&(e={}),(null!=(r=e.data)&&null!=(n=r.entry)?n.id:void 0)?(t=c.parseEntry(e.data),c.addEntriesToLocalJournal([t],o),c.returnEntry(t,t.journal.id).then(function(e){return i.resolve(e)})):(l.log("Create Entry Error",{responseCode:e.status}),console.log("Create entry error: ",JSON.stringify(e,null,2)),console.error("Create entry error"),void i.reject(e.data))}),function(e){return null==e&&(e={}),console.log("Create entry error: ",JSON.stringify(e,null,2)),console.error("Create entry error"),i.reject(e.data,e.status)}),i.promise},deleteEntries:function(n,o,a){var i,s,u,c,d,p;return null==a&&(a={}),i=t.defer(),u={permanent:a.permanent||!1},n=_.isArray(n)?n:[n],d=e.API_ROOT+"/api/journals/"+o+"/entries/delete",u.permanent&&(d+="?permanent=true"),s={entry_ids:n},u.permanent&&(s.permanent=!0),a.allEntries&&(s.all_entries=!0),a.since&&(s.since=a.since),(c=r.put(d,s)).success((p=this,function(e){var t;if(!e.error)return l.log("Delete Entry",{permanent:u.permanent}),e.trashed=p.parseEntries(e.trashed),t=_.map(e.trashed.entries,"id"),p.removeEntriesFromLocalJournal(t,o,u),console.log("Return delete entries: ",e),i.resolve(e);i.reject(e)})),c.error(function(e,t){return console.log("Delete entries error: ",JSON.stringify(e,null,2)),console.error("Delete entries error."),i.reject(e)}),i.promise},restoreEntry:function(e,t){return this.restoreEntries([e],t)},restoreEntries:function(n,o){var a,i,s,u;return a=t.defer(),i={entry_ids:n},(s=r.put(e.API_ROOT+"/api/journals/"+o+"/entries/restore",i)).success((u=this,function(e){return e.error?(console.log("Restore entries error: ",e),console.error("Restore entries error."),void a.reject(e)):(console.log("restored entries: ",e),l.log("Restore Entry"),e.restored=u.parseEntries(e.restored),_.each(e.restored,function(e){return u.updateEntryInLocalJournal(e,o)}),a.resolve(e))})),s.error(function(e,t){return console.log("Restore entries error: ",e),console.error("Restore entries error."),a.reject(e,t)}),a.promise},updateEntryInLocalJournal:function(e,t){var r,n,o,a,i,s,l;return t=parseInt(t),!!(a=_.find(this.journals,{id:t}))&&!(_.indexOf(this.journals,a)<0)&&((n=_.find(a.entries.entries,{id:e.id}))||(n=e,a=this.addEntriesToLocalJournal([n],t)),!((o=_.indexOf(a.entries.entries,n))>0)&&(n.journal.id!==t&&(null!=a?a.entries:void 0)?(l=a.entries.entries.splice(o,1),a.total_entries=a.total_entries-1,a=this.parseJournal(a),i=_.extend(l[0],n),s=_.find(this.journals,{id:n.journal.id}),_.indexOf(this.journals,s),s.entries||(s.entries={entries:[]}),s.entries.entries.unshift(i),s.total_entries=s.total_entries+1,s=this.parseJournal(s)):o<0?(a.entries||(a.entries={}),(r=a.entries).entries||(r.entries=[]),a.entries.entries.unshift(n)):a.entries.entries[o]=_.extend(a.entries.entries[o],n),this.journals=angular.copy(this.journals),n))},removeEntriesFromLocalJournal:function(e,t,r){var n;return null==r&&(r={}),!!(n=this.getLocalJournal(t))&&(console.log("Remove entries from local journal: ",e),_.each(e,function(e){return e=parseInt(e),n.entries.entries=_.reject(n.entries.entries,{id:e})}),r.permanent?n.total_trashed_entries-=e.length:(n.total_entries-=e.length,n.total_trashed_entries+=e.length),n.total_pages=this.getJournalTotalPages(n.total_entries),this.updateLocalJournal(n.id,n),n)},addEntriesToLocalJournal:function(e,t){var r,n;return!!(n=this.getLocalJournal(t))&&(n.entries||(n.entries={}),(r=n.entries).entries||(r.entries=[]),n.entries.entries=n.entries.entries.concat(e),n.total_entries+=e.length,n.total_pages=this.getJournalTotalPages(n.total_entries),this.updateLocalJournal(n.id,n),n)},shareEntryEmail:function(t,n,o,a){var i,s,l;return null==a&&(a={}),a=d(a),i={share_recipients:t.share_recipients.join(","),email_share:!0},t.share_message&&(i.share_message=t.share_message),e.$broadcast("$track:log","Share Entry",{type:"email"}),(s=r.put(e.API_ROOT+"/api/journals/"+o+"/entries/"+n+"/email_share",i)).success((l=this,function(e){var t;return e.error?(a.done(e),void a.error(e)):(t=l.parseEntry(e),a.done(t),a.success(t))})),s.error(function(e,t){return a.done(e),a.error(e,t)})},fetchEntryPhotos:function(t,n,o){var a,i;return null==o&&(o={}),o=d(o),(a=r.get(e.API_ROOT+"/api/journals/"+t+"/entries/"+n+"/photos")).success((i=this,function(e){var t;return t=i.parseEntryPhotos(e),o.done(t),o.success(t)})),a.error(function(e,t){return o.done(e),o.error(e,t)})},fetchPublicEntry:function(n,o){var a,i,s;return null==o&&(o={}),o=d(o),a=t.defer(),(i=r.get(e.API_ROOT+"/api/pe/"+n)).success((s=this,function(e){var t;return o.done(),e.error?(o.error(e),void a.reject(e)):((t=s.parseEntry(e)).original_journal_settings.compose_setting=s.parseComposeSettings(t.original_journal_settings.compose_setting),console.log("Fetched public entry: ",t),o.success(t),a.resolve(t))})),i.error(function(e,t){return o.done(),o.error(e,t),a.reject(e)}),a.promise},fetchShareLink:function(t,n,o){var a,i;return null==o&&(o={}),o=d(o),(a=r.get(e.API_ROOT+"/api/journals/"+t+"/entries/"+n+"/public_link")).success((i=this,function(e){var t;return t=i.parsePublicLink(e),o.done(t),o.success(t)})),a.error(function(e,t){return o.done(e),o.error(e,t)})},fetchUnshareLink:function(t,n,o){var a,i;return null==o&&(o={}),o=d(o),(a=r.get(e.API_ROOT+"/api/journals/"+t+"/entries/"+n+"/unpublic_link")).success((i=this,function(e){var t;return t=i.parsePublicLink(e),o.done(t),o.success(t)})),a.error(function(e,t){return o.done(e),o.error(e,t)})},setDefaultEntryThemes:function(e,r){var n,o;return null==e&&(e=this.entry),null==r&&(r=e.journal.id),o=t.defer(),n=function(e,t){var r,n;return e.journal=angular.extend(e.journal,t),e.is_read_only||(e.pad_theme_id||(e.default_pad_theme_id=(null!=(r=t.compose_setting.default_pad_theme)?r.id:void 0)||1),e.page_theme_id||(e.default_page_theme_id=(null!=(n=t.compose_setting.default_page_theme)?n.id:void 0)||1)),e},this.getJournal(r).then(function(t){return e=n(e,t),o.resolve(e)},function(e){return o.reject(e)}),o.promise},fetchRandomPrompt:function(){var n,o,a;return n=t.defer(),o=function(e){return null==e&&(e={}),console.log("Fetch prompt error: ",JSON.stringify(e,null,2)),console.error("Fetch prompt error"),n.reject(e.data)},a=function(e){var t;return null==e&&(e={}),(null!=(t=e.data)?t.error:void 0)?(o(e),!1):(l.log("Fetch Random Prompt"),n.resolve(e.data.prompt))},r.get(e.API_ROOT+"/api/user/get_random_prompt").then(a,o),n.promise},getTags:function(e){var r;return null==e&&(e={}),r=t.defer(),this.tags?r.resolve(this.tags):this.fetchTags(null,e).then(function(e){return r.resolve(e)},function(e){return r.reject(e)}),r.promise},fetchTags:function(n,o){var a,i,s,l,u;return null==o&&(o={}),a=t.defer(),i=function(e){return null==e&&(e={}),a.reject(e)},u=this,s=function(e){var t,r;return null==e&&(e={}),(null!=(t=e.data)?t.error:void 0)?(i(e),!1):(r=u.parseEntryTags(e.data),u.tags=r,a.resolve(r))},l=e.API_ROOT+"/api/tags",n&&(l+="?journal_id="+n),r.get(l).then(s,i),a.promise},fetchTag:function(n,o){var a,i,s,l;return null==o&&(o={}),a=t.defer(),i=function(e){return null==e&&(e={}),a.reject(e)},l=this,s=function(e){var t,r;if(null==e&&(e={}),!(null!=(t=e.data)?t.error:void 0))return r=l.parseEntryTag(e.data),a.resolve(r);i(e)},r.get(e.API_ROOT+"/api/tags/"+n,{endpoint:"fetchTag"}).then(s,i),a.promise},createEntryTag:function(n,o,a){var i,s,u,c,p;return null==a&&(a={}),i=t.defer(),a=d(a),u={name:n.name,entries_added_to:String(o)||null,created:moment().unix()},p=this,c=function(e){var t;return null==e&&(e={}),a.done(),a.isNew&&l.log("Create New Tag"),l.log("Add Tag"),t=p.parseEntryTag(e.data),p.tags&&p.tags.push(t),a.success(t),i.resolve(t)},s=function(e){return null==e&&(e={}),a.done(e),a.error(e.data),i.reject(e.data)},r.post(e.API_ROOT+"/api/tags",u).then(c,s),i.promise},fetchEntryTags:function(t,n){var o,a;return null==n&&(n={}),n=d(n),(o=r.get(e.API_ROOT+"/api/tags",{params:{entry_id:t}})).success((a=this,function(e){var r,o;return n.done(),o=a.parseEntryTags(e),t===(null!=(r=a.entry)?r.id:void 0)&&(a.entry.tags=o),n.success(o)})),o.error(function(e,t){return n.done(e),n.error(e,t)})},deleteEntryTag:function(t,n,o){var a,i;return null==o&&(o={}),o=d(o),n?(a={updated:moment().unix(),entries_removed_from:String(n)},i=r.put(e.API_ROOT+"/api/tags/"+t,a)):i=r.delete(e.API_ROOT+"/api/tags/"+t),i.success(function(t){return o.done(),t.error?(o.error(t),!1):(n?e.$broadcast("$track:log","Remove Tag"):e.$broadcast("$track:log","Delete Tag"),o.success())}),i.error(function(e,t){return o.done(e),o.error(e,t)})},updateEntryTag:function(n,o,a){var i,s,u,c;return null==a&&(a={}),i=t.defer(),s={name:n.name},(u=r.put(e.API_ROOT+"/api/tags/"+n.id,s)).success((c=this,function(e){var t;return l.log("Update Tag"),t=c.parseEntryTag(e),i.resolve(t)})),u.error(function(e,t){return i.reject(tag)}),i.promise},getEntryTagByName:function(e){var t,r;return void 0!==(r=null!=(t=this.entry)?t.tags:void 0)&&(_.find(r,function(t){return t.name===e})||!1)},fetchEntryVersions:function(n,o,a,i){var s,l,u;return null==a&&(a=1),null==i&&(i=8),s=t.defer(),(l=r.get(e.API_ROOT+"/api/journals/"+n+"/entries/"+o+"/versions?page="+a+"&limit="+i)).success((u=this,function(e){var t;if(!e.error)return t=u.parseVersions(e,a,i),s.resolve(t);s.reject(e)})),l.error(function(e,t){return s.reject(e)}),s.promise},fetchEntryVersionPreview:function(n,o,a){var i,s,u;return i=t.defer(),l.log("View Entry Version Preview"),(s=r.get(e.API_ROOT+"/api/journals/"+n+"/entries/"+o+"/preview_version?ver
2sion_id="+a)).success((u=this,function(e){var t;if(!e.error)return t=u.parseEntryVersionPreview(e),console.log("Fetch entry version preview success: ",t),i.resolve(t);i.reject(e)})),s.error(function(e,t){return i.reject(e)}),i.promise},restoreEntryVersion:function(n,o,a,i){var s,u,c;return null==i&&(i=!0),s=t.defer(),(u=r.get(e.API_ROOT+"/api/journals/"+n+"/entries/"+o+"/restore_version?version_id="+a+"&replace="+i)).success((c=this,function(e){var t;if(!e.error)return l.log("Restore Entry Version",{replace:i}),console.log("Restore entry version success: ",e),(t=c.parseEntry(e)).version_timestamp=moment().unix(),c.updateEntryInLocalJournal(t,n),s.resolve(t);s.reject(e)})),u.error(function(e,t){return console.error("Restore entry error: ",e),s.reject(e)}),s.promise},parseJournals:function(e){var t,r;return t=[],_.each(e,(r=this,function(e){if(e=r.parseJournal(e),_.isObject(e))return t.push(e)})),t},parseJournal:function(e){var t;return _.isObject(e)?(t={},(t=e.journal?e.journal:e).entries||(t.entries={entries:[],total_entries:null}),t.ui||(t.ui={}),t.ui.hideLock=t.is_classroom_master||t.is_classroom_slave,t.ui.hideSettings=t.is_classroom_slave,t=this.parseJournalPageCount(t)):(console.error("Journal is not an object: ",e),!1)},parseJournalPageCount:function(e){return null==e&&(e={}),e.page_size=this.opts.entryLimit,e.total_pages=this.getJournalTotalPages(e.total_entries),e.current_page||(e.current_page=1),e},parsePadThemes:function(e){var t,r;return t=[],_.each(e,(r=this,function(e){return e=r.parsePadTheme(e),t.push(e)})),t},parsePadTheme:function(e){return e.pad_theme},parsePageThemes:function(e){var t,r,n;return null==e&&(e=[]),r=[],_.each(e,(n=this,function(e){return e=n.parsePageTheme(e),r.push(e)})),r.reverse(),(t=_.find(r,{name:"Basic"}))&&0!==_.indexOf(r,t)&&(r.splice(_.indexOf(r,t),1),r.unshift(t)),r},parsePageTheme:function(e){return e.page_theme},parseComposeSettings:function(t){var r;return void 0!==(r=t.compose_setting?t.compose_setting:t)&&r||console.error("Parsed settings undefined"),r.font_colour="000000"===r.font_colour?null:r.font_colour,"helvetica,arial,sans-serif"!==r.font&&"kepler-std"!==r.font&&"Lora,helvetica,arial,sans-serif"!==r.font||(r.font=e.FONT_FAMILY),r},parseEntries:function(e){var t,r;return t={entries:[],total_entries:e.total_entries||0},e=e.hasOwnProperty("entries")?e.entries:e,_.each(e,(r=this,function(e){var n;return n=r.parseBasicEntry(e),t.entries.push(n)})),t},parseBasicEntry:function(e){var t;return(t=e.hasOwnProperty("entry")?e.entry:e).formatted_created_at=moment(t.created_at).format(u.settings.date_format),t.formatted_modified_at=moment(t.modified_at).format(u.settings.date_format),t},parseEntry:function(e){var t,r,n;return t=e.hasOwnProperty("entry")?e.entry:e,e.next&&(t.next=_.map(e.next,(n=this,function(e){return n.parseBasicEntry(e.entry)}))),e.previous&&(t.previous=_.map(e.previous,function(e){return function(t){return e.parseBasicEntry(t.entry)}}(this))),_.isObject(t)||(r=JSON.stringify(t),console.error("Entry is not an object in parseEntry()",r),s.track("Entry is not an object in parseEntry() ::::: "+r)),t.html_body=this.parseEntryHtml(t.richtext_body),t.formatted_created_at=moment(t.created_at).format(u.settings.date_format),t.formatted_modified_at=moment(t.modified_at).format(u.settings.date_format),t.pad_theme_id&&c.indexOf(t.pad_theme_id)>-1&&(t.pad_theme_id=null),t},parseEntryHtml:function(e){var t,r;return e?(r="",(r=(r=e.replace(/\<p\>\<\/p\>/g,"").replace(/\<p\>\s\<\/p\>/g,"").trim()).replace(/(\r\n|\n|\r)/g,"").trim()).substring(r.length-3).search("<p>")>-1&&(r=r.slice(0,r.length-3)),(t=o("<div>")).html(r),t.find("span").each(function(){if(!this.attributes.length)return o(this).contents().unwrap()}),r=t.html()):""},sanitizeEntryHtml:function(e){var t;return void 0===e?"":(e=e.replace(/[\u200B-\u200D\uFEFF]/g,""),e="&lt;p&gt;​&lt;/p&gt;"===(t=o("<div>")).text(e).html()?"":e,t.remove(),e=this.parseEntryHtml(e))},parseEntryPhotos:function(e){var t,r;return t={legacy:[],inline:[]},_.each(e,(r=this,function(n){var o;return void 0===(n=r.parseEntryPhoto(n))?(o=JSON.stringify(e),s.track("Photo should not be undefined :::: ",o),!1):(n.position&&t.legacy.push(n),t.inline.push(n))})),t},parseEntryPhoto:function(e){return e.photo},parsePublicLink:function(e){return e.entry},parseEntryTag:function(e){return e.tag},parseEntryTags:function(e){var t,r;return t=[],_.each(e,(r=this,function(e){return e=r.parseEntryTag(e),t.pu
2sh(e)})),t},parseReminder:function(e){var t,r;return(r=e.reminder).text="","daily"===r.frequency&&(r.text="Daily"),"bidaily"===r.frequency?r.text="Every other day":"weekly"===r.frequency?r.text=function(){switch(r.weekday){case"0":return"Sundays";case"1":return"Mondays";case"2":return"Tuesdays";case"3":return"Wednesdays";case"4":return"Thursdays";case"5":return"Fridays";case"6":return"Saturdays"}}():"monthly"===r.frequency&&(r.text=function(){switch(r.day){case"1":return"1st";case"2":return"2nd";case"3":return"3rd";case"4":return"4th";case"5":return"5th";case"6":return"6th";case"7":return"7th";case"8":return"8th";case"9":return"9th";case"10":return"10th";case"11":return"11th";case"12":return"12th";case"13":return"13th";case"14":return"14th";case"15":return"15th";case"16":return"16th";case"17":return"17th";case"18":return"18th";case"19":return"19th";case"20":return"20th";case"21":return"21st";case"22":return"22nd";case"23":return"23rd";case"24":return"24th";case"25":return"25th";case"26":return"26th";case"27":return"27th";case"28":return"28th";case"29":return"29th";case"30":return"30th";case"31":return"31st"}}(),r.text+=" of the month"),"number"==typeof(t=parseInt(r.hour))&&a.isPaid()?(t>12?(r.hour=t-12,r.ampm="pm"):r.ampm=12===t?"pm":"am",0===t&&(r.hour=12),1===String(r.minute).length&&(r.minute="0"+r.minute),r.text+=" at "+r.hour+":"+r.minute+r.ampm):r.general_time&&(r.text+=" at "+r.general_time+" time"),r},parseReminders:function(e){var t,r;return t=[],_.each(e,(r=this,function(e){return e=r.parseReminder(e),t.push(e)})),t},parseEntryVersionPreview:function(e){var t;return(t=e).plain_text_body=t.plain_text_body.replace(/\n/g,"<br />"),t},parseVersion:function(e){var t;return(t=e).created_at_formatted=moment(new Date(e.created_at)).format(u.settings.date_format+" h:mm A"),t},parseVersions:function(e,t,r){var n,o;return n={totalVersions:e.total_versions,totalPages:Math.ceil(e.total_versions/r),page:t,limit:r,versions:[]},_.each(e.versions,(o=this,function(a,i){return i=i+1+(t-1)*r,(a=o.parseVersion(a,i)).index=e.total_versions-i+1,n.versions.push(a)})),n}}},angular.module("penzuApp").factory("Journals",["$rootScope","$q","$http","Auth","$storage","$error","$track","$global",n])},9244(e,t,r){"use strict";var n=r(6999);(function(){var e,t=[].indexOf||function(e){for(var t=0,r=this.length;t<r;t++)if(t in this&&this[t]===e)return t;return-1};(e=n).fn.validateCreditCard=function(r,n){var o,a,i,s,l,u,c,d,p,h,m,g;for(i=[{name:"amex",pattern:/^3[47]/,valid_length:[15]},{name:"diners_club_carte_blanche",pattern:/^30[0-5]/,valid_length:[14]},{name:"diners_club_international",pattern:/^36/,valid_length:[14]},{name:"jcb",pattern:/^35(2[89]|[3-8][0-9])/,valid_length:[16]},{name:"laser",pattern:/^(6304|670[69]|6771)/,valid_length:[16,17,18,19]},{name:"visa_electron",pattern:/^(4026|417500|4508|4844|491(3|7))/,valid_length:[16]},{name:"visa",pattern:/^4/,valid_length:[16]},{name:"mastercard",pattern:/^5[1-5]/,valid_length:[16]},{name:"maestro",pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,valid_length:[12,13,14,15,16,17,18,19]},{name:"discover",pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,valid_length:[16]}],null==n&&(n={}),null==n.accept&&(n.accept=function(){var e,t,r;for(r=[],e=0,t=i.length;e<t;e++)o=i[e],r.push(o.name);return r}()),h=0,m=(g=n.accept).length;h<m;h++)if(a=g[h],t.call(function(){var e,t,r;for(r=[],e=0,t=i.length;e<t;e++)o=i[e],r.push(o.name);return r}(),a)<0)throw"Credit card type '"+a+"' is not supported";return s=function(e){var r,s,l;for(l=function(){var e,r,a,s;for(s=[],e=0,r=i.length;e<r;e++)a=(o=i[e]).name,t.call(n.accept,a)>=0&&s.push(o);return s}(),r=0,s=l.length;r<s;r++)if(a=l[r],e.match(a.pattern))return a;return null},u=function(e){var t,r,n,o,a,i;for(n=0,r=o=0,a=(i=e.split("").reverse()).length;o<a;r=++o)t=+(t=i[r]),n+=r%2?(t*=2)<10?t:t-9:t;return n%10==0},l=function(e,r){var n;return n=e.length,t.call(r.valid_length,n)>=0},p=function(e){var t,n;return n=!1,t=!1,null!=(a=s(e))&&(n=u(e),t=l(e,a)),r({card_type:a,luhn_valid:n,length_valid:t})},d=function(){var t;return t=c(e(this).val()),p(t)},c=function(e){return e.replace(/[ -]/g,"")}
2,this.bind("input",function(){return e(this).unbind("keyup"),d.call(this)}),this.bind("keyup",function(){return d.call(this)}),0!==this.length&&d.call(this),this}}).call(void 0)},9434(){"use strict";var e;e=function(){function e(e,t){this.$global=t,e.$on("$error:log",function(e,t){return API.error(t)}),e.$on("$error:track",function(e,t){return API.error(t)})}return e.prototype.error=function(e){if(console.log("ERRORTRACKER -- send error :::: ",e),window.Bugsnag)return window.Bugsnag.notify(new Error(e))},e.prototype.track=function(e){if(console.log("ERRORTRACKER -- track action :::: ",e),window.Bugsnag)return window.Bugsnag.leaveBreadcrumb(e,{type:"manual"})},e.prototype.setUser=function(e){if(e=String(e),console.log("ERRORTRACKER -- set user :::: ",e),window.Bugsnag)return window.Bugsnag.setUser(e)},e.prototype.notify=function(e,t){if(null==t&&(t={}),window.Bugsnag)return window.Bugsnag.notify(e,function(e){return e.addMetadata("custom",t)})},e.prototype.leaveBreadcrumb=function(e,t){if(null==t&&(t={}),window.Bugsnag)return window.Bugsnag.leaveBreadcrumb(e,t)},e}(),angular.module("penzuApp").service("$error",["$rootScope","$global",e])},9604(e,t,r){"use strict";var n,o=r(6999);n=function(e){return{restrict:"A",link:function(t,r,n){var a;if(r.prop("method","POST"),n.ngSubmit&&e(function(){return r.off("submit").on("submit",function(e){return e.preventDefault(),r.find("input, textarea, select").trigger("input").trigger("change").trigger("keydown"),t.$apply(n.ngSubmit)})},0),t.form={message:{type:"error",visible:!1,message:""},loading:!1},t.form.message.show=function(e,r){return null==r&&(r="error"),_.defer(function(){return t.$apply(function(){return t.form.message.type=r,t.form.message.message=e,t.form.message.visible=!0})})},t.form.message.hide=function(){return _.defer(function(){return t.$apply(function(){return t.form.message.message="",t.form.message.visible=!1})})},t.$on("form:message:show",function(e,r,n){return t.form.message.show(r,n)}),t.$on("form:message:hide",t.form.message.hide),t.$watch("form.loading",function(e,r){if(e!==r)return e?t.form.showLoadingButtons():t.form.resetLoadingButtons()}),t.form.showLoadingButtons=function(){return r.find("[data-loading-text]").each(function(){return o(this).button("loading")})},t.form.resetLoadingButtons=function(){return r.find("[data-loading-text]").each(function(){return o(this).button("reset")})},a=r.parents(".modal"))return a.on("hidden.bs.modal",function(){return t.form.resetLoadingButtons()})}}},angular.module("penzuApp").directive("pzForm",["$timeout",n]).directive("pzCheckbox",function(){return{template:'<input type="checkbox" name="{{name}}" id="{{name}}" ng-model="pzCheckbox" ng-change="change" class="hidden"> <label for="{{name}}" title="{{label}}" class="btn-checkbox"> <span class="simple-checkbox"></span> {{label}} </label>',restrict:"A",scope:{pzCheckbox:"=",change:"="},link:function(e,t,r){if(e.name=r.name||"",e.label=r.label||"",t.addClass("pz-checkbox"),t.find("input").on("change",function(){var t;return t=o(this),e.pzCheckbox=t.prop("checked"),_.defer(function(){return e.$apply()})}),t.on("click","span.checkbox-dummy",function(t){var r,n;return t.preventDefault(),t.stopPropagation(),r=o(this),n=r.prev(),e.$apply(function(){var t;return n.prop("checked",!n.is(":checked")),n.toggleClass("checked",n.is(":checked")),r.toggleClass("selected",n.is(":checked")),t=n.prop("checked")?n.val():null,e.pzCheckbox=t})}),o("html").hasClass("lt-ie9"))return t.on("click","label",function(t){var r,n;return t.preventDefault(),t.stopPropagation(),r=o(this),n=r.prev(),e.$apply(function(){var t;return n.prop("checked",!n.is(":checked")),n.toggleClass("checked",n.is(":checked")),r.toggleClass("selected",n.is(":checked")),t=n.prop("checked")?n.val():null,e.pzCheckbox=t})})}}}).directive("pzAutoSize",function(){return{restrict:"A",link:function(e,t,r){var n,o,a,i,s,l,u;i=parseInt(r.maxHeight)||0,s=parseInt(r.minHeight)||32,e.$on("$destroy",function(){return t.off()}),a=t.get(0),l=function(){var r,n;if(n=a.scrollHeight,i&&n<i||!i)return a.value.length?(n>50&&(t.css("height","auto"),n=a.scrollHeight),r=(r=n<=i||0===i?n:i)<s?s:r,e.$emit("textarea:resize",r),t.css("height",r+"px")):(t.css("height",s),void e.$emit("textarea:resize",s))},u=_.throttle(function(){return l()},500),n=function(e){return e=e||0,setTimeout(function(){return l()},e)},t.on("change",u),t.on("cut",n),t.on("paste",n),t.on("drop",n),t.on("keyup",u),t.on("blur",function(){return n(500)}),e.$on("textarea:change",n);try{return t.focus(),t.select()}
2catch(e){return o=e,console.log("catch: ",o)}}}}).directive("pzFormAlert",function(){return{template:r(2794)(),restrict:"A",link:function(e,t,r){}}})},9836(e,t,r){r(7766),e.exports=function(e){return""+'<div class="autoLogout-modal"><div class="modal-dialog"><div class="modal-content"><div class="modal-header modal-header-nav"><h4>Are you still writing?</h4></div><form class="form-default" ng-submit="vm.confirm()"><div class="modal-body"><p>You\'ve been idle for more than {{vm.$global.settings.auto_logout}} minutes. We want to make sure your journals stay private, so we\'ll log you out soon if there\'s no activity.</p><h3>Auto-logout in</h3><h4>{{vm.timeout}}s</h4><p>You can change auto-logout preferences in your&nbsp;<a ui-sref="account" ng-click="vm.confirm()">account settings.</a></p></div><div class="modal-footer"><button class="save-button btn-block btn-primary" type="submit">Keep me logged in</button></div></form></div></div></div>'}},9887(e,t,r){r(7766),e.exports=function(e){return""+'<div class="disable-lookingglass__wrap"><div class="pz-card" ng-hide="activeTab == \'confirmation\'"><div class="lookingglass__loader" ng-show="ui.loading"><div class="loader-tab" loader="ui.loading"></div></div><h2>Disable Looking Glass</h2><p class="p-large">We’ll disable Penzu Looking Glass for your entire account. You will no longer receive Looking Glass emails in the future. You can turn Looking Glass back on through your journal settings.</p><hr><form class="form-default" ng-submit="disableLookingGlass()" novalidate="" pz-form=""><div pz-form-alert=""></div><div class="disable-lookingglass__actions"><button class="btn btn-warning btn-block" type="submit">Disable Looking Glass</button></div></form></div><div class="pz-card" ng-show="activeTab == \'confirmation\'"><h2>Looking Glass Disabled</h2><p class="p-large">Looking Glass has been disabled for this account. You will now be redirected to the journals page.</p></div></div>'}}},e=>{e.O(0,[96],()=>e(e.s=4447)),e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.