import{d as Ue,t as Pe,r as u,I as Ot,G as w,A as Ve,l as De,D as Te,o as r,c,b as e,e as o,u as t,a,Z as P,a0 as N,a2 as je,M as _,N as x,w as m,h as I,H as $,g as f,$ as Me,f as b,a7 as Re,ad as Bt,J as Ee,P as Nt}from"../../../common/index.DXvi0yH9.js";import{u as $t,i as tt,C as et,a as st,r as lt,b as it,l as wt}from"../../../common/useUserSearch.C3nz8dbN.js";import{u as Ae,a as Oe,b as Be}from"../../../common/index.CZtQfmHi.js";import{H as Ne,P as vt,T as $e}from"../../partials/index.EnUA63nb.js";import{_ as qe}from"../../../common/Notification.vue_vue_type_script_setup_true_lang.D_vuSbU1.js";import{_ as We}from"../../../common/Confirmation.vue_vue_type_script_setup_true_lang.BvpajMdU.js";import{S as ze,M as qt}from"../../../common/share-2.BE3RfDus.js";import{c as gt}from"../../../common/createLucideIcon.D3XWtEmL.js";import{X as q}from"../../../common/x.ClCP0MsD.js";import{Y as pt,h as E,G as ft,V as ht,S as _t}from"../../../common/transition.CRNcmuQX.js";import{_ as Le}from"../../../common/_plugin-vue_export-helper.DlAUqK2U.js";import"../../../common/form.C3ove4if.js";import"../../../common/keyboard.D4P2wQc7.js";import"../../../common/open-closed.CQX5sZkx.js";import"../../../common/use-tree-walker.Bsdod6n3.js";import"../../../common/pinia.D9yoqqEz.js";import"../../../common/use-resolve-button-type.Cleihsk7.js";import"../../../common/micro-task.CxIZtCgj.js";/**
 * @license lucide-vue-next v0.544.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bt=gt("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
 * @license lucide-vue-next v0.544.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const He=gt("shopping-bag",[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]]);/**
 * @license lucide-vue-next v0.544.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ke=gt("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),Fe={class:"wishlist-items"},Ge={class:"stwlite-tw-bg-gray-50"},Ye={class:"stwlite-tw-max-w-4xl stwlite-tw-mx-auto stwlite-tw-px-4 sm:stwlite-tw-px-6 lg:stwlite-tw-px-8 stwlite-tw-py-8"},Qe={class:"stwlite-tw-bg-white stwlite-tw-rounded-lg stwlite-tw-shadow-sm stwlite-tw-border stwlite-tw-border-gray-200 stwlite-tw-border-solid"},Je={class:"stwlite-tw-px-6 stwlite-tw-py-6"},Xe={class:"stwlite-tw-grid stwlite-tw-grid-cols-1 lg:stwlite-tw-grid-cols-3 stwlite-tw-gap-6 stwlite-tw-mb-6"},Ze={class:"lg:stwlite-tw-col-span-2"},ts={htmlFor:"name",class:"stwlite-tw-block stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-gray-700 stwlite-tw-mb-2"},es=["placeholder"],ss={class:"stwlite-tw-block stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-gray-700 stwlite-tw-mb-2"},ls={class:"stwlite-tw-relative"},is=["value"],ws={class:"stwlite-tw-grid stwlite-tw-grid-cols-1 lg:stwlite-tw-grid-cols-3 stwlite-tw-gap-6 stwlite-tw-mb-6"},os={class:"lg:stwlite-tw-col-span-2"},as={htmlFor:"user",class:"stwlite-tw-block stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-gray-700 stwlite-tw-mb-2"},rs={class:"stwlite-tw-relative"},ns={class:"stwlite-tw-relative"},cs={class:"stwlite-tw-relative stwlite-tw-w-full stwlite-tw-cursor-default stwlite-tw-overflow-hidden stwlite-tw-rounded-lg stwlite-tw-border-solid stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-bg-white stwlite-tw-text-left stwlite-tw-shadow-sm focus-within:stwlite-tw-ring-2 focus-within:stwlite-tw-ring-blue-500 sm:stwlite-tw-text-sm"},us={class:"stwlite-tw-absolute stwlite-tw-inset-y-0 stwlite-tw-right-0 stwlite-tw-flex stwlite-tw-items-center stwlite-tw-pr-2 stwlite-tw-pointer-events-none"},ds={key:0,class:"stwlite-tw-absolute stwlite-tw-z-10 stwlite-tw-mt-1 stwlite-tw-w-full stwlite-tw-bg-white stwlite-tw-py-2 stwlite-tw-px-3 stwlite-tw-text-sm stwlite-tw-text-gray-500 stwlite-tw-rounded-md stwlite-tw-shadow"},ms={key:0,class:"stwlite-tw-absolute stwlite-tw-inset-y-0 stwlite-tw-left-0 stwlite-tw-flex stwlite-tw-items-center stwlite-tw-pl-3 stwlite-tw-text-blue-600"},vs={key:2,class:"stwlite-tw-absolute stwlite-tw-z-10 stwlite-tw-mt-1 stwlite-tw-w-full stwlite-tw-bg-white stwlite-tw-py-2 stwlite-tw-px-3 stwlite-tw-text-sm stwlite-tw-text-gray-500 stwlite-tw-rounded-md stwlite-tw-shadow"},ps={class:"stwlite-tw-block stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-gray-700 stwlite-tw-mb-2"},fs={class:"stwlite-tw-relative"},hs={key:0,class:"stwlite-tw-grid stwlite-tw-grid-cols-1 lg:stwlite-tw-grid-cols-3 stwlite-tw-gap-6 stwlite-tw-mb-6"},_s={class:"lg:stwlite-tw-col-span-2"},bs={htmlFor:"user",class:"stwlite-tw-block stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-gray-700 stwlite-tw-mb-2"},gs={class:"stwlite-tw-relative"},ys={class:"copy-text-container"},xs={class:"copy-text-content"},ks={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Cs={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ss={key:1,class:"stwlite-tw-mb-6 stwlite-tw-flex stwlite-tw-gap-3"},Is={class:"stwlite-tw-mb-8"},Us={htmlFor:"description",class:"stwlite-tw-block stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-gray-700 stwlite-tw-mb-2"},Ps=["placeholder"],Vs={class:"stwlite-tw-flex stwlite-tw-justify-between stwlite-tw-items-center stwlite-tw-mb-4"},Ds={class:"stwlite-tw-text-lg stwlite-tw-font-semibold stwlite-tw-text-gray-900"},Ts=["disabled","title"],js={class:"stwlite-tw-border stwlite-tw-border-gray-200 stwlite-tw-border-solid stwlite-tw-rounded-lg stwlite-tw-overflow-hidden"},Ms={class:"stwlite-tw-bg-gray-50 stwlite-tw-px-6 stwlite-tw-py-3 stwlite-tw-border-0 stwlite-tw-border-b stwlite-tw-border-gray-200 stwlite-tw-border-solid"},Rs={class:"stwlite-tw-grid stwlite-tw-grid-cols-12 stwlite-tw-gap-4 stwlite-tw-text-left stwlite-tw-text-xs stwlite-tw-font-medium stwlite-tw-text-gray-500 stwlite-tw-uppercase stwlite-tw-tracking-wider"},Es={class:"stwlite-tw-col-span-3"},As={class:"stwlite-tw-col-span-2"},Os={class:"stwlite-tw-col-span-2"},Bs={class:"stwlite-tw-col-span-2"},Ns={class:"stwlite-tw-col-span-3"},$s={key:0},qs={class:"stwlite-tw-grid stwlite-tw-grid-cols-12 stwlite-tw-gap-4 stwlite-tw-text-left stwlite-tw-text-xs stwlite-tw-text-gray-500 stwlite-tw-tracking-wider"},Ws={class:"stwlite-tw-col-span-3 stwlite-tw-inline-flex stwlite-tw-items-center"},zs={class:"stwlite-tw-col-span-2 stwlite-tw-inline-flex stwlite-tw-items-center"},Ls={class:"stwlite-tw-col-span-2 stwlite-tw-inline-flex stwlite-tw-items-center"},Hs=["innerHTML"],Ks={class:"stwlite-tw-col-span-2 stwlite-tw-inline-flex stwlite-tw-items-center"},Fs=["onUpdate:modelValue","onChange"],Gs={class:"stwlite-tw-col-span-3 stwlite-tw-inline-flex stwlite-tw-items-center"},Ys=["onClick"],Qs={key:1,class:"stwlite-tw-px-6 stwlite-tw-py-12"},Js={class:"stwlite-tw-flex stwlite-tw-flex-col stwlite-tw-items-center stwlite-tw-text-center"},Xs={class:"stwlite-tw-w-16 stwlite-tw-h-16 stwlite-tw-bg-gray-100 stwlite-tw-rounded-full stwlite-tw-flex stwlite-tw-items-center stwlite-tw-justify-center stwlite-tw-mb-4"},Zs={class:"stwlite-tw-text-gray-500 stwlite-tw-text-sm"},tl={class:"stwlite-tw-fixed stwlite-tw-inset-0 stwlite-tw-overflow-y-auto"},el={class:"stwlite-tw-flex stwlite-tw-min-h-full stwlite-tw-items-center stwlite-tw-justify-center stwlite-tw-p-4 stwlite-tw-text-center"},sl={class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-justify-between"},ll={"aria-hidden":"true"},il={class:"stwlite-tw-mt-4"},wl={class:"stwlite-tw-w-full stwlite-tw-py-3"},ol={class:"stwlite-tw-relative"},al={class:"stwlite-tw-relative stwlite-tw-w-full stwlite-tw-cursor-default stwlite-tw-overflow-hidden stwlite-tw-rounded-lg stwlite-tw-border-solid stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-bg-white stwlite-tw-text-left stwlite-tw-shadow-sm focus-within:stwlite-tw-ring-2 focus-within:stwlite-tw-ring-blue-500 sm:stwlite-tw-text-sm"},rl={class:"stwlite-tw-absolute stwlite-tw-inset-y-0 stwlite-tw-right-0 stwlite-tw-flex stwlite-tw-items-center stwlite-tw-pr-2 stwlite-tw-pointer-events-none"},nl={key:0,class:"stwlite-tw-absolute stwlite-tw-inset-y-0 stwlite-tw-left-0 stwlite-tw-flex stwlite-tw-items-center stwlite-tw-pl-3 stwlite-tw-text-blue-600"},cl={key:1,class:"stwlite-tw-absolute stwlite-tw-mt-1 stwlite-tw-w-full stwlite-tw-bg-white stwlite-tw-py-2 stwlite-tw-px-3 stwlite-tw-text-sm stwlite-tw-text-gray-500 stwlite-tw-rounded-md stwlite-tw-shadow"},ul={class:"stwlite-tw-mt-4 stwlite-tw-space-y-2"},dl=["onClick"],ml={class:"stwlite-tw-mt-4"},vl={class:"stwlite-tw-fixed stwlite-tw-inset-0 stwlite-tw-overflow-y-auto"},pl={class:"stwlite-tw-flex stwlite-tw-min-h-full stwlite-tw-items-center stwlite-tw-justify-center stwlite-tw-p-4 stwlite-tw-text-center"},fl={class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-justify-between"},hl={"aria-hidden":"true"},_l={class:"stwlite-tw-mt-6"},bl={class:"stwlite-tw-mb-6"},gl={class:"stwlite-tw-block stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-gray-700 stwlite-tw-mb-2"},yl={class:"stwlite-tw-flex stwlite-tw-gap-2"},xl=["placeholder"],kl={key:0,class:"stwlite-tw-mt-3 stwlite-tw-space-y-2"},Cl={class:"stwlite-tw-text-sm stwlite-tw-text-gray-700"},Sl=["onClick"],Il={class:"stwlite-tw-mb-6"},Ul={class:"stwlite-tw-block stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-gray-700 stwlite-tw-mb-2"},Pl={class:"stwlite-tw-relative"},Vl={class:"stwlite-tw-relative stwlite-tw-w-full stwlite-tw-cursor-default stwlite-tw-overflow-hidden stwlite-tw-rounded-lg stwlite-tw-border-solid stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-bg-white stwlite-tw-text-left stwlite-tw-shadow-sm focus-within:stwlite-tw-ring-2 focus-within:stwlite-tw-ring-blue-500 sm:stwlite-tw-text-sm"},Dl={class:"stwlite-tw-absolute stwlite-tw-inset-y-0 stwlite-tw-right-0 stwlite-tw-flex stwlite-tw-items-center stwlite-tw-pr-2 stwlite-tw-pointer-events-none"},Tl={key:0,class:"stwlite-tw-absolute stwlite-tw-mt-1 stwlite-tw-w-full stwlite-tw-bg-white stwlite-tw-py-2 stwlite-tw-px-3 stwlite-tw-text-sm stwlite-tw-text-gray-500 stwlite-tw-rounded-md stwlite-tw-shadow"},jl={key:0,class:"stwlite-tw-absolute stwlite-tw-inset-y-0 stwlite-tw-left-0 stwlite-tw-flex stwlite-tw-items-center stwlite-tw-pl-3 stwlite-tw-text-blue-600"},Ml={key:2,class:"stwlite-tw-absolute stwlite-tw-mt-1 stwlite-tw-w-full stwlite-tw-bg-white stwlite-tw-py-2 stwlite-tw-px-3 stwlite-tw-text-sm stwlite-tw-text-gray-500 stwlite-tw-rounded-md stwlite-tw-shadow"},Rl={key:3,class:"stwlite-tw-mt-4 stwlite-tw-space-y-2"},El=["onClick"],Al={class:"stwlite-tw-mt-6 stwlite-tw-flex stwlite-tw-justify-end stwlite-tw-gap-3"},Ol=["disabled"],Bl={class:"stwlite-tw-fixed stwlite-tw-inset-0 stwlite-tw-overflow-y-auto"},Nl={class:"stwlite-tw-flex stwlite-tw-min-h-full stwlite-tw-items-center stwlite-tw-justify-center stwlite-tw-p-4 stwlite-tw-text-center"},$l={class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-justify-between"},ql={"aria-hidden":"true"},Wl={class:"stwlite-tw-mt-6"},zl={class:"stwlite-tw-mb-6"},Ll={class:"stwlite-tw-block stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-gray-700 stwlite-tw-mb-2"},Hl={class:"stwlite-tw-relative"},Kl={class:"stwlite-tw-relative stwlite-tw-w-full stwlite-tw-cursor-default stwlite-tw-overflow-hidden stwlite-tw-rounded-lg stwlite-tw-border-solid stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-bg-white stwlite-tw-text-left stwlite-tw-shadow-sm focus-within:stwlite-tw-ring-2 focus-within:stwlite-tw-ring-blue-500 sm:stwlite-tw-text-sm"},Fl={class:"stwlite-tw-absolute stwlite-tw-inset-y-0 stwlite-tw-right-0 stwlite-tw-flex stwlite-tw-items-center stwlite-tw-pr-2 stwlite-tw-pointer-events-none"},Gl={key:0,class:"stwlite-tw-absolute stwlite-tw-inset-y-0 stwlite-tw-left-0 stwlite-tw-flex stwlite-tw-items-center stwlite-tw-pl-3 stwlite-tw-text-blue-600"},Yl={key:1,class:"stwlite-tw-mt-4 stwlite-tw-space-y-2"},Ql=["onClick"],Jl={class:"stwlite-tw-mb-6"},Xl={class:"stwlite-tw-block stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-gray-700 stwlite-tw-mb-2"},Zl={class:"stwlite-tw-flex stwlite-tw-gap-2"},ti=["placeholder"],ei={key:0,class:"stwlite-tw-mt-3 stwlite-tw-space-y-2"},si={class:"stwlite-tw-text-sm stwlite-tw-text-gray-700"},li=["onClick"],ii={class:"stwlite-tw-mt-6 stwlite-tw-flex stwlite-tw-justify-end stwlite-tw-gap-3"},wi=Ue({__name:"Items",props:{item:{},itemIndex:{}},emits:["action"],setup(Wt,{emit:zt}){var Et,At;const Lt=Wt,Ht=zt,{item:Kt,itemIndex:oi}=Pe(Lt),{saveCollection:Ft,deleteCollections:Gt}=Ae(),{getProducts:Yt,getCollectionProducts:ai}=Oe(),{getUsers:yt}=Be(),n=u({key:"",user_id:"",id:0,name:"",description:"",status:"",is_default:!1,is_public:!1,url_code:"",items:[],emails:[],user_ids:[],allowed_roles:[],allowed_edit_emails:[]}),xt=Ot.wishlistUrl,kt=u(Ot.proDependencies),Ct=u(((Et=kt.value)==null?void 0:Et.activePro)||!1),Qt=u(((At=kt.value)==null?void 0:At.wpRoles)||{}),p=u(Kt.value),g=u([]),W=u(!1),h=u([]),A=u([]),O=u([]),St=u([]),V=u(null),{query:It,options:ot,fetching:Ut,search:Jt,reset:Xt}=$t(),{query:Zt,options:at,fetching:Pt,search:te,reset:Vt}=$t({exclude:i=>{const l=typeof n.value.user_id=="string"?parseInt(n.value.user_id):n.value.user_id;return i.value===l}}),z=u(!1),L=u(!1),H=u(""),D=u(""),K=u(""),rt=u(""),T=u(!1),nt=u(""),F=u(null),j=u(null),U=u("delete"),B=u(!1),G=u(""),ct=u(!1),Y=u(!1),C=u([]),M=u(""),y=u([]),ee=u(!1),Q=u(!1),k=u([]),J=u([]),S=u([]),R=u(""),se=[{label:w("select_status",wp.i18n.__("Select Status","saveto-wishlist-lite-for-woocommerce")),value:""},{label:w("publish",wp.i18n.__("Publish","saveto-wishlist-lite-for-woocommerce")),value:"publish"},{label:w("draft",wp.i18n.__("Draft","saveto-wishlist-lite-for-woocommerce")),value:"draft"}],X=Ve(()=>n.value.status==="draft");w("column_name",wp.i18n.__("Name","saveto-wishlist-lite-for-woocommerce")),w("column_sku",wp.i18n.__("SKU","saveto-wishlist-lite-for-woocommerce")),w("column_price",wp.i18n.__("Price","saveto-wishlist-lite-for-woocommerce")),w("column_quantity",wp.i18n.__("Quantity","saveto-wishlist-lite-for-woocommerce")),w("column_actions",wp.i18n.__("Actions","saveto-wishlist-lite-for-woocommerce"));const Dt=()=>{Ht("action","close")},le=async()=>{z.value=!0,await Ft(n.value).then(i=>{if(i.status==="success"){const l=i.data,s=parseInt(l.is_public)===1,v=parseInt(l.is_default)===1,d={id:l.id,user_id:parseInt(l.user_id),name:l.name||"",description:l.description||"",status:l.status||"",is_default:v,is_public:s,url_code:l.url_code||"",items:l.items||[],emails:[],user_ids:[],allowed_roles:[],allowed_edit_emails:[]};p.value={...p.value,...d},n.value={...n.value,...d},jt(),Z();const mt=Ee("add");l.id>0&&mt==="new"&&(Nt("item",l.id),Nt("add","")),z.value=!1,G.value=xt+p.value.url_code,D.value=w("wishlist_saved",wp.i18n.__("Wishlist saved successfully","saveto-wishlist-lite-for-woocommerce")),H.value=w("success",wp.i18n.__("Success","saveto-wishlist-lite-for-woocommerce")),K.value="success"}else z.value=!1,D.value=w("wishlist_not_saved",wp.i18n.__("Wishlist not saved","saveto-wishlist-lite-for-woocommerce")),H.value=w("error",wp.i18n.__("Error","saveto-wishlist-lite-for-woocommerce")),K.value="error"})},ie=()=>{T.value=!0,nt.value=w("confirmDeleteText",wp.i18n.__("Are you sure you want to delete this wishlist?","saveto-wishlist-lite-for-woocommerce")),U.value="delete",F.value=p.value.id},we=(i,l)=>{T.value=!0,nt.value=w("confirmRemoveProductText",wp.i18n.__("Are you sure you want to remove this product from the wishlist?","saveto-wishlist-lite-for-woocommerce")),U.value="delete-product",j.value={record:i,index:l}},oe=(i,l)=>{const s=parseInt(i.product_id);h.value=h.value.filter(v=>parseInt(v.value)!==s),g.value=g.value.filter((v,d)=>d!==l),Z()},ae=async(i={})=>{W.value=!0,await Yt(i).then(l=>{St.value=l,O.value=l.filter(s=>!h.value.some(v=>parseInt(v.value)===s.id)).map(s=>({label:s.name,value:s.id,product:s})),W.value=!1}).catch(l=>{var s,v;(s=l.error)!=null&&s.message&&(D.value=(v=l.error)==null?void 0:v.message,H.value=w("error",wp.i18n.__("Error","saveto-wishlist-lite-for-woocommerce")),K.value="error")})},re=()=>{X.value||(L.value=!0,A.value=[])},ne=()=>{let i=[];h.value.forEach(l=>{const s=l.product;if(!g.value.some(d=>parseInt(d.product_id)===s.id))i.push({id:0,product_id:s.id,variation_id:s.id,name:s.name,sku:s.sku,price:s.price,quantity:1,priority:0,notes:""});else{const d=g.value.find(mt=>parseInt(mt.product_id)===s.id);i.push({id:d.id,product_id:s.id,variation_id:s.id,name:s.name,sku:s.sku,price:s.price,quantity:d.quantity,priority:d.priority,notes:d.notes})}}),g.value=i,Z(),L.value=!1},Tt=()=>{L.value=!1,h.value=h.value.filter(i=>{const l=parseInt(i.value);return g.value.some(s=>parseInt(s.product_id)===l)})},jt=()=>{const i=p.value.items.map(l=>{if(parseInt(l.product_id),l.product)return{...l,price:l.product.price,name:l.product.name,sku:l.product.sku}});g.value=i,h.value=i.map(l=>({label:l.name,value:l.product_id,product:l.product}))},Z=()=>{n.value={...n.value,items:g.value||[]}},ce=(i,l)=>{Z()},ue=i=>{V.value=i,n.value.user_id=i?i.value:"",i&&Xt()},de=i=>{A.value=A.value.filter(l=>l.value!==i),h.value=h.value.filter(l=>l.value!==i)},me=()=>{D.value=""},ve=()=>{T.value=!1,F.value=null,j.value=null,U.value="",B.value=!1},pe=async()=>{B.value=!0,U.value==="delete"?await Gt([F.value]).then(()=>{F.value=null,T.value=!1,U.value="",B.value=!1,Dt()}):U.value==="delete-product"&&(j.value&&oe(j.value.record,j.value.index),j.value=null,T.value=!1,U.value="",B.value=!1)},fe=async i=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(i);else{const l=document.createElement("textarea");l.value=i,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.focus(),l.select();try{document.execCommand("copy")}finally{document.body.removeChild(l)}}ct.value=!0,setTimeout(()=>{ct.value=!1},2e3)}catch(l){console.error("Failed to copy text:",l)}},he=i=>{rt.value=i.target.value},_e=i=>{W.value=!1,O.value=St.value.filter(l=>!h.value.some(s=>parseInt(s.value)===l.id)).map(l=>({label:l.name,value:l.id,product:l}))},be=async()=>{if(Y.value=!0,C.value=n.value.emails||[],M.value="",Vt(),n.value.user_ids.length>0){const i=await yt({include:n.value.user_ids,per_page:n.value.user_ids.length});y.value=i.map(l=>({label:l.name,value:l.id}))}else y.value=[]},Mt=()=>{const i=M.value.trim();i&&i.includes("@")&&!C.value.includes(i)&&(C.value.push(i),M.value="")},ge=i=>{C.value=C.value.filter(l=>l!==i)},ye=i=>{y.value=i},xe=async()=>{const i=y.value.map(l=>parseInt(l.value));n.value={...n.value,emails:C.value,user_ids:i},Y.value=!1},ut=()=>{Y.value=!1,C.value=[],M.value="",y.value=[],Vt()},ke=()=>{Q.value=!0,J.value=Object.entries(Qt.value).map(([i,l])=>({label:l,value:i})),k.value=(n.value.allowed_roles||[]).map(i=>J.value.find(l=>l.value===i)).filter(i=>i!==void 0),S.value=n.value.allowed_edit_emails||[],R.value=""},Ce=i=>{k.value=i},Rt=()=>{const i=R.value.trim();i&&i.includes("@")&&!S.value.includes(i)&&(S.value.push(i),R.value="")},Se=i=>{S.value=S.value.filter(l=>l!==i)},Ie=()=>{const i=k.value.map(l=>l.value);n.value={...n.value,allowed_roles:i,allowed_edit_emails:S.value},Q.value=!1},dt=()=>{Q.value=!1,k.value=[],S.value=[],R.value=""};return De([rt,h],async([i,l])=>{rt.value!==""&&i.length>2?ae({search:i}):O.value=[],A.value=l.filter(s=>!g.value.some(v=>parseInt(v.product_id)===parseInt(s.value)))}),Te(()=>{if(p.value.id===0)n.value={...n.value,user_id:"",id:0,name:"",description:"",status:"publish",emails:[],user_ids:[],allowed_roles:[],allowed_edit_emails:[]},V.value=null,It.value="";else{const i=parseInt(p.value.is_public)===1,l=parseInt(p.value.is_default)===1;n.value={...n.value,id:p.value.id,user_id:parseInt(p.value.user_id)||"",is_public:i,is_default:l,status:p.value.status,name:p.value.name||"",description:p.value.description||"",url_code:p.value.url_code||"",items:p.value.items||[],emails:p.value.emails||[],user_ids:p.value.user_ids||[],allowed_roles:p.value.allowed_roles||[],allowed_edit_emails:p.value.allowed_edit_emails||[]},jt(),G.value=xt+p.value.url_code}if(n.value.user_id){const i=typeof n.value.user_id=="string"?parseInt(n.value.user_id):n.value.user_id;p.value.user_name?V.value={label:p.value.user_name,value:i}:yt({include:i,per_page:1}).then(l=>{const s=l.find(v=>v.id===i);V.value=s?{label:s.name,value:s.id}:null})}}),(i,l)=>(r(),c(_,null,[e("div",Fe,[e("div",Ge,[o(t(Ne),{infoData:{title:n.value.name||t(w)("new_wishlist",t(wp.i18n.__)("New Wishlist","saveto-wishlist-lite-for-woocommerce"))},showButton:!0,showBackButton:!0,showDeleteButton:n.value.id>0,buttonIcon:"save",buttonText:n.value.id>0?t(w)("update",t(wp.i18n.__)("Update","saveto-wishlist-lite-for-woocommerce")):t(w)("save",t(wp.i18n.__)("Save","saveto-wishlist-lite-for-woocommerce")),isLoading:z.value,onTriggerButton:le,onTriggerBack:Dt,onTriggerDelete:ie},null,8,["infoData","showDeleteButton","buttonText","isLoading"]),e("div",Ye,[e("div",Qe,[e("div",Je,[e("div",Xe,[e("div",Ze,[e("label",ts,a(t(w)("name",t(wp.i18n.__)("Name","saveto-wishlist-lite-for-woocommerce"))),1),P(e("input",{type:"text",id:"name",name:"name","onUpdate:modelValue":l[0]||(l[0]=s=>n.value.name=s),placeholder:t(w)("name",t(wp.i18n.__)("Name","saveto-wishlist-lite-for-woocommerce")),class:"stwlite-tw-block stwlite-tw-w-full stwlite-tw-px-3 stwlite-tw-py-2 stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-border-solid stwlite-tw-rounded-md stwlite-tw-shadow-sm focus:stwlite-tw-outline-none focus:stwlite-tw-ring-blue-500 focus:stwlite-tw-border-blue-500"},null,8,es),[[N,n.value.name]])]),e("div",null,[e("label",ss,a(t(w)("publish",t(wp.i18n.__)("Publish","saveto-wishlist-lite-for-woocommerce"))),1),e("div",ls,[P(e("select",{id:"status",name:"status","onUpdate:modelValue":l[1]||(l[1]=s=>n.value.status=s),class:"stwlite-tw-block stwlite-tw-w-full stwlite-tw-px-3 stwlite-tw-py-2 stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-rounded-md stwlite-tw-shadow-sm focus:stwlite-tw-outline-none focus:stwlite-tw-ring-blue-500 focus:stwlite-tw-border-blue-500 stwlite-tw-appearance-none stwlite-tw-bg-white"},[(r(),c(_,null,x(se,s=>e("option",{key:s.value,value:s.value},a(s.label),9,is)),64))],512),[[je,n.value.status]])])])]),e("div",ws,[e("div",os,[e("label",as,a(t(w)("select_user",t(wp.i18n.__)("Select User","saveto-wishlist-lite-for-woocommerce"))),1),e("div",rs,[o(t(wt),{modelValue:V.value,"onUpdate:modelValue":[l[3]||(l[3]=s=>V.value=s),ue]},{default:m(()=>[e("div",ns,[e("div",cs,[o(t(tt),{class:"stwlite-tw-w-full stwlite-tw-border-0 stwlite-tw-py-2 stwlite-tw-pl-3 stwlite-tw-pr-10 stwlite-tw-leading-5 stwlite-tw-text-gray-900","display-value":s=>(s==null?void 0:s.label)||"",placeholder:t(w)("search_user",t(wp.i18n.__)("Search user...","saveto-wishlist-lite-for-woocommerce")),autocomplete:"off",onChange:l[2]||(l[2]=s=>t(Jt)(s.target.value))},null,8,["display-value","placeholder"]),e("span",us,[o(t(et),{class:"stwlite-tw-h-5 stwlite-tw-w-5 stwlite-tw-text-gray-400","aria-hidden":"true"})])]),t(Ut)?(r(),c("div",ds,a(t(w)("searching",t(wp.i18n.__)("Searching...","saveto-wishlist-lite-for-woocommerce"))),1)):t(ot).length>0?(r(),I(t(st),{key:1,class:"stwlite-tw-absolute stwlite-tw-z-10 stwlite-tw-mt-1 stwlite-tw-max-h-60 stwlite-tw-w-full stwlite-tw-overflow-auto stwlite-tw-rounded-md stwlite-tw-bg-white stwlite-tw-py-1 stwlite-tw-text-base stwlite-tw-shadow-lg stwlite-tw-ring-1 stwlite-tw-ring-black stwlite-tw-ring-opacity-5 focus:stwlite-tw-outline-none sm:stwlite-tw-text-sm"},{default:m(()=>[(r(!0),c(_,null,x(t(ot),s=>(r(),I(t(lt),{key:s.value,value:s,class:"stwlite-tw-relative stwlite-tw-cursor-default stwlite-tw-select-none stwlite-tw-py-2 stwlite-tw-pl-10 stwlite-tw-pr-4"},{default:m(({active:v,selected:d})=>[e("span",{class:$(["stwlite-tw-block stwlite-tw-truncate",d?"font-medium":"font-normal"])},a(s.label),3),d?(r(),c("span",ms,[o(t(it),{class:"stwlite-tw-h-5 stwlite-tw-w-5","aria-hidden":"true"})])):f("",!0)]),_:2},1032,["value"]))),128))]),_:1})):t(It)&&!t(Ut)&&t(ot).length===0?(r(),c("p",vs,a(t(w)("no_users_found",t(wp.i18n.__)("No users found","saveto-wishlist-lite-for-woocommerce"))),1)):f("",!0)])]),_:1},8,["modelValue"])])]),e("div",null,[e("label",ps,a(t(w)("is_public",t(wp.i18n.__)("Is Public","saveto-wishlist-lite-for-woocommerce"))),1),e("div",fs,[P(e("input",{type:"checkbox",name:"is_public","onUpdate:modelValue":l[4]||(l[4]=s=>n.value.is_public=s),class:"stwlite-tw-rounded stwlite-tw-border-gray-300 stwlite-tw-text-blue-600 stwlite-tw-shadow-sm focus:stwlite-tw-border-blue-300 focus:stwlite-tw-ring focus:stwlite-tw-ring-blue-200 focus:stwlite-tw-ring-opacity-50"},null,512),[[Me,n.value.is_public]]),b(" "+a(t(w)("yes",t(wp.i18n.__)("Yes","saveto-wishlist-lite-for-woocommerce"))),1)])])]),n.value.id>0&&(n.value.is_public||Ct.value)?(r(),c("div",hs,[e("div",_s,[e("label",bs,a(t(w)("url",t(wp.i18n.__)("URL","saveto-wishlist-lite-for-woocommerce"))),1),e("div",gs,[e("div",ys,[e("div",xs,a(G.value),1),e("button",{class:"copy-button",onClick:l[5]||(l[5]=s=>fe(G.value)),type:"button"},[ct.value?(r(),c("svg",Cs,l[14]||(l[14]=[e("polyline",{points:"20 6 9 17 4 12"},null,-1)]))):(r(),c("svg",ks,l[13]||(l[13]=[e("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"},null,-1),e("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"},null,-1)])))])])])])])):f("",!0),Ct.value?(r(),c("div",Ss,[e("button",{type:"button",class:"stwlite-tw-inline-flex stwlite-tw-items-center stwlite-tw-px-4 stwlite-tw-py-2 stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-rounded-md stwlite-tw-text-gray-700 stwlite-tw-bg-white hover:stwlite-tw-bg-gray-50 focus:stwlite-tw-outline-none focus:stwlite-tw-ring-2 focus:stwlite-tw-ring-offset-2 focus:stwlite-tw-ring-blue-500 stwlite-tw-transition-colors stwlite-tw-duration-200 stwlite-tw-cursor-pointer",onClick:be},[o(t(ze),{class:"stwlite-tw-w-4 stwlite-tw-h-4 stwlite-tw-mr-2"}),b(" "+a(t(w)("share",t(wp.i18n.__)("Share","saveto-wishlist-lite-for-woocommerce"))),1)]),e("button",{type:"button",class:"stwlite-tw-inline-flex stwlite-tw-items-center stwlite-tw-px-4 stwlite-tw-py-2 stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-rounded-md stwlite-tw-text-gray-700 stwlite-tw-bg-white hover:stwlite-tw-bg-gray-50 focus:stwlite-tw-outline-none focus:stwlite-tw-ring-2 focus:stwlite-tw-ring-offset-2 focus:stwlite-tw-ring-blue-500 stwlite-tw-transition-colors stwlite-tw-duration-200 stwlite-tw-cursor-pointer",onClick:ke},[o(t(bt),{class:"stwlite-tw-w-4 stwlite-tw-h-4 stwlite-tw-mr-2"}),b(" "+a(t(w)("restrictions",t(wp.i18n.__)("Restrictions","saveto-wishlist-lite-for-woocommerce"))),1)])])):f("",!0),e("div",Is,[e("label",Us,a(t(w)("description",t(wp.i18n.__)("Description","saveto-wishlist-lite-for-woocommerce"))),1),P(e("textarea",{id:"description",name:"description","onUpdate:modelValue":l[6]||(l[6]=s=>n.value.description=s),placeholder:t(w)("description",t(wp.i18n.__)("Description","saveto-wishlist-lite-for-woocommerce")),rows:"4",class:"stwlite-tw-block stwlite-tw-w-full stwlite-tw-px-3 stwlite-tw-py-2 stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-rounded-md stwlite-tw-shadow-sm focus:stwlite-tw-outline-none focus:stwlite-tw-ring-blue-500 focus:stwlite-tw-border-blue-500"},null,8,Ps),[[N,n.value.description]])]),e("div",null,[e("div",Vs,[e("h3",Ds,a(t(w)("products",t(wp.i18n.__)("Products","saveto-wishlist-lite-for-woocommerce"))),1),e("button",{class:$(["stwlite-tw-inline-flex stwlite-tw-items-center stwlite-tw-px-3 stwlite-tw-py-2 stwlite-tw-border stwlite-tw-border-transparent stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-rounded-md stwlite-tw-text-white stwlite-tw-transition-colors stwlite-tw-duration-200",X.value?"stwlite-tw-bg-gray-400 stwlite-tw-cursor-not-allowed stwlite-tw-opacity-60":"stwlite-tw-bg-blue-600 hover:stwlite-tw-bg-blue-700 focus:stwlite-tw-outline-none focus:stwlite-tw-ring-2 focus:stwlite-tw-ring-offset-2 focus:stwlite-tw-ring-blue-500 stwlite-tw-cursor-pointer"]),disabled:X.value,title:X.value?t(wp.i18n.__)("Products cannot be added to a draft wishlist","saveto-wishlist-lite-for-woocommerce"):void 0,onClick:re},[o(t(vt),{class:"stwlite-tw-w-4 stwlite-tw-h-4 stwlite-tw-mr-2"}),b(" "+a(t(w)("add_product",t(wp.i18n.__)("Add Product","saveto-wishlist-lite-for-woocommerce"))),1)],10,Ts)]),e("div",js,[e("div",Ms,[e("div",Rs,[e("div",Es,a(t(w)("name",t(wp.i18n.__)("Name","saveto-wishlist-lite-for-woocommerce"))),1),e("div",As,a(t(w)("sku",t(wp.i18n.__)("SKU","saveto-wishlist-lite-for-woocommerce"))),1),e("div",Os,a(t(w)("price",t(wp.i18n.__)("Price","saveto-wishlist-lite-for-woocommerce"))),1),e("div",Bs,a(t(w)("quantity",t(wp.i18n.__)("Quantity","saveto-wishlist-lite-for-woocommerce"))),1),e("div",Ns,a(t(w)("actions",t(wp.i18n.__)("Actions","saveto-wishlist-lite-for-woocommerce"))),1)])]),g.value.length>0?(r(),c("div",$s,[(r(!0),c(_,null,x(g.value,(s,v)=>(r(),c("div",{key:s.id,class:"stwlite-tw-px-6 stwlite-tw-py-3 stwlite-tw-border-0 stwlite-tw-border-b stwlite-tw-border-gray-200 stwlite-tw-border-solid"},[e("div",qs,[e("div",Ws,a(s.name),1),e("div",zs,a(s.sku),1),e("div",Ls,[e("span",{innerHTML:"".concat(t(Re)().wcCurrency.currency_symbol).concat(s.price)},null,8,Hs)]),e("div",Ks,[P(e("input",{class:"stwlite-tw-border-0 stwlite-tw-w-full",type:"number","onUpdate:modelValue":d=>s.quantity=d,onChange:d=>ce()},null,40,Fs),[[N,s.quantity]])]),e("div",Gs,[e("button",{class:"stwlite-tw-inline-flex stwlite-tw-items-center stwlite-tw-px-3 stwlite-tw-py-2 stwlite-tw-border stwlite-tw-border-transparent stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-rounded-md stwlite-tw-text-white stwlite-tw-bg-red-600 hover:stwlite-tw-bg-red-700 focus:stwlite-tw-outline-none focus:stwlite-tw-ring-2 focus:stwlite-tw-ring-offset-2 focus:stwlite-tw-ring-red-500 stwlite-tw-transition-colors stwlite-tw-duration-200",onClick:d=>we(s,v)},[o(t($e),{class:"stwlite-tw-w-4 stwlite-tw-h-4 stwlite-tw-mr-2"}),b(" "+a(t(w)("remove",t(wp.i18n.__)("Remove","saveto-wishlist-lite-for-woocommerce"))),1)],8,Ys)])])]))),128))])):(r(),c("div",Qs,[e("div",Js,[e("div",Xs,[o(t(He),{class:"stwlite-tw-w-6 stwlite-tw-h-6 stwlite-tw-text-gray-400"})]),e("p",Zs,a(t(w)("empty_wishlist_products",t(wp.i18n.__)("This wishlist is empty, add some products!","saveto-wishlist-lite-for-woocommerce"))),1)])]))])])])])])])]),o(t(_t),{appear:"",show:L.value,as:"template"},{default:m(()=>[o(t(pt),{as:"div",onClose:Tt,class:"stwlite-tw-relative stwlite-tw-z-10"},{default:m(()=>[o(t(E),{as:"template",enter:"duration-300 ease-out","enter-from":"opacity-0","enter-to":"opacity-100",leave:"duration-200 ease-in","leave-from":"opacity-100","leave-to":"opacity-0"},{default:m(()=>l[15]||(l[15]=[e("div",{class:"stwlite-tw-fixed stwlite-tw-inset-0 stwlite-tw-bg-black/25"},null,-1)])),_:1}),e("div",tl,[e("div",el,[o(t(E),{as:"template",enter:"duration-300 ease-out","enter-from":"opacity-0 scale-95","enter-to":"opacity-100 scale-100",leave:"duration-200 ease-in","leave-from":"opacity-100 scale-100","leave-to":"opacity-0 scale-95"},{default:m(()=>[o(t(ft),{class:"stwlite-tw-w-full stwlite-tw-max-w-2xl stwlite-tw-transform stwlite-tw-rounded-2xl stwlite-tw-bg-white stwlite-tw-p-6 stwlite-tw-text-left stwlite-tw-align-middle stwlite-tw-shadow-xl stwlite-tw-transition-all"},{default:m(()=>[o(t(ht),{as:"h3",class:"stwlite-tw-text-lg stwlite-tw-font-medium stwlite-tw-leading-6 stwlite-tw-text-gray-900 stwlite-tw-mt-0"},{default:m(()=>[e("div",sl,[e("span",null,a(t(w)("add_products",t(wp.i18n.__)("Add Products","saveto-wishlist-lite-for-woocommerce"))),1),e("button",{onClick:Tt,type:"button",class:"stwlite-tw-ml-4 stwlite-tw-text-gray-400 hover:stwlite-tw-text-gray-600 focus:stwlite-tw-outline-none stwlite-tw-cursor-pointer stwlite-tw-bg-transparent stwlite-tw-border-0 stwlite-tw-text-sm hover:stwlite-tw-underline","aria-label":"Close"},[e("span",ll,a(t(w)("close",t(wp.i18n.__)("Close","saveto-wishlist-lite-for-woocommerce"))),1)])])]),_:1}),e("div",il,[e("div",wl,[o(t(wt),{modelValue:h.value,"onUpdate:modelValue":[l[7]||(l[7]=s=>h.value=s),_e],multiple:""},{default:m(()=>[e("div",ol,[e("div",al,[o(t(tt),{class:"stwlite-tw-w-full stwlite-tw-border-0 stwlite-tw-py-2 stwlite-tw-pl-3 stwlite-tw-pr-10 stwlite-tw-leading-5 stwlite-tw-text-gray-900","display-value":s=>s==null?void 0:s.label,onChange:he,placeholder:t(w)("search_product",t(wp.i18n.__)("Search Product","saveto-wishlist-lite-for-woocommerce")),autocomplete:"off"},null,8,["display-value","placeholder"]),e("span",rl,[o(t(et),{class:"stwlite-tw-h-5 stwlite-tw-w-5 stwlite-tw-text-gray-400","aria-hidden":"true"})])]),O.value.length>0?(r(),I(t(st),{key:0,class:"stwlite-tw-absolute stwlite-tw-mt-1 stwlite-tw-max-h-60 stwlite-tw-w-full stwlite-tw-overflow-auto stwlite-tw-rounded-md stwlite-tw-bg-white stwlite-tw-py-1 stwlite-tw-text-base stwlite-tw-shadow-lg stwlite-tw-ring-1 stwlite-tw-ring-black stwlite-tw-ring-opacity-5 focus:stwlite-tw-outline-none sm:stwlite-tw-text-sm"},{default:m(()=>[(r(!0),c(_,null,x(O.value,s=>(r(),I(t(lt),{key:s.value,value:s,class:"stwlite-tw-relative stwlite-tw-cursor-default stwlite-tw-select-none stwlite-tw-py-2 stwlite-tw-pl-10 stwlite-tw-pr-4"},{default:m(({active:v,selected:d})=>[e("span",{class:$(["stwlite-tw-block stwlite-tw-truncate",d?"font-medium":"font-normal"])},a(s.label),3),d?(r(),c("span",nl,[o(t(it),{class:"stwlite-tw-h-5 stwlite-tw-w-5","aria-hidden":"true"})])):f("",!0)]),_:2},1032,["value"]))),128))]),_:1})):W.value?(r(),c("p",cl,a(t(w)("searching",t(wp.i18n.__)("Searching...","saveto-wishlist-lite-for-woocommerce"))),1)):f("",!0),e("div",ul,[(r(!0),c(_,null,x(A.value,s=>(r(),c("div",{key:s.value,class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-justify-between stwlite-tw-rounded-md stwlite-tw-border stwlite-tw-px-3 stwlite-tw-py-1 stwlite-tw-bg-gray-100"},[e("span",null,a(s.label),1),e("button",{onClick:v=>de(s.value),class:"stwlite-tw-text-gray-500 hover:stwlite-tw-text-red-500 stwlite-tw-cursor-pointer stwlite-tw-border-0 stwlite-tw-bg-transparent"},[o(t(q),{class:"stwlite-tw-h-4 stwlite-tw-w-4"})],8,dl)]))),128))])])]),_:1},8,["modelValue"])])]),e("div",ml,[e("button",{type:"button",class:"stwlite-tw-inline-flex stwlite-tw-justify-center stwlite-tw-rounded-md stwlite-tw-border stwlite-tw-border-transparent stwlite-tw-bg-blue-100 stwlite-tw-px-4 stwlite-tw-py-2 stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-blue-900 hover:stwlite-tw-bg-blue-200 focus:stwlite-tw-outline-none focus-visible:stwlite-tw-ring-2 focus-visible:stwlite-tw-ring-blue-500 focus-visible:stwlite-tw-ring-offset-2",onClick:ne},a(t(w)("ok",t(wp.i18n.__)("OK","saveto-wishlist-lite-for-woocommerce"))),1)])]),_:1})]),_:1})])])]),_:1})]),_:1},8,["show"]),o(We,{isOpen:T.value,processing:B.value,title:t(w)("confirmation_title",t(wp.i18n.__)("Confirmation","saveto-wishlist-lite-for-woocommerce")),message:nt.value,confirmText:t(w)("delete",t(wp.i18n.__)("Delete","saveto-wishlist-lite-for-woocommerce")),cancelText:t(w)("cancelButtonText",t(wp.i18n.__)("Cancel","saveto-wishlist-lite-for-woocommerce")),onCloseAction:ve,onConfirmAction:pe},null,8,["isOpen","processing","title","message","confirmText","cancelText"]),D.value?(r(),I(qe,{key:0,message:D.value,type:K.value,messageTitle:H.value,onCloseNotification:me},null,8,["message","type","messageTitle"])):f("",!0),o(t(_t),{appear:"",show:Y.value,as:"template"},{default:m(()=>[o(t(pt),{as:"div",onClose:ut,class:"stwlite-tw-relative stwlite-tw-z-10"},{default:m(()=>[o(t(E),{as:"template",enter:"duration-300 ease-out","enter-from":"opacity-0","enter-to":"opacity-100",leave:"duration-200 ease-in","leave-from":"opacity-100","leave-to":"opacity-0"},{default:m(()=>l[16]||(l[16]=[e("div",{class:"stwlite-tw-fixed stwlite-tw-inset-0 stwlite-tw-bg-black/25"},null,-1)])),_:1}),e("div",vl,[e("div",pl,[o(t(E),{as:"template",enter:"duration-300 ease-out","enter-from":"opacity-0 scale-95","enter-to":"opacity-100 scale-100",leave:"duration-200 ease-in","leave-from":"opacity-100 scale-100","leave-to":"opacity-0 scale-95"},{default:m(()=>[o(t(ft),{class:"stwlite-tw-w-full stwlite-tw-max-w-2xl stwlite-tw-transform stwlite-tw-rounded-2xl stwlite-tw-bg-white stwlite-tw-p-6 stwlite-tw-text-left stwlite-tw-align-middle stwlite-tw-shadow-xl stwlite-tw-transition-all"},{default:m(()=>[o(t(ht),{as:"h3",class:"stwlite-tw-text-lg stwlite-tw-font-medium stwlite-tw-leading-6 stwlite-tw-text-gray-900 stwlite-tw-mt-0"},{default:m(()=>[e("div",fl,[e("span",null,a(t(w)("share_wishlist",t(wp.i18n.__)("Share Wishlist","saveto-wishlist-lite-for-woocommerce"))),1),e("button",{onClick:ut,type:"button",class:"stwlite-tw-ml-4 stwlite-tw-text-gray-400 hover:stwlite-tw-text-gray-600 focus:stwlite-tw-outline-none stwlite-tw-cursor-pointer stwlite-tw-bg-transparent stwlite-tw-border-0 stwlite-tw-text-sm hover:stwlite-tw-underline","aria-label":"Close"},[e("span",hl,a(t(w)("close",t(wp.i18n.__)("Close","saveto-wishlist-lite-for-woocommerce"))),1)])])]),_:1}),e("div",_l,[e("div",bl,[e("label",gl,[o(t(qt),{class:"stwlite-tw-w-4 stwlite-tw-h-4 stwlite-tw-inline-block stwlite-tw-mr-2"}),b(" "+a(t(w)("share_by_email",t(wp.i18n.__)("Share by Email","saveto-wishlist-lite-for-woocommerce"))),1)]),e("div",yl,[P(e("input",{type:"email","onUpdate:modelValue":l[8]||(l[8]=s=>M.value=s),onKeyup:Bt(Mt,["enter"]),placeholder:t(w)("enter_email",t(wp.i18n.__)("Enter email address","saveto-wishlist-lite-for-woocommerce")),class:"stwlite-tw-flex-1 stwlite-tw-block stwlite-tw-w-full stwlite-tw-px-3 stwlite-tw-py-2 stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-border-solid stwlite-tw-rounded-md stwlite-tw-shadow-sm focus:stwlite-tw-outline-none focus:stwlite-tw-ring-blue-500 focus:stwlite-tw-border-blue-500"},null,40,xl),[[N,M.value]]),e("button",{type:"button",onClick:Mt,class:"stwlite-tw-inline-flex stwlite-tw-items-center stwlite-tw-px-4 stwlite-tw-py-2 stwlite-tw-border stwlite-tw-border-transparent stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-rounded-md stwlite-tw-text-white stwlite-tw-bg-blue-600 hover:stwlite-tw-bg-blue-700 focus:stwlite-tw-outline-none focus:stwlite-tw-ring-2 focus:stwlite-tw-ring-offset-2 focus:stwlite-tw-ring-blue-500 stwlite-tw-transition-colors stwlite-tw-duration-200 stwlite-tw-cursor-pointer"},[o(t(vt),{class:"stwlite-tw-w-4 stwlite-tw-h-4 stwlite-tw-mr-1"}),b(" "+a(t(w)("add",t(wp.i18n.__)("Add","saveto-wishlist-lite-for-woocommerce"))),1)])]),C.value.length>0?(r(),c("div",kl,[(r(!0),c(_,null,x(C.value,(s,v)=>(r(),c("div",{key:v,class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-justify-between stwlite-tw-rounded-md stwlite-tw-border stwlite-tw-px-3 stwlite-tw-py-2 stwlite-tw-bg-gray-100"},[e("span",Cl,a(s),1),e("button",{onClick:d=>ge(s),class:"stwlite-tw-text-gray-500 hover:stwlite-tw-text-red-500 stwlite-tw-cursor-pointer stwlite-tw-border-0 stwlite-tw-bg-transparent"},[o(t(q),{class:"stwlite-tw-h-4 stwlite-tw-w-4"})],8,Sl)]))),128))])):f("",!0)]),e("div",Il,[e("label",Ul,[o(t(Ke),{class:"stwlite-tw-w-4 stwlite-tw-h-4 stwlite-tw-inline-block stwlite-tw-mr-2"}),b(" "+a(t(w)("share_with_users",t(wp.i18n.__)("Share with Users","saveto-wishlist-lite-for-woocommerce"))),1)]),o(t(wt),{modelValue:y.value,"onUpdate:modelValue":[l[10]||(l[10]=s=>y.value=s),ye],multiple:""},{default:m(()=>[e("div",Pl,[e("div",Vl,[o(t(tt),{class:"stwlite-tw-w-full stwlite-tw-border-0 stwlite-tw-py-2 stwlite-tw-pl-3 stwlite-tw-pr-10 stwlite-tw-leading-5 stwlite-tw-text-gray-900","display-value":s=>s==null?void 0:s.label,placeholder:t(w)("search_users",t(wp.i18n.__)("Search users","saveto-wishlist-lite-for-woocommerce")),autocomplete:"off",onChange:l[9]||(l[9]=s=>t(te)(s.target.value))},null,8,["display-value","placeholder"]),e("span",Dl,[o(t(et),{class:"stwlite-tw-h-5 stwlite-tw-w-5 stwlite-tw-text-gray-400","aria-hidden":"true"})])]),t(Pt)?(r(),c("div",Tl,a(t(w)("searching",t(wp.i18n.__)("Searching...","saveto-wishlist-lite-for-woocommerce"))),1)):t(at).length>0?(r(),I(t(st),{key:1,class:"stwlite-tw-absolute stwlite-tw-mt-1 stwlite-tw-max-h-60 stwlite-tw-w-full stwlite-tw-overflow-auto stwlite-tw-rounded-md stwlite-tw-bg-white stwlite-tw-py-1 stwlite-tw-text-base stwlite-tw-shadow-lg stwlite-tw-ring-1 stwlite-tw-ring-black stwlite-tw-ring-opacity-5 focus:stwlite-tw-outline-none sm:stwlite-tw-text-sm"},{default:m(()=>[(r(!0),c(_,null,x(t(at),s=>(r(),I(t(lt),{key:s.value,value:s,class:"stwlite-tw-relative stwlite-tw-cursor-default stwlite-tw-select-none stwlite-tw-py-2 stwlite-tw-pl-10 stwlite-tw-pr-4"},{default:m(({active:v,selected:d})=>[e("span",{class:$(["stwlite-tw-block stwlite-tw-truncate",d?"font-medium":"font-normal"])},a(s.label),3),d?(r(),c("span",jl,[o(t(it),{class:"stwlite-tw-h-5 stwlite-tw-w-5","aria-hidden":"true"})])):f("",!0)]),_:2},1032,["value"]))),128))]),_:1})):t(Zt)&&!t(Pt)&&t(at).length===0?(r(),c("p",Ml,a(t(w)("no_users_found",t(wp.i18n.__)("No users found","saveto-wishlist-lite-for-woocommerce"))),1)):f("",!0),y.value.length>0?(r(),c("div",Rl,[(r(!0),c(_,null,x(y.value,s=>(r(),c("div",{key:s.value,class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-justify-between stwlite-tw-rounded-md stwlite-tw-border stwlite-tw-px-3 stwlite-tw-py-1 stwlite-tw-bg-gray-100"},[e("span",null,a(s.label),1),e("button",{onClick:v=>y.value=y.value.filter(d=>d.value!==s.value),class:"stwlite-tw-text-gray-500 hover:stwlite-tw-text-red-500 stwlite-tw-cursor-pointer stwlite-tw-border-0 stwlite-tw-bg-transparent"},[o(t(q),{class:"stwlite-tw-h-4 stwlite-tw-w-4"})],8,El)]))),128))])):f("",!0)])]),_:1},8,["modelValue"])])]),e("div",Al,[e("button",{type:"button",onClick:ut,class:"stwlite-tw-inline-flex stwlite-tw-justify-center stwlite-tw-rounded-md stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-bg-white stwlite-tw-px-4 stwlite-tw-py-2 stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-gray-700 hover:stwlite-tw-bg-gray-50 focus:stwlite-tw-outline-none focus-visible:stwlite-tw-ring-2 focus-visible:stwlite-tw-ring-blue-500 focus-visible:stwlite-tw-ring-offset-2"},a(t(w)("cancel",t(wp.i18n.__)("Cancel","saveto-wishlist-lite-for-woocommerce"))),1),e("button",{type:"button",onClick:xe,disabled:ee.value,class:"stwlite-tw-inline-flex stwlite-tw-justify-center stwlite-tw-rounded-md stwlite-tw-border stwlite-tw-border-transparent stwlite-tw-bg-blue-600 stwlite-tw-px-4 stwlite-tw-py-2 stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-white hover:stwlite-tw-bg-blue-700 focus:stwlite-tw-outline-none focus-visible:stwlite-tw-ring-2 focus-visible:stwlite-tw-ring-blue-500 focus-visible:stwlite-tw-ring-offset-2 disabled:stwlite-tw-opacity-50 disabled:stwlite-tw-cursor-not-allowed"},a(t(w)("ok",t(wp.i18n.__)("OK","saveto-wishlist-lite-for-woocommerce"))),9,Ol)])]),_:1})]),_:1})])])]),_:1})]),_:1},8,["show"]),o(t(_t),{appear:"",show:Q.value,as:"template"},{default:m(()=>[o(t(pt),{as:"div",onClose:dt,class:"stwlite-tw-relative stwlite-tw-z-10"},{default:m(()=>[o(t(E),{as:"template",enter:"duration-300 ease-out","enter-from":"opacity-0","enter-to":"opacity-100",leave:"duration-200 ease-in","leave-from":"opacity-100","leave-to":"opacity-0"},{default:m(()=>l[17]||(l[17]=[e("div",{class:"stwlite-tw-fixed stwlite-tw-inset-0 stwlite-tw-bg-black/25"},null,-1)])),_:1}),e("div",Bl,[e("div",Nl,[o(t(E),{as:"template",enter:"duration-300 ease-out","enter-from":"opacity-0 scale-95","enter-to":"opacity-100 scale-100",leave:"duration-200 ease-in","leave-from":"opacity-100 scale-100","leave-to":"opacity-0 scale-95"},{default:m(()=>[o(t(ft),{class:"stwlite-tw-w-full stwlite-tw-max-w-2xl stwlite-tw-transform stwlite-tw-rounded-2xl stwlite-tw-bg-white stwlite-tw-p-6 stwlite-tw-text-left stwlite-tw-align-middle stwlite-tw-shadow-xl stwlite-tw-transition-all"},{default:m(()=>[o(t(ht),{as:"h3",class:"stwlite-tw-text-lg stwlite-tw-font-medium stwlite-tw-leading-6 stwlite-tw-text-gray-900 stwlite-tw-mt-0"},{default:m(()=>[e("div",$l,[e("span",null,a(t(w)("restrictions",t(wp.i18n.__)("Restrictions","saveto-wishlist-lite-for-woocommerce"))),1),e("button",{onClick:dt,type:"button",class:"stwlite-tw-ml-4 stwlite-tw-text-gray-400 hover:stwlite-tw-text-gray-600 focus:stwlite-tw-outline-none stwlite-tw-cursor-pointer stwlite-tw-bg-transparent stwlite-tw-border-0 stwlite-tw-text-sm hover:stwlite-tw-underline","aria-label":"Close"},[e("span",ql,a(t(w)("close",t(wp.i18n.__)("Close","saveto-wishlist-lite-for-woocommerce"))),1)])])]),_:1}),e("div",Wl,[e("div",zl,[e("label",Ll,[o(t(bt),{class:"stwlite-tw-w-4 stwlite-tw-h-4 stwlite-tw-inline-block stwlite-tw-mr-2"}),b(" "+a(t(w)("restrict_by_roles",t(wp.i18n.__)("Restrict by Roles","saveto-wishlist-lite-for-woocommerce"))),1)]),o(t(wt),{modelValue:k.value,"onUpdate:modelValue":[l[11]||(l[11]=s=>k.value=s),Ce],multiple:""},{default:m(()=>[e("div",Hl,[e("div",Kl,[o(t(tt),{class:"stwlite-tw-w-full stwlite-tw-border-0 stwlite-tw-py-2 stwlite-tw-pl-3 stwlite-tw-pr-10 stwlite-tw-leading-5 stwlite-tw-text-gray-900","display-value":s=>s==null?void 0:s.label,placeholder:t(w)("search_roles",t(wp.i18n.__)("Search roles","saveto-wishlist-lite-for-woocommerce")),autocomplete:"off"},null,8,["display-value","placeholder"]),e("span",Fl,[o(t(et),{class:"stwlite-tw-h-5 stwlite-tw-w-5 stwlite-tw-text-gray-400","aria-hidden":"true"})])]),J.value.length>0?(r(),I(t(st),{key:0,class:"stwlite-tw-absolute stwlite-tw-mt-1 stwlite-tw-max-h-60 stwlite-tw-w-full stwlite-tw-overflow-auto stwlite-tw-rounded-md stwlite-tw-bg-white stwlite-tw-py-1 stwlite-tw-text-base stwlite-tw-shadow-lg stwlite-tw-ring-1 stwlite-tw-ring-black stwlite-tw-ring-opacity-5 focus:stwlite-tw-outline-none sm:stwlite-tw-text-sm"},{default:m(()=>[(r(!0),c(_,null,x(J.value,s=>(r(),I(t(lt),{key:s.value,value:s,class:"stwlite-tw-relative stwlite-tw-cursor-default stwlite-tw-select-none stwlite-tw-py-2 stwlite-tw-pl-10 stwlite-tw-pr-4"},{default:m(({active:v,selected:d})=>[e("span",{class:$(["stwlite-tw-block stwlite-tw-truncate",d?"font-medium":"font-normal"])},a(s.label),3),d?(r(),c("span",Gl,[o(t(it),{class:"stwlite-tw-h-5 stwlite-tw-w-5","aria-hidden":"true"})])):f("",!0)]),_:2},1032,["value"]))),128))]),_:1})):f("",!0),k.value.length>0?(r(),c("div",Yl,[(r(!0),c(_,null,x(k.value,s=>(r(),c("div",{key:s.value,class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-justify-between stwlite-tw-rounded-md stwlite-tw-border stwlite-tw-px-3 stwlite-tw-py-1 stwlite-tw-bg-gray-100"},[e("span",null,a(s.label),1),e("button",{onClick:v=>k.value=k.value.filter(d=>d.value!==s.value),class:"stwlite-tw-text-gray-500 hover:stwlite-tw-text-red-500 stwlite-tw-cursor-pointer stwlite-tw-border-0 stwlite-tw-bg-transparent"},[o(t(q),{class:"stwlite-tw-h-4 stwlite-tw-w-4"})],8,Ql)]))),128))])):f("",!0)])]),_:1},8,["modelValue"])]),e("div",Jl,[e("label",Xl,[o(t(qt),{class:"stwlite-tw-w-4 stwlite-tw-h-4 stwlite-tw-inline-block stwlite-tw-mr-2"}),b(" "+a(t(w)("who_can_edit",t(wp.i18n.__)("Who Can Edit","saveto-wishlist-lite-for-woocommerce"))),1)]),e("div",Zl,[P(e("input",{type:"email","onUpdate:modelValue":l[12]||(l[12]=s=>R.value=s),onKeyup:Bt(Rt,["enter"]),placeholder:t(w)("enter_email",t(wp.i18n.__)("Enter email address","saveto-wishlist-lite-for-woocommerce")),class:"stwlite-tw-flex-1 stwlite-tw-block stwlite-tw-w-full stwlite-tw-px-3 stwlite-tw-py-2 stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-border-solid stwlite-tw-rounded-md stwlite-tw-shadow-sm focus:stwlite-tw-outline-none focus:stwlite-tw-ring-blue-500 focus:stwlite-tw-border-blue-500"},null,40,ti),[[N,R.value]]),e("button",{type:"button",onClick:Rt,class:"stwlite-tw-inline-flex stwlite-tw-items-center stwlite-tw-px-4 stwlite-tw-py-2 stwlite-tw-border stwlite-tw-border-transparent stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-rounded-md stwlite-tw-text-white stwlite-tw-bg-blue-600 hover:stwlite-tw-bg-blue-700 focus:stwlite-tw-outline-none focus:stwlite-tw-ring-2 focus:stwlite-tw-ring-offset-2 focus:stwlite-tw-ring-blue-500 stwlite-tw-transition-colors stwlite-tw-duration-200 stwlite-tw-cursor-pointer"},[o(t(vt),{class:"stwlite-tw-w-4 stwlite-tw-h-4 stwlite-tw-mr-1"}),b(" "+a(t(w)("add",t(wp.i18n.__)("Add","saveto-wishlist-lite-for-woocommerce"))),1)])]),S.value.length>0?(r(),c("div",ei,[(r(!0),c(_,null,x(S.value,(s,v)=>(r(),c("div",{key:v,class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-justify-between stwlite-tw-rounded-md stwlite-tw-border stwlite-tw-px-3 stwlite-tw-py-2 stwlite-tw-bg-gray-100"},[e("span",si,a(s),1),e("button",{onClick:d=>Se(s),class:"stwlite-tw-text-gray-500 hover:stwlite-tw-text-red-500 stwlite-tw-cursor-pointer stwlite-tw-border-0 stwlite-tw-bg-transparent"},[o(t(q),{class:"stwlite-tw-h-4 stwlite-tw-w-4"})],8,li)]))),128))])):f("",!0)])]),e("div",ii,[e("button",{type:"button",onClick:dt,class:"stwlite-tw-inline-flex stwlite-tw-justify-center stwlite-tw-rounded-md stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-bg-white stwlite-tw-px-4 stwlite-tw-py-2 stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-gray-700 hover:stwlite-tw-bg-gray-50 focus:stwlite-tw-outline-none focus-visible:stwlite-tw-ring-2 focus-visible:stwlite-tw-ring-blue-500 focus-visible:stwlite-tw-ring-offset-2"},a(t(w)("cancel",t(wp.i18n.__)("Cancel","saveto-wishlist-lite-for-woocommerce"))),1),e("button",{type:"button",onClick:Ie,class:"stwlite-tw-inline-flex stwlite-tw-justify-center stwlite-tw-rounded-md stwlite-tw-border stwlite-tw-border-transparent stwlite-tw-bg-blue-600 stwlite-tw-px-4 stwlite-tw-py-2 stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-white hover:stwlite-tw-bg-blue-700 focus:stwlite-tw-outline-none focus-visible:stwlite-tw-ring-2 focus-visible:stwlite-tw-ring-blue-500 focus-visible:stwlite-tw-ring-offset-2"},[o(t(bt),{class:"stwlite-tw-w-4 stwlite-tw-h-4 stwlite-tw-mr-2"}),b(" "+a(t(w)("ok",t(wp.i18n.__)("OK","saveto-wishlist-lite-for-woocommerce"))),1)])])]),_:1})]),_:1})])])]),_:1})]),_:1},8,["show"])],64))}}),Ii=Le(wi,[["__scopeId","data-v-c9eec040"]]);export{Ii as default};
