1const h=document.querySelector('meta[name="csrf-token"]')?.getAttribute("content"),B={"Content-Type":"application/json",Accept:"application/json",...h&&{"X-CSRF-TOKEN":h}},C="https://getapp.o-plati.by/map/?app_link=",k="https://api.qrserver.com/v1/create-qr-code/?size=196x196&data=",v={2:"покÑпаÑÐµÐ»Ñ Ð½Ðµ подÑвеÑдил плаÑеж",3:"недоÑÑаÑоÑно ÑÑедÑÑв на коÑелÑке покÑпаÑелÑ",4:"покÑпаÑÐµÐ»Ñ Ð½Ðµ подÑвеÑдил плаÑеж в ÑеÑение пÑедопÑеделенного оÑÑезка вÑемени",5:"ÑеÑ
ниÑеÑÐºÐ°Ñ Ð¾Ñмена"};function w(){return typeof navigator.userAgentData<"u"&&navigator.userAgentData.mobile!==void 0?navigator.userAgentData.mobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i.test(navigator.userAgent)}let u=0,p="";function g(e){document.getElementById("oplati-step1").classList.toggle("hidden",e!==1),document.getElementById("oplati-step2").classList.toggle("hidden",e!==2),document.getElementById("oplati-step3").classList.toggle("hidden",e!==3)}function f(e){["oplati-panel-default","oplati-panel-success","oplati-panel-danger"].forEach(n=>{const t=document.getElementById(n);t&&t.classList.add("hidden")});const o=document.getElementById("oplati-panel-"+e);o&&o.classList.remove("hidden")}const l=document.getElementById("oplati-btn");l&&l.addEventListener("click",async()=>{const e=document.getElementById("oplati-input"),o=(e?.value||"").trim();if(!o){toastr.error("ÐнеÑиÑе Ð½Ð¾Ð¼ÐµÑ Ð´Ð¾Ð³Ð¾Ð²Ð¾Ñа!"),e?.focus();return}l.disabled=!0,l.textContent="ÐагÑÑзка...";try{const n=await fetch(`/api/oplati/dogovor/${encodeURIComponent(o)}`,{method:"GET",headers:B}),t=await n.json();if(!n.ok){toastr.error(t.error||"ÐÐ¾Ð³Ð¾Ð²Ð¾Ñ Ð½Ðµ найден");return}p=t.dogovor_code||o;const i=Object.keys(t.total_price||{})[0]||"BYN";document.getElementById("oplati-dogovor-code").textContent="#"+(t.dogovor_code||o),document.getElementById("oplati-tour-date").textContent=t.tour_date||"â",document.getElementById("oplati-turist").textContent=t.turist||"â",document.getElementById("oplati-phone").textContent=t.phone||"â",document.getElementById("oplati-total-price").textContent=t.total_price&&t.total_price[i]?`${t.total_price[i]} ${i}`:"â",document.getElementById("oplati-paid-sum").textContent=t.paid_sum&&t.paid_sum[i]?`${t.paid_sum[i]} ${i}`:"â";const a=Number(t.toPayByn)||0,c=document.getElementById("oplati-range"),r=document.getElementById("oplati-sum-input"),I=document.getElementById("oplati-sum-label");c&&r&&I&&(c.min=0,c.max=a,c.value=a,r.min=0,r.max=a,r.step=.01,r.value=a,I.textContent=a.toFixed(2),typeof window.updateRangeStyle=="function"&&window.updateRangeStyle(c)),g(2)}catch(n){console.error(n),toastr.error("ÐÑибка пÑи загÑÑзке даннÑÑ
")}finally{l.disabled=!1,l.textContent="ÐалÑÑе"}});const d=document.getElementById("oplati-range"),m=document.getElementById("oplati-sum-input"),y=document.getElementById("oplati-sum-label");if(d&&m&&y){let e=function(){const n=parseFloat(d.value);m.value=isNaN(n)?d.max:n.toFixed(2),y.textContent=(parseFloat(d.value)||0).toFixed(2),typeof window.updateRangeStyle=="function"&&window.updateRangeStyle(d)},o=function(){let n=parseFloat(m.value);const t=parseFloat(d.max)||0,i=parseFloat(d.min)||0;isNaN(n)&&(n=t),n=Math.max(i,Math.min(t,n)),m.value=n.toFixed(2),d.value=n,y.textContent=n.toFixed(2)};var L=e,_=o;d.addEventListener("input",e),m.addEventListener("input",o)}const s=document.getElementById("oplati-get-qr-btn");s&&s.addEventListener("click",async()=>{const e=parseFloat(document.getElementById("oplati-sum-input")?.value)||0;if(e<.01){toastr.error("УкажиÑе ÑÑÐ¼Ð¼Ñ Ðº оплаÑе");return}s.disabled=!0,s.textContent="ÐагÑÑзка...";try{const o=await fetch("/api/oplati/init-payment",{method:"POST",headers:B,body:JSON.stringify({dogovor_code:p,sum:e})}),n=await o.json();if(!o.ok){toastr.error(n.error||"ÐÑибка иниÑиализаÑии плаÑежа");return}u=n.id;const t=C+encodeURIComponent(n.qr||"");document.getElementById("oplati-qr-dogovor").textContent=p,document.getElementById("oplati-qr-sum").textContent=e.toFixed(2),g(3),f("default"),document.getElementById("oplati-qr-expired").classList.add("hidden");const i=document.getElementById("oplati-qr-code");if(i.innerHTML="",w()){const a=document.getElementById("oplati-applink");a&&(a.href=t,a.click())}else{const a=document.createElement("img");a.alt="QR Ð´Ð»Ñ Ð¾Ð¿Ð»Ð°ÑÑ",a.src=k+encodeURIComponent(t),i.appendChild(a)}setTimeout(E,5e3)}catch(o){console.error(o),toastr.error("ÐÑибка пÑи Ñоздании плаÑежа")}finally{s.disabled=!1,s.textContent="ÐалÑÑе"}});function E(){u<=0||fetch("/api/oplati/check-payment",{method:"POST",headers:B,body:JSON.stringify({payment_id:u,dogovor_code:p})}).then(e=>e.json()).then(e=>{const o=e.status??5;switch(o){case 0:setTimeout(E,3e3);break;case 1:f("success"),setTimeout(()=>{document.getElementById("oplati-btn").click()},5e3);break;default:document.getElementById("oplati-error-reason").textContent=v[o]||v[5],f("danger")}}).catch(()=>{setTimeout(E,3e3)})}const x=document.getElementById("oplati-back-btn");x&&x.addEventListener("click",()=>{document.getElementById("oplati-step3")&&!document.getElementById("oplati-step3").classList.contains("hidden")?(u=0,g(2)):g(1)});const b=new URLSearchParams(window.location.search);if(b.has("dogovor")){const e=document.getElementById("oplati-input");e&&(e.value=b.get("dogovor"),setTimeout(()=>document.getElementById("oplati-btn")?.click(),300))}
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.