/*!
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
*/
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./ColorPicker.css');const e=require("vue");;/* empty css                  */const o=require("../../../../_virtual/_plugin-vue_export-helper.js"),l=["disabled","title"],t=["innerHTML"],r={class:"popover-menu absolute right-0 top-full z-[1000] mt-1"},i={class:"color-picker grid grid-cols-5 gap-1"},n=["onClick"],c={__name:"ColorPicker",props:{editor:{type:Object,required:!0},disabled:{type:Boolean,default:!1},title:{type:String,required:!0},icon:{type:[Object,Function],required:!0},colors:{type:Array,default:()=>[]},isActive:{type:Function,required:!0},isActiveColor:{type:Function,required:!0},onSelectColor:{type:Function,required:!0}},emits:["colorChange"],setup(o,{emit:c}){const a=o,s=c,u=e.ref(null),d=e.ref(!1),p=()=>{d.value=!d.value},v=e=>{a.onSelectColor(e),s("colorChange",e),d.value=!1},m=e=>{u.value&&!u.value.contains(e.target)&&(d.value=!1)};return e.onMounted(()=>{document.addEventListener("click",m)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",m)}),(c,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"popoverRef",ref:u,class:"relative"},[e.createElementVNode("button",{class:e.normalizeClass([{"is-active":o.isActive(),"is-disabled":o.disabled}]),disabled:o.disabled,title:o.title,onClick:p},[e.createElementVNode("span",{innerHTML:o.icon},null,8,t)],10,l),e.withDirectives(e.createElementVNode("div",r,[e.createElementVNode("div",i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.colors,o=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"color-option",style:e.normalizeStyle({backgroundColor:o}),onClick:e=>v(o)},null,12,n))),128)),e.createElementVNode("div",{class:"color-none h-6 w-6 cursor-pointer rounded",onClick:a[0]||(a[0]=e=>v(null))},[e.createElementVNode("span",{class:e.normalizeClass(["icon","i-ic:baseline-close"])})])])],512),[[e.vShow,d.value]])],512))}},a=o.default(c,[["__scopeId","data-v-40a951f4"]]);exports.default=a;