class c{constructor(){this.init()}init(){this.eventHandlers(),this.graphinaFeatureRequest()}eventHandlers(){jQuery(document.body).on("submit",".graphina-password-restricted-form",this.handleChartAccess.bind(this))}graphinaFeatureRequest(){if(parent.document.querySelector(".elementor-editor-active")!==null){let e="",r="https://iqonic.design/feature-request/?for_product=graphina";setInterval(function(){parent.document.querySelector("[class*=elementor-control-iq]")!=null&&(e=parent.document.querySelector("#elementor-panel__editor__help__link"),e!=null&&e.getAttribute("href")!==r&&(e.setAttribute("href",r),e.innerHTML="<b> Graphina Feature Request <i class='eicon-editor-external-link'></i> </b>"))},3e3)}}handleChartAccess(e){e.preventDefault();const r=new FormData(e.currentTarget),t=Object.fromEntries(r.entries()),a={chart_password:t.chart_password,chart_type:t.chart_type,chart_id:t.chart_id,nonce:t.nonce,action:t.action,graphina_password:t.graphina_password};jQuery.ajax({type:"GET",url:gcfe_public_localize.ajaxurl,data:a,dataType:"json",contentType:"application/json",success:(function(n){n.status===!0?(this.graphinasetCookie(n.chart,!0,1),location.reload()):jQuery(e.currentTarget).find(".elementor-alert-danger").show()}).bind(this),error:function(n,o,s){console.error("Ajax Request Failed:",o,s)}})}graphinasetCookie(e,r,t){var a=new Date;a.setTime(a.getTime()+t*24*60*60*1e3);var n="expires="+a.toUTCString();document.cookie=e+"="+r+";"+n+";path=/"}}jQuery(function(){const i={GraphinaPublic:new c};window.GraphinaPublicMain=i});
//# sourceMappingURL=publicMain.js.map
