import{a as e}from"./chunk-IAPRSXGC.js";import{a as o,b as n,c}from"./chunk-3JKID6TE.js";import{f as l}from"./chunk-Z7UPUZED.js";import{s as i,t as S}from"./chunk-ISCRPPFS.js";S();var p=class{static statusColor(a){switch(a){case"P":return"paw-status-success";case"R":return"neutral";case"N":return"paw-status-warning"}return""}static statusTagColor(a){switch(a){case"P":return"green";case"R":return"neutral";case"N":return"warning"}return""}static statusHeaderColor(a){switch(a){case"P":return"paw-status-success";case"R":return"paw-status-neutral";case"N":return"paw-status-warning"}return""}static statusIcon(a){switch(a){case"P":return"far fa-check";case"N":return"far fa-hourglass-half";default:return""}}static wayOfSaleText(a){switch(a){case e.FinalBuyer:return"FinalBuyer";case e.IsTaxComitted:return"IsTaxCommitedShort";case e.ExportSale:return"ExportSale";case e.ExportSaleEU:return"ExportSaleEU";case e.DomesticTaxpayers:return"DomesticTaxpayers";case e.Flatrate:return"Flatrate";case e.OtherNotTaxComitted:return"";case e.R1:return"WayOfSaleBuyerR1";case e.R2:return"WayOfSaleR2";case e.RS:return"SerbianRepublic";case e.BiH:return"FederationBiH";case e.BrckoDistrictBiH:return"BrckoDistrictBiH";case e.Import:return"Import";case e.ImportEU:return"ImportEU";case e.Nonresident:return"Nonresident";case e.DiplomaticConsulate:return"WayOfSaleDiplomaticConsulate";case e.Other:return"Other";default:return""}}static wayOfSaleColor(a){switch(a){case e.FinalBuyer:return"green";case e.IsTaxComitted:return"turquoise";case e.ExportSale:return"cyan";case e.ExportSaleEU:return"pink";case e.DomesticTaxpayers:return"orange";case e.Flatrate:return"yellow";case e.OtherNotTaxComitted:return"";case e.R1:return"green";case e.R2:return"yellow";case e.RS:return"pink";case e.BiH:return"blue";case e.BrckoDistrictBiH:return"purple";case e.Import:return"dark-pink";case e.ImportEU:return"pink";case e.Nonresident:return"red";case e.DiplomaticConsulate:return"purple";case e.Other:return"no-fill";default:return""}}static stringFormat(a,r,t,u){if(r){let s=new RegExp("\\{0\\}","gm");a=a.replace(s,r)}if(t){let s=new RegExp("\\{1\\}","gm");a=a.replace(s,t)}if(u){let s=new RegExp("\\{2\\}","gm");a=a.replace(s,u)}return a}static getStartDate(a,r){let t=new Date;return a===l.DateDoc1&&r.orderDate?t=r.orderDate:a===l.DateDoc2&&r.orderFormDate?t=r.orderFormDate:a===l.Date&&r.date?t=r.date:a===l.TaxDate&&r.dateVAT?t=r.dateVAT:r.invoiceDate&&(t=r.invoiceDate),t}static adjustDateForTimezone(a){let r=new Date(a),t=r.getTimezoneOffset();return new Date(r.getTime()-t*60*1e3)}static stripTime(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())}static isSameDay(a,r){return!a||!r?!1:(a=a instanceof Date?a:new Date(a),this.stripTime(a).getTime()===this.stripTime(r).getTime())}static getWayOfSales(a){switch(a){case i.BA:return[{value:e.IsTaxComitted,label:"IsTaxCommited"},{value:e.ExportSale,label:"ExportSale"},{value:e.BiH,label:"FederationBiH"},{value:e.RS,label:"SerbianRepublic"},{value:e.BrckoDistrictBiH,label:"BrckoDistrictBiH"}];case i.ME:return[{value:e.IsTaxComitted,label:"SubjTaxPayer"},{value:e.FinalBuyer,label:"FinalBuyer"},{value:e.ExportSale,label:"ExportSale"}];case i.RS:case i.MK:return[{value:e.IsTaxComitted,label:"IsTaxCommitedShort"},{value:e.ExportSale,label:"ExportSale"},{value:e.FinalBuyer,label:"FinalBuyer"},{value:e.DiplomaticConsulate,label:"WayOfSaleDiplomaticConsulate"}];case i.HR:return[{value:e.IsTaxComitted,label:"WayOfSaleBuyerR1"},{value:e.ExportSale,label:"ExportSale"},{value:e.ExportSaleEU,label:"ExportSaleEU"},{value:e.FinalBuyer,label:"FinalBuyer"},{value:e.Nonresident,label:"TaxExempt"},{value:e.Other,label:"Other"}];default:return[{value:e.IsTaxComitted,label:"IsTaxCommitedShort"},{value:e.FinalBuyer,label:"FinalBuyer"},{value:e.ExportSale,label:"ExportSale"},{value:e.ExportSaleEU,label:"ExportSaleEU"}]}}static openSerialNumbersDialog(a,r,t,u,s=()=>{}){console.log(t,r),!(!t||r.serialNo===""||r.serialNo===o.NotSerial)&&(t?.autoInvoSerialNo?a.serialNumbersAutoEdition({acKey:t.acKey,docType:t.docType,anNo:r.anNo,issuer:t.issuerId,ident:r.ident,quantityOld:u??0,quantityNew:r.quantity,type:n.K,receiver:t.receiverId,invoiceType:c.Move,date:t.invoiceDate??new Date},r,s):a.openDialog(r,t?.receiverId,n.K,c.Move,!1,t?.invoiceDate??new Date,t?.issuerId,!0,null,s))}};export{p as a};
