: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
let input = sliders[i].querySelector('input[type="hidden"]'),
range = sliders[i].querySelectorAll('input[type="range"]');
range[0].value = range[0].max;
range[1].value = range[0].min;
Themify.triggerEvent(range[1], 'input');
range[0].value = range[0].min;
Themify.triggerEvent(range[0], 'input');
requestAnimationFrame(() => {
const ul = createElement('ul',{class: 'tb_toggleable_fields tb_accordion_fields tb_lb_option',id:data.id}),
fr = createDocumentFragment(),
if (data.id === 'motion_effects' && vals) {
if (vals.hasOwnProperty('custom_parallax_scroll_speed')) {
if (!vals.hasOwnProperty('motion_effects')) {
v_speed: vals.custom_parallax_scroll_speed,
delete vals.custom_parallax_scroll_speed;
if (vals.hasOwnProperty('custom_parallax_scroll_reverse')) {
vals.motion_effects.v.val.v_dir = 'down';
delete vals.custom_parallax_scroll_reverse;
vals.motion_effects.v.val.v_dir = 'up';
if (vals.hasOwnProperty('custom_parallax_scroll_fade')) {
vals.motion_effects.t.val.t_speed = vals.custom_parallax_scroll_speed;
delete vals.custom_parallax_scroll_fade;
const opt = vals[data.id],
const label = data.options[id].label,
li = createElement('li',{class:'tb_closed','data-id':id}),
input = createElement('input',{type:'hidden'}),
title = createElement('','tb_toggleable_fields_title tb_accordion_fields_title tf_plus_icon tf_rel',!label ? i18n[id] : (i18n[label] || label));
input.value = item.val !== undefined?JSON.stringify(item.val):'';
this._expand(li, data.options[id], self);
if (data.options[id] !== undefined) {
for (let id in data.options) {
if (opt === undefined || opt[id] === undefined) {
create(id, data.options[id]);
if (data.id === 'motion_effects') {
const resetEf = createElement('a',{class:'tb_motion_reset_link',href:'#'},i18n.reset_effect);
resetEf.tfOn(_CLICK_, e => {
this._resetMotion(e.currentTarget, self);
if (el.childElementCount < 2) {
el.tfOn('pointerdown', function (e) {
if (e.button === 0 && (e.target.parentNode === this || e.target.parentNode.parentNode === this)) {
e.stopImmediatePropagation();
doc = this.ownerDocument,
item = e.target.closest('.tb_toggleable_item'),
parentNode = item.parentNode;
const scrollDrag = y => {
if (y >= viewMax || y <= viewMin) {
if (isWorking === false) {
const k = ~~(viewMax / 10);
scrollbar.scrollTop += y <= viewMin ? -1 * k : k;
timeout = setTimeout(() => {
requestAnimationFrame(() => {
e.stopImmediatePropagation();
moveTo = doc.elementFromPoint(x, y),
clientY = y - holderHeight - parentNode.getBoundingClientRect().top;
if (clientY > 0 && clientY < parentHeight) {
holder.style.transform = 'translateY(' + clientY + 'px)';
if (y >= viewMax || y <= viewMin) {
if (moveTo !== item && moveTo?.classList.contains('tb_toggleable_item')) {
const side = y > prevY ? 'bottom' : 'top';
if (dir !== side || theLast !== moveTo) {
side === 'bottom' ? moveTo.after(clone) : moveTo.before(clone);
topBodyCl.add('tb_start_animate', 'tb_move_drag');
parentNode.classList.add('tb_sort_start');
if (typeof tinyMCE !== 'undefined') {
const items = parentNode.tfClass('tb_lb_wp_editor');
for (let i = items.length - 1; i > -1; --i) {
editors[id] = tinymce.get(id).getContent();
tinyMCE.execCommand('mceRemoveEditor', false, id);
if (!this.classList.contains('tb_closed')) {
const opt = this.tfClass('tb_toggleable_fields_options')[0];
opt.style.display = 'none';
this.classList.add('tb_closed');
holder = this.cloneNode(true);
holder.tfClass('tb_toggleable_fields_options')[0]?.remove();
clone = holder.cloneNode(true);
scrollbar = this.closest('.tf_scrollbar');
holder.className += ' tb_sort_handler';
clone.classList.add('tb_current_sort');
this.style.display = 'none';
this.after(clone, holder);
holderHeight = holder.getBoundingClientRect().height / 2;
parentHeight = parentNode.offsetHeight;
const box = scrollbar.getBoundingClientRect();
viewMax = box.bottom - 40;
this.tfOff('pointermove', start, {passive: true, once: true})
.tfOff('pointermove', move, {passive: true})
.tfOff('lostpointercapture pointerup', up, {passive: true, once: true});
e.stopImmediatePropagation();
if (typeof tinyMCE !== 'undefined') {
for (let id in editors) {
tinyMCE.execCommand('mceAddEditor', false, id);
tinymce.get(id).setContent(editors[id]);
this.classList.remove('tb_current_sort');
const opt = this.tfClass('tb_toggleable_fields_options')[0];
this.classList.remove('tb_closed');
self.control.preview(parentNode, null, {repeat: true});
Themify.triggerEvent(parentNode, 'sortable');
parentNode.classList.remove('tb_sort_start');
topBodyCl.remove('tb_start_animate', 'tb_move_drag');
theLast = holder = toggleCollapse = dir = prevY = editors = scrollbar = doc = parentHeight = clone = isWorking = holderHeight = viewMin = viewMax = item = timeout = null;
item.tfOn('lostpointercapture pointerup', up, {passive: true, once: true})
.tfOn('pointermove', start, {passive: true, once: true})
.tfOn('pointermove', move, {passive: true})
.setPointerCapture(e.pointerId);
_expand(item, data, self) {
item.tfOn(_CLICK_, function (e) {
if (!this.classList.contains('tb_toggleable_field_disabled') && !e.target.closest('.switch-wrapper')) {
let wrap = this.tfClass('tb_toggleable_fields_options')[0];
wrap = createElement('','tb_toggleable_fields_options tf_box tf_w');
wrap.style.display = 'none';
let pid = this.closest('.tb_toggleable_fields').id,
for(let i=vals.length-1;i>-1;--i){
orig = api.Helper.cloneObject(self.values);
if(data.options.length>0){
wrap.appendChild(self.create(data.options));
} else if (wrap.contains(e.target)) {
if (this.classList.contains('tb_closed')) {
$(wrap).slideDown(function () {
this.parentNode.classList.remove('tb_closed');
$(wrap).slideUp(function () {
this.parentNode.classList.add('tb_closed');
} else if (!e.target.closest('.tb_toggleable_fields_options')) {
const wrap = this.tfClass('tb_toggleable_fields_options')[0];
$(wrap).slideUp(function () {
this.parentNode.classList.add('tb_closed');
const item = el.closest('li'),
cl.add('tb_toggleable_field_disabled', 'tb_closed');
cl.remove('tb_toggleable_field_disabled');
self.control.preview(item.parentNode, null, {repeat: true});
ul = createElement('ul','tb_toggleable_fields tf_w tf_rel'),
oldRepeat = self.is_repeat,
opt = self.values[data.id],
create=(value,itemOpt)=>{
value: itemOpt.toggle?.on || 's'
value: itemOpt.toggle?.off || 'hi'
default: value.on === '1' ? 'on' : 'off',
li = createElement('li',{class: 'tb_toggleable_item tb_closed','data-id':id}),
input = createElement('input',{type:'hidden',value:value.val !== undefined?(typeof value.val==='string'?value.val:JSON.stringify(value.val)):''}),
title = createElement('', 'tb_toggleable_fields_title tf_plus_icon tf_rel'),
switcher = self.create([toogleSwitch]);
title.innerHTML = i18n[itemOpt.label] || itemOpt.label;
if (toogleSwitch.default === 'off') {
li.className += ' tb_toggleable_field_disabled';
li.className += ' ' + itemOpt.class;
switcher.querySelector('.toggle_switch').tfOn('change', function (e) {
_this._disable(this, self);
li.append(input, title, switcher);
_this._expand(li, itemOpt, self);
if (self.is_repeat === true) {
ul.dataset.inputId = data.id;
ul.className += ' tb_lb_option_child';
ul.className += ' tb_lb_option';
for (let i=options.length-1;i>-1;--i) {
optionVals.set(options[i].id,options[i]);
for (let i=0;i<opt.length;++i) {
valsOpt=optionVals.get(id);
for (let i=0;i<options.length;++i) {
if(!mapVals.has(options[i].id)){
if (data.sort !== false) {
self.is_repeat = oldRepeat;
/* options shared across all types in the sortable */
_getGlobalOptions(self) {
_getDefaults(type, self) {
options: self.getOptions('dateFormat'),
not_empty: {hide: 'custom'},
control: {event: 'change'},
not_empty: {hide: 'custom'},
control: {event: 'change'},
not_checked: {hide: 'p_s'}