upskill-event-manager/assets/js/formidable-abandonment.min.js
Ben Reed cdc5ea85f4 feat: Add comprehensive CSS, JavaScript and theme asset infrastructure
Add massive collection of CSS, JavaScript and theme assets that were previously excluded:

**CSS Files (681 total):**
- HVAC plugin-specific styles (hvac-*.css): 34 files including dashboard, certificates, registration, mobile nav, accessibility fixes, animations, and welcome popup
- Theme framework files (Astra, builder systems, layouts): 200+ files
- Plugin compatibility styles (WooCommerce, WPForms, Elementor, Contact Form 7): 150+ files
- WordPress core and editor styles: 50+ files
- Responsive and RTL language support: 200+ files

**JavaScript Files (400+ total):**
- HVAC plugin functionality (hvac-*.js): 27 files including menu systems, dashboard enhancements, profile sharing, mobile responsive features, accessibility, and animations
- Framework and library files: jQuery plugins, GSAP, AOS, Swiper, Chart.js, Lottie, Isotope
- Plugin compatibility scripts: WPForms, WooCommerce, Elementor, Contact Form 7, LifterLMS
- WordPress core functionality: customizer, admin, block editor compatibility
- Third-party integrations: Stripe, SMTP, analytics, search functionality

**Assets:**
- Certificate background images and logos
- Comprehensive theme styling infrastructure
- Mobile-responsive design systems
- Cross-browser compatibility assets
- Performance-optimized minified versions

**Updated .gitignore:**
- Fixed asset directory whitelisting patterns to properly include CSS/JS/images
- Added proper directory structure recognition (!/assets/css/, !/assets/js/, etc.)
- Maintains security by excluding sensitive files while including essential assets

This commit provides the complete frontend infrastructure needed for:
- Full theme functionality and styling
- Plugin feature implementations
- Mobile responsiveness and accessibility
- Cross-browser compatibility
- Performance optimization
- Developer workflow support
2025-08-11 16:20:31 -03:00

