PageSourceSearch

https://devmode.id/_nuxt/DNnIJRzL.js

js devmode.id collected 2026-10-09 03:44:18 UTC 3,009 bytes, 1 lines download raw bytes

1import{a9 as e,S as i,l as c,n as x,i as n,ar as f,al as w,E as h,J as u,o as y,at as k,a6 as _,k as m,Y as d}from"./oZQsvWWb.js";import{u as S}from"./DbiCVc2F.js";const C={key:0,class:"bg-white border hidden sm:block border-gray-200 rounded-2xl p-5 mb-4"},N=["disabled"],V=["disabled"],B={key:0},M={key:1,class:"flex items-center justify-center gap-2"},E={__name:"NewsletterSubscription",setup(T){const t=d(""),l=d(!1),s=d(""),a=d(""),p=S(),g=r=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r);async function b(){try{if(!t.value.trim()){s.value="Email tidak boleh kosong",a.value="error";return}if(!g(t.value)){s.value="Format email tidak valid",a.value="error";return}l.value=!0,s.value="",a.value="";const r=await $fetch("/api/newsletter/subscribe",{method:"POST",body:{email:t.value.trim()}});r.success?(s.value="Berhasil berlangganan newsletter!",a.value="success",t.value=""):(s.value=r.message||"Terjadi kesalahan",a.value="error")}catch(r){console.error("Newsletter subscription error:",r),s.value="Terjadi kesalahan saat berlangganan",a.value="error"}finally{l.value=!1}}return(r,o)=>e(p).selectedArticle?m("",!0):(i(),c("div",C,[o[2]||(o[2]=x('<h3 class="text-xs font-bold text-gray-900 uppercase tracking-widest mb-2 flex items-center"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="mr-2 text-gray-600"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg> Newsletter </h3><p class="text-xs text-gray-600 mb-2 leading-relaxed"> Update terbaru berita, tutorial, dan tren teknologi. </p>',2)),n("form",{onSubmit:k(b,["prevent"]),class:"space-y-2.5"},[f(n("input",{"onUpdate:modelValue":o[0]||(o[0]=v=>h(t)?t.value=v:null),type:"email",placeholder:"Masukkan email Anda",disabled:e(l),class:"w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:opacity-50 disabled:cursor-not-allowed"},null,8,N),[[w,e(t)]]),n("button",{type:"submit",disabled:e(l)||!e(t).trim(),class:u(["w-full bg-red-600 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-lg text-sm transition-colors duration-200",e(l)||!e(t).trim()?"opacity-50 cursor-not-allowed":""])},[e(l)?(i(),c("span",M,[...o[1]||(o[1]=[n("svg",{class:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[n("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),n("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),y(" Memproses... ",-1)])])):(i(),c("span",B,"Berlangganan"))],10,V)],32),e(s)?(i(),c("div",{key:0,class:u(["mt-3 text-xs text-center",e(a)==="success"?"text-green-600":"text-red-600"])},_(e(s)),3)):m("",!0)]))}};export{E as _};

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.