@eway-crm/connector 1.0.207 → 1.0.208

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,80 +1,81 @@
1
1
  declare class GlobalSettingsNames {
2
- static acceptableBackwardWorkReportDays: string;
3
- static adminAppInactiveLogoutTime: string;
4
- static applyGeneralDataProtectionRules: string;
5
- static automaticallyCreateJournalAfterCallDuration: string;
6
- static bonusesCompletedState: string;
7
- static cartInvoicedState: string;
8
- static cartOrderCanceledState: string;
9
- static cartOrderInProcessState: string;
10
- static cartOrderProcessedState: string;
11
- static cartPaidState: string;
12
- static cartProposalInProcessState: string;
13
- static cartProposalProcessedState: string;
14
- static cartSalesVoucherIssuedState: string;
15
- static cartToBeInvoicedState: string;
16
- static cartVoidedState: string;
17
- static clickToCallScheme: string;
18
- static companyDuplicityCheckEnabled: string;
19
- static completedStateName: string;
20
- static contactDuplicityCheckEnabled: string;
21
- static createCompanyWhileImportingContactFromOutlook: string;
22
- static enableContactsTwoWaySyncWithM365: string;
23
- static deadStateName: string;
24
- static enableCompaniesSyncIntoMobileDeviceContacts: string;
25
- static enableContactsSyncIntoMobileDevice: string;
26
- static enableLeadsSyncIntoMobileDeviceContacts: string;
27
- static enableLlamaAiFeatures: string;
28
- static enableUsersSyncIntoMobileDeviceContacts: string;
29
- static emailsActiveProjectsLeadsFilter: string;
30
- static exchangeRatesAdminGroupName: string;
31
- static forcedEmailTrackingGroups: string;
32
- static ignoreEmailsFromDomainsOnEmailsTracking: string;
33
- static trackEmailsFromDomains: string;
34
- static groupsForAllUnpaidInvoicesNotification: string;
35
- static itemPreviewMaxHeight: string;
36
- static lastActivityAttributes: string;
37
- static leadsCompletedState: string;
38
- static leadDeadlineAlertGroups: string;
39
- static leadsDeadState: string;
40
- static marketingCompletedState: string;
41
- static marketingDeadState: string;
42
- static minimumPasswordLength: string;
43
- static nextStepAttributes: string;
44
- static notifyAboutInvoicedInvoiceInPohodaGroup: string;
45
- static notifyAboutLeadsDeadline: string;
46
- static notifyAboutPaidInvoiceInPohodaGroup: string;
47
- static notifyAboutProjectDeadline: string;
48
- static numberOfDecimalPlaces: string;
49
- static phoneListTaskSolverGroup: string;
50
- static projectDeadlineAlert: string;
51
- static serverUpdateProgressNotificationGroup: string;
52
- static sumarizeCartsPricesOnLeads: string;
53
- static sumarizeCartsPricesOnProjects: string;
54
- static sumarizePeopleExpensesOnProjects: string;
55
- static systemHealthNotificationGroup: string;
56
- static tasksCompletedState: string;
57
- static tasksDeferredState: string;
58
- static tasksInProgressState: string;
59
- static tasksNotStartedState: string;
60
- static tasksWaitOnSomeoneElseState: string;
61
- static trackDocumentVersions: string;
62
- static vacationCompletedState: string;
63
- static workReportApprovedState: string;
64
- static defaultLanguage: string;
65
- static defaultCurrency: string;
66
- static myCompanyCountry: string;
67
- static myCompanyName: string;
68
- static myCompanyStreet: string;
69
- static myCompanyCity: string;
70
- static myCompanyState: string;
71
- static myCompanyZip: string;
72
- static myCompanyId: string;
73
- static myCompanyVat: string;
74
- static mergeGoodsInCart: string;
75
- static cartRefreshLogic: string;
76
- static goodsDefaultQuantity: string;
77
- static goodsDefaultVAT: string;
78
- static goodsDefaultVATIncluded: string;
2
+ static readonly acceptableBackwardWorkReportDays = "AcceptableBackwardWorkReportDays";
3
+ static readonly adminAppInactiveLogoutTime = "AdminAppInactiveLogoutTime";
4
+ static readonly applyGeneralDataProtectionRules = "ApplyGeneralDataProtectionRules";
5
+ static readonly automaticallyCreateJournalAfterCallDuration = "AutomaticallyCreateJournalAfterCallDuration";
6
+ static readonly bonusesCompletedState = "BonusesCompletedState";
7
+ static readonly cartInvoicedState = "CartInvoicedState";
8
+ static readonly cartOrderCanceledState = "CartOrderCanceledState";
9
+ static readonly cartOrderInProcessState = "CartOrderInProcessState";
10
+ static readonly cartOrderProcessedState = "CartOrderProcessedState";
11
+ static readonly cartPaidState = "CartPaidState";
12
+ static readonly cartProposalInProcessState = "CartProposalInProcessState";
13
+ static readonly cartProposalProcessedState = "CartProposalProcessedState";
14
+ static readonly cartSalesVoucherIssuedState = "CartSalesVoucherIssuedState";
15
+ static readonly cartToBeInvoicedState = "CartToBeInvoicedState";
16
+ static readonly cartVoidedState = "CartVoidedState";
17
+ static readonly clickToCallScheme = "ClickToCallScheme";
18
+ static readonly companyDuplicityCheckEnabled = "CompanyDuplicityCheckEnabled";
19
+ static readonly completedStateName = "CompletedStateName";
20
+ static readonly contactDuplicityCheckEnabled = "ContactDuplicityCheckEnabled";
21
+ static readonly createCompanyWhileImportingContactFromOutlook = "CreateCompanyWhileImportingContactFromOutlook";
22
+ static readonly defaultProposalValidityPeriod = "DefaultProposalValidityPeriod";
23
+ static readonly enableContactsTwoWaySyncWithM365 = "EnableContactsTwoWaySyncWithM365";
24
+ static readonly deadStateName = "DeadStateName";
25
+ static readonly enableCompaniesSyncIntoMobileDeviceContacts = "EnableCompaniesSyncIntoMobileDeviceContacts";
26
+ static readonly enableContactsSyncIntoMobileDevice = "EnableContactsSyncIntoMobileDevice";
27
+ static readonly enableLeadsSyncIntoMobileDeviceContacts = "EnableLeadsSyncIntoMobileDeviceContacts";
28
+ static readonly enableLlamaAiFeatures = "EnableLlamaAiFeatures";
29
+ static readonly enableUsersSyncIntoMobileDeviceContacts = "EnableUsersSyncIntoMobileDeviceContacts";
30
+ static readonly emailsActiveProjectsLeadsFilter = "EmailsActiveProjectsLeadsFilter";
31
+ static readonly exchangeRatesAdminGroupName = "ExchangeRatesAdminGroupName";
32
+ static readonly forcedEmailTrackingGroups = "ForcedEmailTrackingGroups";
33
+ static readonly ignoreEmailsFromDomainsOnEmailsTracking = "IgnoreEmailsFromDomainsOnEmailsTracking";
34
+ static readonly trackEmailsFromDomains = "TrackEmailsFromDomains";
35
+ static readonly groupsForAllUnpaidInvoicesNotification = "GroupsForAllUnpaidInvoicesNotification";
36
+ static readonly itemPreviewMaxHeight = "ItemPreviewMaxHeight";
37
+ static readonly lastActivityAttributes = "LastActivityAttributes";
38
+ static readonly leadsCompletedState = "LeadsCompletedState";
39
+ static readonly leadDeadlineAlertGroups = "LeadDeadlineAlertGroups";
40
+ static readonly leadsDeadState = "LeadsDeadState";
41
+ static readonly marketingCompletedState = "MarketingCompletedState";
42
+ static readonly marketingDeadState = "MarketingDeadState";
43
+ static readonly minimumPasswordLength = "MinimumPasswordLength";
44
+ static readonly nextStepAttributes = "NextStepAttributes";
45
+ static readonly notifyAboutInvoicedInvoiceInPohodaGroup = "NotifyAboutInvoicedInvoiceInPohodaGroup";
46
+ static readonly notifyAboutLeadsDeadline = "NotifyAboutLeadsDeadline";
47
+ static readonly notifyAboutPaidInvoiceInPohodaGroup = "NotifyAboutPaidInvoiceInPohodaGroup";
48
+ static readonly notifyAboutProjectDeadline = "NotifyAboutProjectDeadline";
49
+ static readonly numberOfDecimalPlaces = "NumberOfDecimalPlaces";
50
+ static readonly phoneListTaskSolverGroup = "PhoneListTaskSolverGroup";
51
+ static readonly projectDeadlineAlert = "ProjectDeadlineAlert";
52
+ static readonly serverUpdateProgressNotificationGroup = "ServerUpdateProgressNotificationGroup";
53
+ static readonly sumarizeCartsPricesOnLeads = "SumarizeCartsPricesOnLeads";
54
+ static readonly sumarizeCartsPricesOnProjects = "SumarizeCartsPricesOnProjects";
55
+ static readonly sumarizePeopleExpensesOnProjects = "SumarizePeopleExpensesOnProjects";
56
+ static readonly systemHealthNotificationGroup = "SystemHealthNotificationGroup";
57
+ static readonly tasksCompletedState = "TasksCompletedState";
58
+ static readonly tasksDeferredState = "TasksDeferredState";
59
+ static readonly tasksInProgressState = "TasksInProgressState";
60
+ static readonly tasksNotStartedState = "TasksNotStartedState";
61
+ static readonly tasksWaitOnSomeoneElseState = "TasksWaitOnSomeoneElseState";
62
+ static readonly trackDocumentVersions = "TrackDocumentVersions";
63
+ static readonly vacationCompletedState = "VacationCompletedState";
64
+ static readonly workReportApprovedState = "WorkReportApprovedState";
65
+ static readonly defaultLanguage = "DefaultLanguage";
66
+ static readonly defaultCurrency = "DefaultCurrency";
67
+ static readonly myCompanyCountry = "MyCompanyCountry";
68
+ static readonly myCompanyName = "MyCompanyName";
69
+ static readonly myCompanyStreet = "MyCompanyStreet";
70
+ static readonly myCompanyCity = "MyCompanyCity";
71
+ static readonly myCompanyState = "MyCompanyState";
72
+ static readonly myCompanyZip = "MyCompanyZIP";
73
+ static readonly myCompanyId = "MyCompanyID";
74
+ static readonly myCompanyVat = "MyCompanyVAT";
75
+ static readonly mergeGoodsInCart = "MergeGoodsInCart";
76
+ static readonly cartRefreshLogic = "CartRefreshLogic";
77
+ static readonly goodsDefaultQuantity = "GoodsDefaultQuantity";
78
+ static readonly goodsDefaultVAT = "GoodsDefaultVAT";
79
+ static readonly goodsDefaultVATIncluded = "GoodsDefaultVATIncluded";
79
80
  }
80
81
  export default GlobalSettingsNames;
package/lib/cjs/index.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * @license Licensed under MIT license
6
6
  * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
7
7
  * @version v4.2.8+1e68dce6
