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AO,OACT,QACE,MAAO,EACX,CACF,C,qECdA2C,eAAe,CACb,sCAAuCC,IACrC,gCACJ,CAAC,EA0BD,MAAMC,UAAoBC,EAAAA,CAAU,CAClCC,KAAO,iCAYAC,QAAU,CACfC,OAAQ,mCACRC,IAAK,eACP,EAEAhO,YAAYiO,EAAyB,CACnC,MAAM,EACN,KAAKA,OAASA,EACd,KAAKC,aAAeD,EAAOC,aAAeD,EAAOC,aAAe,QAChE,KAAK/C,WAAa8C,EAAO9C,WAAa8C,EAAO9C,WAAa,WAC1D,KAAKC,WAAa6C,EAAO7C,WACzB,KAAK+C,eAAiBF,EAAOE,eAEzBF,EAAOG,eACT,KAAKN,QAAQC,OAAS,GACtB,KAAKD,QAAQE,IAAM,cAEvB,CAEOK,OAAc,CACnBC,EAAAA,MAAa,KAAM,EAAK,CAC1B,CAEOC,aAAaC,EAAU,CAC5B,OAAI,KAAKL,gBACP,KAAKA,eAAe,EACpBG,EAAAA,MAAa,KAAM,EAAI,EAChB,KAGTA,EAAAA,MAAa,KAAM,EAAI,EAChB,GACT,CAEA,OAAcrD,KAAKgD,EAA6C,CAC9D,OAAOK,EAAAA,KAAY,IAAIX,EAAYM,CAAM,CAAC,CAC5C,CACF,CAEA,QAAeN,C","sources":["webpack:///./features/accounting-software/api/constants.ts","webpack:///./features/accounting-software/types/CodatEvents.ts","webpack:///./features/accounting-software/types/CodatSync.ts","webpack:///./features/accounting-software/utils/setupPopupWindow.ts","webpack:///./features/accounting-software/services/BaseAccountingSoftwarePackage.ts","webpack:///./features/accounting-software/services/NetSuiteAccountingPackage.ts","webpack:///./features/accounting-software/types/QBWCFileLink.ts","webpack:///./features/accounting-software/services/QuickBooksDesktopAccountingPackage.ts","webpack:///./features/accounting-software/services/QuickBooksOnlineAccountingPackage.ts","webpack:///./features/accounting-software/services/XeroAccountingPackage.ts","webpack:///./features/accounting-software/services/accountingSoftware.ts","webpack:///./features/accounting-software/types/Bill.ts","webpack:///./features/accounting-software/types/Invoice.ts","webpack:///./features/accounting-software/types/SupportedAccountingSoftware.ts","webpack:///./features/accounting-software/utils/getAccountingSoftwareNameByType.ts","webpack:///./features/accounting-software/utils/getAccountingSoftwareShortNameByType.ts","webpack:///./legacy/modals/styled/titleMessageLink.ts"],"sourcesContent":["/**\n * API prefix for accounting software API endpoints\n */\nexport const API_PREFIX = 'v1';\n","enum CodatEvents {\n DataSync = 'realtime:codat:dataSync',\n}\n\nexport default CodatEvents;\n","/** Transmitted Codat SignalR web socket message data types */\nexport enum CodatDataType {\n /** Only transmitted during the initial accounting software connection process. Signals completion of the initial connection process (but not the sync process). */\n Company = 'company',\n /** Transmitted during sync process */\n Bills = 'bills',\n /** Transmitted during sync process */\n Customers = 'customers',\n /** Transmitted during sync process */\n Invoices = 'invoices',\n /** Transmitted during sync process */\n Suppliers = 'suppliers',\n}\n\n/** Codat web socket sync messages */\nexport type CodatSyncMessage = {\n dataType: CodatDataType;\n companyId: string;\n datasetId: string;\n};\n","interface PopupWindowOptions {\n /** Width of the popup window */\n width?: number;\n /** Height of the popup window */\n height?: number;\n /** Whether to center the popup on the screen */\n centered?: boolean;\n}\n\ninterface PopupParameters {\n location: number;\n width: number;\n height: number;\n left?: number;\n top?: number;\n}\n\n/**\n * Creates a popup window with the given parameters\n * @param options {@link PopupWindowOptions}\n * @returns The popup window\n */\nfunction setupPopupWindow({\n width = 1000,\n height = 650,\n centered = true,\n}: PopupWindowOptions = {}) {\n const parameters: PopupParameters = {\n location: 1,\n width,\n height,\n };\n\n if (centered) {\n parameters.left = (window.screen.width - width) / 2;\n parameters.top = (window.screen.height - height) / 2;\n }\n\n const features = Object.keys(parameters)\n .map((k) => `${k}=${parameters[k]}`)\n .join(',');\n\n const popup = window.open('', '', features);\n\n if (popup?.document) {\n popup.document.write('Connecting...');\n }\n\n return popup;\n}\n\nexport type { PopupParameters };\nexport default setupPopupWindow;\n","import * as ko from 'knockout';\n\nimport { AccountingSoftwareIntegrationEventsServiceEventType } from '@/legacy/features/companies/accountingSoftware/analytics/helper';\nimport * as companyService from '@/legacy/services/company';\nimport CompanyEventService from '@/legacy/services/companyEventService';\n\nimport AccountingSoftwareCompany from '../types/AccountingSoftwareCompany';\nimport AccountingSoftwareContact from '../types/AccountingSoftwareContact';\nimport Bill from '../types/Bill';\nimport IAccount from '../types/IAccount';\nimport IAccountingSoftwareAddAccount from '../types/IAccountingSoftwareAddAccount';\nimport IAccountingSoftwarePackage from '../types/IAccountingSoftwarePackage';\nimport IBillAttachmentDetails from '../types/IBillAttachmentDetails';\nimport Invoice from '../types/Invoice';\nimport type { SupportedAccountingSoftwareType as AccountingSoftwareType } from '../types/SupportedAccountingSoftware';\nimport SyncType from '../types/SyncType';\nimport { getAccountingSoftwareNameByType } from '../utils/getAccountingSoftwareNameByType';\nimport { getAccountingSoftwareShortNameByType } from '../utils/getAccountingSoftwareShortNameByType';\n\nabstract class BaseAccountingSoftwarePackage implements IAccountingSoftwarePackage {\n protected companyService: companyService.CompanyService;\n\n readonly id: AccountingSoftwareType;\n\n readonly name: string;\n\n readonly shortName: string;\n\n abstract readonly logoUrl: string;\n\n abstract readonly icon: string;\n\n abstract readonly supportsInvoices: boolean;\n\n readonly usesCodat: boolean = false;\n\n readonly syncProgress: KnockoutObservable = ko.observable();\n\n constructor(id: AccountingSoftwareType) {\n this.companyService = companyService.Instance;\n\n this.id = id;\n this.name = getAccountingSoftwareNameByType(id);\n this.shortName = getAccountingSoftwareShortNameByType(id);\n }\n\n abstract AddAccount(account: IAccountingSoftwareAddAccount): Promise;\n\n abstract Connect(): Promise;\n\n abstract ConnectConnectIcon(): string;\n\n abstract Connected(info: any): Promise;\n\n abstract FilterResolutions(conflictingAccountName: string): string;\n\n abstract GenerateConnectButton($target: JQuery): void;\n\n abstract GetAccounts(): Promise>;\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n GetBillAttachment(attachment: IBillAttachmentDetails) {}\n\n abstract GetBills(): Promise>;\n\n abstract fetchCompany(): Promise;\n\n abstract GetContacts(): Promise>;\n\n GetId(): AccountingSoftwareType {\n return this.id;\n }\n\n abstract GetInvoices(): Promise>;\n\n GetName(): string {\n return this.name;\n }\n\n abstract GetReconciliationStatus(): Promise;\n\n GetShortName(): string {\n return this.shortName;\n }\n\n SupportsInvoices(): boolean {\n return this.supportsInvoices;\n }\n\n SyncData(syncType: SyncType): Promise {\n return Promise.resolve();\n }\n\n async getFullVendorDetails(vendorDetails: any): Promise {\n return vendorDetails;\n }\n\n async getFullCustomerDetails(customerDetails: any): Promise {\n return customerDetails;\n }\n\n protected fireAccountingSoftwareConnectingEvent(context?: string) {\n CompanyEventService.emit(\n AccountingSoftwareIntegrationEventsServiceEventType.AccountingPlatformConnectionInitiated,\n {\n accountingPlatform: this.id,\n context,\n }\n );\n }\n\n protected fireAccountingSoftwareConnectedEvent() {\n CompanyEventService.emit(\n AccountingSoftwareIntegrationEventsServiceEventType.AccountingPlatformConnected,\n {\n accountingPlatform: this.id,\n }\n );\n }\n}\n\nexport default BaseAccountingSoftwarePackage;\n","import * as ko from 'knockout';\nimport * as analytics from 'analytics';\n\nimport { ApiService } from '@/features/api';\nimport eventsService from '@/legacy/services/eventsService';\n\nimport { API_PREFIX } from '../api/constants';\nimport NetSuiteLogo from '../assets/netsuite-logo.svg';\nimport AccountingSoftwareCompany from '../types/AccountingSoftwareCompany';\nimport AccountingSoftwareContact from '../types/AccountingSoftwareContact';\nimport Bill from '../types/Bill';\nimport BillData from '../types/BillData';\nimport CodatConnection from '../types/CodatConnection';\nimport CodatEvents from '../types/CodatEvents';\nimport { CodatDataType, CodatSyncMessage } from '../types/CodatSync';\nimport IAccount from '../types/IAccount';\nimport IAccountingSoftwareAddAccount from '../types/IAccountingSoftwareAddAccount';\nimport IBillAttachmentDetails from '../types/IBillAttachmentDetails';\nimport Invoice from '../types/Invoice';\nimport InvoiceData from '../types/InvoiceData';\nimport { SupportedAccountingSoftware } from '../types/SupportedAccountingSoftware';\nimport SyncCodatDataResponse from '../types/SyncCodatDataResponse';\nimport SyncType from '../types/SyncType';\nimport setupPopupWindow from '../utils/setupPopupWindow';\n\nimport BaseAccountingSoftwarePackage from './BaseAccountingSoftwarePackage';\n\n/** Data types that are transmitted during synchronization with Codat */\nconst SYNC_DATA_TYPES: Array = [\n CodatDataType.Bills,\n CodatDataType.Customers,\n CodatDataType.Invoices,\n CodatDataType.Suppliers,\n];\n\nconst syncTimeoutError = new Error('Timed out waiting for NetSuite data sync');\n\nclass NetSuiteAccountingPackage extends BaseAccountingSoftwarePackage {\n private readonly connectIcon = 'third_party_netsuite_connect';\n\n // TODO: remove vendor logo from public dir once we fully migrate to the new UI\n readonly logoUrl = `${import.meta.env.APP_STATIC_APP_ROOT_URL}/img/vendor/netsuite-icon.svg`;\n\n readonly icon = NetSuiteLogo;\n\n private readonly maxWaitTimeForDataSyncInMilliseconds = 1000 * 60 * 10;\n\n supportsInvoices = true;\n\n usesCodat = true;\n\n private syncedDataTypes: KnockoutObservableArray = ko.observableArray([]);\n\n private syncedDataTypesSet: KnockoutComputed> = ko.pureComputed(\n () => new Set(this.syncedDataTypes())\n );\n\n syncProgress = ko.pureComputed({\n read: () => {\n const progress = (this.syncedDataTypesSet().size / SYNC_DATA_TYPES.length) * 100;\n return Number.isNaN(progress) ? 0 : progress;\n },\n deferEvaluation: true,\n });\n\n constructor() {\n super(SupportedAccountingSoftware.NetSuite);\n }\n\n /**\n * Get NetSuite integration accounts from Codat.\n *\n * In order to behave like other packages, this method has to wait for synced data signals\n * before fetching the accounts from the associated API endpoint; otherwise, it will return an\n * empty response.\n */\n async GetAccounts(): Promise> {\n await this.waitForSyncedDataTypes([CodatDataType.Customers, CodatDataType.Suppliers]);\n\n const companyId: string = this.companyService.CompanyId();\n\n const url = new URL(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/companies/${companyId}/codat/accounts`\n );\n const accounts = await ApiService.get>(url.toString());\n return accounts;\n }\n\n async AddAccount(account: IAccountingSoftwareAddAccount): Promise {\n const companyId: string = this.companyService.CompanyId();\n\n const url = new URL(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/companies/${companyId}/codat/accounts`\n );\n\n const response = await ApiService.post(url.toString(), { body: account });\n\n return response;\n }\n\n async Connect(): Promise {\n const companyId: string = this.companyService.CompanyId();\n\n const codatConnection = await ApiService.post(\n `${import.meta.env.APP_URLS_API_URL}/v1/companies/${companyId}/codat/connections`,\n undefined,\n true\n );\n\n const popup = setupPopupWindow();\n if (popup) {\n popup.location.href = codatConnection.connectionLink;\n }\n }\n\n ConnectConnectIcon(): string {\n return this.connectIcon;\n }\n\n async Connected(info: any): Promise {\n console.log('connected');\n }\n\n FilterResolutions(conflictingAccountName: string): string {\n return conflictingAccountName;\n }\n\n GenerateConnectButton($target: JQuery): void {\n $('', {\n href: '#',\n class: this.connectIcon,\n })\n .appendTo($target)\n .click(() => {\n this.Connect();\n return false;\n });\n }\n\n /**\n * Get NetSuite bills from Codat.\n *\n * In order to behave like other packages, this method has to wait for synced data signals\n * before fetching the bills from the associated API endpoint; otherwise, it will return an\n * empty response.\n */\n async GetBills(): Promise> {\n await this.waitForSyncedDataTypes([CodatDataType.Bills]);\n\n const companyId: string = this.companyService.CompanyId();\n\n const billData = await ApiService.get>(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/companies/${companyId}/codat/bills`\n );\n\n if (companyId !== this.companyService.CompanyId()) {\n throw new Error('Company switched while fetching bills');\n }\n\n return billData.map((data) => new Bill(data));\n }\n\n /** Wait for the company data to be synced during the initial connection process */\n private async waitForCompanyDataSync(): Promise {\n await new Promise((resolve, reject) => {\n // Check whether the company message was received during the sync process (see SyncData())\n if (this.syncedDataTypesSet().has(CodatDataType.Company)) {\n resolve();\n }\n\n const dataSyncSubscription = eventsService.on(\n CodatEvents.DataSync,\n ({ detail: { dataType } }: CustomEvent) => {\n if (dataType === CodatDataType.Company) {\n eventsService.off(dataSyncSubscription);\n resolve();\n }\n }\n );\n\n setTimeout(() => {\n eventsService.off(dataSyncSubscription);\n reject(syncTimeoutError);\n }, this.maxWaitTimeForDataSyncInMilliseconds);\n });\n }\n\n /** Get company associated with NetSuite integration from Codat. */\n async fetchCompany(): Promise {\n const companyId: string = this.companyService.CompanyId();\n const codatConnection = await ApiService.get(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/companies/${companyId}/codat/connections`,\n undefined,\n true\n );\n\n if (!codatConnection?.codatCompanyName) {\n await this.waitForCompanyDataSync();\n return this.fetchCompany();\n }\n\n return { name: codatConnection.codatCompanyName };\n }\n\n async GetContacts(): Promise> {\n return [];\n }\n\n /**\n * Get NetSuite invoices from Codat.\n *\n * In order to behave like other packages, this method has to wait for synced data signals\n * before fetching the invoices from the associated API endpoint; otherwise, it will return an\n * empty response.\n */\n async GetInvoices(): Promise> {\n await this.waitForSyncedDataTypes([CodatDataType.Invoices]);\n\n const companyId: string = this.companyService.CompanyId();\n\n const invoiceData = await ApiService.get>(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/companies/${companyId}/codat/invoices`\n );\n\n if (companyId !== this.companyService.CompanyId()) {\n throw new Error('Company switched while fetching invoices');\n }\n\n return invoiceData.map((data) => new Invoice(data));\n }\n\n async GetReconciliationStatus(): Promise {\n return 'Reconciled';\n }\n\n GetBillAttachment(attachment: IBillAttachmentDetails) {\n const popup = setupPopupWindow({ width: 800, height: 650 });\n if (popup) {\n popup.location.href = attachment.url;\n }\n }\n\n /** Check whether the data types required for synchronization have been synced */\n private hasSyncedDataTypes(\n dataTypes: Array,\n syncedDataTypesSet: Set = this.syncedDataTypesSet()\n ): boolean {\n return dataTypes.every((requiredDataType) => syncedDataTypesSet.has(requiredDataType));\n }\n\n /** Wait for the specified data types to be synced */\n private async waitForSyncedDataTypes(dataTypes: Array): Promise {\n let syncedDataTypesSubscription: KnockoutSubscription;\n const subscription = new Promise((resolve, reject) => {\n syncedDataTypesSubscription = this.syncedDataTypesSet.subscribe((syncedDataTypesSet) => {\n if (this.hasSyncedDataTypes(dataTypes, syncedDataTypesSet)) {\n resolve();\n }\n });\n\n setTimeout(() => {\n reject(syncTimeoutError);\n }, this.maxWaitTimeForDataSyncInMilliseconds);\n });\n\n const current = new Promise((resolve) => {\n if (this.hasSyncedDataTypes(dataTypes)) {\n resolve();\n }\n });\n\n return Promise.race([subscription, current]).finally(() => {\n syncedDataTypesSubscription?.dispose();\n });\n }\n\n /**\n * Trigger the data synchronization process\n *\n * This method kicks off the data synchronization process with Codat, then awaits\n * data sync signals from the RealtimeService before resolving.\n */\n SyncData(syncType: SyncType): Promise {\n return new Promise((resolve, reject) => {\n this.syncedDataTypes([]);\n this.fireAccountingSoftwareConnectingEvent();\n const companyId: string = this.companyService.CompanyId();\n let syncTimeout: number | undefined;\n let lastTimeDataTypeWasSynced: number = Date.now();\n let syncStartTime: number = Date.now();\n\n // This event is triggered by the RealtimeService when Codat has finished syncing data\n const dataSyncSubscription = eventsService.on(\n CodatEvents.DataSync,\n ({ detail: { dataType } }: CustomEvent) => {\n if (SYNC_DATA_TYPES.includes(dataType)) {\n this.syncedDataTypes.push(dataType);\n\n const elapsedTime = Date.now() - lastTimeDataTypeWasSynced;\n const elapsedTimeInSeconds = Math.floor(elapsedTime / 1000);\n const timeRemaining = this.maxWaitTimeForDataSyncInMilliseconds - elapsedTime;\n const timeRemainingInSeconds = Math.floor(timeRemaining / 1000);\n\n console.log(\n `Synced ${dataType}, ${elapsedTimeInSeconds}s elapsed, ${timeRemainingInSeconds}s remaining`\n );\n\n clearTimeout(syncTimeout);\n\n lastTimeDataTypeWasSynced = Date.now();\n }\n\n if (this.hasSyncedDataTypes(SYNC_DATA_TYPES)) {\n const elapsedTime = Date.now() - syncStartTime;\n const elapsedTimeInSeconds = Math.floor(elapsedTime / 1000);\n\n console.log(`Synced all data types in ${elapsedTimeInSeconds}s`);\n\n eventsService.off(dataSyncSubscription);\n\n this.fireAccountingSoftwareConnectedEvent();\n analytics.send('event', 'Company-AccountingSoftware', 'Connect', this.shortName);\n\n resolve();\n }\n }\n );\n\n ApiService.post(\n `${import.meta.env.APP_URLS_API_URL}/v1/companies/${companyId}/codat/sync`,\n {\n body: { syncType },\n }\n )\n .then((response) => {\n if (response.isSyncRequestSent) {\n return;\n }\n\n for (const dataType of SYNC_DATA_TYPES) {\n this.syncedDataTypes.push(dataType);\n }\n\n eventsService.off(dataSyncSubscription);\n\n this.fireAccountingSoftwareConnectedEvent();\n analytics.send('event', 'Company-AccountingSoftware', 'Connect', this.shortName);\n\n resolve();\n })\n .catch((error) => {\n eventsService.off(dataSyncSubscription);\n reject(error);\n });\n\n lastTimeDataTypeWasSynced = Date.now();\n syncStartTime = Date.now();\n\n syncTimeout = window.setTimeout(() => {\n eventsService.off(dataSyncSubscription);\n reject(syncTimeoutError);\n console.error('Timed out waiting for NetSuite data sync');\n }, this.maxWaitTimeForDataSyncInMilliseconds);\n });\n }\n}\n\nexport type { CodatSyncMessage as NetSuiteSyncMessage };\nexport default NetSuiteAccountingPackage;\n","// eslint-disable-next-line @cspell/spellchecker\nimport IQBWCFile from './IQBWCFile';\n\nclass QBWCFileLink {\n file: IQBWCFile;\n\n link: string;\n\n constructor(file: IQBWCFile, link: string) {\n this.file = file;\n this.link = link;\n }\n}\n\nexport default QBWCFileLink;\n","import * as router from 'plugins/router';\nimport * as analytics from 'analytics';\n\nimport { ApiService } from '@/features/api';\n\nimport { API_PREFIX } from '../api/constants';\nimport QuickBooksIcon from '../assets/quickbooks-icon.svg';\nimport AccountingSoftwareCompany from '../types/AccountingSoftwareCompany';\nimport AccountingSoftwareContact from '../types/AccountingSoftwareContact';\nimport Bill from '../types/Bill';\nimport BillData from '../types/BillData';\nimport IAccount from '../types/IAccount';\nimport Invoice from '../types/Invoice';\nimport InvoiceData from '../types/InvoiceData';\n// eslint-disable-next-line @cspell/spellchecker\nimport IQBWCFile from '../types/IQBWCFile';\nimport QBWCFileLink from '../types/QBWCFileLink';\nimport { SupportedAccountingSoftware } from '../types/SupportedAccountingSoftware';\n\nimport BaseAccountingSoftwarePackage from './BaseAccountingSoftwarePackage';\n\nclass QuickBooksDesktopAccountingPackage extends BaseAccountingSoftwarePackage {\n // TODO: remove vendor logo from public dir once we fully migrate to the new UI\n readonly logoUrl = `${import.meta.env.APP_STATIC_APP_ROOT_URL}/img/vendor/quickbooks-icon.svg`;\n\n readonly icon = QuickBooksIcon;\n\n supportsInvoices = true;\n\n constructor() {\n super(SupportedAccountingSoftware.QuickBooksDesktop);\n }\n\n ConnectConnectIcon(): string {\n return 'third_party_quickbooks_desktop_connect';\n }\n\n FilterResolutions(conflictingAccountName: string): string {\n // The name for Plooto Instant in US is too long. We have a shorter name\n if (conflictingAccountName == 'Plooto Instant (United States - USD)') {\n return 'Plooto Instant (US - USD)';\n }\n let newAccountName = conflictingAccountName;\n newAccountName = newAccountName\n .replace(':', '')\n .replace(';', '')\n // eslint-disable-next-line no-control-regex\n .replace(/[^\\x00-\\xFF]/g, '')\n .trim();\n if (newAccountName.length > 31) {\n newAccountName = newAccountName.substring(0, 31);\n }\n return newAccountName;\n }\n\n // callback that is called via pop-up when OAuth has been completed\n async Connected(info: any): Promise {\n const companyId: string = this.companyService.CompanyId();\n\n await ApiService.put(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksonline/oauth`,\n { body: info }\n );\n\n this.fireAccountingSoftwareConnectedEvent();\n analytics.send('event', 'Company-AccountingSoftware', 'Connect', 'QBD');\n }\n\n // called via callback once user clicks on \"connect\" button\n async Connect(): Promise {\n router.navigate('user/integrations/quickbooksDesktop');\n }\n\n // generates a clickable link that starts connection process\n GenerateConnectButton($target: JQuery, context?: string): void {\n $('', {\n href: '#',\n class: 'third_party_quickbooks_desktop_connect',\n })\n .appendTo($target)\n .click(() => {\n this.fireAccountingSoftwareConnectingEvent(context);\n this.Connect();\n return false;\n });\n }\n\n async DownloadQBWC(): Promise {\n const companyId: string = this.companyService.CompanyId();\n\n const qbwcFile = await ApiService.get(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksdesktop/generateQBWC`\n );\n\n const downloadUrl = `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksdesktop/downloadQBWC/${qbwcFile.templateId}`;\n\n return new QBWCFileLink(qbwcFile, downloadUrl);\n }\n\n async AddAccount(account: any): Promise {\n const companyId: string = this.companyService.CompanyId();\n\n const response = await ApiService.put(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksdesktop/accounts`,\n { body: account }\n );\n\n return response;\n }\n\n async GetContacts(): Promise> {\n const companyId: string = this.companyService.CompanyId();\n\n const contacts = await ApiService.get>(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksdesktop/contacts`\n );\n\n return contacts;\n }\n\n async GetAccounts(): Promise> {\n const companyId: string = this.companyService.CompanyId();\n\n const accounts = await ApiService.get>(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksdesktop/accounts`\n );\n\n return accounts;\n }\n\n async fetchCompany(): Promise {\n const companyId: string = this.companyService.CompanyId();\n\n const company = await ApiService.get(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksdesktop/company`\n );\n\n return company;\n }\n\n async GetBills(): Promise> {\n const companyId: string = this.companyService.CompanyId();\n\n const billData = await ApiService.get>(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksdesktop/bills`\n );\n\n if (companyId !== this.companyService.CompanyId()) {\n throw new Error('Company switched while fetching bills');\n }\n\n return billData.map((data) => new Bill(data));\n }\n\n async GetInvoices(): Promise> {\n const companyId: string = this.companyService.CompanyId();\n\n const invoiceData = await ApiService.get>(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksdesktop/invoices`\n );\n\n if (companyId !== this.companyService.CompanyId()) {\n throw new Error('Company switched while fetching invoices');\n }\n\n return invoiceData.map((data) => new Invoice(data));\n }\n\n async GetReconciliationStatus(): Promise {\n const companyId: string = this.companyService.CompanyId();\n\n const reconciliationStatus = await ApiService.get(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksdesktop/reconciliationStatus`\n );\n\n return reconciliationStatus;\n }\n}\n\nexport default QuickBooksDesktopAccountingPackage;\n","import * as analytics from 'analytics';\n\nimport { ApiService } from '@/features/api';\n\nimport { API_PREFIX } from '../api/constants';\nimport QuickBooksIcon from '../assets/quickbooks-icon.svg';\nimport AccountingSoftwareCompany from '../types/AccountingSoftwareCompany';\nimport AccountingSoftwareContact from '../types/AccountingSoftwareContact';\nimport Bill from '../types/Bill';\nimport BillData from '../types/BillData';\nimport IAccount from '../types/IAccount';\nimport IBillAttachmentDetails from '../types/IBillAttachmentDetails';\nimport Invoice from '../types/Invoice';\nimport InvoiceData from '../types/InvoiceData';\nimport IOAuthAccessToken from '../types/IOAuthAccessToken';\nimport IOAuthRequest from '../types/IOAuthRequest';\nimport IOAuthVerifiedToken from '../types/IOAuthVerifiedToken';\nimport { SupportedAccountingSoftware as AccountingSoftware } from '../types/SupportedAccountingSoftware';\nimport setupPopupWindow from '../utils/setupPopupWindow';\n\nimport BaseAccountingSoftwarePackage from './BaseAccountingSoftwarePackage';\n\nclass QuickBooksOnlineAccountingPackage extends BaseAccountingSoftwarePackage {\n // TODO: remove vendor logo from public dir once we fully migrate to the new UI\n readonly logoUrl = `${import.meta.env.APP_STATIC_APP_ROOT_URL}/img/vendor/quickbooks-icon.svg`;\n\n readonly icon = QuickBooksIcon;\n\n supportsInvoices = true;\n\n constructor() {\n super(AccountingSoftware.QuickBooksOnline);\n }\n\n ConnectConnectIcon(): string {\n return 'third_party_quickbooks_connect';\n }\n\n FilterResolutions(conflictingAccountName: string): string {\n return conflictingAccountName;\n }\n\n // callback that is called via pop-up when OAuth has been completed\n async Connected(info: any): Promise {\n // we would get error if user hit 'No' on Intuit confirmation popup\n if (info.error != undefined) {\n return;\n }\n\n const companyId: string = this.companyService.CompanyId();\n\n await ApiService.put(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksonline/oauth`,\n { body: info }\n );\n\n this.fireAccountingSoftwareConnectedEvent();\n analytics.send('event', 'action', 'completed', 'Connected Quickbooks');\n analytics.send('event', 'Company-AccountingSoftware', 'Connect', 'QBO');\n }\n\n // called via callback once user clicks on \"connect\" button\n async Connect(): Promise {\n const connectUrl = `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/quickbooksonline/oauth`;\n\n const oauthData = await ApiService.get(connectUrl);\n\n // set global variable for window so it can be accessed via \"window.opener\" by callback url\n // @ts-expect-error: Property 'QuickBooksAccountingPackage' does not exist on type 'Window & typeof globalThis'.\n window.QuickBooksAccountingPackage = this;\n\n const popup = setupPopupWindow({ width: 800, height: 650 });\n if (popup) {\n popup.location.href = oauthData.url;\n }\n }\n\n async LinkSession(verifiedToken: IOAuthVerifiedToken): Promise {\n const token = await ApiService.post(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/quickbooksonline/link`,\n { body: verifiedToken }\n );\n return token;\n }\n\n async GetToken(accessToken: IOAuthAccessToken): Promise {\n const token = await ApiService.post(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/quickbooksonline/verify`,\n { body: accessToken }\n );\n return token;\n }\n\n // generates a clickable link that starts connection process\n GenerateConnectButton($target: JQuery, context?: string): void {\n $('', {\n href: '#',\n class: 'third_party_quickbooks_connect',\n })\n .appendTo($target)\n .click(() => {\n this.fireAccountingSoftwareConnectingEvent(context);\n this.Connect();\n return false;\n });\n }\n\n async AddAccount(account: IAccount): Promise {\n const companyId: string = this.companyService.CompanyId();\n\n const response = await ApiService.put(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksonline/accounts`,\n { body: account }\n );\n\n return response;\n }\n\n async GetAccounts(): Promise> {\n const companyId: string = this.companyService.CompanyId();\n\n const accounts = await ApiService.get>(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksonline/accounts`\n );\n\n return accounts;\n }\n\n async fetchCompany(): Promise {\n const companyId: string = this.companyService.CompanyId();\n\n const response = await ApiService.get(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksonline/company`\n );\n\n return response;\n }\n\n async GetBills(): Promise> {\n const companyId: string = this.companyService.CompanyId();\n\n const billData = await ApiService.get>(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksonline/bills`\n );\n\n if (companyId !== this.companyService.CompanyId()) {\n throw new Error('Company switched while fetching bills');\n }\n\n return billData.map((data) => new Bill(data));\n }\n\n async GetContacts(): Promise> {\n const companyId: string = this.companyService.CompanyId();\n\n const contacts = await ApiService.get>(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksonline/contacts`\n );\n\n return contacts;\n }\n\n async GetInvoices(): Promise> {\n const companyId: string = this.companyService.CompanyId();\n\n const invoiceData = await ApiService.get>(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/quickbooksonline/invoices`\n );\n\n if (companyId !== this.companyService.CompanyId()) {\n throw new Error('Company switched while fetching invoices');\n }\n\n return invoiceData.map((data) => new Invoice(data));\n }\n\n async GetBillAttachment(attachment: IBillAttachmentDetails): Promise {\n const popup = setupPopupWindow({ width: 800, height: 650 });\n if (popup) {\n popup.location.href = attachment.url;\n }\n }\n\n async GetReconciliationStatus(): Promise {\n return 'Reconciled';\n }\n}\n\nexport default QuickBooksOnlineAccountingPackage;\n","import * as analytics from 'analytics';\n\nimport { ApiErrorResponse, ApiService } from '@/features/api';\nimport titleMessageLinkModal from '@/legacy/modals/styled/titleMessageLink';\nimport * as companyService from '@/legacy/services/company';\n\nimport { API_PREFIX } from '../api/constants';\nimport XeroLogo from '../assets/xero-logo.svg';\nimport AccountingSoftwareCompany from '../types/AccountingSoftwareCompany';\nimport AccountingSoftwareContact from '../types/AccountingSoftwareContact';\nimport Bill from '../types/Bill';\nimport BillData from '../types/BillData';\nimport IAccount from '../types/IAccount';\nimport IBillAttachmentDetails from '../types/IBillAttachmentDetails';\nimport Invoice from '../types/Invoice';\nimport InvoiceData from '../types/InvoiceData';\nimport IOAuthRequest from '../types/IOAuthRequest';\nimport { SupportedAccountingSoftware } from '../types/SupportedAccountingSoftware';\nimport XeroAccountingSoftwareSettings from '../types/XeroAccountingSoftwareSettings';\nimport setupPopupWindow from '../utils/setupPopupWindow';\n\nimport BaseAccountingSoftwarePackage from './BaseAccountingSoftwarePackage';\n\nclass XeroAccountingPackage extends BaseAccountingSoftwarePackage {\n // TODO: remove vendor logo from public dir once we fully migrate to the new UI\n readonly logoUrl = `${import.meta.env.APP_STATIC_APP_ROOT_URL}/img/vendor/xero-icon.svg`;\n\n readonly icon = XeroLogo;\n\n supportsInvoices = true;\n\n constructor() {\n super(SupportedAccountingSoftware.Xero);\n }\n\n FilterResolutions(conflictingAccountName: string): string {\n return conflictingAccountName;\n }\n\n ConnectConnectIcon(): string {\n return 'third_party_xero_connect';\n }\n\n // callback that is called via pop-up when OAuth has been completed\n async Connected(info: any): Promise {\n const companyId: string = this.companyService.CompanyId();\n\n try {\n await ApiService.put(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/companies/${companyId}/xero/oauth`,\n { body: info }\n );\n } catch (error) {\n if ((error as ApiErrorResponse).type === 'invalid.companySelection') {\n // This will show if you don't select a new organisation\n titleMessageLinkModal.show({\n title: 'Please Select An Organisation',\n optionText: 'View \"Reconnecting to Xero\" Article',\n optionLink:\n 'https://www.plooto.com/support/s/article/connect-xero-to-your-plooto-account',\n message:\n 'You must select a new Xero organisation to connect to. Each Xero organisation can only be connected to ONE Plooto company. ' +\n 'If your organisation was previously connected or is not selectable, disconnect your Xero company and connect it again. ' +\n 'Please read the \"Reconnecting to Xero\" section in the \"Connect Xero to Plooto\" help article below.',\n svgIconSymbolLarge: 'svg-warning-large',\n });\n }\n return;\n }\n\n this.fireAccountingSoftwareConnectedEvent();\n\n analytics.send('event', 'action', 'completed', 'Connected Xero');\n analytics.send('event', 'Company-AccountingSoftware', 'Connect', 'Xero');\n\n // if accounting software has re-connected manually trigger mutation\n this.companyService.membership().company().accountingSoftware.valueHasMutated?.();\n }\n\n // called via callback once user clicks on \"connect\" button\n async Connect(): Promise {\n const companyId: string = this.companyService.CompanyId();\n\n const oauthData = await ApiService.get(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/companies/${companyId}/xero/oauth`\n );\n\n // set global variable for window so it can be accessed via \"window.opener\" by callback url\n // @ts-expect-error: Property 'XeroAccountingPackage' does not exist on type 'Window & typeof globalThis'.\n window.XeroAccountingPackage = this;\n\n const popup = setupPopupWindow({ width: 750, height: 810 });\n if (popup) {\n popup.location.href = oauthData.url;\n }\n }\n\n // generates a clickable link that starts connection process\n GenerateConnectButton($target: JQuery, context?: string): void {\n $('', {\n href: '#',\n class: 'third_party_xero_connect',\n })\n .appendTo($target)\n .click(() => {\n this.fireAccountingSoftwareConnectingEvent(context);\n this.Connect();\n return false;\n });\n }\n\n async AddAccount(account: IAccount): Promise {\n const companyId: string = this.companyService.CompanyId();\n\n const response = await ApiService.put(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/companies/${companyId}/xero/accounts`,\n { body: account }\n );\n\n return response;\n }\n\n async PostSettings(\n xeroAccountingSoftwareSettings: XeroAccountingSoftwareSettings\n ): Promise {\n const companyId: string = this.companyService.CompanyId();\n\n const data = await ApiService.post(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/companies/${companyId}/xero/settings`,\n { body: xeroAccountingSoftwareSettings }\n );\n\n return data;\n }\n\n async GetContacts(): Promise> {\n const companyId: string = this.companyService.CompanyId();\n\n const contacts = await ApiService.get>(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/companies/${companyId}/xero/contacts`\n );\n\n return contacts;\n }\n\n async GetAccounts(): Promise> {\n const companyId: string = this.companyService.CompanyId();\n\n const accounts = await ApiService.get>(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/companies/${companyId}/xero/accounts`\n );\n\n return accounts;\n }\n\n async fetchCompany(): Promise {\n const companyId: string = this.companyService.CompanyId();\n\n const response = await ApiService.get(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/companies/${companyId}/xero/company`\n );\n\n return response;\n }\n\n async GetBills(): Promise> {\n const companyId: string = this.companyService.CompanyId();\n\n const billData = await ApiService.get>(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/companies/${companyId}/xero/bills`\n );\n\n if (companyId !== this.companyService.CompanyId()) {\n throw new Error('Company switched while fetching bills');\n }\n\n return billData.map((data) => new Bill(data));\n }\n\n async GetInvoices(): Promise> {\n const companyId: string = this.companyService.CompanyId();\n\n const invoiceData = await ApiService.get>(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/companies/${companyId}/xero/invoices`\n );\n\n if (companyId !== this.companyService.CompanyId()) {\n throw new Error('Company switched while fetching invoices');\n }\n\n return invoiceData.map((data) => new Invoice(data));\n }\n\n GetBillAttachment(attachment: IBillAttachmentDetails) {\n const popup = setupPopupWindow({ width: 800, height: 650 });\n if (popup) {\n popup.location.href = attachment.url;\n }\n }\n\n async GetReconciliationStatus(): Promise {\n return 'Reconciled';\n }\n\n async getFullVendorDetails(vendorDetails: any): Promise {\n // Xero requires an additional call to fetch full vendor details\n const url = `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyService.Instance.CompanyId()}/xero/vendors/${\n vendorDetails.id\n }`;\n const data = ApiService.get(url);\n return data;\n }\n\n async getFullCustomerDetails(customerDetails: any): Promise {\n // Xero requires an additional call to fetch full vendor details\n const url = `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyService.Instance.CompanyId()}/xero/customers/${\n customerDetails.id\n }`;\n const data = await ApiService.get(url);\n return data;\n }\n}\n\nexport default XeroAccountingPackage;\n","import * as ko from 'knockout';\n\nimport IAccountingSoftwarePackage from '../types/IAccountingSoftwarePackage';\nimport { SupportedAccountingSoftwareType } from '../types/SupportedAccountingSoftware';\n\nimport NetSuiteAccountingPackage from './NetSuiteAccountingPackage';\nimport QuickBooksDesktopAccountingPackage from './QuickBooksDesktopAccountingPackage';\nimport QuickBooksOnlineAccountingPackage from './QuickBooksOnlineAccountingPackage';\nimport XeroAccountingPackage from './XeroAccountingPackage';\n\nclass AccountingSoftwareService {\n /** All accounting software packages available to the current company */\n public packages = ko.observable([\n new QuickBooksOnlineAccountingPackage(),\n new QuickBooksDesktopAccountingPackage(),\n new XeroAccountingPackage(),\n new NetSuiteAccountingPackage(),\n ] as Array);\n\n /** Get all accounting software packages available for the current company */\n public GetPackages(): Array {\n return this.packages();\n }\n\n /** Get a specific (available) accounting software package */\n public GetPackage(id: SupportedAccountingSoftwareType): IAccountingSoftwarePackage | undefined {\n return this.packages().find((p) => p.id === id);\n }\n}\n\nconst Instance = new AccountingSoftwareService();\n\nexport { AccountingSoftwareService };\nexport { Instance };\n","import * as ko from 'knockout';\nimport XDate from 'xdate';\n\nimport BillData from '@/features/accounting-software/types/BillData';\nimport BillTrackingCategories from '@/features/accounting-software/types/BillTrackingCategories';\nimport IBillAttachmentDetails from '@/features/accounting-software/types/IBillAttachmentDetails';\nimport IBillVendorDetails from '@/features/accounting-software/types/IBillVendorDetails';\n\nclass Bill {\n public amount: number;\n\n public memo: string;\n\n public billNumber: string;\n\n public id: string;\n\n public currency: string;\n\n public date: Date;\n\n public pay: KnockoutObservable = ko.observable(false);\n\n public vendor: IBillVendorDetails;\n\n public attachments = ko.observableArray([]);\n\n public hasAttachments: boolean;\n\n public attachmentStatus = ko.observable('loadRequired');\n\n public trackingCategories: BillTrackingCategories;\n\n constructor(data: BillData) {\n this.vendor = data.vendor;\n\n const utcDate = new XDate(data.date, true); // Date comes in this format: \"2019-01-01T00:00:00Z\" (Parse it in UTC format)\n this.date = new Date(utcDate.getFullYear(), utcDate.getMonth(), utcDate.getDate()); // re-create the date to base it users browser timezone\n\n this.amount = data.amount;\n this.billNumber = data.billNumber;\n this.id = data.id;\n this.currency = data.currency;\n this.hasAttachments = data.hasAttachments;\n this.trackingCategories = data.trackingCategories;\n\n if (data.attachments?.length > 0) {\n this.attachmentStatus('loaded');\n\n data.attachments.forEach((attachment: IBillAttachmentDetails) => {\n this.attachments.push(attachment);\n });\n }\n\n if (data.memo) {\n this.memo = data.memo;\n }\n }\n}\n\nexport default Bill;\n","import * as ko from 'knockout';\nimport XDate from 'xdate';\n\nimport IBillAttachmentDetails from '@/features/accounting-software/types/IBillAttachmentDetails';\nimport IInvoiceCustomerDetails from '@/features/accounting-software/types/IInvoiceCustomerDetails';\nimport InvoiceData from '@/features/accounting-software/types/InvoiceData';\n\n// @todo just a copy of bill for now\nclass Invoice {\n public amount: number;\n\n public memo: string;\n\n public invoiceNumber: string;\n\n public id: string;\n\n public currency: string;\n\n public date: Date;\n\n public pay: KnockoutObservable = ko.observable(false);\n\n public customer: IInvoiceCustomerDetails;\n\n public inProgress: boolean;\n\n public attachments = ko.observableArray([]);\n\n public hasAttachments: boolean;\n\n public isPadAgreementCompleted: boolean;\n\n public attachmentStatus = ko.observable('loadRequired');\n\n constructor(data: InvoiceData) {\n // This pulls in customer prefill data like address details, print name on check as, etc...\n this.customer = data.customer;\n\n const utcDate = new XDate(data.date, true); // Date comes in this format: \"2019-01-01T00:00:00Z\" (Parse it in UTC format)\n this.date = new Date(utcDate.getFullYear(), utcDate.getMonth(), utcDate.getDate()); // re-create the date to base it users browser timezone\n\n this.amount = data.amount;\n this.invoiceNumber = data.invoiceNumber;\n this.id = data.id;\n this.currency = data.currency;\n this.inProgress = data.inProgress;\n this.hasAttachments = data.hasAttachments;\n this.isPadAgreementCompleted = data.isPadAgreementCompleted;\n\n if (data.memo) {\n this.memo = data.memo;\n }\n }\n}\n\nexport default Invoice;\n","/**\n * Supported accounting software types for syncing with Plooto\n * @constant\n */\nconst SupportedAccountingSoftware = {\n NetSuite: 'netsuite',\n QuickBooksDesktop: 'quickbooksdesktop',\n QuickBooksOnline: 'quickbooksonline',\n Xero: 'xero',\n} as const;\n\ntype SupportedAccountingSoftwareType =\n (typeof SupportedAccountingSoftware)[keyof typeof SupportedAccountingSoftware];\n\nexport type { SupportedAccountingSoftwareType };\nexport { SupportedAccountingSoftware };\n","import {\n SupportedAccountingSoftware,\n SupportedAccountingSoftwareType,\n} from '../types/SupportedAccountingSoftware';\n\nconst getAccountingSoftwareNameByType = (type: SupportedAccountingSoftwareType) => {\n switch (type) {\n case SupportedAccountingSoftware.NetSuite:\n return 'Oracle NetSuite';\n case SupportedAccountingSoftware.QuickBooksDesktop:\n return 'QuickBooks Desktop';\n case SupportedAccountingSoftware.QuickBooksOnline:\n return 'QuickBooks Online';\n case SupportedAccountingSoftware.Xero:\n return 'Xero';\n default:\n return '';\n }\n};\n\nexport { getAccountingSoftwareNameByType };\n","import {\n SupportedAccountingSoftware,\n SupportedAccountingSoftwareType,\n} from '../types/SupportedAccountingSoftware';\n\nconst getAccountingSoftwareShortNameByType = (type: SupportedAccountingSoftwareType) => {\n switch (type) {\n case SupportedAccountingSoftware.NetSuite:\n return 'NetSuite';\n case SupportedAccountingSoftware.QuickBooksDesktop:\n return 'QBD';\n case SupportedAccountingSoftware.QuickBooksOnline:\n return 'QBO';\n case SupportedAccountingSoftware.Xero:\n return 'Xero';\n default:\n return '';\n }\n};\n\nexport { getAccountingSoftwareShortNameByType };\n","import * as dialog from 'plugins/dialog';\n\nimport BaseModal from '@/legacy/modals/BaseModal';\n\ndeclareModules({\n 'modals/styled/titleMessageLink.html': () =>\n import('@/legacy/modals/styled/titleMessageLink.html'),\n});\n\ninterface ViewModelParams {\n title: string;\n\n message: string;\n messageHtml?: string;\n\n continueText?: string;\n\n optionText: string;\n optionLink: string;\n /**\n * Displayed as a button by default\n */\n optionAsLink?: boolean;\n /**\n * If specified do not navigate to optionLink and instead call this callback\n **/\n optionCallback?: () => void;\n\n svgIcon?: string;\n svgIconSymbol?: string;\n svgIconSymbolLarge?: string;\n}\n\nclass StyledModal extends BaseModal {\n view = 'modals/styled/titleMessageLink';\n\n public params: ViewModelParams;\n\n public continueText: string;\n\n public optionText: string;\n\n public optionLink: string;\n\n public optionCallback: () => void;\n\n public classes = {\n option: 'btn btn-block btn-lg btn-primary',\n cta: 'btn-secondary',\n };\n\n constructor(params: ViewModelParams) {\n super();\n this.params = params;\n this.continueText = params.continueText ? params.continueText : 'Close';\n this.optionText = params.optionText ? params.optionText : 'Continue';\n this.optionLink = params.optionLink;\n this.optionCallback = params.optionCallback;\n\n if (params.optionAsLink) {\n this.classes.option = '';\n this.classes.cta = 'btn-primary';\n }\n }\n\n public close(): void {\n dialog.close(this, false);\n }\n\n public selectOption(e: Event) {\n if (this.optionCallback) {\n this.optionCallback();\n dialog.close(this, true);\n return false; // Don't follow the link href\n }\n\n dialog.close(this, true);\n return true;\n }\n\n public static show(params: ViewModelParams): JQueryPromise {\n return dialog.show(new StyledModal(params));\n }\n}\n\nexport default StyledModal;\n"],"names":["API_PREFIX","CodatEvents","CodatDataType","setupPopupWindow","width","height","centered","parameters","location","left","window","screen","top","features","Object","keys","map","k","join","popup","open","document","write","BaseAccountingSoftwarePackage","usesCodat","syncProgress","ko","constructor","id","companyService","name","getAccountingSoftwareNameByType","shortName","getAccountingSoftwareShortNameByType","GetBillAttachment","attachment","GetId","GetName","GetShortName","SupportsInvoices","supportsInvoices","SyncData","syncType","Promise","resolve","getFullVendorDetails","vendorDetails","getFullCustomerDetails","customerDetails","fireAccountingSoftwareConnectingEvent","context","CompanyEventService","emit","AccountingSoftwareIntegrationEventsServiceEventType","AccountingPlatformConnectionInitiated","accountingPlatform","fireAccountingSoftwareConnectedEvent","AccountingPlatformConnected","SYNC_DATA_TYPES","Bills","Customers","Invoices","Suppliers","syncTimeoutError","Error","NetSuiteAccountingPackage","connectIcon","logoUrl","create","globalThis","import_meta_env","APP_STATIC_APP_ROOT_URL","icon","NetSuiteLogo","maxWaitTimeForDataSyncInMilliseconds","syncedDataTypes","syncedDataTypesSet","Set","read","progress","size","length","Number","isNaN","deferEvaluation","SupportedAccountingSoftware","NetSuite","GetAccounts","waitForSyncedDataTypes","companyId","CompanyId","url","URL","APP_URLS_API_URL","ApiService","get","toString","AddAccount","account","post","body","Connect","codatConnection","undefined","href","connectionLink","ConnectConnectIcon","Connected","info","console","log","FilterResolutions","conflictingAccountName","GenerateConnectButton","$target","$","class","appendTo","click","GetBills","billData","data","Bill","waitForCompanyDataSync","reject","has","Company","dataSyncSubscription","eventsService","on","DataSync","detail","dataType","off","setTimeout","fetchCompany","codatCompanyName","GetContacts","GetInvoices","invoiceData","Invoice","GetReconciliationStatus","hasSyncedDataTypes","dataTypes","every","requiredDataType","syncedDataTypesSubscription","subscription","subscribe","current","race","finally","dispose","syncTimeout","lastTimeDataTypeWasSynced","Date","now","syncStartTime","includes","push","elapsedTime","elapsedTimeInSeconds","Math","floor","timeRemaining","timeRemainingInSeconds","clearTimeout","analytics","then","response","isSyncRequestSent","catch","error","QBWCFileLink","file","link","QuickBooksDesktopAccountingPackage","QuickBooksIcon","QuickBooksDesktop","newAccountName","replace","trim","substring","put","router","DownloadQBWC","qbwcFile","downloadUrl","templateId","QuickBooksOnlineAccountingPackage","AccountingSoftware","QuickBooksOnline","connectUrl","oauthData","QuickBooksAccountingPackage","LinkSession","verifiedToken","GetToken","accessToken","XeroAccountingPackage","XeroLogo","Xero","type","titleMessageLinkModal","show","title","optionText","optionLink","message","svgIconSymbolLarge","membership","company","accountingSoftware","valueHasMutated","PostSettings","xeroAccountingSoftwareSettings","AccountingSoftwareService","packages","GetPackages","GetPackage","find","p","Instance","pay","attachments","attachmentStatus","vendor","utcDate","XDate","date","getFullYear","getMonth","getDate","amount","billNumber","currency","hasAttachments","trackingCategories","forEach","memo","customer","invoiceNumber","inProgress","isPadAgreementCompleted","declareModules","modals/styled/titleMessageLink.html","StyledModal","BaseModal","view","classes","option","cta","params","continueText","optionCallback","optionAsLink","close","dialog","selectOption","e"],"sourceRoot":""}