PageSourceSearch

https://abstour.by/build/assets/partner_registration-CYV9t1EG.js

js abstour.by collected 2026-10-02 20:15:04 UTC 5,447 bytes, 1 lines download raw bytes

1import{b as q}from"./app-DdIkYXVQ.js";import"./module.esm-S4M4TpEG.js";const f=document.querySelector("#add-pr-btn"),E=document.querySelector("#partner-registration-form"),x=["pr-name-input","pr-legal-name-input","pr-representative-name-input","pr-login-input","pr-password-input","pr-director-name-input","pr-legal-ddress-input","pr-country-input","pr-city-input","pr-index-input","pr-address-input","pr-city-code-input","pr-phone-input","pr-email-input","pr-inn-input","pr-kpp-input","pr-taxation-system-input","pr-rs-input","pr-ks-input","pr-bank-input","pr-bik-input"],g=document.querySelector("#reviews-agreement-input"),h="border-secondary",I="text-secondary text-14 mt-1";function y(e){const t=document.querySelector(`#${e}`);return t?t.value!==void 0?t:document.querySelector(`#${e}-input`)||t:null}function L(e){if(e.getAttribute("placeholder"))return e.getAttribute("placeholder");const t=e.closest("[x-data]");return t?t.querySelector("button span:first-of-type")?.textContent||e.id:e.getAttribute("aria-label")||e.id}function T(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function b(e){if(!e)return!0;const t=e.type==="hidden"&&e.closest("[x-data]"),o=e.id==="pr-email-input",i=e.value,a=i!=null?String(i).trim():"",r="error-for-"+e.id;let d=e;if(t&&(d=e.closest("[x-data]").querySelector("button"),!d))return!0;let n="";!a||t&&a==="0"?n=`* ${L(e)}`:o&&!T(a)&&(n="* Неверный формат E-mail");let s=document.getElementById(r);const c=t?e.closest("[x-data]"):e;return n?(d.classList.add(h),s||(s=document.createElement("p"),s.id=r,s.classList.add("error-message",...I.split(" ")),c&&c.parentNode&&c.parentNode.insertBefore(s,c.nextSibling)),s.textContent=n,!1):(d.classList.remove(h),s&&s.remove(),!0)}x.forEach(e=>{const t=document.querySelector(`#${e}`),o=y(e);if(!o)return;(t&&t!==o?t:o).addEventListener("blur",()=>{b(o)}),o.id==="pr-email-input"&&o.addEventListener("input",()=>{b(o)}),o.type==="hidden"&&o.closest("[x-data]")&&o.addEventListener("selection-changed",()=>{b(o)})});f&&f.addEventListener("click",async()=>{let e=!0,t=null;x.forEach(n=>{const s=y(n);s&&!b(s)&&(e=!1,t||(t=s))});const o="agreement-error-message";let i=document.getElementById(o);const a=document.querySelector("#reviews-agreement-input-checkbox")||g.closest(".flex.gap-\\[10px\\]");if(g.checked?i&&i.remove():(e=!1,i||(i=document.createElement("p"),i.id=o,i.classList.add("error-message",...I.split(" ")),a&&a.parentNode&&a.parentNode.insertBefore(i,a.nextSibling)),i.textContent="* Необходимо принять соглашение.",t||(t=g)),!e){if(toastr.error("Пожалуйста, заполните все обязательные поля и примите соглашение.","Ошибка валидации"),t){let n=t;t.type==="hidden"&&t.closest("[x-data]")?n=t.closest("[x-data]"):t.type==="checkbox"&&(n=a),n&&(n.scrollIntoView({behavior:"smooth",block:"center"}),t.type!=="hidden"&&t.type!=="checkbox"&&t.focus())}return}const r=n=>(y(n)||document.querySelector(`#${n}`))?.value??"",d={company_name:r("pr-name-input"),full_legal_name:r("pr-legal-name-input"),inn:r("pr-inn-input"),kpp:r("pr-kpp-input"),contact_person:r("pr-representative-name-input"),email:r("pr-email-input"),phone_code:r("pr-city-code-input"),phone:r("pr-phone-input"),fax:r("pr-fax-input"),login:r("pr-login-input"),password:r("pr-password-input"),leader_name:r("pr-director-name-input"),leader_position:r("pr-director-post-input"),legal_address:r("pr-legal-ddress-input"),country_id:r("pr-country-input"),city_id:r("pr-city-input"),postal_code:r("pr-index-input"),actual_address:r("pr-address-input"),tax_system:r("pr-taxation-system-input"),bank_account:r("pr-rs-input"),correspondent_account:r("pr-ks-input"),bank_name:r("pr-bank-input"),bik:r("pr-bik-input"),agreement:g?.checked??!1};f.disabled=!0,f.textContent="Отправка...";try{const n=document.querySelector('meta[name="csrf-token"]')?.getAttribute("content"),s={"Content-Type":"application/json",Accept:"application/json",...n&&{"X-CSRF-TOKEN":n}},c=q();c&&(s.Authorization=`Bearer ${c}`);const v=await fetch("/api/partner-registration-proxy",{method:"POST",headers:s,body:JSON.stringify(d)}),p=await v.json().catch(()=>({}));if(v.ok&&p.success){if(toastr.success(p.message||"Регистрация отправлена на сайт online.abstour.by. Проверьте почту и личный кабинет."),E){E.reset(),window.dispatchEvent(new CustomEvent("reset-form")),x.forEach(k=>
1{const l=y(k),w="error-for-"+(l?.id??k),S=document.getElementById(w);if(S&&S.remove(),l&&l.type==="hidden"&&l.closest("[x-data]")){const _=l.closest("[x-data]").querySelector("button");_&&_.classList.remove(h)}else l&&l.classList.remove(h)});let u=document.getElementById("agreement-error-message");u&&u.remove()}}else{console.error("Server error response:",p);let m=p.message;if(!m&&p.errors){const u=p.errors;m=typeof u=="string"?u:Object.values(u).flat().join(" ")||"Ошибка валидации."}toastr.error(m||"Не удалось отправить данные. Попробуйте позже или зарегистрируйтесь на online.abstour.by.","Ошибка"),p.external_form_url&&toastr.info("Можно зарегистрироваться напрямую на сайте online.abstour.by.","",{timeOut:8e3})}}catch(n){console.error("Network or parsing error:",n)}finally{f.disabled=!1,f.textContent="Зарегистрироваться"}});

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.