import{d as T,G as s,r as c,D as L,o as w,c as l,e as n,u as e,b as t,a as o,M as N,N as j,g as B,f as V,H as h}from"../../../common/index.DXvi0yH9.js";import{H as z}from"../../partials/index.EnUA63nb.js";import D from"./UpgradeModal.D0e-Pmld.js";import{c as m}from"../../../common/createLucideIcon.D3XWtEmL.js";import"../../../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-resolve-button-type.Cleihsk7.js";import"../../../common/crown.Cl0_N8Ry.js";import"../../../common/x.ClCP0MsD.js";import"../../../common/sparkles.WrMKOEbV.js";import"../../../common/trending-up.B3CW55Gy.js";import"../../../common/transition.CRNcmuQX.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 E=m("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
 * @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 H=m("pen-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/**
 * @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 I=m("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),U={class:"stwlite-tw-max-w-7xl stwlite-tw-mx-auto"},S={class:"stwlite-tw-bg-amber-50 stwlite-tw-border-l-4 stwlite-tw-border-amber-400 stwlite-tw-p-4 stwlite-tw-mt-4 stwlite-tw-rounded-md"},O={class:"stwlite-tw-flex stwlite-tw-items-center"},P={class:"stwlite-tw-ml-3"},W={class:"stwlite-tw-text-sm stwlite-tw-text-amber-800"},F={key:0,class:"stwlite-tw-flex stwlite-tw-justify-center stwlite-tw-items-center stwlite-tw-py-12"},R={key:1,class:"stwlite-tw-max-w-7xl stwlite-tw-mx-auto stwlite-tw-px-4 sm:stwlite-tw-px-6 lg:stwlite-tw-px-8 stwlite-tw-py-8"},G={key:0,class:"stwlite-tw-text-center stwlite-tw-py-12"},q={class:"stwlite-tw-text-gray-500 stwlite-tw-text-lg stwlite-tw-mb-4"},J={key:1,class:"stwlite-tw-grid stwlite-tw-grid-cols-1 md:stwlite-tw-grid-cols-2 lg:stwlite-tw-grid-cols-3 stwlite-tw-gap-6"},K={class:"stwlite-tw-p-6 stwlite-tw-flex-1"},Q={class:"stwlite-tw-mb-4"},X={class:"stwlite-tw-text-lg stwlite-tw-font-semibold stwlite-tw-leading-loose"},Y={class:"stwlite-tw-bg-blue-50 stwlite-tw-text-gray-900 stwlite-tw-px-2 stwlite-tw-py-1 stwlite-tw-border-b-2 stwlite-tw-border-blue-600"},Z={class:"stwlite-tw-bg-green-50 stwlite-tw-text-gray-900 stwlite-tw-px-2 stwlite-tw-py-1 stwlite-tw-border-b-2 stwlite-tw-border-green-600"},$={key:0,class:"stwlite-tw-text-sm stwlite-tw-text-gray-600 stwlite-tw-leading-relaxed"},tt={class:"stwlite-tw-px-6 stwlite-tw-py-3 stwlite-tw-bg-gray-50 stwlite-tw-border-t stwlite-tw-border-gray-100 stwlite-tw-flex stwlite-tw-items-center stwlite-tw-justify-between stwlite-tw-gap-3 stwlite-tw-mt-auto"},et={class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-gap-2"},st=["title"],it=["title"],wt={class:"stwlite-tw-flex stwlite-tw-items-center"},lt={class:"stwlite-tw-sr-only"},yt=T({__name:"Automations",setup(ot){const g={title:s("automations_title",wp.i18n.__("Wishlist Automations","saveto-wishlist-lite-for-woocommerce")),description:s("automations_description",wp.i18n.__("Create and manage automated workflows for your wishlists","saveto-wishlist-lite-for-woocommerce"))},v=s("automations_demo_notice",wp.i18n.__("This is a temporary demo view for the Automations page and will be removed once PRO is installed.","saveto-wishlist-lite-for-woocommerce")),r=c(!1),u=c(!1),p=c([{id:1,trigger_type:"product_added",action_type:"send_email",status:"active",description:"Send email notification when a product is added to wishlist"},{id:2,trigger_type:"wishlist_shared",action_type:"create_webhook",status:"inactive",description:"Trigger webhook when wishlist is shared"}]),f={product_added:s("product_added",wp.i18n.__("Product Added","saveto-wishlist-lite-for-woocommerce")),wishlist_shared:s("wishlist_shared",wp.i18n.__("Wishlist Shared","saveto-wishlist-lite-for-woocommerce")),item_removed:s("item_removed",wp.i18n.__("Item Removed","saveto-wishlist-lite-for-woocommerce"))},b={send_email:s("send_email",wp.i18n.__("Send Email","saveto-wishlist-lite-for-woocommerce")),create_webhook:s("create_webhook",wp.i18n.__("Create Webhook","saveto-wishlist-lite-for-woocommerce")),update_usermeta:s("update_usermeta",wp.i18n.__("Update User Meta","saveto-wishlist-lite-for-woocommerce"))},_=()=>{r.value=!0},x=()=>{r.value=!0},y=()=>{r.value=!0},k=()=>{r.value=!0},M=a=>f[a]||a,C=a=>b[a]||a,A=()=>{r.value=!1};return L(()=>{u.value=!1}),(a,d)=>(w(),l("div",null,[n(e(z),{infoData:g,showButton:!0,buttonIcon:"plus",buttonText:e(s)("add_new",e(wp.i18n.__)("Add New","saveto-wishlist-lite-for-woocommerce")),onTriggerButton:_},null,8,["buttonText"]),t("div",U,[t("div",S,[t("div",O,[d[0]||(d[0]=t("div",{class:"stwlite-tw-flex-shrink-0"},[t("svg",{class:"stwlite-tw-h-5 stwlite-tw-w-5 stwlite-tw-text-amber-400",viewBox:"0 0 20 20",fill:"currentColor"},[t("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})])],-1)),t("div",P,[t("p",W,o(e(v)),1)])])])]),u.value?(w(),l("div",F,[n(e(E),{class:"stwlite-tw-w-8 stwlite-tw-h-8 stwlite-tw-animate-spin stwlite-tw-text-blue-600"})])):(w(),l("div",R,[p.value.length===0?(w(),l("div",G,[t("p",q,o(e(s)("no_automations",e(wp.i18n.__)("No automations found. Create your first automation!","saveto-wishlist-lite-for-woocommerce"))),1),t("button",{onClick:_,class:"stwlite-tw-inline-flex stwlite-tw-items-center stwlite-tw-px-6 stwlite-tw-py-3 stwlite-tw-bg-blue-600 stwlite-tw-text-white stwlite-tw-font-medium stwlite-tw-rounded-lg hover:stwlite-tw-bg-blue-700 stwlite-tw-transition-colors stwlite-tw-cursor-pointer stwlite-tw-border-solid stwlite-tw-border-0"},o(e(s)("create_first_automation",e(wp.i18n.__)("Create First Automation","saveto-wishlist-lite-for-woocommerce"))),1)])):(w(),l("div",J,[(w(!0),l(N,null,j(p.value,i=>(w(),l("div",{key:i.id,class:"stwlite-tw-bg-white stwlite-tw-rounded-xl stwlite-tw-border stwlite-tw-border-gray-200 stwlite-tw-overflow-hidden hover:stwlite-tw-shadow-lg hover:stwlite-tw-border-gray-300 stwlite-tw-transition-all stwlite-tw-duration-200 stwlite-tw-flex stwlite-tw-flex-col stwlite-tw-border-solid"},[t("div",K,[t("div",Q,[t("h3",X,[t("span",Y,o(M(i.trigger_type)),1),d[1]||(d[1]=t("span",{class:"stwlite-tw-text-gray-900"}," then ",-1)),t("span",Z,o(C(i.action_type)),1)])]),i.description?(w(),l("p",$,o(i.description),1)):B("",!0)]),t("div",tt,[t("div",et,[t("button",{onClick:x,class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-justify-center stwlite-tw-gap-1 stwlite-tw-px-3 stwlite-tw-py-2 stwlite-tw-bg-white stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-rounded-lg stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-gray-700 hover:stwlite-tw-bg-gray-50 hover:stwlite-tw-border-gray-400 stwlite-tw-transition-all stwlite-tw-cursor-pointer stwlite-tw-border-solid",title:e(s)("edit_automation",e(wp.i18n.__)("Edit Automation","saveto-wishlist-lite-for-woocommerce"))},[n(e(H),{class:"stwlite-tw-w-4 stwlite-tw-h-4"}),V(" "+o(e(s)("edit_automation",e(wp.i18n.__)("Edit Automation","saveto-wishlist-lite-for-woocommerce"))),1)],8,st),t("button",{onClick:y,class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-justify-center stwlite-tw-gap-1 stwlite-tw-px-3 stwlite-tw-py-2 stwlite-tw-bg-white stwlite-tw-border stwlite-tw-border-gray-300 stwlite-tw-rounded-lg stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-text-red-600 hover:stwlite-tw-bg-red-50 hover:stwlite-tw-border-red-400 stwlite-tw-transition-all stwlite-tw-cursor-pointer stwlite-tw-border-solid",title:e(s)("delete_automation",e(wp.i18n.__)("Delete Automation","saveto-wishlist-lite-for-woocommerce"))},[n(e(I),{class:"stwlite-tw-w-4 stwlite-tw-h-4"})],8,it)]),t("div",wt,[t("button",{type:"button",onClick:k,class:h(["stwlite-tw-relative stwlite-tw-inline-flex stwlite-tw-h-7 stwlite-tw-w-12 stwlite-tw-items-center stwlite-tw-rounded-full stwlite-tw-transition-colors focus:stwlite-tw-outline-none focus:stwlite-tw-ring-2 focus:stwlite-tw-ring-offset-2 stwlite-tw-border-0 stwlite-tw-cursor-pointer",i.status==="active"?"stwlite-tw-bg-green-600 focus:stwlite-tw-ring-green-500":"stwlite-tw-bg-gray-300 focus:stwlite-tw-ring-gray-400"])},[t("span",{class:h(["stwlite-tw-inline-block stwlite-tw-h-5 stwlite-tw-w-5 stwlite-tw-transform stwlite-tw-rounded-full stwlite-tw-bg-white stwlite-tw-transition-transform stwlite-tw-shadow-lg",i.status==="active"?"stwlite-tw-translate-x-4":"stwlite-tw-translate-x-0"])},null,2)],2),t("span",lt,o(i.status==="active"?e(s)("active",e(wp.i18n.__)("Active","saveto-wishlist-lite-for-woocommerce")):e(s)("inactive",e(wp.i18n.__)("Inactive","saveto-wishlist-lite-for-woocommerce"))),1)])])]))),128))]))])),n(D,{isOpen:r.value,onClose:A},null,8,["isOpen"])]))}});export{yt as default};
