.updraftcentral_wizard_option {
width: 45%;
float: left;
text-align: center;
}
.updraftcentral_wizard_option label {
margin-bottom: 8px;
}
#updraftcentral_keys_table {
display: none;
}
.create_key_container {
border: 1px solid;
border-radius: 4px;
padding: 0 0 6px 6px;
margin-bottom: 8px;
}
.updraftcentral-subheading {
font-size: 14px;
margin-top: -10px;
margin-bottom: 20px;
}
.updraftcentral-data-consent {
font-size: 13px;
margin-bottom: 10px;
}
#updraftcentral_keys_table {
width: 100%;
}
#updraftcentral_stage1_go {
cursor: pointer;
}
.updraftcentral_wizard_option > div {
margin-top: 5px;
}
#updraftcentral_keys_table td {
line-height: 1.4em;
}
#updraftcentral_keys_table .updraftcentral_key_delete {
display: inline-block;
margin-top: 4px;
margin-bottom: 4px;
}
#updraftcentral_keys_table .updraft_debugrow td {
min-width: auto !important;
}
/*! elementor - v3.29.0 - 04-06-2025 */
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
/*!******************************************************************!*\
!*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
\******************************************************************/
/***/ ((module) => {
function asyncGeneratorStep(n, t, e, r, o, a, c) {
try {
var i = n[a](c),
u = i.value;
} catch (n) {
return void e(n);
}
i.done ? t(u) : Promise.resolve(u).then(r, o);
}
function _asyncToGenerator(n) {
return function () {
var t = this,
e = arguments;
return new Promise(function (r, o) {
var a = n.apply(t, e);
function _next(n) {
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
}
function _throw(n) {
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
}
_next(void 0);
});
};
}
module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
/*!***********************************************************************!*\
!*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
\***********************************************************************/
/***/ ((module) => {
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
/*!********************************************************************!*\
!*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
\********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
function _regeneratorRuntime() {
"use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
return e;
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
var t,
e = {},
r = Object.prototype,
n = r.hasOwnProperty,
o = Object.defineProperty || function (t, e, r) {
t[e] = r.value;
},
i = "function" == typeof Symbol ? Symbol : {},
a = i.iterator || "@@iterator",
c = i.asyncIterator || "@@asyncIterator",
u = i.toStringTag || "@@toStringTag";
function define(t, e, r) {
return Object.defineProperty(t, e, {
value: r,
enumerable: !0,
configurable: !0,
writable: !0
}), t[e];
}
try {
define({}, "");
} catch (t) {
define = function define(t, e, r) {
return t[e] = r;
};
}
function wrap(t, e, r, n) {
var i = e && e.prototype instanceof Generator ? e : Generator,
a = Object.create(i.prototype),
c = new Context(n || []);
return o(a, "_invoke", {
value: makeInvokeMethod(t, r, c)
}), a;
}
function tryCatch(t, e, r) {
try {
return {
type: "normal",
arg: t.call(e, r)
};
} catch (t) {
return {
type: "throw",
arg: t
};
}
}
e.wrap = wrap;
var h = "suspendedStart",
l = "suspendedYield",
f = "executing",
s = "completed",
y = {};
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
var p = {};
define(p, a, function () {
return this;
});
var d = Object.getPrototypeOf,
v = d && d(d(values([])));
v && v !== r && n.call(v, a) && (p = v);
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
function defineIteratorMethods(t) {
["next", "throw", "return"].forEach(function (e) {
define(t, e, function (t) {
return this._invoke(e, t);
});
});
}
function AsyncIterator(t, e) {
function invoke(r, o, i, a) {
var c = tryCatch(t[r], t, o);
if ("throw" !== c.type) {
var u = c.arg,
h = u.value;
return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
invoke("next", t, i, a);
}, function (t) {
invoke("throw", t, i, a);
}) : e.resolve(h).then(function (t) {
u.value = t, i(u);
}, function (t) {
return invoke("throw", t, i, a);
});
}
a(c.arg);
}
var r;
o(this, "_invoke", {
value: function value(t, n) {
function callInvokeWithMethodAndArg() {
return new e(function (e, r) {
invoke(t, n, e, r);
});
}
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
}
});
}
function makeInvokeMethod(e, r, n) {
var o = h;
return function (i, a) {
if (o === f) throw Error("Generator is already running");
if (o === s) {
if ("throw" === i) throw a;
return {
value: t,
done: !0
};
}
for (n.method = i, n.arg = a;;) {
var c = n.delegate;
if (c) {
var u = maybeInvokeDelegate(c, n);
if (u) {
if (u === y) continue;
return u;
}
}
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
if (o === h) throw o = s, n.arg;
n.dispatchException(n.arg);
} else "return" === n.method && n.abrupt("return", n.arg);
o = f;
var p = tryCatch(e, r, n);
if ("normal" === p.type) {
if (o = n.done ? s : l, p.arg === y) continue;
return {
value: p.arg,
done: n.done
};
}
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
}
};
}
function maybeInvokeDelegate(e, r) {
var n = r.method,
o = e.iterator[n];
if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
var i = tryCatch(o, e.iterator, r.arg);
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
var a = i.arg;
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
}
function pushTryEntry(t) {
var e = {
tryLoc: t[0]
};
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
}
function resetTryEntry(t) {
var e = t.completion || {};
e.type = "normal", delete e.arg, t.completion = e;
}
function Context(t) {
this.tryEntries = [{
tryLoc: "root"
}], t.forEach(pushTryEntry, this), this.reset(!0);
}
function values(e) {
if (e || "" === e) {
var r = e[a];
if (r) return r.call(e);
if ("function" == typeof e.next) return e;
if (!isNaN(e.length)) {
var o = -1,
i = function next() {
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
return next.value = t, next.done = !0, next;
};
return i.next = i;
}
}
throw new TypeError(_typeof(e) + " is not iterable");
}
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
value: GeneratorFunctionPrototype,
configurable: !0
}), o(GeneratorFunctionPrototype, "constructor", {
value: GeneratorFunction,
configurable: !0
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
var e = "function" == typeof t && t.constructor;
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
}, e.mark = function (t) {
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
}, e.awrap = function (t) {
return {
__await: t
};
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
return this;
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
void 0 === i && (i = Promise);
var a = new AsyncIterator(wrap(t, r, n, o), i);
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
return t.done ? t.value : a.next();
});
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
return this;
}), define(g, "toString", function () {
return "[object Generator]";
}), e.keys = function (t) {
var e = Object(t),
r = [];
for (var n in e) r.push(n);
return r.reverse(), function next() {
for (; r.length;) {
var t = r.pop();
if (t in e) return next.value = t, next.done = !1, next;
}
return next.done = !0, next;
};
}, e.values = values, Context.prototype = {
constructor: Context,
reset: function reset(e) {
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
},
stop: function stop() {
this.done = !0;
var t = this.tryEntries[0].completion;
if ("throw" === t.type) throw t.arg;
return this.rval;
},
dispatchException: function dispatchException(e) {
if (this.done) throw e;
var r = this;
function handle(n, o) {
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
}
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
var i = this.tryEntries[o],
a = i.completion;
if ("root" === i.tryLoc) return handle("end");
if (i.tryLoc <= this.prev) {
var c = n.call(i, "catchLoc"),
u = n.call(i, "finallyLoc");
if (c && u) {
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
} else if (c) {
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
} else {
if (!u) throw Error("try statement without catch or finally");
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
}
}
}
},
abrupt: function abrupt(t, e) {
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
var o = this.tryEntries[r];
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
var i = o;
break;
}
}
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
var a = i ? i.completion : {};
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
},
complete: function complete(t, e) {
if ("throw" === t.type) throw t.arg;
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
},
finish: function finish(t) {
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
var r = this.tryEntries[e];
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
}
},
"catch": function _catch(t) {
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
var r = this.tryEntries[e];
if (r.tryLoc === t) {
var n = r.completion;
if ("throw" === n.type) {
var o = n.arg;
resetTryEntry(r);
}
return o;
}
}
throw Error("illegal catch attempt");
},
delegateYield: function delegateYield(e, r, n) {
return this.delegate = {
iterator: values(e),
resultName: r,
nextLoc: n
}, "next" === this.method && (this.arg = t), y;
}
}, e;
}
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "../node_modules/@babel/runtime/helpers/typeof.js":
/*!********************************************************!*\
!*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
\********************************************************/
/***/ ((module) => {
function _typeof(o) {
"@babel/helpers - typeof";
return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
}
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "../node_modules/@babel/runtime/regenerator/index.js":
/*!***********************************************************!*\
!*** ../node_modules/@babel/runtime/regenerator/index.js ***!
\***********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
// TODO(Babel 8): Remove this file.
var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
module.exports = runtime;
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
try {
regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
if (typeof globalThis === "object") {
globalThis.regeneratorRuntime = runtime;
} else {
Function("r", "regeneratorRuntime = r")(runtime);
}
}
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = __webpack_modules__;
/******/
/************************************************************************/
/******/ /* webpack/runtime/ensure chunk */
/******/ (() => {
/******/ __webpack_require__.f = {};
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = (chunkId) => {
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
/******/ __webpack_require__.f[key](chunkId, promises);
/******/ return promises;
/******/ }, []));
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/get javascript chunk filename */
/******/ (() => {
/******/ // This function allow to reference async chunks
/******/ __webpack_require__.u = (chunkId) => {
/******/ // return url for filenames not based on template
/******/ if (chunkId === "modules_nested-tabs_assets_js_editor_module_js") return "0d1a75a41cae2a76432a.bundle.js";
/******/ // return url for filenames based on template
/******/ return undefined;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/global */
/******/ (() => {
/******/ __webpack_require__.g = (function() {
/******/ if (typeof globalThis === 'object') return globalThis;
/******/ try {
/******/ return this || new Function('return this')();
/******/ } catch (e) {
/******/ if (typeof window === 'object') return window;
/******/ }
/******/ })();
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/load script */
/******/ (() => {
/******/ var inProgress = {};
/******/ var dataWebpackPrefix = "elementor:";
/******/ // loadScript function to load a script via script tag
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
/******/ var script, needAttach;
/******/ if(key !== undefined) {
/******/ var scripts = document.getElementsByTagName("script");
/******/ for(var i = 0; i < scripts.length; i++) {
/******/ var s = scripts[i];
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
/******/ }
/******/ }
/******/ if(!script) {
/******/ needAttach = true;
/******/ script = document.createElement('script');
/******/
/******/ script.charset = 'utf-8';
/******/ script.timeout = 120;
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
/******/
/******/ script.src = url;
/******/ }
/******/ inProgress[url] = [done];
/******/ var onScriptComplete = (prev, event) => {
/******/ // avoid mem leaks in IE.
/******/ script.onerror = script.onload = null;
/******/ clearTimeout(timeout);
/******/ var doneFns = inProgress[url];
/******/ delete inProgress[url];
/******/ script.parentNode && script.parentNode.removeChild(script);
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
/******/ needAttach && document.head.appendChild(script);
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/publicPath */
/******/ (() => {
/******/ var scriptUrl;
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
/******/ var document = __webpack_require__.g.document;
/******/ if (!scriptUrl && document) {
/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
/******/ scriptUrl = document.currentScript.src;
/******/ if (!scriptUrl) {
/******/ var scripts = document.getElementsByTagName("script");
/******/ if(scripts.length) {
/******/ var i = scripts.length - 1;
/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
/******/ }
/******/ }
/******/ }
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
/******/ __webpack_require__.p = scriptUrl;
/******/ })();
/******/
/******/ /* webpack/runtime/jsonp chunk loading */
/******/ (() => {
/******/ // no baseURI
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "nested-tabs": 0
/******/ };
/******/
/******/ __webpack_require__.f.j = (chunkId, promises) => {
/******/ // JSONP chunk loading for javascript
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
/******/
/******/ // a Promise means "currently loading".
/******/ if(installedChunkData) {
/******/ promises.push(installedChunkData[2]);
/******/ } else {
/******/ if(true) { // all chunks have JS
/******/ // setup Promise in chunk cache
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
/******/ promises.push(installedChunkData[2] = promise);
/******/
/******/ // start chunk loading
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
/******/ // create error before stack unwound to get useful stacktrace later
/******/ var error = new Error();
/******/ var loadingEnded = (event) => {
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
/******/ installedChunkData = installedChunks[chunkId];
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
/******/ if(installedChunkData) {
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
/******/ var realSrc = event && event.target && event.target.src;
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
/******/ error.name = 'ChunkLoadError';
/******/ error.type = errorType;
/******/ error.request = realSrc;
/******/ installedChunkData[1](error);
/******/ }
/******/ }
/******/ };
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
/******/ }
/******/ }
/******/ }
/******/ };
/******/
/******/ // no prefetching
/******/
/******/ // no preloaded
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/
/******/ // no on chunks loaded
/******/
/******/ // install a JSONP callback for chunk loading
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ var [chunkIds, moreModules, runtime] = data;
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0;
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
/******/ for(moduleId in moreModules) {
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(runtime) var result = runtime(__webpack_require__);
/******/ }
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
/******/
/******/ var chunkLoadingGlobal = self["webpackChunkelementor"] = self["webpackChunkelementor"] || [];
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(() => {
"use strict";
/*!********************************************************!*\
!*** ../modules/nested-tabs/assets/js/editor/index.js ***!
\********************************************************/
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
elementorCommon.elements.$window.on('elementor/nested-element-type-loaded', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
return _regenerator.default.wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return __webpack_require__.e(/*! import() */ "modules_nested-tabs_assets_js_editor_module_js").then(__webpack_require__.bind(__webpack_require__, /*! ../editor/module */ "../modules/nested-tabs/assets/js/editor/module.js"));
case 2:
_context.t0 = _context.sent.default;
new _context.t0();
case 4:
case "end":
return _context.stop();
}
}, _callee);
})));
})();
/******/ })()
;
//# sourceMappingURL=nested-tabs.js.map/*!
* Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:block;src:url(../webfonts/fa-solid-900.eot);src:url(../webfonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.woff) format("woff"),url(../webfonts/fa-solid-900.ttf) format("truetype"),url(../webfonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.fas{font-family:"Font Awesome 5 Free";font-weight:900}/*! elementor-pro - v3.29.0 - 04-06-2025 */
.woocommerce .elementor-widget-woocommerce-product-rating .elementor-widget-container .woocommerce-product-rating,.woocommerce .elementor-widget-woocommerce-product-rating:not(:has(.elementor-widget-container)) .woocommerce-product-rating{align-items:center;display:flex;margin-bottom:0}.woocommerce .elementor-widget-woocommerce-product-rating .elementor-widget-container .star-rating,.woocommerce .elementor-widget-woocommerce-product-rating:not(:has(.elementor-widget-container)) .star-rating{margin-top:0}.elementor-product-rating--align-left .woocommerce-product-rating{justify-content:flex-end}.elementor-product-rating--align-right .woocommerce-product-rating{justify-content:flex-start}.elementor-product-rating--align-center .woocommerce-product-rating{justify-content:center}.elementor-product-rating--align-justify .woocommerce-product-rating .woocommerce-review-link{margin-right:auto}@keyframes elementor-animation-pulse {
25% {
transform: scale(1.1);
}
75% {
transform: scale(0.9);
}
}
.elementor-animation-pulse:active,
.elementor-animation-pulse:focus,
.elementor-animation-pulse:hover {
animation-name: elementor-animation-pulse;
animation-duration: 1s;
animation-timing-function: linear;
animation-iteration-count: infinite;
}
@keyframes zoomInUp {
from {
opacity: 0;
transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0);
animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
}
60% {
opacity: 1;
transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
}
}
.zoomInUp {
animation-name: zoomInUp;
}
Who we are
Thank you for using the Stylemix Themes. We are an US based company, creating WordPress themes and plugins to enhance your website building experience.
Providing consent to both our Terms and Conditions and this Privacy Policy is necessary in order to use our support services.
Definitions
Throughout this document, we may use certain words or phrases, and it is important that you understand the meaning of them.
The following is a non-exhaustive list of definitions of words and phrases found in this document:
"Service" refers to the services that we provide, including our WordPress themes (whether obtained from us via Themeforest.net,
our Site, directly via e-mail, or otherwise) and our Site itself;
"Site" refers to our websites, i.e. https://StylemixThemes.com domain and/or its subdomains;
"StylemixThemes" refers to our company, known as "Stylemix LLC"; our Site; our Service; or a combination of all or some of the preceding definitions,
depending on the context in which the word is used;
"User" refers to anyone who uses our Service, including general visitors to our Site;
"You" refers to you, the person who has accepted this Privacy Policy.
What personal data we collect and why we collect it
We are an US based company and operate web servers and CDN service hosted in the US by DigitalOcean.
Our hosting provider adheres to the EU/US "privacy_policy.php", ensuring that your data is securely stored and GDPR compliant.
For more information on DigitalOcean privacy policy, please see here: DigitalOcean Privacy Policy.
Purchase Data
To use our themes and plugins and receive support, you have to register one or more Envato purchase codes on our site.
These purchase codes will be stored together with support expiration dates and your website domain.
This is required for us to provide you with downloads, product support and other customer services.
We manage all this data according to Envato policies and rulers, as well as GDPR requirements.
Identifying Data
If you register on our website, we store your chosen username and your email address and any additional personal information added by yourself to your user profile.
You can see, edit, or delete your personal information at any time (except changing your username). Website administrators can also see and edit this information.
The information we collect from you to the extent that it is private is disclosed only in accordance with our Terms of Service and/or this Privacy Policy.
Support Data
In order to receive technical support, you need to register on our Site or use a Live Chat facilities provided by Intercom.
Only the data you explicitly provided is sent to our Site or Live Chat. You can see the Intercom privacy policy here: Intercom Terms & Policies.
Non-Identifying Data
As is true of most websites, we gather certain information automatically and store it in log files.
In addition, when you use our Services, we may collect certain information automatically from your device.
This information may include internet protocol (IP) addresses, browser type, internet service provider (ISP),
referring/exit pages, operating system, date/time stamp, clickstream data, landing page, and referring URL.
To collect this information, a cookie may be set on your computer or device when you visit our Services.
Cookies contain a small amount of information that allows our web servers to recognize you.
We store information that we collect through cookies, log files, and/or clear gifs to record your preferences.
We may also automatically collect information about your use of features of our Services, about the functionality of our Services,
frequency of visits, and other information related to your interactions with the Services.
We may track your use across different websites and services. In some countries, including countries in the European Economic Area ("EEA"),
the information referenced above in this paragraph may be considered personal information under applicable data protection laws.
Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party,
this information alone cannot usually be used to identify you.
Comments
// tipsy, facebook style tooltips for jquery
// version 1.0.0a
// (c) 2008-2010 jason frame [jason@onehackoranother.com]
// released under the MIT license
(function($) {
function maybeCall(thing, ctx) {
return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
};
function isElementInDOM(ele) {
while (ele = ele.parentNode) {
if (ele == document) return true;
}
return false;
};
function Tipsy(element, options) {
this.$element = $(element);
this.options = options;
this.enabled = true;
this.fixTitle();
};
Tipsy.prototype = {
show: function() {
var title = this.getTitle();
if (title && this.enabled) {
var $tip = this.tip();
$tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
$tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
$tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
var pos = $.extend({}, this.$element.offset(), {
width: this.$element[0].offsetWidth,
height: this.$element[0].offsetHeight
});
var actualWidth = $tip[0].offsetWidth,
actualHeight = $tip[0].offsetHeight,
gravity = maybeCall(this.options.gravity, this.$element[0]);
var tp;
switch (gravity.charAt(0)) {
case 'n':
tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
break;
case 's':
tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
break;
case 'e':
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
break;
case 'w':
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
break;
}
if (gravity.length == 2) {
if (gravity.charAt(1) == 'w') {
tp.left = pos.left + pos.width / 2 - 15;
} else {
tp.left = pos.left + pos.width / 2 - actualWidth + 15;
}
}
$tip.css(tp).addClass('tipsy-' + gravity);
$tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
if (this.options.className) {
$tip.addClass(maybeCall(this.options.className, this.$element[0]));
}
if (this.options.fade) {
$tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
} else {
$tip.css({visibility: 'visible', opacity: this.options.opacity});
}
}
},
hide: function() {
if (this.options.fade) {
this.tip().stop().fadeOut(function() { $(this).remove(); });
} else {
this.tip().remove();
}
},
fixTitle: function() {
var $e = this.$element;
if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
$e.attr('original-title', $e.attr('title') || '').removeAttr('title');
}
},
getTitle: function() {
var title, $e = this.$element, o = this.options;
this.fixTitle();
var title, o = this.options;
if (typeof o.title == 'string') {
title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
} else if (typeof o.title == 'function') {
title = o.title.call($e[0]);
}
title = ('' + title).replace(/(^\s*|\s*$)/, "");
return title || o.fallback;
},
tip: function() {
if (!this.$tip) {
this.$tip = $('').html('');
this.$tip.data('tipsy-pointee', this.$element[0]);
}
return this.$tip;
},
validate: function() {
if (!this.$element[0].parentNode) {
this.hide();
this.$element = null;
this.options = null;
}
},
enable: function() { this.enabled = true; },
disable: function() { this.enabled = false; },
toggleEnabled: function() { this.enabled = !this.enabled; }
};
$.fn.tipsy = function(options) {
if (options === true) {
return this.data('tipsy');
} else if (typeof options == 'string') {
var tipsy = this.data('tipsy');
if (tipsy) tipsy[options]();
return this;
}
options = $.extend({}, $.fn.tipsy.defaults, options);
function get(ele) {
var tipsy = $.data(ele, 'tipsy');
if (!tipsy) {
tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
$.data(ele, 'tipsy', tipsy);
}
return tipsy;
}
function enter() {
var tipsy = get(this);
tipsy.hoverState = 'in';
if (options.delayIn == 0) {
tipsy.show();
} else {
tipsy.fixTitle();
setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
}
};
function leave() {
var tipsy = get(this);
tipsy.hoverState = 'out';
if (options.delayOut == 0) {
tipsy.hide();
} else {
setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
}
};
if (!options.live) this.each(function() { get(this); });
if (options.trigger != 'manual') {
var binder = options.live ? 'live' : 'bind',
eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
this[binder](eventIn, enter)[binder](eventOut, leave);
}
return this;
};
$.fn.tipsy.defaults = {
className: null,
delayIn: 0,
delayOut: 0,
fade: false,
fallback: '',
gravity: 'n',
html: false,
live: false,
offset: 0,
opacity: 0.8,
title: 'title',
trigger: 'hover'
};
$.fn.tipsy.revalidate = function() {
$('.tipsy').each(function() {
var pointee = $.data(this, 'tipsy-pointee');
if (!pointee || !isElementInDOM(pointee)) {
$(this).remove();
}
});
};
// Overwrite this method to provide options on a per-element basis.
// For example, you could store the gravity in a 'tipsy-gravity' attribute:
// return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
// (remember - do not modify 'options' in place!)
$.fn.tipsy.elementOptions = function(ele, options) {
return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
};
$.fn.tipsy.autoNS = function() {
return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
};
$.fn.tipsy.autoWE = function() {
return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
};
/**
* yields a closure of the supplied parameters, producing a function that takes
* no arguments and is suitable for use as an autogravity function like so:
*
* @param margin (int) - distance from the viewable region edge that an
* element should be before setting its tooltip's gravity to be away
* from that edge.
* @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
* if there are no viewable region edges effecting the tooltip's
* gravity. It will try to vary from this minimally, for example,
* if 'sw' is preferred and an element is near the right viewable
* region edge, but not the top edge, it will set the gravity for
* that element's tooltip to be 'se', preserving the southern
* component.
*/
$.fn.tipsy.autoBounds = function(margin, prefer) {
return function() {
var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
boundTop = $(document).scrollTop() + margin,
boundLeft = $(document).scrollLeft() + margin,
$this = $(this);
if ($this.offset().top < boundTop) dir.ns = 'n';
if ($this.offset().left < boundLeft) dir.ew = 'w';
if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e';
if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's';
return dir.ns + (dir.ew ? dir.ew : '');
}
};
})(jQuery);
var sbiBuilder,
sbiStorage = window.localStorage,
sketch = VueColor.Sketch,
dummyLightBoxComponent = 'sbi-dummy-lightbox-component';
Vue.component( dummyLightBoxComponent , {
template: '#' + dummyLightBoxComponent,
props: ['customizerFeedData','parent','dummyLightBoxScreen']
});
/**
* VueJS Global App Builder
*
* @since 4.0
*/
sbiBuilder = new Vue({
el: '#sbi-builder-app',
http: {
emulateJSON: true,
emulateHTTP: true
},
components: {
'sketch-picker': sketch,
},
mixins: [VueClickaway.mixin],
data: {
nonce: sbi_builder.nonce,
admin_nonce: sbi_builder.admin_nonce,
template: sbi_builder.feedInitOutput,
templateRender: false,
updatedTimeStamp: new Date().getTime(),
feedSettingsDomOptions: null,
$parent: this,
plugins: sbi_builder.installPluginsPopup,
dismissLite: sbi_builder.instagram_feed_dismiss_lite,
supportPageUrl: sbi_builder.supportPageUrl,
builderUrl: sbi_builder.builderUrl,
pluginType: sbi_builder.pluginType,
genericText: sbi_builder.genericText,
ajaxHandler: sbi_builder.ajax_handler,
adminPostURL: sbi_builder.adminPostURL,
widgetsPageURL: sbi_builder.widgetsPageURL,
themeSupportsWidgets: sbi_builder.themeSupportsWidgets,
translatedText: sbi_builder.translatedText,
socialShareLink: sbi_builder.socialShareLink,
licenseType: sbi_builder.licenseType,
freeCtaShowFeatures: false,
upgradeUrl: sbi_builder.upgradeUrl,
pluginUrl: sbi_builder.pluginUrl,
welcomeScreen: sbi_builder.welcomeScreen,
allFeedsScreen: sbi_builder.allFeedsScreen,
extensionsPopup: sbi_builder.extensionsPopup,
mainFooterScreen: sbi_builder.mainFooterScreen,
embedPopupScreen: sbi_builder.embedPopupScreen,
selectSourceScreen: sbi_builder.selectSourceScreen,
customizeScreensText: sbi_builder.customizeScreens,
dialogBoxPopupScreen: sbi_builder.dialogBoxPopupScreen,
selectFeedTypeScreen: sbi_builder.selectFeedTypeScreen,
addFeaturedPostScreen: sbi_builder.addFeaturedPostScreen,
addFeaturedAlbumScreen: sbi_builder.addFeaturedAlbumScreen,
addVideosPostScreen: sbi_builder.addVideosPostScreen,
dummyLightBoxData: sbi_builder.dummyLightBoxData,
dummyLightBoxScreen : false,
svgIcons: sbi_builder.svgIcons,
feedsList: sbi_builder.feeds,
manualSourcePopupInit: sbi_builder.manualSourcePopupInit,
feedTypes: sbi_builder.feedTypes,
socialInfo: sbi_builder.socialInfo,
sourcesList: sbi_builder.sources,
links: sbi_builder.links,
legacyFeedsList: sbi_builder.legacyFeeds,
activeExtensions: sbi_builder.activeExtensions,
advancedFeedTypes: sbi_builder.advancedFeedTypes,
//Selected Feed type => User Hashtag Tagged
selectedFeed: ['user'],
selectedFeedPopup: [],
selectedSources: [],
selectedSourcesPopup: [],
selectedSourcesTagged: [],
selectedSourcesTaggedPopup: [],
selectedSourcesUser: [],
selectedSourcesUserPopup: [],
selectedHastags: [],
selectedHastagsPopup: [],
hashtagInputText: '',
hashtagOrderBy: 'recent',
viewsActive: {
//Screens where the footer widget is disabled
footerDiabledScreens: [
'welcome',
'selectFeed'
],
footerWidget: false,
// welcome, selectFeed
pageScreen: 'welcome',
// feedsType, selectSource, feedsTypeGetProcess
selectedFeedSection: 'feedsType',
sourcePopup: false,
feedtypesPopup: false,
feedtypesCustomizerPopup: false,
sourcesListPopup: false,
// step_1 [Add New Source] , step_2 [Connect to a user pages/groups], step_3 [Add Manually]
sourcePopupScreen: 'redirect_1',
// creation or customizer
sourcePopupType: 'creation',
extensionsPopupElement: false,
feedTypeElement: null,
instanceFeedActive: null,
clipboardCopiedNotif: false,
legacyFeedsShown: false,
editName: false,
embedPopup: false,
embedPopupScreen: 'step_1',
embedPopupSelectedPage: null,
moderationMode: false,
// onboarding
onboardingPopup: sbi_builder.allFeedsScreen.onboarding.active,
onboardingStep: 1,
// customizer onboarding
onboardingCustomizerPopup: sbi_builder.customizeScreens.onboarding.active,
// plugin install popup
installPluginPopup: false,
installPluginModal: 'facebook'
},
//Feeds Pagination
feedPagination: {
feedsCount: sbi_builder.feedsCount != undefined ? sbi_builder.feedsCount : null,
pagesNumber: 1,
currentPage: 1,
itemsPerPage: sbi_builder.itemsPerPage != undefined ? sbi_builder.itemsPerPage : null,
},
//Add New Source
newSourceData: sbi_builder.newSourceData ? sbi_builder.newSourceData : null,
sourceConnectionURLs: sbi_builder.sourceConnectionURLs,
returnedApiSourcesList: [],
addNewSource: {
typeSelected: 'page',
manualSourceID: null,
manualSourceToken: null
},
selectedSourcesToConnect: [],
//Feeds Types Get Info
extraProcessFeedsTypes: [
//'events',
'singlealbum',
'featuredpost',
'videos'
],
isCreateProcessGood: false,
feedCreationInfoUrl: null,
feedTypeOnSourcePopup: 'user',
feedsSelected: [],
selectedBulkAction: false,
singleAlbumFeedInfo: {
url: '',
info: {},
success: false,
isError: false
},
featuredPostFeedInfo: {
url: '',
info: {},
success: false,
isError: false
},
videosTypeInfo: {
type: 'all',
info: {},
playListUrl: null,
success: false,
playListUrlError: false
},
customizerFeedDataInitial: null,
customizerFeedData: sbi_builder.customizerFeedData,
wordpressPageLists: sbi_builder.wordpressPageLists,
iscustomizerScreen: (sbi_builder.customizerFeedData != undefined && sbi_builder.customizerFeedData != false),
customizerSidebarBuilder: sbi_builder.customizerSidebarBuilder,
customizerScreens: {
activeTab: 'customize',
printedType: {},
activeSection: null,
previewScreen: 'desktop',
sourceExpanded: null,
sourcesChoosed: [],
inputNameWidth: '0px',
activeSectionData: null,
parentActiveSection: null, //For nested Setions
parentActiveSectionData: null, //For nested Setions
activeColorPicker: null,
popupBackButton: ['hashtag', 'tagged', 'socialwall', 'feedLayout', 'headerLayout', 'postStyling', 'lightbox', 'filtermoderation', 'shoppablefeed']
},
previewScreens: [
'desktop',
'tablet',
'mobile'
],
nestedStylingSection: [
],
expandedCaptions: [],
sourceToDelete: {},
feedToDelete: {},
dialogBox: {
active: false,
type: null, //deleteSourceCustomizer
heading: null,
description: null,
customButtons: undefined
},
feedStyle: '',
expandedPostText: [],
showedSocialShareTooltip: null,
showedCommentSection: [],
//LightBox Object
lightBox: {
visibility: 'hidden',
type: null,
post: null,
activeImage: null,
albumIndex: 0,
videoSource: null
},
highLightedSection: 'all',
shoppableFeed: {
postId: null,
postMedia: null,
postCaption: null,
postShoppableUrl: ''
},
moderationSettings: {
list_type_selected: null,
allow_list: [],
block_list: []
},
customBlockModerationlistTemp: '',
tooltip: {
text: '',
hover: false,
hoverType: 'outside'
},
//Loading Bar
fullScreenLoader: false,
appLoaded: false,
previewLoaded: false,
loadingBar: true,
notificationElement: {
type: 'success', // success, error, warning, message
text: '',
shown: null
},
//Moderation & Shoppable Mode
moderationShoppableMode: false,
moderationShoppableModeAjaxDone: false,
moderationShoppableModeOffset: 0,
onboardingWizardContent : sbi_builder.onboardingWizardContent,
currentOnboardingWizardStep : 0,
onboardingWizardStepContent : {},
currentOnboardingWizardActiveSettings : {},
onboardingSuccessMessages : sbi_builder.onboardingWizardContent.successMessages,
onboardingSuccessMessagesDisplay : [],
onboardingWizardDone : 'false',
isSetupPage : sbi_builder.isSetupPage,
setupLicencekey : '',
setupLicencekeyError : null,
licenseLoading : false
},
watch: {
feedPreviewOutput: function () {
return this.feedPreviewMaker()
},
},
computed: {
feedStyleOutput: function () {
return this.customizerStyleMaker();
},
singleHolderData: function () {
return this.singleHolderParams();
},
getModerationShoppableMode: function () {
return false;
}
},
updated: function () {
if (this.customizerFeedData) {
this.setShortcodeGlobalSettings(true);
}
},
created: function () {
var self = this;
this.$parent = self;
if (self.customizerFeedData) {
self.template = String("
" + self.template + "
");
self.setShortcodeGlobalSettings(true);
self.feedSettingsDomOptions = self.jsonParse(jQuery("html").find("#sb_instagram").attr('data-options'));
self.selectedSources = self.customizerFeedData.settings.id;
self.selectedSourcesUser = self.customizerFeedData.settings.id;
self.selectedSourcesTagged = self.customizerFeedData.settings.tagged;
self.selectedHastags = self.customizerFeedData.settings.hashtag;
self.selectedFeed = self.getCustomizerSelectedFeedsType();
self.selectedFeedPopup = self.getCustomizerSelectedFeedsType();
self.customizerFeedData.settings.shoppablelist = self.jsonParse(self.customizerFeedData.settings.shoppablelist) ? self.jsonParse(self.customizerFeedData.settings.shoppablelist) : [];
self.customizerFeedData.settings.moderationlist = self.jsonParse(self.customizerFeedData.settings.moderationlist) ? self.jsonParse(self.customizerFeedData.settings.moderationlist) : self.moderationSettings;
Object.assign(self.moderationSettings, self.customizerFeedData.settings.moderationlist);
self.customBlockModerationlistTemp = `${self.customizerFeedData.settings.customBlockModerationlist}`;
self.customizerFeedDataInitial = JSON.parse(JSON.stringify(self.customizerFeedData));
self.updatedTimeStamp = new Date().getTime();
}
if (self.customizerFeedData == undefined) {
self.feedPagination.pagesNumber = self.feedPagination.feedsCount != null ? Math.ceil(self.feedPagination.feedsCount / self.feedPagination.itemsPerPage) : 1
}
window.addEventListener('beforeunload', (event) => {
if (self.customizerFeedData) {
self.leaveWindowHandler(event);
}
});
if(self?.onboardingWizardContent !== undefined){
self?.onboardingWizardContent.steps.forEach( step => {
self.onboardingWizardStepContent[step.id] = step;
} );
self.checkActiveOnboardingWizardSettings()
}
self.loadingBar = false;
/* Onboarding - move elements so the position is in context */
self.positionOnboarding();
setTimeout(function () {
self.positionOnboarding();
}, 500);
if( sbiStorage?.isSetupPage !== 'true' && sbiStorage?.isSetupPage !== true ){
self.appLoaded = true;
}
if(sbiStorage?.setCurrentStep !== undefined){
self.currentOnboardingWizardStep = 1;
sbiStorage.removeItem("setCurrentStep");
}
},
methods: {
updateColorValue: function (id) {
var self = this;
self.customizerFeedData.settings[id] = (self.customizerFeedData.settings[id].a == 1) ? self.customizerFeedData.settings[id].hex : self.customizerFeedData.settings[id].hex8;
},
/**
* Leave Window Handler
*
* @since 6.0
*/
leaveWindowHandler: function (ev) {
var self = this,
updateFeedData = {
action: 'sbi_feed_saver_manager_recache_feed',
feedID: self.customizerFeedData.feed_info.id,
};
self.ajaxPost(updateFeedData, function (_ref) {
var data = _ref.data;
});
},
/**
* Show & Hide View
*
* @since 6.0
*/
activateView: function (viewName, sourcePopupType = 'creation', ajaxAction = false) {
var self = this;
if (viewName === 'extensionsPopupElement' && self.customizerFeedData !== undefined && (self.viewsActive.extensionsPopupElement == 'tagged' || self.viewsActive.extensionsPopupElement == 'hashtag')) {
self.activateView('feedtypesPopup');
}
self.viewsActive[viewName] = (self.viewsActive[viewName] == false) ? true : false;
if (viewName === 'sourcePopup') {
self.viewsActive.sourcePopupType = sourcePopupType;
if (self.customizerFeedData != undefined && sourcePopupType != 'updateCustomizer') {
Object.assign(self.customizerScreens.sourcesChoosed, self.customizerFeedData.settings.sources);
}
if (self.customizerFeedData != undefined && sourcePopupType == 'updateCustomizer') {
//self.viewsActive.sourcesListPopup = true;
//self.viewsActive.sourcePopupType = 'customizer';
//self.viewsActive.sourcePopup = true;
//self.customizerFeedData.settings.sources = self.customizerScreens.sourcesChoosed;
}
if (ajaxAction !== false) {
self.customizerControlAjaxAction(ajaxAction);
}
}
if (viewName === 'feedtypesPopup') {
self.viewsActive.feedTypeElement = null;
}
if (viewName == 'editName') {
document.getElementById("sbi-csz-hd-input").focus();
}
if (viewName == 'embedPopup' && ajaxAction == true) {
self.saveFeedSettings();
}
if ((viewName == 'sourcePopup' || viewName == 'sourcePopupType') && sourcePopupType == 'creationRedirect') {
self.viewsActive.sourcePopupScreen = 'redirect_1';
setTimeout(function () {
self.$refs.addSourceRef.processIFConnect()
}, 3500);
}
sbiBuilder.$forceUpdate();
self.movePopUp();
},
/**
* Show/Hide View or Redirect to plugin dashboard page
*
* @since 4.0
*/
activateViewOrRedirect: function (viewName, pluginName, plugin) {
var self = this;
if (plugin.installed && plugin.activated) {
window.location = plugin.dashboard_permalink;
return;
}
self.viewsActive[viewName] = (self.viewsActive[viewName] == false) ? true : false;
if (viewName == 'installPluginPopup') {
self.viewsActive.installPluginModal = pluginName;
}
self.movePopUp();
sbiBuilder.$forceUpdate();
},
movePopUp: function () {
var overlay = document.querySelectorAll("sb-fs-boss");
if (overlay.length > 0) {
document.getElementById("wpbody-content").prepend(overlay[0]);
}
},
/**
* Check if View is Active
*
* @since 4.0
*
* @return boolean
*/
checkActiveView: function (viewName) {
return this.viewsActive[viewName];
},
/**
* Switch & Change Feed Screens
*
* @since 4.0
*/
switchScreen: function (screenType, screenName) {
this.viewsActive[screenType] = screenName;
sbiBuilder.$forceUpdate();
},
/**
* Check if Value is Empty
*
* @since 4.0
*
* @return boolean
*/
checkNotEmpty: function (value) {
return value != null && value.replace(/ /gi, '') != '';
},
/**
* Check if Value exists in Array Object
*
* @since 4.0
*
* @return boolean
*/
checkObjectArrayElement: function (objectArray, object, byWhat) {
var objectResult = objectArray.filter(function (elem) {
return elem[byWhat] == object[byWhat];
});
return (objectResult.length > 0) ? true : false;
},
/**
* Check if Data Setting is Enabled
*
* @since 4.0
*
* @return boolean
*/
valueIsEnabled: function (value) {
return value == 1 || value == true || value == 'true' || value == 'on';
},
/**
* Parse JSON
*
* @since 4.0
*
* @return jsonObject / Boolean
*/
jsonParse: function (jsonString) {
try {
return JSON.parse(jsonString);
} catch (e) {
return false;
}
},
/**
* Ajax Post Action
*
* @since 4.0
*/
ajaxPost: function (data, callback) {
var self = this;
data['nonce'] = data.nonce ? data.nonce : this.nonce;
self.$http.post(self.ajaxHandler, data).then(callback);
},
/**
* Check if Object has Nested Property
*
* @since 4.0
*
* @return boolean
*/
hasOwnNestedProperty: function (obj, propertyPath) {
if (!propertyPath) { return false; } var properties = propertyPath.split('.');
for (var i = 0; i < properties.length; i++) {
var prop = properties[i];
if (!obj || !obj.hasOwnProperty(prop)) {
return false;
} else {
obj = obj[prop];
}
}
return true;
},
/**
* Feed List Pagination
*
* @since 4.0
*/
feedListPagination: function (type) {
var self = this,
currentPage = self.feedPagination.currentPage,
pagesNumber = self.feedPagination.pagesNumber;
self.loadingBar = true;
if ((currentPage != 1 && type == 'prev') || (currentPage < pagesNumber && type == 'next')) {
self.feedPagination.currentPage = (type == 'next') ?
(currentPage < pagesNumber ? (parseInt(currentPage) + 1) : pagesNumber) :
(currentPage > 1 ? (parseInt(currentPage) - 1) : 1);
var postData = {
action: 'sbi_feed_saver_manager_get_feed_list_page',
page: self.feedPagination.currentPage
};
self.ajaxPost(postData, function (_ref) {
var data = _ref.data;
if (data) {
self.feedsList = data;
}
self.loadingBar = false;
});
sbiBuilder.$forceUpdate();
}
},
/**
* Choose Feed Type
*
* @since 6.0
*/
chooseFeedType: function (feedTypeEl, iscustomizerPopup = false) {
var self = this;
if (feedTypeEl.type == 'user') {
self.selectedFeed = 'user';
} else {
self.viewsActive.extensionsPopupElement = feedTypeEl.type;
if (self.customizerFeedData !== undefined) {
self.viewsActive['feedtypesPopup'] = false;
}
}
sbiBuilder.$forceUpdate();
},
/**
* Choose Feed Type
*
* @since 6.0
*/
selectFeedTypePopup: function (feedTypeEl) {
var self = this;
if (feedTypeEl.type != 'socialwall') {
if (!self.selectedFeedPopup.includes(feedTypeEl.type) && !self.selectedFeed.includes(feedTypeEl.type)) {
self.selectedFeedPopup.push(feedTypeEl.type);
} else {
self.selectedFeedPopup.splice(self.selectedFeedPopup.indexOf(feedTypeEl.type), 1);
}
}
},
/**
* Check Selected Feed Type
*
* @since 6.0
*/
checkFeedTypeSelect: function (feedTypeEl) {
var self = this;
if (self.customizerFeedData) {
return self.selectedFeedPopup.includes(feedTypeEl.type) && feedTypeEl.type != 'socialwall'
}
return self.selectedFeed.includes(feedTypeEl.type) && feedTypeEl.type != 'socialwall'
},
/**
* Confirm Add Feed Type Poup
*
* @since 6.0
*/
addFeedTypePopup: function () {
var self = this;
self.selectedFeed = self.selectedFeedPopup.concat(self.selectedFeed);
self.activateView('feedtypesPopup');
if (self.customizerFeedData) {
self.activateView('feedtypesCustomizerPopup');
}
},
/**
* Returns The Selected Feeds Type
* For Customizer PopUp
*
* @since 6.0
*/
getCustomizerSelectedFeedsType: function () {
var self = this,
customizerSettings = self.customizerFeedData.settings;
switch (customizerSettings.type) {
case 'user':
return ['user'];
break;
case 'hashtag':
return ['hashtag'];
break;
case 'tagged':
return ['tagged'];
break;
case 'mixed':
var feedTypes = [];
if (customizerSettings.id.length > 0) {
feedTypes.push('user');
}
if (customizerSettings.hashtag.length > 0) {
feedTypes.push('hashtag');
}
if (customizerSettings.tagged.length > 0) {
feedTypes.push('tagged');
}
return feedTypes;
break;
}
},
/**
* Choose Feed Type
*
* @since 6.0
*/
checkMultipleFeedType: function () {
return this.selectedFeed.length > 1;
},
/**
* Check if Feed Type Source is Active
*
* @since 6.0
*/
checkMultipleFeedTypeActive: function (feedTypeID) {
return this.selectedFeed.length >= 1 && this.selectedFeed.includes(feedTypeID);
},
/**
* Customizer
* Check if Feed Type Source is Active
*
* @since 6.0
*/
checkMultipleFeedTypeActiveCustomizer: function (feedTypeID) {
return this.customizerFeedData.settings.type == feedTypeID || (this.customizerFeedData.settings.type == 'mixed' && this.checkFeedTypeHasSources(feedTypeID));
},
/**
* Customizer
* Check if Feed Type Has Sources
*
* @since 6.0
*/
checkFeedTypeHasSources: function (feedTypeID) {
var self = this;
switch (feedTypeID) {
case 'user':
return self.createSourcesArray(self.customizerFeedData.settings.id).length > 0;
break;
case 'hashtag':
return self.createSourcesArray(self.customizerFeedData.settings.hashtag).length > 0;
break;
case 'tagged':
return self.createSourcesArray(self.customizerFeedData.settings.tagged).length > 0;
break;
}
return false;
},
/**
* Customizer
* Toggle the Feed Types in Popup
*
* @since 6.0
*/
openFeedTypesPopupCustomizer: function () {
var self = this;
self.selectedSourcesUserPopup = self.createSourcesArray(self.selectedSourcesUser);
self.selectedSourcesTaggedPopup = self.createSourcesArray(self.selectedSourcesTagged);
self.selectedHastagsPopup = self.createSourcesArray(self.selectedHastags);
self.activateView('feedtypesCustomizerPopup')
},
/**
* Customizer
* Toggle the Feed Types in Popup
*
* @since 6.0
*/
toggleFeedTypesChooserPopup: function () {
var self = this;
self.activateView('feedtypesCustomizerPopup');
self.activateView('feedtypesPopup');
},
/**
* Customizer
* Toggle the Feed Types With Sources Popup
*
* @since 6.0
*/
toggleFeedTypesSourcesPopup: function () {
var self = this;
self.activateView('sourcesListPopup');
if (self.customizerFeedData) {
self.activateView('feedtypesCustomizerPopup');
}
},
/**
* Customizer
* Update Feed Type
* & Sources/Hashtags
* @since 6.0
*/
updateFeedTypeAndSourcesCustomizer: function () {
var self = this;
self.selectedSourcesUser = JSON.parse(JSON.stringify(self.createSourcesArray(self.selectedSourcesUserPopup)));
self.selectedSourcesTagged = JSON.parse(JSON.stringify(self.createSourcesArray(self.selectedSourcesTaggedPopup)));
self.selectedHastags = JSON.parse(JSON.stringify(self.createSourcesArray(self.getFeedHashtagsSaverPopup())));
self.customizerFeedData.settings.type = self.getFeedTypeSaver();
self.customizerFeedData.settings.id = self.getFeedIdSourcesSaver();
self.customizerFeedData.settings.tagged = self.getFeedIdSourcesTaggedSaver();
self.customizerFeedData.settings.hashtag = self.getFeedHashtagsSaver();
/**/
self.customizerControlAjaxAction('feedFlyPreview');
self.activateView('feedtypesCustomizerPopup');
},
/**
* Customizer
* Cancel Feed Types
* & Sources/Hashtags
* @since 6.0
*/
cancelFeedTypeAndSourcesCustomizer: function () {
var self = this;
if (
JSON.stringify(self.createSourcesArray(self.selectedSourcesUser)) === JSON.stringify(self.createSourcesArray(self.selectedSourcesUserPopup)) &&
JSON.stringify(self.createSourcesArray(self.selectedSourcesTagged)) === JSON.stringify(self.createSourcesArray(self.selectedSourcesTaggedPopup)) &&
JSON.stringify(self.createSourcesArray(self.selectedHastags)) === JSON.stringify(self.createSourcesArray(self.getFeedHashtagsSaverPopup())) &&
JSON.stringify(self.selectedFeedPopup) === JSON.stringify(self.selectedFeed)
) {
self.viewsActive['feedtypesPopup'] = false;
self.viewsActive['feedtypesCustomizerPopup'] = false;
} else {
self.openDialogBox('unsavedFeedSources');
}
},
/**
* Customizer
* Update Feed Type
* & Sources/Hashtags
* @since 6.0
*/
getFeedHashtagsSaverPopup: function () {
var self = this;
if (self.checkNotEmpty(self.hashtagInputText)) {
self.hashtagWriteDetectPopup(true);
}
return self.selectedHastagsPopup;
},
/**
* If max number of source types are added (3)
*
* @since 6.0
*/
maxTypesAdded: function () {
return this.selectedFeed.length >= 3;
},
/**
* Check if Feed Type Source is Active
*
* @since 6.0
*/
removeFeedTypeSource: function (feedTypeID) {
var self = this;
self.selectedFeed.splice(self.selectedFeed.indexOf(feedTypeID), 1);
if (feedTypeID == 'user') {
self.selectedSourcesUser = [];
}
else if (feedTypeID == 'tagged') {
self.selectedSourcesTagged = [];
}
else if (feedTypeID == 'hashtag') {
self.selectedHastags = [];
}
},
/**
* Choose Feed Type
*
* @since 6.0
*/
checkSingleFeedType: function (feedType) {
return this.selectedFeed.length == 1 && this.selectedFeed[0] == feedType;
},
//Check Feed Creation Process Sources & Hashtags
creationProcessCheckSourcesHashtags: function () {
var self = this;
if (self.selectedFeed.length > 1) {
var number = 0;
if (self.selectedFeed.includes('user') && self.selectedSourcesUser.length >= 1) {
number += 1;
}
if (self.selectedFeed.includes('tagged') && self.selectedSourcesTagged.length >= 1) {
number += 1;
}
if (self.selectedFeed.includes('hashtag') && self.selectedHastags.length >= 1) {
number += 1;
}
return (number > 0);
} else {
if (self.selectedFeed.length == 1 && self.selectedFeed[0] == 'hashtag') {
return (self.selectedHastags.length >= 1 || self.checkNotEmpty(self.hashtagInputText))
}
}
return self.selectedSources.length > 0 ? true : false;
},
/*
Feed Creation Process
*/
creationProcessCheckAction: function () {
var self = this, checkBtnNext = false;
switch (self.viewsActive.selectedFeedSection) {
case 'feedsType':
checkBtnNext = self.selectedFeed != null ? true : false;
window.sbiSelectedFeed = self.selectedFeed;
break;
case 'selectSource':
checkBtnNext = self.creationProcessCheckSourcesHashtags();
break;
case 'feedsTypeGetProcess':
break;
}
return checkBtnNext;
},
//Next Click in the Creation Process
creationProcessNext: function () {
var self = this;
switch (self.viewsActive.selectedFeedSection) {
case 'feedsType':
if (self.selectedFeed !== null) {
if (self.selectedFeed === 'socialwall') {
window.location.href = sbi_builder.pluginsInfo.social_wall.settingsPage;
return;
}
self.switchScreen('selectedFeedSection', 'selectSource');
}
break;
case 'selectSource':
if (self.selectedSources.length > 0 || self.creationProcessCheckSourcesHashtags()) {
if (self.checkPeronalAccount()) {
self.hashtagWriteDetect(true);
self.isCreateProcessGood = self.creationProcessCheckSourcesHashtags();
} else {
self.$refs.personalAccountRef.personalAccountPopup = true;
}
}
break;
case 'feedsTypeGetProcess':
break;
}
if (self.isCreateProcessGood) {
self.submitNewFeed();
}
},
changeVideoSource: function (videoSource) {
this.videosTypeInfo.type = videoSource;
sbiBuilder.$forceUpdate();
},
//Next Click in the Onboarding Process
onboardingNext: function () {
this.viewsActive.onboardingStep++;
this.onboardingHideShow();
sbiBuilder.$forceUpdate();
},
//Previous Click in the Onboarding Process
onboardingPrev: function () {
this.viewsActive.onboardingStep--;
this.onboardingHideShow();
sbiBuilder.$forceUpdate();
},
onboardingHideShow: function () {
var tooltips = document.querySelectorAll(".sb-onboarding-tooltip");
for (var i = 0; i < tooltips.length; i++) {
tooltips[i].style.display = "none";
}
document.querySelectorAll(".sb-onboarding-tooltip-" + this.viewsActive.onboardingStep)[0].style.display = "block";
if (this.viewsActive.onboardingCustomizerPopup) {
if (this.viewsActive.onboardingStep === 2) {
this.switchCustomizerTab('customize');
} else if (this.viewsActive.onboardingStep === 3) {
this.switchCustomizerTab('settings');
}
}
},
//Close Click in the Onboarding Process
onboardingClose: function () {
var self = this,
wasActive = self.viewsActive.onboardingPopup ? 'newuser' : 'customizer';
document.getElementById("sbi-builder-app").classList.remove('sb-onboarding-active');
this.switchCustomizerTab('customize');
self.viewsActive.onboardingPopup = false;
self.viewsActive.onboardingCustomizerPopup = false;
self.viewsActive.onboardingStep = 0;
var postData = {
action: 'sbi_dismiss_onboarding',
was_active: wasActive
};
self.ajaxPost(postData, function (_ref) {
var data = _ref.data;
});
sbiBuilder.$forceUpdate();
},
positionOnboarding: function () {
var self = this,
onboardingElem = document.querySelectorAll(".sb-onboarding-overlay")[0],
wrapElem = document.getElementById("sbi-builder-app");
if (onboardingElem === null || typeof onboardingElem === 'undefined') {
return;
}
if (self.viewsActive.onboardingCustomizerPopup && self.iscustomizerScreen) {
if (document.getElementById("sb-onboarding-tooltip-customizer-1") !== null) {
wrapElem.classList.add('sb-onboarding-active');
var step1El = document.querySelectorAll(".sbi-csz-header")[0];
if( step1El !== undefined ){
step1El.appendChild(document.getElementById("sb-onboarding-tooltip-customizer-1"));
}
var step2El = document.querySelectorAll(".sb-customizer-sidebar-sec1")[0];
if( step2El !== undefined ){
step2El.appendChild(document.getElementById("sb-onboarding-tooltip-customizer-2"));
}
var step3El = document.querySelectorAll(".sb-customizer-sidebar-sec1")[0];
if( step3El !== undefined ){
step3El.appendChild(document.getElementById("sb-onboarding-tooltip-customizer-3"));
}
self.onboardingHideShow();
}
} else if (self.viewsActive.onboardingPopup && !self.iscustomizerScreen) {
if (sbi_builder.allFeedsScreen.onboarding.type === 'single') {
if (document.getElementById("sb-onboarding-tooltip-single-1") !== null) {
wrapElem.classList.add('sb-onboarding-active');
var step1El = document.querySelectorAll(".sbi-fb-wlcm-header .sb-positioning-wrap")[0];
if( step1El !== undefined ){
step1El.appendChild(document.getElementById("sb-onboarding-tooltip-single-1"));
}
var step2El = document.querySelectorAll(".sbi-table-wrap")[0];
if( step2El !== undefined ){
step2El.appendChild(document.getElementById("sb-onboarding-tooltip-single-2"));
}
self.onboardingHideShow();
}
} else {
if (document.getElementById("sb-onboarding-tooltip-multiple-1") !== null) {
wrapElem.classList.add('sb-onboarding-active');
var step1El = document.querySelectorAll(".sbi-fb-wlcm-header .sb-positioning-wrap")[0];
if( step1El !== undefined ){
step1El.appendChild(document.getElementById("sb-onboarding-tooltip-multiple-1"));
}
var step2El = document.querySelectorAll(".sbi-fb-lgc-ctn")[0];
if( step2El !== undefined ){
step2El.appendChild(document.getElementById("sb-onboarding-tooltip-multiple-2"));
}
var step3El = document.querySelectorAll(".sbi-legacy-table-wrap")[0];
if( step3El !== undefined ){
step3El.appendChild(document.getElementById("sb-onboarding-tooltip-multiple-3"));
}
self.activateView('legacyFeedsShown');
self.onboardingHideShow();
}
}
}
},
//Back Click in the Creation Process
creationProcessBack: function () {
var self = this;
switch (self.viewsActive.selectedFeedSection) {
case 'feedsType':
self.switchScreen('pageScreen', 'welcome');
break;
case 'selectSource':
self.switchScreen('selectedFeedSection', 'feedsType');
break;
case 'feedsTypeGetProcess':
self.switchScreen('selectedFeedSection', 'selectSource');
break;
}
sbiBuilder.$forceUpdate();
},
getSelectedSourceName: function (sourceID) {
var self = this;
var sourceInfo = self.sourcesList.filter(function (source) {
return source.account_id == sourceID;
});
return (sourceInfo.length > 0) ? sourceInfo[0].username : '';
},
getSourceIdSelected: function () {
var self = this;
if (self.selectedFeed.length == 1 && self.selectedFeed[0] != 'hashtag') {
return self.selectedSources[0];
} else if (self.selectedSourcesUser.length >= 1 && self.selectedFeed.length > 1 && self.selectedFeed.includes('user')) {
return self.selectedSourcesUser[0];
} else if (self.selectedSourcesTagged.length >= 1 && self.selectedFeed.length > 1 && self.selectedFeed.includes('tagged')) {
return self.selectedSourcesTagged[0];
}
return 'Instagram Feed';
},
//Return Feed Type
getFeedTypeSaver: function () {
var self = this;
if (self.selectedFeed.length > 1) {
return 'mixed';
}
return self.selectedFeed[0];
},
//Return Sources ID,
getFeedIdSourcesSaver: function () {
var self = this;
if ((self.selectedFeed.length > 1 && self.selectedFeed.includes('user')) || self.customizerFeedData) {
return self.selectedSourcesUser;
}
return (self.selectedFeed.length == 1 && self.selectedFeed.includes('user')) ? self.selectedSources : "";
},
//Return Sources ID
getFeedIdSourcesTaggedSaver: function () {
var self = this;
if ((self.selectedFeed.length > 1 && self.selectedFeed.includes('tagged')) || self.customizerFeedData) {
return self.selectedSourcesTagged;
}
return (self.selectedFeed.length == 1 && self.selectedFeed.includes('tagged')) ? self.selectedSources : "";
},
//Return Hashtag Saver
getFeedHashtagsSaver: function () {
var self = this;
if (self.selectedFeed.length == 1 && self.selectedFeed[0] == 'hashtag' && self.checkNotEmpty(self.hashtagInputText)) {
self.hashtagWriteDetect(true);
}
if ((self.selectedFeed.length > 1 && self.selectedFeed.includes('hashtag')) || (self.selectedFeed.length == 1 && self.selectedFeed[0] == 'hashtag')) {
return self.selectedHastags;
}
return [];
},
//Create & Submit New Feed
submitNewFeed: function () {
var self = this,
newFeedData = {
action: 'sbi_feed_saver_manager_builder_update',
sources: self.getFeedIdSourcesSaver(),
tagged: self.getFeedIdSourcesTaggedSaver(),
hashtag: self.getFeedHashtagsSaver(),
order: self.hashtagOrderBy,
new_insert: 'true',
sourcename: self.getSelectedSourceName(self.getSourceIdSelected()),
//feedtype : self.selectedFeed,
type: self.getFeedTypeSaver()
};
self.fullScreenLoader = true;
self.ajaxPost(newFeedData, function (_ref) {
var data = _ref.data;
if (data.feed_id && data.success) {
window.location = self.builderUrl + '&feed_id=' + data.feed_id;
}
});
},
//Select Sources
selectSource: function (source) {
var self = this;
if ((source.account_type != 'personal' && self.selectedFeed[0] == 'tagged') || self.selectedFeed[0] == 'user') {
if (self.selectedSources.includes(source.account_id)) {
self.selectedSources.splice(self.selectedSources.indexOf(source.account_id), 1);
} else {
self.selectedSources.push(source.account_id);
}
}
},
//Source Ative
isSourceSelectActive: function (source) {
var self = this;
if (self.selectedSources.includes(source.account_id)) {
return (source.account_type != 'personal' && self.selectedFeed[0] == 'tagged') || self.selectedFeed[0] == 'user';
}
return false;
},
//Check if source is Disabled
checkSourceDisabled: function (source) {
var self = this;
return (source.account_type == 'personal' && self.selectedFeed[0] == 'tagged');
},
//Open Add Source List Popup
openSourceListPopup: function (feedTypeID) {
var self = this;
self.feedTypeOnSourcePopup = feedTypeID;
if (self.feedTypeOnSourcePopup == 'tagged') {
self.selectedSourcesPopup = self.createSourcesArray(self.selectedSourcesTagged);
} else if (self.feedTypeOnSourcePopup == 'user') {
self.selectedSourcesPopup = self.createSourcesArray(self.selectedSourcesUser);
}
self.activateView('sourcesListPopup');
if (self.customizerFeedData) {
self.activateView('feedtypesCustomizerPopup');
}
},
//Check if source is Disabled POPUP
checkSourceDisabledPopup: function (source) {
var self = this;
return (source.account_type == 'personal' && self.feedTypeOnSourcePopup == 'tagged');
},
//Source Active POPUP
isSourceSelectActivePopup: function (source) {
var self = this;
if (self.selectedSourcesPopup.includes(source.account_id)) {
return (source.account_type != 'personal' && self.feedTypeOnSourcePopup == 'tagged') || self.feedTypeOnSourcePopup == 'user';
}
return false;
},
//Select Sources POPUP
selectSourcePopup: function (source) {
var self = this;
if ((source.account_type != 'personal' && self.feedTypeOnSourcePopup == 'tagged') || self.feedTypeOnSourcePopup == 'user') {
if (self.selectedSourcesPopup.includes(source.account_id)) {
self.selectedSourcesPopup.splice(self.selectedSourcesPopup.indexOf(source.account_id), 1);
} else {
self.selectedSourcesPopup.push(source.account_id);
}
}
},
//Return Choosed Feed Type
returnSelectedSourcesByType: function (feedType) {
var self = this,
sourcesListByType = [];
if (feedType == 'user') {
sourcesListByType = self.sourcesList.filter(function (source) {
return (self.customizerFeedData) ? self.selectedSourcesUserPopup.includes(source.account_id) : self.selectedSourcesUser.includes(source.account_id);
});
} else if (feedType == 'tagged') {
sourcesListByType = self.sourcesList.filter(function (source) {
return (self.customizerFeedData) ? self.selectedSourcesTaggedPopup.includes(source.account_id) : self.selectedSourcesTagged.includes(source.account_id);
});
}
return sourcesListByType;
},
//Remove Source From Feed Type
removeSourceFromFeedType: function (source, feedType) {
var self = this;
if (feedType == 'user') {
if (self.customizerFeedData) {
self.selectedSourcesUserPopup.splice(self.selectedSourcesUserPopup.indexOf(source.account_id), 1)
} else {
self.selectedSourcesUser.splice(self.selectedSourcesUser.indexOf(source.account_id), 1)
}
} else if (feedType == 'tagged') {
if (self.customizerFeedData) {
self.selectedSourcesTaggedPopup.splice(self.selectedSourcesTaggedPopup.indexOf(source.account_id), 1)
} else {
self.selectedSourcesTagged.splice(self.selectedSourcesTagged.indexOf(source.account_id), 1)
}
}
},
/*
Return Selected Sources / Hashtags
on The Customizer Control
*/
returnSelectedSourcesByTypeCustomizer: function (feedType) {
var self = this,
sourcesListNameByType = [];
if (feedType == 'user') {
sourcesListNameByType = self.sourcesList.filter(function (source) {
return self.customizerFeedData.settings.id.includes(source.account_id);
});
}
if (feedType == 'tagged') {
sourcesListNameByType = self.sourcesList.filter(function (source) {
return self.customizerFeedData.settings.tagged.includes(source.account_id);
});
}
if (feedType == 'hashtag') {
sourcesListNameByType = Array.isArray(self.customizerFeedData.settings.hashtag) ? self.customizerFeedData.settings.hashtag : self.customizerFeedData.settings.hashtag.split(',');
}
return sourcesListNameByType;
},
//Check if source are Array
createSourcesArray: function (element) {
var self = this;
if (Array.isArray(element) && element.length == 1 && !this.checkNotEmpty(element[0])) {
return [];
}
var arrayResult = Array.isArray(element) ? Array.from(element) : Array.from(element.split(','));
return arrayResult.filter(function (el) {
return el != null && self.checkNotEmpty(el);
});
},
// Add Source to Feed Type
addSourceToFeedType: function () {
var self = this;
if (self.feedTypeOnSourcePopup == 'tagged') {
if (!self.customizerFeedData) {
self.selectedSourcesTagged = self.createSourcesArray(self.selectedSourcesPopup);
self.selectedSourcesTaggedPopup = self.createSourcesArray(self.selectedSourcesTagged);
} else {
self.selectedSourcesTaggedPopup = self.createSourcesArray(self.selectedSourcesPopup);
}
} else if (self.feedTypeOnSourcePopup == 'user') {
if (!self.customizerFeedData) {
self.selectedSourcesUser = self.createSourcesArray(self.selectedSourcesPopup);
self.selectedSourcesUserPopup = self.createSourcesArray(self.selectedSourcesUser);
} else {
self.selectedSourcesUserPopup = self.createSourcesArray(self.selectedSourcesPopup);
}
}
self.activateView('sourcesListPopup');
if (self.customizerFeedData) {
self.activateView('feedtypesCustomizerPopup');
}
},
//Detect Hashtag Writing
hashtagWriteDetectPopup: function (isProcess = false) {
var self = this,
target = window.event;
if (target.keyCode == 188 || isProcess == true) {
self.hashtagInputText = self.hashtagInputText.replace(',', '');
if (self.checkNotEmpty(self.hashtagInputText)) {
if (self.hashtagInputText[0] !== '#') {
self.hashtagInputText = '#' + self.hashtagInputText;
}
self.selectedHastagsPopup = self.createSourcesArray(self.selectedHastagsPopup);
self.selectedHastagsPopup.push(self.hashtagInputText);
}
self.hashtagInputText = '';
}
},
//Detect Hashtag Writing
hashtagWriteDetect: function (isProcess = false) {
var self = this,
target = window.event;
if (target.keyCode == 188 || isProcess == true) {
self.hashtagInputText = self.hashtagInputText.replace(',', '');
if (self.checkNotEmpty(self.hashtagInputText)) {
if (self.hashtagInputText[0] !== '#') {
self.hashtagInputText = '#' + self.hashtagInputText;
}
self.selectedHastags = self.createSourcesArray(self.selectedHastags);
self.selectedHastags.push(self.hashtagInputText);
self.selectedHastagsPopup = self.createSourcesArray(self.selectedHastags);
}
self.hashtagInputText = '';
}
},
//Remove Hashtag from List
removeHashtag: function (hashtag) {
var self = this;
if (self.customizerFeedData) {
self.selectedHastagsPopup.splice(self.selectedHastagsPopup.indexOf(hashtag), 1);
} else {
self.selectedHastags.splice(self.selectedHastags.indexOf(hashtag), 1);
}
},
processDomList: function (selector, attributes) {
document.querySelectorAll(selector).forEach(function (element) {
attributes.map(function (attrName) {
element.setAttribute(attrName[0], attrName[1]);
});
});
},
openTooltipBig: function () {
var self = this, elem = window.event.currentTarget;
self.processDomList('.sbi-fb-onbrd-tltp-elem', [['data-active', 'false']]);
elem.querySelector('.sbi-fb-onbrd-tltp-elem').setAttribute('data-active', 'true');
sbiBuilder.$forceUpdate();
},
closeTooltipBig: function () {
var self = this;
self.processDomList('.sbi-fb-onbrd-tltp-elem', [['data-active', 'false']]);
window.event.stopPropagation();
sbiBuilder.$forceUpdate();
},
/*
FEEDS List Actions
*/
/**
* Switch Bulk Action
*
* @since 4.0
*/
bulkActionClick: function () {
var self = this;
switch (self.selectedBulkAction) {
case 'delete':
if (self.feedsSelected.length > 0) {
self.openDialogBox('deleteMultipleFeeds')
}
break;
}
sbiBuilder.$forceUpdate();
},
/**
* Duplicate Feed
*
* @since 4.0
*/
feedActionDuplicate: function (feed) {
var self = this,
feedsDuplicateData = {
action: 'sbi_feed_saver_manager_duplicate_feed',
feed_id: feed.id
};
self.ajaxPost(feedsDuplicateData, function (_ref) {
var data = _ref.data;
self.feedsList = Object.values(Object.assign({}, data));
//self.feedsList = data;
});
sbiBuilder.$forceUpdate();
},
/**
* Delete Feed
*
* @since 4.0
*/
feedActionDelete: function (feeds_ids) {
var self = this,
feedsDeleteData = {
action: 'sbi_feed_saver_manager_delete_feeds',
feeds_ids: feeds_ids
};
self.ajaxPost(feedsDeleteData, function (_ref) {
var data = _ref.data;
self.feedsList = Object.values(Object.assign({}, data));
self.feedsSelected = [];
});
},
/**
* View Feed Instances
*
* @since 4.0
*/
viewFeedInstances: function (feed) {
var self = this;
self.viewsActive.instanceFeedActive = feed;
self.movePopUp();
sbiBuilder.$forceUpdate();
},
/**
* Select All Feeds in List
*
* @since 4.0
*/
selectAllFeedCheckBox: function () {
var self = this;
if (!self.checkAllFeedsActive()) {
self.feedsSelected = [];
self.feedsList.forEach(function (feed) {
self.feedsSelected.push(feed.id);
});
} else {
self.feedsSelected = [];
}
},
/**
* Select Single Feed in List
*
* @since 4.0
*/
selectFeedCheckBox: function (feedID) {
if (this.feedsSelected.includes(feedID)) {
this.feedsSelected.splice(this.feedsSelected.indexOf(feedID), 1);
} else {
this.feedsSelected.push(feedID);
}
sbiBuilder.$forceUpdate();
},
/**
* Check if All Feeds are Selected
*
* @since 4.0
*/
checkAllFeedsActive: function () {
var self = this,
result = true;
self.feedsList.forEach(function (feed) {
if (!self.feedsSelected.includes(feed.id)) {
result = false;
}
});
return result;
},
/**
* Copy text to clipboard
*
* @since 4.0
*/
copyToClipBoard: function (value) {
var self = this;
const el = document.createElement('textarea');
el.className = 'sbi-fb-cp-clpboard';
el.value = value;
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
self.notificationElement = {
type: 'success',
text: this.genericText.copiedClipboard,
shown: "shown"
};
setTimeout(function () {
self.notificationElement.shown = "hidden";
}, 3000);
sbiBuilder.$forceUpdate();
},
/*-------------------------------------------
CUSTOMIZER FUNCTIONS
-------------------------------------------*/
/**
* HighLight Section
*
* @since 4.0
*/
isSectionHighLighted: function (sectionName) {
var self = this;
return (self.highLightedSection === sectionName || self.highLightedSection === 'all')
},
/**
* Enable Highlight Section
*
* @since 4.0
*/
enableHighLightSection: function (sectionId) {
var self = this,
listPostSection = ['customize_feedlayout', 'customize_colorschemes', 'customize_posts', 'post_style', 'individual_elements'],
headerSection = ['customize_header'],
followButtonSection = ['customize_followbutton'],
loadeMoreSection = ['customize_loadmorebutton'],
lightBoxSection = ['customize_lightbox'],
domBody = document.getElementsByTagName("body")[0];
self.dummyLightBoxScreen = false;
domBody.classList.remove("no-overflow");
if (listPostSection.includes(sectionId)) {
self.highLightedSection = 'postList';
self.scrollToHighLightedSection("sbi_images");
} else if (headerSection.includes(sectionId)) {
self.highLightedSection = 'header';
self.scrollToHighLightedSection("sb_instagram_header");
} else if (followButtonSection.includes(sectionId)) {
self.highLightedSection = 'followButton';
self.scrollToHighLightedSection("sbi_load");
} else if (loadeMoreSection.includes(sectionId)) {
self.highLightedSection = 'loadMore';
self.scrollToHighLightedSection("sbi_load");
} else if( lightBoxSection.includes(sectionId) ){
self.highLightedSection = 'lightBox';
self.dummyLightBoxScreen = true;
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
domBody.classList.add("no-overflow");
} else {
self.highLightedSection = 'all';
domBody.classList.remove("no-overflow");
}
},
/**
* Scroll to Highlighted Section
*
* @since 4.0
*/
scrollToHighLightedSection: function (sectionId) {
const element = document.getElementById(sectionId) !== undefined && document.getElementById(sectionId) !== null ?
document.getElementById(sectionId) :
(document.getElementsByClassName(sectionId)[0] !== undefined && document.getElementsByClassName(sectionId)[0] !== null ? document.getElementsByClassName(sectionId)[0] : null);
if (element != undefined && element != null) {
const y = element.getBoundingClientRect().top - 120 + window.pageYOffset - 10;
window.scrollTo({ top: y, behavior: 'smooth' });
}
},
/**
* Enable & Show Color Picker
*
* @since 4.0
*/
showColorPickerPospup: function (controlId) {
this.customizerScreens.activeColorPicker = controlId;
},
/**
* Hide Color Picker
*
* @since 4.0
*/
hideColorPickerPospup: function () {
this.customizerScreens.activeColorPicker = null;
},
switchCustomizerPreviewDevice: function (previewScreen) {
var self = this;
self.customizerScreens.previewScreen = previewScreen;
self.loadingBar = true;
window.sbi_preview_device = previewScreen;
setTimeout(function () {
self.setShortcodeGlobalSettings(true);
self.loadingBar = false;
}, 200);
sbiBuilder.$forceUpdate();
},
switchCustomizerTab: function (tabId) {
var self = this,
domBody = document.getElementsByTagName("body")[0];
self.customizerScreens.activeTab = tabId;
self.customizerScreens.activeSection = null;
self.customizerScreens.activeSectionData = null;
self.highLightedSection = 'all';
self.dummyLightBoxScreen = false;
//self.dummyLightBoxData.visibility = 'hidden';
domBody.classList.remove("no-overflow");
if (self.moderationShoppableModeAjaxDone && self.getModerationShoppableMode == false) {
self.customizerControlAjaxAction('feedFlyPreview');
}
sbiBuilder.$forceUpdate();
},
switchCustomizerSection: function (sectionId, section, isNested = false, isBackElements) {
var self = this;
self.customizerScreens.parentActiveSection = null;
self.customizerScreens.parentActiveSectionData = null;
if (isNested) {
self.customizerScreens.parentActiveSection = self.customizerScreens.activeSection;
self.customizerScreens.parentActiveSectionData = self.customizerScreens.activeSectionData;
}
self.customizerScreens.activeSection = sectionId;
self.customizerScreens.activeSectionData = section;
self.enableHighLightSection(sectionId);
if (sectionId === 'settings_filters_moderation') {
self.viewsActive['moderationMode'] = false;
}
sbiBuilder.$forceUpdate();
},
switchNestedSection: function (sectionId, section) {
var self = this;
if (section !== null) {
self.customizerScreens.activeSection = sectionId;
self.customizerScreens.activeSectionData = section;
} else {
var sectionArray = sectionId['sections'];
var elementSectionData = self.customizerSidebarBuilder;
sectionArray.map(function (elm, index) {
elementSectionData = (elementSectionData[elm] != undefined && elementSectionData[elm] != null) ? elementSectionData[elm] : null;
});
if (elementSectionData != null) {
self.customizerScreens.activeSection = sectionId['id'];
self.customizerScreens.activeSectionData = elementSectionData;
}
}
sbiBuilder.$forceUpdate();
},
backToPostElements: function () {
var self = this,
individual_elements = self.customizerSidebarBuilder['customize'].sections.customize_posts.nested_sections.individual_elements;
self.customizerScreens.activeSection = 'customize_posts';
self.customizerScreens.activeSectionData = self.customizerSidebarBuilder['customize'].sections.customize_posts;
self.switchCustomizerSection('individual_elements', individual_elements, true, true);
sbiBuilder.$forceUpdate();
},
changeSettingValue: function (settingID, value, doProcess = true, ajaxAction = false) {
var self = this;
if (settingID == 'layout' && value !== 'grid') {
self.viewsActive.extensionsPopupElement = 'feedLayout';
} else if (settingID == 'headerstyle' && value !== 'standard') {
self.viewsActive.extensionsPopupElement = 'headerLayout';
} else if (settingID == 'sortby' && value == 'likes') {
window.open('https://smashballoon.com/instagram-feed/demo/?utm_campaign=instagram-free&utm_source=customizer&utm_medium=load-more', '_blank');
}
else {
if (doProcess) {
self.customizerFeedData.settings[settingID] = value;
}
if (ajaxAction !== false) {
self.customizerControlAjaxAction(ajaxAction, settingID);
}
self.regenerateLayout(settingID);
}
},
//Shortcode Global Layout Settings
regenerateLayout: function (settingID) {
var self = this,
regenerateFeedHTML = [
'layout'
],
relayoutFeed = [
'layout',
'carouselarrows',
'carouselpag',
'carouselautoplay',
'carouseltime',
'carouselloop',
'carouselrows',
'cols',
'colstablet',
'colsmobile',
'highlighttype',
'highlightoffset',
'highlightpattern',
'highlightids',
'highlighthashtag',
'imagepadding'
];
if (relayoutFeed.includes(settingID)) {
setTimeout(function () {
self.setShortcodeGlobalSettings(true);
}, 200)
}
},
//Get Number of Columns depending on the Preview Screen
getColsPreviewScreen: function () {
var self = this;
if (self.getModerationShoppableMode) {
return 4;
}
switch (self.customizerScreens.previewScreen) {
case 'mobile':
return self.customizerFeedData.settings.colsmobile
break;
case 'tablet':
return self.customizerFeedData.settings.colstablet
break;
default:
return self.customizerFeedData.settings.cols
break;
}
},
//Get Post Number depending on the Preview Screen
getPostNumberPreviewScreen: function () {
var self = this;
switch (self.customizerScreens.previewScreen) {
case 'mobile':
return self.customizerFeedData.settings.nummobile
break;
case 'tablet':
return self.customizerFeedData.settings.nummobile
break;
default:
return self.customizerFeedData.settings.num
break;
}
},
//Get Customizer Additional CSS Classes
getAdditionalCustomizerClasses: function () {
var self = this,
additionalCssClasses = '';
if (self.getModerationShoppableMode) {
additionalCssClasses += ' sbi-customizer-ms-modes ';
}
return additionalCssClasses;
},
//Shortcode Global Layout Settings
setShortcodeGlobalSettings: function (flyPreview = false) {
var self = this,
instagramFeed = jQuery("html").find("#sb_instagram"),
feedSettings = self.jsonParse(instagramFeed.attr('data-options')),
customizerSettings = self.customizerFeedData.settings;
if (JSON.stringify(self.feedSettingsDomOptions) !== JSON.stringify(feedSettings) || flyPreview == true) {
if (customizerSettings.layout == 'grid' || self.getModerationShoppableMode) {
feedSettings = self.gridShortcodeSettings(feedSettings, instagramFeed);
}
else if (customizerSettings.layout == 'carousel') {
feedSettings = self.carouselShortcodeSettings(feedSettings, instagramFeed, customizerSettings);
}
else if (customizerSettings.layout == 'masonry') {
feedSettings = self.masonryShortcodeSettings(feedSettings, instagramFeed, customizerSettings);
}
else if (customizerSettings.layout == 'highlight') {
feedSettings = self.highlightShortcodeSettings(feedSettings, instagramFeed, customizerSettings);
}
if (flyPreview === true) {
if (customizerSettings['id'][0] !== undefined) {
var headerSourceId = customizerSettings['id'][0];
newHeaderData = null;
var newHeaderDataMap = self.sourcesList.map(function (source) {
if (source.account_id === headerSourceId) {
newHeaderData = source != undefined ? source : null;
}
});
if (newHeaderData !== null && newHeaderData.header_data !== null) {
self.customizerFeedData.header = newHeaderData;
self.customizerFeedData.headerData = newHeaderData.header_data;
}
}
}
instagramFeed.attr("data-options", JSON.stringify(feedSettings));
//setTimeout(function(){
window.sbi_init()
//},200)
self.feedSettingsDomOptions = feedSettings;
}
jQuery('body').find('#sbi_load .sbi_load_btn').unbind('click')
},
//Grid Shortcode Settings
gridShortcodeSettings: function (feedSettings, instagramFeed) {
var self = this;
feedSettings['grid'] = true;
self.destroyHighlightLayout(instagramFeed);
self.destroyMasonryLayout(instagramFeed);
self.destoryOwl(instagramFeed);
delete feedSettings['carousel'];
delete feedSettings['masonry'];
delete feedSettings['highlight'];
return feedSettings;
},
//Masonry Shortcode Settings
masonryShortcodeSettings: function (feedSettings, instagramFeed) {
var self = this;
feedSettings['masonry'] = true;
self.destroyHighlightLayout(instagramFeed);
self.destoryOwl(instagramFeed);
delete feedSettings['grid'];
delete feedSettings['carousel'];
delete feedSettings['highlight'];
jQuery('.sbi_photo img').show();
return feedSettings;
},
//Carousel Shortcode Settings
carouselShortcodeSettings: function (feedSettings, instagramFeed, customizerSettings) {
var self = this,
arrows = self.valueIsEnabled(customizerSettings['carouselarrows']),
pag = self.valueIsEnabled(customizerSettings['carouselpag']),
autoplay = self.valueIsEnabled(customizerSettings['carouselautoplay']),
time = autoplay ? parseInt(customizerSettings['carouseltime']) : false,
loop = self.checkNotEmpty(customizerSettings['carouselloop']) && customizerSettings['carouselloop'] !== 'rewind' ? false : true,
rows = customizerSettings['carouselrows'] ? Math.min(parseInt(customizerSettings['carouselrows']), 2) : 1;
feedSettings['carousel'] = [arrows, pag, autoplay, time, loop, rows];
self.destoryOwl(instagramFeed);
self.destroyHighlightLayout(instagramFeed);
self.destroyMasonryLayout(instagramFeed);
delete feedSettings['grid'];
delete feedSettings['masonry'];
delete feedSettings['highlight'];
return feedSettings;
},
//Highlight Shortcode Settings
highlightShortcodeSettings: function (feedSettings, instagramFeed, customizerSettings) {
var self = this,
type = customizerSettings['highlighttype'].trim();
pattern = customizerSettings['highlightpattern'].trim();
offset = parseInt(customizerSettings['highlightoffset']),
hashtag = customizerSettings['highlighthashtag'].replace(',', '|').replace('#', '').replace(' ', '').trim(),
ids = customizerSettings['highlightids'].replace(',', '|').replace('sbi_', '').replace(' ', '').trim();
feedSettings['highlight'] = [type, pattern, offset, hashtag, ids];
self.destroyHighlightLayout(instagramFeed);
self.destroyMasonryLayout(instagramFeed);
self.destoryOwl(instagramFeed);
delete feedSettings['carousel'];
delete feedSettings['masonry'];
delete feedSettings['grid'];
return feedSettings;
},
//destroy Owl
destoryOwl: function (instagramFeed) {
var self = this;
var owlCarouselCtn = instagramFeed.find('.sbi_carousel');
if (instagramFeed.find('#sbi_images').hasClass('sbi_carousel')) {
//self.customizerControlAjaxAction("feedFlyPreview");
/*
if( instagramFeed.hasClass('sbi_carousel_2_row') ){
owlCarouselCtn.find('.sbi_owl2row-item').each( function(index, element) {
if(jQuery(element).children().length == 0){
jQuery(element).remove()
}else{
jQuery("#sbi_images").append(jQuery(element).html())
}
jQuery(element).parents('.sbi-owl-item').remove();
});
}else{
owlCarouselCtn.find('.sbi-owl-item').each( function(index, element) {
if(jQuery(element).children().length == 0){
jQuery(element).remove()
}else{
jQuery("#sbi_images").append(jQuery(element).html())
}
jQuery(element).parents('.sbi-owl-item').remove();
});
}
owlCarouselCtn.find('.sbi-owl-item,.sbi-owl-stage,.sbi-owl-stage-outer,.sbi-owl-nav,.sbi-owl-nav').remove();
owlCarouselCtn.removeClass('sbi_carousel');
instagramFeed.removeClass('sbi_carousel_2_row');
jQuery("#sb_instagram").removeClass('2rows');
owlCarouselCtn.sbiOwlCarousel('destroy');
*/
}
},
//Destroy Masonry Layout
destroyMasonryLayout: function (instagramFeed) {
var self = this;
if (instagramFeed.hasClass('sbi_masonry')) {
instagramFeed.find('#sbi_images').css({ 'height': 'unset' });
instagramFeed.find('.sbi_item').each(function () {
jQuery(this).attr({ 'style': '' });
});
jQuery("#sbi_images").smashotope('destroy');
instagramFeed.removeClass('sbi_masonry')
}
},
//Destroy Highlight Layout
destroyHighlightLayout: function (instagramFeed) {
var self = this;
if (instagramFeed.hasClass('sbi_highlight')) {
instagramFeed.find('#sbi_images').css({ 'height': 'unset' });
instagramFeed.find('.sbi_item').each(function () {
jQuery(this).attr({ 'style': '' });
});
jQuery("#sbi_images").smashotope('destroy');
instagramFeed.removeClass('sbi_highlight')
}
},
//Tablet Cols Classes
getTabletColsClass: function () {
var self = this,
customizerSettings = self.customizerFeedData.settings;
return ' sbi_tab_col_' + parseInt(customizerSettings.colstablet);
},
//Mobile Cols Classes
getMobileColsClass: function () {
var self = this,
customizerSettings = self.customizerFeedData.settings,
disableMobile = self.valueIsEnabled(customizerSettings.disablemobile);
if (disableMobile === 'false') disableMobile = '';
if (disableMobile !== ' sbi_disable_mobile' && customizerSettings.colsmobile !== 'same') {
var colsmobile = parseInt(customizerSettings.colsmobile) > 0 ? parseInt(customizerSettings.colsmobile) : 'auto';
return ' sbi_mob_col_' + colsmobile;
} else {
var colsmobile = parseInt(customizerSettings.cols) > 0 ? parseInt(customizerSettings.cols) : 4;
return ' sbi_disable_mobile sbi_mob_col_' + parseInt(customizerSettings.cols);
}
},
//Header Classes
getHeaderClass: function (headerType) {
//return ' header';
var self = this,
customizerSettings = self.customizerFeedData.settings,
headerClasses = 'sb_instagram_header ';
headerClasses += 'sbi_feed_type_user';
headerClasses += customizerSettings['headerstyle'] === 'centered' && headerType === 'normal' ? ' sbi_centered' : '';
headerClasses += ['medium', 'large'].includes(customizerSettings['headersize']) ? ' sbi_' + customizerSettings['headersize'] : '';
headerClasses += self.getHeaderAvatar() === false ? ' sbi_no_avatar' : '';
headerClasses += self.getPaletteClass('_header');
if (customizerSettings.headeroutside) {
headerClasses += ' sbi_header_outside';
}
return headerClasses;
},
//Header Name
getHeaderName: function () {
var self = this,
headerData = self.customizerFeedData.headerData;
if (self.hasOwnNestedProperty(headerData, 'name') && self.checkNotEmpty(headerData['name'])) {
return headerData['name'];
} else if (self.hasOwnNestedProperty(headerData, 'data.full_name')) {
return headerData['data']['full_name'];
}
return self.getHeaderUserName();
},
//Header User Name
getHeaderUserName: function () {
var self = this,
headerData = self.customizerFeedData.headerData;
if (self.hasOwnNestedProperty(headerData, 'username') && self.checkNotEmpty(headerData['username'])) {
return headerData['username'];
} else if (self.hasOwnNestedProperty(headerData, 'user.username')) {
return headerData['user']['username'];
} else if (self.hasOwnNestedProperty(headerData, 'data.username')) {
return headerData['data']['username'];
}
return '';
},
//Header Media Count
getHeaderMediaCount: function () {
var self = this,
headerData = self.customizerFeedData.headerData;
if (self.hasOwnNestedProperty(headerData, 'data.counts.media')) {
return headerData['data']['counts']['media'];
} else if (self.hasOwnNestedProperty(headerData, 'counts.media')) {
return headerData['counts']['media'];
} else if (self.hasOwnNestedProperty(headerData, 'media_count')) {
return headerData['media_count'];
}
return '';
},
//Header Followers Count
getHeaderFollowersCount: function () {
var self = this,
headerData = self.customizerFeedData.headerData;
if (self.hasOwnNestedProperty(headerData, 'data.counts.followed_by')) {
return headerData['data']['counts']['followed_by'];
} else if (self.hasOwnNestedProperty(headerData, 'counts.followed_by')) {
return headerData['counts']['followed_by'];
} else if (self.hasOwnNestedProperty(headerData, 'followers_count')) {
return headerData['followers_count'];
}
return '';
},
//Header Avatar
getHeaderAvatar: function () {
var self = this,
customizerSettings = self.customizerFeedData.settings,
headerData = self.customizerFeedData.headerData,
header = self.customizerFeedData.header;
if (self.checkNotEmpty(customizerSettings['customavatar'])) {
return customizerSettings['customavatar'];
} else if (header['local_avatar_url'] != false && self.checkNotEmpty(header['local_avatar_url'])) {
return header['local_avatar_url'];
} else {
if (self.hasOwnNestedProperty(headerData, 'profile_picture')) {
return headerData['profile_picture'];
} else if (self.hasOwnNestedProperty(headerData, 'profile_picture_url')) {
return headerData['profile_picture_url'];
} else if (self.hasOwnNestedProperty(headerData, 'user.profile_picture')) {
return headerData['user']['profile_picture'];
} else if (self.hasOwnNestedProperty(headerData, 'data.profile_picture')) {
return headerData['data']['profile_picture'];
}
}
return self.pluginUrl + 'img/thumb-placeholder.png';
},
//Header Bio
getHeaderBio: function () {
var self = this,
customizerSettings = self.customizerFeedData.settings,
headerData = self.customizerFeedData.headerData;
if (self.checkNotEmpty(customizerSettings['custombio'])) {
return customizerSettings['custombio'];
} else if (self.hasOwnNestedProperty(headerData, 'data.bio')) {
return headerData['data']['bio'];
} else if (self.hasOwnNestedProperty(headerData, 'bio')) {
return headerData['bio'];
} else if (self.hasOwnNestedProperty(headerData, 'biography')) {
return headerData['biography'];
}
return '';
},
//Header Text Class
getTextHeaderClass: function () {
var self = this,
customizerSettings = self.customizerFeedData.settings,
headerData = self.customizerFeedData.headerData,
headerClass = 'sbi_header_text ',
shouldShowBio = self.checkNotEmpty(self.getHeaderBio()) ? self.valueIsEnabled(customizerSettings['showbio']) : false,
shouldShowInfo = shouldShowBio || self.valueIsEnabled(customizerSettings['showfollowers']);
headerClass += !shouldShowBio ? 'sbi_no_bio ' : '',
headerClass += !shouldShowInfo ? 'sbi_no_info' : '';
return headerClass;
},
//Get Story Delays
getStoryDelays: function () {
var self = this,
customizerSettings = self.customizerFeedData.settings;
return self.checkNotEmpty(customizerSettings['storiestime']) ? Math.max(500, parseInt(customizerSettings['storiestime'])) : 5000;
},
//Get Story Data
getStoryData: function () {
var self = this,
customizerSettings = self.customizerFeedData.settings,
headerData = self.customizerFeedData.headerData;
if (self.hasOwnNestedProperty(headerData, 'stories') && headerData.stories.length > 0 && self.valueIsEnabled(customizerSettings['stories'])) {
return headerData['stories'];
}
return false;
},
//Image Chooser
imageChooser: function (settingID) {
var self = this;
var uploader = wp.media({
frame: 'post',
title: 'Media Uploader',
button: { text: 'Choose Media' },
library: { type: 'image' },
multiple: false
}).on('close', function () {
var selection = uploader.state().get('selection');
if (selection.length != 0) {
attachment = selection.first().toJSON();
self.customizerFeedData.settings[settingID] = attachment.url;
}
}).open();
},
//Change Switcher Settings
changeSwitcherSettingValue: function (settingID, onValue, offValue, ajaxAction = false) {
var self = this;
self.customizerFeedData.settings[settingID] = self.customizerFeedData.settings[settingID] == onValue ? offValue : onValue;
if (ajaxAction !== false) {
self.customizerControlAjaxAction(ajaxAction);
}
if (settingID == 'disablelightbox' || settingID == 'shoppablefeed') {
if (self.valueIsEnabled(self.customizerFeedData.settings['disablelightbox']) || self.valueIsEnabled(self.customizerFeedData.settings['shoppablefeed'])) {
jQuery('body').find('.sbi_link').addClass('sbi_disable_lightbox');
} else {
jQuery('body').find('.sbi_link').removeClass('sbi_disable_lightbox');
}
}
self.regenerateLayout(settingID);
},
//Checkbox List
changeCheckboxListValue: function (settingID, value, ajaxAction = false) {
var self = this,
settingValue = self.customizerFeedData.settings[settingID].split(',');
if (!Array.isArray(settingValue)) {
settingValue = [settingValue];
}
if (settingValue.includes(value)) {
settingValue.splice(settingValue.indexOf(value), 1);
} else {
settingValue.push(value);
}
self.customizerFeedData.settings[settingID] = settingValue.join(',');
},
//Section Checkbox
changeCheckboxSectionValue: function (settingID, value, ajaxAction = false) {
var self = this;
var settingValue = self.customizerFeedData.settings[settingID];
if (!Array.isArray(settingValue) && settingID == 'type') {
settingValue = [settingValue];
}
if (settingValue.includes(value)) {
settingValue.splice(settingValue.indexOf(value), 1);
} else {
settingValue.push(value);
}
if (settingID == 'type') {
self.processFeedTypesSources(settingValue);
}
//settingValue = (settingValue.length == 1 && settingID == 'type') ? settingValue[0] : settingValue;
self.customizerFeedData.settings[settingID] = settingValue;
if (ajaxAction !== false) {
self.customizerControlAjaxAction(ajaxAction);
}
event.stopPropagation()
},
checkboxSectionValueExists: function (settingID, value) {
var self = this;
var settingValue = self.customizerFeedData.settings[settingID];
return settingValue.includes(value) ? true : false;
},
/**
* Check Control Condition
*
* @since 4.0
*/
checkControlCondition: function (conditionsArray = [], checkExtensionActive = false, checkExtensionActiveDimmed = false) {
var self = this,
isConditionTrue = 0;
Object.keys(conditionsArray).map(function (condition, index) {
if (conditionsArray[condition].indexOf(self.customizerFeedData.settings[condition]) !== -1)
isConditionTrue += 1
});
var extensionCondition = checkExtensionActive != undefined && checkExtensionActive != false ? self.checkExtensionActive(checkExtensionActive) : true,
extensionCondition = checkExtensionActiveDimmed != undefined && checkExtensionActiveDimmed != false && !self.checkExtensionActive(checkExtensionActiveDimmed) ? false : extensionCondition;
return (isConditionTrue == Object.keys(conditionsArray).length) ? (extensionCondition) : false;
},
/**
* Check Color Override Condition
*
* @since 4.0
*/
checkControlOverrideColor: function (overrideConditionsArray = []) {
var self = this,
isConditionTrue = 0;
overrideConditionsArray.map(function (condition, index) {
if (self.checkNotEmpty(self.customizerFeedData.settings[condition]) && self.customizerFeedData.settings[condition].replace(/ /gi, '') != '#') {
isConditionTrue += 1
}
});
return (isConditionTrue >= 1) ? true : false;
},
/**
* Show Control
*
* @since 4.0
*/
isControlShown: function (control) {
var self = this;
if (control.checkViewDisabled != undefined) {
return !self.viewsActive[control.checkViewDisabled];
}
if (control.checkView != undefined) {
return !self.viewsActive[control.checkView];
}
if (control.checkExtension != undefined && control.checkExtension != false && !self.checkExtensionActive(control.checkExtension)) {
return self.checkExtensionActive(control.checkExtension);
}
if (control.conditionDimmed != undefined && self.checkControlCondition(control.conditionDimmed))
return self.checkControlCondition(control.conditionDimmed);
if (control.overrideColorCondition != undefined) {
return self.checkControlOverrideColor(control.overrideColorCondition);
}
return (control.conditionHide != undefined && control.condition != undefined || control.checkExtension != undefined)
? self.checkControlCondition(control.condition, control.checkExtension)
: true;
},
checkExtensionActive: function (extension) {
var self = this;
return self.activeExtensions[extension];
},
expandSourceInfo: function (sourceId) {
var self = this;
self.customizerScreens.sourceExpanded = (self.customizerScreens.sourceExpanded === sourceId) ? null : sourceId;
window.event.stopPropagation()
},
resetColor: function (controlId) {
this.customizerFeedData.settings[controlId] = '';
},
//Source Active Customizer
isSourceActiveCustomizer: function (source) {
var self = this;
return (
Array.isArray(self.customizerFeedData.settings.sources.map) ||
self.customizerFeedData.settings.sources instanceof Object
) &&
self.customizerScreens.sourcesChoosed.map(s => s.account_id).includes(source.account_id);
//self.customizerFeedData.settings.sources.map(s => s.account_id).includes(source.account_id);
},
//Choose Source From Customizer
selectSourceCustomizer: function (source, isRemove = false) {
var self = this,
isMultifeed = (self.activeExtensions['multifeed'] !== undefined && self.activeExtensions['multifeed'] == true),
sourcesListMap = Array.isArray(self.customizerFeedData.settings.sources) || self.customizerFeedData.settings.sources instanceof Object ? self.customizerFeedData.settings.sources.map(s => s.account_id) : [];
if (isMultifeed) {
if (self.customizerScreens.sourcesChoosed.map(s => s.account_id).includes(source.account_id)) {
var indexToRemove = self.customizerScreens.sourcesChoosed.findIndex(src => src.account_id === source.account_id);
self.customizerScreens.sourcesChoosed.splice(indexToRemove, 1);
if (isRemove) {
self.customizerFeedData.settings.sources.splice(indexToRemove, 1);
}
} else {
self.customizerScreens.sourcesChoosed.push(source);
}
} else {
self.customizerScreens.sourcesChoosed = (sourcesListMap.includes(source)) ? [] : [source];
}
sbiBuilder.$forceUpdate();
},
closeSourceCustomizer: function () {
var self = this;
self.viewsActive['sourcePopup'] = false;
//self.customizerFeedData.settings.sources = self.customizerScreens.sourcesChoosed;
sbiBuilder.$forceUpdate();
},
customizerFeedTypePrint: function () {
var self = this,
combinedTypes = self.feedTypes.concat(self.advancedFeedTypes);
result = combinedTypes.filter(function (tp) {
return tp.type === self.customizerFeedData.settings.feedtype
});
self.customizerScreens.printedType = result.length > 0 ? result[0] : [];
return result.length > 0 ? true : false;
},
choosedFeedTypeCustomizer: function (feedType) {
var self = this, result = false;
if (
(self.viewsActive.feedTypeElement === null && self.customizerFeedData.settings.feedtype === feedType) ||
(self.viewsActive.feedTypeElement !== null && self.viewsActive.feedTypeElement == feedType)
) {
result = true;
}
return result;
},
updateFeedTypeCustomizer: function () {
var self = this;
if (self.viewsActive.feedTypeElement === 'socialwall') {
window.location.href = sbi_builder.pluginsInfo.social_wall.settingsPage;
return;
}
self.setType(self.viewsActive.feedTypeElement);
self.customizerFeedData.settings.feedtype = self.viewsActive.feedTypeElement;
self.viewsActive.feedTypeElement = null;
self.viewsActive.feedtypesPopup = false;
self.customizerControlAjaxAction('feedFlyPreview');
sbiBuilder.$forceUpdate();
},
updateInputWidth: function () {
this.customizerScreens.inputNameWidth = ((document.getElementById("sbi-csz-hd-input").value.length + 6) * 8) + 'px';
},
feedPreviewMaker: function () {
var self = this;
return self.template;
//return self.template == null ? null : "
" + self.template + "
";
},
customizerStyleMaker: function () {
var self = this;
if (self.customizerSidebarBuilder) {
self.feedStyle = '';
Object.values(self.customizerSidebarBuilder).map(function (tab) {
self.customizerSectionStyle(tab.sections);
});
return '';
}
return false;
},
escapeHTML: function (text) {
return text.replace(/&/g, "&")
.replace(//g, ">")
.replace(/"/g, """)
.replace(/'/g, "'");
},
/**
* Get Feed Preview Global CSS Class
*
* @since 4.0
* @return String
*/
getPaletteClass: function (context = '') {
var self = this,
colorPalette = self.customizerFeedData.settings.colorpalette;
if (self.checkNotEmpty(colorPalette)) {
var feedID = colorPalette === 'custom' ? ('_' + self.customizerFeedData.feed_info.id) : '';
return colorPalette !== 'inherit' ? ' sbi' + context + '_palette_' + colorPalette + feedID : '';
}
return '';
},
customizerSectionStyle: function (sections) {
var self = this;
Object.values(sections).map(function (section) {
if (section.controls) {
Object.values(section.controls).map(function (control) {
self.returnControlStyle(control);
});
}
if (section.nested_sections) {
self.customizerSectionStyle(section.nested_sections);
Object.values(section.nested_sections).map(function (nestedSections) {
Object.values(nestedSections.controls).map(function (nestedControl) {
if (nestedControl.section) {
self.customizerSectionStyle(nestedControl);
}
});
});
}
});
},
returnControlStyle: function (control) {
var self = this;
if (control.style) {
Object.entries(control.style).map(function (css) {
var condition = control.condition != undefined || control.checkExtension != undefined ? self.checkControlCondition(control.condition, control.checkExtension) : true;
if (condition) {
self.feedStyle +=
css[0] + '{' +
css[1].replace("{{value}}", self.customizerFeedData.settings[control.id]) +
'}';
}
});
}
},
/**
* Customizer Control Ajax
* Some of the customizer controls need to perform Ajax
* Calls in order to update the preview
*
* @since 6.0
*/
customizerControlAjaxAction: function (actionType, settingID = false) {
var self = this;
switch (actionType) {
case 'feedFlyPreview':
self.loadingBar = true;
self.templateRender = false;
var previewFeedData = {
action: 'sbi_feed_saver_manager_fly_preview',
feedID: self.customizerFeedData.feed_info.id,
previewSettings: self.customizerFeedData.settings,
feedName: self.customizerFeedData.feed_info.feed_name,
};
if (self.getModerationShoppableMode) {
previewFeedData['moderationShoppableMode'] = true;
previewFeedData['offset'] = self.moderationShoppableModeOffset;
}
self.ajaxPost(previewFeedData, function (_ref) {
var data = _ref.data;
if (data !== false) {
self.updatedTimeStamp = new Date().getTime();
self.template = String("
Comments