ccu-ads
Version:
CCU Ads sdk js
1 lines • 30.3 kB
JavaScript
(()=>{"use strict";var s={353:(s,t,e)=>{e.d(t,{Z:()=>n});var a=e(645),d=e.n(a)()((function(s){return s[1]}));d.push([s.id,".ccu-ads div{display:flex;box-sizing:border-box;flex-direction:column;position:relative;justify-content:center;align-items:center}.ccu-ads button{border:none;background:none}.ccu-ads img,.ccu-ads video{max-width:100%;height:auto}.ccu-ads .ads-style-absolute{position:absolute}.ccu-ads .ads-style-fixed{position:fixed;top:0;left:0}.ccu-ads .ads-style-flex{display:flex}.ccu-ads .ads-style-hidden{display:none}.ccu-ads .ads-style-flex-1{flex:1}.ccu-ads .ads-style-flex-row{flex-direction:row}.ccu-ads .ads-style-flex-col{flex-direction:column}.ccu-ads .ads-style-items-start{align-items:flex-start}.ccu-ads .ads-style-items-center{align-items:center}.ccu-ads .ads-style-items-end{align-items:flex-end}.ccu-ads .ads-style-justify-start{justify-content:flex-start}.ccu-ads .ads-style-justify-center{justify-content:center}.ccu-ads .ads-style-justify-end{justify-content:flex-end}.ccu-ads .ads-style-justify-between{justify-content:space-between}.ccu-ads .ads-style-w-full{width:100%}.ccu-ads .ads-style-h-full{height:100%}.ccu-ads .ads-style-h-20{height:80px}.ccu-ads .ads-style-w-90{width:90%}.ccu-ads .ads-style-w-10{width:40px}.ccu-ads .ads-style-w-80{width:80%}.ccu-ads .ads-style-max-w-7xl{max-width:1360px}.ccu-ads .ads-style-max-w-xl{max-width:576px}.ccu-ads .ads-style-ml-1{margin-left:16px}.ccu-ads .ads-style-ml-2{margin-left:16px}.ccu-ads .ads-style-mr-1{margin-right:16px}.ccu-ads .ads-style-mr-2{margin-right:32px}.ccu-ads .ads-style-mt-1{margin-top:16px}.ccu-ads .ads-style-mt-2{margin-top:32px}.ccu-ads .ads-style-mb-1{margin-bottom:16px}.ccu-ads .ads-style-mb-2{margin-bottom:32px}.ccu-ads .ads-style-p-1{padding:16px}.ccu-ads .ads-style-p-2{padding:32px}.ccu-ads .ads-style-py-1{padding-top:16px;padding-bottom:16px}.ccu-ads .ads-style-px-1{padding-left:16px;padding-right:16px}.ccu-ads .ads-style-pt-0{padding-top:0}.ccu-ads .ads-style-font-bold{font-weight:700}.ccu-ads .ads-style-font-xs{font-size:11.2px}.ccu-ads .ads-style-font-sm{font-size:12.8px}.ccu-ads .ads-style-font-base{font-size:16px}.ccu-ads .ads-style-font-lg{font-size:19.2px}.ccu-ads .ads-style-font-xl{font-size:24px}.ccu-ads .ads-style-font-2xl{font-size:38px}.ccu-ads .ads-style-italic{font-style:italic}.ccu-ads .ads-style-underline{text-decoration:underline}.ccu-ads .ads-style-text-center{text-align:center}.ccu-ads .ads-style-spacing{letter-spacing:.1rem}.ccu-ads .ads-style-text-gray{color:#799499}.ccu-ads .ads-style-text-white{color:#fff}.ccu-ads .ads-style-uppercase{text-transform:uppercase}.ccu-ads .ads-style-bg-black{background-color:#000}.ccu-ads .ads-style-bg-white{background-color:#fff}.ccu-ads .ads-style-bg-light-blue{background-color:#1f9bf4}.ccu-ads .ads-style-bg-blue{background-color:#003359}.ccu-ads .ads-style-bg-green{background-color:#06de9e}.ccu-ads .ads-style-bg-gray{background-color:#d2dcd6 !important}.ccu-ads .ads-style-cursor-pointer{cursor:pointer}.ccu-ads svg{position:absolute;top:2;left:2;width:40px;height:40px;transform:rotateY(-180deg) rotateZ(-90deg)}.ccu-ads circle{stroke-dasharray:113px;stroke-dashoffset:0px;stroke-linecap:round;stroke-width:3px;stroke:#06de9e;fill:none;animation-timing-function:linear;animation-fill-mode:forwards}@keyframes countdown{from{stroke-dashoffset:0px}to{stroke-dashoffset:113px}}",""]);const n=d},645:s=>{s.exports=function(s){var t=[];return t.toString=function(){return this.map((function(t){var e=s(t);return t[2]?"@media ".concat(t[2]," {").concat(e,"}"):e})).join("")},t.i=function(s,e,a){"string"==typeof s&&(s=[[null,s,""]]);var d={};if(a)for(var n=0;n<this.length;n++){var l=this[n][0];null!=l&&(d[l]=!0)}for(var i=0;i<s.length;i++){var c=[].concat(s[i]);a&&d[c[0]]||(e&&(c[2]?c[2]="".concat(e," and ").concat(c[2]):c[2]=e),t.push(c))}},t}},379:s=>{var t=[];function e(s){for(var e=-1,a=0;a<t.length;a++)if(t[a].identifier===s){e=a;break}return e}function a(s,a){for(var n={},l=[],i=0;i<s.length;i++){var c=s[i],o=a.base?c[0]+a.base:c[0],r=n[o]||0,y="".concat(o," ").concat(r);n[o]=r+1;var u=e(y),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==u)t[u].references++,t[u].updater(p);else{var m=d(p,a);a.byIndex=i,t.splice(i,0,{identifier:y,updater:m,references:1})}l.push(y)}return l}function d(s,t){var e=t.domAPI(t);return e.update(s),function(t){if(t){if(t.css===s.css&&t.media===s.media&&t.sourceMap===s.sourceMap&&t.supports===s.supports&&t.layer===s.layer)return;e.update(s=t)}else e.remove()}}s.exports=function(s,d){var n=a(s=s||[],d=d||{});return function(s){s=s||[];for(var l=0;l<n.length;l++){var i=e(n[l]);t[i].references--}for(var c=a(s,d),o=0;o<n.length;o++){var r=e(n[o]);0===t[r].references&&(t[r].updater(),t.splice(r,1))}n=c}}},569:s=>{var t={};s.exports=function(s,e){var a=function(s){if(void 0===t[s]){var e=document.querySelector(s);if(window.HTMLIFrameElement&&e instanceof window.HTMLIFrameElement)try{e=e.contentDocument.head}catch(s){e=null}t[s]=e}return t[s]}(s);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}},216:s=>{s.exports=function(s){var t=document.createElement("style");return s.setAttributes(t,s.attributes),s.insert(t,s.options),t}},565:(s,t,e)=>{s.exports=function(s){var t=e.nc;t&&s.setAttribute("nonce",t)}},795:s=>{s.exports=function(s){var t=s.insertStyleElement(s);return{update:function(e){!function(s,t,e){var a="";e.supports&&(a+="@supports (".concat(e.supports,") {")),e.media&&(a+="@media ".concat(e.media," {"));var d=void 0!==e.layer;d&&(a+="@layer".concat(e.layer.length>0?" ".concat(e.layer):""," {")),a+=e.css,d&&(a+="}"),e.media&&(a+="}"),e.supports&&(a+="}");var n=e.sourceMap;n&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(n))))," */")),t.styleTagTransform(a,s,t.options)}(t,s,e)},remove:function(){!function(s){if(null===s.parentNode)return!1;s.parentNode.removeChild(s)}(t)}}}},589:s=>{s.exports=function(s,t){if(t.styleSheet)t.styleSheet.cssText=s;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(s))}}}},t={};function e(a){var d=t[a];if(void 0!==d)return d.exports;var n=t[a]={id:a,exports:{}};return s[a](n,n.exports,e),n.exports}e.n=s=>{var t=s&&s.__esModule?()=>s.default:()=>s;return e.d(t,{a:t}),t},e.d=(s,t)=>{for(var a in t)e.o(t,a)&&!e.o(s,a)&&Object.defineProperty(s,a,{enumerable:!0,get:t[a]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(s){if("object"==typeof window)return window}}(),e.o=(s,t)=>Object.prototype.hasOwnProperty.call(s,t),(()=>{const s=async(s,t,e=null)=>{let a={"Content-Type":"application/json","ads-api-key":window.ads_api_key};try{const d=await fetch(`https://api.bysato.com/ads/${s}`,{method:"POST",body:JSON.stringify(t),headers:a}),n=await d.json();return null==n||n.error?e:n}catch(s){return console.log(`API ERROR: ${s.message}`),e}},t=()=>navigator.userAgent.match("Android"),a=()=>navigator.userAgent.match("iPad")||navigator.userAgent.match("iPhone")||navigator.userAgent.match("iPod"),d=()=>!!((t()||a())&&window.innerWidth<1100),n=(s,t=8,e=".",a=",")=>{isNaN(s)&&(s=0),s>=1&&s%1==0&&(t=0),0==s&&(t=0);const d=s<0?"-":"";let n=parseInt(s=Math.abs(Number(s)||0).toFixed(t)).toString(),l=n.length>3?n.length%3:0;return d+(l?n.substr(0,l)+a:"")+n.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+a)+(t?e+Math.abs(s-n).toFixed(t).slice(2):"")};var l=e(379),i=e.n(l),c=e(795),o=e.n(c),r=e(569),y=e.n(r),u=e(565),p=e.n(u),m=e(216),f=e.n(m),x=e(589),h=e.n(x),g=e(353),b={};b.styleTagTransform=h(),b.setAttributes=p(),b.insert=y().bind(null,"head"),b.domAPI=o(),b.insertStyleElement=f(),i()(g.Z,b),g.Z&&g.Z.locals&&g.Z.locals;class w{constructor({id:s,amount:t=0,action:e}){this.id=s,this.amount=t,this.action=e}show(){let s=document.querySelector("#ccu-ads-withdrawal-dialog");s&&document.body.removeChild(s);let t=`btcwallet://?action=adreward¶ms=${encodeURIComponent(JSON.stringify({withdrawalId:this.id}))}`;const e=document.createElement("div");e.classList.add("ccu-ads"),e.id="ccu-ads-withdrawal-dialog",e.innerHTML=`\n <div class='ads-style-fixed ads-style-w-full ads-style-h-full ads-style-items-center ads-style-justify-center' style='z-index: 999999; background-color: rgba(120, 148, 155, 0.9);'>\n <div class='ads-style-items-end' style='width: 300px;'>\n <button onclick='document.body.removeChild(document.getElementById("ccu-ads-withdrawal-dialog"));' style='background: none; border: none;'><img src='https://ccu-public.s3.us-east-2.amazonaws.com/ads-sdk-assets/close.svg' style='width: 32px; ' /></button>\n </div>\n <div class='ads-style-mt-1' style='max-width: 300px;'>\n <div class='ads-style-w-full ads-style-p-2 ads-style-bg-white ads-style-items-center' style='border-radius: 16px;'>\n <div class='ads-style-absolute' style='top: -40px; background-color: #003359; padding: 8px; border-radius: 5px;'>\n <img src='https://ccu-public.s3.us-east-2.amazonaws.com/ads-sdk-assets/rewards.svg' style='width: 50px;' />\n </div>\n <span class='ads-style-font-sm ads-style-text-gray ads-style-mt-1 ads-style-uppercase' style='color: #003359;'>Congratulations</span>\n <span class='ads-style-font-lg ads-style-text-gray ads-style-font-bold ads-style-uppercase' style='color: #003359;'>you have earned</span>\n <div class='ads-style-w-full ads-style-flex-row ads-style-justify-center ads-style-mt-1'>\n <span class='ads-style-font-bold ads-style-font-2xl' style='color: #003359; line-height: 1;'>${n(this.amount,0)}</span>\n </div>\n <div class='ads-style-w-full ads-style-flex-row'>\n <span class='ads-style-font-sm ads-style-uppercase'>satoshis</span>\n <img src='https://ccu-public.s3.us-east-2.amazonaws.com/ads-sdk-assets/questionMark.svg' id='question-mark-button' class='ads-style-cursor-pointer' style='width: 15px; margin-left: 8px;' />\n </div>\n <div id="ccu-ads-withdrawal-dialog-action" class='ads-style-w-full' ></div>\n <span class='ads-style-font-xs ads-style-mt-1 ads-style-text-center' style='color: #859ea5;'><b>SATO is the Bitcoin wallet by bysato.com,</b> a public blockchain company listed on the TSX.V</span>\n </div>\n </div>\n <div class='ads-style-w-full ads-style-p-2 ads-style-pt-0' style='max-width: 300px;'>\n <span class='ads-style-text-sm ads-style-text-white ads-style-italic ads-style-mt-1 ads-style-text-center'>Don't have SATO?</span>\n <div class='ads-style-w-full ads-style-flex-row' style='margin-top: 8px;'>\n <div onclick="window.open('https://apps.apple.com/us/app/btcwallet-by-sato/id1608434283')" class='ads-style-flex-1' style='padding-right: 4px;'>\n <img src='https://ccu-public.s3.us-east-2.amazonaws.com/ads-sdk-assets/appStore.svg' alt='' />\n </div>\n <div onclick="window.open('https://play.google.com/store/apps/details?id=com.ccu.btcwallet')" class='ads-style-flex-1' style='padding-left: 4px;'>\n <img src='https://ccu-public.s3.us-east-2.amazonaws.com/ads-sdk-assets/playStore.svg' alt='' />\n </div>\n </div>\n </div>\n </div>\n `,document.body.append(e),d()?document.getElementById("ccu-ads-withdrawal-dialog-action").innerHTML=`\n <button onclick='window.open("${t}")' class='ads-style-bg-green ads-style-mt-1 ads-style-w-full' style='padding: 10px 16px; border-radius: 8px;'><span class='ads-style-text-sm ads-style-text-white ads-style-uppercase ads-style-spacing ads-style-font-bold'>Claim in SATO</span></button>\n `:document.getElementById("ccu-ads-withdrawal-dialog-action").innerHTML=`\n <span class='ads-style-font-sm ads-style-text-gray ads-style-italic ads-style-text-center ads-style-mt-2'>Scan this QR with SATO app to claim the withdrawal.</span>\n <div class='ads-style-w-full'>\n <img src='https://chart.googleapis.com/chart?cht=qr&chl=${encodeURIComponent(t)}&chs=250x250&chld=L|0' />\n <img class='absolute' src='https://ccu-public.s3.us-east-2.amazonaws.com/ads-sdk-assets/satoLogo.png' style='width: 50px' />\n </div>\n `;const a=document.querySelector("#question-mark-button");a&&a.addEventListener("click",(()=>{const s=document.createElement("div");s.classList.add("ads-style-w-full","ads-style-fixed","ads-style-bg-white","ads-style-items-center"),s.style.top=0,s.style.left=0,s.style.zIndex=9999999,s.style.paddingLeft="16px",s.style.paddingRight="16px",s.style.paddingBottom="16px",s.style.height=window.innerHeight+"px",s.style.overflow="auto",s.style.justifyContent="flex-start",s.innerHTML="\n <div class='ads-style-w-full ads-style-h-20 ads-style-items-center' style='border-bottom:solid 1px #ededed' >\n <div class='ads-style-w-full ads-style-max-w-xl ads-style-items-end ads-style-h-20 ads-style-justify-center'>\n <div id='about-sato-close-button' class='ads-style-w-10 '>\n <img src='https://ccu-public.s3.us-east-2.amazonaws.com/ads-sdk-assets/close_white_mb.svg' class='ads-style-cursor-pointer'/>\n </div>\n </div>\n </div>\n <div class='ads-style-w-full ads-style-p-1 ads-style-max-w-xl'>\n <span class='ads-style-text-2xl ads-style-font-bold'>What are Satoshis?</span>\n <span class='ads-style-text-md ads-style-mt-6'>\n A satoshi is the <b>smallest</b> unit of the bitcoin cryptocurrency, named after its pseudonymous creator, or creators, <b>Satoshi Nakamoto.</b>\n You may have stumbled upon this page hoping to find out how many satoshis are in a bitcoin or the USD value of your satoshis. According to the software rules, each bitcoin can be subdivided into a satoshi to bitcoin ratio of 100 million to 1, meaning:\n </span>\n <span class='ads-style-text-md ads-style-mt-6'>1 satoshi = 0.00000001</span>\n <span class='ads-style-text-md'>or</span>\n <span class='ads-style-text-md ads-style-mt-2'>1 bitcoin = 100,000,000</span>\n <span class='ads-style-text-md ads-style-mt-6'>Of note, you will often find satoshis abbreviated as sats. </span>\n </div>\n <div class='ads-style-w-full ads-style-p-1 ads-style-mt-8 ads-style-rounded-xl ads-style-max-w-xl' style='background-color: #e8f1f5' >\n <div class='ads-style-w-full ads-style-flex-row'>\n <div class='ads-style-flex-1 ads-style-items-start'>\n <span class='ads-style-font-bold' style='color: #79939b' >SATOSHI</span>\n <span class='ads-style-text-xs ads-style-mb-1'>1</span>\n <span class='ads-style-text-xs ads-style-mb-1'>10</span>\n <span class='ads-style-text-xs ads-style-mb-1'>100</span>\n <span class='ads-style-text-xs ads-style-mb-1'>1,000</span>\n <span class='ads-style-text-xs ads-style-mb-1'>10,000</span>\n <span class='ads-style-text-xs ads-style-mb-1'>100,000</span>\n <span class='ads-style-text-xs ads-style-mb-1'>1,000,000</span>\n <span class='ads-style-text-xs ads-style-mb-1'>10,000,000</span>\n <span class='ads-style-text-xs ads-style-mb-1'>100,000,000</span>\n </div>\n <div class='ads-style-flex-1 ads-style-items-start'>\n <span class='ads-style-font-bold' style='color: #79939b' >BITCOIN</span>\n <span class='ads-style-text-xs ads-style-mb-1'>0.00000001</span>\n <span class='ads-style-text-xs ads-style-mb-1'>0.00000010</span>\n <span class='ads-style-text-xs ads-style-mb-1'>0.00000100</span>\n <span class='ads-style-text-xs ads-style-mb-1'>0.00001000</span>\n <span class='ads-style-text-xs ads-style-mb-1'>0.00010000</span>\n <span class='ads-style-text-xs ads-style-mb-1'>0.00100000</span>\n <span class='ads-style-text-xs ads-style-mb-1'>0.01000000</span>\n <span class='ads-style-text-xs ads-style-mb-1'>0.10000000</span>\n <span class='ads-style-text-xs ads-style-mb-1'>1.00000000</span>\n </div>\n <div class='ads-style-flex-1 ads-style-items-start'>\n <span class='ads-style-font-bold' style='color: #79939b' >NAME</span>\n <span class='ads-style-text-xs ads-style-mb-1'>Satoshi</span>\n <span class='ads-style-text-xs ads-style-mb-1'>-</span>\n <span class='ads-style-text-xs ads-style-mb-1'>Bit</span>\n <span class='ads-style-text-xs ads-style-mb-1'>-</span>\n <span class='ads-style-text-xs ads-style-mb-1'>-</span>\n <span class='ads-style-text-xs ads-style-mb-1'>1mBTC</span>\n <span class='ads-style-text-xs ads-style-mb-1'>1cBTC</span>\n <span class='ads-style-text-xs ads-style-mb-1'>-</span>\n <span class='ads-style-text-xs ads-style-mb-1'>Bitcoin</span>\n </div>\n </div>\n </div>\n ",e.append(s),document.querySelector("#about-sato-close-button").addEventListener("click",(()=>{s.remove()}))}))}}const v=(s,t,e,a)=>{const l=`https://api.bysato.com/ads/sdk/rewardedVideo/streamClicked.php?token=${encodeURIComponent(a.streamToken)}&action=${encodeURIComponent(t.action)}`;return d()&&s?`\n <div class='ads-style-fixed ads-style-w-full ads-style-h-full ads-style-items-center ads-style-justify-center ads-style-bg-black' style='z-index: 999999999;'>\n <div class='ads-style-w-full ads-style-h-full ads-style-items-center ads-style-justify-center'>\n <div id='ccu-ads-player-container-id' class='ads-style-w-full ads-style-items-center ads-style-justify-center'>\n \x3c!-- <video id='ccu-ads-player-video-id' /> --\x3e\n </div>\n <div id='ccu-ads-player-banner' class='ads-style-w-full ads-style-items-center ads-style-justify-center ads-style-bg-white' style='flex: 1;'>\n <div class='ads-style-w-full ads-style-h-full ads-style-items-center ads-style-justify-center'>\n <div class='ads-style-w-full ads-style-px-1 ads-style-flex-row ads-style-justify-start' style='height: 3.5rem; border-bottom: 1px solid #799499;'>\n <span class='ads-style-font-sm ads-style-text-white ads-style-text-center ads-style-bg-light-blue' style='padding: 5px 10px; border-radius: 1000px;'><img style='width: 60px;' src='https://ccu-public.s3.us-east-2.amazonaws.com/adsLogoSmallV2.svg'/></span>\n <span class='ads-style-font-xs ads-style-ml-1 ads-style-font-bold'>${e}</span>\n <div id='ccu-ads-close-ad-button-mobile' style='width: 1.5rem; height: 1.5rem; margin-left: auto;'>\n <img class='ads-style-w-full' src='https://ccu-public.s3.us-east-2.amazonaws.com/ads-sdk-assets/close_white_mb.svg'/>\n </div>\n </div>\n <div class='ads-style-w-90 ads-style-h-full ads-style-items-center ads-style-justify-center'>\n <div class='ads-style-mt-2'>\n <img class='${t.logo?"ads-style-mb-2":""}' src='${t.logo}' style='width: ${t.logo?"4rem;":"0;"} height: ${t.logo?"4rem;":"0;"} border-radius: 2.5rem; object-fit: cover;' />\n <span class='${d()?"ads-style-text-center":"ads-style-text-left"} ads-style-font-lg ads-style-font-bold ads-style-italic'>${t.name}</span>\n <span class='ads-style-font-sm ads-style-text-gray'>${e}</span>\n <button onclick='window.open("${l}")' class='ads-style-flex ads-style-mt-1 ads-style-bg-green ads-style-flex-row' style='padding: 0.3rem 1rem; border-radius: 100px;'>\n <span class='ads-style-uppercase ads-style-text-white ads-style-font-xs ads-style-spacing'>Open Link</span>\n <img src='https://ccu-public.s3.us-east-2.amazonaws.com/ads-sdk-assets/open.svg' style='width: 15px; height: 15px; margin-left: 0.5rem;' />\n </button>\n </div>\n </div>\n <div class='ads-style-items-center ads-style-justify-center ads-style-flex-row ads-style-bg-blue ${d()?"ads-style-mb-1":""}' style='height: 2.8rem; border-radius: 1.5rem; padding-right: 0.5rem;'>\n <div>\n <img src='https://ccu-public.s3.us-east-2.amazonaws.com/ads-sdk-assets/bitcoin.svg' style='width: 34px; height: 34px;' />\n <svg><circle id='ccu-countdown' r='18' cx='20' cy='20'></circle></svg>\n </div>\n <span class=' ads-style-font-sm ml-1 ads-style-text-white'><span class='ads-style-font-bold'>${n(t.reward,0)} SATs</span> will be yours in <span id='ccu-ads-player-timer'></span> seconds</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n `:d()?`\n <div class='ads-style-fixed ads-style-w-full ads-style-h-full ads-style-items-center ads-style-justify-center ads-style-bg-black' style='z-index: 999999999;'>\n <div class='ads-style-w-full ads-style-h-full ads-style-items-center ads-style-justify-between'>\n <div id='ccu-ads-player-container-id' class='ads-style-w-full ads-style-flex-1 ads-style-items-center ads-style-justify-center'>\n <div class='ads-style-absolute ads-style-cursor-pointer' id='ccu-ads-close-ad-button' style='width: 1.5rem; height: 1.5rem; top: 1.5rem; right: 1.5rem; z-index: 3;' >\n <img src='https://ccu-public.s3.us-east-2.amazonaws.com/ads-sdk-assets/close_white.svg'/>\n </div>\n \x3c!-- <video id='ccu-ads-player-video-id' /> --\x3e\n </div>\n <div id='ccu-ads-player-banner' class='ads-style-w-full ads-style-max-w-7xl ads-style-items-center ads-style-justify-center ads-style-bg-white' style='height: 125px; padding: 0 1rem'>\n <div class='ads-style-w-full ads-style-h-full ads-style-items-center ads-style-justify-center'>\n <div class='ads-style-flex-row ads-style-justify-start ads-style-w-full'>\n <span class='ads-style-text-white ads-style-text-center ads-style-bg-light-blue' style='padding: 5px 10px; border-radius: 1000px; font-size: 10px; white-space: nowrap;'><img style='width: 60px;' src='https://ccu-public.s3.us-east-2.amazonaws.com/adsLogoSmallV2.svg'/></span>\n <div class='ads-style-items-start ads-style-ml-1'>\n <span class='ads-style-font-xs ads-style-font-bold ads-style-italic'>${t.name}</span>\n <span class='${d()?"ads-style-font-xs":"ads-style-font-sm"} ads-style-text-gray'>${e}</span>\n </div>\n </div>\n <div class='ads-style-items-center ads-style-justify-center ads-style-flex-row ads-style-bg-blue ads-style-mt-1' style='height: 40px; border-radius: 24px; padding-right: 8px;'>\n <div>\n <img src='https://ccu-public.s3.us-east-2.amazonaws.com/ads-sdk-assets/bitcoin.svg' style='width: 40px; height: 40;' />\n <svg><circle id='ccu-countdown' r='18' cx='20' cy='20'></circle></svg>\n </div>\n <span class='${d()?"ads-style-font-xs":"ads-style-font-sm"} ads-style-ml-1 ads-style-text-white'><span class='ads-style-font-bold ads-style-text-white'>${n(t.reward,0)} SATs</span> will be yours in <span id='ccu-ads-player-timer'></span> seconds</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n `:`\n <div class='ads-style-fixed ads-style-w-full ads-style-h-full ads-style-items-center ads-style-justify-center ads-style-bg-black' style='z-index: 999999999;'>\n <div class='ads-style-w-full ads-style-h-full ads-style-items-center ads-style-justify-between'>\n <div id='ccu-ads-player-container-id' class='ads-style-w-full ads-style-flex-1 ads-style-items-center ads-style-justify-center'>\n <div class='ads-style-absolute ads-style-cursor-pointer' id='ccu-ads-close-ad-button' style='width: 1.5rem; height: 1.5rem; top: 1.5rem; right: 1.5rem; z-index: 3;' >\n <img src='https://ccu-public.s3.us-east-2.amazonaws.com/ads-sdk-assets/close_white.svg'/>\n </div>\n \x3c!--<video id='ccu-ads-player-video-id' />--\x3e\n </div>\n <div id='ccu-ads-player-banner' class='ads-style-w-full ads-style-max-w-7xl ads-style-items-center ads-style-justify-center ads-style-bg-white' style='height: 100px; border-radius: 2rem 2rem 0 0; padding: 0 1rem'>\n <div class='ads-style-w-full ads-style-h-full ads-style-items-center ads-style-justify-center ads-style-flex-row ads-style-justify-between'>\n <div class='ads-style-flex-row ads-style-justify-start ads-style-absolute' style='top: -1rem'>\n <span class='${d()?"ads-style-font-xs":"ads-style-font-sm"} ads-style-text-white ads-style-text-center ads-style-bg-light-blue' style='padding: 5px 10px; border-radius: 1000px;'><img style='width: 80px;' src='https://ccu-public.s3.us-east-2.amazonaws.com/adsLogoSmallV2.svg'/></span>\n </div>\n <div class='ads-style-h-full ads-style-items-center ads-style-justify-center ads-style-flex-row'>\n <div class='ads-style-flex-row ads-style-ml-2 ads-style-w-full'>\n <img class='${t.logo?"ads-style-mr-2":""} ${d()?"ads-style-hidden":""}' src='${t.logo}' style='display: ${t.logo?"block":"none"}; width: 4rem; height: 4rem; border-radius: 2.5rem; object-fit: cover;' />\n <div class='ads-style-items-start'>\n <span class='${d()?"ads-style-font-base":"ads-style-font-sm"} ads-style-font-bold ads-style-italic'>${t.name}</span>\n <span class='${d()?"ads-style-font-xs":"ads-style-font-sm"} ads-style-text-gray'>${e}</span>\n </div>\n <button onclick='window.open("${l}")' class='ads-style-items-center ads-style-flex ads-style-ml-1 ads-style-bg-green ads-style-flex-row' style='border: none; padding: 0.3rem 1rem; border-radius: 100px;'>\n <span class='ads-style-uppercase ads-style-text-white ads-style-font-xs ads-style-spacing'>Open Link</span>\n <img src='https://ccu-public.s3.us-east-2.amazonaws.com/ads-sdk-assets/open.svg' style='width: 15px; height: 15px; margin-left: 0.5rem;' />\n </button>\n </div>\n </div>\n <div class='ads-style-items-center ads-style-justify-center ads-style-flex-row ads-style-bg-blue' style='height: 40px; border-radius: 24px; padding-right: 8px;'>\n <div>\n <img src='https://ccu-public.s3.us-east-2.amazonaws.com/ads-sdk-assets/bitcoin.svg' style='width: 40px; height: 40;' />\n <svg><circle id='ccu-countdown' r='18' cx='20' cy='20'></circle></svg>\n </div>\n <span class='${d()?"ads-style-font-xs":"ads-style-font-sm"} ads-style-ml-1 text-white'><span class='ads-style-font-bold'>${n(t.reward,0)} SATs</span> will be yours in <span id='ccu-ads-player-timer'></span> seconds</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n `};e.g.CCUAds=class{constructor(s){window.ads_api_key=s}async requestAndShowAd(){if(!window.ads_api_key)return void console.warn("ADS SDK Error: Api key is not defined, initialize the sdk before requesting an ad");let e=await(async t=>s("sdk/rewardedVideo/request.php",t))({platform:t()?"android":a()?"ios":"desktop"});e&&e.streamToken?this.showAd(e):console.warn("ADS SDK Error: Unable to request an ad. Try again later")}showAd(t){let e=t.streamURL,a=t.media,n=a.template;"PARTIAL_SCREEN"!=n||d()||(n="FULL_SCREEN");let l=a.action;l=l.split("://")[1],l=l.split("?")[0];const i=document.createElement("div");i.classList.add("ccu-ads"),i.id="ccu-ads-player-dialog",document.body.append(i);const c=async()=>{console.warn("ADS SDK Error: Unable to show the ad. Try again later"),document.body.removeChild(i),await(async t=>s("sdk/rewardedVideo/streamError.php",t))({token:t.streamToken})},o=document.createElement("video");o.setAttribute("playsinline",""),o.setAttribute("muted",""),o.setAttribute("autoplay",""),o.style.cssText="object-fit: contain;",o.src=e,o.loop=!1,o.onloadedmetadata=async()=>{let e=window.innerHeight-100;d()?o.videoHeight>o.videoWidth?(e=window.innerHeight-125,i.innerHTML=v(!1,a,l,t),o.style.height=`${e}px`):i.innerHTML=v(!0,a,l,t):(i.innerHTML=v(!0,a,l,t),o.style.height=`${e}px`);const n=document.querySelector("#ccu-ads-close-ad-button")||document.querySelector("#ccu-ads-close-ad-button-mobile");n&&n.addEventListener("click",(()=>{o.pause(),document.body.removeChild(i)})),document.querySelector("#ccu-ads-player-container-id").append(o);let r=await(async t=>s("sdk/rewardedVideo/streamStarted.php",t))({token:t.streamToken});r&&"SUCCESS"==r.serverStatus?(o.play(),document.getElementById("ccu-countdown").style.webkitAnimationName="countdown",document.getElementById("ccu-countdown").style.animationName="countdown",document.getElementById("ccu-countdown").style.webkitAnimationDuration=`${o.duration}s`,document.getElementById("ccu-countdown").style.animationDuration=`${o.duration}s`):c()},o.ontimeupdate=()=>{const s=document.getElementById("ccu-ads-player-timer");s&&(s.innerHTML=Math.ceil(o.duration-o.currentTime))},o.onended=async e=>{if(e&&e.isTrusted){document.body.removeChild(i);let e=await(async t=>s("sdk/rewardedVideo/streamEnded.php",t))({token:t.streamToken});e&&"SUCCESS"==e.serverStatus&&e.pendingWithdrawal?new w({id:e.pendingWithdrawal.id,amount:e.pendingWithdrawal.amount,action:`https://api.bysato.com/ads/sdk/rewardedVideo/streamClicked.php?token=${encodeURIComponent(t.streamToken)}&action=${encodeURIComponent(t.action)}`}).show():console.warn("ADS SDK Error: Unable to get reward")}},o.onerror=()=>{c()}}}})()})();