import{s as r,a as m}from"./state.B1AUjM8Q.js";import{o as u,c as o}from"./modal-manager.Cg_dcz_T.js";import{e as l}from"./post-context.CJ7x6Cmx.js";import{g as d}from"./form-handler.-CowQmQJ.js";import{s as p}from"./field-updater.CG-zcKt8.js";import{m as n}from"./button-positioning.sR9eeeF4.js";import{u as c,a as f}from"./ui-helpers.EB085fFg.js";import"../../../common/credit-toast.DauYY3RS.js";import"../../../common/index.CPcBO1Os.js";import"../../../common/modal.BiaPupKG.js";function g(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}function j(){const t=jQuery;t(document).on("click",".saai-generate-alt-tags-button",function(e){e.preventDefault();const a=t(this),i=parseInt(a.attr("data-attachment-id")||"0");r(i);const s=l();m(s),u()})}function E(){const t=jQuery;t(document).on("click saai_move_button",".media-modal:visible li.attachment",n),t("#wp-media-grid").on("click","li.attachment",n),t(document).on("click",'[data-action="close"]',function(e){e.preventDefault(),o()}),t(document).on("click",".saai-generate-button",function(e){e.preventDefault(),d()}),t(document).on("click",".saai-save-button",function(e){e.preventDefault(),p()}),t(document).on("keydown",function(e){const a=jQuery("#saai-image-alt-tags-modal");e.key==="Escape"&&a&&a.css("display")!=="none"&&o()}),t(document).on("change","#saai-check-all",function(){const e=t(this).prop("checked");t(".saai-generate-field").prop("checked",e),c()}),t(document).on("change",".saai-generate-field",function(e){f(),c()})}export{g as __vite_legacy_guard,E as a,j as b};
