/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
import{ref as e,openBlock as t,createElementBlock as a,Fragment as i,createElementVNode as l,normalizeClass as d,createVNode as o}from"vue";import s from"./basic/MediaUploadModal.vue.js";import './ImageUploadButton.css';/* empty css                      */import n from"../../../_virtual/_plugin-vue_export-helper.js";const r=["disabled"],u=/* @__PURE__ */n({__name:"ImageUploadButton",props:{editor:{type:Object,required:!0},disabled:{type:Boolean,default:!1}},setup(n){const u=n,p=e(!1),c=()=>{p.value=!0},m=()=>{p.value=!1},v=()=>{p.value=!1},g=e=>{const[t]=e.target.files||[];t&&((e,t)=>{const a=new FileReader;a.onload=e=>{t(e.target?.result||"")},a.readAsDataURL(e)})(t,e=>{(e=>{e&&u.editor?.chain().focus().setImage({src:e}).run()})(e)}),e.target.value=""};return(e,b)=>(t(),a(i,null,[l("button",{title:"Image",class:d([n.disabled?"is-disabled":""]),disabled:n.disabled,onClick:c},[l("span",{class:d(["icon","i-ant-design:picture-outlined"]),style:{width:"18px",height:"18px"}})],10,r),l("input",{type:"file",accept:"image/*",class:"hidden",onChange:g},null,32),o(s,{visible:p.value,"onUpdate:visible":b[0]||(b[0]=e=>p.value=e),title:"Add Image","media-type":"image",editor:u.editor,onCancel:m,onOk:v},null,8,["visible","editor"])],64))}},[["__scopeId","data-v-e1bc87c3"]]);export{u as default};