PageSourceSearch

https://www.selinawamucii.com/marketplace/build/assets/Edit-ptg_9RkQ.js

js selinawamucii.com collected 2026-10-02 14:32:28 UTC 7,816 bytes, 1 lines download raw bytes

1import{T as S,l as k,B as M,c as N,w as f,o as n,e,t as i,H as q,p as b,G as j,u as o,d as a,g as y,v as U,r as g,F as x,a as v,I as $,f as B,i as E,N as A}from"./app-CLiv0SF_.js";import{A as L}from"./AuthenticatedLayout-C5rhqA9B.js";import{_ as O}from"./Modal-BbBsTkg0.js";import{_ as D}from"./TiptapEditor-DfjPR9e0.js";/* empty css            */import"./ApplicationLogo-DcBGDrkA.js";/* empty css                                                                        */import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ShieldCheckIcon-DBBc9Wz8.js";import"./SparklesIcon-kYQY9l7f.js";import"./XIcon-1oMX-uYW.js";import"./debounce-CeqZbKiu.js";import"./_baseGetTag-BIcDdAj4.js";import"./CheckCircleIcon-DDNT15IH.js";import"./XCircleIcon-Ja3C1R3H.js";import"./FeedbackWidget-CXt3tLGq.js";/* empty css                                                                            */import"./keyboard-3j4TMytL.js";import"./active-element-history-DJuoKIO7.js";import"./AcademicCapIcon-BHzVCBgf.js";const H={class:"font-semibold text-xl text-gray-800 leading-tight"},P={class:"py-12"},F={class:"max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6"},G={class:"rounded-2xl bg-white p-6 shadow-sm ring-1 ring-gray-100"},I={class:"space-y-6"},W={key:0,class:"mt-2 text-sm text-red-600"},z=["value"],J={key:0,class:"mt-2 text-sm text-red-600"},K={key:0,class:"mt-2 text-sm text-red-600"},Q={class:"mt-1"},R={key:0,class:"mt-2 text-sm text-red-600"},X={class:"mt-2 space-y-4"},Y={class:"text-sm font-medium text-gray-600"},Z={class:"mt-1 flex flex-wrap gap-2"},ee=["onClick"],te=["onClick"],se={class:"relative flex items-start"},oe={class:"flex h-5 items-center"},re={class:"mt-6 flex items-center justify-end space-x-3"},ne=["disabled"],le={class:"p-6"},ae={class:"space-y-4"},ie={class:"mt-1"},de=["innerHTML"],me={class:"mt-6 flex justify-end"},Ue={__name:"Edit",props:{template:{type:Object,required:!0},template_types:{type:Object,required:!0},variables:{type:Object,required:!0},flash:{type:Object,default:()=>({})}},setup(p){const d=p,s=S({name:d.template.name,template_type:d.template.template_type,subject:d.template.subject,content:d.template.content,variables:d.template.variables||{},is_active:d.template.is_active}),u=k(!1),c=k({subject:"",content:""}),C=(l,t=null)=>t?"{{"+l+"."+t+"}}":"{{"+l+"}}",w=(l,t=null)=>{const r=C(l,t);window.tinymce&&window.tinymce.activeEditor.insertContent(r)},V=()=>{A.post(route("dashboard.admin.newsletter.templates.preview"),{subject:s.subject,content:s.content},{preserveState:!0,preserveScroll:!0,onSuccess:l=>{c.value=l,u.value=!0}})},T=()=>{s.put(route("dashboard.admin.newsletter.templates.update",d.template.id))};return M(()=>d.flash.preview,l=>{l&&(c.value=l,u.value=!0)}),(l,t)=>(n(),N(L,null,{header:f(()=>[e("h2",H," Edit Template: "+i(p.template.name),1)]),default:f(()=>[e("div",P,[e("div",F,[e("div",G,[e("form",{onSubmit:q(T,["prevent"])},[e("div",I,[e("div",null,[t[7]||(t[7]=e("label",{for:"name",class:"block text-sm font-medium text-gray-700"},"Template Name",-1)),b(e("input",{id:"name",type:"text","onUpdate:modelValue":t[0]||(t[0]=r=>o(s).name=r),class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-[#006838] focus:ring-[#006838] sm:text-sm",required:""},null,512),[[j,o(s).name]]),o(s).errors.name?(n(),a("p",W,i(o(s).errors.name),1)):y("",!0)]),e("div",null,[t[9]||(t[9]=e("label",{for:"template_type",class:"block text-sm font-medium text-gray-700"},"Template Type",-1)),b(e("select",{id:"template_type","onUpdate:modelValue":t[1]||(t[1]=r=>o(s).template_type=r),class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-[#006838] focus:ring-[#006838] sm:text-sm",required:""},[t[8]||(t[8]=e("option",{value:""},"Select a type",-1)),(n(!0),a(x,null,g(p.template_types,(r,m)=>(n(),a("option",{key:m,value:m},i(r),9,z))),128))],512),[[U,o(s).template_type]]),o(s).errors.template_type?(n(),a("p",J,i(o(s).errors.template_type),1)):y("",!0)]),e("div",null,[t[10]||(t[10]=e("label",{for:"subject",class:"block text-sm font-medium text-gray-700"},"Email Subject",-1)),b(e("input",{id:"subject",type:"text","onUpdate:modelValue":t[2]||(t[2]=r=>o(s).subject=r),class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-[#006838] focus:ring-[#006838] sm:text-sm",required:""},null,512),[[j,o(s).subject]]),o(s).errors.subject?(n(),a("p",K,i(o(s).errors.subject),1)):y("",!0)]),e("div",null,[t[11]||(t[11]=e("label",{for:"content",class:"block text-sm font-medium text-gray-700"},"Template Content",-1)),e("div",Q,[v(D,{modelValue:o(s).content,"onUpdate:modelValue":t[3]||(t[3]=r=>o(s).content=r),placeholder:"Write your email template content here..."},null,8,["modelValue"]),o(s).errors.content?(n(),a("p",R,i(o(s).errors.content),1)):y("",!0)])]),e("div",null,[t[12]||(t[12]=e("h3",{class:"text-sm font-medium text-gray-700"},"Available Variables",-1)),e("div",X,[(n(!0),a(x,null,g(p.variables,(r,m)=>(n(),a("div",{key:m},[e("h4",Y,i(m),1),e("div",Z,[typeof r=="string"?(n(),a("button",{key:0,t
1ype:"button",onClick:h=>w(m),class:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 shadow-sm text-xs font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#006838]"},i(r),9,ee)):(n(!0),a(x,{key:1},g(r,(h,_)=>(n(),a("button",{key:_,type:"button",onClick:ue=>w(m,_),class:"inline-flex items-center px-2.5 py-1.5 border border-gray-300 shadow-sm text-xs font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#006838]"},i(h),9,te))),128))])]))),128))])]),e("div",se,[e("div",oe,[b(e("input",{id:"is_active",type:"checkbox","onUpdate:modelValue":t[4]||(t[4]=r=>o(s).is_active=r),class:"h-4 w-4 rounded border-gray-300 text-[#006838] focus:ring-[#006838]"},null,512),[[$,o(s).is_active]])]),t[13]||(t[13]=e("div",{class:"ml-3 text-sm"},[e("label",{for:"is_active",class:"font-medium text-gray-700"},"Active"),e("p",{class:"text-gray-500"},"Make this template available for use in campaigns")],-1))])]),e("div",re,[e("button",{type:"button",onClick:V,class:"rounded-md border border-gray-300 bg-white py-2 px-4 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-[#006838] focus:ring-offset-2"}," Preview "),v(o(E),{href:l.route("dashboard.admin.newsletter.templates.index"),class:"rounded-md border border-gray-300 bg-white py-2 px-4 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-[#006838] focus:ring-offset-2"},{default:f(()=>t[14]||(t[14]=[B(" Cancel ")])),_:1},8,["href"]),e("button",{type:"submit",class:"inline-flex justify-center rounded-md border border-transparent bg-[#006838] py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-[#005830] focus:outline-none focus:ring-2 focus:ring-[#006838] focus:ring-offset-2",disabled:o(s).processing}," Update Template ",8,ne)])],32)])])]),v(O,{show:u.value,onClose:t[6]||(t[6]=r=>u.value=!1)},{default:f(()=>[e("div",le,[t[17]||(t[17]=e("h2",{class:"text-lg font-medium text-gray-900 mb-4"},"Template Preview",-1)),e("div",ae,[e("div",null,[t[15]||(t[15]=e("label",{class:"block text-sm font-medium text-gray-700"},"Subject",-1)),e("p",ie,i(c.value.subject),1)]),e("div",null,[t[16]||(t[16]=e("label",{class:"block text-sm font-medium text-gray-700"},"Content",-1)),e("div",{class:"mt-1 p-4 border rounded-md bg-white",innerHTML:c.value.content},null,8,de)])]),e("div",me,[e("button",{type:"button",class:"bg-white py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#006838]",onClick:t[5]||(t[5]=r=>u.value=!1)}," Close ")])])]),_:1},8,["show"])]),_:1}))}};export{Ue as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.