(()=>{const e=jQuery;function t(){window.elementorFrontend.hooks.addFilter("jet-popup/widget-extensions/popup-data",JetEngine.prepareJetPopup)}function i(){window.JetPlugins.hooks.addFilter("jet-popup.show-popup.data","JetEngine.popupData",(e,t,i)=>i?(i.data("popupIsJetEngine")&&(e=JetEngine.prepareJetPopup(e,{"is-jet-engine":!0},i)),e):e)}function n(e,t,i){if(t["is-jet-engine"]){e.isJetEngine=!0;var n=i.closest(".jet-listing-grid__items"),o=i.closest(".jet-listing-grid__item"),d=i.closest(".jet-calendar-week__day-event"),s=i.closest("[data-item-object]"),r=!1,a="default";if(n.length)e.listingSource=n.data("listing-source"),e.listingId=n.data("listing-id"),e.queryId=n.data("query-id");else{var p=i.closest("[data-query-id]"),l=i.closest("[data-listing-source]");p.length&&(e.queryId=p.data("query-id")),l.length&&(e.listingSource=l.data("listing-source"))}if(s?.length?(e.postId=s.data("item-object"),!(r=s.data("render-type"))&&s.hasClass("jet-dynamic-table__row")&&(r="jet-data-table")):o.length?(e.postId=o.data("post-id"),r="jet-engine"):d.length?(e.postId=d.data("post-id"),r="jet-engine-calendar"):window.elementorFrontendConfig&&window.elementorFrontendConfig.post?e.postId=window.elementorFrontendConfig.post.id:(JetEngineSettings?.post_id||JetEngineSettings?.queried_object_id)&&(e.postId=JetEngineSettings.post_id||JetEngineSettings.queried_object_id,JetEngineSettings.queried_object_class&&(e.listingSource=JetEngineSettings.queried_object_class)),window.JetEngineFormsEditor&&window.JetEngineFormsEditor.hasEditor&&(e.hasEditor=!0),window.JetSmartFilters){switch(r){case"jet-engine":var g=n.data("nav");g.widget_settings?._element_id&&(a=g.widget_settings._element_id);break;case"jet-engine-calendar":var u=d.closest(".jet-listing-calendar").data("settings");u._element_id&&(a=u._element_id);break;case"jet-data-table":const e=i.closest(".jet-dynamic-table")[0].dataset.queryId,t=JetEngineSettings.query_builder.custom_ids;0!==t.length&&t?.[e]&&(a=t[e])}r=window.JetPlugins.hooks.applyFilters("jet-engine.prepareJetPopupData.filterProvider",r,i,t),a=window.JetPlugins.hooks.applyFilters("jet-engine.prepareJetPopupData.filterQueryId",a,i,t),e.queryId&&r&&window.JetSmartFilters?.filterGroups?.[r+"/"+a]?.currentQuery&&(e.filtered_query=window.JetSmartFilters.filterGroups[r+"/"+a].currentQuery)}}return e}function o(t,i,n){if(t){var o={popupId:"jet-popup-"+t};i&&(o.isJetEngine=!0,o.postId=n),e(window).trigger({type:"jet-popup-open-trigger",popupData:o})}}window.JetPlugins.hooks.addAction("jet-engine.modules-include","module-jet-popup",function(d){d.triggerPopup=o,d.addPopupFilter=i,d.prepareJetPopup=n,e(window).on("elementor/frontend/init",t),d.addPopupFilter()})})();