"use strict";(()=>{var e={};e.id=6191,e.ids=[6191,2331],e.modules={53524:e=>{e.exports=require("@prisma/client")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},27790:e=>{e.exports=require("assert")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},32615:e=>{e.exports=require("http")},32694:e=>{e.exports=require("http2")},35240:e=>{e.exports=require("https")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},74175:e=>{e.exports=require("tty")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},5454:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>_,patchFetch:()=>h,requestAsyncStorage:()=>m,routeModule:()=>l,serverHooks:()=>x,staticGenerationAsyncStorage:()=>v});var a={};t.r(a),t.d(a,{GET:()=>c,dynamic:()=>d});var s=t(49303),o=t(88716),i=t(60670),n=t(87070),p=t(59833),u=t(72331);let d="force-dynamic";async function c(e){try{let{searchParams:r}=new URL(e.url),t=parseInt(r.get("service_id")||"13"),a=await (0,p.ox)(t),s=await u.default.setting.findUnique({where:{key:"otp_markup"}}),o=parseFloat(s?.value||"10");return n.NextResponse.json({countries:a,markup:o})}catch(e){return console.error("[OTP COUNTRIES]",e),n.NextResponse.json({error:"Gagal memuat daftar negara"},{status:500})}}let l=new s.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/otp/countries/route",pathname:"/api/otp/countries",filename:"route",bundlePath:"app/api/otp/countries/route"},resolvedPagePath:"C:\\Users\\akmal\\OneDrive\\Documents\\AmaneNime Topup\\amanenime-topup\\app\\api\\otp\\countries\\route.ts",nextConfigOutput:"standalone",userland:a}),{requestAsyncStorage:m,staticGenerationAsyncStorage:v,serverHooks:x}=l,_="/api/otp/countries/route";function h(){return(0,i.patchFetch)({serverHooks:x,staticGenerationAsyncStorage:v})}},72331:(e,r,t)=>{t.r(r),t.d(r,{default:()=>o,prisma:()=>s});var a=t(53524);let s=globalThis.prisma??new a.PrismaClient({datasources:{db:{url:(()=>{if(process.env.DATABASE_URL)return process.env.DATABASE_URL;let e=process.env.DB_USER||"root",r=process.env.DB_PASSWORD||"",t=process.env.DB_HOST||"127.0.0.1",a=process.env.DB_PORT||"3306",s=process.env.DB_NAME||"amanenime_topup";return`mysql://${e}:${r}@${t}:${a}/${s}`})()}},log:["error"]}),o=s},59833:(e,r,t)=>{t.d(r,{Ei:()=>d,Ip:()=>u,TL:()=>l,ox:()=>n,q2:()=>c,vU:()=>p});var a=t(63759);let s=process.env.RUMAHOTP_BASE_URL||"https://www.rumahotp.io/api",o=process.env.RUMAHOTP_API_KEY,i=a.Z.create({baseURL:s,headers:{"x-apikey":o,accept:"application/json"},timeout:15e3});async function n(e){let r=await i.get("/v2/countries",{params:{service_id:e}});return r.data?.data||r.data||[]}async function p(e,r){let t=await i.get("/v2/operators",{params:{country:e,provider_id:r}});return t.data?.data||t.data||[]}async function u(e,r,t){try{let a=await i.get("/v2/orders",{params:{number_id:e,provider_id:r,operator_id:t}});if(!a.data?.result&&!a.data?.id)throw Error(JSON.stringify(a.data));return a.data?.data||a.data}catch(e){if(e.response?.data)throw Error(JSON.stringify(e.response.data));throw e}}async function d(e){let r=await i.get("/v1/orders/get_status",{params:{order_id:e}});return r.data?.data||r.data}async function c(e,r){return(await i.get("/v1/orders/set_status",{params:{order_id:e,status:r}})).data}function l(e,r){return Math.ceil(e*(1+r/100))}}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),a=r.X(0,[8948,5972,3759],()=>t(5454));module.exports=a})();