@eway-crm/connector 1.0.207 → 1.0.209

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;
@@ -1,3 +1,4 @@
1
+ import type { IApiGoodInCart } from './IApiGoodInCart';
1
2
  import type { IApiItemBase } from './IApiItemBase';
2
3
  export interface IApiCart extends IApiItemBase {
3
4
  Id: number | null;
@@ -12,6 +13,7 @@ export interface IApiCart extends IApiItemBase {
12
13
  Vat: number | null;
13
14
  PriceTotalExcludingVat: number | null;
14
15
  GoodsInCartCount: number | null;
16
+ GoodsInCart: IApiGoodInCart[] | null;
15
17
  Note: string | null;
16
18
  PriceTotalDefaultCurrency: number | null;
17
19
  PriceTotalParentCurrency: number | null;
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};