File "Settings.js"
Full Path: /home/attunedd/public_html/wp-content/plugins/wpide/dist/js/chunks/Settings/Settings.js
File size: 15.17 KB
MIME-type: text/plain
Charset: utf-8
"use strict";(self.webpackChunkwpide=self.webpackChunkwpide||[]).push([[265,144,336,218,298],{86201:(t,e,i)=>{i.r(e),i.d(e,{default:()=>l});i(35545),i(11923),i(82837),i(77834),i(68098),i(95653),i(84817);var n=i(71199);const s={name:"Settings",components:{SettingFields:function(){return i.e(265).then(i.bind(i,40891))}},data:function(){return{active:"general"}},computed:{tabs:function(){return[{config_id:"general",title:(0,n.__)("General","wpide")}].concat(this.$router.options.routes.filter((function(t){return!!t.module&&!!t.config})).map((function(t){return{config_id:t.config,title:t.meta.title}})))},activeTab:function(){var t=this;return this.tabs.find((function(e){return e.config_id===t.active}))},fields:function(){return window.WPIDE.config_fields[this.activeTab.config_id]}},watch:{active:function(t){var e=this;this.$nextTick((function(){e.$session.set("settingsActiveTab",t)}))}},mounted:function(){var t=this.$session.get("settingsActiveTab");t&&(this.active=t)},methods:{fieldValue:function(t){var e=this.activeTab.config_id;return""!==e&&(e+="."),this.getConfig(e+t)}}};const l=(0,i(9970).Z)(s,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"nk-fmg-body-content"},[e("div",{staticClass:"nk-block-head nk-block-head-md"},[e("div",{staticClass:"nk-block-between position-relative"},[e("div",{staticClass:"nk-block-head-content"},[e("h3",{staticClass:"nk-block-title page-title"},[t._v(" "+t._s(t.__("Settings","wpide"))+" ")])])])]),e("ul",{staticClass:"nk-nav nav nav-tabs"},[t._l(t.tabs,(function(i){return[e("li",{key:i.config_id,staticClass:"nav-item"},[e("a",{staticClass:"nav-link",class:{active:i.config_id===t.active},attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.active=i.config_id}}},[t._v(t._s(i.title))])])]}))],2),e("div",{staticClass:"nk-block nk-block-xs pt-0"},[e("div",{staticClass:"nk-data data-list data-list-s2 is-medium py-md-5 py-4"},[e("form",{staticClass:"settings-form gy-3",attrs:{action:"#"}},[e("SettingFields",{attrs:{module:t.activeTab.config_id,fields:t.fields}})],1)])])])}),[],!1,null,"60551a80",null).exports},63240:(t,e,i)=>{i.r(e),i.d(e,{default:()=>l});var n=i(93808);i(35545),i(11923),i(82837),i(2017);const s={name:"SettingControl",components:{SettingFoldersControl:i(33613).default,SettingControlRepeater:function(){return i.e(265).then(i.bind(i,42274))},SettingFields:function(){return i.e(265).then(i.bind(i,40891))}},props:["module","id","type","label","multiple","options","attr","repeater","fields","group","vindex"],computed:{settingKey:function(){return this.module+"."+this.id},premiumField:function(){var t=this.getConfigField(this.settingKey);return t&&t.hasOwnProperty("premium")&&t.premium},disabledPremiumField:function(){return this.premiumField&&!this.premium},model:{get:function(){var t=this.$store.state.defaultConfig[this.module],e=this.$store.state.config[this.module];return void 0!==this.group&&null!==this.group&&(t=t[this.group],e=e[this.group]),t=t[this.id],null===(e=e[this.id])&&(e=t),this.premiumField&&!this.premium&&(e=t),this.repeater&&"object"!==(0,n.Z)(e)?e=[]:void 0!==this.vindex&&(e=e[this.vindex]),"number"!==this.type&&"range"!==this.type||(e=parseInt(e)),e},set:function(t){var e=this.cloneObj(this.$store.state.config);void 0!==this.group&&null!==this.group?void 0!==this.vindex?e[this.module][this.group][this.id][this.vindex]=t:e[this.module][this.group][this.id]=t:void 0!==this.vindex?e[this.module][this.id][this.vindex]=t:e[this.module][this.id]=t;var i=!0;this.premiumField&&!this.premium&&(i=!1),this.updateConfig(this.settingKey,t,i)}}},methods:{setSwatchClass:function(t){return this.id+"-"+t},setValue:function(t){this.model=t},getAttr:function(t){return this.attr&&this.attr.hasOwnProperty(t)?this.attr[t]:void 0},checkPremium:function(){this.disabledPremiumField&&this.showPremiumFeatureModal()}}};const l=(0,i(9970).Z)(s,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"form-control-wrap"},[t.repeater?e("SettingControlRepeater",{attrs:{field:t.$props,model:t.model}}):t.repeater?t._e():e("div",[e("span",{on:{click:t.checkPremium,drag:t.checkPremium}},["bool"===t.type?e("b-form-checkbox",{attrs:{size:"lg",disabled:t.disabledPremiumField,switch:""},model:{value:t.model,callback:function(e){t.model=e},expression:"model"}}):"text"===t.type?e("b-form-input",{attrs:{type:"text",placeholder:t.label,disabled:t.disabledPremiumField,size:"lg"},model:{value:t.model,callback:function(e){t.model=e},expression:"model"}}):"number"===t.type?e("b-form-input",{attrs:{type:"number",min:t.getAttr("min",1),step:t.getAttr("min",1),placeholder:t.label,disabled:t.disabledPremiumField,size:"lg"},model:{value:t.model,callback:function(e){t.model=e},expression:"model"}}):"password"===t.type?e("b-form-input",{attrs:{type:"password",placeholder:t.label,disabled:t.disabledPremiumField,size:"lg"},model:{value:t.model,callback:function(e){t.model=e},expression:"model"}}):"range"===t.type?e("span",{staticClass:"d-flex"},[e("b-form-input",{attrs:{type:"range",min:t.getAttr("min",1),max:t.getAttr("max"),step:t.getAttr("step",1),placeholder:t.label,disabled:t.disabledPremiumField,size:"lg"},model:{value:t.model,callback:function(e){t.model=e},expression:"model"}}),e("span",{staticClass:"pl-2",domProps:{textContent:t._s(t.model)}})],1):"select"===t.type?e("b-form-select",{attrs:{options:t.options,multiple:t.multiple,disabled:t.disabledPremiumField,size:"lg"},model:{value:t.model,callback:function(e){t.model=e},expression:"model"}}):"swatches"===t.type?e("span",{staticClass:"nk-opt-list"},t._l(t.options,(function(i,n){return e("span",{key:n,staticClass:"nk-opt-item",class:{active:t.model===n},on:{click:function(e){t.model=n}}},[e("b-form-input",{attrs:{type:"text",disabled:t.disabledPremiumField,hidden:""},model:{value:t.model,callback:function(e){t.model=e},expression:"model"}}),e("span",{staticClass:"nk-opt-item-bg"},[e("span",{class:t.setSwatchClass(n)})]),e("span",{staticClass:"nk-opt-item-name"},[t._v(t._s(i))])],1)})),0):"folders"===t.type?e("SettingFoldersControl",{attrs:{model:t.model,"set-value":t.setValue}}):"group"===t.type?e("SettingFields",{attrs:{module:t.module,fields:t.fields,group:t.id}}):t._e()],1)])],1)}),[],!1,null,null,null).exports},42274:(t,e,i)=>{i.r(e),i.d(e,{default:()=>s});i(35545),i(11923),i(82837),i(28800),i(43146),i(83090),i(49613),i(81379);const n={name:"SettingControlRepeater",components:{SettingControl:function(){return i.e(265).then(i.bind(i,63240))}},props:["field","model"],computed:{settingKey:function(){return this.field.module+"."+this.field.id}},watch:{model:function(t){this.updateConfig(this.settingKey,t)}},methods:{remove:function(t){this.model.splice(t,1)},add:function(){if("group"===this.field.type){var t=[];Object.entries(this.field.fields).forEach((function(){t.push("")})),this.model.push(t)}else this.model.push("")}}};const s=(0,i(9970).Z)(n,(function(){var t=this,e=t._self._c;return e("div",[t._l(t.model,(function(i,n){return[e("div",{key:n,staticClass:"repeater-row"},[e("SettingControl",{attrs:{module:t.field.module,id:t.field.id,type:t.field.type,label:t.field.label||null,options:t.field.options||null,attr:t.field.attr||null,multiple:t.field.multiple||null,fields:t.field.fields||null,repeater:!1,vindex:n}}),e("a",{staticClass:"repeater-row-remove",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.remove(n)}}},[e("em",{staticClass:"icon ni ni-trash"})])],1)]})),e("a",{staticClass:"repeater-row-add",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.add.apply(null,arguments)}}},[e("em",{staticClass:"icon ni ni-plus-circle"}),t._v(" Add")])],2)}),[],!1,null,"382dd4fe",null).exports},40891:(t,e,i)=>{i.r(e),i.d(e,{default:()=>s});i(35545),i(11923),i(82837),i(43146),i(83090),i(45814),i(84817),i(67293),i(73522);const n={name:"SettingFields",components:{SettingControl:function(){return i.e(265).then(i.bind(i,63240))}},props:["module","fields","group"],computed:{allFields:function(){var t=this,e=window.WPIDE.config_fields[this.module],i={};return Object.keys(e).forEach((function(n){var s=t.module+"."+n;"group"!==e[n].type?i[s]=e[n]:e[n].fields&&"group"===e[n].type&&Object.keys(e[n].fields).forEach((function(t){i[s]=e[n].fields[t]}))})),i}},methods:{settingKey:function(t){return this.module+"."+t},premiumField:function(t){var e=this.getConfigField(this.settingKey(t));return e&&e.hasOwnProperty("premium")&&e.premium},reset:function(t){var e=this.getDefaultConfig(this.settingKey(t));this.updateConfig(this.settingKey(t),e)},isFieldHidden:function(t){var e=this,i=!1;if(t.conditions){var n=t.conditions.length,s=0;t.conditions.forEach((function(t){if(e.allFields.hasOwnProperty(t.id)?e.allFields[t.id]:null){var i=e.getConfig(t.id),n=t.value,l=t.operator||"===";if(t.item){var o=i.find((function(e){return e[t.item.key]===t.item.value}));i=o[t.item.conditionKey]}("==="===l&&i===n||"!=="===l&&i!==n||"<"===l&&i<n||">"===l&&i>n||"<="===l&&i<=n||">="===l&&i>=n||"in"===l&&n.includes(i)||"not in"===l&&!n.includes(i))&&s++}})),n!==s&&(i=!0)}return i}}};const s=(0,i(9970).Z)(n,(function(){var t=this,e=t._self._c;return e("div",[t._l(t.fields,(function(i,n){return[t.isFieldHidden(i)?t._e():e("div",{key:n,staticClass:"form-group",class:"field-type-"+i.type},[e("div",{staticClass:"row g-5"},[e("div",{staticClass:"col-lg-5"},[e("label",{staticClass:"form-label",attrs:{for:"site-name"}},[e("span",[t._v(t._s(i.label))]),t.premiumField(n)&&!t.premium?e("b-link",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.auto",modifiers:{hover:!0,auto:!0}}],staticClass:"premium-feature ml-2",attrs:{href:"#",title:t.__("This feature is premium!","wpide")},on:{click:t.showPremiumFeatureModal}},[e("img",{attrs:{width:"24",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAGIElEQVR4AdWaA5AsPxPAvzOebdu2bdu2bdu2bdu2bdt+75wvndpOdXVtbe3O7OG/Vb/KpKcn053u4Cb3v3LdK5tG/jzJdTbJaskbSbDktWSlJBPXdwZmDXcn1zEkMySCgYRIpkmi0+clLmHugPx5SNxIvaPkEzHWz9L7Akqok3sfQZ886waOhIkD0FssXUpLrhPj/InhHJD7k/pVSUmaVkai4YjhHqSeRrKZGBMgCdJ124BeAKlvlKRi0XVxm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8hPoip0TT8IP/+/bvSWbNmDchgxtLPTZ06FWSwJkBdG5c3b14lp/Tp0wd1YEbjmzlzgzhPnjwggwGH2wR0QE+ZW7du1c5hTwLlypVT8mXLlumIwmDt3LkzzFDQtp6yMXp169bFbYfxaRRTCMiRIwc2qEvuAC5uQIECBfSzb9++hZkJ5DDItZwaTBk6dCi+w9hCBl7zCNhyAFMIHMDchhLmepDT6OCMBDMWN/zevXuiVq1adPthzAEMWYIECVSIM2TIgHM13YXqmSRdunSgR1dPLOFZWARhDOgoALAAwtoAM1KLFi1ggQSjsXPgWVN/D/AGuMy2DikZuCW3uXuFZx3dTnMH9D4EeoP3CNPB/T32IL+HWNv/QwQBG04ZiEAEBO36zCOATtyN4H/UB1rKG2Avgsc9UA76j3xW6UM/q6gwoEByi5+wRACCyIet6/oTI9ptqaAwvuQ8/xIdjjkfwL5Yx6O9jw5QJ/C6reSj0bMAJ58ZvJe05nZyB6w5EUUyFQ3H05gwGKhBJAJTwQ5uH8We87BMkp3si3VwKKfLdkkGhw84+EkNO5GsILnLx4eTT2ZuwXvYyaWr6UM+aITUe0i+sYgIA9Dnvkq6s/M5j9A8Zo0rmWctd+2Aj6U5kjj89D6sDrqzSw6ztAqy8/zrIDwfJgfdHOglgNTrSh4T4/xIVKD0I/ceSmrxtsLtnz0krmSsDLKxFfllue/Oz6HNEBr/bpNEMs2y7D+1lFNBzvWdwf8BjK3J3KXoo8QAAAAASUVORK5CYII="}})]):t.group?t._e():e("a",{staticClass:"reset-field",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.reset(n)}}},[e("em",{staticClass:"icon ni ni-undo"})])],1),i.desc?e("span",{staticClass:"form-note",domProps:{innerHTML:t._s(i.desc)}}):t._e()]),e("div",{staticClass:"col-lg-7"},[e("SettingControl",{attrs:{module:t.module,id:n,type:i.type,label:i.label||null,options:i.options||null,attr:i.attr||null,multiple:i.multiple||null,repeater:i.repeater||!1,fields:i.fields||null,conditions:i.conditions||null,group:t.group||null,"all-fields":t.allFields}})],1)]),i.desc_long?e("div",{staticClass:"row"},[e("div",{staticClass:"col-md-12 mt-1 mb-2"},[e("span",{staticClass:"form-note-large rounded bg p-2",domProps:{innerHTML:t._s(i.desc_long)}})])]):t._e()])]}))],2)}),[],!1,null,"2ce06dd7",null).exports},33613:(t,e,i)=>{i.r(e),i.d(e,{default:()=>l});var n=i(71199);const s={name:"SettingFoldersControl",props:["model","setValue"],methods:{selectDir:function(){var t=this;this.showModal((0,n.__)("Select root folder","wpide"),"FileManager/Tree",{selected:function(e){t.setValue(e.path),t.hideModal()},path:"/",root:!0})}}};const l=(0,i(9970).Z)(s,(function(){var t=this,e=t._self._c;return e("b-input-group",[e("b-form-input",{attrs:{type:"text",readonly:!0,size:"lg"},model:{value:t.model,callback:function(e){t.model=e},expression:"model"}}),e("b-input-group-append",[e("b-input-group-text",[e("a",{staticClass:"nk-switch-icon",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.selectDir.apply(null,arguments)}}},[e("em",{staticClass:"icon ni ni-network"})])])],1)],1)}),[],!1,null,null,null).exports},34465:(t,e,i)=>{var n=i(67088)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(i){try{return e[n]=!1,"/./"[t](e)}catch(t){}}return!1}},61661:(t,e,i)=>{var n=i(81930),s=i(88669),l=i(67088)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[l])?!!e:"RegExp"===s(t))}},44915:(t,e,i)=>{var n=i(61661),s=TypeError;t.exports=function(t){if(n(t))throw new s("The method doesn't accept regular expressions");return t}},27221:(t,e,i)=>{var n=i(62262),s=i(79024),l=i(39272),o=i(3021),r=i(37473).trim,a=i(36182),d=n.parseInt,u=n.Symbol,c=u&&u.iterator,p=/^[+-]?0x/i,m=l(p.exec),f=8!==d(a+"08")||22!==d(a+"0x16")||c&&!s((function(){d(Object(c))}));t.exports=f?function(t,e){var i=r(o(t));return d(i,e>>>0||(m(p,i)?16:10))}:d},85735:(t,e,i)=>{var n=i(74777),s=i(79024),l=i(39272),o=i(13520),r=i(72652),a=i(9135),d=l(i(88511).f),u=l([].push),c=n&&s((function(){var t=Object.create(null);return t[2]=2,!d(t,2)})),p=function(t){return function(e){for(var i,s=a(e),l=r(s),p=c&&null===o(s),m=l.length,f=0,h=[];m>f;)i=l[f++],n&&!(p?i in s:d(s,i))||u(h,t?[i,s[i]]:s[i]);return h}};t.exports={entries:p(!0),values:p(!1)}},67293:(t,e,i)=>{var n=i(77545),s=i(93809).includes,l=i(79024),o=i(2755);n({target:"Array",proto:!0,forced:l((function(){return!Array(1).includes()}))},{includes:function(t){return s(this,t,arguments.length>1?arguments[1]:void 0)}}),o("includes")},68098:(t,e,i)=>{var n=i(77545),s=i(65010).map;n({target:"Array",proto:!0,forced:!i(79239)("map")},{map:function(t){return s(this,t,arguments.length>1?arguments[1]:void 0)}})},49613:(t,e,i)=>{var n=i(77545),s=i(85735).entries;n({target:"Object",stat:!0},{entries:function(t){return s(t)}})},2017:(t,e,i)=>{var n=i(77545),s=i(27221);n({global:!0,forced:parseInt!==s},{parseInt:s})},73522:(t,e,i)=>{var n=i(77545),s=i(39272),l=i(44915),o=i(63175),r=i(3021),a=i(34465),d=s("".indexOf);n({target:"String",proto:!0,forced:!a("includes")},{includes:function(t){return!!~d(r(o(this)),r(l(t)),arguments.length>1?arguments[1]:void 0)}})}}]);