import{a1 as g,o as a,i as w,j as p,c as l,b as t,t as c,e as n,u,H as b,n as h,w as x,a0 as B}from"./app-13978987.js";const k=g({id:"modal",state:()=>({states:{}}),actions:{validateKey(e){return/^[a-zA-Z0-9-]+$/.test(e)?e:e.replace(/[^a-zA-Z0-9-]/g,"-").toLowerCase()},open(e){const o=this.validateKey(e);if(this.states.hasOwnProperty(o))return this.states[o]=!1;this.states[o]=!0,document.body.style.overflow="hidden"},close(){document.body.style.overflow="",this.$reset()}},getters:{getState:e=>o=>{let s=o;return/^[a-zA-Z0-9-]+$/.test(s)||(s=o.replace(/[^a-zA-Z0-9-]/g,"-").toLowerCase()),e.states.hasOwnProperty(s)&&e.states[s]||!1}}}),v={key:0,class:"c-modal-header"},_=t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"34",height:"34",viewBox:"0 0 24 24"},[t("path",{fill:"currentColor",d:"m12 13.4l-2.9 2.9q-.275.275-.7.275t-.7-.275q-.275-.275-.275-.7t.275-.7l2.9-2.9l-2.9-2.875q-.275-.275-.275-.7t.275-.7q.275-.275.7-.275t.7.275l2.9 2.9l2.875-2.9q.275-.275.7-.275t.7.275q.3.3.3.713t-.3.687L13.375 12l2.9 2.9q.275.275.275.7t-.275.7q-.3.3-.713.3t-.687-.3L12 13.4Z"})],-1),C=[_],S={class:"c-main-content"},q={key:2,class:"c-model-btn-container-end"},z={key:0,xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-loader animate-spin"},Z=t("line",{x1:"12",y1:"2",x2:"12",y2:"6"},null,-1),$=t("line",{x1:"12",y1:"18",x2:"12",y2:"22"},null,-1),A=t("line",{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76"},null,-1),K=t("line",{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07"},null,-1),L=t("line",{x1:"2",y1:"12",x2:"6",y2:"12"},null,-1),P=t("line",{x1:"18",y1:"12",x2:"22",y2:"12"},null,-1),T=t("line",{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24"},null,-1),M=t("line",{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93"},null,-1),j=[Z,$,A,K,L,P,T,M],N={__name:"Modal",props:{state:{type:Boolean,default:!1},closeBtn:{type:Boolean,default:!0},backdropClose:{type:Boolean,default:!0},headerState:{type:Boolean,default:!1},headerTitle:{type:String,default:"Header Title"},actionBtnState:{type:Boolean,default:!1},actionProcessing:{type:Boolean,default:!1},bgBlur:{type:Boolean,default:!1},bgColor:{type:String,default:"bg-white dark:bg-dark-800"}},emits:["action"],setup(e,{emit:o}){const s=k(),y=o,f=e,m=()=>{f.backdropClose&&s.close()};return(r,i)=>(a(),w(B,{name:"fade",appear:"",mode:"out-in"},{default:p(()=>[e.state?(a(),l("div",{key:0,class:h(["c-modal-container",{"bg-blur":e.bgBlur}]),onClick:x(m,["self"])},[t("div",{class:h(["c-modal-content rounded-lg p-6",e.bgColor])},[e.headerState?(a(),l("h6",v,c(e.headerTitle),1)):n("",!0),e.closeBtn?(a(),l("button",{key:1,class:"c-modal-close",type:"button",onClick:i[0]||(i[0]=(...d)=>u(s).close&&u(s).close(...d))},C)):n("",!0),t("div",S,[b(r.$slots,"default")]),e.actionBtnState?(a(),l("div",q,[t("button",{onClick:i[1]||(i[1]=d=>y("action")),type:"button",class:"btn btn-primary"},[e.actionProcessing?(a(),l("svg",z,j)):n("",!0),t("span",null,c(r.trans("Submit")),1)])])):n("",!0)],2)],2)):n("",!0)]),_:3}))}};export{N as _,k as u};