8
- */class u{}u.rcSuccess="rcSuccess",u.rcBadSession="rcBadSession",u.rcDuplicateContact="rcDuplicateContact",u.rcWebServiceMoved="rcWebServiceMoved",u.rcAccessDenied="rcAccessDenied",u.rcLoginUserNameChanged="rcLoginUserNameChanged",u.rcLicenseExpired="rcLicenseExpired",exports.HttpMethod=void 0,(a=exports.HttpMethod||(exports.HttpMethod={})).get="get",a.post="post";class d{}d.absence="Absence",d.bonusType="BonusType",d.busyStatus="BusyStatus",d.cartType="CartType",d.companyType="CompanyType",d.contactType="ContactType",d.countryCode="CountryCode",d.currency="Currency",d.customFieldCategory="CustomFieldCategory",d.dayType="DayType",d.documentOfflineState="DocumentOfflineState",d.documentType="DocumentType",d.emailCampaignWorkflowStatus="EmailCampaignWorkflowStatus",d.emailOfflineState="EmailOfflineState",d.emailType="EmailType",d.familyStatus="FamilyStatus",d.firstContact="FirstContact",d.globalSettingsCategory="GlobalSettingsCategory",d.goalType="GoalType",d.groupColor="GroupColor",d.importance="Importance",d.journalType="JournalType",d.knowledgeLevel="KnowledgeLevel",d.knowledgeTitle="KnowledgeTitle",d.knowledgeType="KnowledgeType",d.leadType="LeadType",d.marketingType="MarketingType",d.paymentType="PaymentType",d.prefixType="PrefixType",d.productType="ProductType",d.projectOrigin="ProjectOrigin",d.projectType="ProjectType",d.reportCategory="ReportCategory",d.responseForm="ResponseForm",d.responseType="ResponseType",d.salaryDate="SalaryDate",d.salaryType="SalaryType",d.salePriceType="SalePriceType",d.sentimentTone="SentimentTone",d.suffixType="SuffixType",d.taskImportance="TaskImportance",d.tasksSnoozePeriod="TasksSnoozePeriod",d.taskStatus="TaskStatus",d.taskType="TaskType",d.trainingGrade="TrainingGrade",d.trainingTitle="TrainingTitle",d.translations="Translations",d.units="Units",d.userType="UserType",d.usStatesDistrictsTerritories="USStatesDistrictsTerritories",d.vacationType="VacationType",d.vat="VAT",d.workLoad="WorkLoad",d.workReportType="WorkReportType";class m{}m.isValidFolderName=e=>Object.values(m).includes(e),m.actions="Actions",m.additionalFields="AdditionalFields",m.bonuses="Bonuses",m.calendar="Calendar",m.capacityNotes="CapacityNotes",m.capacityNoteTypes="CapacityNoteTypes",m.carts="Carts",m.columnPermissions="ColumnPermissions",m.companies="Companies",m.contacts="Contacts",m.contactsSuggestions="ContactsSuggestions",m.currencyExchangeRates="CurrencyExchangeRates",m.documents="Documents",m.emails="Emails",m.enumTypes="EnumTypes",m.enumValues="EnumValues",m.enumValuesRelations="EnumValuesRelations",m.features="Features",m.flows="Flows",m.globalSettings="GlobalSettings",m.goals="Goals",m.goods="Goods",m.goodsInCart="GoodsInCart",m.goodsInSet="GoodsInSet",m.groups="Groups",m.history="History",m.holidays="Holidays",m.children="Children",m.individualDiscounts="IndividualDiscounts",m.invoiceItems="InvoiceItems",m.invoices="Invoices",m.itemCopyRelations="ItemCopyRelations",m.journal="Journal",m.knowledge="Knowledge",m.layouts="Layouts",m.layoutsModels="LayoutsModels",m.leads="Leads",m.ledger="Ledger",m.mappings="Mappings",m.marketing="Marketing",m.marketingList="MarketingList",m.marketingListSources="MarketingListSources",m.models="Models",m.modulePermissions="ModulePermissions",m.objectTypesOptions="ObjectTypesOptions",m.payments="Payments",m.priceListGroups="PriceListGroups",m.projectAssignments="ProjectAssignments",m.projectAssignmentsPerUserProject="ProjectAssignmentsPerUserProject",m.projectAssignmentsTotal="ProjectAssignmentsTotal",m.projectAssignmentsTotalUserProject="ProjectAssignmentsTotalUserProject",m.projectList="ProjectList",m.projects="Projects",m.projectUsersInCaPlan="ProjectUsersInCaPlan",m.relationData="RelationData",m.relations="Relations",m.reports="Reports",m.revisionsHistory="RevisionsHistory",m.salaries="Salaries",m.salePrices="SalePrices",m.prices="Prices",m.sqlObjects="SqlObjects",m.tasks="Tasks",m.recurrencePatterns="RecurrencePatterns",m.teamRoles="TeamRoles",m.templates="Templates",m.training="Training",m.unifiedRelations="UnifiedRelations",m.users="Users",m.userSettings="UserSettings",m.vacation="Vacation",m.webAccess2Options="WebAccess2Options",m.webAccessOptions="WebAccessOptions",m.workCommitments="WorkCommitments",m.workflowHistory="WorkflowHistory",m.workReports="WorkReports",m.wrongClientVersions="WrongClientVersions",m.xsltTransformations="XsltTransformations",m.xsltTransformationsModels="XsltTransformationsModels",m.getEnumTypeName=e=>e===m.bonuses?d.bonusType:e===m.carts?d.cartType:e===m.companies?d.companyType:e===m.contacts?d.contactType:e===m.documents?d.documentType:e===m.emails?d.emailType:e===m.goals?d.goalType:e===m.goods?d.productType:e===m.journal?d.journalType:e===m.knowledge?d.knowledgeType:e===m.leads?d.leadType:e===m.marketing?d.marketingType:e===m.projects?d.projectType:e===m.salaries?d.salaryType:e===m.salePrices?d.salePriceType:e===m.tasks?d.taskType:e===m.training?d.trainingTitle:e===m.users?d.userType:e===m.vacation?d.vacationType:e===m.workReports?d.workReportType:null,m.getFolderNameByEnumTypeName=e=>e===d.bonusType?m.bonuses:e===d.cartType?m.carts:e===d.companyType?m.companies:e===d.contactType?m.contacts:e===d.documentType?m.documents:e===d.emailType?m.emails:e===d.goalType?m.goals:e===d.journalType?m.journal:e===d.knowledgeType?m.knowledge:e===d.leadType?m.leads:e===d.marketingType?m.marketing:e===d.productType?m.goods:e===d.projectType?m.projects:e===d.salaryType?m.salaries:e===d.salePriceType?m.salePrices:e===d.taskType?m.tasks:e===d.trainingTitle?m.training:e===d.userType?m.users:e===d.vacationType?m.vacation:e===d.workReportType?m.workReports:null;class p{}p.getAllEmailAttachments="GetAllEmailAttachments",p.getCalendarsByItemGuids="GetCalendarsByItemGuids",p.getEmailAttachment="GetEmailAttachment",p.getItemPreview="GetItemPreview",p.getJournalsByItemGuids="GetJournalsByItemGuids",p.getMarketingCampaignsByItemGuids="GetMarketingCampaignsByItemGuids",p.getMarketingListsRecordsByItemGuids="GetMarketingListsRecordsByItemGuids",p.getRevisionHistoryRecordsByItemGuids="GetRevisionHistoryRecordsByItemGuids",p.getVacationsByItemGuids="GetVacationsByItemGuids",p.getWorkflowHistoryRecordsByItemGuids="GetWorkflowHistoryRecordsByItemGuids",p.getCompanyInformationFromTaxRegister="GetCompanyInformationFromTaxRegister",p.logIn="LogIn",p.logOut="LogOut",p.query="Query",p.queryAmount="QueryAmount",p.getServiceAuthSettings="GetServiceAuthSettings",p.getVersion="GetVersion",p.getBinaryAttachment="GetBinaryAttachment",p.getBinaryAttachmentLatestRevision="GetBinaryAttachmentLatestRevision",p.transformItem="TransformItem",p.canUnlinkItems="CanUnlinkItems",p.unlinkItems="UnlinkItems",p.getGoodsFinalPrices="GetGoodsFinalPrices",p.saveItemCopyRelation="SaveItemCopyRelation",p.getFolderNameForApiMethod=e=>{switch(e){case m.calendar:return"Calendars";case m.journal:return"Journals";case m.marketing:return"MarketingCampaigns";case m.marketingList:return"MarketingListsRecords";case m.revisionsHistory:return"RevisionHistoryRecords";case m.vacation:return"Vacations";case m.workflowHistory:return"WorkflowHistoryRecords";default:return e}},p.getGetFolderNameByItemGuidsMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}ByItemGuids`,p.getGetFolderNameMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}`,p.getSearchFolderNameMethodName=e=>`Search${p.getFolderNameForApiMethod(e)}`;class y{constructor(e,t,r,s,o,n){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{e.callWithoutSession(p.logIn,{userName:this.username,passwordHash:this.passwordHash,appVersion:this.appVersion,clientMachineIdentifier:this.clientMachineIdentifier,clientMachineName:this.clientMachineName,createSessionCookie:e.supportsGetItemPreviewMethod},(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new Error("Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)}))},!e||!t)throw new Error("Non of the arguments 'username', 'passwordHash' can be empty.");this.username=e,this.passwordHash=t,this.appVersion=r,this.clientMachineIdentifier=s,this.clientMachineName=o,this.errorCallback=n}}class h{constructor(){this.getSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")},this.invalidateSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")}}}class C{static createAuthorizeUrl(e,t,r,s,o,n,i=!1){if(o&&!n||!o&&n)throw new Error("If codeChallenge is defined, codeChallengeMethod must also be defined and vice versa");let a=`https://login.eway-crm.${i?"dev":"com"}?scope=${encodeURIComponent(t.join(" "))}&prompt=login&response_type=code&redirect_uri=${encodeURIComponent(r)}&client_id=${e}`;return s&&(a+=`&state=${encodeURIComponent(s)}`),o&&n&&(a+=`&code_challenge=${encodeURIComponent(o)}&code_challenge_method=${encodeURIComponent(n)}`),a}}C.finishAuthorization=(e,t,r,s,o,n,i)=>{const a=new URLSearchParams;a.append("code_verifier",s),a.append("client_id",t),a.append("client_secret",r),a.append("code",o),a.append("redirect_uri",n),a.append("grant_type","authorization_code"),C.callTokenEndpoint(e,a,i)},C.refreshToken=(e,t,r,s,o)=>{const n=new URLSearchParams;n.append("client_id",t),n.append("client_secret",r),n.append("refresh_token",s),n.append("grant_type","refresh_token"),C.callTokenEndpoint(e,n,o)},C.getWebServiceUrl=e=>{const t=e.split(".");if(2!==t.length)throw new Error("Invalid token supplied");return n.decode(t[1])},C.getUserName=e=>C.decodeAccessToken(e).username,C.decodeAccessToken=e=>r(e),C.callTokenEndpoint=(t,r,s)=>{e.post(t+"/auth/connect/token",r,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((e=>{s(e.data)})).catch((e=>{e.response&&400==e.response.status?s(e.response.data):s({error:"Token request failed"})}))};class P extends Error{constructor(e,t){super(),this.returnCode=e,this.message=t}}class f{constructor(e,t,r,s,o){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{const r={userName:this.username,appVersion:this.appVersion,createSessionCookie:e.supportsGetItemPreviewMethod},s={Authorization:"Bearer "+this.accessToken};e.callWithoutSession(p.logIn,r,(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new P(e.ReturnCode,"Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)}),s,void 0,(r=>{if(401!==(null==r?void 0:r.statusCode)){if(!this.errorCallback)throw r;this.errorCallback(r)}else this.getNewAccessTokenCallback(e,(r=>{this.accessToken=r.accessToken,r.error||this.getSessionId(e,t)}))}))},!e)throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");this.username=e,this.accessToken=t,this.appVersion=r,this.getNewAccessTokenCallback=s,this.errorCallback=o}}class g extends f{constructor(e,t,r,s,o,n,i,a){if(!(e&&s&&t&&r))throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");super(e,o,n,((e,t)=>{C.refreshToken(e.wsUrl,this.clientId,this.clientSecret,this.refreshToken,(e=>{try{this.refreshTokenCallback&&this.refreshTokenCallback(e)}catch(e){this.errorCallback&&this.errorCallback(new Error("Refresh token callback failed.\n"+JSON.stringify(e)))}void 0!==e.error?t({error:e.error}):t({accessToken:e.access_token})}))}),i),this.refreshToken=s,this.clientId=t,this.clientSecret=r,this.refreshTokenCallback=a}}class T extends Error{constructor(e,t){super(),this.statusCode=e,this.message=t}}class E{}E.stringifyError=e=>JSON.stringify(e,E.replaceErrors),E.replaceErrors=(e,t)=>{if(t instanceof Error){const e={};return Object.getOwnPropertyNames(t).forEach((r=>{e[r]=t[r]})),e}return t};class S{constructor(t,r,s,o){if(this.ensureLogin=()=>new Promise(((e,t)=>{if(this.sessionId)e();else{const r=r=>{r&&(this.sessionId=r,e()),t("Session Id cannot be empty")};this.sessionHandler.getSessionId(this,r)}})),this.createOpenLink=(e,t,r,s)=>{const o=n.encode(this.baseUri);let i="eway://"+t;r&&(i+="/"+(null==r?void 0:r.toLowerCase()));const a=e?"open.eway-crm.dev":"open.eway-crm.com";i=n.encode(i);let l="https://"+a+"/?ws="+o+"&l="+i;return s&&(l+="&n="+encodeURIComponent(s)),l},this.askUploadMethod=(e,t,r,s,o)=>new Promise(((n,i)=>{const a=o?e=>{throw i(e),e}:i;this.callUploadMethod(e,t,r,n,a,a,s)})),this.callUploadMethod=(t,r,s,o,n,i,a)=>{const l=()=>{this.sessionHandler.getSessionId(this,(e=>{this.sessionId=e,this.callUploadMethod(t,r,s,o,n,i,a)}))},c=this.sessionId;if(!c)return void l();const d=`${this.svcUri}/SaveBinaryAttachment?sessionId=${this.sessionId}&itemGuid=${t}&fileName=${encodeURIComponent(r)}`,m=e.post(d,s,a);S.handleCallPromise(m,o,(e=>{if(e.ReturnCode===u.rcBadSession)return this.sessionId=null,void this.sessionHandler.invalidateSessionId(c,l);if(n)n(e);else{const t=new Error("Unhandled connection return code "+e.ReturnCode+": "+e.Description);if(!this.errorCallback)throw t;this.errorCallback(t)}}),(e=>{let t=new Error("Unhandled connection error when calling "+d+": "+E.stringifyError(e));if("statusCode"in e&&413===e.statusCode&&(t=new Error("The file has exceeded the maximum allowed file size for uploading. You can contact your IT administrator or eWay-CRM support if you would like to increase the limit.")),i)i(t);else{if(!this.errorCallback)throw t;this.errorCallback(t)}}))},this.askMethod=(e,t,r,s)=>new Promise(((o,n)=>{const i=s?e=>{throw n(e),e}:n;this.callMethod(e,t,o,i,r,i)})),this.callMethod=(e,t,r,s,o,n)=>{o||(o=exports.HttpMethod.post);const i=()=>{this.sessionHandler.getSessionId(this,(i=>{this.sessionId=i,this.callMethod(e,t,r,s,o,n)}))},a=this.sessionId;if(!a)return void i();t.sessionId=a;const l=e!==p.logOut?r:e=>{this.sessionId=null,r(e)};this.callWithoutSession(e,t,l,(r=>{if(r.ReturnCode!==u.rcBadSession||(this.sessionId=null,e===p.logOut))if(s)s(r);else{const e=new Error("Unhandled connection return code "+r.ReturnCode+": "+r.Description);if(!this.errorCallback)throw e;this.errorCallback(e,t)}else this.sessionHandler.invalidateSessionId(a,i)}),null,o,n)},this.callWithoutSession=(t,r,s,o,n,i,a)=>{var l;i||(i=exports.HttpMethod.post);const c=this.svcUri+"/"+t;let u,d;switch(n&&(u={headers:n,withCredentials:null!==(l=this.supportGetItemPreviewMethod)&&void 0!==l?l:t==p.logIn}),i){case exports.HttpMethod.get:if(r)throw new Error("Calling api get method with data specified does not make any sense.");d=e.get(c,u);break;case exports.HttpMethod.post:d=e.post(c,r,u);break;default:throw new Error(`Unknown http method '${i}'.`)}S.handleCallPromise(d,s,o,(e=>{if(a)try{a(e)}catch(e){if(!this.errorCallback)throw e;this.errorCallback(e,r)}else{const t=new Error("Unhandled connection error when calling "+c+": "+E.stringifyError(e));if(!this.errorCallback)throw t;this.errorCallback(t,r)}}))},this.getItemPreviewGetMethodUrl=(e,t,r)=>this.svcUri+"/"+p.getItemPreview+"?folderName="+encodeURIComponent(e)+"&itemGuid="+encodeURIComponent(t)+(r||0===r?"&itemVersion="+encodeURIComponent(r.toString()):""),this.getEmailAttachmentGetMethodUrl=(e,t)=>this.svcUri+"/"+p.getEmailAttachment+"?itemGuid="+encodeURIComponent(e)+"&contentId="+encodeURIComponent(t),this.getAllEmailAttachmentsZipGetMethodUrl=e=>this.svcUri+"/"+p.getAllEmailAttachments+"?itemGuid="+encodeURIComponent(e),this.getBinaryAttachmentGetMethodUrl=(e,t)=>"number"==typeof t?this.svcUri+"/"+p.getBinaryAttachment+"?itemGuid="+encodeURIComponent(e)+`&revision=${t}`:this.svcUri+"/"+p.getBinaryAttachmentLatestRevision+"?itemGuid="+encodeURIComponent(e),this.getTransformItemMethodUrl=(e,t,r,s)=>`${this.svcUri}/${p.transformItem}?itemGuid=${encodeURIComponent(e)}&itemFolderName=${encodeURIComponent(t)}&transformationGuid=${encodeURIComponent(r)}&outputFormat=${s}`,this.getActiveSessionId=()=>this.sessionId,this.setActiveSessionId=e=>{this.sessionId=e},!t)throw new Error("The argument 'apiServiceUri' cannot be empty.");if(t.length<8||"https://"!==t.substr(0,8).toLowerCase()&&"http://"!==t.substr(0,7).toLowerCase())throw new Error("Api service uri must start either with 'https://' or with 'http://'.");if(".svc"===t.substr(t.length-4).toLowerCase()){this.svcUri=t;const e=["/API.svc","/InsecureAPI.svc","/WcfService/Service.svc"].find((e=>e.toLowerCase()===t.substr(t.length-e.length).toLowerCase()))||"";this.baseUri=t.substr(0,t.length-e.length)}else this.baseUri=S.normalizeWsUrl(t)||t,"https://"===t.substr(0,8).toLowerCase()?this.svcUri=this.baseUri+"/API.svc":this.svcUri=this.baseUri+"/InsecureAPI.svc";this.sessionHandler=r,this.errorCallback=s,this.sessionId=null,this.supportGetItemPreviewMethod=null!=o&&o}get supportsGetItemPreviewMethod(){return this.supportGetItemPreviewMethod}static create(e,t,r,s,o,n,i,a){return new S(e,new y(t,r,s,o,n,i),i,a)}static createAnonymous(e,t){return new S(e,new h,t)}static createUsingOAuth(e,t,r,s,o,n,i,a,l,c){return new S(e,new g(t,r,s,o,n,i,a,l),a,c)}static normalizeWsUrl(e){return e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),e}get wsUrl(){return this.baseUri}static handleCallPromise(e,t,r,s){e.then((e=>{200===e.status?e.data.ReturnCode===u.rcSuccess?t(e.data):r(e.data):s(new T(e.status,e.statusText))})).catch((e=>{e.response?s(new T(e.response.status,e.response.statusText)):s(e)}))}}class A{constructor(e,t,r,s,o,n,i){this.isEnabled=(e,t)=>{const r=()=>{this.url&&this.token?e(this.url,this.token):t()};this.url&&this.token?e(this.url,this.token):this.obtainToken(r)},this.callTokenizedApi=(e,t,r,s)=>{this.isEnabled(((o,n)=>{t.token=n,A.call(o,e,t,r,(o=>{if(o.ReturnCodeString!==this.invalidTokenReturnCode){if(s)s(o);else if(this.generalErrorCallback){const e=new Error("Unhandled tokenized service connection return code "+o.ReturnCodeString+".\nDescription: "+o.Description);this.generalErrorCallback(e)}}else this.obtainToken((()=>{this.callTokenizedApi(e,t,r,s)}))}),(e=>{if(this.generalErrorCallback){const t=new Error("Unhandled tokenized service connection communication error: "+JSON.stringify(e));this.generalErrorCallback(t)}}))}),(()=>{s&&s(null)}))},this.obtainToken=e=>{if(!this.isActive)return this.url=null,this.token=null,void e();const t=t=>{const r=this.urlAndTokenObtainer(t);r.url&&r.token?(this.url=r.url,this.token=r.token,this.isActive=!0,e()):(this.url=null,this.token=null,this.isActive=!1,e())},r=()=>{this.url=null,this.token=null,this.isActive=!1,e()};this.needsSession?this.connection.callMethod(this.obtainTokenMethodName,{},t,r,this.obtainTokenMethodType):this.connection.callWithoutSession(this.obtainTokenMethodName,null,t,r,null,this.obtainTokenMethodType)},this.obtainTokenMethodName=e,this.obtainTokenMethodType=t,this.needsSession=r,this.invalidTokenReturnCode=s,this.urlAndTokenObtainer=o,this.connection=n,this.generalErrorCallback=i||null,this.url=null,this.token=null,this.isActive=!0}static call(t,r,s,o,n,i){const a=t+"/"+r;e.post(a,s).then((e=>{200===e.status?"Success"===e.data.ReturnCodeString?o(e.data):n(e.data):i(new T(e.status,e.statusText))})).catch((e=>{e.response?i(new T(e.response.status,e.response.statusText)):i(e)}))}}const I=e=>({url:e.ServiceUrl,token:e.Token});class v{}v.acceptableBackwardWorkReportDays="AcceptableBackwardWorkReportDays",v.adminAppInactiveLogoutTime="AdminAppInactiveLogoutTime",v.applyGeneralDataProtectionRules="ApplyGeneralDataProtectionRules",v.automaticallyCreateJournalAfterCallDuration="AutomaticallyCreateJournalAfterCallDuration",v.bonusesCompletedState="BonusesCompletedState",v.cartInvoicedState="CartInvoicedState",v.cartOrderCanceledState="CartOrderCanceledState",v.cartOrderInProcessState="CartOrderInProcessState",v.cartOrderProcessedState="CartOrderProcessedState",v.cartPaidState="CartPaidState",v.cartProposalInProcessState="CartProposalInProcessState",v.cartProposalProcessedState="CartProposalProcessedState",v.cartSalesVoucherIssuedState="CartSalesVoucherIssuedState",v.cartToBeInvoicedState="CartToBeInvoicedState",v.cartVoidedState="CartVoidedState",v.clickToCallScheme="ClickToCallScheme",v.companyDuplicityCheckEnabled="CompanyDuplicityCheckEnabled",v.completedStateName="CompletedStateName",v.contactDuplicityCheckEnabled="ContactDuplicityCheckEnabled",v.createCompanyWhileImportingContactFromOutlook="CreateCompanyWhileImportingContactFromOutlook",v.enableContactsTwoWaySyncWithM365="EnableContactsTwoWaySyncWithM365",v.deadStateName="DeadStateName",v.enableCompaniesSyncIntoMobileDeviceContacts="EnableCompaniesSyncIntoMobileDeviceContacts",v.enableContactsSyncIntoMobileDevice="EnableContactsSyncIntoMobileDevice",v.enableLeadsSyncIntoMobileDeviceContacts="EnableLeadsSyncIntoMobileDeviceContacts",v.enableLlamaAiFeatures="EnableLlamaAiFeatures",v.enableUsersSyncIntoMobileDeviceContacts="EnableUsersSyncIntoMobileDeviceContacts",v.emailsActiveProjectsLeadsFilter="EmailsActiveProjectsLeadsFilter",v.exchangeRatesAdminGroupName="ExchangeRatesAdminGroupName",v.forcedEmailTrackingGroups="ForcedEmailTrackingGroups",v.ignoreEmailsFromDomainsOnEmailsTracking="IgnoreEmailsFromDomainsOnEmailsTracking",v.trackEmailsFromDomains="TrackEmailsFromDomains",v.groupsForAllUnpaidInvoicesNotification="GroupsForAllUnpaidInvoicesNotification",v.itemPreviewMaxHeight="ItemPreviewMaxHeight",v.lastActivityAttributes="LastActivityAttributes",v.leadsCompletedState="LeadsCompletedState",v.leadDeadlineAlertGroups="LeadDeadlineAlertGroups",v.leadsDeadState="LeadsDeadState",v.marketingCompletedState="MarketingCompletedState",v.marketingDeadState="MarketingDeadState",v.minimumPasswordLength="MinimumPasswordLength",v.nextStepAttributes="NextStepAttributes",v.notifyAboutInvoicedInvoiceInPohodaGroup="NotifyAboutInvoicedInvoiceInPohodaGroup",v.notifyAboutLeadsDeadline="NotifyAboutLeadsDeadline",v.notifyAboutPaidInvoiceInPohodaGroup="NotifyAboutPaidInvoiceInPohodaGroup",v.notifyAboutProjectDeadline="NotifyAboutProjectDeadline",v.numberOfDecimalPlaces="NumberOfDecimalPlaces",v.phoneListTaskSolverGroup="PhoneListTaskSolverGroup",v.projectDeadlineAlert="ProjectDeadlineAlert",v.serverUpdateProgressNotificationGroup="ServerUpdateProgressNotificationGroup",v.sumarizeCartsPricesOnLeads="SumarizeCartsPricesOnLeads",v.sumarizeCartsPricesOnProjects="SumarizeCartsPricesOnProjects",v.sumarizePeopleExpensesOnProjects="SumarizePeopleExpensesOnProjects",v.systemHealthNotificationGroup="SystemHealthNotificationGroup",v.tasksCompletedState="TasksCompletedState",v.tasksDeferredState="TasksDeferredState",v.tasksInProgressState="TasksInProgressState",v.tasksNotStartedState="TasksNotStartedState",v.tasksWaitOnSomeoneElseState="TasksWaitOnSomeoneElseState",v.trackDocumentVersions="TrackDocumentVersions",v.vacationCompletedState="VacationCompletedState",v.workReportApprovedState="WorkReportApprovedState",v.defaultLanguage="DefaultLanguage",v.defaultCurrency="DefaultCurrency",v.myCompanyCountry="MyCompanyCountry",v.myCompanyName="MyCompanyName",v.myCompanyStreet="MyCompanyStreet",v.myCompanyCity="MyCompanyCity",v.myCompanyState="MyCompanyState",v.myCompanyZip="MyCompanyZIP",v.myCompanyId="MyCompanyID",v.myCompanyVat="MyCompanyVAT",v.mergeGoodsInCart="MergeGoodsInCart",v.cartRefreshLogic="CartRefreshLogic",v.goodsDefaultQuantity="GoodsDefaultQuantity",v.goodsDefaultVAT="GoodsDefaultVAT",v.goodsDefaultVATIncluded="GoodsDefaultVATIncluded";class k{}k.ServerCommon={Server_ID:"Server_ID",Server_ItemCreated:"Server_ItemCreated",Server_ItemChanged:"Server_ItemChanged"},k.Common={CreatedByGUID:"CreatedByGUID",CurrencyEn:"CurrencyEn",DefaultCurrencySuffix:"DefaultCurrency",FileAs:"FileAs",ItemCreated:"ItemCreated",ItemChanged:"ItemChanged",ItemGUID:"ItemGUID",ItemVersion:"ItemVersion",ModifiedByGUID:"ModifiedByGUID",OwnerGUID:"OwnerGUID",ParentCurrencySuffix:"ParentCurrency"},k.Calendar={EndDate:"EndDate",Note:"Note"},k.Carts={SuperiorItem:"SuperiorItem",Customer:"Customer",Contact:"Contact",TypeEn:"TypeEn",StateEn:"StateEn",PriceTotal:"PriceTotal",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",ForPayment:"ForPayment",Paid:"Paid",CurrencyEn:"CurrencyEn",EffectiveFrom:"EffectiveFrom",ValidUntil:"ValidUntil",Active:"Active",Note:"Note",ID:"ID",AccountingCaseDate:"AccountingCaseDate",TaxableSupplyDate:"TaxableSupplyDate",PaymentDate:"PaymentDate",VAT:"VAT",GoodsInCartCount:"GoodsInCartCount",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",ForPaymentDefaultCurrency:"ForPaymentDefaultCurrency",ForPaymentParentCurrency:"ForPaymentParentCurrency",PaidDefaultCurrency:"PaidDefaultCurrency",PaidParentCurrency:"PaidParentCurrency",PaidChanged:"PaidChanged",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PrevStateEn:"PrevStateEn",PurchaseExpenses:"PurchaseExpenses",PurchaseExpensesDefaultCurrency:"PurchaseExpensesDefaultCurrency",PurchaseExpensesParentCurrency:"PurchaseExpensesParentCurrency",PurchaseExpensesChanged:"PurchaseExpensesChanged",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",ProfitParentCurrency:"ProfitParentCurrency",ProfitChanged:"ProfitChanged"},k.Companies={ID:"ID",CompanyName:"CompanyName",Department:"Department",AccountNumber:"AccountNumber",IdentificationNumber:"IdentificationNumber",VatNumber:"VatNumber",Sales:"Reversal",EmployeesCount:"EmployeesCount",Purchaser:"Purchaser",Suppliers:"Suppliers",Competitor:"Competitor",Address1Street:"Address1Street",Address1City:"Address1City",Address1PostalCode:"Address1PostalCode",Address1CountryEn:"Address1CountryEn",Address1State:"Address1State",Address1POBox:"Address1POBox",Address2Street:"Address2Street",Address2City:"Address2City",Address2PostalCode:"Address2PostalCode",Address2CountryEn:"Address2CountryEn",Address2State:"Address2State",Address2POBox:"Address2POBox",Address3Street:"Address3Street",Address3City:"Address3City",Address3PostalCode:"Address3PostalCode",Address3CountryEn:"Address3CountryEn",Address3State:"Address3State",Address3POBox:"Address3POBox",InvoiceAddress:"InvoiceAddress",PostalAddress:"PostalAddress",Phone:"Phone",Mobile:"Mobile",Fax:"Fax",WebPage:"WebPage",TrackedDomains:"TrackedDomains",Email:"Email",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",ImportanceEn:"ImportanceEn",FirstContactEn:"FirstContactEn",LineOfBusiness:"LineOfBusiness",EmailOptOut:"EmailOptOut",MailingListOther:"MailingListOther",MailingListOtherValue:"MailingListOtherValue",Note:"Note",IsPrivate:"IsPrivate",NextStep:"NextStep",LastActivity:"LastActivity",AdditionalDiscount:"AdditionalDiscount"},k.Contacts={ProfilePicture:"ProfilePicture",Title:"Title",Email1Address:"Email1Address",Email2Address:"Email2Address",Email3Address:"Email3Address",DoNotSendNewsletter:"DoNotSendNewsletter",ImportanceEn:"ImportanceEn",PrefixEn:"PrefixEn",FirstName:"FirstName",MiddleName:"MiddleName",LastName:"LastName",SuffixEn:"SuffixEn",BusinessAddressStreet:"BusinessAddressStreet",BusinessAddressCity:"BusinessAddressCity",BusinessAddressPostalCode:"BusinessAddressPostalCode",BusinessAddressCountryEn:"BusinessAddressCountryEn",BusinessAddressState:"BusinessAddressState",BusinessAddressPoBox:"BusinessAddressPOBox",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",OtherAddressStreet:"OtherAddressStreet",OtherAddressCity:"OtherAddressCity",OtherAddressPostalCode:"OtherAddressPostalCode",OtherAddressCountryEn:"OtherAddressCountryEn",OtherAddressState:"OtherAddressState",OtherAddressPOBox:"OtherAddressPOBox",BusinessPhoneNumber:"TelephoneNumber1",BusinessPhoneNumber2:"TelephoneNumber5",BusinessFaxNumber:"TelephoneNumber6",MobilePhoneNumber:"TelephoneNumber3",HomePhoneNumber:"TelephoneNumber2",OtherPhoneNumber:"TelephoneNumber4",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",WebPage:"WebPage",Note:"Note",Department:"Department",Company:"Company",IsPrivate:"Private",NextStep:"NextStep",LastActivity:"LastActivity"},k.Leads={ID:"ID",FileAs:"FileAs",HumanID:"HID",Customer:"Customer",ContactPerson:"ContactPerson",Marketing:"Marketing",ReceiveDate:"ReceiveDate",Email:"Email",Phone:"Phone",Street:"Street",State:"State",CountryEn:"CountryEn",City:"City",POBox:"POBox",Zip:"Zip",Price:"Price",PriceChanged:"PriceChanged",CurrencyEn:k.Common.CurrencyEn,EstimatedEnd:"EstimatedEnd",Probability:"Probability",LeadOriginEn:"LeadOriginEn",PriceDefaultCurrency:"PriceDefaultCurrency",EstimatedValue:"EstimatedValue",EstimatedValueDefaultCurrency:"EstimatedValueDefaultCurrency",Note:"Note",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn",IsPrivate:"Private",EmailOptOut:"EmailOptOut",NextStep:"NextStep",LastActivity:"LastActivity",ItemVersion:"ItemVersion",EstimatedRevenue:"EstimatedRevenue",EstimatedRevenueDefaultCurrency:"EstimatedRevenueDefaultCurrency",CompletedDate:"CompletedDate",LostDate:"LostDate"},k.Documents={FileAs:"FileAs",DocName:"DocName",Preview:"Preview",PreviewWidth:"PreviewWidth",PreviewHeight:"PreviewHeight",DocTypeEn:"DocTypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SuperiorCompany:"Company",SuperiorContact:"Contact",DocSize:"DocSize",Extension:"Extension",CreationTime:"CreationTime",LastWriteTime:"LastWriteTime",IsPrivate:"Private",Note:"Note"},k.Emails={To:"To",From:"SenderEmailAddress",Cc:"Cc",Subject:"Subject",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SentOn:"SentOn",ReceivedTime:"ReceivedTime",FileSize:"FileSize",AttachmentsCount:"AttachmentsCount",Note:"Note",SentimentTone:"SentimentTone",Summary:"Summary"},k.GoodsBase={Code:"Code",Structure:"Structure",Note:"Note",Description:"Description",TypeEn:"TypeEn",SaleCurrencyEn:"SaleCurrencyEn",PurchaseCurrencyEn:"PurchaseCurrencyEn",UnitEn:"UnitEn",PurchasePrice:"PurchasePrice",PurchasePriceDefaultCurrency:"PurchasePriceDefaultCurrency",PurchasePriceChanged:"PurchasePriceChanged",SalePrice:"SalePrice",SalePriceDefaultCurrency:"SalePriceDefaultCurrency",SalePriceChanged:"SalePriceChanged",IsPriceSum:"IsPriceSum",VATRate:"VATRate",VATIncluded:"VATIncluded"},k.Goods=Object.assign(Object.assign({},k.GoodsBase),{PriceListGroupGUID:"PriceListGroupGUID",InventoryQuantity:"InventoryQuantity"}),k.GoodsInCart=Object.assign(Object.assign({},k.GoodsBase),{Cart:"Cart",GoodsInfo:"GoodsInfo",SuperiorItem:"SuperiorItem",Quantity:"Quantity",PriceTotal:"PriceTotal",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATTotal:"VATTotal",VATTotalDefaultCurrency:"VATTotalDefaultCurrency",VATTotalParentCurrency:"VATTotalParentCurrency",SalePriceExcludingVAT:"SalePriceExcludingVAT",SalePriceExcludingVATDefaultCurrency:"SalePriceExcludingVATDefaultCurrency",SalePriceExcludingVATParentCurrency:"SalePriceExcludingVATParentCurrency",VAT:"VAT",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PurchasePriceParentCurrency:"PurchasePriceParentCurrency",SalePriceParentCurrency:"SalePriceParentCurrency",ListPrice:"ListPrice",ListPriceDefaultCurrency:"ListPriceDefaultCurrency",ListPriceParentCurrency:"ListPriceParentCurrency",ListPriceChanged:"ListPriceChanged",Discount:"Discount",HierarchyInSet:"HierarchyInSet",IsFromSet:"IsFromSet",ParentGUID:"ParentGUID",Rank:"Rank",IncludeInCartPrice:"IncludeInCartPrice",ListPriceCustomized:"ListPriceCustomized",ChildItemsCount:"ChildItemsCount",JoinedToGUID:"JoinedToGUID",PurchasePriceTotal:"PurchasePriceTotal",PurchasePriceTotalDefaultCurrency:"PurchasePriceTotalDefaultCurrency",PurchasePriceTotalParentCurrency:"PurchasePriceTotalParentCurrency",PurchasePriceTotalChanged:"PurchasePriceTotalChanged"}),k.Journal={FileAs:"FileAs",Subject:"Subject",TypeEn:"TypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",EventStart:"EventStart",EventEnd:"EventEnd",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",Marketing:"Marketing",IsSystem:"System",IsPrivate:"Private",Note:"Note",Phone:"Phone"},k.Vacation={StartDate:"StartDate",EndDate:"EndDate",User:"User",Duration:"Duration",Place:"Place",Note:"Note",AllDay:"AllDay",TypeEn:"TypeEn",StateEn:"StateEn",IsPrivate:"Private"},k.Marketing={HumanID:"HumanID",EstimatedStart:"EstimatedStart",EstimatedEnd:"EstimatedEnd",RealStart:"RealStart",RealEnd:"RealEnd",TargetGroup:"TargetGroup",EmailsSent:"EmailsSent",EmailsDelivered:"EmailsDelivered",EmailsViewed:"EmailsViewed",PeopleUnsubscribed:"PeopleUnsubscribed",FinalRevenues:"FinalRevenues",TypeEn:"TypeEn",StateEn:"StateEn"},k.Projects={HumanID:"HID",FileAs:"FileAs",ProjectName:"ProjectName",ProjectOriginEn:"ProjectOriginEn",TypeEn:"TypeEn",StateEn:"StateEn",PaymentTypeEn:"PaymentTypeEn",ProjectStart:"ProjectStart",ProjectRealEnd:"ProjectRealEnd",EstimatedEnd:"ProjectEnd",CurrencyEn:k.Common.CurrencyEn,DefaultCurrencyEn:"DefaultCurrencyEn",EstimatedMargin:"EstimatedMargin",EstimatedPeopleExpenses:"EstimatedPeopleExpenses",EstimatedPeopleExpensesDefaultCurrency:"EstimatedPeopleExpensesDefaultCurrency",EstimatedOtherExpenses:"EstimatedOtherExpenses",EstimatedOtherExpensesDefaultCurrency:"EstimatedOtherExpensesDefaultCurrency",EstimatedPrice:"EstimatedPrice",EstimatedPriceDefaultCurrency:"EstimatedPriceDefaultCurrency",EstimatedProfit:"EstimatedProfit",EstimatedProfitDefaultCurrency:"EstimatedProfitDefaultCurrency",EstimatedPriceChanged:"EstimatedPriceChanged",EstimatedPeopleExpensesChanged:"EstimatedPeopleExpensesChanged",EstimatedOtherExpensesChanged:"EstimatedOtherExpensesChanged",Delay:"Delay",EstimatedWorkHours:"EstimatedWorkHours",TotalWorkHours:"TotalWorkHours",PeopleExpenses:"PeopleExpenses",OtherExpenses:"OtherExpenses",PeopleExpensesDefaultCurrency:"PeopleExpensesDefaultCurrency",OtherExpensesDefaultCurrency:"OtherExpensesDefaultCurrency",PeopleExpensesChanged:"PeopleExpensesChanged",OtherExpensesChanged:"OtherExpensesChanged",Price:"Price",PriceDefaultCurrency:"PriceDefaultCurrency",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",Margin:"Margin",PriceChanged:"PriceChanged",SuperiorProject:"SuperiorProject",Customer:"Customer",ContactPerson:"ContactPerson",Users:"Users",ProjectManager:"ProjectManager",InvoicePaymentDate:"InvoicePaymentDate",PaymentMaturity:"PaymentMaturity",InvoiceIssueDate:"InvoiceIssueDate",LicensesCount:"LicensesCount",LicensePrice:"LicensePrice",LicensePriceDefaultCurrency:"LicensePriceDefaultCurrency",NextStep:"NextStep",LastActivity:"LastActivity",IsPrivate:"Private",LicensePriceChanged:"LicensePriceChanged",Note:"Note",CompletedDate:"CompletedDate",LostDate:"LostDate"},k.Tasks={FileAs:"FileAs",Subject:"Subject",RootItem:"RootItem",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",StartDate:"StartDate",DueDate:"DueDate",Reminder:"Reminder",ReminderDate:"ReminderDate",ImportanceEn:"ImportanceEn",IsCompleted:"Complete",PercentComplete:"PercentComplete",PercentCompleteDecimal:"PercentCompleteDecimal",CompletedDate:"CompletedDate",Solver:"Solver",Delegator:"Delegator",Level:"Level",IsPrivate:"Private",ActualWorkHours:"ActualWorkHours",TotalWorkHours:"TotalWorkHours",Body:"Body",TypeEn:"TypeEn",StateEn:"StateEn"},k.Training={TitleEn:"TitleEn"},k.WorkReports={Task:"Task",ProjectName:"ProjectName",UserName:"UserName",Subject:"Subject",Date:"Date",FromTime:"FromTime",ToTime:"ToTime",Overtime:"Overtime",Month:"Month",Year:"Year",IsPrivate:"Private",Note:"Note",Duration:"Duration",WorkReportEn:"WorkReportEn",StateEn:"StateEn"},k.Users={ProfilePicture:"ProfilePicture",UserName:"UserName",JobTitle:"JobTitle",IDCardNumber:"IDCardNumber",Birthdate:"Birthdate",BirthPlace:"BirthPlace",PersonalIdentificationNumber:"PersonalIdentificationNumber",Active:"Active",FamilyStatusEn:"FamilyStatusEn",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",BankAccount:"BankAccount",BusinessPhoneNumber:"BusinessPhoneNumber",MobilePhoneNumber:"MobilePhoneNumber",Email1Address:"Email1Address",Email2Address:"Email2Address",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",IdentificationNumber:"IdentificationNumber",HealthInsurance:"HealthInsurance",HolidayLength:"HolidayLength",RemainingDaysOfHoliday:"RemainingDaysOfHoliday",SalaryDateEn:"SalaryDateEn",Supervisor:"Supervisor",TravelDistance:"TravelDistance",TimeAccessibility:"TimeAccessibility",TransportMode:"TransportMode",WorkdayStartTime:"WorkdayStartTime",Note:"Note",IsSystem:"IsSystem"},k.Groups={IsAdmin:"IsAdmin",GroupName:"GroupName",FileAs:"FileAs",Description:"Description",IsPM:"IsPM",System:"System",IsRole:"IsRole",IsCategory:"IsCategory",DisallowControlModulePermissions:"DisallowControlModulePermissions",DisallowControlColumnPermissions:"DisallowControlColumnPermissions",IsOutlookCategory:"IsOutlookCategory",DisallowControlUserAssignment:"DisallowControlUserAssignment",ColorEn:"ColorEn",Picture:"Picture"},k.PriceListGroups={Note:"Note"},k.Prices={SalePriceGUID:"SalePriceGUID",GoodsItemGUID:"GoodsItemGUID",Price:"Price",CurrencyEn:"CurrencyEn"},k.SalePrices={Note:"Note",Discount:"Discount",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn"},k.XsltTransformations={LangCode:"LangCode",Definition:"Definition",Namespace:"Namespace",ObjectTypeID:"ObjectTypeID",TransformationVersion:"TransformationVersion"},k.XsltTransformationsModels={ObjectTypeID:"ObjectTypeID",TransformationGUID:"TransformationGUID",ItemTypeGUID:"ItemTypeGUID"},k.allTypeEnNames=["TypeEn",k.Documents.DocTypeEn,k.WorkReports.WorkReportEn,"TitleEn"],k.getFolderFileAs=e=>{switch(e){case m.leads:return k.Leads.FileAs;case m.projects:return k.Projects.ProjectName;case m.documents:return k.Documents.DocName;case m.companies:return k.Companies.CompanyName;case m.contacts:case m.users:return k.Common.FileAs;case m.emails:return k.Emails.Subject;case m.journal:return k.Journal.FileAs;case m.tasks:return k.Tasks.Subject;case m.workReports:return k.WorkReports.Subject;case m.vacation:return k.Vacation.TypeEn;case m.carts:case m.goods:case m.goodsInCart:return k.Common.FileAs;case m.groups:return k.Groups.GroupName;case m.xsltTransformations:return k.Common.FileAs;default:return console.warn(`FileAs col name not defined for folderName ${e}`),k.Common.FileAs}};class b{}b.general="GENERAL",b.group="GROUP",b.contactPerson="CONTACTPERSON",b.contact="CONTACT",b.customer="CUSTOMER",b.company="COMPANY",b.outlookProject="OUTLOOKPROJECT",b.supervisor="SUPERVISOR",b.projectOrigin="PROJECT_ORIGIN",b.cart="CART",b.goodsInCart="GOODSINCART";class D{}D.all="All",D.own="Own",D.readonly="Readonly",D.invisible="Invisible",D.none="None";class w{}var x,F,O,N;w.mandatory="Mandatory",w.optional="Optional",w.unique="Unique",w.none="None",exports.Edition=void 0,(x=exports.Edition||(exports.Edition={})).Free="Free",x.Basic="Basic",x.Professional="Professional",x.Enterprise="Enterprise",exports.Feature=void 0,(F=exports.Feature||(exports.Feature={})).ContactsAndCompanies="ContactsAndCompanies",F.Sales="Sales",F.Projects="Projects",F.Marketing="Marketing",exports.SentimentTone=void 0,(O=exports.SentimentTone||(exports.SentimentTone={}))[O.Negative=0]="Negative",O[O.Neutral=1]="Neutral",O[O.Positive=2]="Positive";class R{}R.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",R.wordAddin="WordAddin",R.excelAddin="ExcelAddin",R.tasksRecurrentTasks="TasksRecurrentTasks",R.tasksSubtasks="TasksSubtasks",R.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",R.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",R.emailsAutomaticTracking="EmailsAutomaticTracking",R.convertEmailToProject="ConvertEmailToProject",R.duplicityChecker="DuplicityChecker",R.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",R.subProjects="SubProjects",R.resourceAndPlanning="ResourceAndPlanning",R.professionalEmailCampaigns="ProfessionalEmailCampaigns",R.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",R.wordEmailMerge="WordEmailMerge",R.printLabels="PrintLabels",R.printEnvelopes="PrintEnvelopes",R.userViews="UserViews",R.sharedUserViews="SharedUserViews",R.gridConditionalFormating="GridConditionalFormating",R.multipleCurrencies="MultipleCurrencies",R.historyTracking="HistoryTracking",R.privateItems="PrivateItems",R.itemTypes="ItemTypes",R.formLayoutCustomization="FormLayoutCustomization",R.workflowBasicDefinitions="WorkflowBasicDefinitions",R.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",R.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",R.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",R.workflowGroupLevelActions="WorkflowGroupLevelActions",R.customFields="CustomFields",R.importantFields="ImportantFields",R.mandatoryFields="MandatoryFields",R.uniqueFields="UniqueFields",R.readOnlyFields="ReadOnlyFields",R.transformationCustomTemplates="TransformationCustomTemplates",R.userRoles="UserRoles",R.modulePermissions="ModulePermissions",R.columnPermissions="ColumnPermissions",R.api="API",R.gate="Gate",R.threeCXIntegration="ThreeCXIntegration",R.tapiIntegration="TapiIntegration",R.pohodaIntegration="PohodaIntegration",R.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",R.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",R.quickBooksIntegration="QuickBooksIntegration",R.saveBinaryDataOnDisk="SaveBinaryDataOnDisk",R.activeDirectoryLogin="ActiveDirectoryLogin",R.callerIdentificationOnApple="CallerIdentificationOnApple",R.legacyAdministration="LegacyAdministration";class M{}M.customAdditionalFieldsCount="CustomAdditionalFieldsCount",M.customEnabledAdvancedWorkflowsCount="CustomEnabledAdvancedWorkflowsCount",M.customEnabledBasicWorkflowsCount="CustomEnabledBasicWorkflowsCount",M.customMandatoryFieldsCount="CustomMandatoryFieldsCount",M.customOptionalFieldsCount="CustomOptionalFieldsCount",M.customReadonlyFieldsCount="CustomReadonlyFieldsCount",M.customUniqueFieldsCount="CustomUniqueFieldsCount",M.customVisibleTypesCount="CustomVisibleTypesCount",M.visibleCurrenciesCount="VisibleCurrenciesCount";class _{}_.contactsAutomaticSynchronizationWithOutlook="ContactsAutomaticSynchronizationWithOutlook",_.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",_.contactsSynchronizationWithAndroid="ContactsSynchronizationWithAndroid",_.documentsRevisions="DocumentsRevisions",_.wordAddin="WordAddin",_.excelAddin="ExcelAddin",_.tasksReminders="TasksReminders",_.tasksRecurrentTasks="TasksRecurrentTasks",_.tasksSubtasks="TasksSubtasks",_.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",_.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",_.emailsManualTracking="EmailsManualTracking",_.emailsAutomaticTracking="EmailsAutomaticTracking",_.emailSummaryAndSentimentToneFromAi="EmailSummaryAndSentimentToneFromAi",_.convertEmailToContact="ConvertEmailToContact",_.convertEmailToDeal="ConvertEmailToDeal",_.convertEmailToProject="ConvertEmailToProject",_.convertEmailToTask="ConvertEmailToTask",_.convertFromSuggestedContact="ConvertFromSuggestedContact",_.gravatarIntegration="GravatarIntegration",_.logoboxIntegration="LogoboxIntegration",_.companiesBussinesRegisterApiIntegration="CompaniesBussinesRegisterApiIntegration",_.duplicityChecker="DuplicityChecker",_.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",_.subProjects="SubProjects",_.resourceAndPlanning="ResourceAndPlanning",_.professionalEmailCampaigns="ProfessionalEmailCampaigns",_.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",_.wordEmailMerge="WordEmailMerge",_.printLabels="PrintLabels",_.printEnvelopes="PrintEnvelopes",_.userViews="UserViews",_.sharedUserViews="SharedUserViews",_.gridRowSummary="GridRowSummary",_.gridConditionalFormating="GridConditionalFormating",_.multipleCurrencies="MultipleCurrencies",_.historyTracking="HistoryTracking",_.privateItems="PrivateItems",_.itemTypes="ItemTypes",_.formLayoutCustomization="FormLayoutCustomization",_.workflowBasicDefinitions="WorkflowBasicDefinitions",_.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",_.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",_.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",_.workflowGroupLevelActions="WorkflowGroupLevelActions",_.customFields="CustomFields",_.importantFields="ImportantFields",_.mandatoryFields="MandatoryFields",_.uniqueFields="UniqueFields",_.readOnlyFields="ReadOnlyFields",_.transformationCustomTemplates="TransformationCustomTemplates",_.userRoles="UserRoles",_.modulePermissions="ModulePermissions",_.columnPermissions="ColumnPermissions",_.commonDataAPI="CommonDataAPI",_.eWayCrmAPI="eWayCrmAPI",_.threeCXIntegration="ThreeCXIntegration",_.tapiIntegration="TapiIntegration",_.pohodaIntegration="PohodaIntegration",_.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",_.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",_.quickBooksIntegration="QuickBooksIntegration",_.shareByTeams="ShareByTeams",_.convertEmailToContactWithDataFromAi="ConvertEmailToContactWithDataFromAi",_.convertEmailToDealWithDataFromAi="ConvertEmailToDealWithDataFromAi",_.convertEmailToProjectWithDataFromAi="ConvertEmailToProjectWithDataFromAi",function(e){e.UnpaidImportantInvoices="UnpaidImportantInvoices",e.UncollectableSubscriptionPayment="UncollectableSubscriptionPayment",e.UncollectableSubscriptionPaymentWithExpiredCard="UncollectableSubscriptionPaymentWithExpiredCard",e.StandardSubscriptionPeriod="StandardSubscriptionPeriod"}(N||(N={}));var L,V=N;!function(e){e.License="License",e.CloudLicense="CloudLicense",e.MiscLicense="MiscLicense",e.Support="Support",e.Service="Service"}(L||(L={}));var G=L;class U{}U.getIsDebug=e=>{var t;return!!(null===(t=null==e?void 0:e.sessionHandler.lastSuccessfulLoginResponse)||void 0===t?void 0:t.Debug)},U.supportsFeaturesOf=(e,t)=>{var r;const s=null===(r=e.sessionHandler.lastSuccessfulLoginResponse)||void 0===r?void 0:r.WcfVersion;return!!s&&U.supportsVersionFeaturesOf(s,t)},U.supportsVersionFeaturesOf=(e,t)=>s.compare(e,t,">=")||s.compare(e,"1.0.0.0","=");class j{}j.textBox="TextBox",j.comboBox="ComboBox",j.numericBox="NumericBox",j.relation="Relation",j.checkBox="CheckBox",j.linkTextBox="LinkTextBox",j.dateEdit="DateEdit",j.memoBox="MemoBox",j.multiSelectComboBox="MultiSelectComboBox",j.workflowState="WorkflowState",j.image="Image",j.multiSelectRelation="MultiSelectRelation";const B={[m.relations]:0,[m.unifiedRelations]:1,[m.users]:2,[m.groups]:3,[m.enumTypes]:4,[m.enumValues]:5,[m.additionalFields]:6};var W,H,z,Q;exports.Version=void 0,(W=exports.Version||(exports.Version={})).Version75="7.5",W.Version76="7.6",W.Version77="7.7",W.Version81="8.1",W.Version82="8.2",W.Version83="8.3",W.Version90="9.0",W.Version91="9.1",W.Version92="9.2";class $ extends U{}$.is75OrLater=e=>U.supportsFeaturesOf(e,exports.Version.Version75),$.is76OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version76),$.is77OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version77),$.is81OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version81),$.is82OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version82),$.is83OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version83),$.is90OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version90),$.is91OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version91),$.is92OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version92),$.isFeatureSupported=(e,t)=>$.supportsFeaturesOf(e,t);class q{static createHubItemsCountsQuery(e,t,r){return{__type:"HubItemsCountsQuery:#EQ",ParentItemGuids:e,ItemTypes:t,ExcludeSystemItems:r}}static createRelatedTableQuery(e,t,r){return{__type:r?"RelatedTableQuery:#EQ":"TypelessRelatedTableQuery:#EQ",BaseItemID:e,ItemTypes:Array.isArray(t)?t:[t],RelationType:r}}static createMainTableQuery(e){return{__type:"MainTableQuery:#EQ",ItemTypes:Array.isArray(e)?e:[e]}}}q.column=e=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}),q.multiSelectComboColumnLegacy=(e,t,r)=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues]({0}, '${e}', '${t}'`,Alias:null!=r?r:e}),q.multiSelectComboColumn=(e,t,r,s,o)=>{if(!$.is77OrLater(e))return q.multiSelectComboColumnLegacy(r,s,o);return{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues_WithObjectTypeID]({0}, dbo.GetObjectTypeID('${t}'), '${r}', '${s}')`,Alias:null!=o?o:r}},q.joinColumn=(e,t,r,s,o)=>{const n={__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:e,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:t},TargetColumnName:o},Name:r};return s&&(n.Alias=s),n},q.singleVariatedColumn=(e,t,r)=>q.variatedColumn([q.columnVariation(e,t)],r),q.variatedColumn=(e,t)=>{const r={__type:"VariatedColumn:#EQ",Source:{__type:"MainTable:#EQ"},Variations:e};return t&&(r.Alias=t),r},q.columnVariation=(e,t,r)=>{const s={FolderName:t,Field:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}};return r&&(s.Field.Transformation=r),s},q.joinColumnVariation=(e,t,r,s)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:t,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:r}},Name:s}}),q.relationColumnVariation=(e,t,r,s)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:t,Direction:1,ItemTypes:r},Name:s}}),q.relatedColumn=(e,t,r,s)=>{const o={__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r};return s&&(o.Alias=s),o},q.relatedSubstituableColumn=(e,t,r,s,o)=>{const n={__type:"SubstituableColumn:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r,Substitute:s};return o&&(n.Alias=o),n},q.relatedColumnFolderNameToken=(e,t,r)=>({__type:"Token:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},TypeName:"ItemType",Alias:r}),q.folderNameToken=e=>({__type:"Token:#EQ",Source:{__type:"MainTable:#EQ"},TypeName:"ItemType",Alias:null!=e?e:"FolderName"}),q.equalsFilterExpression=(e,t)=>({__type:"EqualsFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.notEqualsExpression=(e,t)=>({__type:"NotFilterExpression:#EQ",Child:q.equalsFilterExpression(e,t)}),q.andFilterExpression=e=>({__type:"AndFilterExpressionOperator:#EQ",Children:e}),q.orFilterExpression=e=>({__type:"OrFilterExpressionOperator:#EQ",Children:e}),q.lessFilterExpression=(e,t)=>({__type:"LessFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.lessOrEqualFilterExpression=(e,t)=>({__type:"LessOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.greaterFilterExpression=(e,t)=>({__type:"GreaterFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.greaterOrEqualFilterExpression=(e,t)=>({__type:"GreaterOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.likeFilterExpression=(e,t)=>({__type:"LikeFilterExpressionPredicate:#EQ",Field:e,Value:`%${t}%`}),q.inFilterExpression=(e,t)=>({__type:"InFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.isNullOrEmptyFilterExpression=e=>q.orFilterExpression([q.equalsFilterExpression(q.column(e),null),q.equalsFilterExpression(q.column(e),"")]);class J{static toRfc3339String(e){const t=e=>e<10?`0${e}`:String(e);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}${(e=>{if(0===e)return"Z";const r=e>0?"-":"+";return e=Math.abs(e),`${r}${t(Math.floor(e/60))}:${t(e%60)}`})(e.getTimezoneOffset())}`}}J.isValid=e=>e instanceof Date&&!isNaN(e.getTime()),J.areDaysEqual=(e,t)=>{const r=J.clearTime(e),s=J.clearTime(t);return r.getTime()===s.getTime()},J.areTimesEqual=(e,t)=>e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes(),J.areDatesEqual=(e,t)=>!!e&&!!t&&J.areDaysEqual(e,t)&&J.areTimesEqual(e,t),J.clearTime=e=>{const t=new Date(e);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},J.isWithoutTime=e=>0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds(),J.getFormattedSqlDateTime=e=>e.toISOString().slice(0,19).replace("T"," "),J.getRfcWithoutTimezone=e=>e.slice(0,19),exports.TransformItemFormats=void 0,(H=exports.TransformItemFormats||(exports.TransformItemFormats={})).OpenXmlDocx="OpenXmlDocx",H.Pdf="Pdf",H.WordMlXml="WordMlXml";exports.EnumTypeEditMode=void 0,(z=exports.EnumTypeEditMode||(exports.EnumTypeEditMode={})).Readonly="Readonly",z.VisibleRankDefaultOnly="VisibleRankDefaultOnly",z.Editable="Editable",exports.ImportResult=void 0,(Q=exports.ImportResult||(exports.ImportResult={})).Success="Success",Q.Failure="Failed",Q.FailureDuplicityFound="Failed_DuplicityFound",Q.FailureItemAlreadyRemoved="Failed_ItemAlreadyRemoved",Q.FailureColumnsLockedWFAction="Failed_ColumnsLocked",Q.FailureItemLockedWFAction="Failed_ItemLocked",Q.FailureLicenceLimitReached="Failed_LicenseLimitReached",Q.FailureInssuficientModulePermission="Failed_InsufficientModulePermission",Q.FailureInssuficientColumnsPermission="Failed_InsufficientColumnsPermission",c.polyfill(),exports.ApiConnectionAsNonDefaultExport=S,exports.ApiMethods=p,exports.ColumnPermissionMandatoryRules=w,exports.ColumnPermissionPermissionRules=D,exports.CommonDataConnection=class{constructor(e,t){this.isCommonDataApiEnabled=(e,t)=>{this.tokenizedConnection.isEnabled(e,t)},this.callCommonDataApi=(e,t,r,s)=>{this.tokenizedConnection.callTokenizedApi(e,t,r,s)},this.tokenizedConnection=new A("ObtainCommonDataApiAccessToken",exports.HttpMethod.get,!1,"InvalidCommonDataToken",I,e,t)}},exports.CustomizationStatsItemKeys=M,exports.DateHelper=J,exports.EWItem=class{constructor(e,t){if(!e||!t)throw new Error("Both folderName and baseItem has to be defined!");this.folderName=e,this.baseItem=t}getEmailAddress(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.Email1Address||e.Email2Address||e.Email3Address}case m.leads:return this.baseItem.Email;case m.companies:return this.baseItem.Email;case m.users:{const e=this.baseItem;return e.Email1Address||e.Email2Address}default:return null}}getInitials(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}case m.users:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}default:return null}}getInitialsInternal(e,t){const r=((null==e?void 0:e.substr(0,1))||"")+((null==t?void 0:t.substr(0,1))||"");return""==r?null:r}getItemPreview(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}case m.users:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}default:return null}}},exports.EnumTypes=d,exports.ErrorHelper=E,exports.ExpirationReason=V,exports.FieldNames=k,exports.FieldTypes=j,exports.FolderNames=m,exports.Functionality=R,exports.GlobalSettingsNames=v,exports.HttpRequestError=T,exports.LicenseKeyInvoiceSeverity=G,exports.LicenseRestrictionKeys=_,exports.OAuthHelper=C,exports.OAuthSessionHandlerBase=f,exports.ObjectTypeIds=B,exports.QueryHelper=q,exports.RelationTypes=b,exports.ReturnCodes=u,exports.StringHelper=class{static trim(e,t,r=!1){if(null==e)return e;let s=e.trim();return s.length<=t||(s=s.substring(0,t-(r?3:0)),r&&(s+="...")),s}},exports.TokenizedServiceConnection=A,exports.VersionHelper=$,exports.VersionHelperBase=U,exports.default=S;
8
+ */class u{}u.rcSuccess="rcSuccess",u.rcBadSession="rcBadSession",u.rcDuplicateContact="rcDuplicateContact",u.rcWebServiceMoved="rcWebServiceMoved",u.rcAccessDenied="rcAccessDenied",u.rcLoginUserNameChanged="rcLoginUserNameChanged",u.rcLicenseExpired="rcLicenseExpired",exports.HttpMethod=void 0,(a=exports.HttpMethod||(exports.HttpMethod={})).get="get",a.post="post";class d{}d.absence="Absence",d.bonusType="BonusType",d.busyStatus="BusyStatus",d.cartType="CartType",d.companyType="CompanyType",d.contactType="ContactType",d.countryCode="CountryCode",d.currency="Currency",d.customFieldCategory="CustomFieldCategory",d.dayType="DayType",d.documentOfflineState="DocumentOfflineState",d.documentType="DocumentType",d.emailCampaignWorkflowStatus="EmailCampaignWorkflowStatus",d.emailOfflineState="EmailOfflineState",d.emailType="EmailType",d.familyStatus="FamilyStatus",d.firstContact="FirstContact",d.globalSettingsCategory="GlobalSettingsCategory",d.goalType="GoalType",d.groupColor="GroupColor",d.importance="Importance",d.journalType="JournalType",d.knowledgeLevel="KnowledgeLevel",d.knowledgeTitle="KnowledgeTitle",d.knowledgeType="KnowledgeType",d.leadType="LeadType",d.marketingType="MarketingType",d.paymentType="PaymentType",d.prefixType="PrefixType",d.productType="ProductType",d.projectOrigin="ProjectOrigin",d.projectType="ProjectType",d.reportCategory="ReportCategory",d.responseForm="ResponseForm",d.responseType="ResponseType",d.salaryDate="SalaryDate",d.salaryType="SalaryType",d.salePriceType="SalePriceType",d.sentimentTone="SentimentTone",d.suffixType="SuffixType",d.taskImportance="TaskImportance",d.tasksSnoozePeriod="TasksSnoozePeriod",d.taskStatus="TaskStatus",d.taskType="TaskType",d.trainingGrade="TrainingGrade",d.trainingTitle="TrainingTitle",d.translations="Translations",d.units="Units",d.userType="UserType",d.usStatesDistrictsTerritories="USStatesDistrictsTerritories",d.vacationType="VacationType",d.vat="VAT",d.workLoad="WorkLoad",d.workReportType="WorkReportType";class m{}m.isValidFolderName=e=>Object.values(m).includes(e),m.actions="Actions",m.additionalFields="AdditionalFields",m.bonuses="Bonuses",m.calendar="Calendar",m.capacityNotes="CapacityNotes",m.capacityNoteTypes="CapacityNoteTypes",m.carts="Carts",m.columnPermissions="ColumnPermissions",m.companies="Companies",m.contacts="Contacts",m.contactsSuggestions="ContactsSuggestions",m.currencyExchangeRates="CurrencyExchangeRates",m.documents="Documents",m.emails="Emails",m.enumTypes="EnumTypes",m.enumValues="EnumValues",m.enumValuesRelations="EnumValuesRelations",m.features="Features",m.flows="Flows",m.globalSettings="GlobalSettings",m.goals="Goals",m.goods="Goods",m.goodsInCart="GoodsInCart",m.goodsInSet="GoodsInSet",m.groups="Groups",m.history="History",m.holidays="Holidays",m.children="Children",m.individualDiscounts="IndividualDiscounts",m.invoiceItems="InvoiceItems",m.invoices="Invoices",m.itemCopyRelations="ItemCopyRelations",m.journal="Journal",m.knowledge="Knowledge",m.layouts="Layouts",m.layoutsModels="LayoutsModels",m.leads="Leads",m.ledger="Ledger",m.mappings="Mappings",m.marketing="Marketing",m.marketingList="MarketingList",m.marketingListSources="MarketingListSources",m.models="Models",m.modulePermissions="ModulePermissions",m.objectTypesOptions="ObjectTypesOptions",m.payments="Payments",m.priceListGroups="PriceListGroups",m.projectAssignments="ProjectAssignments",m.projectAssignmentsPerUserProject="ProjectAssignmentsPerUserProject",m.projectAssignmentsTotal="ProjectAssignmentsTotal",m.projectAssignmentsTotalUserProject="ProjectAssignmentsTotalUserProject",m.projectList="ProjectList",m.projects="Projects",m.projectUsersInCaPlan="ProjectUsersInCaPlan",m.relationData="RelationData",m.relations="Relations",m.reports="Reports",m.revisionsHistory="RevisionsHistory",m.salaries="Salaries",m.salePrices="SalePrices",m.prices="Prices",m.sqlObjects="SqlObjects",m.tasks="Tasks",m.recurrencePatterns="RecurrencePatterns",m.teamRoles="TeamRoles",m.templates="Templates",m.training="Training",m.unifiedRelations="UnifiedRelations",m.users="Users",m.userSettings="UserSettings",m.vacation="Vacation",m.webAccess2Options="WebAccess2Options",m.webAccessOptions="WebAccessOptions",m.workCommitments="WorkCommitments",m.workflowHistory="WorkflowHistory",m.workReports="WorkReports",m.wrongClientVersions="WrongClientVersions",m.xsltTransformations="XsltTransformations",m.xsltTransformationsModels="XsltTransformationsModels",m.getEnumTypeName=e=>e===m.bonuses?d.bonusType:e===m.carts?d.cartType:e===m.companies?d.companyType:e===m.contacts?d.contactType:e===m.documents?d.documentType:e===m.emails?d.emailType:e===m.goals?d.goalType:e===m.goods?d.productType:e===m.journal?d.journalType:e===m.knowledge?d.knowledgeType:e===m.leads?d.leadType:e===m.marketing?d.marketingType:e===m.projects?d.projectType:e===m.salaries?d.salaryType:e===m.salePrices?d.salePriceType:e===m.tasks?d.taskType:e===m.training?d.trainingTitle:e===m.users?d.userType:e===m.vacation?d.vacationType:e===m.workReports?d.workReportType:null,m.getFolderNameByEnumTypeName=e=>e===d.bonusType?m.bonuses:e===d.cartType?m.carts:e===d.companyType?m.companies:e===d.contactType?m.contacts:e===d.documentType?m.documents:e===d.emailType?m.emails:e===d.goalType?m.goals:e===d.journalType?m.journal:e===d.knowledgeType?m.knowledge:e===d.leadType?m.leads:e===d.marketingType?m.marketing:e===d.productType?m.goods:e===d.projectType?m.projects:e===d.salaryType?m.salaries:e===d.salePriceType?m.salePrices:e===d.taskType?m.tasks:e===d.trainingTitle?m.training:e===d.userType?m.users:e===d.vacationType?m.vacation:e===d.workReportType?m.workReports:null;class p{}p.getAllEmailAttachments="GetAllEmailAttachments",p.getCalendarsByItemGuids="GetCalendarsByItemGuids",p.getEmailAttachment="GetEmailAttachment",p.getItemPreview="GetItemPreview",p.getJournalsByItemGuids="GetJournalsByItemGuids",p.getMarketingCampaignsByItemGuids="GetMarketingCampaignsByItemGuids",p.getMarketingListsRecordsByItemGuids="GetMarketingListsRecordsByItemGuids",p.getRevisionHistoryRecordsByItemGuids="GetRevisionHistoryRecordsByItemGuids",p.getVacationsByItemGuids="GetVacationsByItemGuids",p.getWorkflowHistoryRecordsByItemGuids="GetWorkflowHistoryRecordsByItemGuids",p.getCompanyInformationFromTaxRegister="GetCompanyInformationFromTaxRegister",p.logIn="LogIn",p.logOut="LogOut",p.query="Query",p.queryAmount="QueryAmount",p.getServiceAuthSettings="GetServiceAuthSettings",p.getVersion="GetVersion",p.getBinaryAttachment="GetBinaryAttachment",p.getBinaryAttachmentLatestRevision="GetBinaryAttachmentLatestRevision",p.transformItem="TransformItem",p.canUnlinkItems="CanUnlinkItems",p.unlinkItems="UnlinkItems",p.getGoodsFinalPrices="GetGoodsFinalPrices",p.saveItemCopyRelation="SaveItemCopyRelation",p.getFolderNameForApiMethod=e=>{switch(e){case m.calendar:return"Calendars";case m.journal:return"Journals";case m.marketing:return"MarketingCampaigns";case m.marketingList:return"MarketingListsRecords";case m.revisionsHistory:return"RevisionHistoryRecords";case m.vacation:return"Vacations";case m.workflowHistory:return"WorkflowHistoryRecords";default:return e}},p.getGetFolderNameByItemGuidsMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}ByItemGuids`,p.getGetFolderNameMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}`,p.getSearchFolderNameMethodName=e=>`Search${p.getFolderNameForApiMethod(e)}`;class y{constructor(e,t,r,s,o,n){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{e.callWithoutSession(p.logIn,{userName:this.username,passwordHash:this.passwordHash,appVersion:this.appVersion,clientMachineIdentifier:this.clientMachineIdentifier,clientMachineName:this.clientMachineName,createSessionCookie:e.supportsGetItemPreviewMethod},(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new Error("Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)}))},!e||!t)throw new Error("Non of the arguments 'username', 'passwordHash' can be empty.");this.username=e,this.passwordHash=t,this.appVersion=r,this.clientMachineIdentifier=s,this.clientMachineName=o,this.errorCallback=n}}class h{constructor(){this.getSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")},this.invalidateSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")}}}class C{static createAuthorizeUrl(e,t,r,s,o,n,i=!1){if(o&&!n||!o&&n)throw new Error("If codeChallenge is defined, codeChallengeMethod must also be defined and vice versa");let a=`https://login.eway-crm.${i?"dev":"com"}?scope=${encodeURIComponent(t.join(" "))}&prompt=login&response_type=code&redirect_uri=${encodeURIComponent(r)}&client_id=${e}`;return s&&(a+=`&state=${encodeURIComponent(s)}`),o&&n&&(a+=`&code_challenge=${encodeURIComponent(o)}&code_challenge_method=${encodeURIComponent(n)}`),a}}C.finishAuthorization=(e,t,r,s,o,n,i)=>{const a=new URLSearchParams;a.append("code_verifier",s),a.append("client_id",t),a.append("client_secret",r),a.append("code",o),a.append("redirect_uri",n),a.append("grant_type","authorization_code"),C.callTokenEndpoint(e,a,i)},C.refreshToken=(e,t,r,s,o)=>{const n=new URLSearchParams;n.append("client_id",t),n.append("client_secret",r),n.append("refresh_token",s),n.append("grant_type","refresh_token"),C.callTokenEndpoint(e,n,o)},C.getWebServiceUrl=e=>{const t=e.split(".");if(2!==t.length)throw new Error("Invalid token supplied");return n.decode(t[1])},C.getUserName=e=>C.decodeAccessToken(e).username,C.decodeAccessToken=e=>r(e),C.callTokenEndpoint=(t,r,s)=>{e.post(t+"/auth/connect/token",r,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((e=>{s(e.data)})).catch((e=>{e.response&&400==e.response.status?s(e.response.data):s({error:"Token request failed"})}))};class P extends Error{constructor(e,t){super(),this.returnCode=e,this.message=t}}class f{constructor(e,t,r,s,o){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{const r={userName:this.username,appVersion:this.appVersion,createSessionCookie:e.supportsGetItemPreviewMethod},s={Authorization:"Bearer "+this.accessToken};e.callWithoutSession(p.logIn,r,(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new P(e.ReturnCode,"Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)}),s,void 0,(r=>{if(401!==(null==r?void 0:r.statusCode)){if(!this.errorCallback)throw r;this.errorCallback(r)}else this.getNewAccessTokenCallback(e,(r=>{this.accessToken=r.accessToken,r.error||this.getSessionId(e,t)}))}))},!e)throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");this.username=e,this.accessToken=t,this.appVersion=r,this.getNewAccessTokenCallback=s,this.errorCallback=o}}class g extends f{constructor(e,t,r,s,o,n,i,a){if(!(e&&s&&t&&r))throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");super(e,o,n,((e,t)=>{C.refreshToken(e.wsUrl,this.clientId,this.clientSecret,this.refreshToken,(e=>{try{this.refreshTokenCallback&&this.refreshTokenCallback(e)}catch(e){this.errorCallback&&this.errorCallback(new Error("Refresh token callback failed.\n"+JSON.stringify(e)))}void 0!==e.error?t({error:e.error}):t({accessToken:e.access_token})}))}),i),this.refreshToken=s,this.clientId=t,this.clientSecret=r,this.refreshTokenCallback=a}}class T extends Error{constructor(e,t){super(),this.statusCode=e,this.message=t}}class E{}E.stringifyError=e=>JSON.stringify(e,E.replaceErrors),E.replaceErrors=(e,t)=>{if(t instanceof Error){const e={};return Object.getOwnPropertyNames(t).forEach((r=>{e[r]=t[r]})),e}return t};class S{constructor(t,r,s,o){if(this.ensureLogin=()=>new Promise(((e,t)=>{if(this.sessionId)e();else{const r=r=>{r&&(this.sessionId=r,e()),t("Session Id cannot be empty")};this.sessionHandler.getSessionId(this,r)}})),this.createOpenLink=(e,t,r,s)=>{const o=n.encode(this.baseUri);let i="eway://"+t;r&&(i+="/"+(null==r?void 0:r.toLowerCase()));const a=e?"open.eway-crm.dev":"open.eway-crm.com";i=n.encode(i);let l="https://"+a+"/?ws="+o+"&l="+i;return s&&(l+="&n="+encodeURIComponent(s)),l},this.askUploadMethod=(e,t,r,s,o)=>new Promise(((n,i)=>{const a=o?e=>{throw i(e),e}:i;this.callUploadMethod(e,t,r,n,a,a,s)})),this.callUploadMethod=(t,r,s,o,n,i,a)=>{const l=()=>{this.sessionHandler.getSessionId(this,(e=>{this.sessionId=e,this.callUploadMethod(t,r,s,o,n,i,a)}))},c=this.sessionId;if(!c)return void l();const d=`${this.svcUri}/SaveBinaryAttachment?sessionId=${this.sessionId}&itemGuid=${t}&fileName=${encodeURIComponent(r)}`,m=e.post(d,s,a);S.handleCallPromise(m,o,(e=>{if(e.ReturnCode===u.rcBadSession)return this.sessionId=null,void this.sessionHandler.invalidateSessionId(c,l);if(n)n(e);else{const t=new Error("Unhandled connection return code "+e.ReturnCode+": "+e.Description);if(!this.errorCallback)throw t;this.errorCallback(t)}}),(e=>{let t=new Error("Unhandled connection error when calling "+d+": "+E.stringifyError(e));if("statusCode"in e&&413===e.statusCode&&(t=new Error("The file has exceeded the maximum allowed file size for uploading. You can contact your IT administrator or eWay-CRM support if you would like to increase the limit.")),i)i(t);else{if(!this.errorCallback)throw t;this.errorCallback(t)}}))},this.askMethod=(e,t,r,s)=>new Promise(((o,n)=>{const i=s?e=>{throw n(e),e}:n;this.callMethod(e,t,o,i,r,i)})),this.callMethod=(e,t,r,s,o,n)=>{o||(o=exports.HttpMethod.post);const i=()=>{this.sessionHandler.getSessionId(this,(i=>{this.sessionId=i,this.callMethod(e,t,r,s,o,n)}))},a=this.sessionId;if(!a)return void i();t.sessionId=a;const l=e!==p.logOut?r:e=>{this.sessionId=null,r(e)};this.callWithoutSession(e,t,l,(r=>{if(r.ReturnCode!==u.rcBadSession||(this.sessionId=null,e===p.logOut))if(s)s(r);else{const e=new Error("Unhandled connection return code "+r.ReturnCode+": "+r.Description);if(!this.errorCallback)throw e;this.errorCallback(e,t)}else this.sessionHandler.invalidateSessionId(a,i)}),null,o,n)},this.callWithoutSession=(t,r,s,o,n,i,a)=>{var l;i||(i=exports.HttpMethod.post);const c=this.svcUri+"/"+t;let u,d;switch(n&&(u={headers:n,withCredentials:null!==(l=this.supportGetItemPreviewMethod)&&void 0!==l?l:t==p.logIn}),i){case exports.HttpMethod.get:if(r)throw new Error("Calling api get method with data specified does not make any sense.");d=e.get(c,u);break;case exports.HttpMethod.post:d=e.post(c,r,u);break;default:throw new Error(`Unknown http method '${i}'.`)}S.handleCallPromise(d,s,o,(e=>{if(a)try{a(e)}catch(e){if(!this.errorCallback)throw e;this.errorCallback(e,r)}else{const t=new Error("Unhandled connection error when calling "+c+": "+E.stringifyError(e));if(!this.errorCallback)throw t;this.errorCallback(t,r)}}))},this.getItemPreviewGetMethodUrl=(e,t,r)=>this.svcUri+"/"+p.getItemPreview+"?folderName="+encodeURIComponent(e)+"&itemGuid="+encodeURIComponent(t)+(r||0===r?"&itemVersion="+encodeURIComponent(r.toString()):""),this.getEmailAttachmentGetMethodUrl=(e,t)=>this.svcUri+"/"+p.getEmailAttachment+"?itemGuid="+encodeURIComponent(e)+"&contentId="+encodeURIComponent(t),this.getAllEmailAttachmentsZipGetMethodUrl=e=>this.svcUri+"/"+p.getAllEmailAttachments+"?itemGuid="+encodeURIComponent(e),this.getBinaryAttachmentGetMethodUrl=(e,t)=>"number"==typeof t?this.svcUri+"/"+p.getBinaryAttachment+"?itemGuid="+encodeURIComponent(e)+`&revision=${t}`:this.svcUri+"/"+p.getBinaryAttachmentLatestRevision+"?itemGuid="+encodeURIComponent(e),this.getTransformItemMethodUrl=(e,t,r,s)=>`${this.svcUri}/${p.transformItem}?itemGuid=${encodeURIComponent(e)}&itemFolderName=${encodeURIComponent(t)}&transformationGuid=${encodeURIComponent(r)}&outputFormat=${s}`,this.getActiveSessionId=()=>this.sessionId,this.setActiveSessionId=e=>{this.sessionId=e},!t)throw new Error("The argument 'apiServiceUri' cannot be empty.");if(t.length<8||"https://"!==t.substr(0,8).toLowerCase()&&"http://"!==t.substr(0,7).toLowerCase())throw new Error("Api service uri must start either with 'https://' or with 'http://'.");if(".svc"===t.substr(t.length-4).toLowerCase()){this.svcUri=t;const e=["/API.svc","/InsecureAPI.svc","/WcfService/Service.svc"].find((e=>e.toLowerCase()===t.substr(t.length-e.length).toLowerCase()))||"";this.baseUri=t.substr(0,t.length-e.length)}else this.baseUri=S.normalizeWsUrl(t)||t,"https://"===t.substr(0,8).toLowerCase()?this.svcUri=this.baseUri+"/API.svc":this.svcUri=this.baseUri+"/InsecureAPI.svc";this.sessionHandler=r,this.errorCallback=s,this.sessionId=null,this.supportGetItemPreviewMethod=null!=o&&o}get supportsGetItemPreviewMethod(){return this.supportGetItemPreviewMethod}static create(e,t,r,s,o,n,i,a){return new S(e,new y(t,r,s,o,n,i),i,a)}static createAnonymous(e,t){return new S(e,new h,t)}static createUsingOAuth(e,t,r,s,o,n,i,a,l,c){return new S(e,new g(t,r,s,o,n,i,a,l),a,c)}static normalizeWsUrl(e){return e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),e}get wsUrl(){return this.baseUri}static handleCallPromise(e,t,r,s){e.then((e=>{200===e.status?e.data.ReturnCode===u.rcSuccess?t(e.data):r(e.data):s(new T(e.status,e.statusText))})).catch((e=>{e.response?s(new T(e.response.status,e.response.statusText)):s(e)}))}}class A{constructor(e,t,r,s,o,n,i){this.isEnabled=(e,t)=>{const r=()=>{this.url&&this.token?e(this.url,this.token):t()};this.url&&this.token?e(this.url,this.token):this.obtainToken(r)},this.callTokenizedApi=(e,t,r,s)=>{this.isEnabled(((o,n)=>{t.token=n,A.call(o,e,t,r,(o=>{if(o.ReturnCodeString!==this.invalidTokenReturnCode){if(s)s(o);else if(this.generalErrorCallback){const e=new Error("Unhandled tokenized service connection return code "+o.ReturnCodeString+".\nDescription: "+o.Description);this.generalErrorCallback(e)}}else this.obtainToken((()=>{this.callTokenizedApi(e,t,r,s)}))}),(e=>{if(this.generalErrorCallback){const t=new Error("Unhandled tokenized service connection communication error: "+JSON.stringify(e));this.generalErrorCallback(t)}}))}),(()=>{s&&s(null)}))},this.obtainToken=e=>{if(!this.isActive)return this.url=null,this.token=null,void e();const t=t=>{const r=this.urlAndTokenObtainer(t);r.url&&r.token?(this.url=r.url,this.token=r.token,this.isActive=!0,e()):(this.url=null,this.token=null,this.isActive=!1,e())},r=()=>{this.url=null,this.token=null,this.isActive=!1,e()};this.needsSession?this.connection.callMethod(this.obtainTokenMethodName,{},t,r,this.obtainTokenMethodType):this.connection.callWithoutSession(this.obtainTokenMethodName,null,t,r,null,this.obtainTokenMethodType)},this.obtainTokenMethodName=e,this.obtainTokenMethodType=t,this.needsSession=r,this.invalidTokenReturnCode=s,this.urlAndTokenObtainer=o,this.connection=n,this.generalErrorCallback=i||null,this.url=null,this.token=null,this.isActive=!0}static call(t,r,s,o,n,i){const a=t+"/"+r;e.post(a,s).then((e=>{200===e.status?"Success"===e.data.ReturnCodeString?o(e.data):n(e.data):i(new T(e.status,e.statusText))})).catch((e=>{e.response?i(new T(e.response.status,e.response.statusText)):i(e)}))}}const I=e=>({url:e.ServiceUrl,token:e.Token});class v{}v.acceptableBackwardWorkReportDays="AcceptableBackwardWorkReportDays",v.adminAppInactiveLogoutTime="AdminAppInactiveLogoutTime",v.applyGeneralDataProtectionRules="ApplyGeneralDataProtectionRules",v.automaticallyCreateJournalAfterCallDuration="AutomaticallyCreateJournalAfterCallDuration",v.bonusesCompletedState="BonusesCompletedState",v.cartInvoicedState="CartInvoicedState",v.cartOrderCanceledState="CartOrderCanceledState",v.cartOrderInProcessState="CartOrderInProcessState",v.cartOrderProcessedState="CartOrderProcessedState",v.cartPaidState="CartPaidState",v.cartProposalInProcessState="CartProposalInProcessState",v.cartProposalProcessedState="CartProposalProcessedState",v.cartSalesVoucherIssuedState="CartSalesVoucherIssuedState",v.cartToBeInvoicedState="CartToBeInvoicedState",v.cartVoidedState="CartVoidedState",v.clickToCallScheme="ClickToCallScheme",v.companyDuplicityCheckEnabled="CompanyDuplicityCheckEnabled",v.completedStateName="CompletedStateName",v.contactDuplicityCheckEnabled="ContactDuplicityCheckEnabled",v.createCompanyWhileImportingContactFromOutlook="CreateCompanyWhileImportingContactFromOutlook",v.defaultProposalValidityPeriod="DefaultProposalValidityPeriod",v.enableContactsTwoWaySyncWithM365="EnableContactsTwoWaySyncWithM365",v.deadStateName="DeadStateName",v.enableCompaniesSyncIntoMobileDeviceContacts="EnableCompaniesSyncIntoMobileDeviceContacts",v.enableContactsSyncIntoMobileDevice="EnableContactsSyncIntoMobileDevice",v.enableLeadsSyncIntoMobileDeviceContacts="EnableLeadsSyncIntoMobileDeviceContacts",v.enableLlamaAiFeatures="EnableLlamaAiFeatures",v.enableUsersSyncIntoMobileDeviceContacts="EnableUsersSyncIntoMobileDeviceContacts",v.emailsActiveProjectsLeadsFilter="EmailsActiveProjectsLeadsFilter",v.exchangeRatesAdminGroupName="ExchangeRatesAdminGroupName",v.forcedEmailTrackingGroups="ForcedEmailTrackingGroups",v.ignoreEmailsFromDomainsOnEmailsTracking="IgnoreEmailsFromDomainsOnEmailsTracking",v.trackEmailsFromDomains="TrackEmailsFromDomains",v.groupsForAllUnpaidInvoicesNotification="GroupsForAllUnpaidInvoicesNotification",v.itemPreviewMaxHeight="ItemPreviewMaxHeight",v.lastActivityAttributes="LastActivityAttributes",v.leadsCompletedState="LeadsCompletedState",v.leadDeadlineAlertGroups="LeadDeadlineAlertGroups",v.leadsDeadState="LeadsDeadState",v.marketingCompletedState="MarketingCompletedState",v.marketingDeadState="MarketingDeadState",v.minimumPasswordLength="MinimumPasswordLength",v.nextStepAttributes="NextStepAttributes",v.notifyAboutInvoicedInvoiceInPohodaGroup="NotifyAboutInvoicedInvoiceInPohodaGroup",v.notifyAboutLeadsDeadline="NotifyAboutLeadsDeadline",v.notifyAboutPaidInvoiceInPohodaGroup="NotifyAboutPaidInvoiceInPohodaGroup",v.notifyAboutProjectDeadline="NotifyAboutProjectDeadline",v.numberOfDecimalPlaces="NumberOfDecimalPlaces",v.phoneListTaskSolverGroup="PhoneListTaskSolverGroup",v.projectDeadlineAlert="ProjectDeadlineAlert",v.serverUpdateProgressNotificationGroup="ServerUpdateProgressNotificationGroup",v.sumarizeCartsPricesOnLeads="SumarizeCartsPricesOnLeads",v.sumarizeCartsPricesOnProjects="SumarizeCartsPricesOnProjects",v.sumarizePeopleExpensesOnProjects="SumarizePeopleExpensesOnProjects",v.systemHealthNotificationGroup="SystemHealthNotificationGroup",v.tasksCompletedState="TasksCompletedState",v.tasksDeferredState="TasksDeferredState",v.tasksInProgressState="TasksInProgressState",v.tasksNotStartedState="TasksNotStartedState",v.tasksWaitOnSomeoneElseState="TasksWaitOnSomeoneElseState",v.trackDocumentVersions="TrackDocumentVersions",v.vacationCompletedState="VacationCompletedState",v.workReportApprovedState="WorkReportApprovedState",v.defaultLanguage="DefaultLanguage",v.defaultCurrency="DefaultCurrency",v.myCompanyCountry="MyCompanyCountry",v.myCompanyName="MyCompanyName",v.myCompanyStreet="MyCompanyStreet",v.myCompanyCity="MyCompanyCity",v.myCompanyState="MyCompanyState",v.myCompanyZip="MyCompanyZIP",v.myCompanyId="MyCompanyID",v.myCompanyVat="MyCompanyVAT",v.mergeGoodsInCart="MergeGoodsInCart",v.cartRefreshLogic="CartRefreshLogic",v.goodsDefaultQuantity="GoodsDefaultQuantity",v.goodsDefaultVAT="GoodsDefaultVAT",v.goodsDefaultVATIncluded="GoodsDefaultVATIncluded";class k{}k.ServerCommon={Server_ID:"Server_ID",Server_ItemCreated:"Server_ItemCreated",Server_ItemChanged:"Server_ItemChanged"},k.Common={CreatedByGUID:"CreatedByGUID",CurrencyEn:"CurrencyEn",DefaultCurrencySuffix:"DefaultCurrency",FileAs:"FileAs",ItemCreated:"ItemCreated",ItemChanged:"ItemChanged",ItemGUID:"ItemGUID",ItemVersion:"ItemVersion",ModifiedByGUID:"ModifiedByGUID",OwnerGUID:"OwnerGUID",ParentCurrencySuffix:"ParentCurrency"},k.Calendar={EndDate:"EndDate",Note:"Note"},k.Carts={SuperiorItem:"SuperiorItem",Customer:"Customer",Contact:"Contact",TypeEn:"TypeEn",StateEn:"StateEn",PriceTotal:"PriceTotal",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",ForPayment:"ForPayment",Paid:"Paid",CurrencyEn:"CurrencyEn",EffectiveFrom:"EffectiveFrom",ValidUntil:"ValidUntil",Active:"Active",Note:"Note",ID:"ID",AccountingCaseDate:"AccountingCaseDate",TaxableSupplyDate:"TaxableSupplyDate",PaymentDate:"PaymentDate",VAT:"VAT",GoodsInCartCount:"GoodsInCartCount",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",ForPaymentDefaultCurrency:"ForPaymentDefaultCurrency",ForPaymentParentCurrency:"ForPaymentParentCurrency",PaidDefaultCurrency:"PaidDefaultCurrency",PaidParentCurrency:"PaidParentCurrency",PaidChanged:"PaidChanged",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PrevStateEn:"PrevStateEn",PurchaseExpenses:"PurchaseExpenses",PurchaseExpensesDefaultCurrency:"PurchaseExpensesDefaultCurrency",PurchaseExpensesParentCurrency:"PurchaseExpensesParentCurrency",PurchaseExpensesChanged:"PurchaseExpensesChanged",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",ProfitParentCurrency:"ProfitParentCurrency",ProfitChanged:"ProfitChanged"},k.Companies={ID:"ID",CompanyName:"CompanyName",Department:"Department",AccountNumber:"AccountNumber",IdentificationNumber:"IdentificationNumber",VatNumber:"VatNumber",Sales:"Reversal",EmployeesCount:"EmployeesCount",Purchaser:"Purchaser",Suppliers:"Suppliers",Competitor:"Competitor",Address1Street:"Address1Street",Address1City:"Address1City",Address1PostalCode:"Address1PostalCode",Address1CountryEn:"Address1CountryEn",Address1State:"Address1State",Address1POBox:"Address1POBox",Address2Street:"Address2Street",Address2City:"Address2City",Address2PostalCode:"Address2PostalCode",Address2CountryEn:"Address2CountryEn",Address2State:"Address2State",Address2POBox:"Address2POBox",Address3Street:"Address3Street",Address3City:"Address3City",Address3PostalCode:"Address3PostalCode",Address3CountryEn:"Address3CountryEn",Address3State:"Address3State",Address3POBox:"Address3POBox",InvoiceAddress:"InvoiceAddress",PostalAddress:"PostalAddress",Phone:"Phone",Mobile:"Mobile",Fax:"Fax",WebPage:"WebPage",TrackedDomains:"TrackedDomains",Email:"Email",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",ImportanceEn:"ImportanceEn",FirstContactEn:"FirstContactEn",LineOfBusiness:"LineOfBusiness",EmailOptOut:"EmailOptOut",MailingListOther:"MailingListOther",MailingListOtherValue:"MailingListOtherValue",Note:"Note",IsPrivate:"IsPrivate",NextStep:"NextStep",LastActivity:"LastActivity",AdditionalDiscount:"AdditionalDiscount"},k.Contacts={ProfilePicture:"ProfilePicture",Title:"Title",Email1Address:"Email1Address",Email2Address:"Email2Address",Email3Address:"Email3Address",DoNotSendNewsletter:"DoNotSendNewsletter",ImportanceEn:"ImportanceEn",PrefixEn:"PrefixEn",FirstName:"FirstName",MiddleName:"MiddleName",LastName:"LastName",SuffixEn:"SuffixEn",BusinessAddressStreet:"BusinessAddressStreet",BusinessAddressCity:"BusinessAddressCity",BusinessAddressPostalCode:"BusinessAddressPostalCode",BusinessAddressCountryEn:"BusinessAddressCountryEn",BusinessAddressState:"BusinessAddressState",BusinessAddressPoBox:"BusinessAddressPOBox",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",OtherAddressStreet:"OtherAddressStreet",OtherAddressCity:"OtherAddressCity",OtherAddressPostalCode:"OtherAddressPostalCode",OtherAddressCountryEn:"OtherAddressCountryEn",OtherAddressState:"OtherAddressState",OtherAddressPOBox:"OtherAddressPOBox",BusinessPhoneNumber:"TelephoneNumber1",BusinessPhoneNumber2:"TelephoneNumber5",BusinessFaxNumber:"TelephoneNumber6",MobilePhoneNumber:"TelephoneNumber3",HomePhoneNumber:"TelephoneNumber2",OtherPhoneNumber:"TelephoneNumber4",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",WebPage:"WebPage",Note:"Note",Department:"Department",Company:"Company",IsPrivate:"Private",NextStep:"NextStep",LastActivity:"LastActivity"},k.Leads={ID:"ID",FileAs:"FileAs",HumanID:"HID",Customer:"Customer",ContactPerson:"ContactPerson",Marketing:"Marketing",ReceiveDate:"ReceiveDate",Email:"Email",Phone:"Phone",Street:"Street",State:"State",CountryEn:"CountryEn",City:"City",POBox:"POBox",Zip:"Zip",Price:"Price",PriceChanged:"PriceChanged",CurrencyEn:k.Common.CurrencyEn,EstimatedEnd:"EstimatedEnd",Probability:"Probability",LeadOriginEn:"LeadOriginEn",PriceDefaultCurrency:"PriceDefaultCurrency",EstimatedValue:"EstimatedValue",EstimatedValueDefaultCurrency:"EstimatedValueDefaultCurrency",Note:"Note",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn",IsPrivate:"Private",EmailOptOut:"EmailOptOut",NextStep:"NextStep",LastActivity:"LastActivity",ItemVersion:"ItemVersion",EstimatedRevenue:"EstimatedRevenue",EstimatedRevenueDefaultCurrency:"EstimatedRevenueDefaultCurrency",CompletedDate:"CompletedDate",LostDate:"LostDate"},k.Documents={FileAs:"FileAs",DocName:"DocName",Preview:"Preview",PreviewWidth:"PreviewWidth",PreviewHeight:"PreviewHeight",DocTypeEn:"DocTypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SuperiorCompany:"Company",SuperiorContact:"Contact",DocSize:"DocSize",Extension:"Extension",CreationTime:"CreationTime",LastWriteTime:"LastWriteTime",IsPrivate:"Private",Note:"Note"},k.Emails={To:"To",From:"SenderEmailAddress",Cc:"Cc",Subject:"Subject",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SentOn:"SentOn",ReceivedTime:"ReceivedTime",FileSize:"FileSize",AttachmentsCount:"AttachmentsCount",Note:"Note",SentimentTone:"SentimentTone",Summary:"Summary"},k.GoodsBase={Code:"Code",Structure:"Structure",Note:"Note",Description:"Description",TypeEn:"TypeEn",SaleCurrencyEn:"SaleCurrencyEn",PurchaseCurrencyEn:"PurchaseCurrencyEn",UnitEn:"UnitEn",PurchasePrice:"PurchasePrice",PurchasePriceDefaultCurrency:"PurchasePriceDefaultCurrency",PurchasePriceChanged:"PurchasePriceChanged",SalePrice:"SalePrice",SalePriceDefaultCurrency:"SalePriceDefaultCurrency",SalePriceChanged:"SalePriceChanged",IsPriceSum:"IsPriceSum",VATRate:"VATRate",VATIncluded:"VATIncluded"},k.Goods=Object.assign(Object.assign({},k.GoodsBase),{PriceListGroupGUID:"PriceListGroupGUID",InventoryQuantity:"InventoryQuantity"}),k.GoodsInCart=Object.assign(Object.assign({},k.GoodsBase),{Cart:"Cart",GoodsInfo:"GoodsInfo",SuperiorItem:"SuperiorItem",Quantity:"Quantity",PriceTotal:"PriceTotal",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATTotal:"VATTotal",VATTotalDefaultCurrency:"VATTotalDefaultCurrency",VATTotalParentCurrency:"VATTotalParentCurrency",SalePriceExcludingVAT:"SalePriceExcludingVAT",SalePriceExcludingVATDefaultCurrency:"SalePriceExcludingVATDefaultCurrency",SalePriceExcludingVATParentCurrency:"SalePriceExcludingVATParentCurrency",VAT:"VAT",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PurchasePriceParentCurrency:"PurchasePriceParentCurrency",SalePriceParentCurrency:"SalePriceParentCurrency",ListPrice:"ListPrice",ListPriceDefaultCurrency:"ListPriceDefaultCurrency",ListPriceParentCurrency:"ListPriceParentCurrency",ListPriceChanged:"ListPriceChanged",Discount:"Discount",HierarchyInSet:"HierarchyInSet",IsFromSet:"IsFromSet",ParentGUID:"ParentGUID",Rank:"Rank",IncludeInCartPrice:"IncludeInCartPrice",ListPriceCustomized:"ListPriceCustomized",ChildItemsCount:"ChildItemsCount",JoinedToGUID:"JoinedToGUID",PurchasePriceTotal:"PurchasePriceTotal",PurchasePriceTotalDefaultCurrency:"PurchasePriceTotalDefaultCurrency",PurchasePriceTotalParentCurrency:"PurchasePriceTotalParentCurrency",PurchasePriceTotalChanged:"PurchasePriceTotalChanged"}),k.Journal={FileAs:"FileAs",Subject:"Subject",TypeEn:"TypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",EventStart:"EventStart",EventEnd:"EventEnd",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",Marketing:"Marketing",IsSystem:"System",IsPrivate:"Private",Note:"Note",Phone:"Phone"},k.Vacation={StartDate:"StartDate",EndDate:"EndDate",User:"User",Duration:"Duration",Place:"Place",Note:"Note",AllDay:"AllDay",TypeEn:"TypeEn",StateEn:"StateEn",IsPrivate:"Private"},k.Marketing={HumanID:"HumanID",EstimatedStart:"EstimatedStart",EstimatedEnd:"EstimatedEnd",RealStart:"RealStart",RealEnd:"RealEnd",TargetGroup:"TargetGroup",EmailsSent:"EmailsSent",EmailsDelivered:"EmailsDelivered",EmailsViewed:"EmailsViewed",PeopleUnsubscribed:"PeopleUnsubscribed",FinalRevenues:"FinalRevenues",TypeEn:"TypeEn",StateEn:"StateEn"},k.Projects={HumanID:"HID",FileAs:"FileAs",ProjectName:"ProjectName",ProjectOriginEn:"ProjectOriginEn",TypeEn:"TypeEn",StateEn:"StateEn",PaymentTypeEn:"PaymentTypeEn",ProjectStart:"ProjectStart",ProjectRealEnd:"ProjectRealEnd",EstimatedEnd:"ProjectEnd",CurrencyEn:k.Common.CurrencyEn,DefaultCurrencyEn:"DefaultCurrencyEn",EstimatedMargin:"EstimatedMargin",EstimatedPeopleExpenses:"EstimatedPeopleExpenses",EstimatedPeopleExpensesDefaultCurrency:"EstimatedPeopleExpensesDefaultCurrency",EstimatedOtherExpenses:"EstimatedOtherExpenses",EstimatedOtherExpensesDefaultCurrency:"EstimatedOtherExpensesDefaultCurrency",EstimatedPrice:"EstimatedPrice",EstimatedPriceDefaultCurrency:"EstimatedPriceDefaultCurrency",EstimatedProfit:"EstimatedProfit",EstimatedProfitDefaultCurrency:"EstimatedProfitDefaultCurrency",EstimatedPriceChanged:"EstimatedPriceChanged",EstimatedPeopleExpensesChanged:"EstimatedPeopleExpensesChanged",EstimatedOtherExpensesChanged:"EstimatedOtherExpensesChanged",Delay:"Delay",EstimatedWorkHours:"EstimatedWorkHours",TotalWorkHours:"TotalWorkHours",PeopleExpenses:"PeopleExpenses",OtherExpenses:"OtherExpenses",PeopleExpensesDefaultCurrency:"PeopleExpensesDefaultCurrency",OtherExpensesDefaultCurrency:"OtherExpensesDefaultCurrency",PeopleExpensesChanged:"PeopleExpensesChanged",OtherExpensesChanged:"OtherExpensesChanged",Price:"Price",PriceDefaultCurrency:"PriceDefaultCurrency",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",Margin:"Margin",PriceChanged:"PriceChanged",SuperiorProject:"SuperiorProject",Customer:"Customer",ContactPerson:"ContactPerson",Users:"Users",ProjectManager:"ProjectManager",InvoicePaymentDate:"InvoicePaymentDate",PaymentMaturity:"PaymentMaturity",InvoiceIssueDate:"InvoiceIssueDate",LicensesCount:"LicensesCount",LicensePrice:"LicensePrice",LicensePriceDefaultCurrency:"LicensePriceDefaultCurrency",NextStep:"NextStep",LastActivity:"LastActivity",IsPrivate:"Private",LicensePriceChanged:"LicensePriceChanged",Note:"Note",CompletedDate:"CompletedDate",LostDate:"LostDate"},k.Tasks={FileAs:"FileAs",Subject:"Subject",RootItem:"RootItem",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",StartDate:"StartDate",DueDate:"DueDate",Reminder:"Reminder",ReminderDate:"ReminderDate",ImportanceEn:"ImportanceEn",IsCompleted:"Complete",PercentComplete:"PercentComplete",PercentCompleteDecimal:"PercentCompleteDecimal",CompletedDate:"CompletedDate",Solver:"Solver",Delegator:"Delegator",Level:"Level",IsPrivate:"Private",ActualWorkHours:"ActualWorkHours",TotalWorkHours:"TotalWorkHours",Body:"Body",TypeEn:"TypeEn",StateEn:"StateEn"},k.Training={TitleEn:"TitleEn"},k.WorkReports={Task:"Task",ProjectName:"ProjectName",UserName:"UserName",Subject:"Subject",Date:"Date",FromTime:"FromTime",ToTime:"ToTime",Overtime:"Overtime",Month:"Month",Year:"Year",IsPrivate:"Private",Note:"Note",Duration:"Duration",WorkReportEn:"WorkReportEn",StateEn:"StateEn"},k.Users={ProfilePicture:"ProfilePicture",UserName:"UserName",JobTitle:"JobTitle",IDCardNumber:"IDCardNumber",Birthdate:"Birthdate",BirthPlace:"BirthPlace",PersonalIdentificationNumber:"PersonalIdentificationNumber",Active:"Active",FamilyStatusEn:"FamilyStatusEn",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",BankAccount:"BankAccount",BusinessPhoneNumber:"BusinessPhoneNumber",MobilePhoneNumber:"MobilePhoneNumber",Email1Address:"Email1Address",Email2Address:"Email2Address",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",IdentificationNumber:"IdentificationNumber",HealthInsurance:"HealthInsurance",HolidayLength:"HolidayLength",RemainingDaysOfHoliday:"RemainingDaysOfHoliday",SalaryDateEn:"SalaryDateEn",Supervisor:"Supervisor",TravelDistance:"TravelDistance",TimeAccessibility:"TimeAccessibility",TransportMode:"TransportMode",WorkdayStartTime:"WorkdayStartTime",Note:"Note",IsSystem:"IsSystem"},k.Groups={IsAdmin:"IsAdmin",GroupName:"GroupName",FileAs:"FileAs",Description:"Description",IsPM:"IsPM",System:"System",IsRole:"IsRole",IsCategory:"IsCategory",DisallowControlModulePermissions:"DisallowControlModulePermissions",DisallowControlColumnPermissions:"DisallowControlColumnPermissions",IsOutlookCategory:"IsOutlookCategory",DisallowControlUserAssignment:"DisallowControlUserAssignment",ColorEn:"ColorEn",Picture:"Picture"},k.PriceListGroups={Note:"Note"},k.Prices={SalePriceGUID:"SalePriceGUID",GoodsItemGUID:"GoodsItemGUID",Price:"Price",CurrencyEn:"CurrencyEn"},k.SalePrices={Note:"Note",Discount:"Discount",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn"},k.XsltTransformations={LangCode:"LangCode",Definition:"Definition",Namespace:"Namespace",ObjectTypeID:"ObjectTypeID",TransformationVersion:"TransformationVersion"},k.XsltTransformationsModels={ObjectTypeID:"ObjectTypeID",TransformationGUID:"TransformationGUID",ItemTypeGUID:"ItemTypeGUID"},k.allTypeEnNames=["TypeEn",k.Documents.DocTypeEn,k.WorkReports.WorkReportEn,"TitleEn"],k.getFolderFileAs=e=>{switch(e){case m.leads:return k.Leads.FileAs;case m.projects:return k.Projects.ProjectName;case m.documents:return k.Documents.DocName;case m.companies:return k.Companies.CompanyName;case m.contacts:case m.users:return k.Common.FileAs;case m.emails:return k.Emails.Subject;case m.journal:return k.Journal.FileAs;case m.tasks:return k.Tasks.Subject;case m.workReports:return k.WorkReports.Subject;case m.vacation:return k.Vacation.TypeEn;case m.carts:case m.goods:case m.goodsInCart:return k.Common.FileAs;case m.groups:return k.Groups.GroupName;case m.xsltTransformations:return k.Common.FileAs;default:return console.warn(`FileAs col name not defined for folderName ${e}`),k.Common.FileAs}};class b{}b.general="GENERAL",b.group="GROUP",b.contactPerson="CONTACTPERSON",b.contact="CONTACT",b.customer="CUSTOMER",b.company="COMPANY",b.outlookProject="OUTLOOKPROJECT",b.supervisor="SUPERVISOR",b.projectOrigin="PROJECT_ORIGIN",b.cart="CART",b.goodsInCart="GOODSINCART";class D{}D.all="All",D.own="Own",D.readonly="Readonly",D.invisible="Invisible",D.none="None";class w{}var x,F,O,N;w.mandatory="Mandatory",w.optional="Optional",w.unique="Unique",w.none="None",exports.Edition=void 0,(x=exports.Edition||(exports.Edition={})).Free="Free",x.Basic="Basic",x.Professional="Professional",x.Enterprise="Enterprise",exports.Feature=void 0,(F=exports.Feature||(exports.Feature={})).ContactsAndCompanies="ContactsAndCompanies",F.Sales="Sales",F.Projects="Projects",F.Marketing="Marketing",exports.SentimentTone=void 0,(O=exports.SentimentTone||(exports.SentimentTone={}))[O.Negative=0]="Negative",O[O.Neutral=1]="Neutral",O[O.Positive=2]="Positive";class R{}R.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",R.wordAddin="WordAddin",R.excelAddin="ExcelAddin",R.tasksRecurrentTasks="TasksRecurrentTasks",R.tasksSubtasks="TasksSubtasks",R.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",R.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",R.emailsAutomaticTracking="EmailsAutomaticTracking",R.convertEmailToProject="ConvertEmailToProject",R.duplicityChecker="DuplicityChecker",R.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",R.subProjects="SubProjects",R.resourceAndPlanning="ResourceAndPlanning",R.professionalEmailCampaigns="ProfessionalEmailCampaigns",R.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",R.wordEmailMerge="WordEmailMerge",R.printLabels="PrintLabels",R.printEnvelopes="PrintEnvelopes",R.userViews="UserViews",R.sharedUserViews="SharedUserViews",R.gridConditionalFormating="GridConditionalFormating",R.multipleCurrencies="MultipleCurrencies",R.historyTracking="HistoryTracking",R.privateItems="PrivateItems",R.itemTypes="ItemTypes",R.formLayoutCustomization="FormLayoutCustomization",R.workflowBasicDefinitions="WorkflowBasicDefinitions",R.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",R.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",R.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",R.workflowGroupLevelActions="WorkflowGroupLevelActions",R.customFields="CustomFields",R.importantFields="ImportantFields",R.mandatoryFields="MandatoryFields",R.uniqueFields="UniqueFields",R.readOnlyFields="ReadOnlyFields",R.transformationCustomTemplates="TransformationCustomTemplates",R.userRoles="UserRoles",R.modulePermissions="ModulePermissions",R.columnPermissions="ColumnPermissions",R.api="API",R.gate="Gate",R.threeCXIntegration="ThreeCXIntegration",R.tapiIntegration="TapiIntegration",R.pohodaIntegration="PohodaIntegration",R.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",R.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",R.quickBooksIntegration="QuickBooksIntegration",R.saveBinaryDataOnDisk="SaveBinaryDataOnDisk",R.activeDirectoryLogin="ActiveDirectoryLogin",R.callerIdentificationOnApple="CallerIdentificationOnApple",R.legacyAdministration="LegacyAdministration";class M{}M.customAdditionalFieldsCount="CustomAdditionalFieldsCount",M.customEnabledAdvancedWorkflowsCount="CustomEnabledAdvancedWorkflowsCount",M.customEnabledBasicWorkflowsCount="CustomEnabledBasicWorkflowsCount",M.customMandatoryFieldsCount="CustomMandatoryFieldsCount",M.customOptionalFieldsCount="CustomOptionalFieldsCount",M.customReadonlyFieldsCount="CustomReadonlyFieldsCount",M.customUniqueFieldsCount="CustomUniqueFieldsCount",M.customVisibleTypesCount="CustomVisibleTypesCount",M.visibleCurrenciesCount="VisibleCurrenciesCount";class _{}_.contactsAutomaticSynchronizationWithOutlook="ContactsAutomaticSynchronizationWithOutlook",_.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",_.contactsSynchronizationWithAndroid="ContactsSynchronizationWithAndroid",_.documentsRevisions="DocumentsRevisions",_.wordAddin="WordAddin",_.excelAddin="ExcelAddin",_.tasksReminders="TasksReminders",_.tasksRecurrentTasks="TasksRecurrentTasks",_.tasksSubtasks="TasksSubtasks",_.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",_.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",_.emailsManualTracking="EmailsManualTracking",_.emailsAutomaticTracking="EmailsAutomaticTracking",_.emailSummaryAndSentimentToneFromAi="EmailSummaryAndSentimentToneFromAi",_.convertEmailToContact="ConvertEmailToContact",_.convertEmailToDeal="ConvertEmailToDeal",_.convertEmailToProject="ConvertEmailToProject",_.convertEmailToTask="ConvertEmailToTask",_.convertFromSuggestedContact="ConvertFromSuggestedContact",_.gravatarIntegration="GravatarIntegration",_.logoboxIntegration="LogoboxIntegration",_.companiesBussinesRegisterApiIntegration="CompaniesBussinesRegisterApiIntegration",_.duplicityChecker="DuplicityChecker",_.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",_.subProjects="SubProjects",_.resourceAndPlanning="ResourceAndPlanning",_.professionalEmailCampaigns="ProfessionalEmailCampaigns",_.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",_.wordEmailMerge="WordEmailMerge",_.printLabels="PrintLabels",_.printEnvelopes="PrintEnvelopes",_.userViews="UserViews",_.sharedUserViews="SharedUserViews",_.gridRowSummary="GridRowSummary",_.gridConditionalFormating="GridConditionalFormating",_.multipleCurrencies="MultipleCurrencies",_.historyTracking="HistoryTracking",_.privateItems="PrivateItems",_.itemTypes="ItemTypes",_.formLayoutCustomization="FormLayoutCustomization",_.workflowBasicDefinitions="WorkflowBasicDefinitions",_.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",_.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",_.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",_.workflowGroupLevelActions="WorkflowGroupLevelActions",_.customFields="CustomFields",_.importantFields="ImportantFields",_.mandatoryFields="MandatoryFields",_.uniqueFields="UniqueFields",_.readOnlyFields="ReadOnlyFields",_.transformationCustomTemplates="TransformationCustomTemplates",_.userRoles="UserRoles",_.modulePermissions="ModulePermissions",_.columnPermissions="ColumnPermissions",_.commonDataAPI="CommonDataAPI",_.eWayCrmAPI="eWayCrmAPI",_.threeCXIntegration="ThreeCXIntegration",_.tapiIntegration="TapiIntegration",_.pohodaIntegration="PohodaIntegration",_.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",_.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",_.quickBooksIntegration="QuickBooksIntegration",_.shareByTeams="ShareByTeams",_.convertEmailToContactWithDataFromAi="ConvertEmailToContactWithDataFromAi",_.convertEmailToDealWithDataFromAi="ConvertEmailToDealWithDataFromAi",_.convertEmailToProjectWithDataFromAi="ConvertEmailToProjectWithDataFromAi",function(e){e.UnpaidImportantInvoices="UnpaidImportantInvoices",e.UncollectableSubscriptionPayment="UncollectableSubscriptionPayment",e.UncollectableSubscriptionPaymentWithExpiredCard="UncollectableSubscriptionPaymentWithExpiredCard",e.StandardSubscriptionPeriod="StandardSubscriptionPeriod"}(N||(N={}));var L,V=N;!function(e){e.License="License",e.CloudLicense="CloudLicense",e.MiscLicense="MiscLicense",e.Support="Support",e.Service="Service"}(L||(L={}));var G=L;class U{}U.getIsDebug=e=>{var t;return!!(null===(t=null==e?void 0:e.sessionHandler.lastSuccessfulLoginResponse)||void 0===t?void 0:t.Debug)},U.supportsFeaturesOf=(e,t)=>{var r;const s=null===(r=e.sessionHandler.lastSuccessfulLoginResponse)||void 0===r?void 0:r.WcfVersion;return!!s&&U.supportsVersionFeaturesOf(s,t)},U.supportsVersionFeaturesOf=(e,t)=>s.compare(e,t,">=")||s.compare(e,"1.0.0.0","=");class j{}j.textBox="TextBox",j.comboBox="ComboBox",j.numericBox="NumericBox",j.relation="Relation",j.checkBox="CheckBox",j.linkTextBox="LinkTextBox",j.dateEdit="DateEdit",j.memoBox="MemoBox",j.multiSelectComboBox="MultiSelectComboBox",j.workflowState="WorkflowState",j.image="Image",j.multiSelectRelation="MultiSelectRelation";const B={[m.relations]:0,[m.unifiedRelations]:1,[m.users]:2,[m.groups]:3,[m.enumTypes]:4,[m.enumValues]:5,[m.additionalFields]:6};var W,H,z,Q;exports.Version=void 0,(W=exports.Version||(exports.Version={})).Version75="7.5",W.Version76="7.6",W.Version77="7.7",W.Version81="8.1",W.Version82="8.2",W.Version83="8.3",W.Version90="9.0",W.Version91="9.1",W.Version92="9.2";class $ extends U{}$.is75OrLater=e=>U.supportsFeaturesOf(e,exports.Version.Version75),$.is76OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version76),$.is77OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version77),$.is81OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version81),$.is82OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version82),$.is83OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version83),$.is90OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version90),$.is91OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version91),$.is92OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version92),$.isFeatureSupported=(e,t)=>$.supportsFeaturesOf(e,t);class q{static createHubItemsCountsQuery(e,t,r){return{__type:"HubItemsCountsQuery:#EQ",ParentItemGuids:e,ItemTypes:t,ExcludeSystemItems:r}}static createRelatedTableQuery(e,t,r){return{__type:r?"RelatedTableQuery:#EQ":"TypelessRelatedTableQuery:#EQ",BaseItemID:e,ItemTypes:Array.isArray(t)?t:[t],RelationType:r}}static createMainTableQuery(e){return{__type:"MainTableQuery:#EQ",ItemTypes:Array.isArray(e)?e:[e]}}}q.column=e=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}),q.multiSelectComboColumnLegacy=(e,t,r)=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues]({0}, '${e}', '${t}'`,Alias:null!=r?r:e}),q.multiSelectComboColumn=(e,t,r,s,o)=>{if(!$.is77OrLater(e))return q.multiSelectComboColumnLegacy(r,s,o);return{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues_WithObjectTypeID]({0}, dbo.GetObjectTypeID('${t}'), '${r}', '${s}')`,Alias:null!=o?o:r}},q.joinColumn=(e,t,r,s,o)=>{const n={__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:e,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:t},TargetColumnName:o},Name:r};return s&&(n.Alias=s),n},q.singleVariatedColumn=(e,t,r)=>q.variatedColumn([q.columnVariation(e,t)],r),q.variatedColumn=(e,t)=>{const r={__type:"VariatedColumn:#EQ",Source:{__type:"MainTable:#EQ"},Variations:e};return t&&(r.Alias=t),r},q.columnVariation=(e,t,r)=>{const s={FolderName:t,Field:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}};return r&&(s.Field.Transformation=r),s},q.joinColumnVariation=(e,t,r,s)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:t,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:r}},Name:s}}),q.relationColumnVariation=(e,t,r,s)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:t,Direction:1,ItemTypes:r},Name:s}}),q.relatedColumn=(e,t,r,s)=>{const o={__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r};return s&&(o.Alias=s),o},q.relatedSubstituableColumn=(e,t,r,s,o)=>{const n={__type:"SubstituableColumn:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r,Substitute:s};return o&&(n.Alias=o),n},q.relatedColumnFolderNameToken=(e,t,r)=>({__type:"Token:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},TypeName:"ItemType",Alias:r}),q.folderNameToken=e=>({__type:"Token:#EQ",Source:{__type:"MainTable:#EQ"},TypeName:"ItemType",Alias:null!=e?e:"FolderName"}),q.equalsFilterExpression=(e,t)=>({__type:"EqualsFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.notEqualsExpression=(e,t)=>({__type:"NotFilterExpression:#EQ",Child:q.equalsFilterExpression(e,t)}),q.andFilterExpression=e=>({__type:"AndFilterExpressionOperator:#EQ",Children:e}),q.orFilterExpression=e=>({__type:"OrFilterExpressionOperator:#EQ",Children:e}),q.lessFilterExpression=(e,t)=>({__type:"LessFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.lessOrEqualFilterExpression=(e,t)=>({__type:"LessOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.greaterFilterExpression=(e,t)=>({__type:"GreaterFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.greaterOrEqualFilterExpression=(e,t)=>({__type:"GreaterOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.likeFilterExpression=(e,t)=>({__type:"LikeFilterExpressionPredicate:#EQ",Field:e,Value:`%${t}%`}),q.inFilterExpression=(e,t)=>({__type:"InFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.isNullOrEmptyFilterExpression=e=>q.orFilterExpression([q.equalsFilterExpression(q.column(e),null),q.equalsFilterExpression(q.column(e),"")]);class J{static toRfc3339String(e){const t=e=>e<10?`0${e}`:String(e);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}${(e=>{if(0===e)return"Z";const r=e>0?"-":"+";return e=Math.abs(e),`${r}${t(Math.floor(e/60))}:${t(e%60)}`})(e.getTimezoneOffset())}`}}J.isValid=e=>e instanceof Date&&!isNaN(e.getTime()),J.areDaysEqual=(e,t)=>{const r=J.clearTime(e),s=J.clearTime(t);return r.getTime()===s.getTime()},J.areTimesEqual=(e,t)=>e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes(),J.areDatesEqual=(e,t)=>!!e&&!!t&&J.areDaysEqual(e,t)&&J.areTimesEqual(e,t),J.clearTime=e=>{const t=new Date(e);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},J.isWithoutTime=e=>0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds(),J.getFormattedSqlDateTime=e=>e.toISOString().slice(0,19).replace("T"," "),J.getRfcWithoutTimezone=e=>e.slice(0,19),exports.TransformItemFormats=void 0,(H=exports.TransformItemFormats||(exports.TransformItemFormats={})).OpenXmlDocx="OpenXmlDocx",H.Pdf="Pdf",H.WordMlXml="WordMlXml";exports.EnumTypeEditMode=void 0,(z=exports.EnumTypeEditMode||(exports.EnumTypeEditMode={})).Readonly="Readonly",z.VisibleRankDefaultOnly="VisibleRankDefaultOnly",z.Editable="Editable",exports.ImportResult=void 0,(Q=exports.ImportResult||(exports.ImportResult={})).Success="Success",Q.Failure="Failed",Q.FailureDuplicityFound="Failed_DuplicityFound",Q.FailureItemAlreadyRemoved="Failed_ItemAlreadyRemoved",Q.FailureColumnsLockedWFAction="Failed_ColumnsLocked",Q.FailureItemLockedWFAction="Failed_ItemLocked",Q.FailureLicenceLimitReached="Failed_LicenseLimitReached",Q.FailureInssuficientModulePermission="Failed_InsufficientModulePermission",Q.FailureInssuficientColumnsPermission="Failed_InsufficientColumnsPermission",c.polyfill(),exports.ApiConnectionAsNonDefaultExport=S,exports.ApiMethods=p,exports.ColumnPermissionMandatoryRules=w,exports.ColumnPermissionPermissionRules=D,exports.CommonDataConnection=class{constructor(e,t){this.isCommonDataApiEnabled=(e,t)=>{this.tokenizedConnection.isEnabled(e,t)},this.callCommonDataApi=(e,t,r,s)=>{this.tokenizedConnection.callTokenizedApi(e,t,r,s)},this.tokenizedConnection=new A("ObtainCommonDataApiAccessToken",exports.HttpMethod.get,!1,"InvalidCommonDataToken",I,e,t)}},exports.CustomizationStatsItemKeys=M,exports.DateHelper=J,exports.EWItem=class{constructor(e,t){if(!e||!t)throw new Error("Both folderName and baseItem has to be defined!");this.folderName=e,this.baseItem=t}getEmailAddress(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.Email1Address||e.Email2Address||e.Email3Address}case m.leads:return this.baseItem.Email;case m.companies:return this.baseItem.Email;case m.users:{const e=this.baseItem;return e.Email1Address||e.Email2Address}default:return null}}getInitials(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}case m.users:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}default:return null}}getInitialsInternal(e,t){const r=((null==e?void 0:e.substr(0,1))||"")+((null==t?void 0:t.substr(0,1))||"");return""==r?null:r}getItemPreview(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}case m.users:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}default:return null}}},exports.EnumTypes=d,exports.ErrorHelper=E,exports.ExpirationReason=V,exports.FieldNames=k,exports.FieldTypes=j,exports.FolderNames=m,exports.Functionality=R,exports.GlobalSettingsNames=v,exports.HttpRequestError=T,exports.LicenseKeyInvoiceSeverity=G,exports.LicenseRestrictionKeys=_,exports.OAuthHelper=C,exports.OAuthSessionHandlerBase=f,exports.ObjectTypeIds=B,exports.QueryHelper=q,exports.RelationTypes=b,exports.ReturnCodes=u,exports.StringHelper=class{static trim(e,t,r=!1){if(null==e)return e;let s=e.trim();return s.length<=t||(s=s.substring(0,t-(r?3:0)),r&&(s+="...")),s}},exports.TokenizedServiceConnection=A,exports.VersionHelper=$,exports.VersionHelperBase=U,exports.default=S;
@@ -1,80 +1,81 @@
1
1
  declare class GlobalSettingsNames {
2
- static acceptableBackwardWorkReportDays: string;
3
- static adminAppInactiveLogoutTime: string;
4
- static applyGeneralDataProtectionRules: string;
5
- static automaticallyCreateJournalAfterCallDuration: string;
6
- static bonusesCompletedState: string;
7
- static cartInvoicedState: string;
8
- static cartOrderCanceledState: string;
9
- static cartOrderInProcessState: string;
10
- static cartOrderProcessedState: string;
11
- static cartPaidState: string;
12
- static cartProposalInProcessState: string;
13
- static cartProposalProcessedState: string;
14
- static cartSalesVoucherIssuedState: string;
15
- static cartToBeInvoicedState: string;
16
- static cartVoidedState: string;
17
- static clickToCallScheme: string;
18
- static companyDuplicityCheckEnabled: string;
19
- static completedStateName: string;
20
- static contactDuplicityCheckEnabled: string;
21
- static createCompanyWhileImportingContactFromOutlook: string;
22
- static enableContactsTwoWaySyncWithM365: string;
23
- static deadStateName: string;
24
- static enableCompaniesSyncIntoMobileDeviceContacts: string;
25
- static enableContactsSyncIntoMobileDevice: string;
26
- static enableLeadsSyncIntoMobileDeviceContacts: string;
27
- static enableLlamaAiFeatures: string;
28
- static enableUsersSyncIntoMobileDeviceContacts: string;
29
- static emailsActiveProjectsLeadsFilter: string;
30
- static exchangeRatesAdminGroupName: string;
31
- static forcedEmailTrackingGroups: string;
32
- static ignoreEmailsFromDomainsOnEmailsTracking: string;
33
- static trackEmailsFromDomains: string;
34
- static groupsForAllUnpaidInvoicesNotification: string;
35
- static itemPreviewMaxHeight: string;
36
- static lastActivityAttributes: string;
37
- static leadsCompletedState: string;
38
- static leadDeadlineAlertGroups: string;
39
- static leadsDeadState: string;
40
- static marketingCompletedState: string;
41
- static marketingDeadState: string;
42
- static minimumPasswordLength: string;
43
- static nextStepAttributes: string;
44
- static notifyAboutInvoicedInvoiceInPohodaGroup: string;
45
- static notifyAboutLeadsDeadline: string;
46
- static notifyAboutPaidInvoiceInPohodaGroup: string;
47
- static notifyAboutProjectDeadline: string;
48
- static numberOfDecimalPlaces: string;
49
- static phoneListTaskSolverGroup: string;
50
- static projectDeadlineAlert: string;
51
- static serverUpdateProgressNotificationGroup: string;
52
- static sumarizeCartsPricesOnLeads: string;
53
- static sumarizeCartsPricesOnProjects: string;
54
- static sumarizePeopleExpensesOnProjects: string;
55
- static systemHealthNotificationGroup: string;
56
- static tasksCompletedState: string;
57
- static tasksDeferredState: string;
58
- static tasksInProgressState: string;
59
- static tasksNotStartedState: string;
60
- static tasksWaitOnSomeoneElseState: string;
61
- static trackDocumentVersions: string;
62
- static vacationCompletedState: string;
63
- static workReportApprovedState: string;
64
- static defaultLanguage: string;
65
- static defaultCurrency: string;
66
- static myCompanyCountry: string;
67
- static myCompanyName: string;
68
- static myCompanyStreet: string;
69
- static myCompanyCity: string;
70
- static myCompanyState: string;
71
- static myCompanyZip: string;
72
- static myCompanyId: string;
73
- static myCompanyVat: string;
74
- static mergeGoodsInCart: string;
75
- static cartRefreshLogic: string;
76
- static goodsDefaultQuantity: string;
77
- static goodsDefaultVAT: string;
78
- static goodsDefaultVATIncluded: string;
2
+ static readonly acceptableBackwardWorkReportDays = "AcceptableBackwardWorkReportDays";
3
+ static readonly adminAppInactiveLogoutTime = "AdminAppInactiveLogoutTime";
4
+ static readonly applyGeneralDataProtectionRules = "ApplyGeneralDataProtectionRules";
5
+ static readonly automaticallyCreateJournalAfterCallDuration = "AutomaticallyCreateJournalAfterCallDuration";
6
+ static readonly bonusesCompletedState = "BonusesCompletedState";
7
+ static readonly cartInvoicedState = "CartInvoicedState";
8
+ static readonly cartOrderCanceledState = "CartOrderCanceledState";
9
+ static readonly cartOrderInProcessState = "CartOrderInProcessState";
10
+ static readonly cartOrderProcessedState = "CartOrderProcessedState";
11
+ static readonly cartPaidState = "CartPaidState";
12
+ static readonly cartProposalInProcessState = "CartProposalInProcessState";
13
+ static readonly cartProposalProcessedState = "CartProposalProcessedState";
14
+ static readonly cartSalesVoucherIssuedState = "CartSalesVoucherIssuedState";
15
+ static readonly cartToBeInvoicedState = "CartToBeInvoicedState";
16
+ static readonly cartVoidedState = "CartVoidedState";
17
+ static readonly clickToCallScheme = "ClickToCallScheme";
18
+ static readonly companyDuplicityCheckEnabled = "CompanyDuplicityCheckEnabled";
19
+ static readonly completedStateName = "CompletedStateName";
20
+ static readonly contactDuplicityCheckEnabled = "ContactDuplicityCheckEnabled";
21
+ static readonly createCompanyWhileImportingContactFromOutlook = "CreateCompanyWhileImportingContactFromOutlook";
22
+ static readonly defaultProposalValidityPeriod = "DefaultProposalValidityPeriod";
23
+ static readonly enableContactsTwoWaySyncWithM365 = "EnableContactsTwoWaySyncWithM365";
24
+ static readonly deadStateName = "DeadStateName";
25
+ static readonly enableCompaniesSyncIntoMobileDeviceContacts = "EnableCompaniesSyncIntoMobileDeviceContacts";
26
+ static readonly enableContactsSyncIntoMobileDevice = "EnableContactsSyncIntoMobileDevice";
27
+ static readonly enableLeadsSyncIntoMobileDeviceContacts = "EnableLeadsSyncIntoMobileDeviceContacts";
28
+ static readonly enableLlamaAiFeatures = "EnableLlamaAiFeatures";
29
+ static readonly enableUsersSyncIntoMobileDeviceContacts = "EnableUsersSyncIntoMobileDeviceContacts";
30
+ static readonly emailsActiveProjectsLeadsFilter = "EmailsActiveProjectsLeadsFilter";
31
+ static readonly exchangeRatesAdminGroupName = "ExchangeRatesAdminGroupName";
32
+ static readonly forcedEmailTrackingGroups = "ForcedEmailTrackingGroups";
33
+ static readonly ignoreEmailsFromDomainsOnEmailsTracking = "IgnoreEmailsFromDomainsOnEmailsTracking";
34
+ static readonly trackEmailsFromDomains = "TrackEmailsFromDomains";
35
+ static readonly groupsForAllUnpaidInvoicesNotification = "GroupsForAllUnpaidInvoicesNotification";
36
+ static readonly itemPreviewMaxHeight = "ItemPreviewMaxHeight";
37
+ static readonly lastActivityAttributes = "LastActivityAttributes";
38
+ static readonly leadsCompletedState = "LeadsCompletedState";
39
+ static readonly leadDeadlineAlertGroups = "LeadDeadlineAlertGroups";
40
+ static readonly leadsDeadState = "LeadsDeadState";
41
+ static readonly marketingCompletedState = "MarketingCompletedState";
42
+ static readonly marketingDeadState = "MarketingDeadState";
43
+ static readonly minimumPasswordLength = "MinimumPasswordLength";
44
+ static readonly nextStepAttributes = "NextStepAttributes";
45
+ static readonly notifyAboutInvoicedInvoiceInPohodaGroup = "NotifyAboutInvoicedInvoiceInPohodaGroup";
46
+ static readonly notifyAboutLeadsDeadline = "NotifyAboutLeadsDeadline";
47
+ static readonly notifyAboutPaidInvoiceInPohodaGroup = "NotifyAboutPaidInvoiceInPohodaGroup";
48
+ static readonly notifyAboutProjectDeadline = "NotifyAboutProjectDeadline";
49
+ static readonly numberOfDecimalPlaces = "NumberOfDecimalPlaces";
50
+ static readonly phoneListTaskSolverGroup = "PhoneListTaskSolverGroup";
51
+ static readonly projectDeadlineAlert = "ProjectDeadlineAlert";
52
+ static readonly serverUpdateProgressNotificationGroup = "ServerUpdateProgressNotificationGroup";
53
+ static readonly sumarizeCartsPricesOnLeads = "SumarizeCartsPricesOnLeads";
54
+ static readonly sumarizeCartsPricesOnProjects = "SumarizeCartsPricesOnProjects";
55
+ static readonly sumarizePeopleExpensesOnProjects = "SumarizePeopleExpensesOnProjects";
56
+ static readonly systemHealthNotificationGroup = "SystemHealthNotificationGroup";
57
+ static readonly tasksCompletedState = "TasksCompletedState";
58
+ static readonly tasksDeferredState = "TasksDeferredState";
59
+ static readonly tasksInProgressState = "TasksInProgressState";
60
+ static readonly tasksNotStartedState = "TasksNotStartedState";
61
+ static readonly tasksWaitOnSomeoneElseState = "TasksWaitOnSomeoneElseState";
62
+ static readonly trackDocumentVersions = "TrackDocumentVersions";
63
+ static readonly vacationCompletedState = "VacationCompletedState";
64
+ static readonly workReportApprovedState = "WorkReportApprovedState";
65
+ static readonly defaultLanguage = "DefaultLanguage";
66
+ static readonly defaultCurrency = "DefaultCurrency";
67
+ static readonly myCompanyCountry = "MyCompanyCountry";
68
+ static readonly myCompanyName = "MyCompanyName";
69
+ static readonly myCompanyStreet = "MyCompanyStreet";
70
+ static readonly myCompanyCity = "MyCompanyCity";
71
+ static readonly myCompanyState = "MyCompanyState";
72
+ static readonly myCompanyZip = "MyCompanyZIP";
73
+ static readonly myCompanyId = "MyCompanyID";
74
+ static readonly myCompanyVat = "MyCompanyVAT";
75
+ static readonly mergeGoodsInCart = "MergeGoodsInCart";
76
+ static readonly cartRefreshLogic = "CartRefreshLogic";
77
+ static readonly goodsDefaultQuantity = "GoodsDefaultQuantity";
78
+ static readonly goodsDefaultVAT = "GoodsDefaultVAT";
79
+ static readonly goodsDefaultVATIncluded = "GoodsDefaultVATIncluded";
79
80
  }
80
81
  export default GlobalSettingsNames;
package/lib/esm/index.js CHANGED
@@ -5,4 +5,4 @@ import e from"axios";import*as t from"universal-base64url";import r from"jwt-dec
5
5
  * @license Licensed under MIT license
6
6
  * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
7
7
  * @version v4.2.8+1e68dce6
8
- */class l{}l.rcSuccess="rcSuccess",l.rcBadSession="rcBadSession",l.rcDuplicateContact="rcDuplicateContact",l.rcWebServiceMoved="rcWebServiceMoved",l.rcAccessDenied="rcAccessDenied",l.rcLoginUserNameChanged="rcLoginUserNameChanged",l.rcLicenseExpired="rcLicenseExpired",function(e){e.get="get",e.post="post"}(o||(o={}));class c{}c.absence="Absence",c.bonusType="BonusType",c.busyStatus="BusyStatus",c.cartType="CartType",c.companyType="CompanyType",c.contactType="ContactType",c.countryCode="CountryCode",c.currency="Currency",c.customFieldCategory="CustomFieldCategory",c.dayType="DayType",c.documentOfflineState="DocumentOfflineState",c.documentType="DocumentType",c.emailCampaignWorkflowStatus="EmailCampaignWorkflowStatus",c.emailOfflineState="EmailOfflineState",c.emailType="EmailType",c.familyStatus="FamilyStatus",c.firstContact="FirstContact",c.globalSettingsCategory="GlobalSettingsCategory",c.goalType="GoalType",c.groupColor="GroupColor",c.importance="Importance",c.journalType="JournalType",c.knowledgeLevel="KnowledgeLevel",c.knowledgeTitle="KnowledgeTitle",c.knowledgeType="KnowledgeType",c.leadType="LeadType",c.marketingType="MarketingType",c.paymentType="PaymentType",c.prefixType="PrefixType",c.productType="ProductType",c.projectOrigin="ProjectOrigin",c.projectType="ProjectType",c.reportCategory="ReportCategory",c.responseForm="ResponseForm",c.responseType="ResponseType",c.salaryDate="SalaryDate",c.salaryType="SalaryType",c.salePriceType="SalePriceType",c.sentimentTone="SentimentTone",c.suffixType="SuffixType",c.taskImportance="TaskImportance",c.tasksSnoozePeriod="TasksSnoozePeriod",c.taskStatus="TaskStatus",c.taskType="TaskType",c.trainingGrade="TrainingGrade",c.trainingTitle="TrainingTitle",c.translations="Translations",c.units="Units",c.userType="UserType",c.usStatesDistrictsTerritories="USStatesDistrictsTerritories",c.vacationType="VacationType",c.vat="VAT",c.workLoad="WorkLoad",c.workReportType="WorkReportType";class u{}u.isValidFolderName=e=>Object.values(u).includes(e),u.actions="Actions",u.additionalFields="AdditionalFields",u.bonuses="Bonuses",u.calendar="Calendar",u.capacityNotes="CapacityNotes",u.capacityNoteTypes="CapacityNoteTypes",u.carts="Carts",u.columnPermissions="ColumnPermissions",u.companies="Companies",u.contacts="Contacts",u.contactsSuggestions="ContactsSuggestions",u.currencyExchangeRates="CurrencyExchangeRates",u.documents="Documents",u.emails="Emails",u.enumTypes="EnumTypes",u.enumValues="EnumValues",u.enumValuesRelations="EnumValuesRelations",u.features="Features",u.flows="Flows",u.globalSettings="GlobalSettings",u.goals="Goals",u.goods="Goods",u.goodsInCart="GoodsInCart",u.goodsInSet="GoodsInSet",u.groups="Groups",u.history="History",u.holidays="Holidays",u.children="Children",u.individualDiscounts="IndividualDiscounts",u.invoiceItems="InvoiceItems",u.invoices="Invoices",u.itemCopyRelations="ItemCopyRelations",u.journal="Journal",u.knowledge="Knowledge",u.layouts="Layouts",u.layoutsModels="LayoutsModels",u.leads="Leads",u.ledger="Ledger",u.mappings="Mappings",u.marketing="Marketing",u.marketingList="MarketingList",u.marketingListSources="MarketingListSources",u.models="Models",u.modulePermissions="ModulePermissions",u.objectTypesOptions="ObjectTypesOptions",u.payments="Payments",u.priceListGroups="PriceListGroups",u.projectAssignments="ProjectAssignments",u.projectAssignmentsPerUserProject="ProjectAssignmentsPerUserProject",u.projectAssignmentsTotal="ProjectAssignmentsTotal",u.projectAssignmentsTotalUserProject="ProjectAssignmentsTotalUserProject",u.projectList="ProjectList",u.projects="Projects",u.projectUsersInCaPlan="ProjectUsersInCaPlan",u.relationData="RelationData",u.relations="Relations",u.reports="Reports",u.revisionsHistory="RevisionsHistory",u.salaries="Salaries",u.salePrices="SalePrices",u.prices="Prices",u.sqlObjects="SqlObjects",u.tasks="Tasks",u.recurrencePatterns="RecurrencePatterns",u.teamRoles="TeamRoles",u.templates="Templates",u.training="Training",u.unifiedRelations="UnifiedRelations",u.users="Users",u.userSettings="UserSettings",u.vacation="Vacation",u.webAccess2Options="WebAccess2Options",u.webAccessOptions="WebAccessOptions",u.workCommitments="WorkCommitments",u.workflowHistory="WorkflowHistory",u.workReports="WorkReports",u.wrongClientVersions="WrongClientVersions",u.xsltTransformations="XsltTransformations",u.xsltTransformationsModels="XsltTransformationsModels",u.getEnumTypeName=e=>e===u.bonuses?c.bonusType:e===u.carts?c.cartType:e===u.companies?c.companyType:e===u.contacts?c.contactType:e===u.documents?c.documentType:e===u.emails?c.emailType:e===u.goals?c.goalType:e===u.goods?c.productType:e===u.journal?c.journalType:e===u.knowledge?c.knowledgeType:e===u.leads?c.leadType:e===u.marketing?c.marketingType:e===u.projects?c.projectType:e===u.salaries?c.salaryType:e===u.salePrices?c.salePriceType:e===u.tasks?c.taskType:e===u.training?c.trainingTitle:e===u.users?c.userType:e===u.vacation?c.vacationType:e===u.workReports?c.workReportType:null,u.getFolderNameByEnumTypeName=e=>e===c.bonusType?u.bonuses:e===c.cartType?u.carts:e===c.companyType?u.companies:e===c.contactType?u.contacts:e===c.documentType?u.documents:e===c.emailType?u.emails:e===c.goalType?u.goals:e===c.journalType?u.journal:e===c.knowledgeType?u.knowledge:e===c.leadType?u.leads:e===c.marketingType?u.marketing:e===c.productType?u.goods:e===c.projectType?u.projects:e===c.salaryType?u.salaries:e===c.salePriceType?u.salePrices:e===c.taskType?u.tasks:e===c.trainingTitle?u.training:e===c.userType?u.users:e===c.vacationType?u.vacation:e===c.workReportType?u.workReports:null;class d{}d.getAllEmailAttachments="GetAllEmailAttachments",d.getCalendarsByItemGuids="GetCalendarsByItemGuids",d.getEmailAttachment="GetEmailAttachment",d.getItemPreview="GetItemPreview",d.getJournalsByItemGuids="GetJournalsByItemGuids",d.getMarketingCampaignsByItemGuids="GetMarketingCampaignsByItemGuids",d.getMarketingListsRecordsByItemGuids="GetMarketingListsRecordsByItemGuids",d.getRevisionHistoryRecordsByItemGuids="GetRevisionHistoryRecordsByItemGuids",d.getVacationsByItemGuids="GetVacationsByItemGuids",d.getWorkflowHistoryRecordsByItemGuids="GetWorkflowHistoryRecordsByItemGuids",d.getCompanyInformationFromTaxRegister="GetCompanyInformationFromTaxRegister",d.logIn="LogIn",d.logOut="LogOut",d.query="Query",d.queryAmount="QueryAmount",d.getServiceAuthSettings="GetServiceAuthSettings",d.getVersion="GetVersion",d.getBinaryAttachment="GetBinaryAttachment",d.getBinaryAttachmentLatestRevision="GetBinaryAttachmentLatestRevision",d.transformItem="TransformItem",d.canUnlinkItems="CanUnlinkItems",d.unlinkItems="UnlinkItems",d.getGoodsFinalPrices="GetGoodsFinalPrices",d.saveItemCopyRelation="SaveItemCopyRelation",d.getFolderNameForApiMethod=e=>{switch(e){case u.calendar:return"Calendars";case u.journal:return"Journals";case u.marketing:return"MarketingCampaigns";case u.marketingList:return"MarketingListsRecords";case u.revisionsHistory:return"RevisionHistoryRecords";case u.vacation:return"Vacations";case u.workflowHistory:return"WorkflowHistoryRecords";default:return e}},d.getGetFolderNameByItemGuidsMethodName=e=>`Get${d.getFolderNameForApiMethod(e)}ByItemGuids`,d.getGetFolderNameMethodName=e=>`Get${d.getFolderNameForApiMethod(e)}`,d.getSearchFolderNameMethodName=e=>`Search${d.getFolderNameForApiMethod(e)}`;class m{constructor(e,t,r,n,s,o){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{e.callWithoutSession(d.logIn,{userName:this.username,passwordHash:this.passwordHash,appVersion:this.appVersion,clientMachineIdentifier:this.clientMachineIdentifier,clientMachineName:this.clientMachineName,createSessionCookie:e.supportsGetItemPreviewMethod},(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new Error("Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)}))},!e||!t)throw new Error("Non of the arguments 'username', 'passwordHash' can be empty.");this.username=e,this.passwordHash=t,this.appVersion=r,this.clientMachineIdentifier=n,this.clientMachineName=s,this.errorCallback=o}}class p{constructor(){this.getSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")},this.invalidateSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")}}}class y{static createAuthorizeUrl(e,t,r,n,s,o,i=!1){if(s&&!o||!s&&o)throw new Error("If codeChallenge is defined, codeChallengeMethod must also be defined and vice versa");let a=`https://login.eway-crm.${i?"dev":"com"}?scope=${encodeURIComponent(t.join(" "))}&prompt=login&response_type=code&redirect_uri=${encodeURIComponent(r)}&client_id=${e}`;return n&&(a+=`&state=${encodeURIComponent(n)}`),s&&o&&(a+=`&code_challenge=${encodeURIComponent(s)}&code_challenge_method=${encodeURIComponent(o)}`),a}}y.finishAuthorization=(e,t,r,n,s,o,i)=>{const a=new URLSearchParams;a.append("code_verifier",n),a.append("client_id",t),a.append("client_secret",r),a.append("code",s),a.append("redirect_uri",o),a.append("grant_type","authorization_code"),y.callTokenEndpoint(e,a,i)},y.refreshToken=(e,t,r,n,s)=>{const o=new URLSearchParams;o.append("client_id",t),o.append("client_secret",r),o.append("refresh_token",n),o.append("grant_type","refresh_token"),y.callTokenEndpoint(e,o,s)},y.getWebServiceUrl=e=>{const r=e.split(".");if(2!==r.length)throw new Error("Invalid token supplied");return t.decode(r[1])},y.getUserName=e=>y.decodeAccessToken(e).username,y.decodeAccessToken=e=>r(e),y.callTokenEndpoint=(t,r,n)=>{e.post(t+"/auth/connect/token",r,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((e=>{n(e.data)})).catch((e=>{e.response&&400==e.response.status?n(e.response.data):n({error:"Token request failed"})}))};class h extends Error{constructor(e,t){super(),this.returnCode=e,this.message=t}}class C{constructor(e,t,r,n,s){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{const r={userName:this.username,appVersion:this.appVersion,createSessionCookie:e.supportsGetItemPreviewMethod},n={Authorization:"Bearer "+this.accessToken};e.callWithoutSession(d.logIn,r,(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new h(e.ReturnCode,"Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)}),n,void 0,(r=>{if(401!==(null==r?void 0:r.statusCode)){if(!this.errorCallback)throw r;this.errorCallback(r)}else this.getNewAccessTokenCallback(e,(r=>{this.accessToken=r.accessToken,r.error||this.getSessionId(e,t)}))}))},!e)throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");this.username=e,this.accessToken=t,this.appVersion=r,this.getNewAccessTokenCallback=n,this.errorCallback=s}}class P extends C{constructor(e,t,r,n,s,o,i,a){if(!(e&&n&&t&&r))throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");super(e,s,o,((e,t)=>{y.refreshToken(e.wsUrl,this.clientId,this.clientSecret,this.refreshToken,(e=>{try{this.refreshTokenCallback&&this.refreshTokenCallback(e)}catch(e){this.errorCallback&&this.errorCallback(new Error("Refresh token callback failed.\n"+JSON.stringify(e)))}void 0!==e.error?t({error:e.error}):t({accessToken:e.access_token})}))}),i),this.refreshToken=n,this.clientId=t,this.clientSecret=r,this.refreshTokenCallback=a}}class f extends Error{constructor(e,t){super(),this.statusCode=e,this.message=t}}class g{}g.stringifyError=e=>JSON.stringify(e,g.replaceErrors),g.replaceErrors=(e,t)=>{if(t instanceof Error){const e={};return Object.getOwnPropertyNames(t).forEach((r=>{e[r]=t[r]})),e}return t};class T{constructor(r,n,s,i){if(this.ensureLogin=()=>new Promise(((e,t)=>{if(this.sessionId)e();else{const r=r=>{r&&(this.sessionId=r,e()),t("Session Id cannot be empty")};this.sessionHandler.getSessionId(this,r)}})),this.createOpenLink=(e,r,n,s)=>{const o=t.encode(this.baseUri);let i="eway://"+r;n&&(i+="/"+(null==n?void 0:n.toLowerCase()));const a=e?"open.eway-crm.dev":"open.eway-crm.com";i=t.encode(i);let l="https://"+a+"/?ws="+o+"&l="+i;return s&&(l+="&n="+encodeURIComponent(s)),l},this.askUploadMethod=(e,t,r,n,s)=>new Promise(((o,i)=>{const a=s?e=>{throw i(e),e}:i;this.callUploadMethod(e,t,r,o,a,a,n)})),this.callUploadMethod=(t,r,n,s,o,i,a)=>{const c=()=>{this.sessionHandler.getSessionId(this,(e=>{this.sessionId=e,this.callUploadMethod(t,r,n,s,o,i,a)}))},u=this.sessionId;if(!u)return void c();const d=`${this.svcUri}/SaveBinaryAttachment?sessionId=${this.sessionId}&itemGuid=${t}&fileName=${encodeURIComponent(r)}`,m=e.post(d,n,a);T.handleCallPromise(m,s,(e=>{if(e.ReturnCode===l.rcBadSession)return this.sessionId=null,void this.sessionHandler.invalidateSessionId(u,c);if(o)o(e);else{const t=new Error("Unhandled connection return code "+e.ReturnCode+": "+e.Description);if(!this.errorCallback)throw t;this.errorCallback(t)}}),(e=>{let t=new Error("Unhandled connection error when calling "+d+": "+g.stringifyError(e));if("statusCode"in e&&413===e.statusCode&&(t=new Error("The file has exceeded the maximum allowed file size for uploading. You can contact your IT administrator or eWay-CRM support if you would like to increase the limit.")),i)i(t);else{if(!this.errorCallback)throw t;this.errorCallback(t)}}))},this.askMethod=(e,t,r,n)=>new Promise(((s,o)=>{const i=n?e=>{throw o(e),e}:o;this.callMethod(e,t,s,i,r,i)})),this.callMethod=(e,t,r,n,s,i)=>{s||(s=o.post);const a=()=>{this.sessionHandler.getSessionId(this,(o=>{this.sessionId=o,this.callMethod(e,t,r,n,s,i)}))},c=this.sessionId;if(!c)return void a();t.sessionId=c;const u=e!==d.logOut?r:e=>{this.sessionId=null,r(e)};this.callWithoutSession(e,t,u,(r=>{if(r.ReturnCode!==l.rcBadSession||(this.sessionId=null,e===d.logOut))if(n)n(r);else{const e=new Error("Unhandled connection return code "+r.ReturnCode+": "+r.Description);if(!this.errorCallback)throw e;this.errorCallback(e,t)}else this.sessionHandler.invalidateSessionId(c,a)}),null,s,i)},this.callWithoutSession=(t,r,n,s,i,a,l)=>{var c;a||(a=o.post);const u=this.svcUri+"/"+t;let m,p;switch(i&&(m={headers:i,withCredentials:null!==(c=this.supportGetItemPreviewMethod)&&void 0!==c?c:t==d.logIn}),a){case o.get:if(r)throw new Error("Calling api get method with data specified does not make any sense.");p=e.get(u,m);break;case o.post:p=e.post(u,r,m);break;default:throw new Error(`Unknown http method '${a}'.`)}T.handleCallPromise(p,n,s,(e=>{if(l)try{l(e)}catch(e){if(!this.errorCallback)throw e;this.errorCallback(e,r)}else{const t=new Error("Unhandled connection error when calling "+u+": "+g.stringifyError(e));if(!this.errorCallback)throw t;this.errorCallback(t,r)}}))},this.getItemPreviewGetMethodUrl=(e,t,r)=>this.svcUri+"/"+d.getItemPreview+"?folderName="+encodeURIComponent(e)+"&itemGuid="+encodeURIComponent(t)+(r||0===r?"&itemVersion="+encodeURIComponent(r.toString()):""),this.getEmailAttachmentGetMethodUrl=(e,t)=>this.svcUri+"/"+d.getEmailAttachment+"?itemGuid="+encodeURIComponent(e)+"&contentId="+encodeURIComponent(t),this.getAllEmailAttachmentsZipGetMethodUrl=e=>this.svcUri+"/"+d.getAllEmailAttachments+"?itemGuid="+encodeURIComponent(e),this.getBinaryAttachmentGetMethodUrl=(e,t)=>"number"==typeof t?this.svcUri+"/"+d.getBinaryAttachment+"?itemGuid="+encodeURIComponent(e)+`&revision=${t}`:this.svcUri+"/"+d.getBinaryAttachmentLatestRevision+"?itemGuid="+encodeURIComponent(e),this.getTransformItemMethodUrl=(e,t,r,n)=>`${this.svcUri}/${d.transformItem}?itemGuid=${encodeURIComponent(e)}&itemFolderName=${encodeURIComponent(t)}&transformationGuid=${encodeURIComponent(r)}&outputFormat=${n}`,this.getActiveSessionId=()=>this.sessionId,this.setActiveSessionId=e=>{this.sessionId=e},!r)throw new Error("The argument 'apiServiceUri' cannot be empty.");if(r.length<8||"https://"!==r.substr(0,8).toLowerCase()&&"http://"!==r.substr(0,7).toLowerCase())throw new Error("Api service uri must start either with 'https://' or with 'http://'.");if(".svc"===r.substr(r.length-4).toLowerCase()){this.svcUri=r;const e=["/API.svc","/InsecureAPI.svc","/WcfService/Service.svc"].find((e=>e.toLowerCase()===r.substr(r.length-e.length).toLowerCase()))||"";this.baseUri=r.substr(0,r.length-e.length)}else this.baseUri=T.normalizeWsUrl(r)||r,"https://"===r.substr(0,8).toLowerCase()?this.svcUri=this.baseUri+"/API.svc":this.svcUri=this.baseUri+"/InsecureAPI.svc";this.sessionHandler=n,this.errorCallback=s,this.sessionId=null,this.supportGetItemPreviewMethod=null!=i&&i}get supportsGetItemPreviewMethod(){return this.supportGetItemPreviewMethod}static create(e,t,r,n,s,o,i,a){return new T(e,new m(t,r,n,s,o,i),i,a)}static createAnonymous(e,t){return new T(e,new p,t)}static createUsingOAuth(e,t,r,n,s,o,i,a,l,c){return new T(e,new P(t,r,n,s,o,i,a,l),a,c)}static normalizeWsUrl(e){return e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),e}get wsUrl(){return this.baseUri}static handleCallPromise(e,t,r,n){e.then((e=>{200===e.status?e.data.ReturnCode===l.rcSuccess?t(e.data):r(e.data):n(new f(e.status,e.statusText))})).catch((e=>{e.response?n(new f(e.response.status,e.response.statusText)):n(e)}))}}class E{constructor(e,t,r,n,s,o,i){this.isEnabled=(e,t)=>{const r=()=>{this.url&&this.token?e(this.url,this.token):t()};this.url&&this.token?e(this.url,this.token):this.obtainToken(r)},this.callTokenizedApi=(e,t,r,n)=>{this.isEnabled(((s,o)=>{t.token=o,E.call(s,e,t,r,(s=>{if(s.ReturnCodeString!==this.invalidTokenReturnCode){if(n)n(s);else if(this.generalErrorCallback){const e=new Error("Unhandled tokenized service connection return code "+s.ReturnCodeString+".\nDescription: "+s.Description);this.generalErrorCallback(e)}}else this.obtainToken((()=>{this.callTokenizedApi(e,t,r,n)}))}),(e=>{if(this.generalErrorCallback){const t=new Error("Unhandled tokenized service connection communication error: "+JSON.stringify(e));this.generalErrorCallback(t)}}))}),(()=>{n&&n(null)}))},this.obtainToken=e=>{if(!this.isActive)return this.url=null,this.token=null,void e();const t=t=>{const r=this.urlAndTokenObtainer(t);r.url&&r.token?(this.url=r.url,this.token=r.token,this.isActive=!0,e()):(this.url=null,this.token=null,this.isActive=!1,e())},r=()=>{this.url=null,this.token=null,this.isActive=!1,e()};this.needsSession?this.connection.callMethod(this.obtainTokenMethodName,{},t,r,this.obtainTokenMethodType):this.connection.callWithoutSession(this.obtainTokenMethodName,null,t,r,null,this.obtainTokenMethodType)},this.obtainTokenMethodName=e,this.obtainTokenMethodType=t,this.needsSession=r,this.invalidTokenReturnCode=n,this.urlAndTokenObtainer=s,this.connection=o,this.generalErrorCallback=i||null,this.url=null,this.token=null,this.isActive=!0}static call(t,r,n,s,o,i){const a=t+"/"+r;e.post(a,n).then((e=>{200===e.status?"Success"===e.data.ReturnCodeString?s(e.data):o(e.data):i(new f(e.status,e.statusText))})).catch((e=>{e.response?i(new f(e.response.status,e.response.statusText)):i(e)}))}}const S=e=>({url:e.ServiceUrl,token:e.Token});class A{constructor(e,t){this.isCommonDataApiEnabled=(e,t)=>{this.tokenizedConnection.isEnabled(e,t)},this.callCommonDataApi=(e,t,r,n)=>{this.tokenizedConnection.callTokenizedApi(e,t,r,n)},this.tokenizedConnection=new E("ObtainCommonDataApiAccessToken",o.get,!1,"InvalidCommonDataToken",S,e,t)}}class I{}I.acceptableBackwardWorkReportDays="AcceptableBackwardWorkReportDays",I.adminAppInactiveLogoutTime="AdminAppInactiveLogoutTime",I.applyGeneralDataProtectionRules="ApplyGeneralDataProtectionRules",I.automaticallyCreateJournalAfterCallDuration="AutomaticallyCreateJournalAfterCallDuration",I.bonusesCompletedState="BonusesCompletedState",I.cartInvoicedState="CartInvoicedState",I.cartOrderCanceledState="CartOrderCanceledState",I.cartOrderInProcessState="CartOrderInProcessState",I.cartOrderProcessedState="CartOrderProcessedState",I.cartPaidState="CartPaidState",I.cartProposalInProcessState="CartProposalInProcessState",I.cartProposalProcessedState="CartProposalProcessedState",I.cartSalesVoucherIssuedState="CartSalesVoucherIssuedState",I.cartToBeInvoicedState="CartToBeInvoicedState",I.cartVoidedState="CartVoidedState",I.clickToCallScheme="ClickToCallScheme",I.companyDuplicityCheckEnabled="CompanyDuplicityCheckEnabled",I.completedStateName="CompletedStateName",I.contactDuplicityCheckEnabled="ContactDuplicityCheckEnabled",I.createCompanyWhileImportingContactFromOutlook="CreateCompanyWhileImportingContactFromOutlook",I.enableContactsTwoWaySyncWithM365="EnableContactsTwoWaySyncWithM365",I.deadStateName="DeadStateName",I.enableCompaniesSyncIntoMobileDeviceContacts="EnableCompaniesSyncIntoMobileDeviceContacts",I.enableContactsSyncIntoMobileDevice="EnableContactsSyncIntoMobileDevice",I.enableLeadsSyncIntoMobileDeviceContacts="EnableLeadsSyncIntoMobileDeviceContacts",I.enableLlamaAiFeatures="EnableLlamaAiFeatures",I.enableUsersSyncIntoMobileDeviceContacts="EnableUsersSyncIntoMobileDeviceContacts",I.emailsActiveProjectsLeadsFilter="EmailsActiveProjectsLeadsFilter",I.exchangeRatesAdminGroupName="ExchangeRatesAdminGroupName",I.forcedEmailTrackingGroups="ForcedEmailTrackingGroups",I.ignoreEmailsFromDomainsOnEmailsTracking="IgnoreEmailsFromDomainsOnEmailsTracking",I.trackEmailsFromDomains="TrackEmailsFromDomains",I.groupsForAllUnpaidInvoicesNotification="GroupsForAllUnpaidInvoicesNotification",I.itemPreviewMaxHeight="ItemPreviewMaxHeight",I.lastActivityAttributes="LastActivityAttributes",I.leadsCompletedState="LeadsCompletedState",I.leadDeadlineAlertGroups="LeadDeadlineAlertGroups",I.leadsDeadState="LeadsDeadState",I.marketingCompletedState="MarketingCompletedState",I.marketingDeadState="MarketingDeadState",I.minimumPasswordLength="MinimumPasswordLength",I.nextStepAttributes="NextStepAttributes",I.notifyAboutInvoicedInvoiceInPohodaGroup="NotifyAboutInvoicedInvoiceInPohodaGroup",I.notifyAboutLeadsDeadline="NotifyAboutLeadsDeadline",I.notifyAboutPaidInvoiceInPohodaGroup="NotifyAboutPaidInvoiceInPohodaGroup",I.notifyAboutProjectDeadline="NotifyAboutProjectDeadline",I.numberOfDecimalPlaces="NumberOfDecimalPlaces",I.phoneListTaskSolverGroup="PhoneListTaskSolverGroup",I.projectDeadlineAlert="ProjectDeadlineAlert",I.serverUpdateProgressNotificationGroup="ServerUpdateProgressNotificationGroup",I.sumarizeCartsPricesOnLeads="SumarizeCartsPricesOnLeads",I.sumarizeCartsPricesOnProjects="SumarizeCartsPricesOnProjects",I.sumarizePeopleExpensesOnProjects="SumarizePeopleExpensesOnProjects",I.systemHealthNotificationGroup="SystemHealthNotificationGroup",I.tasksCompletedState="TasksCompletedState",I.tasksDeferredState="TasksDeferredState",I.tasksInProgressState="TasksInProgressState",I.tasksNotStartedState="TasksNotStartedState",I.tasksWaitOnSomeoneElseState="TasksWaitOnSomeoneElseState",I.trackDocumentVersions="TrackDocumentVersions",I.vacationCompletedState="VacationCompletedState",I.workReportApprovedState="WorkReportApprovedState",I.defaultLanguage="DefaultLanguage",I.defaultCurrency="DefaultCurrency",I.myCompanyCountry="MyCompanyCountry",I.myCompanyName="MyCompanyName",I.myCompanyStreet="MyCompanyStreet",I.myCompanyCity="MyCompanyCity",I.myCompanyState="MyCompanyState",I.myCompanyZip="MyCompanyZIP",I.myCompanyId="MyCompanyID",I.myCompanyVat="MyCompanyVAT",I.mergeGoodsInCart="MergeGoodsInCart",I.cartRefreshLogic="CartRefreshLogic",I.goodsDefaultQuantity="GoodsDefaultQuantity",I.goodsDefaultVAT="GoodsDefaultVAT",I.goodsDefaultVATIncluded="GoodsDefaultVATIncluded";class v{}v.ServerCommon={Server_ID:"Server_ID",Server_ItemCreated:"Server_ItemCreated",Server_ItemChanged:"Server_ItemChanged"},v.Common={CreatedByGUID:"CreatedByGUID",CurrencyEn:"CurrencyEn",DefaultCurrencySuffix:"DefaultCurrency",FileAs:"FileAs",ItemCreated:"ItemCreated",ItemChanged:"ItemChanged",ItemGUID:"ItemGUID",ItemVersion:"ItemVersion",ModifiedByGUID:"ModifiedByGUID",OwnerGUID:"OwnerGUID",ParentCurrencySuffix:"ParentCurrency"},v.Calendar={EndDate:"EndDate",Note:"Note"},v.Carts={SuperiorItem:"SuperiorItem",Customer:"Customer",Contact:"Contact",TypeEn:"TypeEn",StateEn:"StateEn",PriceTotal:"PriceTotal",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",ForPayment:"ForPayment",Paid:"Paid",CurrencyEn:"CurrencyEn",EffectiveFrom:"EffectiveFrom",ValidUntil:"ValidUntil",Active:"Active",Note:"Note",ID:"ID",AccountingCaseDate:"AccountingCaseDate",TaxableSupplyDate:"TaxableSupplyDate",PaymentDate:"PaymentDate",VAT:"VAT",GoodsInCartCount:"GoodsInCartCount",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",ForPaymentDefaultCurrency:"ForPaymentDefaultCurrency",ForPaymentParentCurrency:"ForPaymentParentCurrency",PaidDefaultCurrency:"PaidDefaultCurrency",PaidParentCurrency:"PaidParentCurrency",PaidChanged:"PaidChanged",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PrevStateEn:"PrevStateEn",PurchaseExpenses:"PurchaseExpenses",PurchaseExpensesDefaultCurrency:"PurchaseExpensesDefaultCurrency",PurchaseExpensesParentCurrency:"PurchaseExpensesParentCurrency",PurchaseExpensesChanged:"PurchaseExpensesChanged",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",ProfitParentCurrency:"ProfitParentCurrency",ProfitChanged:"ProfitChanged"},v.Companies={ID:"ID",CompanyName:"CompanyName",Department:"Department",AccountNumber:"AccountNumber",IdentificationNumber:"IdentificationNumber",VatNumber:"VatNumber",Sales:"Reversal",EmployeesCount:"EmployeesCount",Purchaser:"Purchaser",Suppliers:"Suppliers",Competitor:"Competitor",Address1Street:"Address1Street",Address1City:"Address1City",Address1PostalCode:"Address1PostalCode",Address1CountryEn:"Address1CountryEn",Address1State:"Address1State",Address1POBox:"Address1POBox",Address2Street:"Address2Street",Address2City:"Address2City",Address2PostalCode:"Address2PostalCode",Address2CountryEn:"Address2CountryEn",Address2State:"Address2State",Address2POBox:"Address2POBox",Address3Street:"Address3Street",Address3City:"Address3City",Address3PostalCode:"Address3PostalCode",Address3CountryEn:"Address3CountryEn",Address3State:"Address3State",Address3POBox:"Address3POBox",InvoiceAddress:"InvoiceAddress",PostalAddress:"PostalAddress",Phone:"Phone",Mobile:"Mobile",Fax:"Fax",WebPage:"WebPage",TrackedDomains:"TrackedDomains",Email:"Email",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",ImportanceEn:"ImportanceEn",FirstContactEn:"FirstContactEn",LineOfBusiness:"LineOfBusiness",EmailOptOut:"EmailOptOut",MailingListOther:"MailingListOther",MailingListOtherValue:"MailingListOtherValue",Note:"Note",IsPrivate:"IsPrivate",NextStep:"NextStep",LastActivity:"LastActivity",AdditionalDiscount:"AdditionalDiscount"},v.Contacts={ProfilePicture:"ProfilePicture",Title:"Title",Email1Address:"Email1Address",Email2Address:"Email2Address",Email3Address:"Email3Address",DoNotSendNewsletter:"DoNotSendNewsletter",ImportanceEn:"ImportanceEn",PrefixEn:"PrefixEn",FirstName:"FirstName",MiddleName:"MiddleName",LastName:"LastName",SuffixEn:"SuffixEn",BusinessAddressStreet:"BusinessAddressStreet",BusinessAddressCity:"BusinessAddressCity",BusinessAddressPostalCode:"BusinessAddressPostalCode",BusinessAddressCountryEn:"BusinessAddressCountryEn",BusinessAddressState:"BusinessAddressState",BusinessAddressPoBox:"BusinessAddressPOBox",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",OtherAddressStreet:"OtherAddressStreet",OtherAddressCity:"OtherAddressCity",OtherAddressPostalCode:"OtherAddressPostalCode",OtherAddressCountryEn:"OtherAddressCountryEn",OtherAddressState:"OtherAddressState",OtherAddressPOBox:"OtherAddressPOBox",BusinessPhoneNumber:"TelephoneNumber1",BusinessPhoneNumber2:"TelephoneNumber5",BusinessFaxNumber:"TelephoneNumber6",MobilePhoneNumber:"TelephoneNumber3",HomePhoneNumber:"TelephoneNumber2",OtherPhoneNumber:"TelephoneNumber4",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",WebPage:"WebPage",Note:"Note",Department:"Department",Company:"Company",IsPrivate:"Private",NextStep:"NextStep",LastActivity:"LastActivity"},v.Leads={ID:"ID",FileAs:"FileAs",HumanID:"HID",Customer:"Customer",ContactPerson:"ContactPerson",Marketing:"Marketing",ReceiveDate:"ReceiveDate",Email:"Email",Phone:"Phone",Street:"Street",State:"State",CountryEn:"CountryEn",City:"City",POBox:"POBox",Zip:"Zip",Price:"Price",PriceChanged:"PriceChanged",CurrencyEn:v.Common.CurrencyEn,EstimatedEnd:"EstimatedEnd",Probability:"Probability",LeadOriginEn:"LeadOriginEn",PriceDefaultCurrency:"PriceDefaultCurrency",EstimatedValue:"EstimatedValue",EstimatedValueDefaultCurrency:"EstimatedValueDefaultCurrency",Note:"Note",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn",IsPrivate:"Private",EmailOptOut:"EmailOptOut",NextStep:"NextStep",LastActivity:"LastActivity",ItemVersion:"ItemVersion",EstimatedRevenue:"EstimatedRevenue",EstimatedRevenueDefaultCurrency:"EstimatedRevenueDefaultCurrency",CompletedDate:"CompletedDate",LostDate:"LostDate"},v.Documents={FileAs:"FileAs",DocName:"DocName",Preview:"Preview",PreviewWidth:"PreviewWidth",PreviewHeight:"PreviewHeight",DocTypeEn:"DocTypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SuperiorCompany:"Company",SuperiorContact:"Contact",DocSize:"DocSize",Extension:"Extension",CreationTime:"CreationTime",LastWriteTime:"LastWriteTime",IsPrivate:"Private",Note:"Note"},v.Emails={To:"To",From:"SenderEmailAddress",Cc:"Cc",Subject:"Subject",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SentOn:"SentOn",ReceivedTime:"ReceivedTime",FileSize:"FileSize",AttachmentsCount:"AttachmentsCount",Note:"Note",SentimentTone:"SentimentTone",Summary:"Summary"},v.GoodsBase={Code:"Code",Structure:"Structure",Note:"Note",Description:"Description",TypeEn:"TypeEn",SaleCurrencyEn:"SaleCurrencyEn",PurchaseCurrencyEn:"PurchaseCurrencyEn",UnitEn:"UnitEn",PurchasePrice:"PurchasePrice",PurchasePriceDefaultCurrency:"PurchasePriceDefaultCurrency",PurchasePriceChanged:"PurchasePriceChanged",SalePrice:"SalePrice",SalePriceDefaultCurrency:"SalePriceDefaultCurrency",SalePriceChanged:"SalePriceChanged",IsPriceSum:"IsPriceSum",VATRate:"VATRate",VATIncluded:"VATIncluded"},v.Goods=Object.assign(Object.assign({},v.GoodsBase),{PriceListGroupGUID:"PriceListGroupGUID",InventoryQuantity:"InventoryQuantity"}),v.GoodsInCart=Object.assign(Object.assign({},v.GoodsBase),{Cart:"Cart",GoodsInfo:"GoodsInfo",SuperiorItem:"SuperiorItem",Quantity:"Quantity",PriceTotal:"PriceTotal",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATTotal:"VATTotal",VATTotalDefaultCurrency:"VATTotalDefaultCurrency",VATTotalParentCurrency:"VATTotalParentCurrency",SalePriceExcludingVAT:"SalePriceExcludingVAT",SalePriceExcludingVATDefaultCurrency:"SalePriceExcludingVATDefaultCurrency",SalePriceExcludingVATParentCurrency:"SalePriceExcludingVATParentCurrency",VAT:"VAT",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PurchasePriceParentCurrency:"PurchasePriceParentCurrency",SalePriceParentCurrency:"SalePriceParentCurrency",ListPrice:"ListPrice",ListPriceDefaultCurrency:"ListPriceDefaultCurrency",ListPriceParentCurrency:"ListPriceParentCurrency",ListPriceChanged:"ListPriceChanged",Discount:"Discount",HierarchyInSet:"HierarchyInSet",IsFromSet:"IsFromSet",ParentGUID:"ParentGUID",Rank:"Rank",IncludeInCartPrice:"IncludeInCartPrice",ListPriceCustomized:"ListPriceCustomized",ChildItemsCount:"ChildItemsCount",JoinedToGUID:"JoinedToGUID",PurchasePriceTotal:"PurchasePriceTotal",PurchasePriceTotalDefaultCurrency:"PurchasePriceTotalDefaultCurrency",PurchasePriceTotalParentCurrency:"PurchasePriceTotalParentCurrency",PurchasePriceTotalChanged:"PurchasePriceTotalChanged"}),v.Journal={FileAs:"FileAs",Subject:"Subject",TypeEn:"TypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",EventStart:"EventStart",EventEnd:"EventEnd",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",Marketing:"Marketing",IsSystem:"System",IsPrivate:"Private",Note:"Note",Phone:"Phone"},v.Vacation={StartDate:"StartDate",EndDate:"EndDate",User:"User",Duration:"Duration",Place:"Place",Note:"Note",AllDay:"AllDay",TypeEn:"TypeEn",StateEn:"StateEn",IsPrivate:"Private"},v.Marketing={HumanID:"HumanID",EstimatedStart:"EstimatedStart",EstimatedEnd:"EstimatedEnd",RealStart:"RealStart",RealEnd:"RealEnd",TargetGroup:"TargetGroup",EmailsSent:"EmailsSent",EmailsDelivered:"EmailsDelivered",EmailsViewed:"EmailsViewed",PeopleUnsubscribed:"PeopleUnsubscribed",FinalRevenues:"FinalRevenues",TypeEn:"TypeEn",StateEn:"StateEn"},v.Projects={HumanID:"HID",FileAs:"FileAs",ProjectName:"ProjectName",ProjectOriginEn:"ProjectOriginEn",TypeEn:"TypeEn",StateEn:"StateEn",PaymentTypeEn:"PaymentTypeEn",ProjectStart:"ProjectStart",ProjectRealEnd:"ProjectRealEnd",EstimatedEnd:"ProjectEnd",CurrencyEn:v.Common.CurrencyEn,DefaultCurrencyEn:"DefaultCurrencyEn",EstimatedMargin:"EstimatedMargin",EstimatedPeopleExpenses:"EstimatedPeopleExpenses",EstimatedPeopleExpensesDefaultCurrency:"EstimatedPeopleExpensesDefaultCurrency",EstimatedOtherExpenses:"EstimatedOtherExpenses",EstimatedOtherExpensesDefaultCurrency:"EstimatedOtherExpensesDefaultCurrency",EstimatedPrice:"EstimatedPrice",EstimatedPriceDefaultCurrency:"EstimatedPriceDefaultCurrency",EstimatedProfit:"EstimatedProfit",EstimatedProfitDefaultCurrency:"EstimatedProfitDefaultCurrency",EstimatedPriceChanged:"EstimatedPriceChanged",EstimatedPeopleExpensesChanged:"EstimatedPeopleExpensesChanged",EstimatedOtherExpensesChanged:"EstimatedOtherExpensesChanged",Delay:"Delay",EstimatedWorkHours:"EstimatedWorkHours",TotalWorkHours:"TotalWorkHours",PeopleExpenses:"PeopleExpenses",OtherExpenses:"OtherExpenses",PeopleExpensesDefaultCurrency:"PeopleExpensesDefaultCurrency",OtherExpensesDefaultCurrency:"OtherExpensesDefaultCurrency",PeopleExpensesChanged:"PeopleExpensesChanged",OtherExpensesChanged:"OtherExpensesChanged",Price:"Price",PriceDefaultCurrency:"PriceDefaultCurrency",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",Margin:"Margin",PriceChanged:"PriceChanged",SuperiorProject:"SuperiorProject",Customer:"Customer",ContactPerson:"ContactPerson",Users:"Users",ProjectManager:"ProjectManager",InvoicePaymentDate:"InvoicePaymentDate",PaymentMaturity:"PaymentMaturity",InvoiceIssueDate:"InvoiceIssueDate",LicensesCount:"LicensesCount",LicensePrice:"LicensePrice",LicensePriceDefaultCurrency:"LicensePriceDefaultCurrency",NextStep:"NextStep",LastActivity:"LastActivity",IsPrivate:"Private",LicensePriceChanged:"LicensePriceChanged",Note:"Note",CompletedDate:"CompletedDate",LostDate:"LostDate"},v.Tasks={FileAs:"FileAs",Subject:"Subject",RootItem:"RootItem",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",StartDate:"StartDate",DueDate:"DueDate",Reminder:"Reminder",ReminderDate:"ReminderDate",ImportanceEn:"ImportanceEn",IsCompleted:"Complete",PercentComplete:"PercentComplete",PercentCompleteDecimal:"PercentCompleteDecimal",CompletedDate:"CompletedDate",Solver:"Solver",Delegator:"Delegator",Level:"Level",IsPrivate:"Private",ActualWorkHours:"ActualWorkHours",TotalWorkHours:"TotalWorkHours",Body:"Body",TypeEn:"TypeEn",StateEn:"StateEn"},v.Training={TitleEn:"TitleEn"},v.WorkReports={Task:"Task",ProjectName:"ProjectName",UserName:"UserName",Subject:"Subject",Date:"Date",FromTime:"FromTime",ToTime:"ToTime",Overtime:"Overtime",Month:"Month",Year:"Year",IsPrivate:"Private",Note:"Note",Duration:"Duration",WorkReportEn:"WorkReportEn",StateEn:"StateEn"},v.Users={ProfilePicture:"ProfilePicture",UserName:"UserName",JobTitle:"JobTitle",IDCardNumber:"IDCardNumber",Birthdate:"Birthdate",BirthPlace:"BirthPlace",PersonalIdentificationNumber:"PersonalIdentificationNumber",Active:"Active",FamilyStatusEn:"FamilyStatusEn",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",BankAccount:"BankAccount",BusinessPhoneNumber:"BusinessPhoneNumber",MobilePhoneNumber:"MobilePhoneNumber",Email1Address:"Email1Address",Email2Address:"Email2Address",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",IdentificationNumber:"IdentificationNumber",HealthInsurance:"HealthInsurance",HolidayLength:"HolidayLength",RemainingDaysOfHoliday:"RemainingDaysOfHoliday",SalaryDateEn:"SalaryDateEn",Supervisor:"Supervisor",TravelDistance:"TravelDistance",TimeAccessibility:"TimeAccessibility",TransportMode:"TransportMode",WorkdayStartTime:"WorkdayStartTime",Note:"Note",IsSystem:"IsSystem"},v.Groups={IsAdmin:"IsAdmin",GroupName:"GroupName",FileAs:"FileAs",Description:"Description",IsPM:"IsPM",System:"System",IsRole:"IsRole",IsCategory:"IsCategory",DisallowControlModulePermissions:"DisallowControlModulePermissions",DisallowControlColumnPermissions:"DisallowControlColumnPermissions",IsOutlookCategory:"IsOutlookCategory",DisallowControlUserAssignment:"DisallowControlUserAssignment",ColorEn:"ColorEn",Picture:"Picture"},v.PriceListGroups={Note:"Note"},v.Prices={SalePriceGUID:"SalePriceGUID",GoodsItemGUID:"GoodsItemGUID",Price:"Price",CurrencyEn:"CurrencyEn"},v.SalePrices={Note:"Note",Discount:"Discount",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn"},v.XsltTransformations={LangCode:"LangCode",Definition:"Definition",Namespace:"Namespace",ObjectTypeID:"ObjectTypeID",TransformationVersion:"TransformationVersion"},v.XsltTransformationsModels={ObjectTypeID:"ObjectTypeID",TransformationGUID:"TransformationGUID",ItemTypeGUID:"ItemTypeGUID"},v.allTypeEnNames=["TypeEn",v.Documents.DocTypeEn,v.WorkReports.WorkReportEn,"TitleEn"],v.getFolderFileAs=e=>{switch(e){case u.leads:return v.Leads.FileAs;case u.projects:return v.Projects.ProjectName;case u.documents:return v.Documents.DocName;case u.companies:return v.Companies.CompanyName;case u.contacts:case u.users:return v.Common.FileAs;case u.emails:return v.Emails.Subject;case u.journal:return v.Journal.FileAs;case u.tasks:return v.Tasks.Subject;case u.workReports:return v.WorkReports.Subject;case u.vacation:return v.Vacation.TypeEn;case u.carts:case u.goods:case u.goodsInCart:return v.Common.FileAs;case u.groups:return v.Groups.GroupName;case u.xsltTransformations:return v.Common.FileAs;default:return console.warn(`FileAs col name not defined for folderName ${e}`),v.Common.FileAs}};class k{}k.general="GENERAL",k.group="GROUP",k.contactPerson="CONTACTPERSON",k.contact="CONTACT",k.customer="CUSTOMER",k.company="COMPANY",k.outlookProject="OUTLOOKPROJECT",k.supervisor="SUPERVISOR",k.projectOrigin="PROJECT_ORIGIN",k.cart="CART",k.goodsInCart="GOODSINCART";class b{}b.all="All",b.own="Own",b.readonly="Readonly",b.invisible="Invisible",b.none="None";class D{}var w,F,N,O;D.mandatory="Mandatory",D.optional="Optional",D.unique="Unique",D.none="None",function(e){e.Free="Free",e.Basic="Basic",e.Professional="Professional",e.Enterprise="Enterprise"}(w||(w={})),function(e){e.ContactsAndCompanies="ContactsAndCompanies",e.Sales="Sales",e.Projects="Projects",e.Marketing="Marketing"}(F||(F={})),function(e){e[e.Negative=0]="Negative",e[e.Neutral=1]="Neutral",e[e.Positive=2]="Positive"}(N||(N={}));class R{}R.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",R.wordAddin="WordAddin",R.excelAddin="ExcelAddin",R.tasksRecurrentTasks="TasksRecurrentTasks",R.tasksSubtasks="TasksSubtasks",R.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",R.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",R.emailsAutomaticTracking="EmailsAutomaticTracking",R.convertEmailToProject="ConvertEmailToProject",R.duplicityChecker="DuplicityChecker",R.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",R.subProjects="SubProjects",R.resourceAndPlanning="ResourceAndPlanning",R.professionalEmailCampaigns="ProfessionalEmailCampaigns",R.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",R.wordEmailMerge="WordEmailMerge",R.printLabels="PrintLabels",R.printEnvelopes="PrintEnvelopes",R.userViews="UserViews",R.sharedUserViews="SharedUserViews",R.gridConditionalFormating="GridConditionalFormating",R.multipleCurrencies="MultipleCurrencies",R.historyTracking="HistoryTracking",R.privateItems="PrivateItems",R.itemTypes="ItemTypes",R.formLayoutCustomization="FormLayoutCustomization",R.workflowBasicDefinitions="WorkflowBasicDefinitions",R.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",R.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",R.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",R.workflowGroupLevelActions="WorkflowGroupLevelActions",R.customFields="CustomFields",R.importantFields="ImportantFields",R.mandatoryFields="MandatoryFields",R.uniqueFields="UniqueFields",R.readOnlyFields="ReadOnlyFields",R.transformationCustomTemplates="TransformationCustomTemplates",R.userRoles="UserRoles",R.modulePermissions="ModulePermissions",R.columnPermissions="ColumnPermissions",R.api="API",R.gate="Gate",R.threeCXIntegration="ThreeCXIntegration",R.tapiIntegration="TapiIntegration",R.pohodaIntegration="PohodaIntegration",R.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",R.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",R.quickBooksIntegration="QuickBooksIntegration",R.saveBinaryDataOnDisk="SaveBinaryDataOnDisk",R.activeDirectoryLogin="ActiveDirectoryLogin",R.callerIdentificationOnApple="CallerIdentificationOnApple",R.legacyAdministration="LegacyAdministration";class x{}x.customAdditionalFieldsCount="CustomAdditionalFieldsCount",x.customEnabledAdvancedWorkflowsCount="CustomEnabledAdvancedWorkflowsCount",x.customEnabledBasicWorkflowsCount="CustomEnabledBasicWorkflowsCount",x.customMandatoryFieldsCount="CustomMandatoryFieldsCount",x.customOptionalFieldsCount="CustomOptionalFieldsCount",x.customReadonlyFieldsCount="CustomReadonlyFieldsCount",x.customUniqueFieldsCount="CustomUniqueFieldsCount",x.customVisibleTypesCount="CustomVisibleTypesCount",x.visibleCurrenciesCount="VisibleCurrenciesCount";class M{}M.contactsAutomaticSynchronizationWithOutlook="ContactsAutomaticSynchronizationWithOutlook",M.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",M.contactsSynchronizationWithAndroid="ContactsSynchronizationWithAndroid",M.documentsRevisions="DocumentsRevisions",M.wordAddin="WordAddin",M.excelAddin="ExcelAddin",M.tasksReminders="TasksReminders",M.tasksRecurrentTasks="TasksRecurrentTasks",M.tasksSubtasks="TasksSubtasks",M.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",M.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",M.emailsManualTracking="EmailsManualTracking",M.emailsAutomaticTracking="EmailsAutomaticTracking",M.emailSummaryAndSentimentToneFromAi="EmailSummaryAndSentimentToneFromAi",M.convertEmailToContact="ConvertEmailToContact",M.convertEmailToDeal="ConvertEmailToDeal",M.convertEmailToProject="ConvertEmailToProject",M.convertEmailToTask="ConvertEmailToTask",M.convertFromSuggestedContact="ConvertFromSuggestedContact",M.gravatarIntegration="GravatarIntegration",M.logoboxIntegration="LogoboxIntegration",M.companiesBussinesRegisterApiIntegration="CompaniesBussinesRegisterApiIntegration",M.duplicityChecker="DuplicityChecker",M.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",M.subProjects="SubProjects",M.resourceAndPlanning="ResourceAndPlanning",M.professionalEmailCampaigns="ProfessionalEmailCampaigns",M.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",M.wordEmailMerge="WordEmailMerge",M.printLabels="PrintLabels",M.printEnvelopes="PrintEnvelopes",M.userViews="UserViews",M.sharedUserViews="SharedUserViews",M.gridRowSummary="GridRowSummary",M.gridConditionalFormating="GridConditionalFormating",M.multipleCurrencies="MultipleCurrencies",M.historyTracking="HistoryTracking",M.privateItems="PrivateItems",M.itemTypes="ItemTypes",M.formLayoutCustomization="FormLayoutCustomization",M.workflowBasicDefinitions="WorkflowBasicDefinitions",M.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",M.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",M.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",M.workflowGroupLevelActions="WorkflowGroupLevelActions",M.customFields="CustomFields",M.importantFields="ImportantFields",M.mandatoryFields="MandatoryFields",M.uniqueFields="UniqueFields",M.readOnlyFields="ReadOnlyFields",M.transformationCustomTemplates="TransformationCustomTemplates",M.userRoles="UserRoles",M.modulePermissions="ModulePermissions",M.columnPermissions="ColumnPermissions",M.commonDataAPI="CommonDataAPI",M.eWayCrmAPI="eWayCrmAPI",M.threeCXIntegration="ThreeCXIntegration",M.tapiIntegration="TapiIntegration",M.pohodaIntegration="PohodaIntegration",M.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",M.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",M.quickBooksIntegration="QuickBooksIntegration",M.shareByTeams="ShareByTeams",M.convertEmailToContactWithDataFromAi="ConvertEmailToContactWithDataFromAi",M.convertEmailToDealWithDataFromAi="ConvertEmailToDealWithDataFromAi",M.convertEmailToProjectWithDataFromAi="ConvertEmailToProjectWithDataFromAi",function(e){e.UnpaidImportantInvoices="UnpaidImportantInvoices",e.UncollectableSubscriptionPayment="UncollectableSubscriptionPayment",e.UncollectableSubscriptionPaymentWithExpiredCard="UncollectableSubscriptionPaymentWithExpiredCard",e.StandardSubscriptionPeriod="StandardSubscriptionPeriod"}(O||(O={}));var _,L=O;!function(e){e.License="License",e.CloudLicense="CloudLicense",e.MiscLicense="MiscLicense",e.Support="Support",e.Service="Service"}(_||(_={}));var G=_;class U{}U.getIsDebug=e=>{var t;return!!(null===(t=null==e?void 0:e.sessionHandler.lastSuccessfulLoginResponse)||void 0===t?void 0:t.Debug)},U.supportsFeaturesOf=(e,t)=>{var r;const n=null===(r=e.sessionHandler.lastSuccessfulLoginResponse)||void 0===r?void 0:r.WcfVersion;return!!n&&U.supportsVersionFeaturesOf(n,t)},U.supportsVersionFeaturesOf=(e,t)=>n(e,t,">=")||n(e,"1.0.0.0","=");class V{}V.textBox="TextBox",V.comboBox="ComboBox",V.numericBox="NumericBox",V.relation="Relation",V.checkBox="CheckBox",V.linkTextBox="LinkTextBox",V.dateEdit="DateEdit",V.memoBox="MemoBox",V.multiSelectComboBox="MultiSelectComboBox",V.workflowState="WorkflowState",V.image="Image",V.multiSelectRelation="MultiSelectRelation";const B={[u.relations]:0,[u.unifiedRelations]:1,[u.users]:2,[u.groups]:3,[u.enumTypes]:4,[u.enumValues]:5,[u.additionalFields]:6};var W,j,H,z;!function(e){e.Version75="7.5",e.Version76="7.6",e.Version77="7.7",e.Version81="8.1",e.Version82="8.2",e.Version83="8.3",e.Version90="9.0",e.Version91="9.1",e.Version92="9.2"}(W||(W={}));class Q extends U{}Q.is75OrLater=e=>U.supportsFeaturesOf(e,W.Version75),Q.is76OrLater=e=>Q.supportsFeaturesOf(e,W.Version76),Q.is77OrLater=e=>Q.supportsFeaturesOf(e,W.Version77),Q.is81OrLater=e=>Q.supportsFeaturesOf(e,W.Version81),Q.is82OrLater=e=>Q.supportsFeaturesOf(e,W.Version82),Q.is83OrLater=e=>Q.supportsFeaturesOf(e,W.Version83),Q.is90OrLater=e=>Q.supportsFeaturesOf(e,W.Version90),Q.is91OrLater=e=>Q.supportsFeaturesOf(e,W.Version91),Q.is92OrLater=e=>Q.supportsFeaturesOf(e,W.Version92),Q.isFeatureSupported=(e,t)=>Q.supportsFeaturesOf(e,t);class ${static createHubItemsCountsQuery(e,t,r){return{__type:"HubItemsCountsQuery:#EQ",ParentItemGuids:e,ItemTypes:t,ExcludeSystemItems:r}}static createRelatedTableQuery(e,t,r){return{__type:r?"RelatedTableQuery:#EQ":"TypelessRelatedTableQuery:#EQ",BaseItemID:e,ItemTypes:Array.isArray(t)?t:[t],RelationType:r}}static createMainTableQuery(e){return{__type:"MainTableQuery:#EQ",ItemTypes:Array.isArray(e)?e:[e]}}}$.column=e=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}),$.multiSelectComboColumnLegacy=(e,t,r)=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues]({0}, '${e}', '${t}'`,Alias:null!=r?r:e}),$.multiSelectComboColumn=(e,t,r,n,s)=>{if(!Q.is77OrLater(e))return $.multiSelectComboColumnLegacy(r,n,s);return{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues_WithObjectTypeID]({0}, dbo.GetObjectTypeID('${t}'), '${r}', '${n}')`,Alias:null!=s?s:r}},$.joinColumn=(e,t,r,n,s)=>{const o={__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:e,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:t},TargetColumnName:s},Name:r};return n&&(o.Alias=n),o},$.singleVariatedColumn=(e,t,r)=>$.variatedColumn([$.columnVariation(e,t)],r),$.variatedColumn=(e,t)=>{const r={__type:"VariatedColumn:#EQ",Source:{__type:"MainTable:#EQ"},Variations:e};return t&&(r.Alias=t),r},$.columnVariation=(e,t,r)=>{const n={FolderName:t,Field:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}};return r&&(n.Field.Transformation=r),n},$.joinColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:t,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:r}},Name:n}}),$.relationColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:t,Direction:1,ItemTypes:r},Name:n}}),$.relatedColumn=(e,t,r,n)=>{const s={__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r};return n&&(s.Alias=n),s},$.relatedSubstituableColumn=(e,t,r,n,s)=>{const o={__type:"SubstituableColumn:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r,Substitute:n};return s&&(o.Alias=s),o},$.relatedColumnFolderNameToken=(e,t,r)=>({__type:"Token:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},TypeName:"ItemType",Alias:r}),$.folderNameToken=e=>({__type:"Token:#EQ",Source:{__type:"MainTable:#EQ"},TypeName:"ItemType",Alias:null!=e?e:"FolderName"}),$.equalsFilterExpression=(e,t)=>({__type:"EqualsFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.notEqualsExpression=(e,t)=>({__type:"NotFilterExpression:#EQ",Child:$.equalsFilterExpression(e,t)}),$.andFilterExpression=e=>({__type:"AndFilterExpressionOperator:#EQ",Children:e}),$.orFilterExpression=e=>({__type:"OrFilterExpressionOperator:#EQ",Children:e}),$.lessFilterExpression=(e,t)=>({__type:"LessFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.lessOrEqualFilterExpression=(e,t)=>({__type:"LessOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.greaterFilterExpression=(e,t)=>({__type:"GreaterFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.greaterOrEqualFilterExpression=(e,t)=>({__type:"GreaterOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.likeFilterExpression=(e,t)=>({__type:"LikeFilterExpressionPredicate:#EQ",Field:e,Value:`%${t}%`}),$.inFilterExpression=(e,t)=>({__type:"InFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.isNullOrEmptyFilterExpression=e=>$.orFilterExpression([$.equalsFilterExpression($.column(e),null),$.equalsFilterExpression($.column(e),"")]);class q{static trim(e,t,r=!1){if(null==e)return e;let n=e.trim();return n.length<=t||(n=n.substring(0,t-(r?3:0)),r&&(n+="...")),n}}class J{static toRfc3339String(e){const t=e=>e<10?`0${e}`:String(e);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}${(e=>{if(0===e)return"Z";const r=e>0?"-":"+";return e=Math.abs(e),`${r}${t(Math.floor(e/60))}:${t(e%60)}`})(e.getTimezoneOffset())}`}}J.isValid=e=>e instanceof Date&&!isNaN(e.getTime()),J.areDaysEqual=(e,t)=>{const r=J.clearTime(e),n=J.clearTime(t);return r.getTime()===n.getTime()},J.areTimesEqual=(e,t)=>e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes(),J.areDatesEqual=(e,t)=>!!e&&!!t&&J.areDaysEqual(e,t)&&J.areTimesEqual(e,t),J.clearTime=e=>{const t=new Date(e);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},J.isWithoutTime=e=>0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds(),J.getFormattedSqlDateTime=e=>e.toISOString().slice(0,19).replace("T"," "),J.getRfcWithoutTimezone=e=>e.slice(0,19),function(e){e.OpenXmlDocx="OpenXmlDocx",e.Pdf="Pdf",e.WordMlXml="WordMlXml"}(j||(j={}));class X{constructor(e,t){if(!e||!t)throw new Error("Both folderName and baseItem has to be defined!");this.folderName=e,this.baseItem=t}getEmailAddress(){switch(this.folderName){case u.contacts:{const e=this.baseItem;return e.Email1Address||e.Email2Address||e.Email3Address}case u.leads:return this.baseItem.Email;case u.companies:return this.baseItem.Email;case u.users:{const e=this.baseItem;return e.Email1Address||e.Email2Address}default:return null}}getInitials(){switch(this.folderName){case u.contacts:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}case u.users:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}default:return null}}getInitialsInternal(e,t){const r=((null==e?void 0:e.substr(0,1))||"")+((null==t?void 0:t.substr(0,1))||"");return""==r?null:r}getItemPreview(){switch(this.folderName){case u.contacts:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}case u.users:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}default:return null}}}!function(e){e.Readonly="Readonly",e.VisibleRankDefaultOnly="VisibleRankDefaultOnly",e.Editable="Editable"}(H||(H={})),function(e){e.Success="Success",e.Failure="Failed",e.FailureDuplicityFound="Failed_DuplicityFound",e.FailureItemAlreadyRemoved="Failed_ItemAlreadyRemoved",e.FailureColumnsLockedWFAction="Failed_ColumnsLocked",e.FailureItemLockedWFAction="Failed_ItemLocked",e.FailureLicenceLimitReached="Failed_LicenseLimitReached",e.FailureInssuficientModulePermission="Failed_InsufficientModulePermission",e.FailureInssuficientColumnsPermission="Failed_InsufficientColumnsPermission"}(z||(z={})),a.polyfill();export{T as ApiConnectionAsNonDefaultExport,d as ApiMethods,D as ColumnPermissionMandatoryRules,b as ColumnPermissionPermissionRules,A as CommonDataConnection,x as CustomizationStatsItemKeys,J as DateHelper,X as EWItem,w as Edition,H as EnumTypeEditMode,c as EnumTypes,g as ErrorHelper,L as ExpirationReason,F as Feature,v as FieldNames,V as FieldTypes,u as FolderNames,R as Functionality,I as GlobalSettingsNames,o as HttpMethod,f as HttpRequestError,z as ImportResult,G as LicenseKeyInvoiceSeverity,M as LicenseRestrictionKeys,y as OAuthHelper,C as OAuthSessionHandlerBase,B as ObjectTypeIds,$ as QueryHelper,k as RelationTypes,l as ReturnCodes,N as SentimentTone,q as StringHelper,E as TokenizedServiceConnection,j as TransformItemFormats,W as Version,Q as VersionHelper,U as VersionHelperBase,T as default};
8
+ */class l{}l.rcSuccess="rcSuccess",l.rcBadSession="rcBadSession",l.rcDuplicateContact="rcDuplicateContact",l.rcWebServiceMoved="rcWebServiceMoved",l.rcAccessDenied="rcAccessDenied",l.rcLoginUserNameChanged="rcLoginUserNameChanged",l.rcLicenseExpired="rcLicenseExpired",function(e){e.get="get",e.post="post"}(o||(o={}));class c{}c.absence="Absence",c.bonusType="BonusType",c.busyStatus="BusyStatus",c.cartType="CartType",c.companyType="CompanyType",c.contactType="ContactType",c.countryCode="CountryCode",c.currency="Currency",c.customFieldCategory="CustomFieldCategory",c.dayType="DayType",c.documentOfflineState="DocumentOfflineState",c.documentType="DocumentType",c.emailCampaignWorkflowStatus="EmailCampaignWorkflowStatus",c.emailOfflineState="EmailOfflineState",c.emailType="EmailType",c.familyStatus="FamilyStatus",c.firstContact="FirstContact",c.globalSettingsCategory="GlobalSettingsCategory",c.goalType="GoalType",c.groupColor="GroupColor",c.importance="Importance",c.journalType="JournalType",c.knowledgeLevel="KnowledgeLevel",c.knowledgeTitle="KnowledgeTitle",c.knowledgeType="KnowledgeType",c.leadType="LeadType",c.marketingType="MarketingType",c.paymentType="PaymentType",c.prefixType="PrefixType",c.productType="ProductType",c.projectOrigin="ProjectOrigin",c.projectType="ProjectType",c.reportCategory="ReportCategory",c.responseForm="ResponseForm",c.responseType="ResponseType",c.salaryDate="SalaryDate",c.salaryType="SalaryType",c.salePriceType="SalePriceType",c.sentimentTone="SentimentTone",c.suffixType="SuffixType",c.taskImportance="TaskImportance",c.tasksSnoozePeriod="TasksSnoozePeriod",c.taskStatus="TaskStatus",c.taskType="TaskType",c.trainingGrade="TrainingGrade",c.trainingTitle="TrainingTitle",c.translations="Translations",c.units="Units",c.userType="UserType",c.usStatesDistrictsTerritories="USStatesDistrictsTerritories",c.vacationType="VacationType",c.vat="VAT",c.workLoad="WorkLoad",c.workReportType="WorkReportType";class u{}u.isValidFolderName=e=>Object.values(u).includes(e),u.actions="Actions",u.additionalFields="AdditionalFields",u.bonuses="Bonuses",u.calendar="Calendar",u.capacityNotes="CapacityNotes",u.capacityNoteTypes="CapacityNoteTypes",u.carts="Carts",u.columnPermissions="ColumnPermissions",u.companies="Companies",u.contacts="Contacts",u.contactsSuggestions="ContactsSuggestions",u.currencyExchangeRates="CurrencyExchangeRates",u.documents="Documents",u.emails="Emails",u.enumTypes="EnumTypes",u.enumValues="EnumValues",u.enumValuesRelations="EnumValuesRelations",u.features="Features",u.flows="Flows",u.globalSettings="GlobalSettings",u.goals="Goals",u.goods="Goods",u.goodsInCart="GoodsInCart",u.goodsInSet="GoodsInSet",u.groups="Groups",u.history="History",u.holidays="Holidays",u.children="Children",u.individualDiscounts="IndividualDiscounts",u.invoiceItems="InvoiceItems",u.invoices="Invoices",u.itemCopyRelations="ItemCopyRelations",u.journal="Journal",u.knowledge="Knowledge",u.layouts="Layouts",u.layoutsModels="LayoutsModels",u.leads="Leads",u.ledger="Ledger",u.mappings="Mappings",u.marketing="Marketing",u.marketingList="MarketingList",u.marketingListSources="MarketingListSources",u.models="Models",u.modulePermissions="ModulePermissions",u.objectTypesOptions="ObjectTypesOptions",u.payments="Payments",u.priceListGroups="PriceListGroups",u.projectAssignments="ProjectAssignments",u.projectAssignmentsPerUserProject="ProjectAssignmentsPerUserProject",u.projectAssignmentsTotal="ProjectAssignmentsTotal",u.projectAssignmentsTotalUserProject="ProjectAssignmentsTotalUserProject",u.projectList="ProjectList",u.projects="Projects",u.projectUsersInCaPlan="ProjectUsersInCaPlan",u.relationData="RelationData",u.relations="Relations",u.reports="Reports",u.revisionsHistory="RevisionsHistory",u.salaries="Salaries",u.salePrices="SalePrices",u.prices="Prices",u.sqlObjects="SqlObjects",u.tasks="Tasks",u.recurrencePatterns="RecurrencePatterns",u.teamRoles="TeamRoles",u.templates="Templates",u.training="Training",u.unifiedRelations="UnifiedRelations",u.users="Users",u.userSettings="UserSettings",u.vacation="Vacation",u.webAccess2Options="WebAccess2Options",u.webAccessOptions="WebAccessOptions",u.workCommitments="WorkCommitments",u.workflowHistory="WorkflowHistory",u.workReports="WorkReports",u.wrongClientVersions="WrongClientVersions",u.xsltTransformations="XsltTransformations",u.xsltTransformationsModels="XsltTransformationsModels",u.getEnumTypeName=e=>e===u.bonuses?c.bonusType:e===u.carts?c.cartType:e===u.companies?c.companyType:e===u.contacts?c.contactType:e===u.documents?c.documentType:e===u.emails?c.emailType:e===u.goals?c.goalType:e===u.goods?c.productType:e===u.journal?c.journalType:e===u.knowledge?c.knowledgeType:e===u.leads?c.leadType:e===u.marketing?c.marketingType:e===u.projects?c.projectType:e===u.salaries?c.salaryType:e===u.salePrices?c.salePriceType:e===u.tasks?c.taskType:e===u.training?c.trainingTitle:e===u.users?c.userType:e===u.vacation?c.vacationType:e===u.workReports?c.workReportType:null,u.getFolderNameByEnumTypeName=e=>e===c.bonusType?u.bonuses:e===c.cartType?u.carts:e===c.companyType?u.companies:e===c.contactType?u.contacts:e===c.documentType?u.documents:e===c.emailType?u.emails:e===c.goalType?u.goals:e===c.journalType?u.journal:e===c.knowledgeType?u.knowledge:e===c.leadType?u.leads:e===c.marketingType?u.marketing:e===c.productType?u.goods:e===c.projectType?u.projects:e===c.salaryType?u.salaries:e===c.salePriceType?u.salePrices:e===c.taskType?u.tasks:e===c.trainingTitle?u.training:e===c.userType?u.users:e===c.vacationType?u.vacation:e===c.workReportType?u.workReports:null;class d{}d.getAllEmailAttachments="GetAllEmailAttachments",d.getCalendarsByItemGuids="GetCalendarsByItemGuids",d.getEmailAttachment="GetEmailAttachment",d.getItemPreview="GetItemPreview",d.getJournalsByItemGuids="GetJournalsByItemGuids",d.getMarketingCampaignsByItemGuids="GetMarketingCampaignsByItemGuids",d.getMarketingListsRecordsByItemGuids="GetMarketingListsRecordsByItemGuids",d.getRevisionHistoryRecordsByItemGuids="GetRevisionHistoryRecordsByItemGuids",d.getVacationsByItemGuids="GetVacationsByItemGuids",d.getWorkflowHistoryRecordsByItemGuids="GetWorkflowHistoryRecordsByItemGuids",d.getCompanyInformationFromTaxRegister="GetCompanyInformationFromTaxRegister",d.logIn="LogIn",d.logOut="LogOut",d.query="Query",d.queryAmount="QueryAmount",d.getServiceAuthSettings="GetServiceAuthSettings",d.getVersion="GetVersion",d.getBinaryAttachment="GetBinaryAttachment",d.getBinaryAttachmentLatestRevision="GetBinaryAttachmentLatestRevision",d.transformItem="TransformItem",d.canUnlinkItems="CanUnlinkItems",d.unlinkItems="UnlinkItems",d.getGoodsFinalPrices="GetGoodsFinalPrices",d.saveItemCopyRelation="SaveItemCopyRelation",d.getFolderNameForApiMethod=e=>{switch(e){case u.calendar:return"Calendars";case u.journal:return"Journals";case u.marketing:return"MarketingCampaigns";case u.marketingList:return"MarketingListsRecords";case u.revisionsHistory:return"RevisionHistoryRecords";case u.vacation:return"Vacations";case u.workflowHistory:return"WorkflowHistoryRecords";default:return e}},d.getGetFolderNameByItemGuidsMethodName=e=>`Get${d.getFolderNameForApiMethod(e)}ByItemGuids`,d.getGetFolderNameMethodName=e=>`Get${d.getFolderNameForApiMethod(e)}`,d.getSearchFolderNameMethodName=e=>`Search${d.getFolderNameForApiMethod(e)}`;class m{constructor(e,t,r,n,s,o){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{e.callWithoutSession(d.logIn,{userName:this.username,passwordHash:this.passwordHash,appVersion:this.appVersion,clientMachineIdentifier:this.clientMachineIdentifier,clientMachineName:this.clientMachineName,createSessionCookie:e.supportsGetItemPreviewMethod},(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new Error("Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)}))},!e||!t)throw new Error("Non of the arguments 'username', 'passwordHash' can be empty.");this.username=e,this.passwordHash=t,this.appVersion=r,this.clientMachineIdentifier=n,this.clientMachineName=s,this.errorCallback=o}}class p{constructor(){this.getSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")},this.invalidateSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")}}}class y{static createAuthorizeUrl(e,t,r,n,s,o,i=!1){if(s&&!o||!s&&o)throw new Error("If codeChallenge is defined, codeChallengeMethod must also be defined and vice versa");let a=`https://login.eway-crm.${i?"dev":"com"}?scope=${encodeURIComponent(t.join(" "))}&prompt=login&response_type=code&redirect_uri=${encodeURIComponent(r)}&client_id=${e}`;return n&&(a+=`&state=${encodeURIComponent(n)}`),s&&o&&(a+=`&code_challenge=${encodeURIComponent(s)}&code_challenge_method=${encodeURIComponent(o)}`),a}}y.finishAuthorization=(e,t,r,n,s,o,i)=>{const a=new URLSearchParams;a.append("code_verifier",n),a.append("client_id",t),a.append("client_secret",r),a.append("code",s),a.append("redirect_uri",o),a.append("grant_type","authorization_code"),y.callTokenEndpoint(e,a,i)},y.refreshToken=(e,t,r,n,s)=>{const o=new URLSearchParams;o.append("client_id",t),o.append("client_secret",r),o.append("refresh_token",n),o.append("grant_type","refresh_token"),y.callTokenEndpoint(e,o,s)},y.getWebServiceUrl=e=>{const r=e.split(".");if(2!==r.length)throw new Error("Invalid token supplied");return t.decode(r[1])},y.getUserName=e=>y.decodeAccessToken(e).username,y.decodeAccessToken=e=>r(e),y.callTokenEndpoint=(t,r,n)=>{e.post(t+"/auth/connect/token",r,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((e=>{n(e.data)})).catch((e=>{e.response&&400==e.response.status?n(e.response.data):n({error:"Token request failed"})}))};class h extends Error{constructor(e,t){super(),this.returnCode=e,this.message=t}}class C{constructor(e,t,r,n,s){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{const r={userName:this.username,appVersion:this.appVersion,createSessionCookie:e.supportsGetItemPreviewMethod},n={Authorization:"Bearer "+this.accessToken};e.callWithoutSession(d.logIn,r,(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new h(e.ReturnCode,"Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)}),n,void 0,(r=>{if(401!==(null==r?void 0:r.statusCode)){if(!this.errorCallback)throw r;this.errorCallback(r)}else this.getNewAccessTokenCallback(e,(r=>{this.accessToken=r.accessToken,r.error||this.getSessionId(e,t)}))}))},!e)throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");this.username=e,this.accessToken=t,this.appVersion=r,this.getNewAccessTokenCallback=n,this.errorCallback=s}}class P extends C{constructor(e,t,r,n,s,o,i,a){if(!(e&&n&&t&&r))throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");super(e,s,o,((e,t)=>{y.refreshToken(e.wsUrl,this.clientId,this.clientSecret,this.refreshToken,(e=>{try{this.refreshTokenCallback&&this.refreshTokenCallback(e)}catch(e){this.errorCallback&&this.errorCallback(new Error("Refresh token callback failed.\n"+JSON.stringify(e)))}void 0!==e.error?t({error:e.error}):t({accessToken:e.access_token})}))}),i),this.refreshToken=n,this.clientId=t,this.clientSecret=r,this.refreshTokenCallback=a}}class f extends Error{constructor(e,t){super(),this.statusCode=e,this.message=t}}class g{}g.stringifyError=e=>JSON.stringify(e,g.replaceErrors),g.replaceErrors=(e,t)=>{if(t instanceof Error){const e={};return Object.getOwnPropertyNames(t).forEach((r=>{e[r]=t[r]})),e}return t};class T{constructor(r,n,s,i){if(this.ensureLogin=()=>new Promise(((e,t)=>{if(this.sessionId)e();else{const r=r=>{r&&(this.sessionId=r,e()),t("Session Id cannot be empty")};this.sessionHandler.getSessionId(this,r)}})),this.createOpenLink=(e,r,n,s)=>{const o=t.encode(this.baseUri);let i="eway://"+r;n&&(i+="/"+(null==n?void 0:n.toLowerCase()));const a=e?"open.eway-crm.dev":"open.eway-crm.com";i=t.encode(i);let l="https://"+a+"/?ws="+o+"&l="+i;return s&&(l+="&n="+encodeURIComponent(s)),l},this.askUploadMethod=(e,t,r,n,s)=>new Promise(((o,i)=>{const a=s?e=>{throw i(e),e}:i;this.callUploadMethod(e,t,r,o,a,a,n)})),this.callUploadMethod=(t,r,n,s,o,i,a)=>{const c=()=>{this.sessionHandler.getSessionId(this,(e=>{this.sessionId=e,this.callUploadMethod(t,r,n,s,o,i,a)}))},u=this.sessionId;if(!u)return void c();const d=`${this.svcUri}/SaveBinaryAttachment?sessionId=${this.sessionId}&itemGuid=${t}&fileName=${encodeURIComponent(r)}`,m=e.post(d,n,a);T.handleCallPromise(m,s,(e=>{if(e.ReturnCode===l.rcBadSession)return this.sessionId=null,void this.sessionHandler.invalidateSessionId(u,c);if(o)o(e);else{const t=new Error("Unhandled connection return code "+e.ReturnCode+": "+e.Description);if(!this.errorCallback)throw t;this.errorCallback(t)}}),(e=>{let t=new Error("Unhandled connection error when calling "+d+": "+g.stringifyError(e));if("statusCode"in e&&413===e.statusCode&&(t=new Error("The file has exceeded the maximum allowed file size for uploading. You can contact your IT administrator or eWay-CRM support if you would like to increase the limit.")),i)i(t);else{if(!this.errorCallback)throw t;this.errorCallback(t)}}))},this.askMethod=(e,t,r,n)=>new Promise(((s,o)=>{const i=n?e=>{throw o(e),e}:o;this.callMethod(e,t,s,i,r,i)})),this.callMethod=(e,t,r,n,s,i)=>{s||(s=o.post);const a=()=>{this.sessionHandler.getSessionId(this,(o=>{this.sessionId=o,this.callMethod(e,t,r,n,s,i)}))},c=this.sessionId;if(!c)return void a();t.sessionId=c;const u=e!==d.logOut?r:e=>{this.sessionId=null,r(e)};this.callWithoutSession(e,t,u,(r=>{if(r.ReturnCode!==l.rcBadSession||(this.sessionId=null,e===d.logOut))if(n)n(r);else{const e=new Error("Unhandled connection return code "+r.ReturnCode+": "+r.Description);if(!this.errorCallback)throw e;this.errorCallback(e,t)}else this.sessionHandler.invalidateSessionId(c,a)}),null,s,i)},this.callWithoutSession=(t,r,n,s,i,a,l)=>{var c;a||(a=o.post);const u=this.svcUri+"/"+t;let m,p;switch(i&&(m={headers:i,withCredentials:null!==(c=this.supportGetItemPreviewMethod)&&void 0!==c?c:t==d.logIn}),a){case o.get:if(r)throw new Error("Calling api get method with data specified does not make any sense.");p=e.get(u,m);break;case o.post:p=e.post(u,r,m);break;default:throw new Error(`Unknown http method '${a}'.`)}T.handleCallPromise(p,n,s,(e=>{if(l)try{l(e)}catch(e){if(!this.errorCallback)throw e;this.errorCallback(e,r)}else{const t=new Error("Unhandled connection error when calling "+u+": "+g.stringifyError(e));if(!this.errorCallback)throw t;this.errorCallback(t,r)}}))},this.getItemPreviewGetMethodUrl=(e,t,r)=>this.svcUri+"/"+d.getItemPreview+"?folderName="+encodeURIComponent(e)+"&itemGuid="+encodeURIComponent(t)+(r||0===r?"&itemVersion="+encodeURIComponent(r.toString()):""),this.getEmailAttachmentGetMethodUrl=(e,t)=>this.svcUri+"/"+d.getEmailAttachment+"?itemGuid="+encodeURIComponent(e)+"&contentId="+encodeURIComponent(t),this.getAllEmailAttachmentsZipGetMethodUrl=e=>this.svcUri+"/"+d.getAllEmailAttachments+"?itemGuid="+encodeURIComponent(e),this.getBinaryAttachmentGetMethodUrl=(e,t)=>"number"==typeof t?this.svcUri+"/"+d.getBinaryAttachment+"?itemGuid="+encodeURIComponent(e)+`&revision=${t}`:this.svcUri+"/"+d.getBinaryAttachmentLatestRevision+"?itemGuid="+encodeURIComponent(e),this.getTransformItemMethodUrl=(e,t,r,n)=>`${this.svcUri}/${d.transformItem}?itemGuid=${encodeURIComponent(e)}&itemFolderName=${encodeURIComponent(t)}&transformationGuid=${encodeURIComponent(r)}&outputFormat=${n}`,this.getActiveSessionId=()=>this.sessionId,this.setActiveSessionId=e=>{this.sessionId=e},!r)throw new Error("The argument 'apiServiceUri' cannot be empty.");if(r.length<8||"https://"!==r.substr(0,8).toLowerCase()&&"http://"!==r.substr(0,7).toLowerCase())throw new Error("Api service uri must start either with 'https://' or with 'http://'.");if(".svc"===r.substr(r.length-4).toLowerCase()){this.svcUri=r;const e=["/API.svc","/InsecureAPI.svc","/WcfService/Service.svc"].find((e=>e.toLowerCase()===r.substr(r.length-e.length).toLowerCase()))||"";this.baseUri=r.substr(0,r.length-e.length)}else this.baseUri=T.normalizeWsUrl(r)||r,"https://"===r.substr(0,8).toLowerCase()?this.svcUri=this.baseUri+"/API.svc":this.svcUri=this.baseUri+"/InsecureAPI.svc";this.sessionHandler=n,this.errorCallback=s,this.sessionId=null,this.supportGetItemPreviewMethod=null!=i&&i}get supportsGetItemPreviewMethod(){return this.supportGetItemPreviewMethod}static create(e,t,r,n,s,o,i,a){return new T(e,new m(t,r,n,s,o,i),i,a)}static createAnonymous(e,t){return new T(e,new p,t)}static createUsingOAuth(e,t,r,n,s,o,i,a,l,c){return new T(e,new P(t,r,n,s,o,i,a,l),a,c)}static normalizeWsUrl(e){return e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),e}get wsUrl(){return this.baseUri}static handleCallPromise(e,t,r,n){e.then((e=>{200===e.status?e.data.ReturnCode===l.rcSuccess?t(e.data):r(e.data):n(new f(e.status,e.statusText))})).catch((e=>{e.response?n(new f(e.response.status,e.response.statusText)):n(e)}))}}class E{constructor(e,t,r,n,s,o,i){this.isEnabled=(e,t)=>{const r=()=>{this.url&&this.token?e(this.url,this.token):t()};this.url&&this.token?e(this.url,this.token):this.obtainToken(r)},this.callTokenizedApi=(e,t,r,n)=>{this.isEnabled(((s,o)=>{t.token=o,E.call(s,e,t,r,(s=>{if(s.ReturnCodeString!==this.invalidTokenReturnCode){if(n)n(s);else if(this.generalErrorCallback){const e=new Error("Unhandled tokenized service connection return code "+s.ReturnCodeString+".\nDescription: "+s.Description);this.generalErrorCallback(e)}}else this.obtainToken((()=>{this.callTokenizedApi(e,t,r,n)}))}),(e=>{if(this.generalErrorCallback){const t=new Error("Unhandled tokenized service connection communication error: "+JSON.stringify(e));this.generalErrorCallback(t)}}))}),(()=>{n&&n(null)}))},this.obtainToken=e=>{if(!this.isActive)return this.url=null,this.token=null,void e();const t=t=>{const r=this.urlAndTokenObtainer(t);r.url&&r.token?(this.url=r.url,this.token=r.token,this.isActive=!0,e()):(this.url=null,this.token=null,this.isActive=!1,e())},r=()=>{this.url=null,this.token=null,this.isActive=!1,e()};this.needsSession?this.connection.callMethod(this.obtainTokenMethodName,{},t,r,this.obtainTokenMethodType):this.connection.callWithoutSession(this.obtainTokenMethodName,null,t,r,null,this.obtainTokenMethodType)},this.obtainTokenMethodName=e,this.obtainTokenMethodType=t,this.needsSession=r,this.invalidTokenReturnCode=n,this.urlAndTokenObtainer=s,this.connection=o,this.generalErrorCallback=i||null,this.url=null,this.token=null,this.isActive=!0}static call(t,r,n,s,o,i){const a=t+"/"+r;e.post(a,n).then((e=>{200===e.status?"Success"===e.data.ReturnCodeString?s(e.data):o(e.data):i(new f(e.status,e.statusText))})).catch((e=>{e.response?i(new f(e.response.status,e.response.statusText)):i(e)}))}}const S=e=>({url:e.ServiceUrl,token:e.Token});class A{constructor(e,t){this.isCommonDataApiEnabled=(e,t)=>{this.tokenizedConnection.isEnabled(e,t)},this.callCommonDataApi=(e,t,r,n)=>{this.tokenizedConnection.callTokenizedApi(e,t,r,n)},this.tokenizedConnection=new E("ObtainCommonDataApiAccessToken",o.get,!1,"InvalidCommonDataToken",S,e,t)}}class I{}I.acceptableBackwardWorkReportDays="AcceptableBackwardWorkReportDays",I.adminAppInactiveLogoutTime="AdminAppInactiveLogoutTime",I.applyGeneralDataProtectionRules="ApplyGeneralDataProtectionRules",I.automaticallyCreateJournalAfterCallDuration="AutomaticallyCreateJournalAfterCallDuration",I.bonusesCompletedState="BonusesCompletedState",I.cartInvoicedState="CartInvoicedState",I.cartOrderCanceledState="CartOrderCanceledState",I.cartOrderInProcessState="CartOrderInProcessState",I.cartOrderProcessedState="CartOrderProcessedState",I.cartPaidState="CartPaidState",I.cartProposalInProcessState="CartProposalInProcessState",I.cartProposalProcessedState="CartProposalProcessedState",I.cartSalesVoucherIssuedState="CartSalesVoucherIssuedState",I.cartToBeInvoicedState="CartToBeInvoicedState",I.cartVoidedState="CartVoidedState",I.clickToCallScheme="ClickToCallScheme",I.companyDuplicityCheckEnabled="CompanyDuplicityCheckEnabled",I.completedStateName="CompletedStateName",I.contactDuplicityCheckEnabled="ContactDuplicityCheckEnabled",I.createCompanyWhileImportingContactFromOutlook="CreateCompanyWhileImportingContactFromOutlook",I.defaultProposalValidityPeriod="DefaultProposalValidityPeriod",I.enableContactsTwoWaySyncWithM365="EnableContactsTwoWaySyncWithM365",I.deadStateName="DeadStateName",I.enableCompaniesSyncIntoMobileDeviceContacts="EnableCompaniesSyncIntoMobileDeviceContacts",I.enableContactsSyncIntoMobileDevice="EnableContactsSyncIntoMobileDevice",I.enableLeadsSyncIntoMobileDeviceContacts="EnableLeadsSyncIntoMobileDeviceContacts",I.enableLlamaAiFeatures="EnableLlamaAiFeatures",I.enableUsersSyncIntoMobileDeviceContacts="EnableUsersSyncIntoMobileDeviceContacts",I.emailsActiveProjectsLeadsFilter="EmailsActiveProjectsLeadsFilter",I.exchangeRatesAdminGroupName="ExchangeRatesAdminGroupName",I.forcedEmailTrackingGroups="ForcedEmailTrackingGroups",I.ignoreEmailsFromDomainsOnEmailsTracking="IgnoreEmailsFromDomainsOnEmailsTracking",I.trackEmailsFromDomains="TrackEmailsFromDomains",I.groupsForAllUnpaidInvoicesNotification="GroupsForAllUnpaidInvoicesNotification",I.itemPreviewMaxHeight="ItemPreviewMaxHeight",I.lastActivityAttributes="LastActivityAttributes",I.leadsCompletedState="LeadsCompletedState",I.leadDeadlineAlertGroups="LeadDeadlineAlertGroups",I.leadsDeadState="LeadsDeadState",I.marketingCompletedState="MarketingCompletedState",I.marketingDeadState="MarketingDeadState",I.minimumPasswordLength="MinimumPasswordLength",I.nextStepAttributes="NextStepAttributes",I.notifyAboutInvoicedInvoiceInPohodaGroup="NotifyAboutInvoicedInvoiceInPohodaGroup",I.notifyAboutLeadsDeadline="NotifyAboutLeadsDeadline",I.notifyAboutPaidInvoiceInPohodaGroup="NotifyAboutPaidInvoiceInPohodaGroup",I.notifyAboutProjectDeadline="NotifyAboutProjectDeadline",I.numberOfDecimalPlaces="NumberOfDecimalPlaces",I.phoneListTaskSolverGroup="PhoneListTaskSolverGroup",I.projectDeadlineAlert="ProjectDeadlineAlert",I.serverUpdateProgressNotificationGroup="ServerUpdateProgressNotificationGroup",I.sumarizeCartsPricesOnLeads="SumarizeCartsPricesOnLeads",I.sumarizeCartsPricesOnProjects="SumarizeCartsPricesOnProjects",I.sumarizePeopleExpensesOnProjects="SumarizePeopleExpensesOnProjects",I.systemHealthNotificationGroup="SystemHealthNotificationGroup",I.tasksCompletedState="TasksCompletedState",I.tasksDeferredState="TasksDeferredState",I.tasksInProgressState="TasksInProgressState",I.tasksNotStartedState="TasksNotStartedState",I.tasksWaitOnSomeoneElseState="TasksWaitOnSomeoneElseState",I.trackDocumentVersions="TrackDocumentVersions",I.vacationCompletedState="VacationCompletedState",I.workReportApprovedState="WorkReportApprovedState",I.defaultLanguage="DefaultLanguage",I.defaultCurrency="DefaultCurrency",I.myCompanyCountry="MyCompanyCountry",I.myCompanyName="MyCompanyName",I.myCompanyStreet="MyCompanyStreet",I.myCompanyCity="MyCompanyCity",I.myCompanyState="MyCompanyState",I.myCompanyZip="MyCompanyZIP",I.myCompanyId="MyCompanyID",I.myCompanyVat="MyCompanyVAT",I.mergeGoodsInCart="MergeGoodsInCart",I.cartRefreshLogic="CartRefreshLogic",I.goodsDefaultQuantity="GoodsDefaultQuantity",I.goodsDefaultVAT="GoodsDefaultVAT",I.goodsDefaultVATIncluded="GoodsDefaultVATIncluded";class v{}v.ServerCommon={Server_ID:"Server_ID",Server_ItemCreated:"Server_ItemCreated",Server_ItemChanged:"Server_ItemChanged"},v.Common={CreatedByGUID:"CreatedByGUID",CurrencyEn:"CurrencyEn",DefaultCurrencySuffix:"DefaultCurrency",FileAs:"FileAs",ItemCreated:"ItemCreated",ItemChanged:"ItemChanged",ItemGUID:"ItemGUID",ItemVersion:"ItemVersion",ModifiedByGUID:"ModifiedByGUID",OwnerGUID:"OwnerGUID",ParentCurrencySuffix:"ParentCurrency"},v.Calendar={EndDate:"EndDate",Note:"Note"},v.Carts={SuperiorItem:"SuperiorItem",Customer:"Customer",Contact:"Contact",TypeEn:"TypeEn",StateEn:"StateEn",PriceTotal:"PriceTotal",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",ForPayment:"ForPayment",Paid:"Paid",CurrencyEn:"CurrencyEn",EffectiveFrom:"EffectiveFrom",ValidUntil:"ValidUntil",Active:"Active",Note:"Note",ID:"ID",AccountingCaseDate:"AccountingCaseDate",TaxableSupplyDate:"TaxableSupplyDate",PaymentDate:"PaymentDate",VAT:"VAT",GoodsInCartCount:"GoodsInCartCount",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",ForPaymentDefaultCurrency:"ForPaymentDefaultCurrency",ForPaymentParentCurrency:"ForPaymentParentCurrency",PaidDefaultCurrency:"PaidDefaultCurrency",PaidParentCurrency:"PaidParentCurrency",PaidChanged:"PaidChanged",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PrevStateEn:"PrevStateEn",PurchaseExpenses:"PurchaseExpenses",PurchaseExpensesDefaultCurrency:"PurchaseExpensesDefaultCurrency",PurchaseExpensesParentCurrency:"PurchaseExpensesParentCurrency",PurchaseExpensesChanged:"PurchaseExpensesChanged",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",ProfitParentCurrency:"ProfitParentCurrency",ProfitChanged:"ProfitChanged"},v.Companies={ID:"ID",CompanyName:"CompanyName",Department:"Department",AccountNumber:"AccountNumber",IdentificationNumber:"IdentificationNumber",VatNumber:"VatNumber",Sales:"Reversal",EmployeesCount:"EmployeesCount",Purchaser:"Purchaser",Suppliers:"Suppliers",Competitor:"Competitor",Address1Street:"Address1Street",Address1City:"Address1City",Address1PostalCode:"Address1PostalCode",Address1CountryEn:"Address1CountryEn",Address1State:"Address1State",Address1POBox:"Address1POBox",Address2Street:"Address2Street",Address2City:"Address2City",Address2PostalCode:"Address2PostalCode",Address2CountryEn:"Address2CountryEn",Address2State:"Address2State",Address2POBox:"Address2POBox",Address3Street:"Address3Street",Address3City:"Address3City",Address3PostalCode:"Address3PostalCode",Address3CountryEn:"Address3CountryEn",Address3State:"Address3State",Address3POBox:"Address3POBox",InvoiceAddress:"InvoiceAddress",PostalAddress:"PostalAddress",Phone:"Phone",Mobile:"Mobile",Fax:"Fax",WebPage:"WebPage",TrackedDomains:"TrackedDomains",Email:"Email",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",ImportanceEn:"ImportanceEn",FirstContactEn:"FirstContactEn",LineOfBusiness:"LineOfBusiness",EmailOptOut:"EmailOptOut",MailingListOther:"MailingListOther",MailingListOtherValue:"MailingListOtherValue",Note:"Note",IsPrivate:"IsPrivate",NextStep:"NextStep",LastActivity:"LastActivity",AdditionalDiscount:"AdditionalDiscount"},v.Contacts={ProfilePicture:"ProfilePicture",Title:"Title",Email1Address:"Email1Address",Email2Address:"Email2Address",Email3Address:"Email3Address",DoNotSendNewsletter:"DoNotSendNewsletter",ImportanceEn:"ImportanceEn",PrefixEn:"PrefixEn",FirstName:"FirstName",MiddleName:"MiddleName",LastName:"LastName",SuffixEn:"SuffixEn",BusinessAddressStreet:"BusinessAddressStreet",BusinessAddressCity:"BusinessAddressCity",BusinessAddressPostalCode:"BusinessAddressPostalCode",BusinessAddressCountryEn:"BusinessAddressCountryEn",BusinessAddressState:"BusinessAddressState",BusinessAddressPoBox:"BusinessAddressPOBox",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",OtherAddressStreet:"OtherAddressStreet",OtherAddressCity:"OtherAddressCity",OtherAddressPostalCode:"OtherAddressPostalCode",OtherAddressCountryEn:"OtherAddressCountryEn",OtherAddressState:"OtherAddressState",OtherAddressPOBox:"OtherAddressPOBox",BusinessPhoneNumber:"TelephoneNumber1",BusinessPhoneNumber2:"TelephoneNumber5",BusinessFaxNumber:"TelephoneNumber6",MobilePhoneNumber:"TelephoneNumber3",HomePhoneNumber:"TelephoneNumber2",OtherPhoneNumber:"TelephoneNumber4",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",WebPage:"WebPage",Note:"Note",Department:"Department",Company:"Company",IsPrivate:"Private",NextStep:"NextStep",LastActivity:"LastActivity"},v.Leads={ID:"ID",FileAs:"FileAs",HumanID:"HID",Customer:"Customer",ContactPerson:"ContactPerson",Marketing:"Marketing",ReceiveDate:"ReceiveDate",Email:"Email",Phone:"Phone",Street:"Street",State:"State",CountryEn:"CountryEn",City:"City",POBox:"POBox",Zip:"Zip",Price:"Price",PriceChanged:"PriceChanged",CurrencyEn:v.Common.CurrencyEn,EstimatedEnd:"EstimatedEnd",Probability:"Probability",LeadOriginEn:"LeadOriginEn",PriceDefaultCurrency:"PriceDefaultCurrency",EstimatedValue:"EstimatedValue",EstimatedValueDefaultCurrency:"EstimatedValueDefaultCurrency",Note:"Note",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn",IsPrivate:"Private",EmailOptOut:"EmailOptOut",NextStep:"NextStep",LastActivity:"LastActivity",ItemVersion:"ItemVersion",EstimatedRevenue:"EstimatedRevenue",EstimatedRevenueDefaultCurrency:"EstimatedRevenueDefaultCurrency",CompletedDate:"CompletedDate",LostDate:"LostDate"},v.Documents={FileAs:"FileAs",DocName:"DocName",Preview:"Preview",PreviewWidth:"PreviewWidth",PreviewHeight:"PreviewHeight",DocTypeEn:"DocTypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SuperiorCompany:"Company",SuperiorContact:"Contact",DocSize:"DocSize",Extension:"Extension",CreationTime:"CreationTime",LastWriteTime:"LastWriteTime",IsPrivate:"Private",Note:"Note"},v.Emails={To:"To",From:"SenderEmailAddress",Cc:"Cc",Subject:"Subject",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SentOn:"SentOn",ReceivedTime:"ReceivedTime",FileSize:"FileSize",AttachmentsCount:"AttachmentsCount",Note:"Note",SentimentTone:"SentimentTone",Summary:"Summary"},v.GoodsBase={Code:"Code",Structure:"Structure",Note:"Note",Description:"Description",TypeEn:"TypeEn",SaleCurrencyEn:"SaleCurrencyEn",PurchaseCurrencyEn:"PurchaseCurrencyEn",UnitEn:"UnitEn",PurchasePrice:"PurchasePrice",PurchasePriceDefaultCurrency:"PurchasePriceDefaultCurrency",PurchasePriceChanged:"PurchasePriceChanged",SalePrice:"SalePrice",SalePriceDefaultCurrency:"SalePriceDefaultCurrency",SalePriceChanged:"SalePriceChanged",IsPriceSum:"IsPriceSum",VATRate:"VATRate",VATIncluded:"VATIncluded"},v.Goods=Object.assign(Object.assign({},v.GoodsBase),{PriceListGroupGUID:"PriceListGroupGUID",InventoryQuantity:"InventoryQuantity"}),v.GoodsInCart=Object.assign(Object.assign({},v.GoodsBase),{Cart:"Cart",GoodsInfo:"GoodsInfo",SuperiorItem:"SuperiorItem",Quantity:"Quantity",PriceTotal:"PriceTotal",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATTotal:"VATTotal",VATTotalDefaultCurrency:"VATTotalDefaultCurrency",VATTotalParentCurrency:"VATTotalParentCurrency",SalePriceExcludingVAT:"SalePriceExcludingVAT",SalePriceExcludingVATDefaultCurrency:"SalePriceExcludingVATDefaultCurrency",SalePriceExcludingVATParentCurrency:"SalePriceExcludingVATParentCurrency",VAT:"VAT",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PurchasePriceParentCurrency:"PurchasePriceParentCurrency",SalePriceParentCurrency:"SalePriceParentCurrency",ListPrice:"ListPrice",ListPriceDefaultCurrency:"ListPriceDefaultCurrency",ListPriceParentCurrency:"ListPriceParentCurrency",ListPriceChanged:"ListPriceChanged",Discount:"Discount",HierarchyInSet:"HierarchyInSet",IsFromSet:"IsFromSet",ParentGUID:"ParentGUID",Rank:"Rank",IncludeInCartPrice:"IncludeInCartPrice",ListPriceCustomized:"ListPriceCustomized",ChildItemsCount:"ChildItemsCount",JoinedToGUID:"JoinedToGUID",PurchasePriceTotal:"PurchasePriceTotal",PurchasePriceTotalDefaultCurrency:"PurchasePriceTotalDefaultCurrency",PurchasePriceTotalParentCurrency:"PurchasePriceTotalParentCurrency",PurchasePriceTotalChanged:"PurchasePriceTotalChanged"}),v.Journal={FileAs:"FileAs",Subject:"Subject",TypeEn:"TypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",EventStart:"EventStart",EventEnd:"EventEnd",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",Marketing:"Marketing",IsSystem:"System",IsPrivate:"Private",Note:"Note",Phone:"Phone"},v.Vacation={StartDate:"StartDate",EndDate:"EndDate",User:"User",Duration:"Duration",Place:"Place",Note:"Note",AllDay:"AllDay",TypeEn:"TypeEn",StateEn:"StateEn",IsPrivate:"Private"},v.Marketing={HumanID:"HumanID",EstimatedStart:"EstimatedStart",EstimatedEnd:"EstimatedEnd",RealStart:"RealStart",RealEnd:"RealEnd",TargetGroup:"TargetGroup",EmailsSent:"EmailsSent",EmailsDelivered:"EmailsDelivered",EmailsViewed:"EmailsViewed",PeopleUnsubscribed:"PeopleUnsubscribed",FinalRevenues:"FinalRevenues",TypeEn:"TypeEn",StateEn:"StateEn"},v.Projects={HumanID:"HID",FileAs:"FileAs",ProjectName:"ProjectName",ProjectOriginEn:"ProjectOriginEn",TypeEn:"TypeEn",StateEn:"StateEn",PaymentTypeEn:"PaymentTypeEn",ProjectStart:"ProjectStart",ProjectRealEnd:"ProjectRealEnd",EstimatedEnd:"ProjectEnd",CurrencyEn:v.Common.CurrencyEn,DefaultCurrencyEn:"DefaultCurrencyEn",EstimatedMargin:"EstimatedMargin",EstimatedPeopleExpenses:"EstimatedPeopleExpenses",EstimatedPeopleExpensesDefaultCurrency:"EstimatedPeopleExpensesDefaultCurrency",EstimatedOtherExpenses:"EstimatedOtherExpenses",EstimatedOtherExpensesDefaultCurrency:"EstimatedOtherExpensesDefaultCurrency",EstimatedPrice:"EstimatedPrice",EstimatedPriceDefaultCurrency:"EstimatedPriceDefaultCurrency",EstimatedProfit:"EstimatedProfit",EstimatedProfitDefaultCurrency:"EstimatedProfitDefaultCurrency",EstimatedPriceChanged:"EstimatedPriceChanged",EstimatedPeopleExpensesChanged:"EstimatedPeopleExpensesChanged",EstimatedOtherExpensesChanged:"EstimatedOtherExpensesChanged",Delay:"Delay",EstimatedWorkHours:"EstimatedWorkHours",TotalWorkHours:"TotalWorkHours",PeopleExpenses:"PeopleExpenses",OtherExpenses:"OtherExpenses",PeopleExpensesDefaultCurrency:"PeopleExpensesDefaultCurrency",OtherExpensesDefaultCurrency:"OtherExpensesDefaultCurrency",PeopleExpensesChanged:"PeopleExpensesChanged",OtherExpensesChanged:"OtherExpensesChanged",Price:"Price",PriceDefaultCurrency:"PriceDefaultCurrency",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",Margin:"Margin",PriceChanged:"PriceChanged",SuperiorProject:"SuperiorProject",Customer:"Customer",ContactPerson:"ContactPerson",Users:"Users",ProjectManager:"ProjectManager",InvoicePaymentDate:"InvoicePaymentDate",PaymentMaturity:"PaymentMaturity",InvoiceIssueDate:"InvoiceIssueDate",LicensesCount:"LicensesCount",LicensePrice:"LicensePrice",LicensePriceDefaultCurrency:"LicensePriceDefaultCurrency",NextStep:"NextStep",LastActivity:"LastActivity",IsPrivate:"Private",LicensePriceChanged:"LicensePriceChanged",Note:"Note",CompletedDate:"CompletedDate",LostDate:"LostDate"},v.Tasks={FileAs:"FileAs",Subject:"Subject",RootItem:"RootItem",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",StartDate:"StartDate",DueDate:"DueDate",Reminder:"Reminder",ReminderDate:"ReminderDate",ImportanceEn:"ImportanceEn",IsCompleted:"Complete",PercentComplete:"PercentComplete",PercentCompleteDecimal:"PercentCompleteDecimal",CompletedDate:"CompletedDate",Solver:"Solver",Delegator:"Delegator",Level:"Level",IsPrivate:"Private",ActualWorkHours:"ActualWorkHours",TotalWorkHours:"TotalWorkHours",Body:"Body",TypeEn:"TypeEn",StateEn:"StateEn"},v.Training={TitleEn:"TitleEn"},v.WorkReports={Task:"Task",ProjectName:"ProjectName",UserName:"UserName",Subject:"Subject",Date:"Date",FromTime:"FromTime",ToTime:"ToTime",Overtime:"Overtime",Month:"Month",Year:"Year",IsPrivate:"Private",Note:"Note",Duration:"Duration",WorkReportEn:"WorkReportEn",StateEn:"StateEn"},v.Users={ProfilePicture:"ProfilePicture",UserName:"UserName",JobTitle:"JobTitle",IDCardNumber:"IDCardNumber",Birthdate:"Birthdate",BirthPlace:"BirthPlace",PersonalIdentificationNumber:"PersonalIdentificationNumber",Active:"Active",FamilyStatusEn:"FamilyStatusEn",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",BankAccount:"BankAccount",BusinessPhoneNumber:"BusinessPhoneNumber",MobilePhoneNumber:"MobilePhoneNumber",Email1Address:"Email1Address",Email2Address:"Email2Address",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",IdentificationNumber:"IdentificationNumber",HealthInsurance:"HealthInsurance",HolidayLength:"HolidayLength",RemainingDaysOfHoliday:"RemainingDaysOfHoliday",SalaryDateEn:"SalaryDateEn",Supervisor:"Supervisor",TravelDistance:"TravelDistance",TimeAccessibility:"TimeAccessibility",TransportMode:"TransportMode",WorkdayStartTime:"WorkdayStartTime",Note:"Note",IsSystem:"IsSystem"},v.Groups={IsAdmin:"IsAdmin",GroupName:"GroupName",FileAs:"FileAs",Description:"Description",IsPM:"IsPM",System:"System",IsRole:"IsRole",IsCategory:"IsCategory",DisallowControlModulePermissions:"DisallowControlModulePermissions",DisallowControlColumnPermissions:"DisallowControlColumnPermissions",IsOutlookCategory:"IsOutlookCategory",DisallowControlUserAssignment:"DisallowControlUserAssignment",ColorEn:"ColorEn",Picture:"Picture"},v.PriceListGroups={Note:"Note"},v.Prices={SalePriceGUID:"SalePriceGUID",GoodsItemGUID:"GoodsItemGUID",Price:"Price",CurrencyEn:"CurrencyEn"},v.SalePrices={Note:"Note",Discount:"Discount",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn"},v.XsltTransformations={LangCode:"LangCode",Definition:"Definition",Namespace:"Namespace",ObjectTypeID:"ObjectTypeID",TransformationVersion:"TransformationVersion"},v.XsltTransformationsModels={ObjectTypeID:"ObjectTypeID",TransformationGUID:"TransformationGUID",ItemTypeGUID:"ItemTypeGUID"},v.allTypeEnNames=["TypeEn",v.Documents.DocTypeEn,v.WorkReports.WorkReportEn,"TitleEn"],v.getFolderFileAs=e=>{switch(e){case u.leads:return v.Leads.FileAs;case u.projects:return v.Projects.ProjectName;case u.documents:return v.Documents.DocName;case u.companies:return v.Companies.CompanyName;case u.contacts:case u.users:return v.Common.FileAs;case u.emails:return v.Emails.Subject;case u.journal:return v.Journal.FileAs;case u.tasks:return v.Tasks.Subject;case u.workReports:return v.WorkReports.Subject;case u.vacation:return v.Vacation.TypeEn;case u.carts:case u.goods:case u.goodsInCart:return v.Common.FileAs;case u.groups:return v.Groups.GroupName;case u.xsltTransformations:return v.Common.FileAs;default:return console.warn(`FileAs col name not defined for folderName ${e}`),v.Common.FileAs}};class k{}k.general="GENERAL",k.group="GROUP",k.contactPerson="CONTACTPERSON",k.contact="CONTACT",k.customer="CUSTOMER",k.company="COMPANY",k.outlookProject="OUTLOOKPROJECT",k.supervisor="SUPERVISOR",k.projectOrigin="PROJECT_ORIGIN",k.cart="CART",k.goodsInCart="GOODSINCART";class b{}b.all="All",b.own="Own",b.readonly="Readonly",b.invisible="Invisible",b.none="None";class D{}var w,F,N,O;D.mandatory="Mandatory",D.optional="Optional",D.unique="Unique",D.none="None",function(e){e.Free="Free",e.Basic="Basic",e.Professional="Professional",e.Enterprise="Enterprise"}(w||(w={})),function(e){e.ContactsAndCompanies="ContactsAndCompanies",e.Sales="Sales",e.Projects="Projects",e.Marketing="Marketing"}(F||(F={})),function(e){e[e.Negative=0]="Negative",e[e.Neutral=1]="Neutral",e[e.Positive=2]="Positive"}(N||(N={}));class R{}R.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",R.wordAddin="WordAddin",R.excelAddin="ExcelAddin",R.tasksRecurrentTasks="TasksRecurrentTasks",R.tasksSubtasks="TasksSubtasks",R.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",R.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",R.emailsAutomaticTracking="EmailsAutomaticTracking",R.convertEmailToProject="ConvertEmailToProject",R.duplicityChecker="DuplicityChecker",R.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",R.subProjects="SubProjects",R.resourceAndPlanning="ResourceAndPlanning",R.professionalEmailCampaigns="ProfessionalEmailCampaigns",R.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",R.wordEmailMerge="WordEmailMerge",R.printLabels="PrintLabels",R.printEnvelopes="PrintEnvelopes",R.userViews="UserViews",R.sharedUserViews="SharedUserViews",R.gridConditionalFormating="GridConditionalFormating",R.multipleCurrencies="MultipleCurrencies",R.historyTracking="HistoryTracking",R.privateItems="PrivateItems",R.itemTypes="ItemTypes",R.formLayoutCustomization="FormLayoutCustomization",R.workflowBasicDefinitions="WorkflowBasicDefinitions",R.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",R.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",R.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",R.workflowGroupLevelActions="WorkflowGroupLevelActions",R.customFields="CustomFields",R.importantFields="ImportantFields",R.mandatoryFields="MandatoryFields",R.uniqueFields="UniqueFields",R.readOnlyFields="ReadOnlyFields",R.transformationCustomTemplates="TransformationCustomTemplates",R.userRoles="UserRoles",R.modulePermissions="ModulePermissions",R.columnPermissions="ColumnPermissions",R.api="API",R.gate="Gate",R.threeCXIntegration="ThreeCXIntegration",R.tapiIntegration="TapiIntegration",R.pohodaIntegration="PohodaIntegration",R.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",R.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",R.quickBooksIntegration="QuickBooksIntegration",R.saveBinaryDataOnDisk="SaveBinaryDataOnDisk",R.activeDirectoryLogin="ActiveDirectoryLogin",R.callerIdentificationOnApple="CallerIdentificationOnApple",R.legacyAdministration="LegacyAdministration";class x{}x.customAdditionalFieldsCount="CustomAdditionalFieldsCount",x.customEnabledAdvancedWorkflowsCount="CustomEnabledAdvancedWorkflowsCount",x.customEnabledBasicWorkflowsCount="CustomEnabledBasicWorkflowsCount",x.customMandatoryFieldsCount="CustomMandatoryFieldsCount",x.customOptionalFieldsCount="CustomOptionalFieldsCount",x.customReadonlyFieldsCount="CustomReadonlyFieldsCount",x.customUniqueFieldsCount="CustomUniqueFieldsCount",x.customVisibleTypesCount="CustomVisibleTypesCount",x.visibleCurrenciesCount="VisibleCurrenciesCount";class M{}M.contactsAutomaticSynchronizationWithOutlook="ContactsAutomaticSynchronizationWithOutlook",M.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",M.contactsSynchronizationWithAndroid="ContactsSynchronizationWithAndroid",M.documentsRevisions="DocumentsRevisions",M.wordAddin="WordAddin",M.excelAddin="ExcelAddin",M.tasksReminders="TasksReminders",M.tasksRecurrentTasks="TasksRecurrentTasks",M.tasksSubtasks="TasksSubtasks",M.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",M.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",M.emailsManualTracking="EmailsManualTracking",M.emailsAutomaticTracking="EmailsAutomaticTracking",M.emailSummaryAndSentimentToneFromAi="EmailSummaryAndSentimentToneFromAi",M.convertEmailToContact="ConvertEmailToContact",M.convertEmailToDeal="ConvertEmailToDeal",M.convertEmailToProject="ConvertEmailToProject",M.convertEmailToTask="ConvertEmailToTask",M.convertFromSuggestedContact="ConvertFromSuggestedContact",M.gravatarIntegration="GravatarIntegration",M.logoboxIntegration="LogoboxIntegration",M.companiesBussinesRegisterApiIntegration="CompaniesBussinesRegisterApiIntegration",M.duplicityChecker="DuplicityChecker",M.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",M.subProjects="SubProjects",M.resourceAndPlanning="ResourceAndPlanning",M.professionalEmailCampaigns="ProfessionalEmailCampaigns",M.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",M.wordEmailMerge="WordEmailMerge",M.printLabels="PrintLabels",M.printEnvelopes="PrintEnvelopes",M.userViews="UserViews",M.sharedUserViews="SharedUserViews",M.gridRowSummary="GridRowSummary",M.gridConditionalFormating="GridConditionalFormating",M.multipleCurrencies="MultipleCurrencies",M.historyTracking="HistoryTracking",M.privateItems="PrivateItems",M.itemTypes="ItemTypes",M.formLayoutCustomization="FormLayoutCustomization",M.workflowBasicDefinitions="WorkflowBasicDefinitions",M.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",M.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",M.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",M.workflowGroupLevelActions="WorkflowGroupLevelActions",M.customFields="CustomFields",M.importantFields="ImportantFields",M.mandatoryFields="MandatoryFields",M.uniqueFields="UniqueFields",M.readOnlyFields="ReadOnlyFields",M.transformationCustomTemplates="TransformationCustomTemplates",M.userRoles="UserRoles",M.modulePermissions="ModulePermissions",M.columnPermissions="ColumnPermissions",M.commonDataAPI="CommonDataAPI",M.eWayCrmAPI="eWayCrmAPI",M.threeCXIntegration="ThreeCXIntegration",M.tapiIntegration="TapiIntegration",M.pohodaIntegration="PohodaIntegration",M.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",M.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",M.quickBooksIntegration="QuickBooksIntegration",M.shareByTeams="ShareByTeams",M.convertEmailToContactWithDataFromAi="ConvertEmailToContactWithDataFromAi",M.convertEmailToDealWithDataFromAi="ConvertEmailToDealWithDataFromAi",M.convertEmailToProjectWithDataFromAi="ConvertEmailToProjectWithDataFromAi",function(e){e.UnpaidImportantInvoices="UnpaidImportantInvoices",e.UncollectableSubscriptionPayment="UncollectableSubscriptionPayment",e.UncollectableSubscriptionPaymentWithExpiredCard="UncollectableSubscriptionPaymentWithExpiredCard",e.StandardSubscriptionPeriod="StandardSubscriptionPeriod"}(O||(O={}));var _,L=O;!function(e){e.License="License",e.CloudLicense="CloudLicense",e.MiscLicense="MiscLicense",e.Support="Support",e.Service="Service"}(_||(_={}));var G=_;class U{}U.getIsDebug=e=>{var t;return!!(null===(t=null==e?void 0:e.sessionHandler.lastSuccessfulLoginResponse)||void 0===t?void 0:t.Debug)},U.supportsFeaturesOf=(e,t)=>{var r;const n=null===(r=e.sessionHandler.lastSuccessfulLoginResponse)||void 0===r?void 0:r.WcfVersion;return!!n&&U.supportsVersionFeaturesOf(n,t)},U.supportsVersionFeaturesOf=(e,t)=>n(e,t,">=")||n(e,"1.0.0.0","=");class V{}V.textBox="TextBox",V.comboBox="ComboBox",V.numericBox="NumericBox",V.relation="Relation",V.checkBox="CheckBox",V.linkTextBox="LinkTextBox",V.dateEdit="DateEdit",V.memoBox="MemoBox",V.multiSelectComboBox="MultiSelectComboBox",V.workflowState="WorkflowState",V.image="Image",V.multiSelectRelation="MultiSelectRelation";const B={[u.relations]:0,[u.unifiedRelations]:1,[u.users]:2,[u.groups]:3,[u.enumTypes]:4,[u.enumValues]:5,[u.additionalFields]:6};var W,j,H,z;!function(e){e.Version75="7.5",e.Version76="7.6",e.Version77="7.7",e.Version81="8.1",e.Version82="8.2",e.Version83="8.3",e.Version90="9.0",e.Version91="9.1",e.Version92="9.2"}(W||(W={}));class Q extends U{}Q.is75OrLater=e=>U.supportsFeaturesOf(e,W.Version75),Q.is76OrLater=e=>Q.supportsFeaturesOf(e,W.Version76),Q.is77OrLater=e=>Q.supportsFeaturesOf(e,W.Version77),Q.is81OrLater=e=>Q.supportsFeaturesOf(e,W.Version81),Q.is82OrLater=e=>Q.supportsFeaturesOf(e,W.Version82),Q.is83OrLater=e=>Q.supportsFeaturesOf(e,W.Version83),Q.is90OrLater=e=>Q.supportsFeaturesOf(e,W.Version90),Q.is91OrLater=e=>Q.supportsFeaturesOf(e,W.Version91),Q.is92OrLater=e=>Q.supportsFeaturesOf(e,W.Version92),Q.isFeatureSupported=(e,t)=>Q.supportsFeaturesOf(e,t);class ${static createHubItemsCountsQuery(e,t,r){return{__type:"HubItemsCountsQuery:#EQ",ParentItemGuids:e,ItemTypes:t,ExcludeSystemItems:r}}static createRelatedTableQuery(e,t,r){return{__type:r?"RelatedTableQuery:#EQ":"TypelessRelatedTableQuery:#EQ",BaseItemID:e,ItemTypes:Array.isArray(t)?t:[t],RelationType:r}}static createMainTableQuery(e){return{__type:"MainTableQuery:#EQ",ItemTypes:Array.isArray(e)?e:[e]}}}$.column=e=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}),$.multiSelectComboColumnLegacy=(e,t,r)=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues]({0}, '${e}', '${t}'`,Alias:null!=r?r:e}),$.multiSelectComboColumn=(e,t,r,n,s)=>{if(!Q.is77OrLater(e))return $.multiSelectComboColumnLegacy(r,n,s);return{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues_WithObjectTypeID]({0}, dbo.GetObjectTypeID('${t}'), '${r}', '${n}')`,Alias:null!=s?s:r}},$.joinColumn=(e,t,r,n,s)=>{const o={__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:e,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:t},TargetColumnName:s},Name:r};return n&&(o.Alias=n),o},$.singleVariatedColumn=(e,t,r)=>$.variatedColumn([$.columnVariation(e,t)],r),$.variatedColumn=(e,t)=>{const r={__type:"VariatedColumn:#EQ",Source:{__type:"MainTable:#EQ"},Variations:e};return t&&(r.Alias=t),r},$.columnVariation=(e,t,r)=>{const n={FolderName:t,Field:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}};return r&&(n.Field.Transformation=r),n},$.joinColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:t,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:r}},Name:n}}),$.relationColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:t,Direction:1,ItemTypes:r},Name:n}}),$.relatedColumn=(e,t,r,n)=>{const s={__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r};return n&&(s.Alias=n),s},$.relatedSubstituableColumn=(e,t,r,n,s)=>{const o={__type:"SubstituableColumn:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r,Substitute:n};return s&&(o.Alias=s),o},$.relatedColumnFolderNameToken=(e,t,r)=>({__type:"Token:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},TypeName:"ItemType",Alias:r}),$.folderNameToken=e=>({__type:"Token:#EQ",Source:{__type:"MainTable:#EQ"},TypeName:"ItemType",Alias:null!=e?e:"FolderName"}),$.equalsFilterExpression=(e,t)=>({__type:"EqualsFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.notEqualsExpression=(e,t)=>({__type:"NotFilterExpression:#EQ",Child:$.equalsFilterExpression(e,t)}),$.andFilterExpression=e=>({__type:"AndFilterExpressionOperator:#EQ",Children:e}),$.orFilterExpression=e=>({__type:"OrFilterExpressionOperator:#EQ",Children:e}),$.lessFilterExpression=(e,t)=>({__type:"LessFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.lessOrEqualFilterExpression=(e,t)=>({__type:"LessOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.greaterFilterExpression=(e,t)=>({__type:"GreaterFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.greaterOrEqualFilterExpression=(e,t)=>({__type:"GreaterOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.likeFilterExpression=(e,t)=>({__type:"LikeFilterExpressionPredicate:#EQ",Field:e,Value:`%${t}%`}),$.inFilterExpression=(e,t)=>({__type:"InFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.isNullOrEmptyFilterExpression=e=>$.orFilterExpression([$.equalsFilterExpression($.column(e),null),$.equalsFilterExpression($.column(e),"")]);class q{static trim(e,t,r=!1){if(null==e)return e;let n=e.trim();return n.length<=t||(n=n.substring(0,t-(r?3:0)),r&&(n+="...")),n}}class J{static toRfc3339String(e){const t=e=>e<10?`0${e}`:String(e);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}${(e=>{if(0===e)return"Z";const r=e>0?"-":"+";return e=Math.abs(e),`${r}${t(Math.floor(e/60))}:${t(e%60)}`})(e.getTimezoneOffset())}`}}J.isValid=e=>e instanceof Date&&!isNaN(e.getTime()),J.areDaysEqual=(e,t)=>{const r=J.clearTime(e),n=J.clearTime(t);return r.getTime()===n.getTime()},J.areTimesEqual=(e,t)=>e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes(),J.areDatesEqual=(e,t)=>!!e&&!!t&&J.areDaysEqual(e,t)&&J.areTimesEqual(e,t),J.clearTime=e=>{const t=new Date(e);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},J.isWithoutTime=e=>0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds(),J.getFormattedSqlDateTime=e=>e.toISOString().slice(0,19).replace("T"," "),J.getRfcWithoutTimezone=e=>e.slice(0,19),function(e){e.OpenXmlDocx="OpenXmlDocx",e.Pdf="Pdf",e.WordMlXml="WordMlXml"}(j||(j={}));class X{constructor(e,t){if(!e||!t)throw new Error("Both folderName and baseItem has to be defined!");this.folderName=e,this.baseItem=t}getEmailAddress(){switch(this.folderName){case u.contacts:{const e=this.baseItem;return e.Email1Address||e.Email2Address||e.Email3Address}case u.leads:return this.baseItem.Email;case u.companies:return this.baseItem.Email;case u.users:{const e=this.baseItem;return e.Email1Address||e.Email2Address}default:return null}}getInitials(){switch(this.folderName){case u.contacts:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}case u.users:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}default:return null}}getInitialsInternal(e,t){const r=((null==e?void 0:e.substr(0,1))||"")+((null==t?void 0:t.substr(0,1))||"");return""==r?null:r}getItemPreview(){switch(this.folderName){case u.contacts:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}case u.users:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}default:return null}}}!function(e){e.Readonly="Readonly",e.VisibleRankDefaultOnly="VisibleRankDefaultOnly",e.Editable="Editable"}(H||(H={})),function(e){e.Success="Success",e.Failure="Failed",e.FailureDuplicityFound="Failed_DuplicityFound",e.FailureItemAlreadyRemoved="Failed_ItemAlreadyRemoved",e.FailureColumnsLockedWFAction="Failed_ColumnsLocked",e.FailureItemLockedWFAction="Failed_ItemLocked",e.FailureLicenceLimitReached="Failed_LicenseLimitReached",e.FailureInssuficientModulePermission="Failed_InsufficientModulePermission",e.FailureInssuficientColumnsPermission="Failed_InsufficientColumnsPermission"}(z||(z={})),a.polyfill();export{T as ApiConnectionAsNonDefaultExport,d as ApiMethods,D as ColumnPermissionMandatoryRules,b as ColumnPermissionPermissionRules,A as CommonDataConnection,x as CustomizationStatsItemKeys,J as DateHelper,X as EWItem,w as Edition,H as EnumTypeEditMode,c as EnumTypes,g as ErrorHelper,L as ExpirationReason,F as Feature,v as FieldNames,V as FieldTypes,u as FolderNames,R as Functionality,I as GlobalSettingsNames,o as HttpMethod,f as HttpRequestError,z as ImportResult,G as LicenseKeyInvoiceSeverity,M as LicenseRestrictionKeys,y as OAuthHelper,C as OAuthSessionHandlerBase,B as ObjectTypeIds,$ as QueryHelper,k as RelationTypes,l as ReturnCodes,N as SentimentTone,q as StringHelper,E as TokenizedServiceConnection,j as TransformItemFormats,W as Version,Q as VersionHelper,U as VersionHelperBase,T as default};
package/lib/index.d.ts CHANGED
@@ -291,83 +291,84 @@ declare class ApiMethods {
291
291
  }
292
292
 
293
293
  declare class GlobalSettingsNames {
294
- static acceptableBackwardWorkReportDays: string;
295
- static adminAppInactiveLogoutTime: string;
296
- static applyGeneralDataProtectionRules: string;
297
- static automaticallyCreateJournalAfterCallDuration: string;
298
- static bonusesCompletedState: string;
299
- static cartInvoicedState: string;
300
- static cartOrderCanceledState: string;
301
- static cartOrderInProcessState: string;
302
- static cartOrderProcessedState: string;
303
- static cartPaidState: string;
304
- static cartProposalInProcessState: string;
305
- static cartProposalProcessedState: string;
306
- static cartSalesVoucherIssuedState: string;
307
- static cartToBeInvoicedState: string;
308
- static cartVoidedState: string;
309
- static clickToCallScheme: string;
310
- static companyDuplicityCheckEnabled: string;
311
- static completedStateName: string;
312
- static contactDuplicityCheckEnabled: string;
313
- static createCompanyWhileImportingContactFromOutlook: string;
314
- static enableContactsTwoWaySyncWithM365: string;
315
- static deadStateName: string;
316
- static enableCompaniesSyncIntoMobileDeviceContacts: string;
317
- static enableContactsSyncIntoMobileDevice: string;
318
- static enableLeadsSyncIntoMobileDeviceContacts: string;
319
- static enableLlamaAiFeatures: string;
320
- static enableUsersSyncIntoMobileDeviceContacts: string;
321
- static emailsActiveProjectsLeadsFilter: string;
322
- static exchangeRatesAdminGroupName: string;
323
- static forcedEmailTrackingGroups: string;
324
- static ignoreEmailsFromDomainsOnEmailsTracking: string;
325
- static trackEmailsFromDomains: string;
326
- static groupsForAllUnpaidInvoicesNotification: string;
327
- static itemPreviewMaxHeight: string;
328
- static lastActivityAttributes: string;
329
- static leadsCompletedState: string;
330
- static leadDeadlineAlertGroups: string;
331
- static leadsDeadState: string;
332
- static marketingCompletedState: string;
333
- static marketingDeadState: string;
334
- static minimumPasswordLength: string;
335
- static nextStepAttributes: string;
336
- static notifyAboutInvoicedInvoiceInPohodaGroup: string;
337
- static notifyAboutLeadsDeadline: string;
338
- static notifyAboutPaidInvoiceInPohodaGroup: string;
339
- static notifyAboutProjectDeadline: string;
340
- static numberOfDecimalPlaces: string;
341
- static phoneListTaskSolverGroup: string;
342
- static projectDeadlineAlert: string;
343
- static serverUpdateProgressNotificationGroup: string;
344
- static sumarizeCartsPricesOnLeads: string;
345
- static sumarizeCartsPricesOnProjects: string;
346
- static sumarizePeopleExpensesOnProjects: string;
347
- static systemHealthNotificationGroup: string;
348
- static tasksCompletedState: string;
349
- static tasksDeferredState: string;
350
- static tasksInProgressState: string;
351
- static tasksNotStartedState: string;
352
- static tasksWaitOnSomeoneElseState: string;
353
- static trackDocumentVersions: string;
354
- static vacationCompletedState: string;
355
- static workReportApprovedState: string;
356
- static defaultLanguage: string;
357
- static defaultCurrency: string;
358
- static myCompanyCountry: string;
359
- static myCompanyName: string;
360
- static myCompanyStreet: string;
361
- static myCompanyCity: string;
362
- static myCompanyState: string;
363
- static myCompanyZip: string;
364
- static myCompanyId: string;
365
- static myCompanyVat: string;
366
- static mergeGoodsInCart: string;
367
- static cartRefreshLogic: string;
368
- static goodsDefaultQuantity: string;
369
- static goodsDefaultVAT: string;
370
- static goodsDefaultVATIncluded: string;
294
+ static readonly acceptableBackwardWorkReportDays = "AcceptableBackwardWorkReportDays";
295
+ static readonly adminAppInactiveLogoutTime = "AdminAppInactiveLogoutTime";
296
+ static readonly applyGeneralDataProtectionRules = "ApplyGeneralDataProtectionRules";
297
+ static readonly automaticallyCreateJournalAfterCallDuration = "AutomaticallyCreateJournalAfterCallDuration";
298
+ static readonly bonusesCompletedState = "BonusesCompletedState";
299
+ static readonly cartInvoicedState = "CartInvoicedState";
300
+ static readonly cartOrderCanceledState = "CartOrderCanceledState";
301
+ static readonly cartOrderInProcessState = "CartOrderInProcessState";
302
+ static readonly cartOrderProcessedState = "CartOrderProcessedState";
303
+ static readonly cartPaidState = "CartPaidState";
304
+ static readonly cartProposalInProcessState = "CartProposalInProcessState";
305
+ static readonly cartProposalProcessedState = "CartProposalProcessedState";
306
+ static readonly cartSalesVoucherIssuedState = "CartSalesVoucherIssuedState";
307
+ static readonly cartToBeInvoicedState = "CartToBeInvoicedState";
308
+ static readonly cartVoidedState = "CartVoidedState";
309
+ static readonly clickToCallScheme = "ClickToCallScheme";
310
+ static readonly companyDuplicityCheckEnabled = "CompanyDuplicityCheckEnabled";
311
+ static readonly completedStateName = "CompletedStateName";
312
+ static readonly contactDuplicityCheckEnabled = "ContactDuplicityCheckEnabled";
313
+ static readonly createCompanyWhileImportingContactFromOutlook = "CreateCompanyWhileImportingContactFromOutlook";
314
+ static readonly defaultProposalValidityPeriod = "DefaultProposalValidityPeriod";
315
+ static readonly enableContactsTwoWaySyncWithM365 = "EnableContactsTwoWaySyncWithM365";
316
+ static readonly deadStateName = "DeadStateName";
317
+ static readonly enableCompaniesSyncIntoMobileDeviceContacts = "EnableCompaniesSyncIntoMobileDeviceContacts";
318
+ static readonly enableContactsSyncIntoMobileDevice = "EnableContactsSyncIntoMobileDevice";
319
+ static readonly enableLeadsSyncIntoMobileDeviceContacts = "EnableLeadsSyncIntoMobileDeviceContacts";
320
+ static readonly enableLlamaAiFeatures = "EnableLlamaAiFeatures";
321
+ static readonly enableUsersSyncIntoMobileDeviceContacts = "EnableUsersSyncIntoMobileDeviceContacts";
322
+ static readonly emailsActiveProjectsLeadsFilter = "EmailsActiveProjectsLeadsFilter";
323
+ static readonly exchangeRatesAdminGroupName = "ExchangeRatesAdminGroupName";
324
+ static readonly forcedEmailTrackingGroups = "ForcedEmailTrackingGroups";
325
+ static readonly ignoreEmailsFromDomainsOnEmailsTracking = "IgnoreEmailsFromDomainsOnEmailsTracking";
326
+ static readonly trackEmailsFromDomains = "TrackEmailsFromDomains";
327
+ static readonly groupsForAllUnpaidInvoicesNotification = "GroupsForAllUnpaidInvoicesNotification";
328
+ static readonly itemPreviewMaxHeight = "ItemPreviewMaxHeight";
329
+ static readonly lastActivityAttributes = "LastActivityAttributes";
330
+ static readonly leadsCompletedState = "LeadsCompletedState";
331
+ static readonly leadDeadlineAlertGroups = "LeadDeadlineAlertGroups";
332
+ static readonly leadsDeadState = "LeadsDeadState";
333
+ static readonly marketingCompletedState = "MarketingCompletedState";
334
+ static readonly marketingDeadState = "MarketingDeadState";
335
+ static readonly minimumPasswordLength = "MinimumPasswordLength";
336
+ static readonly nextStepAttributes = "NextStepAttributes";
337
+ static readonly notifyAboutInvoicedInvoiceInPohodaGroup = "NotifyAboutInvoicedInvoiceInPohodaGroup";
338
+ static readonly notifyAboutLeadsDeadline = "NotifyAboutLeadsDeadline";
339
+ static readonly notifyAboutPaidInvoiceInPohodaGroup = "NotifyAboutPaidInvoiceInPohodaGroup";
340
+ static readonly notifyAboutProjectDeadline = "NotifyAboutProjectDeadline";
341
+ static readonly numberOfDecimalPlaces = "NumberOfDecimalPlaces";
342
+ static readonly phoneListTaskSolverGroup = "PhoneListTaskSolverGroup";
343
+ static readonly projectDeadlineAlert = "ProjectDeadlineAlert";
344
+ static readonly serverUpdateProgressNotificationGroup = "ServerUpdateProgressNotificationGroup";
345
+ static readonly sumarizeCartsPricesOnLeads = "SumarizeCartsPricesOnLeads";
346
+ static readonly sumarizeCartsPricesOnProjects = "SumarizeCartsPricesOnProjects";
347
+ static readonly sumarizePeopleExpensesOnProjects = "SumarizePeopleExpensesOnProjects";
348
+ static readonly systemHealthNotificationGroup = "SystemHealthNotificationGroup";
349
+ static readonly tasksCompletedState = "TasksCompletedState";
350
+ static readonly tasksDeferredState = "TasksDeferredState";
351
+ static readonly tasksInProgressState = "TasksInProgressState";
352
+ static readonly tasksNotStartedState = "TasksNotStartedState";
353
+ static readonly tasksWaitOnSomeoneElseState = "TasksWaitOnSomeoneElseState";
354
+ static readonly trackDocumentVersions = "TrackDocumentVersions";
355
+ static readonly vacationCompletedState = "VacationCompletedState";
356
+ static readonly workReportApprovedState = "WorkReportApprovedState";
357
+ static readonly defaultLanguage = "DefaultLanguage";
358
+ static readonly defaultCurrency = "DefaultCurrency";
359
+ static readonly myCompanyCountry = "MyCompanyCountry";
360
+ static readonly myCompanyName = "MyCompanyName";
361
+ static readonly myCompanyStreet = "MyCompanyStreet";
362
+ static readonly myCompanyCity = "MyCompanyCity";
363
+ static readonly myCompanyState = "MyCompanyState";
364
+ static readonly myCompanyZip = "MyCompanyZIP";
365
+ static readonly myCompanyId = "MyCompanyID";
366
+ static readonly myCompanyVat = "MyCompanyVAT";
367
+ static readonly mergeGoodsInCart = "MergeGoodsInCart";
368
+ static readonly cartRefreshLogic = "CartRefreshLogic";
369
+ static readonly goodsDefaultQuantity = "GoodsDefaultQuantity";
370
+ static readonly goodsDefaultVAT = "GoodsDefaultVAT";
371
+ static readonly goodsDefaultVATIncluded = "GoodsDefaultVATIncluded";
371
372
  }
372
373
 
373
374
  declare class FieldNames {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eway-crm/connector",
3
- "version": "1.0.207",
3
+ "version": "1.0.208",
4
4
  "description": "eWay-CRM API JavaScript connector library.",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/esm/index.js",
@@ -50,7 +50,8 @@
50
50
  "rollup-plugin-delete": "^2.0.0",
51
51
  "rollup-plugin-dts": "^5.3.0",
52
52
  "ts-jest": "^29.1.0",
53
- "typescript": ">=5.3.3 <5.4.0"
53
+ "typescript": ">=5.3.3 <5.4.0",
54
+ "tslib": "^2.8.1"
54
55
  },
55
56
  "files": [
56
57
  "lib/**/*"