1 line
No EOL
18 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(()=>{var t={931:function(t,e,o){var i,n;i=function(){var t=!1;function e(t){this.opts=function(){for(var t=1;t<arguments.length;t++)for(var e in arguments[t])arguments[t].hasOwnProperty(e)&&(arguments[0][e]=arguments[t][e]);return arguments[0]}({},{onClose:null,onOpen:null,beforeOpen:null,beforeClose:null,stickyFooter:!1,footer:!1,cssClass:[],closeLabel:"Close",closeMethods:["overlay","button","escape"]},t),this.init()}function o(){this.modalBoxFooter&&(this.modalBoxFooter.style.width=this.modalBox.clientWidth+"px",this.modalBoxFooter.style.left=this.modalBox.offsetLeft+"px")}return e.prototype.init=function(){if(!this.modal)return function(){this.modal=document.createElement("div"),this.modal.classList.add("tingle-modal"),0!==this.opts.closeMethods.length&&-1!==this.opts.closeMethods.indexOf("overlay")||this.modal.classList.add("tingle-modal--noOverlayClose"),this.modal.style.display="none",this.opts.cssClass.forEach((function(t){"string"==typeof t&&this.modal.classList.add(t)}),this),-1!==this.opts.closeMethods.indexOf("button")&&(this.modalCloseBtn=document.createElement("button"),this.modalCloseBtn.type="button",this.modalCloseBtn.classList.add("tingle-modal__close"),this.modalCloseBtnIcon=document.createElement("span"),this.modalCloseBtnIcon.classList.add("tingle-modal__closeIcon"),this.modalCloseBtnIcon.innerHTML='<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.3 9.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3L5 6.4l3.3 3.3c.2.2.5.3.7.3.2 0 .5-.1.7-.3.4-.4.4-1 0-1.4L6.4 5l3.3-3.3c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0L5 3.6 1.7.3C1.3-.1.7-.1.3.3c-.4.4-.4 1 0 1.4L3.6 5 .3 8.3c-.4.4-.4 1 0 1.4z" fill="#000" fill-rule="nonzero"/></svg>',this.modalCloseBtnLabel=document.createElement("span"),this.modalCloseBtnLabel.classList.add("tingle-modal__closeLabel"),this.modalCloseBtnLabel.innerHTML=this.opts.closeLabel,this.modalCloseBtn.appendChild(this.modalCloseBtnIcon),this.modalCloseBtn.appendChild(this.modalCloseBtnLabel)),this.modalBox=document.createElement("div"),this.modalBox.classList.add("tingle-modal-box"),this.modalBoxContent=document.createElement("div"),this.modalBoxContent.classList.add("tingle-modal-box__content"),this.modalBox.appendChild(this.modalBoxContent),-1!==this.opts.closeMethods.indexOf("button")&&this.modal.appendChild(this.modalCloseBtn),this.modal.appendChild(this.modalBox)}.call(this),function(){this._events={clickCloseBtn:this.close.bind(this),clickOverlay:function(t){var e=this.modal.offsetWidth-this.modal.clientWidth,o=t.clientX>=this.modal.offsetWidth-15,i=this.modal.scrollHeight!==this.modal.offsetHeight;"MacIntel"===navigator.platform&&0==e&&o&&i||-1!==this.opts.closeMethods.indexOf("overlay")&&!function(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}(t.target,"tingle-modal")&&t.clientX<this.modal.clientWidth&&this.close()}.bind(this),resize:this.checkOverflow.bind(this),keyboardNav:function(t){-1!==this.opts.closeMethods.indexOf("escape")&&27===t.which&&this.isOpen()&&this.close()}.bind(this)},-1!==this.opts.closeMethods.indexOf("button")&&this.modalCloseBtn.addEventListener("click",this._events.clickCloseBtn),this.modal.addEventListener("mousedown",this._events.clickOverlay),window.addEventListener("resize",this._events.resize),document.addEventListener("keydown",this._events.keyboardNav)}.call(this),document.body.appendChild(this.modal,document.body.firstChild),this.opts.footer&&this.addFooter(),this},e.prototype._busy=function(e){t=e},e.prototype._isBusy=function(){return t},e.prototype.destroy=function(){null!==this.modal&&(this.isOpen()&&this.close(!0),function(){-1!==this.opts.closeMethods.indexOf("button")&&this.modalCloseBtn.removeEventListener("click",this._events.clickCloseBtn),this.modal.removeEventListener("mousedown",this._events.clickOverlay),window.removeEventListener("resize",this._events.resize),document.removeEventListener("keydown",this._events.keyboardNav)}.call(this),this.modal.parentNode.removeChild(this.modal),this.modal=null)},e.prototype.isOpen=function(){return!!this.modal.classList.contains("tingle-modal--visible")},e.prototype.open=function(){if(!this._isBusy()){this._busy(!0);var t=this;return"function"==typeof t.opts.beforeOpen&&t.opts.beforeOpen(),this.modal.style.removeProperty?this.modal.style.removeProperty("display"):this.modal.style.removeAttribute("display"),document.getSelection().removeAllRanges(),this._scrollPosition=window.pageYOffset,document.body.classList.add("tingle-enabled"),document.body.style.top=-this._scrollPosition+"px",this.setStickyFooter(this.opts.stickyFooter),this.modal.classList.add("tingle-modal--visible"),"function"==typeof t.opts.onOpen&&t.opts.onOpen.call(t),t._busy(!1),this.checkOverflow(),this}},e.prototype.close=function(t){if(!this._isBusy()){if(this._busy(!0),"function"==typeof this.opts.beforeClose&&!this.opts.beforeClose.call(this))return void this._busy(!1);document.body.classList.remove("tingle-enabled"),document.body.style.top=null,window.scrollTo({top:this._scrollPosition,behavior:"instant"}),this.modal.classList.remove("tingle-modal--visible");var e=this;e.modal.style.display="none","function"==typeof e.opts.onClose&&e.opts.onClose.call(this),e._busy(!1)}},e.prototype.setContent=function(t){return"string"==typeof t?this.modalBoxContent.innerHTML=t:(this.modalBoxContent.innerHTML="",this.modalBoxContent.appendChild(t)),this.isOpen()&&this.checkOverflow(),this},e.prototype.getContent=function(){return this.modalBoxContent},e.prototype.addFooter=function(){return function(){this.modalBoxFooter=document.createElement("div"),this.modalBoxFooter.classList.add("tingle-modal-box__footer"),this.modalBox.appendChild(this.modalBoxFooter)}.call(this),this},e.prototype.setFooterContent=function(t){return this.modalBoxFooter.innerHTML=t,this},e.prototype.getFooterContent=function(){return this.modalBoxFooter},e.prototype.setStickyFooter=function(t){return this.isOverflow()||(t=!1),t?this.modalBox.contains(this.modalBoxFooter)&&(this.modalBox.removeChild(this.modalBoxFooter),this.modal.appendChild(this.modalBoxFooter),this.modalBoxFooter.classList.add("tingle-modal-box__footer--sticky"),o.call(this),this.modalBoxContent.style["padding-bottom"]=this.modalBoxFooter.clientHeight+20+"px"):this.modalBoxFooter&&(this.modalBox.contains(this.modalBoxFooter)||(this.modal.removeChild(this.modalBoxFooter),this.modalBox.appendChild(this.modalBoxFooter),this.modalBoxFooter.style.width="auto",this.modalBoxFooter.style.left="",this.modalBoxContent.style["padding-bottom"]="",this.modalBoxFooter.classList.remove("tingle-modal-box__footer--sticky"))),this},e.prototype.addFooterBtn=function(t,e,o){var i=document.createElement("button");return i.innerHTML=t,i.addEventListener("click",o),"string"==typeof e&&e.length&&e.split(" ").forEach((function(t){i.classList.add(t)})),this.modalBoxFooter.appendChild(i),i},e.prototype.resize=function(){console.warn("Resize is deprecated and will be removed in version 1.0")},e.prototype.isOverflow=function(){return window.innerHeight<=this.modalBox.clientHeight},e.prototype.checkOverflow=function(){this.modal.classList.contains("tingle-modal--visible")&&(this.isOverflow()?this.modal.classList.add("tingle-modal--overflow"):this.modal.classList.remove("tingle-modal--overflow"),!this.isOverflow()&&this.opts.stickyFooter?this.setStickyFooter(!1):this.isOverflow()&&this.opts.stickyFooter&&(o.call(this),this.setStickyFooter(!0)))},{modal:e}},void 0===(n="function"==typeof i?i.call(e,o,e,t):i)||(t.exports=n)}},e={};function o(i){var n=e[i];if(void 0!==n)return n.exports;var s=e[i]={exports:{}};return t[i].call(s.exports,s,s.exports,o),s.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=t=>{const e={[Symbol.iterator](){const t=Object.values(this);let e=Object.keys(this);return{next(){if(e<t.length){const o=t[e];return e++,{value:o,done:!1}}return{done:!0}}}}};return Array.prototype.forEach.call(t,(t=>{e[t.form_id]=document.querySelector("#frm_form_"+t.form_id+"_container form")})),e},e=t=>document.querySelector(`#frm_form_${t}_container form`),i=(t,e,o="abandonment")=>{let i;void 0!==frmAbdn.formSettings&&"abandonment"===o&&(i=frmAbdn.formSettings),void 0!==frmAbdn.loggedOutDraft&&"loggedOutDraft"===o&&(i=frmAbdn.loggedOutDraft);return i.find((e=>e.form_id===t))[e]},n=t=>{const o=e(t);return a(o)||o.classList.contains("frm_loading_form")||o.classList.contains("frm_loading_prev")?{empty:!0}:s(o)+"&antispam_token="+o.dataset.token},s=t=>Array.from(new FormData(t),(function(t){return t.map(encodeURIComponent).join("=")})).join("&"),a=t=>{const e=new FormData(t);for(const t of e.values())if(""!==t)return!1;return!0},l=(t,e,o)=>{if(void 0===o)return;let i=t.querySelector(`input[name="${e}"]`);i||(i=document.createElement("input"),i.type="hidden",i.name=e,i.value=o,t.appendChild(i))},r=t=>t.map((t=>`item_meta[${t}]`)),d=async t=>{if(!t)return{success:!1,message:"No data to send."};const e=await fetch(frm_js.ajax_url,{method:"POST",credentials:"same-origin",headers:{"Cache-Control":"no-cache"},body:t});return Promise.resolve(e.json())};const m=function(){this.eligible=!1,this.observedFieldsFilled=!1,this.formID=null,this.callBack=null,this.is_draft=!1,this.autoSaveInterval=!1,this.bind=function(){this.isEligible()&&(this.callBack(),this.afterCallback(),this.eligible=!1)},this.isEligible=function(){return this.eligible},this.visibilityChange=function(){document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&this.bind()}))},this.saveOnInterval=function(){this.autoSaveInterval&&setInterval((()=>{this.isEligible()&&(this.bind(),this.is_draft&&this.showAutoSaveTime())}),this.autoSaveInterval)},this.showAutoSaveTime=function(){const t=`${frmAbdn.translatable.autoSaved} ${this.formatedTime()}`;let o=document.getElementById("frm-auto-save-time");o||(o=document.createElement("span"),o.id="frm-auto-save-time"),o.textContent=t;const i=e(this.formID).querySelector(".frm_submit .frm_save_draft");i&&i.parentNode.insertBefore(o,i.nextSibling)},this.formatedTime=function(){const t=new Date,e=this.getValidTimeFormat(),o=t.getHours(),i=t.getMinutes(),n=o>=12,s={g:o%12||12,G:o,h:(o%12||12).toString().padStart(2,"0"),H:o.toString().padStart(2,"0"),i:i.toString().padStart(2,"0"),a:n?"pm":"am",A:n?"PM":"AM"};return e.split("").map((t=>void 0!==s[t]?s[t]:t)).join("")},this.getValidTimeFormat=function(){const t=["h","H","g","G","i","a","A"," ",":"],e="g:i a",o=frmAbdn.timeFormat||e;for(const i of o)if(!t.includes(i))return e;return o},this.isAutoSave=function(){return 0!==this.autoSaveInterval},this.setAutoSaveInterval=function(){let t=((t,o)=>{const i=e(t).querySelector(`input[name='${o}']`);return i?i.value:""})(this.formID,"auto_save");t||(t=0),this.autoSaveInterval=t},this.isFormManipulated=function(){e(this.formID).addEventListener("change",(()=>{this.eligible=!0}))},this.isFormSubmitted=function(){document.addEventListener("click",(t=>{t.target.classList.contains("frm_final_submit")&&(this.eligible=!1)}))},this.setDraftStatus=function(){this.isAutoSave()&&!0===i(this.formID,"is_draft")&&this.switchToDraft()},this.switchToDraft=function(){this.is_draft=!0,this.eligible=!0},this.afterCallback=function(){if(this.is_draft)return;const t=e(this.formID).querySelector('[name="id"]');t&&""!==t.value&&this.switchToDraft()},this.isEmailRequired=function(){return this.isAbandonEnabled()&&i(this.formID,"abandon_email_required")},this.isAbandonEnabled=function(){return i(this.formID,"enable_abandon")},this.observeFields=function(){const t=r(i(this.formID,"observable_fields"));Array.prototype.forEach.call(t,(t=>{document.addEventListener("keyup",(e=>{t===e.target.name&&(this.eligible=!0,this.observedFieldsFilled=!0)}))})),e(this.formID).addEventListener("change",(()=>{this.observedFieldsFilled&&(this.eligible=!0)}))},this.initForm=function(){const t=!this.is_draft&&this.isAbandonEnabled(),e=this.is_draft&&this.isAutoSave();t&&this.isEmailRequired()?this.observeFields():(t||e)&&this.isFormManipulated()},this.init=function(t=this.formID,o=this.callBack){this.formID=t,this.callBack=o,this.isFormSubmitted(),this.setAutoSaveInterval(),this.setDraftStatus(),jQuery(document).on("frmPageChanged frmFormComplete",function(){!this.is_draft&&e(this.formID)?.querySelector(".frm_saving_draft")&&this.switchToDraft(),this.initForm()}.bind(this)),jQuery(document).on("frmAfterRemoveRow",function(){this.eligible=!0}.bind(this)),this.initForm(),this.saveOnInterval(),this.visibilityChange()}};var c=o(931),h=o.n(c);function f(t,e,o){document.addEventListener("click",(i=>{const n=document.getElementById(t);if(!n||!i.target.id.match(t)&&!n.contains(i.target))return;i.preventDefault(),async function(t,e){if(!t)return;if(navigator.clipboard)try{await navigator.clipboard.writeText(t.getAttribute(e))}catch(t){console.log(t)}}(document.getElementById(e),o);const s=document.querySelector(".frm-abandonment-copy-success");s&&s.remove();const a=document.createElement("span");a.setAttribute("class","frm-abandonment-copy-success"),a.innerHTML='<svg width="16px" height="16px" class="frmsvg" viewBox="0 0 10 8"><path d="M9.2 1c.2.3.2.7 0 1l-5 5c-.3.2-.6.2-.9 0L.8 4.3a.6.6 0 0 1 .9-.8l2 2 4.6-4.5c.3-.3.6-.3.9 0Z"/></svg>',a.style.margin="0 5px",n.parentNode.insertBefore(a,n.nextSibling),setTimeout((()=>{a.remove()}),6e3)}))}const u=function(){this.firstEmailToField=!1,this.hasEmail=!1,this.formID=null,this.modal=null,this.watchSaveDraft=function(){document.addEventListener("click",(t=>{const o=t.target;if(!o.classList.contains("frm_save_draft"))return;const i=e(this.formID);!this.hasEmail&&this.addRequiredEmailError(i,o)||(i.classList.contains("frm-temp-js-validate")&&i.classList.remove("frm_js_validate","frm-temp-js-validate"),this.hasEmail?this.maybeAddHiddenField(i):(this.stopFormSubmit(o),this.modal||this.initiateModal(),this.modal.open()))}),!0)},this.addRequiredEmailError=function(t,e){const o=document.querySelector(`input[name="${this.firstEmailToField}"][type="email"]`);if(!o)return!1;const i=o.parentNode;return i&&""===o.value?(i.classList.add("frm_blank_field"),o.addEventListener("change",(()=>{this.allowFormSubmit(e)})),t.classList.contains("frm_js_validate")||t.classList.add("frm_js_validate","frm-temp-js-validate"),this.stopFormSubmit(e),!0):(i.classList.remove("frm_blank_field"),!1)},this.stopFormSubmit=function(t){t.classList.remove("frm_save_draft"),t.classList.add("frm_pending_save_draft")},this.allowFormSubmit=function(t){t.classList.remove("frm_pending_save_draft"),t.classList.add("frm_save_draft")},this.maybeAddHiddenField=function(t){this.hasEmail&&l(t,"loggedout_draft","1")},this.initiateModal=function(){const t=e(this.formID).parentNode.getAttribute("class").split(" ").filter(Boolean);t[0]="frm-abandonment-modal",this.modal=new(h().modal)({footer:!0,stickyFooter:!1,closeMethods:["overlay","escape"],closeLabel:frmAbdn.translatable.close,cssClass:t,onOpen:()=>{document.querySelector(".tingle-modal-box__footer").classList.add("frm_submit")},onClose:()=>{const t=e(this.formID),o=t.querySelector(".frm_pending_save_draft");o&&(this.maybeAddHiddenField(t),this.allowFormSubmit(o))}}),this.modalSetContent(),this.modalSetButton()},this.modalSetContent=function(){this.modal.setContent(`\n\t\t<a class="frm-abandonment-close" href="#">×</a>\n\t\t<h3>\n\t\t\t${frmAbdn.translatable.title}\n\t\t</h3>\n\t\t<div class="frm_description">\n\t\t\t<p>\n\t\t\t${frmAbdn.translatable.content}\n\t\t\t</p>\n\t\t</div>\n\t\t<div class="frm_form_field frm_top_container">\n\t\t\t<label for="frm-abandonment-modal-email" class="frm_primary_label">\n\t\t\t\t${frmAbdn.translatable.label}\n\t\t\t\t<span class="frm_required" aria-hidden="true">*</span>\n\t\t\t</label>\n\n\t\t\t<input type="email" id="frm-abandonment-modal-email" />\n\n\t\t\t<div class="frm_error frm-abandonment-field-error frm-abandonment-btn-invisible" role="alert" >\n\t\t\t\t${frmAbdn.translatable.error}\n\t\t\t</div>\n\t\t</div>\n\t\t`)},this.modalSetButton=function(){this.modal.addFooterBtn(frmAbdn.translatable.button,"frm-abandonment-modal-btn frm-abandonment-modal-btn-primary",(()=>{const t=e(this.formID),o=t.querySelector(`input[name="${this.firstEmailToField}"]`),i=document.getElementById("frm-abandonment-modal-email");if(i.value.match(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i)){o.value=i.value,this.hasEmail=!0;const e=t.querySelector(".frm_pending_save_draft");return this.allowFormSubmit(e),e.click(),void this.modal.close()}const n=document.getElementById("frm-abandonment-modal-email");n.focus(),n.style.border="1px solid rgb(255, 0, 0)";document.querySelector(".frm-abandonment-field-error").classList.remove("frm-abandonment-btn-invisible")})),document.querySelector(".frm-abandonment-close").addEventListener("click",(()=>{this.modal.close()}))},this.observeEmailFields=function(){const t=i(this.formID,"observable_fields","loggedOutDraft");if(void 0===t)return void(this.hasEmail=!0);const o=r(t),n=e(this.formID);Array.prototype.forEach.call(o,((t,e)=>{0===e&&(this.firstEmailToField=t);const o=n.querySelector(`input[name='${t}']`);o&&o.value&&(this.hasEmail=!0),document.addEventListener("change",(e=>{t===e.target.getAttribute("name")&&(this.hasEmail=Boolean(e.target.value))}))}))},this.init=function(t){this.formID=t,this.observeEmailFields(),this.watchSaveDraft(),f("frm-abandonment-copy-link","frm-abandonment-link","value")}};var p;p=()=>{void 0!==frmAbdn.formSettings&&v(),void 0!==frmAbdn.loggedOutDraft&&b()},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",p):p());const v=()=>{const e=t(frmAbdn.formSettings);for(const t in e){if(null===e[t])continue;(new m).init(t,(()=>{let e=n(t);e=y(t,e),d(e).then((e=>{g(e,t)}))}))}},b=()=>{const e=t(frmAbdn.loggedOutDraft);for(const t in e){if(null===e[t])continue;(new u).init(t)}};function y(t,e){if(!0===e.empty)return!1;const o=new FormData;return o.append("form_id",t),o.append("data",e),o.append("action","frm_abandoned"),o}function g(t,e){if(!t.success||!t.data.id)return;const o=document.querySelector("#frm_form_"+e+"_container .frm_fields_container");o.querySelector('input[name="frm_action"]').value="update",l(o,"id",t.data.id),l(o,"secret",t.data.secret)}})()})();