PageSourceSearch

https://anyserv.eu/_astro/VATCalculator.astro_astro_type_script_index_0_lang.DEDrQjz1.js

js anyserv.eu collected 2026-10-02 01:02:04 UTC 12,446 bytes, 1 lines download raw bytes

1function c(){return(document.documentElement.lang||"en").split("-")[0]}function l(){const o=window.TOOL_TRANSLATIONS;if(!o)return{};const t=c();return o[t]||o.en}function d(){return{en:"en-US",pl:"pl-PL",de:"de-DE",fr:"fr-FR",es:"es-ES"}[c()]||"en-US"}function b(){return{pl:"PL",de:"DE",fr:"FR",es:"ES",en:"US"}[c()]||"US"}function y(){const o=document.querySelector(".vat-calculator");if(!o)return;const t=l(),e=o.querySelector("#tax-results");o.querySelectorAll("[data-i18n]").forEach(a=>{if(e&&e.contains(a))return;const n=a.getAttribute("data-i18n");n&&t[n]!=null&&(a.textContent=t[n])}),o.querySelectorAll("[data-placeholder-i18n]").forEach(a=>{const n=a.getAttribute("data-placeholder-i18n");n&&t[n]!=null&&a.setAttribute("placeholder",String(t[n]))})}window.TOOL_TRANSLATIONS={en:{mode_section_label:"Amount type",tooltip_mode:"Choose net if your amount excludes tax, or gross if tax is already included.",mode_add:"Amount is Net (Add Tax)",mode_remove:"Amount is Gross (Extract Tax)",label_country:"Region / Country",tooltip_country:"Jurisdiction for an indicative default rate. Override the percentage if your transaction uses a different rate.",label_currency:"Currency",tooltip_currency:"Currency used to format amounts. It should match how you pay or invoice.",label_amount:"Amount",tooltip_amount:"Net mode: amount before tax. Gross mode: total including tax.",ph_amount:"e.g. 100.00",ph_rate:"e.g. 23",label_rate_unit:"%",tooltip_rate:"Percentage applied in this calculation. Updates when you change country unless you edit manually.",label_net:"Net Price",label_gross:"Gross Price",label_tax_amount:"Tax Amount",tax_rates_disclaimer:"Default rates are indicative. Always verify current rates with your local tax authority before filing.",error_amount_exceeds_limit:"Amount cannot exceed 1 billion (1,000,000,000)."},pl:{mode_section_label:"Rodzaj kwoty",tooltip_mode:"Wybierz netto, jeśli kwota jest bez podatku, lub brutto, jeśli podatek jest już w kwocie.",mode_add:"Kwota netto (Dodaj podatek)",mode_remove:"Kwota brutto (Wylicz podatek)",label_country:"Region / Kraj",tooltip_country:"Jurysdykcja dla orientacyjnej stawki domyślnej. Zmień procent, jeśli w Twoim przypadku obowiązuje inna stawka.",label_currency:"Waluta",tooltip_currency:"Waluta formatowania kwot - zwykle zgodna z płatnością lub fakturą.",label_amount:"Kwota",tooltip_amount:"Tryb netto: kwota przed podatkiem. Tryb brutto: kwota z podatkiem.",ph_amount:"np. 100,00",ph_rate:"np. 23",label_rate_unit:"%",tooltip_rate:"Procent podatku w tym obliczeniu. Aktualizuje się przy zmianie kraju, chyba że edytujesz ręcznie.",label_net:"Cena Netto",label_gross:"Cena Brutto",label_tax_amount:"Kwota Podatku",tax_rates_disclaimer:"Domyślne stawki mają charakter orientacyjny. Przed rozliczeniem zweryfikuj aktualne stawki u właściwego organu.",error_amount_exceeds_limit:"Kwota nie może przekraczać 1 miliarda (1 000 000 000)."},de:{mode_section_label:"Betragsart",tooltip_mode:"Netto wählen, wenn der Betrag ohne Steuer ist, oder Brutto, wenn die Steuer bereits enthalten ist.",mode_add:"Nettobetrag (Steuer hinzufügen)",mode_remove:"Bruttobetrag (Steuer abziehen)",label_country:"Region / Land",tooltip_country:"Zuständigkeit für einen indikativen Standardsatz. Passen Sie den Prozentsatz an, falls Ihr Fall abweicht.",label_currency:"Währung",tooltip_currency:"Währung zur Formatierung - in der Regel wie gezahlt oder in Rechnung gestellt.",label_amount:"Betrag",tooltip_amount:"Netto-Modus: Betrag vor Steuer. Brutto-Modus: Gesamtbetrag inklusive Steuer.",ph_amount:"z. B. 100,00",ph_rate:"z. B. 23",label_rate_unit:"%",tooltip_rate:"Steuersatz für diese Berechnung. Wird bei Länderwechsel aktualisiert, sofern nicht manuell geändert.",label_net:"Nettopreis",label_gross:"Bruttopreis",label_tax_amount:"Steuerbetrag",tax_rates_disclaimer:"Standardwerte sind unverbindlich. Vor Abgaben immer aktuelle Sätze bei der zuständigen Stelle prüfen.",error_amount_exceeds_limit:"Der Betrag darf 1 Milliarde (1.000.000.000) nicht überschreiten."},fr:{mode_section_label:"Type de montant",tooltip_mode:"Choisissez net si le montant est hors taxes, ou brut si la taxe est déjà incluse.",mode_add:"Montant net (ajouter la taxe)",mode_remove:"Montant brut (extraire la taxe)",label_country:"Région / Pays",tooltip_country:"Juridiction pour un taux indicatif par défaut. Ajustez le pourcentage si votre situation diffère.",label_currency:"Devise",tooltip_currency:"Devise d’affichage des montants - en général celle du paiement ou de la facturation.",label_amount:"Montant",tooltip_amount:"Mode net : montant hors taxe. Mode brut : total toutes taxes comprises.",ph_amount:"ex. 100,00",ph_rate:"ex. 23",label_rate_unit:"%",tooltip_rate:"Pourcentage appliqué. Se met à jour quand vous changez de pays sauf si vous le modifiez.",label_net:"Prix HT",label_gross:"Prix TTC",label_tax_amount:"Montant de la taxe",tax_rates_disclaimer:"Les taux par défaut sont indicatifs. Vérifiez toujours les taux officiels avant une déclaration.",error_amount_exceeds_limit:"Le montant ne peut pas dépasser 1 milliard (1 000 000 000)."},es:{mode_section_label:"Tipo de importe",tooltip_mode:"Elija neto si el importe no incluye impuesto, o bruto si el impuesto ya está incluido.",mode_add:"Importe Neto (Añadir impuesto)",mode_remove:"Importe Bruto (Extraer impuesto)",label_country:"Región / País",tooltip_country:"Jurisdicción para una tasa indicativa por defecto. Ajuste el porcentaje si su caso es distinto.",label_currency:"Moneda",tooltip_currency:"Moneda para formatear importes; suele coincidir con el pago o la factura.",label_amount:"Importe",tooltip_amount:"Modo neto: importe sin impuesto. Modo bruto: total con impuesto incluido.",ph_amount:"ej. 100,00",ph_rate:"ej. 23",label_rate_unit:"%",tooltip_rate:"Porcentaje aplicado en este cálculo. Se actualiza al cambiar el país salvo que lo edite.",label_net:"Precio Neto",label_gross:"Precio Bruto",label_tax_amount:"Importe del Impuesto",tax_rates_disclaimer:"Las tasas predeterminadas son orientativas. Confirme siempre las tasas vigentes con la autoridad fiscal.",error_amount_exceeds_limit:"El importe no puede superar 1.000 millones (1.000.000.000)."}};const p={AD:{rate:4.5,name:"VAT",curr:"EUR"},AL:{rate:20,name:"VAT",curr:"ALL"},AU:{rate:10,name:"GST",curr:"AUD"},AT:{rate:20,name:"VAT",curr:"EUR"},BE:{rate:21,name:"VAT",curr:"EUR"},BG:{rate:20,name:"VAT",curr:"BGN"},CA:{rate:5,name:"GST",curr:"CAD"},CH:{rate:8.1,name:"VAT",curr:"CHF"},CZ:{rate:21,name:"VAT",curr:"CZK"},DE:{rate:19,name:"VAT",curr:"EUR"},DK:{rate:25,name:"VAT",curr:"DKK"},EE:{rate:22,name:"VAT",curr:"EUR"},ES:{rate:21,name:"VAT",curr:"EUR"},FI:{rate:24,name:"VAT",curr:"EUR"},FR:{rate:20,name:"VAT",curr:"EUR"},GB:{rate:20,name:"VAT",curr:"GBP"},GR:{rate:24,name:"VAT",curr:"EUR"},HR:{rate:25,name:"VAT",curr:"EUR"},HU:{rate:27,name:"VAT",curr:"HUF"},IE:{rate:23,name:"VAT",curr:"EUR"},IS:{rate:24,name:"VAT",curr:"ISK"},IT:{rate:22,name:"VAT",curr:"EUR"},JP:{rate:10,name:"Consumption Tax",curr:"JPY"},LT:{rate:21,name:"VAT",curr:"EUR"},LU:{rate:17,name:"VAT",curr:"EUR"},LV:{rate:21,name:"VAT",curr:"EUR"},MT:{rate:18,name:"VAT",curr:"EUR"},NL:{rate:21,name:"VAT",curr:"EUR"},NO:{rate:25,name:"VAT",curr:"NOK"},NZ:{rate:15,name:"GST",curr:"NZD"},PL:{rate:23,name:"VAT",curr:"PLN"},PT:{rate:23,name:"VAT",curr:"EUR"},RO:{rate:19,name:"VAT",curr:"RON"},SE:{rate:25,name:"VAT",curr:"SEK"},SI:{rate:22,name:"VAT",curr:"EUR"},SK:{rate:20,name:"VAT",curr:"EUR"},TR:{rate:20,name:"VAT",curr:"TRY"},US:{rate:0,name:"Sales Tax",curr:"USD"}},f=999,u=1e9;function g(o){o&&o.querySelectorAll('input[type="number"]').forEach(t=>{const e=t,a=e.min!==""?Number(e.min):NaN,n=!Number.isNaN(a)&&a>=0;e.addEventListener("keydown",r=>
1{if(r.key==="e"||r.key==="E"||r.key==="+"){r.preventDefault();return}n&&r.key==="-"&&r.preventDefault()}),e.addEventListener("paste",r=>{r.preventDefault();let i=r.clipboardData?.getData("text/plain")??"";i=i.replace(/[eE+]/g,""),n&&(i=i.replace(/-/g,""));const s=e.selectionStart??e.value.length,_=e.selectionEnd??e.value.length,h=e.value.slice(0,s)+i+e.value.slice(_);e.value=h;const m=s+i.length;e.setSelectionRange(m,m),e.dispatchEvent(new Event("input",{bubbles:!0}))})})}function A(o,t){let e=parseFloat(String(o)),a=parseFloat(String(t));return Number.isFinite(e)||(e=0),Number.isFinite(a)||(a=0),e=Math.min(u,Math.max(0,e)),a=Math.min(f,Math.max(0,a)),{amount:e,rate:a}}class x{constructor(){this.els={amount:document.getElementById("tax-amount"),rate:document.getElementById("tax-rate"),country:document.getElementById("tax-country"),currency:document.getElementById("tax-currency"),modes:document.querySelectorAll('input[name="tax-mode"]'),resMain:document.getElementById("res-main"),resSub:document.getElementById("res-sub"),resTax:document.getElementById("res-tax-amount"),labelMain:document.getElementById("main-result-label"),labelSub:document.getElementById("sub-result-label"),taxAmtLabel:document.querySelector('#tax-results [data-i18n="label_tax_amount"]'),taxLabels:document.querySelectorAll(".dynamic-tax-label"),rateBadge:document.getElementById("tax-rate-badge")},this.els.amount&&this.init()}init(){y(),this.populateCountries(),this.setupEvents(),this.bindInputGuards(),this.handleCountryChange(!1),this.calculate()}bindInputGuards(){const t=document.getElementById("tax-form");g(t)}showAmountLimitError(t){const e=this.els.amount;if(!e)return;const n=l().error_amount_exceeds_limit||"Amount cannot exceed 1 billion (1,000,000,000).";let r=e.parentElement?.querySelector(".field-error-msg");if(t){e.classList.add("is-error"),r||(r=document.createElement("p"),r.className="field-error-msg",e.parentElement?.appendChild(r)),r.textContent=n;return}e.classList.remove("is-error"),r?.remove()}enforceAmountLimit(){const t=this.els.amount;if(!t)return!1;const e=parseFloat(String(t.value));return!Number.isFinite(e)||e<=u?(this.showAmountLimitError(!1),!1):(t.value=String(u),this.showAmountLimitError(!0),!0)}populateCountries(){const t=this.els.country;if(!t)return;t.innerHTML="";const e=Object.keys(p).sort();let a;try{a=new Intl.DisplayNames([d()],{type:"region"})}catch{a=new Intl.DisplayNames(["en-US"],{type:"region"})}const n=b();e.forEach(r=>{const i=a.of(r)||r,s=new Option(i,r);r===n&&(s.selected=!0),t.add(s)}),t.classList.remove("no-as-dropdown"),!t.dataset.asDropdown&&typeof window.AnyServDropdown=="function"?new window.AnyServDropdown(t):!t.dataset.asDropdown&&typeof window.initAnyServDropdowns=="function"&&window.initAnyServDropdowns()}setupEvents(){[this.els.amount,this.els.rate,this.els.country,this.els.currency].forEach(e=>{e&&(e.addEventListener("input",()=>{e===this.els.amount&&this.enforceAmountLimit(),this.calculate()}),e.addEventListener("change",()=>{e===this.els.amount&&this.enforceAmountLimit(),e===this.els.country&&this.handleCountryChange(!0),this.calculate()}))}),this.els.modes.forEach(e=>e.addEventListener("change",()=>this.calculate()))}handleCountryChange(t=!0){const e=this.els.country.value,a=p[e];a&&(t&&(this.els.rate.value=a.rate),this.els.currency&&(this.els.currency.value=a.curr),this.els.taxLabels.forEac
1h(n=>{n.textContent=a.name}))}getMode(){return Array.from(this.els.modes).find(t=>t.checked)?.value||"add"}format(t){const e=this.els.currency.value,a=d();try{return new Intl.NumberFormat(a,{style:"currency",currency:e,minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}catch{return new Intl.NumberFormat(a,{minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}}calculate(){this.enforceAmountLimit();const{amount:t,rate:e}=A(this.els.amount.value,this.els.rate.value),a=this.getMode()==="add";this.els.rateBadge&&(this.els.rateBadge.textContent=String(e));let n,r,i;a?(n=t,i=n*(e/100),r=n+i,this.updateUI("label_gross","Gross Price",r,"label_net","Net Price",n,i)):(r=t,n=r/(1+e/100),i=r-n,this.updateUI("label_net","Net Price",n,"label_gross","Gross Price",r,i))}updateUI(t,e,a,n,r,i,s){this.setI18n(this.els.labelMain,t,e),this.els.resMain&&(this.els.resMain.textContent=this.format(a)),this.setI18n(this.els.labelSub,n,r),this.els.resSub&&(this.els.resSub.textContent=this.format(i)),this.setI18n(this.els.taxAmtLabel,"label_tax_amount","Tax Amount"),this.els.resTax&&(this.els.resTax.textContent=this.format(Math.max(0,s)))}setI18n(t,e,a){const n=l();t&&(t.textContent=n[e]??a,t.setAttribute("data-i18n",e))}}document.addEventListener("DOMContentLoaded",()=>{window.taxCalculator=new x});

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.