File Editor
Directories:
.. (Back)
Files:
about.7931a7fb.js
campaign-edit.5d7e00e8.js
campaigns.8a3c9bb9.js
connect.1e32bc92.js
dashboard.6b6db9c1.js
integrations.c4b4d63b.js
monsterleads.e931d44a.js
personalization.c31b518e.js
playbooks.f0ed7431.js
settings.e807738f.js
temp.733143d6.js
templates.08e9af2c.js
university.4994188f.js
Create New File
Create
Edit File: templates.08e9af2c.js
"use strict";(self["webpackChunkoptinmonster_wordpress_plugin_vue_app"]=self["webpackChunkoptinmonster_wordpress_plugin_vue_app"]||[]).push([[624],{60581:function(e,t,s){s.r(t),s.d(t,{default:function(){return f}});var a=function(){var e=this,t=e._self._c;return e.reachedCampaignLimit?t("templates-limit-exceeded"):t("core-page",{attrs:{classes:"templates-wrapper"}},[t("common-page-tabnav",{attrs:{current:"templates",tabs:e.tabs}}),t("h1",[e._v("Select a Campaign Type:")]),t("common-alerts",{attrs:{alerts:e.alerts}}),t("div",{staticClass:"templates-content"},[t("templates-types"),t("div",{staticClass:"omapi-content-area"},[t("templates-upsell-alerts"),t("div",{staticClass:"template-content"},[t("div",{staticClass:"template-content-left"},[e.isLoading?t("div",{staticClass:"archie-loader-wrapper"},[t("div",[t("core-loading",{staticClass:"loader"})],1)]):t("templates-filters")],1),t("div",{staticClass:"template-content-right"},[e.hasTemplates?t("div",{staticClass:"omapi-template-listing-wrap"},[t("templates-grid",{attrs:{templates:e.selectedTemplates}}),e.isLoading?t("svg-loading",{style:{margin:"0 auto"}}):e._e()],1):e.isLoading?t("div",{staticClass:"archie-loader-wrapper"},[t("div",[t("core-loading",{staticClass:"loader"})],1)]):t("div",{staticClass:"no-templates-available"},[e.validType&&e.search?t("core-feedback",{attrs:{"feedback-type":"templates"}},[t("em",[e._v(" Looks like we don't have that template yet. Tell us more about the template you're looking for below and we'll consider adding it to our library. ")]),t("em",[e._v(" Or, if you need it right away, "),t("a",{attrs:{href:"https://optinmonster.com/vip-service/?utm_source=plugin&utm_medium=template_search",target:"_blank",rel:"noopener noreferrer"}},[e._v(" purchase a VIP Campaign ")]),e._v(" and we'll do it for you within two business days. ")])]):t("core-alert",{attrs:{type:e.validType?"info":"warn"}},[t("div",{staticClass:"alert-message"},[e._v(" "+e._s(e.noTemplatesMessage)+" ")])])],1)])])],1)],1),t("campaigns-modal-create-campaign"),t("templates-modal-not-connected"),t("templates-modal-no-access")],1)},i=[],r=s(42877),o=s.n(r),l=s(55808),n=s.n(l),p=s(95353),m=s(96709),d=s(89138),c={mixins:[m.X,d.I],computed:{...(0,p.aH)("templates",["activeType","search","sort","popular","templates"]),...(0,p.L8)(["reachedCampaignLimit"]),...(0,p.L8)("templates",["typePermitted","featured","filters","filterGamified","validType"]),alerts(){return this.$get("$store.state.alerts",[])},isLoading(){return this.$store.getters.isLoading("templates")},popularTemplates(){const e=this.popular[this.activeType];return e&&e.length?this.order(e):[]},featuredTemplates(){const e=this.featured[this.activeType];return e&&e.length?this.order(e):[]},showableTemplates(){const e=(e,t)=>!this.filters[e].length||!this.filters[e].find((e=>!t.includes(e))),t=["popular","featured"].includes(this.sort)?`${this.sort}Templates`:"templates",s=this[t].filter((e=>{if(""===this.search)return!0;const t=this.search.toLowerCase(),s=e.name.toLowerCase().includes(t),a=e.keywords.some((e=>e.toLowerCase().includes(t))),i=e.categories.some((e=>e.name.toLowerCase().includes(t))),r=e.features.some((e=>e.name.toLowerCase().includes(t))),o=e.seasons.some((e=>e.name.toLowerCase().includes(t)));return s||a||i||r||o})).filter((t=>{const s="mobile"===this.filters.device?t.mobile:!t.mobile;if(!s)return!1;const a=["goals","categories","tags","seasons","features"];return!a.find((s=>!e(s,t[s].map((e=>e.id)))))}));return this.order(s)},selectedTemplates(){return this.showableTemplates.filter((e=>this.filterGamified?e.tags.find((e=>1===e.id)):e.type===this.activeType))},hasTemplates(){return this.selectedTemplates.length},shouldShowUpsells(){return!!this.$store.getters.connected&&!this.typePermitted(this.activeType)},noTemplatesMessage(){return this.validType?"No templates available for your current selection.":`${n()(this.activeType)} is not a valid type. Please select one of the options above.`}},created(){this.$store.dispatch("campaigns/fetchDashboard").catch((()=>{})),this.loadApiScript("omwpapi-templates-apijs",this.$constants.TEMPLATES_PREVIEW_ACCOUNT,this.$constants.TEMPLATES_PREVIEW_USER)},mounted(){this.fetchTemplateData().catch((()=>{})),this.$bus.$emit("dashboard-view-mounted","templates")},methods:{...(0,p.i0)("templates",["fetchTemplateData"]),applyFilters(e){this.$bus.$emit("applied-bulk-filter"),this.$store.commit("templates/appliedFilters",e)},order(e){return o()(e,[e=>e.tags.find((e=>2===e.id))?1:0,e=>Number(this.$moment(e.created_at).isAfter(this.$moment().subtract(3,"months"))),e=>e.order,e=>this.$moment(e.created_at).valueOf(),e=>e.name.toLowerCase()],["desc","desc","asc","desc","asc"])}}},u=c,h=s(81656),v=(0,h.A)(u,a,i,!1,null,null,null),f=v.exports},89138:function(e,t,s){s.d(t,{I:function(){return a}});const a={data(){return{tabs:{templates:{name:"Templates",route:{path:"templates",params:{tab:"popup"}}},playbooks:{name:"Playbooks",route:{path:"playbooks",params:{}}}}}}}},96709:function(e,t,s){s.d(t,{X:function(){return l}});var a=s(79158),i=s(63191),r=s(22805);const o=(e,t,s,a)=>{let i=document.getElementById(t);if(i)return i;if(!e)return void console.error("apiJsUrl not provided to loadApiScript");const o=document.getElementsByTagName("head")[0]||document.documentElement;return i=document.createElement("script"),i.type="text/javascript",i.id=t,i.src=e,i.async=!0,i.dataset.account=s,i.dataset.user=a,(0,r.isProduction)()||(i.dataset.env=(0,r.isDevelopment)()?"dev":r.currentEnv),o.appendChild(i),i},l={created(){this.listenApiLoaded(),(0,a.rH)(),(0,a.b9)(),(0,a.XU)(),(0,a._f)(),(0,a.Jd)(),this.$store.subscribe((e=>{const t=["templates/setLoadingPreview","templates/setPreviewing","templates/filterOptions","templates/templates","templates/permittedTypes","templates/recentTemplates","templates/popular","templates/setApiLoaded"],s=["route/ROUTE_CHANGED"];let a=e.type.startsWith("templates/")&&!t.includes(e.type);a||(a=s.includes(e.type)),a&&this.closeAllPreviews()}))},beforeDestroy(){(0,a.rH)(!1),(0,a.b9)(!1),(0,a._f)(!1),(0,a.XU)(!1),(0,a.Jd)(!1)},methods:{listenApiLoaded(e="addEventListener"){["om.Api.init","om.Main.init","om.Campaigns.init","om.Campaign.init"].forEach((t=>document[e](t,this.setApiLoaded)))},setApiLoaded(){this.listenApiLoaded("removeEventListener"),this.$store.commit("templates/setApiLoaded")},closeAllPreviews(){(0,a._V)(),this.$store.commit("templates/setLoadingPreview",""),this.$store.commit("templates/setPreviewing","")},loadApiScript(e,t,s){return o(i.DS.apiJs(),e,t,s)}}}}}]); //# sourceMappingURL=templates.08e9af2c.js.map
Save Changes
Rename File
Rename