@social-mail/social-mail-client 1.2.488 → 1.2.490

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.
Files changed (87) hide show
  1. package/content/local-db/worker.js +2 -2
  2. package/dist/admin/AdminAppIndex.pack.js +944 -210
  3. package/dist/admin/AdminAppIndex.pack.js.map +1 -1
  4. package/dist/admin/AdminAppIndex.pack.min.js +28 -3
  5. package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
  6. package/dist/model/model.d.ts +9 -5
  7. package/dist/model/model.d.ts.map +1 -1
  8. package/dist/model/model.js +907 -207
  9. package/dist/model/model.js.map +1 -1
  10. package/dist/public/channel/ChannelView.pack.js +907 -207
  11. package/dist/public/channel/ChannelView.pack.js.map +1 -1
  12. package/dist/public/channel/ChannelView.pack.min.js +1 -1
  13. package/dist/public/channel/ChannelView.pack.min.js.map +1 -1
  14. package/dist/public/contact-us/ContactUsApp.d.ts +1 -0
  15. package/dist/public/contact-us/ContactUsApp.d.ts.map +1 -1
  16. package/dist/public/contact-us/ContactUsApp.js +100 -14
  17. package/dist/public/contact-us/ContactUsApp.js.map +1 -1
  18. package/dist/public/contact-us/ContactUsApp.pack.js +100 -14
  19. package/dist/public/contact-us/ContactUsApp.pack.js.map +1 -1
  20. package/dist/public/contact-us/ContactUsApp.pack.min.js +82 -14
  21. package/dist/public/contact-us/ContactUsApp.pack.min.js.map +1 -1
  22. package/dist/public/store/Store.pack.js +907 -207
  23. package/dist/public/store/Store.pack.js.map +1 -1
  24. package/dist/public/store/Store.pack.min.js +1 -1
  25. package/dist/public/store/Store.pack.min.js.map +1 -1
  26. package/dist/public/store/cart/ShoppingCart.pack.js +909 -208
  27. package/dist/public/store/cart/ShoppingCart.pack.js.map +1 -1
  28. package/dist/public/store/cart/ShoppingCart.pack.min.js +1 -1
  29. package/dist/public/store/cart/ShoppingCart.pack.min.js.map +1 -1
  30. package/dist/services/LoginService.d.ts.map +1 -1
  31. package/dist/services/LoginService.js +2 -1
  32. package/dist/services/LoginService.js.map +1 -1
  33. package/dist/services/local-db/LocalDbService.d.ts +12 -5
  34. package/dist/services/local-db/LocalDbService.d.ts.map +1 -1
  35. package/dist/services/local-db/LocalDbService.js +57 -21
  36. package/dist/services/local-db/LocalDbService.js.map +1 -1
  37. package/dist/services/local-db/core/LocalTable.d.ts +19 -0
  38. package/dist/services/local-db/core/LocalTable.d.ts.map +1 -0
  39. package/dist/services/local-db/core/LocalTable.js +120 -0
  40. package/dist/services/local-db/core/LocalTable.js.map +1 -0
  41. package/dist/services/local-db/core/TemplateQuery.d.ts +27 -0
  42. package/dist/services/local-db/core/TemplateQuery.d.ts.map +1 -0
  43. package/dist/services/local-db/core/TemplateQuery.js +132 -0
  44. package/dist/services/local-db/core/TemplateQuery.js.map +1 -0
  45. package/dist/services/local-db/mailboxes/LocalMailbox.d.ts +13 -0
  46. package/dist/services/local-db/mailboxes/LocalMailbox.d.ts.map +1 -0
  47. package/dist/services/local-db/mailboxes/LocalMailbox.js +62 -0
  48. package/dist/services/local-db/mailboxes/LocalMailbox.js.map +1 -0
  49. package/dist/services/mime-service/MimeNode.js +1 -1
  50. package/dist/services/mime-service/MimeNode.js.map +1 -1
  51. package/dist/site-editor/editor/HtmlPageEditor.d.ts.map +1 -1
  52. package/dist/site-editor/editor/HtmlPageEditor.js +34 -1
  53. package/dist/site-editor/editor/HtmlPageEditor.js.map +1 -1
  54. package/dist/tests/template-query/template-queries.test.d.ts +2 -0
  55. package/dist/tests/template-query/template-queries.test.d.ts.map +1 -0
  56. package/dist/tests/template-query/template-queries.test.js +27 -0
  57. package/dist/tests/template-query/template-queries.test.js.map +1 -0
  58. package/dist/tsconfig.tsbuildinfo +1 -1
  59. package/dist/web/AppIndex.pack.js +944 -210
  60. package/dist/web/AppIndex.pack.js.map +1 -1
  61. package/dist/web/AppIndex.pack.min.js +29 -4
  62. package/dist/web/AppIndex.pack.min.js.map +1 -1
  63. package/dist/web/page/files/shares/AddSharePage.d.ts +0 -1
  64. package/dist/web/page/files/shares/AddSharePage.d.ts.map +1 -1
  65. package/node_modules/@web-atoms/entity/dist/services/BaseEntityService.d.ts +2 -0
  66. package/node_modules/@web-atoms/entity/dist/services/BaseEntityService.d.ts.map +1 -1
  67. package/node_modules/@web-atoms/entity/dist/services/BaseEntityService.js.map +1 -1
  68. package/node_modules/@web-atoms/entity/dist/tsconfig.tsbuildinfo +1 -1
  69. package/node_modules/@web-atoms/entity/package.json +1 -1
  70. package/node_modules/@web-atoms/entity/src/services/BaseEntityService.ts +2 -0
  71. package/package.json +2 -2
  72. package/pg-worker.js +15 -0
  73. package/src/model/model.ts +84 -82
  74. package/src/public/contact-us/ContactUsApp.tsx +102 -17
  75. package/src/services/LoginService.ts +5 -0
  76. package/src/services/local-db/LocalDbService.ts +68 -32
  77. package/src/services/local-db/core/LocalTable.ts +113 -0
  78. package/src/services/local-db/core/TemplateQuery.ts +135 -0
  79. package/src/services/local-db/mailboxes/LocalMailbox.ts +60 -0
  80. package/src/services/mime-service/MimeNode.ts +1 -1
  81. package/src/site-editor/editor/HtmlPageEditor.tsx +31 -1
  82. package/src/tests/template-query/template-queries.test.ts +22 -0
  83. package/dist/services/local-db/SqlDbFactory.d.ts +0 -47
  84. package/dist/services/local-db/SqlDbFactory.d.ts.map +0 -1
  85. package/dist/services/local-db/SqlDbFactory.js +0 -179
  86. package/dist/services/local-db/SqlDbFactory.js.map +0 -1
  87. package/src/services/local-db/SqlDbFactory.ts +0 -181
@@ -696,7 +696,7 @@ html, body {
696
696
  }
697
697
  }
698
698
 
699
- `.installLocal();stack=0;_export("default",BusyProgress=class BusyProgress{static create(){if(!container){container=document.createElement("div");container.className=css;const progressBar=document.createElement("div");progressBar.className="progress-bar";container.appendChild(progressBar);const progressBarValue=document.createElement("div");progressBarValue.className="progress-bar-value";progressBar.appendChild(progressBarValue);document.body.appendChild(container)}stack++;if(stack===1){container.setAttribute("data-show","true")}return{dispose(){stack--;if(stack<=0){container.removeAttribute("data-show")}}}}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/BusyProgress");System.register([],(function(_export,_context){"use strict";var _a,root,apiPath,apiPathRoot;return{setters:[],execute:function(){root=((_a=window.socialMail)===null||_a===void 0?void 0:_a.path)||"/";if(root.endsWith("/")){root=root.substring(0,root.length-1)}_export("apiPath",apiPath=root?url=>root+url:url=>url);_export("apiPathRoot",apiPathRoot=root)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/apiPath");System.register(["tslib","@web-atoms/core/dist/di/DISingleton","@web-atoms/entity/dist/services/BaseEntityService","@web-atoms/core/dist/di/Inject","@web-atoms/core/dist/App","./BusyProgress","../common/apiPath"],(function(_export,_context){"use strict";var __decorate,__metadata,DISingleton,BaseEntityService,Inject,App,BusyProgress,apiPath,EntityService;return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsCoreDistDiDISingleton){DISingleton=_webAtomsCoreDistDiDISingleton.default},function(_webAtomsEntityDistServicesBaseEntityService){BaseEntityService=_webAtomsEntityDistServicesBaseEntityService.default},function(_webAtomsCoreDistDiInject){Inject=_webAtomsCoreDistDiInject.Inject},function(_webAtomsCoreDistApp){App=_webAtomsCoreDistApp.App},function(_BusyProgress){BusyProgress=_BusyProgress.default},function(_commonApiPath){apiPath=_commonApiPath.apiPath}],execute:function(){EntityService=class EntityService extends BaseEntityService{constructor(){super(...arguments);this.queryProcessor="JavaScript";this.url=apiPath("/api/entity/")}createBusyIndicator(options){if(options.hideActivityIndicator){return}return BusyProgress.create()}};__decorate([Inject,__metadata("design:type",App)],EntityService.prototype,"app",void 0);EntityService=__decorate([DISingleton()],EntityService);_export("default",EntityService)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/EntityService");System.register(["@web-atoms/date-time/dist/DateTime","@web-atoms/entity/dist/services/BaseEntityService"],(function(_export,_context){"use strict";var DateTime,Model,DefaultFactory,modelEntitySchemas,AppRole,AppFileContentDispositionArray,AppFile,AccessToken,AppFileVersion,AppFileAccessTypeArray,AppFileAccess,AppFileTag,FileContent,Configuration,Contact,ContactEmail,ContactPhone,ContactItem,ContactDomain,ContactAddress,CachedItem,Domain,HostedDomain,DomainUser,HostedZone,HostedZoneRecordTypeArray,HostedZoneRecord,HostedZoneUser,DomainRelayTypeArray,DomainRelay,DomainKey,EmailStatusArray,Email,EmailEngagement,EmailLog,EmailRecipientTypeArray,EmailRecipient,EmailTag,EmailAddress,EmailTemplate,Mailbox,MailboxEmail,MailboxContactStatusArray,MailboxContact,MailboxFolder,MailboxContactEmail,MailboxContactTag,MailboxSyncTargetDirectionArray,MailboxSyncTargetProtocolArray,MailboxSyncTargetLastSyncStatusArray,MailboxSyncTarget,ChannelConfig,SubscriberActivity,SearchWordStatusArray,SearchWord,SearchWordIndex,ServerActivityActivityArray,ServerActivity,Store,StoreUser,StoreConfig,StoreItemItemTypeArray,StoreItem,StoreItemFolder,StoreItemFolderTag,StoreItemPrice,StoreMediaFile,StoreInsight,StoreLedger,StoreJournalJournalTypeArray,StoreJournal,StoreJournalEntry,StoreJournalLineItemItemTypeArray,StoreJournalLineItem,StoreItemTax,StoreTag,StoreItemTag,UserStatusArray,User,UserPin,UserPushSubscription,UserRole,UserMailbox,UserAuthFactorMethodArray,UserAuthFactor,WebSiteFolder,WebSiteFolderHost,WebSiteFolderVersion,WebSiteChannel,WebSiteStore,LoginSession,TextDocument,IncomingSmsSource,VerificationTokenTypeArray,VerificationToken,VerificationTokenAddress,Tag,fixRelatedSchemas;return{setters:[function(_webAtomsDateTimeDistDateTime){DateTime=_webAtomsDateTimeDistDateTime.default},function(_webAtomsEntityDistServicesBaseEntityService){Model=_webAtomsEntityDistServicesBaseEntityService.Model;DefaultFactory=_webAtomsEntityDistServicesBaseEntityService.DefaultFactory}],execute:function(){_export("modelEntitySchemas",modelEntitySchemas={});_export("AppRole",AppRole=new Model("AppRole",["roleName"],{},{name:"app_roles",keys:[{name:"roleName",type:"string"}],properties:[],relations:[{name:"roles",isCollection:true,isInverse:true,relatedName:"UserRole"}]}));modelEntitySchemas["AppRole"]=AppRole;_export("AppFileContentDispositionArray",AppFileContentDispositionArray=[{label:"attachment",value:"attachment"},{label:"inline",value:"inline"}]);_export("AppFile",AppFile=new Model("AppFile",["appFileID"],{isFolder:false,name:"",fileSize:0,contentType:"",isDeleted:false,isShared:false,dateCreated:new DefaultFactory((()=>new DateTime))},{name:"app_files",keys:[{name:"appFileID",type:"number",generated:"identity"}],properties:[{name:"path",type:"string",default:["path",'""']},{name:"isFolder",type:"boolean",default:["isFolder","false"]},{name:"name",type:"string",default:["name",'""']},{name:"fileSize",type:"number",default:["fileSize","0"]},{name:"contentType",type:"string",default:["contentType",'""']},{name:"contentDisposition",type:"string",default:["contentDisposition",'"attachment"']},{name:"contentID",type:"string",default:["contentID",'""']},{name:"fileContentID",type:"number"},{name:"creatorID",type:"number"},{name:"parentID",type:"number"},{name:"emailID",type:"number"},{name:"isDeleted",type:"boolean",default:["isDeleted","false"]},{name:"isShared",type:"boolean",default:["isShared","false"]},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"versions",type:"number",default:["versions","0"]}],relations:[{name:"fileContent",fkMap:[{fk:"fileContentID",relatedKey:"fileContentID"}],relatedName:"FileContent"},{name:"creator",fkMap:[{fk:"creatorID",relatedKey:"userID"}],relatedName:"User"},{name:"parent",fkMap:[{fk:"parentID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"children",isCollection:true,isInverse:true,relatedName:"AppFile"},{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"},{name:"fileVersions",isCollection:true,isInverse:true,relatedName:"AppFileVersion"},{name:"folderVersions",isCollection:true,isInverse:true,relatedName:"AppFileVersion"},{name:"accessList",isCollection:true,isInverse:true,relatedName:"AppFileAccess"},{name:"tags",isCollection:true,isInverse:true,relatedName:"AppFileTag"},{name:"mailboxLogos",isCollection:true,isInverse:true,relatedName:"Mailbox"},{name:"previewContacts",isCollection:true,isInverse:true,relatedName:"Contact"},{name:"templates",isCollection:true,isInverse:true,relatedName:"EmailTemplate"},{name:"websiteFolder",isCollection:false,isInverse:true,relatedName:"WebSiteFolder"},{name:"currentVersionWebSites",isCollection:true,isInverse:true,relatedName:"WebSiteFolder"},{name:"stores",isCollection:true,isInverse:true,relatedName:"Store"},{name:"storeItems",isCollection:true,isInverse:true,relatedName:"StoreItem"},{name:"storeMediaFiles",isCollection:true,isInverse:true,relatedName:"StoreMediaFile"},{name:"storeJournals",isCollection:true,isInverse:true,relatedName:"StoreJournal"},{name:"userPins",isCollection:true,isInverse:true,relatedName:"UserPin"},{name:"websiteVersions",isCollection:true,isInverse:true,relatedName:"WebSiteFolderVersion"}],queries:{storeItemFiles:"external",children:"external",templateSnapshot:"external"}}));modelEntitySchemas["AppFile"]=AppFile;_export("AccessToken",AccessToken=new Model("AccessToken",["tokenID"],{dateCreated:new DefaultFactory((()=>new DateTime)),expiryDate:new DefaultFactory((()=>new DateTime))},{name:"access_tokens",keys:[{name:"tokenID",type:"number",generated:"identity"}],properties:[{name:"userID",type:"number"},{name:"secret",type:"string",default:["secret",'""']},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"expiryDate",type:"DateTime",default:["expiryDate","new DefaultFactory(() => new DateTime())"]},{name:"lastUsed",type:"DateTime",default:["lastUsed","new DefaultFactory(() => new DateTime())"]}],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"}]}));modelEntitySchemas["AccessToken"]=AccessToken;_export("AppFileVersion",AppFileVersion=new Model("AppFileVersion",["versionID"],{name:"",dateCreated:new DefaultFactory((()=>new DateTime))},{name:"app_file_versions",keys:[{name:"versionID",type:"number",generated:"identity"}],properties:[{name:"fileID",type:"number"},{name:"userID",type:"number"},{name:"sessionID",type:"number"},{name:"fileContentID",type:"number"},{name:"name",type:"string",default:["name",'""']},{name:"folderID",type:"number"},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]}],relations:[{name:"file",fkMap:[{fk:"fileID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"session",fkMap:[{fk:"sessionID",relatedKey:"sessionID"}],relatedName:"LoginSession"},{name:"fileContent",fkMap:[{fk:"fileContentID",relatedKey:"fileContentID"}],relatedName:"FileContent"},{name:"folder",fkMap:[{fk:"folderID",relatedKey:"appFileID"}],relatedName:"AppFile"}]}));modelEntitySchemas["AppFileVersion"]=AppFileVersion;_export("AppFileAccessTypeArray",AppFileAccessTypeArray=[{label:"create",value:"create"},{label:"read",value:"read"},{label:"write",value:"write"},{label:"delegate",value:"delegate"}]);_export("AppFileAccess",AppFileAccess=new Model("AppFileAccess",["accessID","type"],{dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime))},{name:"app_file_access",keys:[{name:"accessID",type:"number",generated:"identity"},{name:"type",type:"string"}],properties:[{name:"fileID",type:"number"},{name:"userID",type:"number"},{name:"accessCode",type:"string",default:["accessCode",'""']},{name:"expires",type:"DateTime",default:["expires","new DefaultFactory(() => new DateTime())"]},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]}],relations:[{name:"file",fkMap:[{fk:"fileID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"}]}));modelEntitySchemas["AppFileAccess"]=AppFileAccess;_export("AppFileTag",AppFileTag=new Model("AppFileTag",["appFileID","tagID"],{},{name:"app_file_tags",keys:[{name:"appFileID",type:"number"},{name:"tagID",type:"number"}],properties:[],relations:[{name:"file",fkMap:[{fk:"appFileID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"tag",fkMap:[{fk:"tagID",relatedKey:"tagID"}],relatedName:"Tag"}]}));modelEntitySchemas["AppFileTag"]=AppFileTag;_export("FileContent",FileContent=new Model("FileContent",["fileContentID"],{contentHash:"",contentType:"",contentSize:0,dateCreated:new DefaultFactory((()=>new DateTime)),deleted:false},{name:"file_contents",keys:[{name:"fileContentID",type:"number",generated:"identity"}],properties:[{name:"contentHash",type:"string",default:["contentHash",'""']},{name:"cloudPath",type:"string",default:["cloudPath",'""']},{name:"contentType",type:"string",default:["contentType",'""']},{name:"contentSize",type:"number",default:["contentSize","0"]},{name:"compression",type:"string",default:["compression",'""']},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"textDocumentID",type:"number"},{name:"deleted",type:"boolean",default:["deleted","false"]}],relations:[{name:"textDocument",fkMap:[{fk:"textDocumentID",relatedKey:"textDocumentID"}],relatedName:"TextDocument"},{name:"appFiles",isCollection:true,isInverse:true,relatedName:"AppFile"},{name:"versions",isCollection:true,isInverse:true,relatedName:"AppFileVersion"}]}));modelEntitySchemas["FileContent"]=FileContent;_export("Configuration",Configuration=new Model("Configuration",["name"],{},{name:"configuration",keys:[{name:"name",type:"string"}],properties:[{name:"configValue",type:"string",default:["configValue",'""']}],relations:[]}));modelEntitySchemas["Configuration"]=Configuration;_export("Contact",Contact=new Model("Contact",["contactID"],{name:"",type:"",dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime))},{name:"contacts",keys:[{name:"contactID",type:"number",generated:"identity"}],properties:[{name:"externalID",type:"string",default:["externalID",'""']},{name:"userID",type:"number"},{name:"mailboxID",type:"number"},{name:"domainID",type:"number"},{name:"name",type:"string",default:["name",'""']},{name:"description",type:"string",default:["description",'""']},{name:"companyID",type:"string",default:["companyID",'""']},{name:"salesTaxID",type:"string",default:["salesTaxID",'""']},{name:"gstTaxID",type:"string",default:["gstTaxID",'""']},{name:"vatTaxID",type:"string",default:["vatTaxID",'""']},{name:"incomeTaxID",type:"string",default:["incomeTaxID",'""']},{name:"type",type:"string",default:["type",'""']},{name:"synchronization",type:"string",default:["synchronization",'""']},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"previewID",type:"number"},{name:"billingAddressID",type:"number"},{name:"shippingAddressID",type:"number"}],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"},{name:"hostedDomain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"HostedDomain"},{name:"preview",fkMap:[{fk:"previewID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"billingAddress",fkMap:[{fk:"billingAddressID",relatedKey:"addressID"}],relatedName:"ContactAddress"},{name:"addresses",isCollection:true,isInverse:true,relatedName:"ContactAddress"},{name:"shippingAddress",fkMap:[{fk:"shippingAddressID",relatedKey:"addressID"}],relatedName:"ContactAddress"},{name:"emails",isCollection:true,isInverse:true,relatedName:"ContactEmail"},{name:"phones",isCollection:true,isInverse:true,relatedName:"ContactPhone"},{name:"items",isCollection:true,isInverse:true,relatedName:"ContactItem"},{name:"domains",isCollection:true,isInverse:true,relatedName:"ContactDomain"},{name:"sellerStores",isCollection:true,isInverse:true,relatedName:"Store"},{name:"vendorItems",isCollection:true,isInverse:true,relatedName:"StoreItem"},{name:"ledgers",isCollection:true,isInverse:true,relatedName:"StoreLedger"},{name:"soldInvoices",isCollection:true,isInverse:true,relatedName:"StoreJournal"},{name:"boughtInvoices",isCollection:true,isInverse:true,relatedName:"StoreJournal"},{name:"soldItems",isCollection:true,isInverse:true,relatedName:"StoreJournalLineItem"}]}));modelEntitySchemas["Contact"]=Contact;_export("ContactEmail",ContactEmail=new Model("ContactEmail",["emailAddressID","contactID"],{type:"",blocked:false},{name:"contact_emails",keys:[{name:"emailAddressID",type:"number"},{name:"contactID",type:"number"}],properties:[{name:"type",type:"string",default:["type",'""']},{name:"notes",type:"string",default:["notes",'""']},{name:"blocked",type:"boolean",default:["blocked","false"]}],relations:[{name:"emailAddress",fkMap:[{fk:"emailAddressID",relatedKey:"emailAddressID"}],relatedName:"EmailAddress"},{name:"contact",fkMap:[{fk:"contactID",relatedKey:"contactID"}],relatedName:"Contact"}]}));modelEntitySchemas["ContactEmail"]=ContactEmail;_export("ContactPhone",ContactPhone=new Model("ContactPhone",["contactID","phoneNumberE64"],{type:""},{name:"contact_phones",keys:[{name:"contactID",type:"number"},{name:"phoneNumberE64",type:"string"}],properties:[{name:"type",type:"string",default:["type",'""']},{name:"notes",type:"string",default:["notes",'""']}],relations:[{name:"contact",fkMap:[{fk:"contactID",relatedKey:"contactID"}],relatedName:"Contact"}]}));modelEntitySchemas["ContactPhone"]=ContactPhone;_export("ContactItem",ContactItem=new Model("ContactItem",["itemID"],{type:"",title:"",valuesJson:""},{name:"contact_items",keys:[{name:"itemID",type:"number",generated:"identity"}],properties:[{name:"contactID",type:"number"},{name:"type",type:"string",default:["type",'""']},{name:"title",type:"string",default:["title",'""']},{name:"valuesJson",type:"string",default:["valuesJson",'""']}],relations:[{name:"contact",fkMap:[{fk:"contactID",relatedKey:"contactID"}],relatedName:"Contact"}]}));modelEntitySchemas["ContactItem"]=ContactItem;_export("ContactDomain",ContactDomain=new Model("ContactDomain",["domainID","contactID"],{blocked:false},{name:"contact_domains",keys:[{name:"domainID",type:"number"},{name:"contactID",type:"number"}],properties:[{name:"blocked",type:"boolean",default:["blocked","false"]}],relations:[{name:"domain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"Domain"},{name:"contact",fkMap:[{fk:"contactID",relatedKey:"contactID"}],relatedName:"Contact"}]}));modelEntitySchemas["ContactDomain"]=ContactDomain;_export("ContactAddress",ContactAddress=new Model("ContactAddress",["addressID"],{title:"",line1:""},{name:"contact_addresses",keys:[{name:"addressID",type:"number",generated:"identity"}],properties:[{name:"contactID",type:"number"},{name:"title",type:"string",default:["title",'""']},{name:"line1",type:"string",default:["line1",'""']},{name:"line2",type:"string",default:["line2",'""']},{name:"line3",type:"string",default:["line3",'""']},{name:"city",type:"string",default:["city",'""']},{name:"state",type:"string",default:["state",'""']},{name:"countryCode",type:"string",default:["countryCode",'""']},{name:"phoneNumber",type:"string",default:["phoneNumber",'""']},{name:"notes",type:"string",default:["notes",'""']}],relations:[{name:"contact",fkMap:[{fk:"contactID",relatedKey:"contactID"}],relatedName:"Contact"},{name:"billingContacts",isCollection:true,isInverse:true,relatedName:"Contact"},{name:"shippingContacts",isCollection:true,isInverse:true,relatedName:"Contact"}]}));modelEntitySchemas["ContactAddress"]=ContactAddress;_export("CachedItem",CachedItem=new Model("CachedItem",["itemID"],{keyHash:"",key:"",expiry:new DefaultFactory((()=>new DateTime)),ready:false,slide:false},{name:"cached_item",keys:[{name:"itemID",type:"number",generated:"identity"}],properties:[{name:"keyHash",type:"string",default:["keyHash",'""']},{name:"key",type:"string",default:["key",'""']},{name:"expiry",type:"DateTime",default:["expiry","new DefaultFactory(() => new DateTime())"]},{name:"ready",type:"boolean",default:["ready","false"]},{name:"slide",type:"boolean",default:["slide","false"]}],relations:[]}));modelEntitySchemas["CachedItem"]=CachedItem;_export("Domain",Domain=new Model("Domain",["domainID"],{name:"",received:0,failed:0},{name:"domains",keys:[{name:"domainID",type:"number",generated:"identity"}],properties:[{name:"name",type:"string",default:["name",'""']},{name:"received",type:"number",default:["received","0"]},{name:"failed",type:"number",default:["failed","0"]}],relations:[{name:"emailAddresses",isCollection:true,isInverse:true,relatedName:"EmailAddress"},{name:"mailboxes",isCollection:true,isInverse:true,relatedName:"Mailbox"},{name:"hostedDomain",isCollection:false,isInverse:true,relatedName:"HostedDomain"},{name:"contactDomains",isCollection:true,isInverse:true,relatedName:"ContactDomain"},{name:"hostedZone",isCollection:false,isInverse:true,relatedName:"HostedZone"},{name:"activities",isCollection:true,isInverse:true,relatedName:"ServerActivity"}]}));modelEntitySchemas["Domain"]=Domain;_export("HostedDomain",HostedDomain=new Model("HostedDomain",["domainID"],{enableReceive:false,enableSend:false,useRelay:false,maxSendPerSecond:0},{name:"hosted_domains",keys:[{name:"domainID",type:"number"}],properties:[{name:"enableReceive",type:"boolean",default:["enableReceive","false"]},{name:"enableSend",type:"boolean",default:["enableSend","false"]},{name:"useRelay",type:"boolean",default:["useRelay","false"]},{name:"maxSendPerSecond",type:"number",default:["maxSendPerSecond","0"]},{name:"aliasForName",type:"string"}],relations:[{name:"domain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"Domain"},{name:"aliasFor",fkMap:[{fk:"aliasForName",relatedKey:"domainID"}],relatedName:"HostedDomain"},{name:"aliases",isCollection:true,isInverse:true,relatedName:"HostedDomain"},{name:"contacts",isCollection:true,isInverse:true,relatedName:"Contact"},{name:"domainUsers",isCollection:true,isInverse:true,relatedName:"DomainUser"},{name:"relays",isCollection:true,isInverse:true,relatedName:"DomainRelay"},{name:"domainKeys",isCollection:true,isInverse:true,relatedName:"DomainKey"},{name:"templates",isCollection:true,isInverse:true,relatedName:"EmailTemplate"}]}));modelEntitySchemas["HostedDomain"]=HostedDomain;_export("DomainUser",DomainUser=new Model("DomainUser",["domainID","userID"],{isAdmin:false,allowCreateMailbox:false},{name:"domain_users",keys:[{name:"domainID",type:"number"},{name:"userID",type:"number"}],properties:[{name:"prefix",type:"string",default:["prefix",'""']},{name:"isAdmin",type:"boolean",default:["isAdmin","false"]},{name:"allowCreateMailbox",type:"boolean",default:["allowCreateMailbox","false"]}],relations:[{name:"hostedDomain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"HostedDomain"},{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"}]}));modelEntitySchemas["DomainUser"]=DomainUser;_export("HostedZone",HostedZone=new Model("HostedZone",["zoneID"],{},{name:"hosted_zones",keys:[{name:"zoneID",type:"number"}],properties:[],relations:[{name:"domain",fkMap:[{fk:"zoneID",relatedKey:"domainID"}],relatedName:"Domain"},{name:"records",isCollection:true,isInverse:true,relatedName:"HostedZoneRecord"},{name:"users",isCollection:true,isInverse:true,relatedName:"HostedZoneUser"}]}));modelEntitySchemas["HostedZone"]=HostedZone;_export("HostedZoneRecordTypeArray",HostedZoneRecordTypeArray=[{label:"A",value:"A"},{label:"AAAA",value:"AAAA"},{label:"CNAME",value:"CNAME"},{label:"MX",value:"MX"},{label:"TXT",value:"TXT"},{label:"PTR",value:"PTR"},{label:"SRV",value:"SRV"},{label:"CAA",value:"CAA"},{label:"NS",value:"NS"},{label:"SOA",value:"SOA"}]);_export("HostedZoneRecord",HostedZoneRecord=new Model("HostedZoneRecord",["recordID"],{disabled:false,readonly:false,name:"",type:"A",isAlias:false,value:"",ttl:0,dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime)),hosted:false},{name:"hosted_zone_records",keys:[{name:"recordID",type:"number",generated:"identity"}],properties:[{name:"zoneID",type:"number"},{name:"disabled",type:"boolean",default:["disabled","false"]},{name:"readonly",type:"boolean",default:["readonly","false"]},{name:"name",type:"string",default:["name",'""']},{name:"type",type:"Object",default:["type",'"A"']},{name:"isAlias",type:"boolean",default:["isAlias","false"]},{name:"value",type:"string",default:["value",'""']},{name:"ttl",type:"number",default:["ttl","0"]},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"notes",type:"string",default:["notes",'""']},{name:"expiryDate",type:"DateTime",default:["expiryDate","new DefaultFactory(() => new DateTime())"]},{name:"hosted",type:"boolean",default:["hosted","false"]},{name:"fqdn",type:"string",default:["fqdn",'""']}],relations:[{name:"zone",fkMap:[{fk:"zoneID",relatedKey:"zoneID"}],relatedName:"HostedZone"}]}));modelEntitySchemas["HostedZoneRecord"]=HostedZoneRecord;_export("HostedZoneUser",HostedZoneUser=new Model("HostedZoneUser",["zoneID","userID"],{},{name:"hosted_zone_users",keys:[{name:"zoneID",type:"number"},{name:"userID",type:"number"}],properties:[],relations:[{name:"zone",fkMap:[{fk:"zoneID",relatedKey:"zoneID"}],relatedName:"HostedZone"},{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"}]}));modelEntitySchemas["HostedZoneUser"]=HostedZoneUser;_export("DomainRelayTypeArray",DomainRelayTypeArray=[{label:"smtp",value:"smtp"},{label:"ses",value:"ses"},{label:"https",value:"https"}]);_export("DomainRelay",DomainRelay=new Model("DomainRelay",["domainRelayID"],{type:"smtp",host:"",username:"",password:"",priority:0},{name:"domain_relays",keys:[{name:"domainRelayID",type:"number",generated:"identity"}],properties:[{name:"domainID",type:"number"},{name:"type",type:"string",default:["type",'"smtp"']},{name:"host",type:"string",default:["host",'""']},{name:"username",type:"string",default:["username",'""']},{name:"password",type:"string",default:["password",'""']},{name:"priority",type:"number",default:["priority","0"]},{name:"script",type:"string",default:["script",'""']}],relations:[{name:"hostedDomain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"HostedDomain"}]}));modelEntitySchemas["DomainRelay"]=DomainRelay;_export("DomainKey",DomainKey=new Model("DomainKey",["domainKeyID"],{name:"",keyType:"",publicKey:""},{name:"domain_keys",keys:[{name:"domainKeyID",type:"number",generated:"identity"}],properties:[{name:"name",type:"string",default:["name",'""']},{name:"keyType",type:"string",default:["keyType",'""']},{name:"publicKey",type:"string",default:["publicKey",'""']},{name:"domainID",type:"number"},{name:"privateKey",type:"string",default:["privateKey",'""']}],relations:[{name:"hostedDomain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"HostedDomain"}]}));modelEntitySchemas["DomainKey"]=DomainKey;_export("EmailStatusArray",EmailStatusArray=[{label:"queued",value:"queued"},{label:"received",value:"received"},{label:"draft",value:"draft"},{label:"published",value:"published"},{label:"pending-approval",value:"pending-approval"},{label:"scheduled",value:"scheduled"},{label:"sent",value:"sent"},{label:"sent-failed",value:"sent-failed"},{label:"deleted",value:"deleted"},{label:"closed",value:"closed"}]);_export("Email",Email=new Model("Email",["emailID"],{senderName:"",received:false,hasUnsubscribe:false,dateReceived:new DefaultFactory((()=>new DateTime)),dateCreated:new DefaultFactory((()=>new DateTime)),status:"queued",forwardCount:0,replyCount:0,viewCount:0,emailSize:0,originalFileSize:0},{name:"emails",keys:[{name:"emailID",type:"number",generated:"identity"}],properties:[{name:"subject",type:"string",default:["subject",'""']},{name:"summary",type:"string",default:["summary",'""']},{name:"textBody",type:"string",default:["textBody",'""']},{name:"htmlBody",type:"string",default:["htmlBody",'""']},{name:"senderName",type:"string",default:["senderName",'""']},{name:"senderID",type:"number"},{name:"userID",type:"number"},{name:"received",type:"boolean",default:["received","false"]},{name:"headers",type:"string",default:["headers",'""']},{name:"hasUnsubscribe",type:"boolean",default:["hasUnsubscribe","false"]},{name:"headerMessageID",type:"string",default:["headerMessageID",'""']},{name:"inReplyTo",type:"string",default:["inReplyTo",'""']},{name:"externalEmailID",type:"string",default:["externalEmailID",'""']},{name:"dateReceived",type:"DateTime",default:["dateReceived","new DefaultFactory(() => new DateTime())"]},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateSent",type:"DateTime",default:["dateSent","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"status",type:"string",default:["status",'"queued"']},{name:"forwardCount",type:"number",default:["forwardCount","0"]},{name:"replyCount",type:"number",default:["replyCount","0"]},{name:"viewCount",type:"number",default:["viewCount","0"]},{name:"mimeFileID",type:"number"},{name:"sentMessageID",type:"string",default:["sentMessageID",'""']},{name:"htmlBodyID",type:"number"},{name:"emailSize",type:"number",default:["emailSize","0"]},{name:"originalFileSize",type:"number",default:["originalFileSize","0"]},{name:"workflowID",type:"string",default:["workflowID",'""']},{name:"parentID",type:"number"},{name:"threadID",type:"number"},{name:"forwardedID",type:"number"},{name:"lastReplyID",type:"number"},{name:"engagement",type:"string",default:["engagement",'""']},{name:"tags",type:"string",default:["tags",'""']}],relations:[{name:"senderEmail",fkMap:[{fk:"senderID",relatedKey:"emailAddressID"}],relatedName:"EmailAddress"},{name:"senderUser",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"mimeFile",fkMap:[{fk:"mimeFileID",relatedKey:"logID"}],relatedName:"EmailLog"},{name:"logs",isCollection:true,isInverse:true,relatedName:"EmailLog"},{name:"htmlBodyFile",fkMap:[{fk:"htmlBodyID",relatedKey:"logID"}],relatedName:"EmailLog"},{name:"parent",fkMap:[{fk:"parentID",relatedKey:"emailID"}],relatedName:"Email"},{name:"children",isCollection:true,isInverse:true,relatedName:"Email"},{name:"thread",fkMap:[{fk:"threadID",relatedKey:"emailID"}],relatedName:"Email"},{name:"threadChildren",isCollection:true,isInverse:true,relatedName:"Email"},{name:"forwarded",fkMap:[{fk:"forwardedID",relatedKey:"emailID"}],relatedName:"Email"},{name:"forwards",isCollection:true,isInverse:true,relatedName:"Email"},{name:"lastReply",fkMap:[{fk:"lastReplyID",relatedKey:"emailID"}],relatedName:"Email"},{name:"lastRepliedThreads",isCollection:true,isInverse:true,relatedName:"Email"},{name:"attachments",isCollection:true,isInverse:true,relatedName:"AppFile"},{name:"engagements",isCollection:true,isInverse:true,relatedName:"EmailEngagement"},{name:"recipients",isCollection:true,isInverse:true,relatedName:"EmailRecipient"},{name:"emailTags",isCollection:true,isInverse:true,relatedName:"EmailTag"},{name:"mailboxes",isCollection:true,isInverse:true,relatedName:"MailboxEmail"},{name:"lastEmailThreads",isCollection:true,isInverse:true,relatedName:"MailboxContact"},{name:"threadContacts",isCollection:true,isInverse:true,relatedName:"MailboxContactEmail"},{name:"subscriberActivities",isCollection:true,isInverse:true,relatedName:"SubscriberActivity"}],queries:{channelEmails:"external"}}));modelEntitySchemas["Email"]=Email;_export("EmailEngagement",EmailEngagement=new Model("EmailEngagement",["emailID","engagement"],{count:0},{name:"email_engagements",keys:[{name:"emailID",type:"number"},{name:"engagement",type:"string"}],properties:[{name:"count",type:"number",default:["count","0"]}],relations:[{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"}]}));modelEntitySchemas["EmailEngagement"]=EmailEngagement;_export("EmailLog",EmailLog=new Model("EmailLog",["logID"],{fileName:"",fileSize:0,compression:"",dateCreated:new DefaultFactory((()=>new DateTime)),cloudPath:""},{name:"email_logs",keys:[{name:"logID",type:"number",generated:"identity"}],properties:[{name:"emailID",type:"number"},{name:"fileName",type:"string",default:["fileName",'""']},{name:"fileSize",type:"number",default:["fileSize","0"]},{name:"compression",type:"string",default:["compression",'""']},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"cloudPath",type:"string",default:["cloudPath",'""']}],relations:[{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"},{name:"mimeFileEmails",isCollection:true,isInverse:true,relatedName:"Email"},{name:"htmlBodyFileEmails",isCollection:true,isInverse:true,relatedName:"Email"}]}));modelEntitySchemas["EmailLog"]=EmailLog;_export("EmailRecipientTypeArray",EmailRecipientTypeArray=[{label:"from",value:"from"},{label:"to",value:"to"},{label:"cc",value:"cc"},{label:"bcc",value:"bcc"},{label:"viewer",value:"viewer"},{label:"editor",value:"editor"}]);_export("EmailRecipient",EmailRecipient=new Model("EmailRecipient",["emailID","emailAddressID"],{type:"from"},{name:"email_recipients",keys:[{name:"emailID",type:"number"},{name:"emailAddressID",type:"number"}],properties:[{name:"type",type:"string",default:["type",'"from"']},{name:"name",type:"string",default:["name",'""']},{name:"dateSent",type:"DateTime",default:["dateSent","new DefaultFactory(() => new DateTime())"]},{name:"error",type:"string",default:["error",'""']},{name:"status",type:"string",default:["status",'""']},{name:"replyTo",type:"string",default:["replyTo",'""']}],relations:[{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"},{name:"emailAddress",fkMap:[{fk:"emailAddressID",relatedKey:"emailAddressID"}],relatedName:"EmailAddress"}]}));modelEntitySchemas["EmailRecipient"]=EmailRecipient;_export("EmailTag",EmailTag=new Model("EmailTag",["emailID","tagID"],{},{name:"email_tags",keys:[{name:"emailID",type:"number"},{name:"tagID",type:"number"}],properties:[],relations:[{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"},{name:"tag",fkMap:[{fk:"tagID",relatedKey:"tagID"}],relatedName:"Tag"}]}));modelEntitySchemas["EmailTag"]=EmailTag;_export("EmailAddress",EmailAddress=new Model("EmailAddress",["emailAddressID"],{emailAddress:"",name:"",blocked:false},{name:"email_addresses",keys:[{name:"emailAddressID",type:"number",generated:"identity"}],properties:[{name:"emailAddress",type:"string",default:["emailAddress",'""']},{name:"domainID",type:"number"},{name:"name",type:"string",default:["name",'""']},{name:"blocked",type:"boolean",default:["blocked","false"]}],relations:[{name:"domain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"Domain"},{name:"senders",isCollection:true,isInverse:true,relatedName:"Email"},{name:"mailbox",isCollection:false,isInverse:true,relatedName:"Mailbox"},{name:"contactEmails",isCollection:true,isInverse:true,relatedName:"ContactEmail"},{name:"recipients",isCollection:true,isInverse:true,relatedName:"EmailRecipient"},{name:"threads",isCollection:true,isInverse:true,relatedName:"MailboxContact"},{name:"subscriberActivities",isCollection:true,isInverse:true,relatedName:"SubscriberActivity"}]}));modelEntitySchemas["EmailAddress"]=EmailAddress;_export("EmailTemplate",EmailTemplate=new Model("EmailTemplate",["templateID"],{},{name:"email_templates",keys:[{name:"templateID",type:"number",generated:"identity"}],properties:[{name:"domainID",type:"number"},{name:"mailboxID",type:"number"},{name:"folderID",type:"number"}],relations:[{name:"hostedDomain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"HostedDomain"},{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"},{name:"folder",fkMap:[{fk:"folderID",relatedKey:"appFileID"}],relatedName:"AppFile"}]}));modelEntitySchemas["EmailTemplate"]=EmailTemplate;_export("Mailbox",Mailbox=new Model("Mailbox",["mailboxID"],{storage:0,maxStorage:0,indexAttachments:false,indexImageAttachments:false,openThreads:0,totalThreads:0,unread:0,isExternal:false,maxSendPerSecond:0,dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime)),isChannel:false,isPrivateChannel:false,requireApproval:false,subscriberCount:0},{name:"mailboxes",keys:[{name:"mailboxID",type:"number"}],properties:[{name:"domainID",type:"number"},{name:"storage",type:"number",default:["storage","0"]},{name:"maxStorage",type:"number",default:["maxStorage","0"]},{name:"indexAttachments",type:"boolean",default:["indexAttachments","false"]},{name:"indexImageAttachments",type:"boolean",default:["indexImageAttachments","false"]},{name:"firstID",type:"number",default:["firstID","0"]},{name:"recentID",type:"number",default:["recentID","0"]},{name:"openThreads",type:"number",default:["openThreads","0"]},{name:"totalThreads",type:"number",default:["totalThreads","0"]},{name:"unread",type:"number",default:["unread","0"]},{name:"logoID",type:"number"},{name:"isExternal",type:"boolean",default:["isExternal","false"]},{name:"maxSendPerSecond",type:"number",default:["maxSendPerSecond","0"]},{name:"description",type:"string",default:["description",'""']},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"isChannel",type:"boolean",default:["isChannel","false"]},{name:"isPrivateChannel",type:"boolean",default:["isPrivateChannel","false"]},{name:"requireApproval",type:"boolean",default:["requireApproval","false"]},{name:"subscriberCount",type:"number",default:["subscriberCount","0"]},{name:"datePublished",type:"DateTime",default:["datePublished","new DefaultFactory(() => new DateTime())"]},{name:"dateEngaged",type:"DateTime",default:["dateEngaged","new DefaultFactory(() => new DateTime())"]},{name:"parentID",type:"number",default:["parentID","0"]}],relations:[{name:"emailAddress",fkMap:[{fk:"mailboxID",relatedKey:"emailAddressID"}],relatedName:"EmailAddress"},{name:"domain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"Domain"},{name:"logo",fkMap:[{fk:"logoID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"contacts",isCollection:true,isInverse:true,relatedName:"Contact"},{name:"templates",isCollection:true,isInverse:true,relatedName:"EmailTemplate"},{name:"emails",isCollection:true,isInverse:true,relatedName:"MailboxEmail"},{name:"mailboxContacts",isCollection:true,isInverse:true,relatedName:"MailboxContact"},{name:"folders",isCollection:true,isInverse:true,relatedName:"MailboxFolder"},{name:"threadEmails",isCollection:true,isInverse:true,relatedName:"MailboxContactEmail"},{name:"syncTargets",isCollection:true,isInverse:true,relatedName:"MailboxSyncTarget"},{name:"channelConfig",isCollection:false,isInverse:true,relatedName:"ChannelConfig"},{name:"subscriberActivities",isCollection:true,isInverse:true,relatedName:"SubscriberActivity"},{name:"userPins",isCollection:true,isInverse:true,relatedName:"UserPin"},{name:"userMailboxes",isCollection:true,isInverse:true,relatedName:"UserMailbox"},{name:"websiteChannels",isCollection:true,isInverse:true,relatedName:"WebSiteChannel"}],queries:{channels:"external"},actions:{fetch:"external"}}));modelEntitySchemas["Mailbox"]=Mailbox;_export("MailboxEmail",MailboxEmail=new Model("MailboxEmail",["mailboxID","emailID"],{},{name:"mailbox_emails",keys:[{name:"mailboxID",type:"number"},{name:"emailID",type:"number"}],properties:[],relations:[{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"},{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"}]}));modelEntitySchemas["MailboxEmail"]=MailboxEmail;_export("MailboxContactStatusArray",MailboxContactStatusArray=[{label:"invited",value:"invited"},{label:"added",value:"added"},{label:"active",value:"active"},{label:"unsubscribed",value:"unsubscribed"},{label:"blocked",value:"blocked"}]);_export("MailboxContact",MailboxContact=new Model("MailboxContact",["mailboxID","emailAddressID"],{dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime)),unread:0,openThreads:0,totalThreads:0,autoClose:false,total:0,isOwner:false,canContribute:false,priority:0,blocked:false,newRequest:false,spam:false,mute:false,status:"invited"},{name:"mailbox_contacts",keys:[{name:"mailboxID",type:"number"},{name:"emailAddressID",type:"number"}],properties:[{name:"folderTagID",type:"number",default:["folderTagID","0"]},{name:"lastEmailID",type:"number"},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"unread",type:"number",default:["unread","0"]},{name:"openThreads",type:"number",default:["openThreads","0"]},{name:"totalThreads",type:"number",default:["totalThreads","0"]},{name:"autoClose",type:"boolean",default:["autoClose","false"]},{name:"total",type:"number",default:["total","0"]},{name:"doNotIndex",type:"boolean",default:["doNotIndex","false"]},{name:"doNotIndexAttachments",type:"boolean",default:["doNotIndexAttachments","false"]},{name:"isOwner",type:"boolean",default:["isOwner","false"]},{name:"canContribute",type:"boolean",default:["canContribute","false"]},{name:"priority",type:"number",default:["priority","0"]},{name:"blocked",type:"boolean",default:["blocked","false"]},{name:"newRequest",type:"boolean",default:["newRequest","false"]},{name:"spam",type:"boolean",default:["spam","false"]},{name:"mute",type:"boolean",default:["mute","false"]},{name:"status",type:"string",default:["status",'"invited"']}],relations:[{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"},{name:"emailAddress",fkMap:[{fk:"emailAddressID",relatedKey:"emailAddressID"}],relatedName:"EmailAddress"},{name:"lastEmail",fkMap:[{fk:"lastEmailID",relatedKey:"emailID"}],relatedName:"Email"},{name:"contactEmails",isCollection:true,isInverse:true,relatedName:"MailboxContactEmail"},{name:"tags",isCollection:true,isInverse:true,relatedName:"MailboxContactTag"}]}));modelEntitySchemas["MailboxContact"]=MailboxContact;_export("MailboxFolder",MailboxFolder=new Model("MailboxFolder",["mailboxID","tagID"],{count:0,isSystem:false},{name:"mailbox_folders",keys:[{name:"mailboxID",type:"number"},{name:"tagID",type:"number"}],properties:[{name:"count",type:"number",default:["count","0"]},{name:"isSystem",type:"boolean",default:["isSystem","false"]}],relations:[{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"},{name:"tag",fkMap:[{fk:"tagID",relatedKey:"tagID"}],relatedName:"Tag"}]}));modelEntitySchemas["MailboxFolder"]=MailboxFolder;_export("MailboxContactEmail",MailboxContactEmail=new Model("MailboxContactEmail",["mailboxID","emailAddressID","emailID"],{dateReceived:new DefaultFactory((()=>new DateTime))},{name:"mailbox_contact_emails",keys:[{name:"mailboxID",type:"number"},{name:"emailAddressID",type:"number"},{name:"emailID",type:"number"}],properties:[{name:"dateReceived",type:"DateTime",default:["dateReceived","new DefaultFactory(() => new DateTime())"]},{name:"timeRead",type:"DateTime",default:["timeRead","new DefaultFactory(() => new DateTime())"]},{name:"engagement",type:"string",default:["engagement",'""']},{name:"signedFileLogID",type:"number",default:["signedFileLogID","0"]}],relations:[{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"},{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"},{name:"mailboxContact",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"},{fk:"emailAddressID",relatedKey:"emailAddressID"}],relatedName:"MailboxContact"}]}));modelEntitySchemas["MailboxContactEmail"]=MailboxContactEmail;_export("MailboxContactTag",MailboxContactTag=new Model("MailboxContactTag",["mailboxID","emailAddressID","tagID"],{count:0,dateUpdated:new DefaultFactory((()=>new DateTime))},{name:"mailbox_contact_tags",keys:[{name:"mailboxID",type:"number"},{name:"emailAddressID",type:"number"},{name:"tagID",type:"number"}],properties:[{name:"count",type:"number",default:["count","0"]},{name:"dateUpdated",type:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]}],relations:[{name:"tag",fkMap:[{fk:"tagID",relatedKey:"tagID"}],relatedName:"Tag"},{name:"mailboxContact",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"},{fk:"emailAddressID",relatedKey:"emailAddressID"}],relatedName:"MailboxContact"}]}));modelEntitySchemas["MailboxContactTag"]=MailboxContactTag;_export("MailboxSyncTargetDirectionArray",MailboxSyncTargetDirectionArray=[{label:"in",value:"in"},{label:"out",value:"out"}]);_export("MailboxSyncTargetProtocolArray",MailboxSyncTargetProtocolArray=[{label:"imap",value:"imap"},{label:"smtp",value:"smtp"}]);_export("MailboxSyncTargetLastSyncStatusArray",MailboxSyncTargetLastSyncStatusArray=[{label:"none",value:"none"},{label:"success",value:"success"},{label:"failed",value:"failed"}]);_export("MailboxSyncTarget",MailboxSyncTarget=new Model("MailboxSyncTarget",["syncTargetID"],{direction:"in",protocol:"imap",username:"",host:"",port:0,isSecure:false,syncAllFolders:false,syncJunkMails:false,intervalSeconds:0,active:false},{name:"mailbox_sync_targets",keys:[{name:"syncTargetID",type:"number",generated:"identity"}],properties:[{name:"mailboxID",type:"number"},{name:"direction",type:"string",default:["direction",'"in"']},{name:"protocol",type:"string",default:["protocol",'"imap"']},{name:"username",type:"string",default:["username",'""']},{name:"password",type:"string",default:["password",'""']},{name:"host",type:"string",default:["host",'""']},{name:"port",type:"number",default:["port","0"]},{name:"isSecure",type:"boolean",default:["isSecure","false"]},{name:"syncAllFolders",type:"boolean",default:["syncAllFolders","false"]},{name:"syncJunkMails",type:"boolean",default:["syncJunkMails","false"]},{name:"allFolderName",type:"string",default:["allFolderName",'""']},{name:"intervalSeconds",type:"number",default:["intervalSeconds","0"]},{name:"active",type:"boolean",default:["active","false"]},{name:"lastSync",type:"DateTime",default:["lastSync","new DefaultFactory(() => new DateTime())"]},{name:"lastSyncStatus",type:"string",default:["lastSyncStatus",'"none"']},{name:"syncState",type:"string",default:["syncState",'""']},{name:"lastSyncError",type:"string",default:["lastSyncError",'""']}],relations:[{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"}]}));modelEntitySchemas["MailboxSyncTarget"]=MailboxSyncTarget;_export("ChannelConfig",ChannelConfig=new Model("ChannelConfig",["mailboxID"],{sendInviteOnEngagement:false,memberOnlyEngagement:false,notSafeForWork:false},{name:"channel_configs",keys:[{name:"mailboxID",type:"number"}],properties:[{name:"inviteContent",type:"string",default:["inviteContent",'""']},{name:"welcomeContent",type:"string",default:["welcomeContent",'""']},{name:"sendInviteOnEngagement",type:"boolean",default:["sendInviteOnEngagement","false"]},{name:"memberOnlyEngagement",type:"boolean",default:["memberOnlyEngagement","false"]},{name:"notSafeForWork",type:"boolean",default:["notSafeForWork","false"]},{name:"postFooter",type:"string",default:["postFooter",'""']}],relations:[{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"}]}));modelEntitySchemas["ChannelConfig"]=ChannelConfig;_export("SubscriberActivity",SubscriberActivity=new Model("SubscriberActivity",["activityID"],{activity:"",dateCreated:new DefaultFactory((()=>new DateTime))},{name:"subscriber_activities",keys:[{name:"activityID",type:"number",generated:"identity"}],properties:[{name:"mailboxID",type:"number"},{name:"emailID",type:"number"},{name:"emailAddressID",type:"number"},{name:"activity",type:"string",default:["activity",'""']},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"ipAddress",type:"string",default:["ipAddress",'""']},{name:"accessCode",type:"string",default:["accessCode",'""']}],relations:[{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"},{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"},{name:"subscriber",fkMap:[{fk:"emailAddressID",relatedKey:"emailAddressID"}],relatedName:"EmailAddress"}]}));modelEntitySchemas["SubscriberActivity"]=SubscriberActivity;_export("SearchWordStatusArray",SearchWordStatusArray=[{label:"begin",value:"begin"},{label:"ready",value:"ready"},{label:"deleted",value:"deleted"}]);_export("SearchWord",SearchWord=new Model("SearchWord",["wordID"],{word:"",dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime)),status:"begin"},{name:"search_words",keys:[{name:"wordID",type:"number",generated:"identity"}],properties:[{name:"word",type:"string",default:["word",'""']},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"expires",type:"DateTime",default:["expires","new DefaultFactory(() => new DateTime())"]},{name:"status",type:"string",default:["status",'"begin"']},{name:"recentID",type:"number",default:["recentID","0"]},{name:"firstID",type:"number",default:["firstID","0"]}],relations:[{name:"indexes",isCollection:true,isInverse:true,relatedName:"SearchWordIndex"}]}));modelEntitySchemas["SearchWord"]=SearchWord;_export("SearchWordIndex",SearchWordIndex=new Model("SearchWordIndex",["wordID","fileContentID"],{rank:0},{name:"search_word_index",keys:[{name:"wordID",type:"number"},{name:"fileContentID",type:"number"}],properties:[{name:"rank",type:"number",default:["rank","0"]}],relations:[{name:"word",fkMap:[{fk:"wordID",relatedKey:"wordID"}],relatedName:"SearchWord"}]}));modelEntitySchemas["SearchWordIndex"]=SearchWordIndex;_export("ServerActivityActivityArray",ServerActivityActivityArray=[{label:"visit",value:"visit"},{label:"rcpt-not-found",value:"rcpt-not-found"},{label:"mail-received",value:"mail-received"}]);_export("ServerActivity",ServerActivity=new Model("ServerActivity",["activityID"],{dateCreated:new DefaultFactory((()=>new DateTime)),ipAddress:"",activity:"visit"},{name:"server_activities",keys:[{name:"activityID",type:"number",generated:"identity"}],properties:[{name:"domainID",type:"number"},{name:"webSiteFolderID",type:"number"},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"ipAddress",type:"string",default:["ipAddress",'""']},{name:"activity",type:"string",default:["activity",'"visit"']}],relations:[{name:"domain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"Domain"},{name:"webSite",fkMap:[{fk:"webSiteFolderID",relatedKey:"folderID"}],relatedName:"WebSiteFolder"}]}));modelEntitySchemas["ServerActivity"]=ServerActivity;_export("Store",Store=new Model("Store",["storeID"],{name:"",currency:""},{name:"stores",keys:[{name:"storeID",type:"number",generated:"identity"}],properties:[{name:"name",type:"string",default:["name",'""']},{name:"currency",type:"string",default:["currency",'""']},{name:"sellerID",type:"number"},{name:"folderID",type:"number"}],relations:[{name:"seller",fkMap:[{fk:"sellerID",relatedKey:"contactID"}],relatedName:"Contact"},{name:"folder",fkMap:[{fk:"folderID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"storeUsers",isCollection:true,isInverse:true,relatedName:"StoreUser"},{name:"configs",isCollection:true,isInverse:true,relatedName:"StoreConfig"},{name:"storeItems",isCollection:true,isInverse:true,relatedName:"StoreItem"},{name:"itemFolders",isCollection:true,isInverse:true,relatedName:"StoreItemFolder"},{name:"insights",isCollection:true,isInverse:true,relatedName:"StoreInsight"},{name:"ledgers",isCollection:true,isInverse:true,relatedName:"StoreLedger"},{name:"journals",isCollection:true,isInverse:true,relatedName:"StoreJournal"},{name:"tags",isCollection:true,isInverse:true,relatedName:"StoreTag"},{name:"storeWebsites",isCollection:true,isInverse:true,relatedName:"WebSiteStore"}],queries:{storeQuery:"external"}}));modelEntitySchemas["Store"]=Store;_export("StoreUser",StoreUser=new Model("StoreUser",["storeID","userID"],{},{name:"store_users",keys:[{name:"storeID",type:"number"},{name:"userID",type:"number"}],properties:[],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"},{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"}]}));modelEntitySchemas["StoreUser"]=StoreUser;_export("StoreConfig",StoreConfig=new Model("StoreConfig",["storeID","groupName","configName"],{encrypted:false,configValue:""},{name:"store_configs",keys:[{name:"storeID",type:"number"},{name:"groupName",type:"string"},{name:"configName",type:"string"}],properties:[{name:"encrypted",type:"boolean",default:["encrypted","false"]},{name:"configValue",type:"string",default:["configValue",'""']}],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"}]}));modelEntitySchemas["StoreConfig"]=StoreConfig;_export("StoreItemItemTypeArray",StoreItemItemTypeArray=[{label:"product",value:"product"},{label:"e-product",value:"e-product"},{label:"shipping",value:"shipping"},{label:"service",value:"service"},{label:"tax",value:"tax"},{label:"fee",value:"fee"},{label:"commission",value:"commission"},{label:"variant",value:"variant"},{label:"size",value:"size"}]);_export("StoreItem",StoreItem=new Model("StoreItem",["storeItemID"],{name:"",active:false,itemType:"product",dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime)),price:0,maxPrice:0},{name:"store_items",keys:[{name:"storeItemID",type:"number",generated:"identity"}],properties:[{name:"storeID",type:"number"},{name:"itemFolderID",type:"number"},{name:"name",type:"string",default:["name",'""']},{name:"active",type:"boolean",default:["active","false"]},{name:"internalNotes",type:"string",default:["internalNotes",'""']},{name:"description",type:"string",default:["description",'""']},{name:"itemType",type:"string",default:["itemType",'"product"']},{name:"folderID",type:"number"},{name:"sizeForID",type:"number"},{name:"variantForID",type:"number"},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"vendorID",type:"number"},{name:"price",type:"number",default:["price","0"]},{name:"maxPrice",type:"number",default:["maxPrice","0"]}],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"},{name:"itemFolder",fkMap:[{fk:"itemFolderID",relatedKey:"itemFolderID"}],relatedName:"StoreItemFolder"},{name:"fileFolder",fkMap:[{fk:"folderID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"sizeFor",fkMap:[{fk:"sizeForID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"sizes",isCollection:true,isInverse:true,relatedName:"StoreItem"},{name:"variantFor",fkMap:[{fk:"variantForID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"variants",isCollection:true,isInverse:true,relatedName:"StoreItem"},{name:"vendor",fkMap:[{fk:"vendorID",relatedKey:"contactID"}],relatedName:"Contact"},{name:"storeItemPrices",isCollection:true,isInverse:true,relatedName:"StoreItemPrice"},{name:"mediaFiles",isCollection:true,isInverse:true,relatedName:"StoreMediaFile"},{name:"insights",isCollection:true,isInverse:true,relatedName:"StoreInsight"},{name:"ledgers",isCollection:true,isInverse:true,relatedName:"StoreLedger"},{name:"lineItems",isCollection:true,isInverse:true,relatedName:"StoreJournalLineItem"},{name:"taxes",isCollection:true,isInverse:true,relatedName:"StoreItemTax"},{name:"taxItems",isCollection:true,isInverse:true,relatedName:"StoreItemTax"},{name:"storeItemTags",isCollection:true,isInverse:true,relatedName:"StoreItemTag"}],queries:{storeQuery:"external"}}));modelEntitySchemas["StoreItem"]=StoreItem;_export("StoreItemFolder",StoreItemFolder=new Model("StoreItemFolder",["itemFolderID"],{name:"",path:""},{name:"store_item_folders",keys:[{name:"itemFolderID",type:"number",generated:"identity"}],properties:[{name:"storeID",type:"number"},{name:"name",type:"string",default:["name",'""']},{name:"path",type:"string",default:["path",'""']},{name:"parentID",type:"number"}],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"},{name:"parent",fkMap:[{fk:"parentID",relatedKey:"itemFolderID"}],relatedName:"StoreItemFolder"},{name:"children",isCollection:true,isInverse:true,relatedName:"StoreItemFolder"},{name:"items",isCollection:true,isInverse:true,relatedName:"StoreItem"},{name:"tags",isCollection:true,isInverse:true,relatedName:"StoreItemFolderTag"}]}));modelEntitySchemas["StoreItemFolder"]=StoreItemFolder;_export("StoreItemFolderTag",StoreItemFolderTag=new Model("StoreItemFolderTag",["itemFolderID","tagID"],{count:0},{name:"store_item_folder_tags",keys:[{name:"itemFolderID",type:"number"},{name:"tagID",type:"number"}],properties:[{name:"count",type:"number",default:["count","0"]}],relations:[{name:"itemFolder",fkMap:[{fk:"itemFolderID",relatedKey:"itemFolderID"}],relatedName:"StoreItemFolder"},{name:"tag",fkMap:[{fk:"tagID",relatedKey:"tagID"}],relatedName:"Tag"}]}));modelEntitySchemas["StoreItemFolderTag"]=StoreItemFolderTag;_export("StoreItemPrice",StoreItemPrice=new Model("StoreItemPrice",["priceID"],{startDate:new DefaultFactory((()=>new DateTime)),currency:"",amount:0,taxIncluded:false,taxAmount:0,active:false},{name:"store_item_prices",keys:[{name:"priceID",type:"number",generated:"identity"}],properties:[{name:"storeItemID",type:"number"},{name:"startDate",type:"DateTime",default:["startDate","new DefaultFactory(() => new DateTime())"]},{name:"endDate",type:"DateTime",default:["endDate","new DefaultFactory(() => new DateTime())"]},{name:"currency",type:"string",default:["currency",'""']},{name:"amount",type:"number",default:["amount","0"]},{name:"maxAmount",type:"number",default:["maxAmount","0"]},{name:"taxIncluded",type:"boolean",default:["taxIncluded","false"]},{name:"taxAmount",type:"number",default:["taxAmount","0"]},{name:"active",type:"boolean",default:["active","false"]}],relations:[{name:"storeItem",fkMap:[{fk:"storeItemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"lineItems",isCollection:true,isInverse:true,relatedName:"StoreJournalLineItem"}],queries:{storeQuery:"external"}}));modelEntitySchemas["StoreItemPrice"]=StoreItemPrice;_export("StoreMediaFile",StoreMediaFile=new Model("StoreMediaFile",["storeItemID","appFileID"],{sortOrder:0,title:"",isPreview:false,isDeleted:false},{name:"store_media_files",keys:[{name:"storeItemID",type:"number"},{name:"appFileID",type:"number"}],properties:[{name:"fileContentID",type:"number",default:["fileContentID","0"]},{name:"sortOrder",type:"number",default:["sortOrder","0"]},{name:"title",type:"string",default:["title",'""']},{name:"description",type:"string",default:["description",'""']},{name:"isPreview",type:"boolean",default:["isPreview","false"]},{name:"isDeleted",type:"boolean",default:["isDeleted","false"]},{name:"fileHtmlView",type:"string",default:["fileHtmlView",'""']},{name:"fileLink",type:"string",default:["fileLink",'""']}],relations:[{name:"storeItem",fkMap:[{fk:"storeItemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"appFile",fkMap:[{fk:"appFileID",relatedKey:"appFileID"}],relatedName:"AppFile"}],queries:{storeQuery:"external"}}));modelEntitySchemas["StoreMediaFile"]=StoreMediaFile;_export("StoreInsight",StoreInsight=new Model("StoreInsight",["insightID"],{name:"",value:0,isPublic:false},{name:"store_insights",keys:[{name:"insightID",type:"number",generated:"identity"}],properties:[{name:"storeID",type:"number"},{name:"storeItemID",type:"number"},{name:"name",type:"string",default:["name",'""']},{name:"value",type:"number",default:["value","0"]},{name:"isPublic",type:"boolean",default:["isPublic","false"]}],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"},{name:"storeItem",fkMap:[{fk:"storeItemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"}]}));modelEntitySchemas["StoreInsight"]=StoreInsight;_export("StoreLedger",StoreLedger=new Model("StoreLedger",["ledgerID"],{ledgerType:"",name:"",balance:0},{name:"store_ledger",keys:[{name:"ledgerID",type:"number",generated:"identity"}],properties:[{name:"path",type:"string",default:["path",'""']},{name:"storeID",type:"number"},{name:"parentID",type:"number"},{name:"contactID",type:"number"},{name:"itemID",type:"number"},{name:"head",type:"string",default:["head",'""']},{name:"ledgerType",type:"string",default:["ledgerType",'""']},{name:"name",type:"string",default:["name",'""']},{name:"description",type:"string",default:["description",'""']},{name:"balance",type:"number",default:["balance","0"]}],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"},{name:"parent",fkMap:[{fk:"parentID",relatedKey:"ledgerID"}],relatedName:"StoreLedger"},{name:"children",isCollection:true,isInverse:true,relatedName:"StoreLedger"},{name:"contact",fkMap:[{fk:"contactID",relatedKey:"contactID"}],relatedName:"Contact"},{name:"item",fkMap:[{fk:"itemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"entries",isCollection:true,isInverse:true,relatedName:"StoreJournalEntry"}]}));modelEntitySchemas["StoreLedger"]=StoreLedger;_export("StoreJournalJournalTypeArray",StoreJournalJournalTypeArray=[{label:"order",value:"order"},{label:"purchase-order",value:"purchase-order"},{label:"sales-invoice",value:"sales-invoice"},{label:"journal",value:"journal"},{label:"purchase-bill",value:"purchase-bill"},{label:"payment",value:"payment"}]);_export("StoreJournal",StoreJournal=new Model("StoreJournal",["journalID"],{dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime)),journalType:"order",posted:false,status:"",total:0,balance:0,taxExempt:false},{name:"store_journals",keys:[{name:"journalID",type:"number",generated:"identity"}],properties:[{name:"storeID",type:"number"},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"journalType",type:"string",default:["journalType",'"order"']},{name:"description",type:"string",default:["description",'""']},{name:"posted",type:"boolean",default:["posted","false"]},{name:"status",type:"string",default:["status",'""']},{name:"sellerID",type:"number"},{name:"buyerID",type:"number"},{name:"total",type:"number",default:["total","0"]},{name:"balance",type:"number",default:["balance","0"]},{name:"referenceID",type:"number"},{name:"folderID",type:"number"},{name:"taxExempt",type:"boolean",default:["taxExempt","false"]},{name:"taxExemptNotes",type:"string",default:["taxExemptNotes",'""']},{name:"taxExemptTaxID",type:"string",default:["taxExemptTaxID",'""']}],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"},{name:"seller",fkMap:[{fk:"sellerID",relatedKey:"contactID"}],relatedName:"Contact"},{name:"buyer",fkMap:[{fk:"buyerID",relatedKey:"contactID"}],relatedName:"Contact"},{name:"reference",fkMap:[{fk:"referenceID",relatedKey:"journalID"}],relatedName:"StoreJournal"},{name:"references",isCollection:true,isInverse:true,relatedName:"StoreJournal"},{name:"folder",fkMap:[{fk:"folderID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"entries",isCollection:true,isInverse:true,relatedName:"StoreJournalEntry"},{name:"lineItems",isCollection:true,isInverse:true,relatedName:"StoreJournalLineItem"}]}));modelEntitySchemas["StoreJournal"]=StoreJournal;_export("StoreJournalEntry",StoreJournalEntry=new Model("StoreJournalEntry",["entryID"],{credit:0,debit:0},{name:"store_journal_entries",keys:[{name:"entryID",type:"number",generated:"identity"}],properties:[{name:"journalID",type:"number"},{name:"ledgerID",type:"number"},{name:"credit",type:"number",default:["credit","0"]},{name:"debit",type:"number",default:["debit","0"]},{name:"balance",type:"number",default:["balance","0"]},{name:"description",type:"string",default:["description",'""']},{name:"lineItemID",type:"number"}],relations:[{name:"journal",fkMap:[{fk:"journalID",relatedKey:"journalID"}],relatedName:"StoreJournal"},{name:"ledger",fkMap:[{fk:"ledgerID",relatedKey:"ledgerID"}],relatedName:"StoreLedger"},{name:"lineItem",fkMap:[{fk:"lineItemID",relatedKey:"lineItemID"}],relatedName:"StoreJournalLineItem"}]}));modelEntitySchemas["StoreJournalEntry"]=StoreJournalEntry;_export("StoreJournalLineItemItemTypeArray",StoreJournalLineItemItemTypeArray=[{label:"product",value:"product"},{label:"e-product",value:"e-product"},{label:"shipping",value:"shipping"},{label:"service",value:"service"},{label:"tax",value:"tax"},{label:"fee",value:"fee"},{label:"commission",value:"commission"},{label:"variant",value:"variant"},{label:"size",value:"size"}]);_export("StoreJournalLineItem",StoreJournalLineItem=new Model("StoreJournalLineItem",["lineItemID"],{amount:0,total:0,quantity:0,inclusive:false,hide:false},{name:"store_journal_line_items",keys:[{name:"lineItemID",type:"number",generated:"identity"}],properties:[{name:"journalID",type:"number"},{name:"itemID",type:"number"},{name:"itemPriceID",type:"number"},{name:"amount",type:"number",default:["amount","0"]},{name:"total",type:"number",default:["total","0"]},{name:"quantity",type:"number",default:["quantity","0"]},{name:"inclusive",type:"boolean",default:["inclusive","false"]},{name:"itemType",type:"string",default:["itemType",'"product"']},{name:"hide",type:"boolean",default:["hide","false"]},{name:"vendorID",type:"number"},{name:"sourceID",type:"number"}],relations:[{name:"journal",fkMap:[{fk:"journalID",relatedKey:"journalID"}],relatedName:"StoreJournal"},{name:"item",fkMap:[{fk:"itemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"itemPrice",fkMap:[{fk:"itemPriceID",relatedKey:"priceID"}],relatedName:"StoreItemPrice"},{name:"vendor",fkMap:[{fk:"vendorID",relatedKey:"contactID"}],relatedName:"Contact"},{name:"source",fkMap:[{fk:"sourceID",relatedKey:"lineItemID"}],relatedName:"StoreJournalLineItem"},{name:"relatedItems",isCollection:true,isInverse:true,relatedName:"StoreJournalLineItem"},{name:"entries",isCollection:true,isInverse:true,relatedName:"StoreJournalEntry"}]}));modelEntitySchemas["StoreJournalLineItem"]=StoreJournalLineItem;_export("StoreItemTax",StoreItemTax=new Model("StoreItemTax",["storeItemID","taxItemID"],{inclusive:false,print:false},{name:"store_item_taxes",keys:[{name:"storeItemID",type:"number"},{name:"taxItemID",type:"number"}],properties:[{name:"inclusive",type:"boolean",default:["inclusive","false"]},{name:"print",type:"boolean",default:["print","false"]}],relations:[{name:"storeItem",fkMap:[{fk:"storeItemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"taxItem",fkMap:[{fk:"taxItemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"}]}));modelEntitySchemas["StoreItemTax"]=StoreItemTax;_export("StoreTag",StoreTag=new Model("StoreTag",["storeID","tagID"],{count:0},{name:"store_tags",keys:[{name:"storeID",type:"number"},{name:"tagID",type:"number"}],properties:[{name:"count",type:"number",default:["count","0"]}],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"},{name:"tag",fkMap:[{fk:"tagID",relatedKey:"tagID"}],relatedName:"Tag"}],queries:{storeQuery:"external"}}));modelEntitySchemas["StoreTag"]=StoreTag;_export("StoreItemTag",StoreItemTag=new Model("StoreItemTag",["storeItemID","tagID"],{sortOrder:0},{name:"store_item_tags",keys:[{name:"storeItemID",type:"number"},{name:"tagID",type:"number"}],properties:[{name:"sortOrder",type:"number",default:["sortOrder","0"]},{name:"tagValue",type:"string",default:["tagValue",'""']}],relations:[{name:"storeItem",fkMap:[{fk:"storeItemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"tag",fkMap:[{fk:"tagID",relatedKey:"tagID"}],relatedName:"Tag"}]}));modelEntitySchemas["StoreItemTag"]=StoreItemTag;_export("UserStatusArray",UserStatusArray=[{label:"active",value:"active"},{label:"blocked",value:"blocked"},{label:"locked",value:"locked"},{label:"change-password",value:"change-password"},{label:"external",value:"external"}]);_export("User",User=new Model("User",["userID"],{userName:"",displayName:"",status:"active",isExternal:false,multiFactor:false,dateUpdated:new DefaultFactory((()=>new DateTime)),storage:0,maxStorage:0,maxWebSites:0,maxExternalInboxes:0,maxChildUsers:0},{name:"users",keys:[{name:"userID",type:"number",generated:"identity"}],properties:[{name:"userName",type:"string",default:["userName",'""']},{name:"displayName",type:"string",default:["displayName",'""']},{name:"passwordHash",type:"string",default:["passwordHash",'""']},{name:"passwordSalt",type:"string",default:["passwordSalt",'""']},{name:"status",type:"string",default:["status",'"active"']},{name:"isExternal",type:"boolean",default:["isExternal","false"]},{name:"multiFactor",type:"boolean",default:["multiFactor","false"]},{name:"dateUpdated",type:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"storage",type:"number",default:["storage","0"]},{name:"maxStorage",type:"number",default:["maxStorage","0"]},{name:"maxWebSites",type:"number",default:["maxWebSites","0"]},{name:"maxExternalInboxes",type:"number",default:["maxExternalInboxes","0"]},{name:"maxChildUsers",type:"number",default:["maxChildUsers","0"]},{name:"parentID",type:"number"}],relations:[{name:"parent",fkMap:[{fk:"parentID",relatedKey:"userID"}],relatedName:"User"},{name:"children",isCollection:true,isInverse:true,relatedName:"User"},{name:"createdFiles",isCollection:true,isInverse:true,relatedName:"AppFile"},{name:"sentEmails",isCollection:true,isInverse:true,relatedName:"Email"},{name:"accessTokens",isCollection:true,isInverse:true,relatedName:"AccessToken"},{name:"versions",isCollection:true,isInverse:true,relatedName:"AppFileVersion"},{name:"sessions",isCollection:true,isInverse:true,relatedName:"LoginSession"},{name:"fileAccessList",isCollection:true,isInverse:true,relatedName:"AppFileAccess"},{name:"contacts",isCollection:true,isInverse:true,relatedName:"Contact"},{name:"domainUsers",isCollection:true,isInverse:true,relatedName:"DomainUser"},{name:"hostedZones",isCollection:true,isInverse:true,relatedName:"HostedZoneUser"},{name:"stores",isCollection:true,isInverse:true,relatedName:"StoreUser"},{name:"pins",isCollection:true,isInverse:true,relatedName:"UserPin"},{name:"userPushSubscriptions",isCollection:true,isInverse:true,relatedName:"UserPushSubscription"},{name:"roles",isCollection:true,isInverse:true,relatedName:"UserRole"},{name:"userMailboxes",isCollection:true,isInverse:true,relatedName:"UserMailbox"},{name:"authFactors",isCollection:true,isInverse:true,relatedName:"UserAuthFactor"},{name:"publishedWebSiteVersions",isCollection:true,isInverse:true,relatedName:"WebSiteFolderVersion"}]}));modelEntitySchemas["User"]=User;_export("UserPin",UserPin=new Model("UserPin",["pinID"],{},{name:"user_pins",keys:[{name:"pinID",type:"number",generated:"identity"}],properties:[{name:"userID",type:"number"},{name:"appFileID",type:"number"},{name:"mailboxID",type:"number"}],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"file",fkMap:[{fk:"appFileID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"}]}));modelEntitySchemas["UserPin"]=UserPin;_export("UserPushSubscription",UserPushSubscription=new Model("UserPushSubscription",["subscriptionID"],{notify:false},{name:"user_push_subscriptions",keys:[{name:"subscriptionID",type:"number",generated:"identity"}],properties:[{name:"userID",type:"number"},{name:"mailboxID",type:"number",default:["mailboxID","0"]},{name:"emailAddressID",type:"number",default:["emailAddressID","0"]},{name:"notify",type:"boolean",default:["notify","false"]}],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"}]}));modelEntitySchemas["UserPushSubscription"]=UserPushSubscription;_export("UserRole",UserRole=new Model("UserRole",["userID","roleName"],{},{name:"user_roles",keys:[{name:"userID",type:"number"},{name:"roleName",type:"string"}],properties:[],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"role",fkMap:[{fk:"roleName",relatedKey:"roleName"}],relatedName:"AppRole"}]}));modelEntitySchemas["UserRole"]=UserRole;_export("UserMailbox",UserMailbox=new Model("UserMailbox",["userID","mailboxID"],{},{name:"user_mailboxes",keys:[{name:"userID",type:"number"},{name:"mailboxID",type:"number"}],properties:[],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"}]}));modelEntitySchemas["UserMailbox"]=UserMailbox;_export("UserAuthFactorMethodArray",UserAuthFactorMethodArray=[{label:"totp",value:"totp"},{label:"hotp",value:"hotp"},{label:"fido2",value:"fido2"},{label:"one-time",value:"one-time"},{label:"otp",value:"otp"},{label:"otp-in",value:"otp-in"}]);_export("UserAuthFactor",UserAuthFactor=new Model("UserAuthFactor",["authFactorID"],{method:"totp",verified:false,dateUpdated:new DefaultFactory((()=>new DateTime))},{name:"user_auth_factor",keys:[{name:"authFactorID",type:"number",generated:"identity"}],properties:[{name:"userID",type:"number"},{name:"method",type:"string",default:["method",'"totp"']},{name:"secret",type:"string",default:["secret",'""']},{name:"hint",type:"string",default:["hint",'""']},{name:"phoneNumber",type:"string",default:["phoneNumber",'""']},{name:"isdCode",type:"string",default:["isdCode",'""']},{name:"verificationID",type:"number"},{name:"verified",type:"boolean",default:["verified","false"]},{name:"dateUpdated",type:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]}],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"verificationToken",fkMap:[{fk:"verificationID",relatedKey:"verificationID"}],relatedName:"VerificationToken"}]}));modelEntitySchemas["UserAuthFactor"]=UserAuthFactor;_export("WebSiteFolder",WebSiteFolder=new Model("WebSiteFolder",["folderID"],{isStatic:false,isTemplate:false,isModified:false,snapshotStorage:0},{name:"web_site_folders",keys:[{name:"folderID",type:"number"}],properties:[{name:"currentVersionID",type:"number"},{name:"isStatic",type:"boolean",default:["isStatic","false"]},{name:"isTemplate",type:"boolean",default:["isTemplate","false"]},{name:"isModified",type:"boolean",default:["isModified","false"]},{name:"snapshotStorage",type:"number",default:["snapshotStorage","0"]},{name:"supportEmail",type:"string",default:["supportEmail",'""']},{name:"fromEmail",type:"string",default:["fromEmail",'""']}],relations:[{name:"folder",fkMap:[{fk:"folderID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"currentVersion",fkMap:[{fk:"currentVersionID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"activities",isCollection:true,isInverse:true,relatedName:"ServerActivity"},{name:"hosts",isCollection:true,isInverse:true,relatedName:"WebSiteFolderHost"},{name:"versions",isCollection:true,isInverse:true,relatedName:"WebSiteFolderVersion"},{name:"channels",isCollection:true,isInverse:true,relatedName:"WebSiteChannel"},{name:"websiteStores",isCollection:true,isInverse:true,relatedName:"WebSiteStore"}],queries:{templates:"external"}}));modelEntitySchemas["WebSiteFolder"]=WebSiteFolder;_export("WebSiteFolderHost",WebSiteFolderHost=new Model("WebSiteFolderHost",["host"],{},{name:"web_site_folder_host",keys:[{name:"host",type:"string"}],properties:[{name:"folderID",type:"number"}],relations:[{name:"folder",fkMap:[{fk:"folderID",relatedKey:"folderID"}],relatedName:"WebSiteFolder"}]}));modelEntitySchemas["WebSiteFolderHost"]=WebSiteFolderHost;_export("WebSiteFolderVersion",WebSiteFolderVersion=new Model("WebSiteFolderVersion",["folderID","snapshotFolderID"],{dateCreated:new DefaultFactory((()=>new DateTime)),name:""},{name:"web_site_folder_version",keys:[{name:"folderID",type:"number"},{name:"snapshotFolderID",type:"number"}],properties:[{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"name",type:"string",default:["name",'""']},{name:"description",type:"string",default:["description",'""']},{name:"authorID",type:"number"}],relations:[{name:"websiteFolder",fkMap:[{fk:"folderID",relatedKey:"folderID"}],relatedName:"WebSiteFolder"},{name:"snapshotFolder",fkMap:[{fk:"snapshotFolderID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"author",fkMap:[{fk:"authorID",relatedKey:"userID"}],relatedName:"User"}]}));modelEntitySchemas["WebSiteFolderVersion"]=WebSiteFolderVersion;_export("WebSiteChannel",WebSiteChannel=new Model("WebSiteChannel",["folderID","channelID"],{},{name:"web_site_channels",keys:[{name:"folderID",type:"number"},{name:"channelID",type:"number"}],properties:[],relations:[{name:"website",fkMap:[{fk:"folderID",relatedKey:"folderID"}],relatedName:"WebSiteFolder"},{name:"channel",fkMap:[{fk:"channelID",relatedKey:"mailboxID"}],relatedName:"Mailbox"}]}));modelEntitySchemas["WebSiteChannel"]=WebSiteChannel;_export("WebSiteStore",WebSiteStore=new Model("WebSiteStore",["folderID","storeID"],{},{name:"web_site_stores",keys:[{name:"folderID",type:"number"},{name:"storeID",type:"number"}],properties:[],relations:[{name:"website",fkMap:[{fk:"folderID",relatedKey:"folderID"}],relatedName:"WebSiteFolder"},{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"}]}));modelEntitySchemas["WebSiteStore"]=WebSiteStore;_export("LoginSession",LoginSession=new Model("LoginSession",["sessionID"],{invalid:false,dateUpdated:new DefaultFactory((()=>new DateTime))},{name:"login_sessions",keys:[{name:"sessionID",type:"number",generated:"identity"}],properties:[{name:"userID",type:"number"},{name:"start",type:"DateTime",default:["start","new DefaultFactory(() => new Date())"]},{name:"expiry",type:"DateTime",default:["expiry","new DefaultFactory(() => new Date())"]},{name:"invalid",type:"boolean",default:["invalid","false"]},{name:"dateUpdated",type:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"status",type:"string",default:["status",'""']},{name:"deviceToken",type:"string",default:["deviceToken",'""']},{name:"deviceTokenType",type:"string",default:["deviceTokenType",'""']},{name:"verificationID",type:"number"}],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"verificationToken",fkMap:[{fk:"verificationID",relatedKey:"verificationID"}],relatedName:"VerificationToken"},{name:"versions",isCollection:true,isInverse:true,relatedName:"AppFileVersion"}],queries:{currentUser:"external"}}));modelEntitySchemas["LoginSession"]=LoginSession;_export("TextDocument",TextDocument=new Model("TextDocument",["textDocumentID"],{searchable:""},{name:"text_documents",keys:[{name:"textDocumentID",type:"number"}],properties:[{name:"searchable",type:"string",default:["searchable",'""']}],relations:[{name:"fileContent",isCollection:false,isInverse:true,relatedName:"FileContent"}]}));modelEntitySchemas["TextDocument"]=TextDocument;_export("IncomingSmsSource",IncomingSmsSource=new Model("IncomingSmsSource",["textInSourceID"],{name:"",isdPrefix:"",phoneNumber:"",dateUpdated:new DefaultFactory((()=>new DateTime)),countryCode:""},{name:"incoming_sms_source",keys:[{name:"textInSourceID",type:"number",generated:"identity"}],properties:[{name:"name",type:"string",default:["name",'""']},{name:"username",type:"string",default:["username",'""']},{name:"encryptedPassword",type:"string",default:["encryptedPassword",'""']},{name:"isdPrefix",type:"string",default:["isdPrefix",'""']},{name:"keyword",type:"string",default:["keyword",'""']},{name:"phoneNumber",type:"string",default:["phoneNumber",'""']},{name:"dateUpdated",type:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"countryCode",type:"string",default:["countryCode",'""']}],relations:[]}));modelEntitySchemas["IncomingSmsSource"]=IncomingSmsSource;_export("VerificationTokenTypeArray",VerificationTokenTypeArray=[{label:"email",value:"email"},{label:"sms",value:"sms"},{label:"captcha",value:"captcha"},{label:"totp",value:"totp"}]);_export("VerificationToken",VerificationToken=new Model("VerificationToken",["verificationID"],{dateCreated:new DefaultFactory((()=>new DateTime)),expiry:new DefaultFactory((()=>new DateTime)),verified:false,accessCode:"",type:"email"},{name:"verification_tokens",keys:[{name:"verificationID",type:"number",generated:"identity"}],properties:[{name:"externalID",type:"string",default:["externalID",'""']},{name:"dateCreated",type:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"expiry",type:"DateTime",default:["expiry","new DefaultFactory(() => new DateTime())"]},{name:"verified",type:"boolean",default:["verified","false"]},{name:"code",type:"string",default:["code",'""']},{name:"accessCode",type:"string",default:["accessCode",'""']},{name:"ipAddress",type:"string",default:["ipAddress",'""']},{name:"externalConfig",type:"string",default:["externalConfig",'""']},{name:"type",type:"string",default:["type",'"email"']}],relations:[{name:"loginSessions",isCollection:true,isInverse:true,relatedName:"LoginSession"},{name:"authFactors",isCollection:true,isInverse:true,relatedName:"UserAuthFactor"},{name:"addresses",isCollection:true,isInverse:true,relatedName:"VerificationTokenAddress"}],queries:{get:"external"},actions:{resendCode:"external",verifyCode:"external"}}));modelEntitySchemas["VerificationToken"]=VerificationToken;_export("VerificationTokenAddress",VerificationTokenAddress=new Model("VerificationTokenAddress",["verificationID","address"],{},{name:"verification_token_addresses",keys:[{name:"verificationID",type:"number"},{name:"address",type:"string"}],properties:[],relations:[{name:"verificationToken",fkMap:[{fk:"verificationID",relatedKey:"verificationID"}],relatedName:"VerificationToken"}]}));modelEntitySchemas["VerificationTokenAddress"]=VerificationTokenAddress;_export("Tag",Tag=new Model("Tag",["tagID"],{name:"",label:"",isSystemTag:false},{name:"tags",keys:[{name:"tagID",type:"number",generated:"identity"}],properties:[{name:"name",type:"string",default:["name",'""']},{name:"label",type:"string",default:["label",'""']},{name:"lowerCaseName",type:"string",generated:"computed"},{name:"path",type:"string",default:["path",'""']},{name:"isSystemTag",type:"boolean",default:["isSystemTag","false"]},{name:"contentTypes",type:"string",default:["contentTypes",'""']},{name:"parentID",type:"number"}],relations:[{name:"parent",fkMap:[{fk:"parentID",relatedKey:"tagID"}],relatedName:"Tag"},{name:"children",isCollection:true,isInverse:true,relatedName:"Tag"},{name:"fileTags",isCollection:true,isInverse:true,relatedName:"AppFileTag"},{name:"emailTags",isCollection:true,isInverse:true,relatedName:"EmailTag"},{name:"mailboxFolders",isCollection:true,isInverse:true,relatedName:"MailboxFolder"},{name:"mailboxContactTags",isCollection:true,isInverse:true,relatedName:"MailboxContactTag"},{name:"storeItemFolderTags",isCollection:true,isInverse:true,relatedName:"StoreItemFolderTag"},{name:"storeTags",isCollection:true,isInverse:true,relatedName:"StoreTag"},{name:"storeItemTags",isCollection:true,isInverse:true,relatedName:"StoreItemTag"}]}));modelEntitySchemas["Tag"]=Tag;fixRelatedSchemas=schema=>{for(const key in schema){if(Object.prototype.hasOwnProperty.call(schema,key)){const element=schema[key];if(!element.name){continue}const{relations}=element.schema;if(!relations){continue}for(const iterator of relations){iterator.relatedModel=schema[iterator.relatedName]}}}};fixRelatedSchemas(modelEntitySchemas)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/model/model");System.register([],(function(_export,_context){"use strict";var SocialMailApp,_a,socialMail;_export("default",void 0);return{setters:[],execute:function(){socialMail=(_a=window.socialMail)!==null&&_a!==void 0?_a:{path:"/",name:"Social Mail"};_export("default",SocialMailApp=class SocialMailApp{});SocialMailApp.config=socialMail}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/SocialMailApp");System.register(["tslib","@web-atoms/core/dist/di/DISingleton","@web-atoms/core/dist/di/Inject","./EntityService","../model/model","../common/SocialMailApp","@web-atoms/core/dist/App","@web-atoms/core/dist/core/sleep","@web-atoms/date-time/dist/DateTime"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,DISingleton,Inject,EntityService,LoginSession,SocialMailApp,App,sleep,DateTime,LoginService;return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsCoreDistDiDISingleton){DISingleton=_webAtomsCoreDistDiDISingleton.default},function(_webAtomsCoreDistDiInject){Inject=_webAtomsCoreDistDiInject.Inject},function(_EntityService){EntityService=_EntityService.default},function(_modelModel){LoginSession=_modelModel.LoginSession},function(_commonSocialMailApp){SocialMailApp=_commonSocialMailApp.default},function(_webAtomsCoreDistApp){App=_webAtomsCoreDistApp.App},function(_webAtomsCoreDistCoreSleep){sleep=_webAtomsCoreDistCoreSleep.default},function(_webAtomsDateTimeDistDateTime){DateTime=_webAtomsDateTimeDistDateTime.default}],execute:function(){LoginService=class LoginService{getUser(){var _a,_b;return __awaiter(this,void 0,void 0,(function*(){(_a=this.user)!==null&&_a!==void 0?_a:this.user=(_b=yield this.entityService.query(LoginSession,"currentUser").firstOrDefault())===null||_b===void 0?void 0:_b.user;SocialMailApp.user=this.user;return this.user}))}login(session,cancelToken){return __awaiter(this,void 0,void 0,(function*(){const result=yield this.entityService.save(session);if(session.invalid){if(session.verificationToken){this.checkSession(session,cancelToken).catch(console.error)}return session.status}location.reload()}))}checkSession(session,cancelToken){return __awaiter(this,void 0,void 0,(function*(){do{yield sleep(5e3);session.dateUpdated=DateTime.now;yield this.entityService.save(session);if(!session.invalid){location.reload()}}while(!(cancelToken===null||cancelToken===void 0?void 0:cancelToken.cancelled))}))}updateRegistration(s){return __awaiter(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}logout(){return __awaiter(this,void 0,void 0,(function*(){const session=yield this.entityService.query(LoginSession,"currentUser").firstOrDefault();session.invalid=true;const cloner=this.entityService.cloner(session);yield this.entityService.save(cloner.copy);yield sleep(1e3);location.reload()}))}enforceLogin(){return __awaiter(this,void 0,void 0,(function*(){const user=yield this.getUser();if(user===null||user===void 0?void 0:user.userID){return}}))}};__decorate([Inject,__metadata("design:type",EntityService)],LoginService.prototype,"entityService",void 0);__decorate([Inject,__metadata("design:type",App)],LoginService.prototype,"app",void 0);LoginService=__decorate([DISingleton()],LoginService);_export("default",LoginService)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/LoginService");System.register([],(function(_export,_context){"use strict";function InjectProperty(target,key){Object.defineProperty(target,key,{get:function(){const plist=Reflect.getMetadata("design:type",target,key);const result=this.app.resolve(plist);Object.defineProperty(this,key,{get:()=>result});return result},configurable:true})}_export("default",InjectProperty);return{setters:[],execute:function(){}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/InjectProperty");System.register(["@web-atoms/web-controls/dist/mobile-app/MobileApp"],(function(_export,_context){"use strict";var ContentPage,AdminHome;_export("default",void 0);return{setters:[function(_webAtomsWebControlsDistMobileAppMobileApp){ContentPage=_webAtomsWebControlsDistMobileAppMobileApp.ContentPage}],execute:function(){_export("default",AdminHome=class AdminHome extends ContentPage{})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/admin/pages/home/AdminHome");System.register([],(function(_export,_context){"use strict";var ColorItem,Colors;function toFixedString(t){return("0"+t.toString(16)).slice(-2)}_export({ColorItem:void 0,default:void 0});return{setters:[],execute:function(){_export("ColorItem",ColorItem=class ColorItem{constructor(colorCodeOrRed,namedColorOrGreen,blue,alpha){if(typeof colorCodeOrRed==="string"){this.colorCode=colorCodeOrRed;if(typeof namedColorOrGreen==="string"){this.namedColor=namedColorOrGreen}const r=ColorItem.parseRgb(this.colorCode);this.red=r.red;this.green=r.green;this.blue=r.blue;this.alpha=r.alpha}else{this.red=colorCodeOrRed;if(typeof namedColorOrGreen==="number"){this.green=namedColorOrGreen}this.blue=blue;this.alpha=alpha;this.colorCode=ColorItem.rgb(this.red,this.green,this.blue,this.alpha)}}toString(){return this.colorCode}withAlphaPercent(a){return new ColorItem(this.red,this.green,this.blue,a)}static parseRgb(rgba){if(/^\#/.test(rgba)){rgba=rgba.substr(1);if(rgba.length===3){rgba=rgba.split("").map((x=>x+x)).join("")}const red=Number.parseInt(rgba[0]+rgba[1],16);const green=Number.parseInt(rgba[2]+rgba[3],16);const blue=Number.parseInt(rgba[4]+rgba[5],16);if(rgba.length>6){const alpha=Number.parseInt(rgba[6]+rgba[7],16);return{red,green,blue,alpha}}return{red,green,blue}}if(/^rgba/i.test(rgba)){rgba=rgba.substr(5);rgba=rgba.substr(0,rgba.length-1);const a=rgba.split(",").map(((x,i)=>i===3?Number.parseFloat(x):Number.parseInt(x,10)));return{red:a[0],green:a[1],blue:a[2],alpha:a[3]}}if(/^rgb/i.test(rgba)){rgba=rgba.substr(4);rgba=rgba.substr(0,rgba.length-1);const a=rgba.split(",").map((x=>Number.parseInt(x,10)));return{red:a[0],green:a[1],blue:a[2]}}throw new Error("Unknown color format "+rgba)}static rgb(r,g,b,a){if(a!==undefined){return`rgba(${r},${g},${b},${a})`}return"#"+toFixedString(r)+toFixedString(g)+toFixedString(b)}});_export("default",Colors=class Colors{static rgba(red,green,blue,alpha){return new ColorItem(red,green,blue,alpha)}static parse(color){if(!color){return null}color=color.toLowerCase();for(const key in Colors){if(Colors.hasOwnProperty(key)){const element=Colors[key];if(element instanceof ColorItem){const ci=element;if(ci.namedColor===color){return ci}}}}if(/^(\#|rgb\(|rgba\()/i.test(color)){return new ColorItem(color)}throw new Error("Invalid color format "+color)}});Colors.black=new ColorItem("#000000","black");Colors.silver=new ColorItem("#c0c0c0","silver");Colors.gray=new ColorItem("#808080","gray");Colors.white=new ColorItem("#ffffff","white");Colors.maroon=new ColorItem("#800000","maroon");Colors.red=new ColorItem("#ff0000","red");Colors.purple=new ColorItem("#800080","purple");Colors.fuchsia=new ColorItem("#ff00ff","fuchsia");Colors.green=new ColorItem("#008000","green");Colors.lime=new ColorItem("#00ff00","lime");Colors.olive=new ColorItem("#808000","olive");Colors.yellow=new ColorItem("#ffff00","yellow");Colors.navy=new ColorItem("#000080","navy");Colors.blue=new ColorItem("#0000ff","blue");Colors.teal=new ColorItem("#008080","teal");Colors.aqua=new ColorItem("#00ffff","aqua");Colors.orange=new ColorItem("#ffa500","orange");Colors.aliceBlue=new ColorItem("#f0f8ff","aliceblue");Colors.antiqueWhite=new ColorItem("#faebd7","antiquewhite");Colors.aquaMarine=new ColorItem("#7fffd4","aquamarine");Colors.azure=new ColorItem("#f0ffff","azure");Colors.beige=new ColorItem("#f5f5dc","beige");Colors.bisque=new ColorItem("#ffe4c4","bisque");Colors.blanchedAlmond=new ColorItem("#ffebcd","blanchedalmond");Colors.blueViolet=new ColorItem("#8a2be2","blueviolet");Colors.brown=new ColorItem("#a52a2a","brown");Colors.burlyWood=new ColorItem("#deb887","burlywood");Colors.cadetBlue=new ColorItem("#5f9ea0","cadetblue");Colors.chartReuse=new ColorItem("#7fff00","chartreuse");Colors.chocolate=new ColorItem("#d2691e","chocolate");Colors.coral=new ColorItem("#ff7f50","coral");Colors.cornFlowerBlue=new ColorItem("#6495ed","cornflowerblue");Colors.cornSilk=new ColorItem("#fff8dc","cornsilk");Colors.crimson=new ColorItem("#dc143c","crimson");Colors.cyan=new ColorItem("#00ffff","cyan");Colors.darkBlue=new ColorItem("#00008b","darkblue");Colors.darkCyan=new ColorItem("#008b8b","darkcyan");Colors.darkGoldenRod=new ColorItem("#b8860b","darkgoldenrod");Colors.darkGray=new ColorItem("#a9a9a9","darkgray");Colors.darkGreen=new ColorItem("#006400","darkgreen");Colors.darkGrey=new ColorItem("#a9a9a9","darkgrey");Colors.darkKhaki=new ColorItem("#bdb76b","darkkhaki");Colors.darkMagenta=new ColorItem("#8b008b","darkmagenta");Colors.darkOliveGreen=new ColorItem("#556b2f","darkolivegreen");Colors.darkOrange=new ColorItem("#ff8c00","darkorange");Colors.darkOrchid=new ColorItem("#9932cc","darkorchid");Colors.darkRed=new ColorItem("#8b0000","darkred");Colors.darkSalmon=new ColorItem("#e9967a","darksalmon");Colors.darkSeaGreen=new ColorItem("#8fbc8f","darkseagreen");Colors.darkSlateBlue=new ColorItem("#483d8b","darkslateblue");Colors.darkSlateGray=new ColorItem("#2f4f4f","darkslategray");Colors.darkSlateGrey=new ColorItem("#2f4f4f","darkslategrey");Colors.darkTurquoise=new ColorItem("#00ced1","darkturquoise");Colors.darkViolet=new ColorItem("#9400d3","darkviolet");Colors.deepPink=new ColorItem("#ff1493","deeppink");Colors.deepSkyBlue=new ColorItem("#00bfff","deepskyblue");Colors.dimGray=new ColorItem("#696969","dimgray");Colors.dimGrey=new ColorItem("#696969","dimgrey");Colors.dodgerBlue=new ColorItem("#1e90ff","dodgerblue");Colors.fireBrick=new ColorItem("#b22222","firebrick");Colors.floralWhite=new ColorItem("#fffaf0","floralwhite");Colors.forestGreen=new ColorItem("#228b22","forestgreen");Colors.gainsboro=new ColorItem("#dcdcdc","gainsboro");Colors.ghostWhite=new ColorItem("#f8f8ff","ghostwhite");Colors.gold=new ColorItem("#ffd700","gold");Colors.goldenRod=new ColorItem("#daa520","goldenrod");Colors.greenYellow=new ColorItem("#adff2f","greenyellow");Colors.grey=new ColorItem("#808080","grey");Colors.honeyDew=new ColorItem("#f0fff0","honeydew");Colors.hotPink=new ColorItem("#ff69b4","hotpink");Colors.indianRed=new ColorItem("#cd5c5c","indianred");Colors.indigo=new ColorItem("#4b0082","indigo");Colors.ivory=new ColorItem("#fffff0","ivory");Colors.khaki=new ColorItem("#f0e68c","khaki");Colors.lavender=new ColorItem("#e6e6fa","lavender");Colors.lavenderBlush=new ColorItem("#fff0f5","lavenderblush");Colors.lawnGreen=new ColorItem("#7cfc00","lawngreen");Colors.lemonChiffon=new ColorItem("#fffacd","lemonchiffon");Colors.lightBlue=new ColorItem("#add8e6","lightblue");Colors.lightCoral=new ColorItem("#f08080","lightcoral");Colors.lightCyan=new ColorItem("#e0ffff","lightcyan");Colors.lightGoldenRodYellow=new ColorItem("#fafad2","lightgoldenrodyellow");Colors.lightGray=new ColorItem("#d3d3d3","lightgray");Colors.lightGreen=new ColorItem("#90ee90","lightgreen");Colors.lightGrey=new ColorItem("#d3d3d3","lightgrey");Colors.lightPink=new ColorItem("#ffb6c1","lightpink");Colors.lightSalmon=new ColorItem("#ffa07a","lightsalmon");Colors.lightSeaGreen=new ColorItem("#20b2aa","lightseagreen");Colors.lightSkyBlue=new ColorItem("#87cefa","lightskyblue");Colors.lightSlateGray=new ColorItem("#778899","lightslategray");Colors.lightSlateGrey=new ColorItem("#778899","lightslategrey");Colors.lightSteelBlue=new ColorItem("#b0c4de","lightsteelblue");Colors.lightYellow=new ColorItem("#ffffe0","lightyellow");Colors.limeGreen=new ColorItem("#32cd32","limegreen");Colors.linen=new ColorItem("#faf0e6","linen");Colors.magenta=new ColorItem("#ff00ff","magenta");Colors.mediumAquaMarine=new ColorItem("#66cdaa","mediumaquamarine");Colors.mediumBlue=new ColorItem("#0000cd","mediumblue");Colors.mediumOrchid=new ColorItem("#ba55d3","mediumorchid");Colors.mediumPurple=new ColorItem("#9370db","mediumpurple");Colors.mediumSeaGreen=new ColorItem("#3cb371","mediumseagreen");Colors.mediumSlateBlue=new ColorItem("#7b68ee","mediumslateblue");Colors.mediumSpringGreen=new ColorItem("#00fa9a","mediumspringgreen");Colors.mediumTurquoise=new ColorItem("#48d1cc","mediumturquoise");Colors.mediumVioletred=new ColorItem("#c71585","mediumvioletred");Colors.midNightBlue=new ColorItem("#191970","midnightblue");Colors.mintCream=new ColorItem("#f5fffa","mintcream");Colors.mistyRose=new ColorItem("#ffe4e1","mistyrose");Colors.moccasin=new ColorItem("#ffe4b5","moccasin");Colors.navajoWhite=new ColorItem("#ffdead","navajowhite");Colors.oldLace=new ColorItem("#fdf5e6","oldlace");Colors.oliveDrab=new ColorItem("#6b8e23","olivedrab");Colors.orangeRed=new ColorItem("#ff4500","orangered");Colors.orchid=new ColorItem("#da70d6","orchid");Colors.paleGoldenRod=new ColorItem("#eee8aa","palegoldenrod");Colors.paleGreen=new ColorItem("#98fb98","palegreen");Colors.paleTurquoise=new ColorItem("#afeeee","paleturquoise");Colors.paleVioletRed=new ColorItem("#db7093","palevioletred");Colors.papayaWhip=new ColorItem("#ffefd5","papayawhip");Colors.peachPuff=new ColorItem("#ffdab9","peachpuff");Colors.peru=new ColorItem("#cd853f","peru");Colors.pink=new ColorItem("#ffc0cb","pink");Colors.plum=new ColorItem("#dda0dd","plum");Colors.powderBlue=new ColorItem("#b0e0e6","powderblue");Colors.rosyBrown=new ColorItem("#bc8f8f","rosybrown");Colors.royalBlue=new ColorItem("#4169e1","royalblue");Colors.saddleBrown=new ColorItem("#8b4513","saddlebrown");Colors.salmon=new ColorItem("#fa8072","salmon");Colors.sandyBrown=new ColorItem("#f4a460","sandybrown");Colors.seaGreen=new ColorItem("#2e8b57","seagreen");Colors.seaShell=new ColorItem("#fff5ee","seashell");Colors.sienna=new ColorItem("#a0522d","sienna");Colors.skyBlue=new ColorItem("#87ceeb","skyblue");Colors.slateBlue=new ColorItem("#6a5acd","slateblue");Colors.slateGray=new ColorItem("#708090","slategray");Colors.slateGrey=new ColorItem("#708090","slategrey");Colors.snow=new ColorItem("#fffafa","snow");Colors.springGreen=new ColorItem("#00ff7f","springgreen");Colors.steelBlue=new ColorItem("#4682b4","steelblue");Colors.tan=new ColorItem("#d2b48c","tan");Colors.thistle=new ColorItem("#d8bfd8","thistle");Colors.tomato=new ColorItem("#ff6347","tomato");Colors.turquoise=new ColorItem("#40e0d0","turquoise");Colors.violet=new ColorItem("#ee82ee","violet");Colors.wheat=new ColorItem("#f5deb3","wheat");Colors.whiteSmoke=new ColorItem("#f5f5f5","whitesmoke");Colors.yellowGreen=new ColorItem("#9acd32","yellowgreen");Colors.rebeccaPurple=new ColorItem("#663399","rebeccapurple");Colors.transparent=new ColorItem("#00000000","transparent")}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/Colors");System.register(["./AtomBinder","./AtomWatcher"],(function(_export,_context){"use strict";var AtomBinder,AtomWatcher;function WatchProperty(target,key,descriptor){const{get}=descriptor;const isSetup=Symbol.for(`isSetup${key}`);return{get:function(){const watcher=new AtomWatcher(this,get,(()=>{AtomBinder.refreshValue(this,key)}),this);watcher.init(false);this.registerDisposable(watcher);this[isSetup]=watcher;Object.defineProperty(this,key,descriptor);return get.apply(this)},configurable:true}}_export("default",WatchProperty);return{setters:[function(_AtomBinder){AtomBinder=_AtomBinder.AtomBinder},function(_AtomWatcher){AtomWatcher=_AtomWatcher.AtomWatcher}],execute:function(){}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/WatchProperty");System.register(["@web-atoms/core/dist/style/styled"],(function(_export,_context){"use strict";var styled;return{setters:[function(_webAtomsCoreDistStyleStyled){styled=_webAtomsCoreDistStyleStyled.default}],execute:function(){styled.css`
699
+ `.installLocal();stack=0;_export("default",BusyProgress=class BusyProgress{static create(){if(!container){container=document.createElement("div");container.className=css;const progressBar=document.createElement("div");progressBar.className="progress-bar";container.appendChild(progressBar);const progressBarValue=document.createElement("div");progressBarValue.className="progress-bar-value";progressBar.appendChild(progressBarValue);document.body.appendChild(container)}stack++;if(stack===1){container.setAttribute("data-show","true")}return{dispose(){stack--;if(stack<=0){container.removeAttribute("data-show")}}}}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/BusyProgress");System.register([],(function(_export,_context){"use strict";var _a,root,apiPath,apiPathRoot;return{setters:[],execute:function(){root=((_a=window.socialMail)===null||_a===void 0?void 0:_a.path)||"/";if(root.endsWith("/")){root=root.substring(0,root.length-1)}_export("apiPath",apiPath=root?url=>root+url:url=>url);_export("apiPathRoot",apiPathRoot=root)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/apiPath");System.register(["tslib","@web-atoms/core/dist/di/DISingleton","@web-atoms/entity/dist/services/BaseEntityService","@web-atoms/core/dist/di/Inject","@web-atoms/core/dist/App","./BusyProgress","../common/apiPath"],(function(_export,_context){"use strict";var __decorate,__metadata,DISingleton,BaseEntityService,Inject,App,BusyProgress,apiPath,EntityService;return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsCoreDistDiDISingleton){DISingleton=_webAtomsCoreDistDiDISingleton.default},function(_webAtomsEntityDistServicesBaseEntityService){BaseEntityService=_webAtomsEntityDistServicesBaseEntityService.default},function(_webAtomsCoreDistDiInject){Inject=_webAtomsCoreDistDiInject.Inject},function(_webAtomsCoreDistApp){App=_webAtomsCoreDistApp.App},function(_BusyProgress){BusyProgress=_BusyProgress.default},function(_commonApiPath){apiPath=_commonApiPath.apiPath}],execute:function(){EntityService=class EntityService extends BaseEntityService{constructor(){super(...arguments);this.queryProcessor="JavaScript";this.url=apiPath("/api/entity/")}createBusyIndicator(options){if(options.hideActivityIndicator){return}return BusyProgress.create()}};__decorate([Inject,__metadata("design:type",App)],EntityService.prototype,"app",void 0);EntityService=__decorate([DISingleton()],EntityService);_export("default",EntityService)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/EntityService");System.register(["@web-atoms/date-time/dist/DateTime","@web-atoms/entity/dist/services/BaseEntityService"],(function(_export,_context){"use strict";var DateTime,Model,DefaultFactory,modelEntitySchemas,AppRole,AppFileContentDispositionArray,AppFile,AccessToken,AppFileVersion,AppFileAccessTypeArray,AppFileAccess,AppFileTag,FileContent,Configuration,Contact,ContactEmail,ContactPhone,ContactItem,ContactDomain,ContactAddress,CachedItem,Domain,HostedDomain,DomainUser,HostedZone,HostedZoneRecordTypeArray,HostedZoneRecord,HostedZoneUser,DomainRelayTypeArray,DomainRelay,DomainKey,EmailStatusArray,Email,EmailEngagement,EmailLog,EmailRecipientTypeArray,EmailRecipient,EmailTag,EmailAddress,EmailTemplate,Mailbox,MailboxEmail,MailboxContactStatusArray,MailboxContact,MailboxFolder,MailboxContactEmail,MailboxContactTag,MailboxSyncTargetDirectionArray,MailboxSyncTargetProtocolArray,MailboxSyncTargetLastSyncStatusArray,MailboxSyncTarget,ChannelConfig,SubscriberActivity,SearchWordStatusArray,SearchWord,SearchWordIndex,ServerActivityActivityArray,ServerActivity,Store,StoreUser,StoreConfig,StoreItemItemTypeArray,StoreItem,StoreItemFolder,StoreItemFolderTag,StoreItemPrice,StoreMediaFile,StoreInsight,StoreLedger,StoreJournalJournalTypeArray,StoreJournal,StoreJournalEntry,StoreJournalLineItemItemTypeArray,StoreJournalLineItem,StoreItemTax,StoreTag,StoreItemTag,UserStatusArray,User,UserPin,UserPushSubscription,UserRole,UserMailbox,UserAuthFactorMethodArray,UserAuthFactor,WebSiteFolder,WebSiteFolderHost,WebSiteFolderVersion,WebSiteChannel,WebSiteStore,LoginSession,TextDocument,IncomingSmsSource,VerificationTokenTypeArray,VerificationToken,VerificationTokenAddress,Tag,fixRelatedSchemas;return{setters:[function(_webAtomsDateTimeDistDateTime){DateTime=_webAtomsDateTimeDistDateTime.default},function(_webAtomsEntityDistServicesBaseEntityService){Model=_webAtomsEntityDistServicesBaseEntityService.Model;DefaultFactory=_webAtomsEntityDistServicesBaseEntityService.DefaultFactory}],execute:function(){_export("modelEntitySchemas",modelEntitySchemas={});_export("AppRole",AppRole=new Model("AppRole",["roleName"],{},{name:"app_roles",keys:[{name:"roleName",type:"string",dataType:"Char",length:100}],properties:[],relations:[{name:"roles",isCollection:true,isInverse:true,relatedName:"UserRole"}]}));modelEntitySchemas["AppRole"]=AppRole;_export("AppFileContentDispositionArray",AppFileContentDispositionArray=[{label:"attachment",value:"attachment"},{label:"inline",value:"inline"}]);_export("AppFile",AppFile=new Model("AppFile",["appFileID"],{isFolder:false,name:"",fileSize:0,contentType:"",isDeleted:false,isShared:false,dateCreated:new DefaultFactory((()=>new DateTime))},{name:"app_files",keys:[{name:"appFileID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"path",type:"string",dataType:"AsciiChar",length:400,default:["path",'""']},{name:"isFolder",type:"boolean",dataType:"Boolean",default:["isFolder","false"]},{name:"name",type:"string",dataType:"Char",length:400,default:["name",'""']},{name:"fileSize",type:"number",dataType:"BigInt",default:["fileSize","0"]},{name:"contentType",type:"string",dataType:"Char",length:200,default:["contentType",'""']},{name:"contentDisposition",type:"string",dataType:"AsciiChar",length:10,default:["contentDisposition",'"attachment"']},{name:"contentID",type:"string",dataType:"Char",default:["contentID",'""']},{name:"fileContentID",type:"number",dataType:"BigInt"},{name:"creatorID",type:"number",dataType:"BigInt"},{name:"parentID",type:"number",dataType:"BigInt"},{name:"emailID",type:"number",dataType:"BigInt"},{name:"isDeleted",type:"boolean",dataType:"Boolean",default:["isDeleted","false"]},{name:"isShared",type:"boolean",dataType:"Boolean",default:["isShared","false"]},{name:"dateCreated",type:"DateTime",dataType:"DateTimeOffset",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",dataType:"DateTimeOffset",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"versions",type:"number",dataType:"Int",default:["versions","0"]}],relations:[{name:"fileContent",fkMap:[{fk:"fileContentID",relatedKey:"fileContentID"}],relatedName:"FileContent"},{name:"creator",fkMap:[{fk:"creatorID",relatedKey:"userID"}],relatedName:"User"},{name:"parent",fkMap:[{fk:"parentID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"children",isCollection:true,isInverse:true,relatedName:"AppFile"},{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"},{name:"fileVersions",isCollection:true,isInverse:true,relatedName:"AppFileVersion"},{name:"folderVersions",isCollection:true,isInverse:true,relatedName:"AppFileVersion"},{name:"accessList",isCollection:true,isInverse:true,relatedName:"AppFileAccess"},{name:"tags",isCollection:true,isInverse:true,relatedName:"AppFileTag"},{name:"mailboxLogos",isCollection:true,isInverse:true,relatedName:"Mailbox"},{name:"previewContacts",isCollection:true,isInverse:true,relatedName:"Contact"},{name:"templates",isCollection:true,isInverse:true,relatedName:"EmailTemplate"},{name:"websiteFolder",isCollection:false,isInverse:true,relatedName:"WebSiteFolder"},{name:"currentVersionWebSites",isCollection:true,isInverse:true,relatedName:"WebSiteFolder"},{name:"stores",isCollection:true,isInverse:true,relatedName:"Store"},{name:"storeItems",isCollection:true,isInverse:true,relatedName:"StoreItem"},{name:"storeMediaFiles",isCollection:true,isInverse:true,relatedName:"StoreMediaFile"},{name:"storeJournals",isCollection:true,isInverse:true,relatedName:"StoreJournal"},{name:"userPins",isCollection:true,isInverse:true,relatedName:"UserPin"},{name:"websiteVersions",isCollection:true,isInverse:true,relatedName:"WebSiteFolderVersion"}],queries:{storeItemFiles:"external",children:"external",templateSnapshot:"external"}}));modelEntitySchemas["AppFile"]=AppFile;_export("AccessToken",AccessToken=new Model("AccessToken",["tokenID"],{dateCreated:new DefaultFactory((()=>new DateTime)),expiryDate:new DefaultFactory((()=>new DateTime))},{name:"access_tokens",keys:[{name:"tokenID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"userID",type:"number",dataType:"BigInt"},{name:"secret",type:"string",dataType:"Char",length:400,default:["secret",'""']},{name:"dateCreated",type:"DateTime",dataType:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"expiryDate",type:"DateTime",dataType:"DateTime",default:["expiryDate","new DefaultFactory(() => new DateTime())"]},{name:"lastUsed",type:"DateTime",dataType:"DateTime",default:["lastUsed","new DefaultFactory(() => new DateTime())"]}],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"}]}));modelEntitySchemas["AccessToken"]=AccessToken;_export("AppFileVersion",AppFileVersion=new Model("AppFileVersion",["versionID"],{name:"",dateCreated:new DefaultFactory((()=>new DateTime))},{name:"app_file_versions",keys:[{name:"versionID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"fileID",type:"number",dataType:"BigInt"},{name:"userID",type:"number",dataType:"BigInt"},{name:"sessionID",type:"number",dataType:"BigInt"},{name:"fileContentID",type:"number",dataType:"BigInt"},{name:"name",type:"string",dataType:"Char",length:400,default:["name",'""']},{name:"folderID",type:"number",dataType:"BigInt"},{name:"dateCreated",type:"DateTime",dataType:"DateTimeOffset",default:["dateCreated","new DefaultFactory(() => new DateTime())"]}],relations:[{name:"file",fkMap:[{fk:"fileID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"session",fkMap:[{fk:"sessionID",relatedKey:"sessionID"}],relatedName:"LoginSession"},{name:"fileContent",fkMap:[{fk:"fileContentID",relatedKey:"fileContentID"}],relatedName:"FileContent"},{name:"folder",fkMap:[{fk:"folderID",relatedKey:"appFileID"}],relatedName:"AppFile"}]}));modelEntitySchemas["AppFileVersion"]=AppFileVersion;_export("AppFileAccessTypeArray",AppFileAccessTypeArray=[{label:"create",value:"create"},{label:"read",value:"read"},{label:"write",value:"write"},{label:"delegate",value:"delegate"}]);_export("AppFileAccess",AppFileAccess=new Model("AppFileAccess",["fileID","userID","type"],{dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime))},{name:"app_file_access",keys:[{name:"fileID",type:"number",dataType:"BigInt"},{name:"userID",type:"number",dataType:"BigInt"},{name:"type",type:"string",dataType:"Char",length:10}],properties:[{name:"accessCode",type:"string",dataType:"Char",length:200,default:["accessCode",'""']},{name:"expires",type:"DateTime",dataType:"DateTimeOffset",default:["expires","new DefaultFactory(() => new DateTime())"]},{name:"dateCreated",type:"DateTime",dataType:"DateTimeOffset",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",dataType:"DateTimeOffset",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]}],relations:[{name:"file",fkMap:[{fk:"fileID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"}]}));modelEntitySchemas["AppFileAccess"]=AppFileAccess;_export("AppFileTag",AppFileTag=new Model("AppFileTag",["appFileID","tagID"],{},{name:"app_file_tags",keys:[{name:"appFileID",type:"number",dataType:"BigInt"},{name:"tagID",type:"number",dataType:"BigInt"}],properties:[],relations:[{name:"file",fkMap:[{fk:"appFileID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"tag",fkMap:[{fk:"tagID",relatedKey:"tagID"}],relatedName:"Tag"}]}));modelEntitySchemas["AppFileTag"]=AppFileTag;_export("FileContent",FileContent=new Model("FileContent",["fileContentID"],{contentHash:"",contentType:"",contentSize:0,dateCreated:new DefaultFactory((()=>new DateTime)),deleted:false},{name:"file_contents",keys:[{name:"fileContentID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"contentHash",type:"string",dataType:"AsciiChar",length:200,default:["contentHash",'""']},{name:"cloudPath",type:"string",dataType:"Char",length:450,default:["cloudPath",'""']},{name:"contentType",type:"string",dataType:"Char",length:200,default:["contentType",'""']},{name:"contentSize",type:"number",dataType:"BigInt",default:["contentSize","0"]},{name:"compression",type:"string",dataType:"Char",length:10,default:["compression",'""']},{name:"dateCreated",type:"DateTime",dataType:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"textDocumentID",type:"number",dataType:"BigInt"},{name:"deleted",type:"boolean",dataType:"Boolean",default:["deleted","false"]}],relations:[{name:"textDocument",fkMap:[{fk:"textDocumentID",relatedKey:"textDocumentID"}],relatedName:"TextDocument"},{name:"appFiles",isCollection:true,isInverse:true,relatedName:"AppFile"},{name:"versions",isCollection:true,isInverse:true,relatedName:"AppFileVersion"}]}));modelEntitySchemas["FileContent"]=FileContent;_export("Configuration",Configuration=new Model("Configuration",["name"],{},{name:"configuration",keys:[{name:"name",type:"string",dataType:"Char",length:200}],properties:[{name:"configValue",type:"string",dataType:"Char",default:["configValue",'""']}],relations:[]}));modelEntitySchemas["Configuration"]=Configuration;_export("Contact",Contact=new Model("Contact",["contactID"],{name:"",type:"",dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime))},{name:"contacts",keys:[{name:"contactID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"externalID",type:"string",dataType:"Char",length:400,default:["externalID",'""']},{name:"userID",type:"number",dataType:"BigInt"},{name:"mailboxID",type:"number",dataType:"BigInt"},{name:"domainID",type:"number",dataType:"BigInt"},{name:"name",type:"string",dataType:"Char",length:200,default:["name",'""']},{name:"description",type:"string",dataType:"Char",length:200,default:["description",'""']},{name:"companyID",type:"string",dataType:"Char",length:200,default:["companyID",'""']},{name:"salesTaxID",type:"string",dataType:"Char",length:200,default:["salesTaxID",'""']},{name:"gstTaxID",type:"string",dataType:"Char",length:200,default:["gstTaxID",'""']},{name:"vatTaxID",type:"string",dataType:"Char",length:200,default:["vatTaxID",'""']},{name:"incomeTaxID",type:"string",dataType:"Char",length:200,default:["incomeTaxID",'""']},{name:"type",type:"string",dataType:"Char",length:50,default:["type",'""']},{name:"synchronization",type:"string",dataType:"Char",default:["synchronization",'""']},{name:"dateCreated",type:"DateTime",dataType:"DateTimeOffset",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",dataType:"DateTimeOffset",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"previewID",type:"number",dataType:"BigInt"},{name:"billingAddressID",type:"number",dataType:"BigInt"},{name:"shippingAddressID",type:"number",dataType:"BigInt"}],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"},{name:"hostedDomain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"HostedDomain"},{name:"preview",fkMap:[{fk:"previewID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"billingAddress",fkMap:[{fk:"billingAddressID",relatedKey:"addressID"}],relatedName:"ContactAddress"},{name:"addresses",isCollection:true,isInverse:true,relatedName:"ContactAddress"},{name:"shippingAddress",fkMap:[{fk:"shippingAddressID",relatedKey:"addressID"}],relatedName:"ContactAddress"},{name:"emails",isCollection:true,isInverse:true,relatedName:"ContactEmail"},{name:"phones",isCollection:true,isInverse:true,relatedName:"ContactPhone"},{name:"items",isCollection:true,isInverse:true,relatedName:"ContactItem"},{name:"domains",isCollection:true,isInverse:true,relatedName:"ContactDomain"},{name:"sellerStores",isCollection:true,isInverse:true,relatedName:"Store"},{name:"vendorItems",isCollection:true,isInverse:true,relatedName:"StoreItem"},{name:"ledgers",isCollection:true,isInverse:true,relatedName:"StoreLedger"},{name:"soldInvoices",isCollection:true,isInverse:true,relatedName:"StoreJournal"},{name:"boughtInvoices",isCollection:true,isInverse:true,relatedName:"StoreJournal"},{name:"soldItems",isCollection:true,isInverse:true,relatedName:"StoreJournalLineItem"}]}));modelEntitySchemas["Contact"]=Contact;_export("ContactEmail",ContactEmail=new Model("ContactEmail",["emailAddressID","contactID"],{type:"",blocked:false},{name:"contact_emails",keys:[{name:"emailAddressID",type:"number",dataType:"BigInt"},{name:"contactID",type:"number",dataType:"BigInt"}],properties:[{name:"type",type:"string",dataType:"Char",length:50,default:["type",'""']},{name:"notes",type:"string",dataType:"Char",default:["notes",'""']},{name:"blocked",type:"boolean",dataType:"Boolean",default:["blocked","false"]}],relations:[{name:"emailAddress",fkMap:[{fk:"emailAddressID",relatedKey:"emailAddressID"}],relatedName:"EmailAddress"},{name:"contact",fkMap:[{fk:"contactID",relatedKey:"contactID"}],relatedName:"Contact"}]}));modelEntitySchemas["ContactEmail"]=ContactEmail;_export("ContactPhone",ContactPhone=new Model("ContactPhone",["contactID","phoneNumberE64"],{type:""},{name:"contact_phones",keys:[{name:"contactID",type:"number",dataType:"BigInt"},{name:"phoneNumberE64",type:"string",dataType:"Char",length:50}],properties:[{name:"type",type:"string",dataType:"Char",length:50,default:["type",'""']},{name:"notes",type:"string",dataType:"Char",default:["notes",'""']}],relations:[{name:"contact",fkMap:[{fk:"contactID",relatedKey:"contactID"}],relatedName:"Contact"}]}));modelEntitySchemas["ContactPhone"]=ContactPhone;_export("ContactItem",ContactItem=new Model("ContactItem",["itemID"],{type:"",title:"",valuesJson:""},{name:"contact_items",keys:[{name:"itemID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"contactID",type:"number",dataType:"BigInt"},{name:"type",type:"string",dataType:"Char",length:200,default:["type",'""']},{name:"title",type:"string",dataType:"Char",length:400,default:["title",'""']},{name:"valuesJson",type:"string",dataType:"Char",default:["valuesJson",'""']}],relations:[{name:"contact",fkMap:[{fk:"contactID",relatedKey:"contactID"}],relatedName:"Contact"}]}));modelEntitySchemas["ContactItem"]=ContactItem;_export("ContactDomain",ContactDomain=new Model("ContactDomain",["domainID","contactID"],{blocked:false},{name:"contact_domains",keys:[{name:"domainID",type:"number",dataType:"BigInt"},{name:"contactID",type:"number",dataType:"BigInt"}],properties:[{name:"blocked",type:"boolean",dataType:"Boolean",default:["blocked","false"]}],relations:[{name:"domain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"Domain"},{name:"contact",fkMap:[{fk:"contactID",relatedKey:"contactID"}],relatedName:"Contact"}]}));modelEntitySchemas["ContactDomain"]=ContactDomain;_export("ContactAddress",ContactAddress=new Model("ContactAddress",["addressID"],{title:"",line1:""},{name:"contact_addresses",keys:[{name:"addressID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"contactID",type:"number",dataType:"BigInt"},{name:"title",type:"string",dataType:"Char",length:400,default:["title",'""']},{name:"line1",type:"string",dataType:"Char",length:400,default:["line1",'""']},{name:"line2",type:"string",dataType:"Char",length:400,default:["line2",'""']},{name:"line3",type:"string",dataType:"Char",length:400,default:["line3",'""']},{name:"city",type:"string",dataType:"Char",length:50,default:["city",'""']},{name:"state",type:"string",dataType:"Char",length:50,default:["state",'""']},{name:"countryCode",type:"string",dataType:"Char",length:5,default:["countryCode",'""']},{name:"phoneNumber",type:"string",dataType:"Char",length:5,default:["phoneNumber",'""']},{name:"notes",type:"string",dataType:"Char",length:5,default:["notes",'""']}],relations:[{name:"contact",fkMap:[{fk:"contactID",relatedKey:"contactID"}],relatedName:"Contact"},{name:"billingContacts",isCollection:true,isInverse:true,relatedName:"Contact"},{name:"shippingContacts",isCollection:true,isInverse:true,relatedName:"Contact"}]}));modelEntitySchemas["ContactAddress"]=ContactAddress;_export("CachedItem",CachedItem=new Model("CachedItem",["itemID"],{keyHash:"",key:"",expiry:new DefaultFactory((()=>new DateTime)),ready:false,slide:false},{name:"cached_item",keys:[{name:"itemID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"keyHash",type:"string",dataType:"Char",length:450,default:["keyHash",'""']},{name:"key",type:"string",dataType:"Char",default:["key",'""']},{name:"expiry",type:"DateTime",dataType:"DateTime",default:["expiry","new DefaultFactory(() => new DateTime())"]},{name:"ready",type:"boolean",dataType:"Boolean",default:["ready","false"]},{name:"slide",type:"boolean",dataType:"Boolean",default:["slide","false"]}],relations:[]}));modelEntitySchemas["CachedItem"]=CachedItem;_export("Domain",Domain=new Model("Domain",["domainID"],{name:"",received:0,failed:0},{name:"domains",keys:[{name:"domainID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"name",type:"string",dataType:"Char",length:200,default:["name",'""']},{name:"received",type:"number",dataType:"Int",default:["received","0"]},{name:"failed",type:"number",dataType:"Int",default:["failed","0"]}],relations:[{name:"emailAddresses",isCollection:true,isInverse:true,relatedName:"EmailAddress"},{name:"mailboxes",isCollection:true,isInverse:true,relatedName:"Mailbox"},{name:"hostedDomain",isCollection:false,isInverse:true,relatedName:"HostedDomain"},{name:"contactDomains",isCollection:true,isInverse:true,relatedName:"ContactDomain"},{name:"hostedZone",isCollection:false,isInverse:true,relatedName:"HostedZone"},{name:"activities",isCollection:true,isInverse:true,relatedName:"ServerActivity"}]}));modelEntitySchemas["Domain"]=Domain;_export("HostedDomain",HostedDomain=new Model("HostedDomain",["domainID"],{enableReceive:false,enableSend:false,useRelay:false,maxSendPerSecond:0},{name:"hosted_domains",keys:[{name:"domainID",type:"number",dataType:"BigInt"}],properties:[{name:"enableReceive",type:"boolean",dataType:"Boolean",default:["enableReceive","false"]},{name:"enableSend",type:"boolean",dataType:"Boolean",default:["enableSend","false"]},{name:"useRelay",type:"boolean",dataType:"Boolean",default:["useRelay","false"]},{name:"maxSendPerSecond",type:"number",dataType:"Decimal",default:["maxSendPerSecond","0"]},{name:"aliasForName",type:"string",dataType:"Char",length:200}],relations:[{name:"domain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"Domain"},{name:"aliasFor",fkMap:[{fk:"aliasForName",relatedKey:"domainID"}],relatedName:"HostedDomain"},{name:"aliases",isCollection:true,isInverse:true,relatedName:"HostedDomain"},{name:"contacts",isCollection:true,isInverse:true,relatedName:"Contact"},{name:"domainUsers",isCollection:true,isInverse:true,relatedName:"DomainUser"},{name:"relays",isCollection:true,isInverse:true,relatedName:"DomainRelay"},{name:"domainKeys",isCollection:true,isInverse:true,relatedName:"DomainKey"},{name:"templates",isCollection:true,isInverse:true,relatedName:"EmailTemplate"}]}));modelEntitySchemas["HostedDomain"]=HostedDomain;_export("DomainUser",DomainUser=new Model("DomainUser",["domainID","userID"],{isAdmin:false,allowCreateMailbox:false},{name:"domain_users",keys:[{name:"domainID",type:"number",dataType:"BigInt"},{name:"userID",type:"number",dataType:"BigInt"}],properties:[{name:"prefix",type:"string",dataType:"Char",length:20,default:["prefix",'""']},{name:"isAdmin",type:"boolean",dataType:"Boolean",default:["isAdmin","false"]},{name:"allowCreateMailbox",type:"boolean",dataType:"Boolean",default:["allowCreateMailbox","false"]}],relations:[{name:"hostedDomain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"HostedDomain"},{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"}]}));modelEntitySchemas["DomainUser"]=DomainUser;_export("HostedZone",HostedZone=new Model("HostedZone",["zoneID"],{dnsHosted:false,dateUpdated:new DefaultFactory((()=>new DateTime))},{name:"hosted_zones",keys:[{name:"zoneID",type:"number",dataType:"BigInt"}],properties:[{name:"dnsHosted",type:"boolean",dataType:"Boolean",default:["dnsHosted","false"]},{name:"unsigned",type:"string",dataType:"Char",default:["unsigned",'""']},{name:"digest",type:"string",dataType:"Char",default:["digest",'""']},{name:"dateUpdated",type:"DateTime",dataType:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"dateSigned",type:"DateTime",dataType:"DateTime",default:["dateSigned","new DefaultFactory(() => new DateTime())"]}],relations:[{name:"domain",fkMap:[{fk:"zoneID",relatedKey:"domainID"}],relatedName:"Domain"},{name:"records",isCollection:true,isInverse:true,relatedName:"HostedZoneRecord"},{name:"users",isCollection:true,isInverse:true,relatedName:"HostedZoneUser"}],actions:{updateHosting:"external"}}));modelEntitySchemas["HostedZone"]=HostedZone;_export("HostedZoneRecordTypeArray",HostedZoneRecordTypeArray=[{label:"A",value:"A"},{label:"AAAA",value:"AAAA"},{label:"CNAME",value:"CNAME"},{label:"MX",value:"MX"},{label:"TXT",value:"TXT"},{label:"PTR",value:"PTR"},{label:"SRV",value:"SRV"},{label:"CAA",value:"CAA"},{label:"NS",value:"NS"},{label:"SOA",value:"SOA"}]);_export("HostedZoneRecord",HostedZoneRecord=new Model("HostedZoneRecord",["recordID"],{disabled:false,readonly:false,name:"",type:"A",isAlias:false,value:"",ttl:0,dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime)),hosted:false},{name:"hosted_zone_records",keys:[{name:"recordID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"zoneID",type:"number",dataType:"BigInt"},{name:"disabled",type:"boolean",dataType:"Boolean",default:["disabled","false"]},{name:"readonly",type:"boolean",dataType:"Boolean",default:["readonly","false"]},{name:"name",type:"string",dataType:"Char",length:200,default:["name",'""']},{name:"type",type:"Object",dataType:"Char",length:15,default:["type",'"A"']},{name:"isAlias",type:"boolean",dataType:"Boolean",default:["isAlias","false"]},{name:"value",type:"string",dataType:"Char",default:["value",'""']},{name:"ttl",type:"number",dataType:"Int",default:["ttl","0"]},{name:"dateCreated",type:"DateTime",dataType:"DateTimeOffset",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",dataType:"DateTimeOffset",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"notes",type:"string",dataType:"Char",default:["notes",'""']},{name:"expiryDate",type:"DateTime",dataType:"DateTimeOffset",default:["expiryDate","new DefaultFactory(() => new DateTime())"]},{name:"hosted",type:"boolean",dataType:"Boolean",default:["hosted","false"]},{name:"fqdn",type:"string",dataType:"Char",default:["fqdn",'""']}],relations:[{name:"zone",fkMap:[{fk:"zoneID",relatedKey:"zoneID"}],relatedName:"HostedZone"}]}));modelEntitySchemas["HostedZoneRecord"]=HostedZoneRecord;_export("HostedZoneUser",HostedZoneUser=new Model("HostedZoneUser",["zoneID","userID"],{},{name:"hosted_zone_users",keys:[{name:"zoneID",type:"number",dataType:"BigInt"},{name:"userID",type:"number",dataType:"BigInt"}],properties:[],relations:[{name:"zone",fkMap:[{fk:"zoneID",relatedKey:"zoneID"}],relatedName:"HostedZone"},{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"}]}));modelEntitySchemas["HostedZoneUser"]=HostedZoneUser;_export("DomainRelayTypeArray",DomainRelayTypeArray=[{label:"smtp",value:"smtp"},{label:"ses",value:"ses"},{label:"https",value:"https"}]);_export("DomainRelay",DomainRelay=new Model("DomainRelay",["domainRelayID"],{type:"smtp",host:"",username:"",password:"",priority:0},{name:"domain_relays",keys:[{name:"domainRelayID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"domainID",type:"number",dataType:"BigInt"},{name:"type",type:"string",dataType:"AsciiChar",length:20,default:["type",'"smtp"']},{name:"host",type:"string",dataType:"Char",length:400,default:["host",'""']},{name:"username",type:"string",dataType:"Char",length:100,default:["username",'""']},{name:"password",type:"string",dataType:"Char",length:100,default:["password",'""']},{name:"priority",type:"number",dataType:"Int",default:["priority","0"]},{name:"script",type:"string",dataType:"Char",default:["script",'""']}],relations:[{name:"hostedDomain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"HostedDomain"}]}));modelEntitySchemas["DomainRelay"]=DomainRelay;_export("DomainKey",DomainKey=new Model("DomainKey",["domainKeyID"],{name:"",keyType:"",publicKey:""},{name:"domain_keys",keys:[{name:"domainKeyID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"name",type:"string",dataType:"Char",length:100,default:["name",'""']},{name:"keyType",type:"string",dataType:"Char",length:20,default:["keyType",'""']},{name:"publicKey",type:"string",dataType:"Char",default:["publicKey",'""']},{name:"domainID",type:"number",dataType:"BigInt"},{name:"privateKey",type:"string",dataType:"Char",default:["privateKey",'""']}],relations:[{name:"hostedDomain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"HostedDomain"}]}));modelEntitySchemas["DomainKey"]=DomainKey;_export("EmailStatusArray",EmailStatusArray=[{label:"queued",value:"queued"},{label:"received",value:"received"},{label:"draft",value:"draft"},{label:"published",value:"published"},{label:"pending-approval",value:"pending-approval"},{label:"scheduled",value:"scheduled"},{label:"sent",value:"sent"},{label:"sent-failed",value:"sent-failed"},{label:"deleted",value:"deleted"},{label:"closed",value:"closed"}]);_export("Email",Email=new Model("Email",["emailID"],{senderName:"",received:false,hasUnsubscribe:false,dateReceived:new DefaultFactory((()=>new DateTime)),dateCreated:new DefaultFactory((()=>new DateTime)),status:"queued",forwardCount:0,replyCount:0,viewCount:0,emailSize:0,originalFileSize:0},{name:"emails",keys:[{name:"emailID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"subject",type:"string",dataType:"Char",default:["subject",'""']},{name:"summary",type:"string",dataType:"Char",length:200,default:["summary",'""']},{name:"textBody",type:"string",dataType:"Char",default:["textBody",'""']},{name:"htmlBody",type:"string",dataType:"Char",default:["htmlBody",'""']},{name:"senderName",type:"string",dataType:"Char",default:["senderName",'""']},{name:"senderID",type:"number",dataType:"BigInt"},{name:"userID",type:"number",dataType:"BigInt"},{name:"received",type:"boolean",dataType:"Boolean",default:["received","false"]},{name:"headers",type:"string",dataType:"Char",default:["headers",'""']},{name:"hasUnsubscribe",type:"boolean",dataType:"Boolean",default:["hasUnsubscribe","false"]},{name:"headerMessageID",type:"string",dataType:"Char",default:["headerMessageID",'""']},{name:"inReplyTo",type:"string",dataType:"Char",default:["inReplyTo",'""']},{name:"externalEmailID",type:"string",dataType:"Char",length:200,default:["externalEmailID",'""']},{name:"dateReceived",type:"DateTime",dataType:"DateTime",default:["dateReceived","new DefaultFactory(() => new DateTime())"]},{name:"dateCreated",type:"DateTime",dataType:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateSent",type:"DateTime",dataType:"DateTime",default:["dateSent","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",dataType:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"status",type:"string",dataType:"AsciiChar",length:20,default:["status",'"queued"']},{name:"forwardCount",type:"number",dataType:"Int",default:["forwardCount","0"]},{name:"replyCount",type:"number",dataType:"Int",default:["replyCount","0"]},{name:"viewCount",type:"number",dataType:"Int",default:["viewCount","0"]},{name:"mimeFileID",type:"number",dataType:"BigInt"},{name:"sentMessageID",type:"string",dataType:"Char",length:200,default:["sentMessageID",'""']},{name:"htmlBodyID",type:"number",dataType:"BigInt"},{name:"emailSize",type:"number",dataType:"BigInt",default:["emailSize","0"]},{name:"originalFileSize",type:"number",dataType:"Int",default:["originalFileSize","0"]},{name:"workflowID",type:"string",dataType:"Char",length:400,default:["workflowID",'""']},{name:"parentID",type:"number",dataType:"BigInt"},{name:"threadID",type:"number",dataType:"BigInt"},{name:"forwardedID",type:"number",dataType:"BigInt"},{name:"lastReplyID",type:"number",dataType:"BigInt"},{name:"engagement",type:"string",dataType:"Char",length:200,default:["engagement",'""']},{name:"tags",type:"string",dataType:"Char",default:["tags",'""']}],relations:[{name:"senderEmail",fkMap:[{fk:"senderID",relatedKey:"emailAddressID"}],relatedName:"EmailAddress"},{name:"senderUser",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"mimeFile",fkMap:[{fk:"mimeFileID",relatedKey:"logID"}],relatedName:"EmailLog"},{name:"logs",isCollection:true,isInverse:true,relatedName:"EmailLog"},{name:"htmlBodyFile",fkMap:[{fk:"htmlBodyID",relatedKey:"logID"}],relatedName:"EmailLog"},{name:"parent",fkMap:[{fk:"parentID",relatedKey:"emailID"}],relatedName:"Email"},{name:"children",isCollection:true,isInverse:true,relatedName:"Email"},{name:"thread",fkMap:[{fk:"threadID",relatedKey:"emailID"}],relatedName:"Email"},{name:"threadChildren",isCollection:true,isInverse:true,relatedName:"Email"},{name:"forwarded",fkMap:[{fk:"forwardedID",relatedKey:"emailID"}],relatedName:"Email"},{name:"forwards",isCollection:true,isInverse:true,relatedName:"Email"},{name:"lastReply",fkMap:[{fk:"lastReplyID",relatedKey:"emailID"}],relatedName:"Email"},{name:"lastRepliedThreads",isCollection:true,isInverse:true,relatedName:"Email"},{name:"attachments",isCollection:true,isInverse:true,relatedName:"AppFile"},{name:"engagements",isCollection:true,isInverse:true,relatedName:"EmailEngagement"},{name:"recipients",isCollection:true,isInverse:true,relatedName:"EmailRecipient"},{name:"emailTags",isCollection:true,isInverse:true,relatedName:"EmailTag"},{name:"mailboxes",isCollection:true,isInverse:true,relatedName:"MailboxEmail"},{name:"lastEmailThreads",isCollection:true,isInverse:true,relatedName:"MailboxContact"},{name:"threadContacts",isCollection:true,isInverse:true,relatedName:"MailboxContactEmail"},{name:"subscriberActivities",isCollection:true,isInverse:true,relatedName:"SubscriberActivity"}],queries:{channelEmails:"external"}}));modelEntitySchemas["Email"]=Email;_export("EmailEngagement",EmailEngagement=new Model("EmailEngagement",["emailID","engagement"],{count:0},{name:"email_engagements",keys:[{name:"emailID",type:"number",dataType:"BigInt"},{name:"engagement",type:"string",dataType:"Char",length:200}],properties:[{name:"count",type:"number",dataType:"Int",default:["count","0"]}],relations:[{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"}]}));modelEntitySchemas["EmailEngagement"]=EmailEngagement;_export("EmailLog",EmailLog=new Model("EmailLog",["logID"],{fileName:"",fileSize:0,compression:"",dateCreated:new DefaultFactory((()=>new DateTime)),cloudPath:""},{name:"email_logs",keys:[{name:"logID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"emailID",type:"number",dataType:"BigInt"},{name:"fileName",type:"string",dataType:"Char",length:200,default:["fileName",'""']},{name:"fileSize",type:"number",dataType:"Int",default:["fileSize","0"]},{name:"compression",type:"string",dataType:"Char",length:20,default:["compression",'""']},{name:"dateCreated",type:"DateTime",dataType:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"cloudPath",type:"string",dataType:"Char",length:200,default:["cloudPath",'""']}],relations:[{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"},{name:"mimeFileEmails",isCollection:true,isInverse:true,relatedName:"Email"},{name:"htmlBodyFileEmails",isCollection:true,isInverse:true,relatedName:"Email"}]}));modelEntitySchemas["EmailLog"]=EmailLog;_export("EmailRecipientTypeArray",EmailRecipientTypeArray=[{label:"from",value:"from"},{label:"to",value:"to"},{label:"cc",value:"cc"},{label:"bcc",value:"bcc"},{label:"viewer",value:"viewer"},{label:"editor",value:"editor"}]);_export("EmailRecipient",EmailRecipient=new Model("EmailRecipient",["emailID","emailAddressID"],{type:"from"},{name:"email_recipients",keys:[{name:"emailID",type:"number",dataType:"BigInt"},{name:"emailAddressID",type:"number",dataType:"BigInt"}],properties:[{name:"type",type:"string",dataType:"Char",length:10,default:["type",'"from"']},{name:"name",type:"string",dataType:"Char",length:200,default:["name",'""']},{name:"dateSent",type:"DateTime",dataType:"DateTimeOffset",default:["dateSent","new DefaultFactory(() => new DateTime())"]},{name:"error",type:"string",dataType:"Char",default:["error",'""']},{name:"status",type:"string",dataType:"Char",length:15,default:["status",'""']},{name:"replyTo",type:"string",dataType:"Char",length:400,default:["replyTo",'""']}],relations:[{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"},{name:"emailAddress",fkMap:[{fk:"emailAddressID",relatedKey:"emailAddressID"}],relatedName:"EmailAddress"}]}));modelEntitySchemas["EmailRecipient"]=EmailRecipient;_export("EmailTag",EmailTag=new Model("EmailTag",["emailID","tagID"],{},{name:"email_tags",keys:[{name:"emailID",type:"number",dataType:"BigInt"},{name:"tagID",type:"number",dataType:"BigInt"}],properties:[],relations:[{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"},{name:"tag",fkMap:[{fk:"tagID",relatedKey:"tagID"}],relatedName:"Tag"}]}));modelEntitySchemas["EmailTag"]=EmailTag;_export("EmailAddress",EmailAddress=new Model("EmailAddress",["emailAddressID"],{emailAddress:"",name:"",blocked:false},{name:"email_addresses",keys:[{name:"emailAddressID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"emailAddress",type:"string",dataType:"Char",length:400,default:["emailAddress",'""']},{name:"domainID",type:"number",dataType:"BigInt"},{name:"name",type:"string",dataType:"Char",length:400,default:["name",'""']},{name:"blocked",type:"boolean",dataType:"Boolean",default:["blocked","false"]}],relations:[{name:"domain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"Domain"},{name:"senders",isCollection:true,isInverse:true,relatedName:"Email"},{name:"mailbox",isCollection:false,isInverse:true,relatedName:"Mailbox"},{name:"contactEmails",isCollection:true,isInverse:true,relatedName:"ContactEmail"},{name:"recipients",isCollection:true,isInverse:true,relatedName:"EmailRecipient"},{name:"threads",isCollection:true,isInverse:true,relatedName:"MailboxContact"},{name:"subscriberActivities",isCollection:true,isInverse:true,relatedName:"SubscriberActivity"}]}));modelEntitySchemas["EmailAddress"]=EmailAddress;_export("EmailTemplate",EmailTemplate=new Model("EmailTemplate",["templateID"],{},{name:"email_templates",keys:[{name:"templateID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"domainID",type:"number",dataType:"BigInt"},{name:"mailboxID",type:"number",dataType:"BigInt"},{name:"folderID",type:"number",dataType:"BigInt"}],relations:[{name:"hostedDomain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"HostedDomain"},{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"},{name:"folder",fkMap:[{fk:"folderID",relatedKey:"appFileID"}],relatedName:"AppFile"}]}));modelEntitySchemas["EmailTemplate"]=EmailTemplate;_export("Mailbox",Mailbox=new Model("Mailbox",["mailboxID"],{storage:0,maxStorage:0,indexAttachments:false,indexImageAttachments:false,openThreads:0,totalThreads:0,unread:0,isExternal:false,maxSendPerSecond:0,dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime)),isChannel:false,isPrivateChannel:false,requireApproval:false,subscriberCount:0},{name:"mailboxes",keys:[{name:"mailboxID",type:"number",dataType:"BigInt"}],properties:[{name:"domainID",type:"number",dataType:"BigInt"},{name:"storage",type:"number",dataType:"BigInt",default:["storage","0"]},{name:"maxStorage",type:"number",dataType:"BigInt",default:["maxStorage","0"]},{name:"indexAttachments",type:"boolean",dataType:"Boolean",default:["indexAttachments","false"]},{name:"indexImageAttachments",type:"boolean",dataType:"Boolean",default:["indexImageAttachments","false"]},{name:"firstID",type:"number",dataType:"BigInt",default:["firstID","0"]},{name:"recentID",type:"number",dataType:"BigInt",default:["recentID","0"]},{name:"openThreads",type:"number",dataType:"Int",default:["openThreads","0"]},{name:"totalThreads",type:"number",dataType:"Int",default:["totalThreads","0"]},{name:"unread",type:"number",dataType:"Int",default:["unread","0"]},{name:"logoID",type:"number",dataType:"BigInt"},{name:"isExternal",type:"boolean",dataType:"Boolean",default:["isExternal","false"]},{name:"maxSendPerSecond",type:"number",dataType:"Decimal",default:["maxSendPerSecond","0"]},{name:"description",type:"string",dataType:"Char",default:["description",'""']},{name:"dateCreated",type:"DateTime",dataType:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",dataType:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"isChannel",type:"boolean",dataType:"Boolean",default:["isChannel","false"]},{name:"isPrivateChannel",type:"boolean",dataType:"Boolean",default:["isPrivateChannel","false"]},{name:"requireApproval",type:"boolean",dataType:"Boolean",default:["requireApproval","false"]},{name:"subscriberCount",type:"number",dataType:"Int",default:["subscriberCount","0"]},{name:"datePublished",type:"DateTime",dataType:"DateTime",default:["datePublished","new DefaultFactory(() => new DateTime())"]},{name:"dateEngaged",type:"DateTime",dataType:"DateTime",default:["dateEngaged","new DefaultFactory(() => new DateTime())"]},{name:"parentID",type:"number",dataType:"BigInt",default:["parentID","0"]}],relations:[{name:"emailAddress",fkMap:[{fk:"mailboxID",relatedKey:"emailAddressID"}],relatedName:"EmailAddress"},{name:"domain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"Domain"},{name:"logo",fkMap:[{fk:"logoID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"contacts",isCollection:true,isInverse:true,relatedName:"Contact"},{name:"templates",isCollection:true,isInverse:true,relatedName:"EmailTemplate"},{name:"emails",isCollection:true,isInverse:true,relatedName:"MailboxEmail"},{name:"mailboxContacts",isCollection:true,isInverse:true,relatedName:"MailboxContact"},{name:"folders",isCollection:true,isInverse:true,relatedName:"MailboxFolder"},{name:"threadEmails",isCollection:true,isInverse:true,relatedName:"MailboxContactEmail"},{name:"syncTargets",isCollection:true,isInverse:true,relatedName:"MailboxSyncTarget"},{name:"channelConfig",isCollection:false,isInverse:true,relatedName:"ChannelConfig"},{name:"subscriberActivities",isCollection:true,isInverse:true,relatedName:"SubscriberActivity"},{name:"userPins",isCollection:true,isInverse:true,relatedName:"UserPin"},{name:"userMailboxes",isCollection:true,isInverse:true,relatedName:"UserMailbox"},{name:"websiteChannels",isCollection:true,isInverse:true,relatedName:"WebSiteChannel"}],queries:{channels:"external"},actions:{fetch:"external"}}));modelEntitySchemas["Mailbox"]=Mailbox;_export("MailboxEmail",MailboxEmail=new Model("MailboxEmail",["mailboxID","emailID"],{},{name:"mailbox_emails",keys:[{name:"mailboxID",type:"number",dataType:"BigInt"},{name:"emailID",type:"number",dataType:"BigInt"}],properties:[],relations:[{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"},{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"}]}));modelEntitySchemas["MailboxEmail"]=MailboxEmail;_export("MailboxContactStatusArray",MailboxContactStatusArray=[{label:"invited",value:"invited"},{label:"added",value:"added"},{label:"active",value:"active"},{label:"unsubscribed",value:"unsubscribed"},{label:"blocked",value:"blocked"}]);_export("MailboxContact",MailboxContact=new Model("MailboxContact",["mailboxID","emailAddressID"],{dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime)),unread:0,openThreads:0,totalThreads:0,autoClose:false,total:0,isOwner:false,canContribute:false,priority:0,blocked:false,newRequest:false,spam:false,mute:false,status:"invited"},{name:"mailbox_contacts",keys:[{name:"mailboxID",type:"number",dataType:"BigInt"},{name:"emailAddressID",type:"number",dataType:"BigInt"}],properties:[{name:"folderTagID",type:"number",dataType:"BigInt",default:["folderTagID","0"]},{name:"lastEmailID",type:"number",dataType:"BigInt"},{name:"dateCreated",type:"DateTime",dataType:"DateTimeOffset",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",dataType:"DateTimeOffset",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"unread",type:"number",dataType:"Int",default:["unread","0"]},{name:"openThreads",type:"number",dataType:"Int",default:["openThreads","0"]},{name:"totalThreads",type:"number",dataType:"Int",default:["totalThreads","0"]},{name:"autoClose",type:"boolean",dataType:"Boolean",default:["autoClose","false"]},{name:"total",type:"number",dataType:"Int",default:["total","0"]},{name:"doNotIndex",type:"boolean",dataType:"Boolean",default:["doNotIndex","false"]},{name:"doNotIndexAttachments",type:"boolean",dataType:"Boolean",default:["doNotIndexAttachments","false"]},{name:"isOwner",type:"boolean",dataType:"Boolean",default:["isOwner","false"]},{name:"canContribute",type:"boolean",dataType:"Boolean",default:["canContribute","false"]},{name:"priority",type:"number",dataType:"Int",default:["priority","0"]},{name:"blocked",type:"boolean",dataType:"Boolean",default:["blocked","false"]},{name:"newRequest",type:"boolean",dataType:"Boolean",default:["newRequest","false"]},{name:"spam",type:"boolean",dataType:"Boolean",default:["spam","false"]},{name:"mute",type:"boolean",dataType:"Boolean",default:["mute","false"]},{name:"status",type:"string",dataType:"Char",length:15,default:["status",'"invited"']}],relations:[{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"},{name:"emailAddress",fkMap:[{fk:"emailAddressID",relatedKey:"emailAddressID"}],relatedName:"EmailAddress"},{name:"lastEmail",fkMap:[{fk:"lastEmailID",relatedKey:"emailID"}],relatedName:"Email"},{name:"contactEmails",isCollection:true,isInverse:true,relatedName:"MailboxContactEmail"},{name:"tags",isCollection:true,isInverse:true,relatedName:"MailboxContactTag"}]}));modelEntitySchemas["MailboxContact"]=MailboxContact;_export("MailboxFolder",MailboxFolder=new Model("MailboxFolder",["mailboxID","tagID"],{count:0,isSystem:false},{name:"mailbox_folders",keys:[{name:"mailboxID",type:"number",dataType:"BigInt"},{name:"tagID",type:"number",dataType:"BigInt"}],properties:[{name:"count",type:"number",dataType:"Int",default:["count","0"]},{name:"isSystem",type:"boolean",dataType:"Boolean",default:["isSystem","false"]}],relations:[{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"},{name:"tag",fkMap:[{fk:"tagID",relatedKey:"tagID"}],relatedName:"Tag"}]}));modelEntitySchemas["MailboxFolder"]=MailboxFolder;_export("MailboxContactEmail",MailboxContactEmail=new Model("MailboxContactEmail",["mailboxID","emailAddressID","emailID"],{dateReceived:new DefaultFactory((()=>new DateTime))},{name:"mailbox_contact_emails",keys:[{name:"mailboxID",type:"number",dataType:"BigInt"},{name:"emailAddressID",type:"number",dataType:"BigInt"},{name:"emailID",type:"number",dataType:"BigInt"}],properties:[{name:"dateReceived",type:"DateTime",dataType:"DateTimeOffset",default:["dateReceived","new DefaultFactory(() => new DateTime())"]},{name:"timeRead",type:"DateTime",dataType:"DateTimeOffset",default:["timeRead","new DefaultFactory(() => new DateTime())"]},{name:"engagement",type:"string",dataType:"Char",length:200,default:["engagement",'""']},{name:"signedFileLogID",type:"number",dataType:"BigInt",default:["signedFileLogID","0"]}],relations:[{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"},{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"},{name:"mailboxContact",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"},{fk:"emailAddressID",relatedKey:"emailAddressID"}],relatedName:"MailboxContact"}]}));modelEntitySchemas["MailboxContactEmail"]=MailboxContactEmail;_export("MailboxContactTag",MailboxContactTag=new Model("MailboxContactTag",["mailboxID","emailAddressID","tagID"],{count:0,dateUpdated:new DefaultFactory((()=>new DateTime))},{name:"mailbox_contact_tags",keys:[{name:"mailboxID",type:"number",dataType:"BigInt"},{name:"emailAddressID",type:"number",dataType:"BigInt"},{name:"tagID",type:"number",dataType:"BigInt"}],properties:[{name:"count",type:"number",dataType:"Int",default:["count","0"]},{name:"dateUpdated",type:"DateTime",dataType:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]}],relations:[{name:"tag",fkMap:[{fk:"tagID",relatedKey:"tagID"}],relatedName:"Tag"},{name:"mailboxContact",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"},{fk:"emailAddressID",relatedKey:"emailAddressID"}],relatedName:"MailboxContact"}]}));modelEntitySchemas["MailboxContactTag"]=MailboxContactTag;_export("MailboxSyncTargetDirectionArray",MailboxSyncTargetDirectionArray=[{label:"in",value:"in"},{label:"out",value:"out"}]);_export("MailboxSyncTargetProtocolArray",MailboxSyncTargetProtocolArray=[{label:"imap",value:"imap"},{label:"smtp",value:"smtp"}]);_export("MailboxSyncTargetLastSyncStatusArray",MailboxSyncTargetLastSyncStatusArray=[{label:"none",value:"none"},{label:"success",value:"success"},{label:"failed",value:"failed"}]);_export("MailboxSyncTarget",MailboxSyncTarget=new Model("MailboxSyncTarget",["syncTargetID"],{direction:"in",protocol:"imap",username:"",host:"",port:0,isSecure:false,syncAllFolders:false,syncJunkMails:false,intervalSeconds:0,active:false},{name:"mailbox_sync_targets",keys:[{name:"syncTargetID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"mailboxID",type:"number",dataType:"BigInt"},{name:"direction",type:"string",dataType:"Char",length:5,default:["direction",'"in"']},{name:"protocol",type:"string",dataType:"Char",length:20,default:["protocol",'"imap"']},{name:"username",type:"string",dataType:"Char",length:200,default:["username",'""']},{name:"password",type:"string",dataType:"Char",length:200,default:["password",'""']},{name:"host",type:"string",dataType:"Char",length:200,default:["host",'""']},{name:"port",type:"number",dataType:"Int",default:["port","0"]},{name:"isSecure",type:"boolean",dataType:"Boolean",default:["isSecure","false"]},{name:"syncAllFolders",type:"boolean",dataType:"Boolean",default:["syncAllFolders","false"]},{name:"syncJunkMails",type:"boolean",dataType:"Boolean",default:["syncJunkMails","false"]},{name:"allFolderName",type:"string",dataType:"Char",length:200,default:["allFolderName",'""']},{name:"intervalSeconds",type:"number",dataType:"Int",default:["intervalSeconds","0"]},{name:"active",type:"boolean",dataType:"Boolean",default:["active","false"]},{name:"lastSync",type:"DateTime",dataType:"DateTimeOffset",default:["lastSync","new DefaultFactory(() => new DateTime())"]},{name:"lastSyncStatus",type:"string",dataType:"Char",length:200,default:["lastSyncStatus",'"none"']},{name:"syncState",type:"string",dataType:"Char",default:["syncState",'""']},{name:"lastSyncError",type:"string",dataType:"Char",default:["lastSyncError",'""']}],relations:[{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"}]}));modelEntitySchemas["MailboxSyncTarget"]=MailboxSyncTarget;_export("ChannelConfig",ChannelConfig=new Model("ChannelConfig",["mailboxID"],{sendInviteOnEngagement:false,memberOnlyEngagement:false,notSafeForWork:false},{name:"channel_configs",keys:[{name:"mailboxID",type:"number",dataType:"BigInt"}],properties:[{name:"inviteContent",type:"string",dataType:"Char",default:["inviteContent",'""']},{name:"welcomeContent",type:"string",dataType:"Char",default:["welcomeContent",'""']},{name:"sendInviteOnEngagement",type:"boolean",dataType:"Boolean",default:["sendInviteOnEngagement","false"]},{name:"memberOnlyEngagement",type:"boolean",dataType:"Boolean",default:["memberOnlyEngagement","false"]},{name:"notSafeForWork",type:"boolean",dataType:"Boolean",default:["notSafeForWork","false"]},{name:"postFooter",type:"string",dataType:"Char",default:["postFooter",'""']}],relations:[{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"}]}));modelEntitySchemas["ChannelConfig"]=ChannelConfig;_export("SubscriberActivity",SubscriberActivity=new Model("SubscriberActivity",["activityID"],{activity:"",dateCreated:new DefaultFactory((()=>new DateTime))},{name:"subscriber_activities",keys:[{name:"activityID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"mailboxID",type:"number",dataType:"BigInt"},{name:"emailID",type:"number",dataType:"BigInt"},{name:"emailAddressID",type:"number",dataType:"BigInt"},{name:"activity",type:"string",dataType:"Char",length:20,default:["activity",'""']},{name:"dateCreated",type:"DateTime",dataType:"DateTimeOffset",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"ipAddress",type:"string",dataType:"Char",length:50,default:["ipAddress",'""']},{name:"accessCode",type:"string",dataType:"Char",length:50,default:["accessCode",'""']}],relations:[{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"},{name:"email",fkMap:[{fk:"emailID",relatedKey:"emailID"}],relatedName:"Email"},{name:"subscriber",fkMap:[{fk:"emailAddressID",relatedKey:"emailAddressID"}],relatedName:"EmailAddress"}]}));modelEntitySchemas["SubscriberActivity"]=SubscriberActivity;_export("SearchWordStatusArray",SearchWordStatusArray=[{label:"begin",value:"begin"},{label:"ready",value:"ready"},{label:"deleted",value:"deleted"}]);_export("SearchWord",SearchWord=new Model("SearchWord",["wordID"],{word:"",dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime)),status:"begin"},{name:"search_words",keys:[{name:"wordID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"word",type:"string",dataType:"Char",default:["word",'""']},{name:"dateCreated",type:"DateTime",dataType:"DateTimeOffset",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",dataType:"DateTimeOffset",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"expires",type:"DateTime",dataType:"DateTimeOffset",default:["expires","new DefaultFactory(() => new DateTime())"]},{name:"status",type:"string",dataType:"Char",length:10,default:["status",'"begin"']},{name:"recentID",type:"number",dataType:"BigInt",default:["recentID","0"]},{name:"firstID",type:"number",dataType:"BigInt",default:["firstID","0"]}],relations:[{name:"indexes",isCollection:true,isInverse:true,relatedName:"SearchWordIndex"}]}));modelEntitySchemas["SearchWord"]=SearchWord;_export("SearchWordIndex",SearchWordIndex=new Model("SearchWordIndex",["wordID","fileContentID"],{rank:0},{name:"search_word_index",keys:[{name:"wordID",type:"number",dataType:"BigInt"},{name:"fileContentID",type:"number",dataType:"BigInt"}],properties:[{name:"rank",type:"number",dataType:"Int",default:["rank","0"]}],relations:[{name:"word",fkMap:[{fk:"wordID",relatedKey:"wordID"}],relatedName:"SearchWord"}]}));modelEntitySchemas["SearchWordIndex"]=SearchWordIndex;_export("ServerActivityActivityArray",ServerActivityActivityArray=[{label:"visit",value:"visit"},{label:"rcpt-not-found",value:"rcpt-not-found"},{label:"mail-received",value:"mail-received"}]);_export("ServerActivity",ServerActivity=new Model("ServerActivity",["activityID"],{dateCreated:new DefaultFactory((()=>new DateTime)),ipAddress:"",activity:"visit"},{name:"server_activities",keys:[{name:"activityID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"domainID",type:"number",dataType:"BigInt"},{name:"webSiteFolderID",type:"number",dataType:"BigInt"},{name:"dateCreated",type:"DateTime",dataType:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"ipAddress",type:"string",dataType:"Char",length:50,default:["ipAddress",'""']},{name:"activity",type:"string",dataType:"Char",length:50,default:["activity",'"visit"']}],relations:[{name:"domain",fkMap:[{fk:"domainID",relatedKey:"domainID"}],relatedName:"Domain"},{name:"webSite",fkMap:[{fk:"webSiteFolderID",relatedKey:"folderID"}],relatedName:"WebSiteFolder"}]}));modelEntitySchemas["ServerActivity"]=ServerActivity;_export("Store",Store=new Model("Store",["storeID"],{name:"",currency:""},{name:"stores",keys:[{name:"storeID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"name",type:"string",dataType:"Char",length:200,default:["name",'""']},{name:"currency",type:"string",dataType:"Char",length:5,default:["currency",'""']},{name:"sellerID",type:"number",dataType:"BigInt"},{name:"folderID",type:"number",dataType:"BigInt"}],relations:[{name:"seller",fkMap:[{fk:"sellerID",relatedKey:"contactID"}],relatedName:"Contact"},{name:"folder",fkMap:[{fk:"folderID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"storeUsers",isCollection:true,isInverse:true,relatedName:"StoreUser"},{name:"configs",isCollection:true,isInverse:true,relatedName:"StoreConfig"},{name:"storeItems",isCollection:true,isInverse:true,relatedName:"StoreItem"},{name:"itemFolders",isCollection:true,isInverse:true,relatedName:"StoreItemFolder"},{name:"insights",isCollection:true,isInverse:true,relatedName:"StoreInsight"},{name:"ledgers",isCollection:true,isInverse:true,relatedName:"StoreLedger"},{name:"journals",isCollection:true,isInverse:true,relatedName:"StoreJournal"},{name:"tags",isCollection:true,isInverse:true,relatedName:"StoreTag"},{name:"storeWebsites",isCollection:true,isInverse:true,relatedName:"WebSiteStore"}],queries:{storeQuery:"external"}}));modelEntitySchemas["Store"]=Store;_export("StoreUser",StoreUser=new Model("StoreUser",["storeID","userID"],{},{name:"store_users",keys:[{name:"storeID",type:"number",dataType:"BigInt"},{name:"userID",type:"number",dataType:"BigInt"}],properties:[],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"},{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"}]}));modelEntitySchemas["StoreUser"]=StoreUser;_export("StoreConfig",StoreConfig=new Model("StoreConfig",["storeID","groupName","configName"],{encrypted:false,configValue:""},{name:"store_configs",keys:[{name:"storeID",type:"number",dataType:"BigInt"},{name:"groupName",type:"string",dataType:"Char",length:50},{name:"configName",type:"string",dataType:"Char",length:200}],properties:[{name:"encrypted",type:"boolean",dataType:"Boolean",default:["encrypted","false"]},{name:"configValue",type:"string",dataType:"Char",default:["configValue",'""']}],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"}]}));modelEntitySchemas["StoreConfig"]=StoreConfig;_export("StoreItemItemTypeArray",StoreItemItemTypeArray=[{label:"product",value:"product"},{label:"e-product",value:"e-product"},{label:"shipping",value:"shipping"},{label:"service",value:"service"},{label:"tax",value:"tax"},{label:"fee",value:"fee"},{label:"commission",value:"commission"},{label:"variant",value:"variant"},{label:"size",value:"size"}]);_export("StoreItem",StoreItem=new Model("StoreItem",["storeItemID"],{name:"",active:false,itemType:"product",dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime)),price:0,maxPrice:0},{name:"store_items",keys:[{name:"storeItemID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"storeID",type:"number",dataType:"BigInt"},{name:"itemFolderID",type:"number",dataType:"BigInt"},{name:"name",type:"string",dataType:"Char",length:200,default:["name",'""']},{name:"active",type:"boolean",dataType:"Boolean",default:["active","false"]},{name:"internalNotes",type:"string",dataType:"Char",default:["internalNotes",'""']},{name:"description",type:"string",dataType:"Char",default:["description",'""']},{name:"itemType",type:"string",dataType:"Char",length:20,default:["itemType",'"product"']},{name:"folderID",type:"number",dataType:"BigInt"},{name:"sizeForID",type:"number",dataType:"BigInt"},{name:"variantForID",type:"number",dataType:"BigInt"},{name:"dateCreated",type:"DateTime",dataType:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",dataType:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"vendorID",type:"number",dataType:"BigInt"},{name:"price",type:"number",dataType:"Decimal",default:["price","0"]},{name:"maxPrice",type:"number",dataType:"Decimal",default:["maxPrice","0"]}],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"},{name:"itemFolder",fkMap:[{fk:"itemFolderID",relatedKey:"itemFolderID"}],relatedName:"StoreItemFolder"},{name:"fileFolder",fkMap:[{fk:"folderID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"sizeFor",fkMap:[{fk:"sizeForID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"sizes",isCollection:true,isInverse:true,relatedName:"StoreItem"},{name:"variantFor",fkMap:[{fk:"variantForID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"variants",isCollection:true,isInverse:true,relatedName:"StoreItem"},{name:"vendor",fkMap:[{fk:"vendorID",relatedKey:"contactID"}],relatedName:"Contact"},{name:"storeItemPrices",isCollection:true,isInverse:true,relatedName:"StoreItemPrice"},{name:"mediaFiles",isCollection:true,isInverse:true,relatedName:"StoreMediaFile"},{name:"insights",isCollection:true,isInverse:true,relatedName:"StoreInsight"},{name:"ledgers",isCollection:true,isInverse:true,relatedName:"StoreLedger"},{name:"lineItems",isCollection:true,isInverse:true,relatedName:"StoreJournalLineItem"},{name:"taxes",isCollection:true,isInverse:true,relatedName:"StoreItemTax"},{name:"taxItems",isCollection:true,isInverse:true,relatedName:"StoreItemTax"},{name:"storeItemTags",isCollection:true,isInverse:true,relatedName:"StoreItemTag"}],queries:{storeQuery:"external"}}));modelEntitySchemas["StoreItem"]=StoreItem;_export("StoreItemFolder",StoreItemFolder=new Model("StoreItemFolder",["itemFolderID"],{name:"",path:""},{name:"store_item_folders",keys:[{name:"itemFolderID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"storeID",type:"number",dataType:"BigInt"},{name:"name",type:"string",dataType:"Char",length:200,default:["name",'""']},{name:"path",type:"string",dataType:"Char",length:400,default:["path",'""']},{name:"parentID",type:"number",dataType:"BigInt"}],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"},{name:"parent",fkMap:[{fk:"parentID",relatedKey:"itemFolderID"}],relatedName:"StoreItemFolder"},{name:"children",isCollection:true,isInverse:true,relatedName:"StoreItemFolder"},{name:"items",isCollection:true,isInverse:true,relatedName:"StoreItem"},{name:"tags",isCollection:true,isInverse:true,relatedName:"StoreItemFolderTag"}]}));modelEntitySchemas["StoreItemFolder"]=StoreItemFolder;_export("StoreItemFolderTag",StoreItemFolderTag=new Model("StoreItemFolderTag",["itemFolderID","tagID"],{count:0},{name:"store_item_folder_tags",keys:[{name:"itemFolderID",type:"number",dataType:"BigInt"},{name:"tagID",type:"number",dataType:"BigInt"}],properties:[{name:"count",type:"number",dataType:"Int",default:["count","0"]}],relations:[{name:"itemFolder",fkMap:[{fk:"itemFolderID",relatedKey:"itemFolderID"}],relatedName:"StoreItemFolder"},{name:"tag",fkMap:[{fk:"tagID",relatedKey:"tagID"}],relatedName:"Tag"}]}));modelEntitySchemas["StoreItemFolderTag"]=StoreItemFolderTag;_export("StoreItemPrice",StoreItemPrice=new Model("StoreItemPrice",["priceID"],{startDate:new DefaultFactory((()=>new DateTime)),currency:"",amount:0,taxIncluded:false,taxAmount:0,active:false},{name:"store_item_prices",keys:[{name:"priceID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"storeItemID",type:"number",dataType:"BigInt"},{name:"startDate",type:"DateTime",dataType:"DateTimeOffset",default:["startDate","new DefaultFactory(() => new DateTime())"]},{name:"endDate",type:"DateTime",dataType:"DateTimeOffset",default:["endDate","new DefaultFactory(() => new DateTime())"]},{name:"currency",type:"string",dataType:"Char",length:5,default:["currency",'""']},{name:"amount",type:"number",dataType:"Decimal",default:["amount","0"]},{name:"maxAmount",type:"number",dataType:"Decimal",default:["maxAmount","0"]},{name:"taxIncluded",type:"boolean",dataType:"Boolean",default:["taxIncluded","false"]},{name:"taxAmount",type:"number",dataType:"Decimal",default:["taxAmount","0"]},{name:"active",type:"boolean",dataType:"Boolean",default:["active","false"]}],relations:[{name:"storeItem",fkMap:[{fk:"storeItemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"lineItems",isCollection:true,isInverse:true,relatedName:"StoreJournalLineItem"}],queries:{storeQuery:"external"}}));modelEntitySchemas["StoreItemPrice"]=StoreItemPrice;_export("StoreMediaFile",StoreMediaFile=new Model("StoreMediaFile",["storeItemID","appFileID"],{sortOrder:0,title:"",isPreview:false,isDeleted:false},{name:"store_media_files",keys:[{name:"storeItemID",type:"number",dataType:"BigInt"},{name:"appFileID",type:"number",dataType:"BigInt"}],properties:[{name:"fileContentID",type:"number",dataType:"BigInt",default:["fileContentID","0"]},{name:"sortOrder",type:"number",dataType:"Int",default:["sortOrder","0"]},{name:"title",type:"string",dataType:"Char",length:400,default:["title",'""']},{name:"description",type:"string",dataType:"Char",default:["description",'""']},{name:"isPreview",type:"boolean",dataType:"Boolean",default:["isPreview","false"]},{name:"isDeleted",type:"boolean",dataType:"Boolean",default:["isDeleted","false"]},{name:"fileHtmlView",type:"string",dataType:"Char",default:["fileHtmlView",'""']},{name:"fileLink",type:"string",dataType:"Char",default:["fileLink",'""']}],relations:[{name:"storeItem",fkMap:[{fk:"storeItemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"appFile",fkMap:[{fk:"appFileID",relatedKey:"appFileID"}],relatedName:"AppFile"}],queries:{storeQuery:"external"}}));modelEntitySchemas["StoreMediaFile"]=StoreMediaFile;_export("StoreInsight",StoreInsight=new Model("StoreInsight",["insightID"],{name:"",value:0,isPublic:false},{name:"store_insights",keys:[{name:"insightID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"storeID",type:"number",dataType:"BigInt"},{name:"storeItemID",type:"number",dataType:"BigInt"},{name:"name",type:"string",dataType:"Char",length:200,default:["name",'""']},{name:"value",type:"number",dataType:"Decimal",default:["value","0"]},{name:"isPublic",type:"boolean",dataType:"Boolean",default:["isPublic","false"]}],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"},{name:"storeItem",fkMap:[{fk:"storeItemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"}]}));modelEntitySchemas["StoreInsight"]=StoreInsight;_export("StoreLedger",StoreLedger=new Model("StoreLedger",["ledgerID"],{ledgerType:"",name:"",balance:0},{name:"store_ledger",keys:[{name:"ledgerID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"path",type:"string",dataType:"Char",length:400,default:["path",'""']},{name:"storeID",type:"number",dataType:"BigInt"},{name:"parentID",type:"number",dataType:"BigInt"},{name:"contactID",type:"number",dataType:"BigInt"},{name:"itemID",type:"number",dataType:"BigInt"},{name:"head",type:"string",dataType:"Char",length:50,default:["head",'""']},{name:"ledgerType",type:"string",dataType:"Char",length:50,default:["ledgerType",'""']},{name:"name",type:"string",dataType:"Char",length:400,default:["name",'""']},{name:"description",type:"string",dataType:"Char",default:["description",'""']},{name:"balance",type:"number",dataType:"Decimal",default:["balance","0"]}],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"},{name:"parent",fkMap:[{fk:"parentID",relatedKey:"ledgerID"}],relatedName:"StoreLedger"},{name:"children",isCollection:true,isInverse:true,relatedName:"StoreLedger"},{name:"contact",fkMap:[{fk:"contactID",relatedKey:"contactID"}],relatedName:"Contact"},{name:"item",fkMap:[{fk:"itemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"entries",isCollection:true,isInverse:true,relatedName:"StoreJournalEntry"}]}));modelEntitySchemas["StoreLedger"]=StoreLedger;_export("StoreJournalJournalTypeArray",StoreJournalJournalTypeArray=[{label:"order",value:"order"},{label:"purchase-order",value:"purchase-order"},{label:"sales-invoice",value:"sales-invoice"},{label:"journal",value:"journal"},{label:"purchase-bill",value:"purchase-bill"},{label:"payment",value:"payment"}]);_export("StoreJournal",StoreJournal=new Model("StoreJournal",["journalID"],{dateCreated:new DefaultFactory((()=>new DateTime)),dateUpdated:new DefaultFactory((()=>new DateTime)),journalType:"order",posted:false,status:"",total:0,balance:0,taxExempt:false},{name:"store_journals",keys:[{name:"journalID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"storeID",type:"number",dataType:"BigInt"},{name:"dateCreated",type:"DateTime",dataType:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"dateUpdated",type:"DateTime",dataType:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"journalType",type:"string",dataType:"AsciiChar",length:50,default:["journalType",'"order"']},{name:"description",type:"string",dataType:"Char",default:["description",'""']},{name:"posted",type:"boolean",dataType:"Boolean",default:["posted","false"]},{name:"status",type:"string",dataType:"Char",length:50,default:["status",'""']},{name:"sellerID",type:"number",dataType:"BigInt"},{name:"buyerID",type:"number",dataType:"BigInt"},{name:"total",type:"number",dataType:"Decimal",default:["total","0"]},{name:"balance",type:"number",dataType:"Decimal",default:["balance","0"]},{name:"referenceID",type:"number",dataType:"BigInt"},{name:"folderID",type:"number",dataType:"BigInt"},{name:"taxExempt",type:"boolean",dataType:"Boolean",default:["taxExempt","false"]},{name:"taxExemptNotes",type:"string",dataType:"Char",default:["taxExemptNotes",'""']},{name:"taxExemptTaxID",type:"string",dataType:"Char",default:["taxExemptTaxID",'""']}],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"},{name:"seller",fkMap:[{fk:"sellerID",relatedKey:"contactID"}],relatedName:"Contact"},{name:"buyer",fkMap:[{fk:"buyerID",relatedKey:"contactID"}],relatedName:"Contact"},{name:"reference",fkMap:[{fk:"referenceID",relatedKey:"journalID"}],relatedName:"StoreJournal"},{name:"references",isCollection:true,isInverse:true,relatedName:"StoreJournal"},{name:"folder",fkMap:[{fk:"folderID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"entries",isCollection:true,isInverse:true,relatedName:"StoreJournalEntry"},{name:"lineItems",isCollection:true,isInverse:true,relatedName:"StoreJournalLineItem"}]}));modelEntitySchemas["StoreJournal"]=StoreJournal;_export("StoreJournalEntry",StoreJournalEntry=new Model("StoreJournalEntry",["entryID"],{credit:0,debit:0},{name:"store_journal_entries",keys:[{name:"entryID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"journalID",type:"number",dataType:"BigInt"},{name:"ledgerID",type:"number",dataType:"BigInt"},{name:"credit",type:"number",dataType:"Decimal",default:["credit","0"]},{name:"debit",type:"number",dataType:"Decimal",default:["debit","0"]},{name:"balance",type:"number",dataType:"Decimal",default:["balance","0"]},{name:"description",type:"string",dataType:"Char",default:["description",'""']},{name:"lineItemID",type:"number",dataType:"BigInt"}],relations:[{name:"journal",fkMap:[{fk:"journalID",relatedKey:"journalID"}],relatedName:"StoreJournal"},{name:"ledger",fkMap:[{fk:"ledgerID",relatedKey:"ledgerID"}],relatedName:"StoreLedger"},{name:"lineItem",fkMap:[{fk:"lineItemID",relatedKey:"lineItemID"}],relatedName:"StoreJournalLineItem"}]}));modelEntitySchemas["StoreJournalEntry"]=StoreJournalEntry;_export("StoreJournalLineItemItemTypeArray",StoreJournalLineItemItemTypeArray=[{label:"product",value:"product"},{label:"e-product",value:"e-product"},{label:"shipping",value:"shipping"},{label:"service",value:"service"},{label:"tax",value:"tax"},{label:"fee",value:"fee"},{label:"commission",value:"commission"},{label:"variant",value:"variant"},{label:"size",value:"size"}]);_export("StoreJournalLineItem",StoreJournalLineItem=new Model("StoreJournalLineItem",["lineItemID"],{amount:0,total:0,quantity:0,inclusive:false,hide:false},{name:"store_journal_line_items",keys:[{name:"lineItemID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"journalID",type:"number",dataType:"BigInt"},{name:"itemID",type:"number",dataType:"BigInt"},{name:"itemPriceID",type:"number",dataType:"BigInt"},{name:"amount",type:"number",dataType:"Decimal",default:["amount","0"]},{name:"total",type:"number",dataType:"Decimal",default:["total","0"]},{name:"quantity",type:"number",dataType:"Decimal",default:["quantity","0"]},{name:"inclusive",type:"boolean",dataType:"Boolean",default:["inclusive","false"]},{name:"itemType",type:"string",dataType:"Char",length:50,default:["itemType",'"product"']},{name:"hide",type:"boolean",dataType:"Boolean",default:["hide","false"]},{name:"vendorID",type:"number",dataType:"BigInt"},{name:"sourceID",type:"number",dataType:"BigInt"}],relations:[{name:"journal",fkMap:[{fk:"journalID",relatedKey:"journalID"}],relatedName:"StoreJournal"},{name:"item",fkMap:[{fk:"itemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"itemPrice",fkMap:[{fk:"itemPriceID",relatedKey:"priceID"}],relatedName:"StoreItemPrice"},{name:"vendor",fkMap:[{fk:"vendorID",relatedKey:"contactID"}],relatedName:"Contact"},{name:"source",fkMap:[{fk:"sourceID",relatedKey:"lineItemID"}],relatedName:"StoreJournalLineItem"},{name:"relatedItems",isCollection:true,isInverse:true,relatedName:"StoreJournalLineItem"},{name:"entries",isCollection:true,isInverse:true,relatedName:"StoreJournalEntry"}]}));modelEntitySchemas["StoreJournalLineItem"]=StoreJournalLineItem;_export("StoreItemTax",StoreItemTax=new Model("StoreItemTax",["storeItemID","taxItemID"],{inclusive:false,print:false},{name:"store_item_taxes",keys:[{name:"storeItemID",type:"number",dataType:"BigInt"},{name:"taxItemID",type:"number",dataType:"BigInt"}],properties:[{name:"inclusive",type:"boolean",dataType:"Boolean",default:["inclusive","false"]},{name:"print",type:"boolean",dataType:"Boolean",default:["print","false"]}],relations:[{name:"storeItem",fkMap:[{fk:"storeItemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"taxItem",fkMap:[{fk:"taxItemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"}]}));modelEntitySchemas["StoreItemTax"]=StoreItemTax;_export("StoreTag",StoreTag=new Model("StoreTag",["storeID","tagID"],{count:0},{name:"store_tags",keys:[{name:"storeID",type:"number",dataType:"BigInt"},{name:"tagID",type:"number",dataType:"BigInt"}],properties:[{name:"count",type:"number",dataType:"Int",default:["count","0"]}],relations:[{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"},{name:"tag",fkMap:[{fk:"tagID",relatedKey:"tagID"}],relatedName:"Tag"}],queries:{storeQuery:"external"}}));modelEntitySchemas["StoreTag"]=StoreTag;_export("StoreItemTag",StoreItemTag=new Model("StoreItemTag",["storeItemID","tagID"],{sortOrder:0},{name:"store_item_tags",keys:[{name:"storeItemID",type:"number",dataType:"BigInt"},{name:"tagID",type:"number",dataType:"BigInt"}],properties:[{name:"sortOrder",type:"number",dataType:"Int",default:["sortOrder","0"]},{name:"tagValue",type:"string",dataType:"Char",default:["tagValue",'""']}],relations:[{name:"storeItem",fkMap:[{fk:"storeItemID",relatedKey:"storeItemID"}],relatedName:"StoreItem"},{name:"tag",fkMap:[{fk:"tagID",relatedKey:"tagID"}],relatedName:"Tag"}]}));modelEntitySchemas["StoreItemTag"]=StoreItemTag;_export("UserStatusArray",UserStatusArray=[{label:"active",value:"active"},{label:"blocked",value:"blocked"},{label:"locked",value:"locked"},{label:"change-password",value:"change-password"},{label:"external",value:"external"}]);_export("User",User=new Model("User",["userID"],{userName:"",displayName:"",status:"active",isExternal:false,multiFactor:false,dateUpdated:new DefaultFactory((()=>new DateTime)),storage:0,maxStorage:0,maxWebSites:0,maxExternalInboxes:0,maxChildUsers:0},{name:"users",keys:[{name:"userID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"userName",type:"string",dataType:"Char",length:200,default:["userName",'""']},{name:"displayName",type:"string",dataType:"Char",length:200,default:["displayName",'""']},{name:"passwordHash",type:"string",dataType:"Char",default:["passwordHash",'""']},{name:"passwordSalt",type:"string",dataType:"Char",length:20,default:["passwordSalt",'""']},{name:"status",type:"string",dataType:"AsciiChar",length:15,default:["status",'"active"']},{name:"isExternal",type:"boolean",dataType:"Boolean",default:["isExternal","false"]},{name:"multiFactor",type:"boolean",dataType:"Boolean",default:["multiFactor","false"]},{name:"dateUpdated",type:"DateTime",dataType:"DateTimeOffset",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"storage",type:"number",dataType:"BigInt",default:["storage","0"]},{name:"maxStorage",type:"number",dataType:"BigInt",default:["maxStorage","0"]},{name:"maxWebSites",type:"number",dataType:"BigInt",default:["maxWebSites","0"]},{name:"maxExternalInboxes",type:"number",dataType:"BigInt",default:["maxExternalInboxes","0"]},{name:"maxChildUsers",type:"number",dataType:"BigInt",default:["maxChildUsers","0"]},{name:"parentID",type:"number",dataType:"BigInt"}],relations:[{name:"parent",fkMap:[{fk:"parentID",relatedKey:"userID"}],relatedName:"User"},{name:"children",isCollection:true,isInverse:true,relatedName:"User"},{name:"createdFiles",isCollection:true,isInverse:true,relatedName:"AppFile"},{name:"sentEmails",isCollection:true,isInverse:true,relatedName:"Email"},{name:"accessTokens",isCollection:true,isInverse:true,relatedName:"AccessToken"},{name:"versions",isCollection:true,isInverse:true,relatedName:"AppFileVersion"},{name:"sessions",isCollection:true,isInverse:true,relatedName:"LoginSession"},{name:"fileAccessList",isCollection:true,isInverse:true,relatedName:"AppFileAccess"},{name:"contacts",isCollection:true,isInverse:true,relatedName:"Contact"},{name:"domainUsers",isCollection:true,isInverse:true,relatedName:"DomainUser"},{name:"hostedZones",isCollection:true,isInverse:true,relatedName:"HostedZoneUser"},{name:"stores",isCollection:true,isInverse:true,relatedName:"StoreUser"},{name:"pins",isCollection:true,isInverse:true,relatedName:"UserPin"},{name:"userPushSubscriptions",isCollection:true,isInverse:true,relatedName:"UserPushSubscription"},{name:"roles",isCollection:true,isInverse:true,relatedName:"UserRole"},{name:"userMailboxes",isCollection:true,isInverse:true,relatedName:"UserMailbox"},{name:"authFactors",isCollection:true,isInverse:true,relatedName:"UserAuthFactor"},{name:"publishedWebSiteVersions",isCollection:true,isInverse:true,relatedName:"WebSiteFolderVersion"}]}));modelEntitySchemas["User"]=User;_export("UserPin",UserPin=new Model("UserPin",["pinID"],{},{name:"user_pins",keys:[{name:"pinID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"userID",type:"number",dataType:"BigInt"},{name:"appFileID",type:"number",dataType:"BigInt"},{name:"mailboxID",type:"number",dataType:"BigInt"}],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"file",fkMap:[{fk:"appFileID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"}]}));modelEntitySchemas["UserPin"]=UserPin;_export("UserPushSubscription",UserPushSubscription=new Model("UserPushSubscription",["subscriptionID"],{notify:false},{name:"user_push_subscriptions",keys:[{name:"subscriptionID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"userID",type:"number",dataType:"BigInt"},{name:"mailboxID",type:"number",dataType:"BigInt",default:["mailboxID","0"]},{name:"emailAddressID",type:"number",dataType:"BigInt",default:["emailAddressID","0"]},{name:"notify",type:"boolean",dataType:"Boolean",default:["notify","false"]}],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"}]}));modelEntitySchemas["UserPushSubscription"]=UserPushSubscription;_export("UserRole",UserRole=new Model("UserRole",["userID","roleName"],{},{name:"user_roles",keys:[{name:"userID",type:"number",dataType:"BigInt"},{name:"roleName",type:"string",dataType:"Char",length:200}],properties:[],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"role",fkMap:[{fk:"roleName",relatedKey:"roleName"}],relatedName:"AppRole"}]}));modelEntitySchemas["UserRole"]=UserRole;_export("UserMailbox",UserMailbox=new Model("UserMailbox",["userID","mailboxID"],{},{name:"user_mailboxes",keys:[{name:"userID",type:"number",dataType:"BigInt"},{name:"mailboxID",type:"number",dataType:"BigInt"}],properties:[],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"mailbox",fkMap:[{fk:"mailboxID",relatedKey:"mailboxID"}],relatedName:"Mailbox"}]}));modelEntitySchemas["UserMailbox"]=UserMailbox;_export("UserAuthFactorMethodArray",UserAuthFactorMethodArray=[{label:"totp",value:"totp"},{label:"hotp",value:"hotp"},{label:"fido2",value:"fido2"},{label:"one-time",value:"one-time"},{label:"otp",value:"otp"},{label:"otp-in",value:"otp-in"}]);_export("UserAuthFactor",UserAuthFactor=new Model("UserAuthFactor",["authFactorID"],{method:"totp",verified:false,dateUpdated:new DefaultFactory((()=>new DateTime))},{name:"user_auth_factor",keys:[{name:"authFactorID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"userID",type:"number",dataType:"BigInt"},{name:"method",type:"string",dataType:"Char",length:10,default:["method",'"totp"']},{name:"secret",type:"string",dataType:"Char",default:["secret",'""']},{name:"hint",type:"string",dataType:"Char",length:100,default:["hint",'""']},{name:"phoneNumber",type:"string",dataType:"Char",length:20,default:["phoneNumber",'""']},{name:"isdCode",type:"string",dataType:"Char",length:20,default:["isdCode",'""']},{name:"verificationID",type:"number",dataType:"BigInt"},{name:"verified",type:"boolean",dataType:"Boolean",default:["verified","false"]},{name:"dateUpdated",type:"DateTime",dataType:"DateTimeOffset",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]}],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"verificationToken",fkMap:[{fk:"verificationID",relatedKey:"verificationID"}],relatedName:"VerificationToken"}]}));modelEntitySchemas["UserAuthFactor"]=UserAuthFactor;_export("WebSiteFolder",WebSiteFolder=new Model("WebSiteFolder",["folderID"],{isStatic:false,isTemplate:false,isModified:false,snapshotStorage:0},{name:"web_site_folders",keys:[{name:"folderID",type:"number",dataType:"BigInt"}],properties:[{name:"currentVersionID",type:"number",dataType:"BigInt"},{name:"isStatic",type:"boolean",dataType:"Boolean",default:["isStatic","false"]},{name:"isTemplate",type:"boolean",dataType:"Boolean",default:["isTemplate","false"]},{name:"isModified",type:"boolean",dataType:"Boolean",default:["isModified","false"]},{name:"snapshotStorage",type:"number",dataType:"BigInt",default:["snapshotStorage","0"]},{name:"supportEmail",type:"string",dataType:"Char",length:200,default:["supportEmail",'""']},{name:"fromEmail",type:"string",dataType:"Char",length:200,default:["fromEmail",'""']}],relations:[{name:"folder",fkMap:[{fk:"folderID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"currentVersion",fkMap:[{fk:"currentVersionID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"activities",isCollection:true,isInverse:true,relatedName:"ServerActivity"},{name:"hosts",isCollection:true,isInverse:true,relatedName:"WebSiteFolderHost"},{name:"versions",isCollection:true,isInverse:true,relatedName:"WebSiteFolderVersion"},{name:"channels",isCollection:true,isInverse:true,relatedName:"WebSiteChannel"},{name:"websiteStores",isCollection:true,isInverse:true,relatedName:"WebSiteStore"}],queries:{templates:"external"}}));modelEntitySchemas["WebSiteFolder"]=WebSiteFolder;_export("WebSiteFolderHost",WebSiteFolderHost=new Model("WebSiteFolderHost",["host"],{},{name:"web_site_folder_host",keys:[{name:"host",type:"string",dataType:"Char",length:200}],properties:[{name:"folderID",type:"number",dataType:"BigInt"}],relations:[{name:"folder",fkMap:[{fk:"folderID",relatedKey:"folderID"}],relatedName:"WebSiteFolder"}]}));modelEntitySchemas["WebSiteFolderHost"]=WebSiteFolderHost;_export("WebSiteFolderVersion",WebSiteFolderVersion=new Model("WebSiteFolderVersion",["folderID","snapshotFolderID"],{dateCreated:new DefaultFactory((()=>new DateTime)),name:""},{name:"web_site_folder_version",keys:[{name:"folderID",type:"number",dataType:"BigInt"},{name:"snapshotFolderID",type:"number",dataType:"BigInt"}],properties:[{name:"dateCreated",type:"DateTime",dataType:"DateTime",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"name",type:"string",dataType:"Char",length:200,default:["name",'""']},{name:"description",type:"string",dataType:"Char",default:["description",'""']},{name:"authorID",type:"number",dataType:"BigInt"}],relations:[{name:"websiteFolder",fkMap:[{fk:"folderID",relatedKey:"folderID"}],relatedName:"WebSiteFolder"},{name:"snapshotFolder",fkMap:[{fk:"snapshotFolderID",relatedKey:"appFileID"}],relatedName:"AppFile"},{name:"author",fkMap:[{fk:"authorID",relatedKey:"userID"}],relatedName:"User"}]}));modelEntitySchemas["WebSiteFolderVersion"]=WebSiteFolderVersion;_export("WebSiteChannel",WebSiteChannel=new Model("WebSiteChannel",["folderID","channelID"],{},{name:"web_site_channels",keys:[{name:"folderID",type:"number",dataType:"BigInt"},{name:"channelID",type:"number",dataType:"BigInt"}],properties:[],relations:[{name:"website",fkMap:[{fk:"folderID",relatedKey:"folderID"}],relatedName:"WebSiteFolder"},{name:"channel",fkMap:[{fk:"channelID",relatedKey:"mailboxID"}],relatedName:"Mailbox"}]}));modelEntitySchemas["WebSiteChannel"]=WebSiteChannel;_export("WebSiteStore",WebSiteStore=new Model("WebSiteStore",["folderID","storeID"],{},{name:"web_site_stores",keys:[{name:"folderID",type:"number",dataType:"BigInt"},{name:"storeID",type:"number",dataType:"BigInt"}],properties:[],relations:[{name:"website",fkMap:[{fk:"folderID",relatedKey:"folderID"}],relatedName:"WebSiteFolder"},{name:"store",fkMap:[{fk:"storeID",relatedKey:"storeID"}],relatedName:"Store"}]}));modelEntitySchemas["WebSiteStore"]=WebSiteStore;_export("LoginSession",LoginSession=new Model("LoginSession",["sessionID"],{invalid:false,dateUpdated:new DefaultFactory((()=>new DateTime))},{name:"login_sessions",keys:[{name:"sessionID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"userID",type:"number",dataType:"BigInt"},{name:"start",type:"DateTime",dataType:"DateTimeOffset",default:["start","new DefaultFactory(() => new Date())"]},{name:"expiry",type:"DateTime",dataType:"DateTimeOffset",default:["expiry","new DefaultFactory(() => new Date())"]},{name:"invalid",type:"boolean",dataType:"Boolean",default:["invalid","false"]},{name:"dateUpdated",type:"DateTime",dataType:"DateTimeOffset",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"status",type:"string",dataType:"AsciiChar",length:20,default:["status",'""']},{name:"deviceToken",type:"string",dataType:"AsciiChar",default:["deviceToken",'""']},{name:"deviceTokenType",type:"string",dataType:"AsciiChar",length:50,default:["deviceTokenType",'""']},{name:"verificationID",type:"number",dataType:"BigInt"}],relations:[{name:"user",fkMap:[{fk:"userID",relatedKey:"userID"}],relatedName:"User"},{name:"verificationToken",fkMap:[{fk:"verificationID",relatedKey:"verificationID"}],relatedName:"VerificationToken"},{name:"versions",isCollection:true,isInverse:true,relatedName:"AppFileVersion"}],queries:{currentUser:"external"}}));modelEntitySchemas["LoginSession"]=LoginSession;_export("TextDocument",TextDocument=new Model("TextDocument",["textDocumentID"],{searchable:""},{name:"text_documents",keys:[{name:"textDocumentID",type:"number",dataType:"BigInt"}],properties:[{name:"searchable",type:"string",dataType:"Char",default:["searchable",'""']}],relations:[{name:"fileContent",isCollection:false,isInverse:true,relatedName:"FileContent"}]}));modelEntitySchemas["TextDocument"]=TextDocument;_export("IncomingSmsSource",IncomingSmsSource=new Model("IncomingSmsSource",["textInSourceID"],{name:"",isdPrefix:"",phoneNumber:"",dateUpdated:new DefaultFactory((()=>new DateTime)),countryCode:""},{name:"incoming_sms_source",keys:[{name:"textInSourceID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"name",type:"string",dataType:"Char",length:100,default:["name",'""']},{name:"username",type:"string",dataType:"Char",default:["username",'""']},{name:"encryptedPassword",type:"string",dataType:"Char",default:["encryptedPassword",'""']},{name:"isdPrefix",type:"string",dataType:"Char",default:["isdPrefix",'""']},{name:"keyword",type:"string",dataType:"Char",default:["keyword",'""']},{name:"phoneNumber",type:"string",dataType:"Char",default:["phoneNumber",'""']},{name:"dateUpdated",type:"DateTime",dataType:"DateTime",default:["dateUpdated","new DefaultFactory(() => new DateTime())"]},{name:"countryCode",type:"string",dataType:"Char",length:20,default:["countryCode",'""']}],relations:[]}));modelEntitySchemas["IncomingSmsSource"]=IncomingSmsSource;_export("VerificationTokenTypeArray",VerificationTokenTypeArray=[{label:"email",value:"email"},{label:"sms",value:"sms"},{label:"captcha",value:"captcha"},{label:"totp",value:"totp"}]);_export("VerificationToken",VerificationToken=new Model("VerificationToken",["verificationID"],{dateCreated:new DefaultFactory((()=>new DateTime)),expiry:new DefaultFactory((()=>new DateTime)),verified:false,accessCode:"",type:"email"},{name:"verification_tokens",keys:[{name:"verificationID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"externalID",type:"string",dataType:"Char",length:200,default:["externalID",'""']},{name:"dateCreated",type:"DateTime",dataType:"DateTimeOffset",default:["dateCreated","new DefaultFactory(() => new DateTime())"]},{name:"expiry",type:"DateTime",dataType:"DateTimeOffset",default:["expiry","new DefaultFactory(() => new DateTime())"]},{name:"verified",type:"boolean",dataType:"Boolean",default:["verified","false"]},{name:"code",type:"string",dataType:"Char",length:20,default:["code",'""']},{name:"accessCode",type:"string",dataType:"Char",length:50,default:["accessCode",'""']},{name:"ipAddress",type:"string",dataType:"Char",length:50,default:["ipAddress",'""']},{name:"externalConfig",type:"string",dataType:"Char",default:["externalConfig",'""']},{name:"type",type:"string",dataType:"AsciiChar",length:50,default:["type",'"email"']}],relations:[{name:"loginSessions",isCollection:true,isInverse:true,relatedName:"LoginSession"},{name:"authFactors",isCollection:true,isInverse:true,relatedName:"UserAuthFactor"},{name:"addresses",isCollection:true,isInverse:true,relatedName:"VerificationTokenAddress"}],queries:{get:"external"},actions:{resendCode:"external",verifyCode:"external"}}));modelEntitySchemas["VerificationToken"]=VerificationToken;_export("VerificationTokenAddress",VerificationTokenAddress=new Model("VerificationTokenAddress",["verificationID","address"],{},{name:"verification_token_addresses",keys:[{name:"verificationID",type:"number",dataType:"BigInt"},{name:"address",type:"string",dataType:"Char",length:200}],properties:[],relations:[{name:"verificationToken",fkMap:[{fk:"verificationID",relatedKey:"verificationID"}],relatedName:"VerificationToken"}]}));modelEntitySchemas["VerificationTokenAddress"]=VerificationTokenAddress;_export("Tag",Tag=new Model("Tag",["tagID"],{name:"",label:"",isSystemTag:false},{name:"tags",keys:[{name:"tagID",type:"number",generated:"identity",dataType:"BigInt"}],properties:[{name:"name",type:"string",dataType:"Char",length:200,default:["name",'""']},{name:"label",type:"string",dataType:"Char",length:200,default:["label",'""']},{name:"lowerCaseName",type:"string",generated:"computed",dataType:"Char",length:200},{name:"path",type:"string",dataType:"AsciiChar",length:400,default:["path",'""']},{name:"isSystemTag",type:"boolean",dataType:"Boolean",default:["isSystemTag","false"]},{name:"contentTypes",type:"string",dataType:"Char",default:["contentTypes",'""']},{name:"parentID",type:"number",dataType:"BigInt"}],relations:[{name:"parent",fkMap:[{fk:"parentID",relatedKey:"tagID"}],relatedName:"Tag"},{name:"children",isCollection:true,isInverse:true,relatedName:"Tag"},{name:"fileTags",isCollection:true,isInverse:true,relatedName:"AppFileTag"},{name:"emailTags",isCollection:true,isInverse:true,relatedName:"EmailTag"},{name:"mailboxFolders",isCollection:true,isInverse:true,relatedName:"MailboxFolder"},{name:"mailboxContactTags",isCollection:true,isInverse:true,relatedName:"MailboxContactTag"},{name:"storeItemFolderTags",isCollection:true,isInverse:true,relatedName:"StoreItemFolderTag"},{name:"storeTags",isCollection:true,isInverse:true,relatedName:"StoreTag"},{name:"storeItemTags",isCollection:true,isInverse:true,relatedName:"StoreItemTag"}]}));modelEntitySchemas["Tag"]=Tag;fixRelatedSchemas=schema=>{for(const key in schema){if(Object.prototype.hasOwnProperty.call(schema,key)){const element=schema[key];if(!element.name){continue}const{relations}=element.schema;if(!relations){continue}for(const iterator of relations){iterator.relatedModel=schema[iterator.relatedName]}}}};fixRelatedSchemas(modelEntitySchemas)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/model/model");System.register([],(function(_export,_context){"use strict";var SocialMailApp,_a,socialMail;_export("default",void 0);return{setters:[],execute:function(){socialMail=(_a=window.socialMail)!==null&&_a!==void 0?_a:{path:"/",name:"Social Mail"};_export("default",SocialMailApp=class SocialMailApp{});SocialMailApp.config=socialMail}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/SocialMailApp");System.register(["tslib","@web-atoms/core/dist/di/DISingleton","@web-atoms/core/dist/di/Inject","./EntityService","../model/model","../common/SocialMailApp","@web-atoms/core/dist/App","@web-atoms/core/dist/core/sleep","@web-atoms/date-time/dist/DateTime"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,DISingleton,Inject,EntityService,LoginSession,SocialMailApp,App,sleep,DateTime,LoginService;return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsCoreDistDiDISingleton){DISingleton=_webAtomsCoreDistDiDISingleton.default},function(_webAtomsCoreDistDiInject){Inject=_webAtomsCoreDistDiInject.Inject},function(_EntityService){EntityService=_EntityService.default},function(_modelModel){LoginSession=_modelModel.LoginSession},function(_commonSocialMailApp){SocialMailApp=_commonSocialMailApp.default},function(_webAtomsCoreDistApp){App=_webAtomsCoreDistApp.App},function(_webAtomsCoreDistCoreSleep){sleep=_webAtomsCoreDistCoreSleep.default},function(_webAtomsDateTimeDistDateTime){DateTime=_webAtomsDateTimeDistDateTime.default}],execute:function(){LoginService=class LoginService{getUser(){var _a,_b,_c;return __awaiter(this,void 0,void 0,(function*(){(_a=this.user)!==null&&_a!==void 0?_a:this.user=(_b=yield this.entityService.query(LoginSession,"currentUser").firstOrDefault())===null||_b===void 0?void 0:_b.user;SocialMailApp.user=this.user;if((_c=this.user)===null||_c===void 0?void 0:_c.userID){}return this.user}))}login(session,cancelToken){return __awaiter(this,void 0,void 0,(function*(){const result=yield this.entityService.save(session);if(session.invalid){if(session.verificationToken){this.checkSession(session,cancelToken).catch(console.error)}return session.status}location.reload()}))}checkSession(session,cancelToken){return __awaiter(this,void 0,void 0,(function*(){do{yield sleep(5e3);session.dateUpdated=DateTime.now;yield this.entityService.save(session);if(!session.invalid){location.reload()}}while(!(cancelToken===null||cancelToken===void 0?void 0:cancelToken.cancelled))}))}updateRegistration(s){return __awaiter(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}logout(){return __awaiter(this,void 0,void 0,(function*(){const session=yield this.entityService.query(LoginSession,"currentUser").firstOrDefault();session.invalid=true;const cloner=this.entityService.cloner(session);yield this.entityService.save(cloner.copy);yield sleep(1e3);location.reload()}))}enforceLogin(){return __awaiter(this,void 0,void 0,(function*(){const user=yield this.getUser();if(user===null||user===void 0?void 0:user.userID){return}}))}};__decorate([Inject,__metadata("design:type",EntityService)],LoginService.prototype,"entityService",void 0);__decorate([Inject,__metadata("design:type",App)],LoginService.prototype,"app",void 0);LoginService=__decorate([DISingleton()],LoginService);_export("default",LoginService)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/LoginService");System.register([],(function(_export,_context){"use strict";function InjectProperty(target,key){Object.defineProperty(target,key,{get:function(){const plist=Reflect.getMetadata("design:type",target,key);const result=this.app.resolve(plist);Object.defineProperty(this,key,{get:()=>result});return result},configurable:true})}_export("default",InjectProperty);return{setters:[],execute:function(){}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/InjectProperty");System.register(["@web-atoms/web-controls/dist/mobile-app/MobileApp"],(function(_export,_context){"use strict";var ContentPage,AdminHome;_export("default",void 0);return{setters:[function(_webAtomsWebControlsDistMobileAppMobileApp){ContentPage=_webAtomsWebControlsDistMobileAppMobileApp.ContentPage}],execute:function(){_export("default",AdminHome=class AdminHome extends ContentPage{})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/admin/pages/home/AdminHome");System.register([],(function(_export,_context){"use strict";var ColorItem,Colors;function toFixedString(t){return("0"+t.toString(16)).slice(-2)}_export({ColorItem:void 0,default:void 0});return{setters:[],execute:function(){_export("ColorItem",ColorItem=class ColorItem{constructor(colorCodeOrRed,namedColorOrGreen,blue,alpha){if(typeof colorCodeOrRed==="string"){this.colorCode=colorCodeOrRed;if(typeof namedColorOrGreen==="string"){this.namedColor=namedColorOrGreen}const r=ColorItem.parseRgb(this.colorCode);this.red=r.red;this.green=r.green;this.blue=r.blue;this.alpha=r.alpha}else{this.red=colorCodeOrRed;if(typeof namedColorOrGreen==="number"){this.green=namedColorOrGreen}this.blue=blue;this.alpha=alpha;this.colorCode=ColorItem.rgb(this.red,this.green,this.blue,this.alpha)}}toString(){return this.colorCode}withAlphaPercent(a){return new ColorItem(this.red,this.green,this.blue,a)}static parseRgb(rgba){if(/^\#/.test(rgba)){rgba=rgba.substr(1);if(rgba.length===3){rgba=rgba.split("").map((x=>x+x)).join("")}const red=Number.parseInt(rgba[0]+rgba[1],16);const green=Number.parseInt(rgba[2]+rgba[3],16);const blue=Number.parseInt(rgba[4]+rgba[5],16);if(rgba.length>6){const alpha=Number.parseInt(rgba[6]+rgba[7],16);return{red,green,blue,alpha}}return{red,green,blue}}if(/^rgba/i.test(rgba)){rgba=rgba.substr(5);rgba=rgba.substr(0,rgba.length-1);const a=rgba.split(",").map(((x,i)=>i===3?Number.parseFloat(x):Number.parseInt(x,10)));return{red:a[0],green:a[1],blue:a[2],alpha:a[3]}}if(/^rgb/i.test(rgba)){rgba=rgba.substr(4);rgba=rgba.substr(0,rgba.length-1);const a=rgba.split(",").map((x=>Number.parseInt(x,10)));return{red:a[0],green:a[1],blue:a[2]}}throw new Error("Unknown color format "+rgba)}static rgb(r,g,b,a){if(a!==undefined){return`rgba(${r},${g},${b},${a})`}return"#"+toFixedString(r)+toFixedString(g)+toFixedString(b)}});_export("default",Colors=class Colors{static rgba(red,green,blue,alpha){return new ColorItem(red,green,blue,alpha)}static parse(color){if(!color){return null}color=color.toLowerCase();for(const key in Colors){if(Colors.hasOwnProperty(key)){const element=Colors[key];if(element instanceof ColorItem){const ci=element;if(ci.namedColor===color){return ci}}}}if(/^(\#|rgb\(|rgba\()/i.test(color)){return new ColorItem(color)}throw new Error("Invalid color format "+color)}});Colors.black=new ColorItem("#000000","black");Colors.silver=new ColorItem("#c0c0c0","silver");Colors.gray=new ColorItem("#808080","gray");Colors.white=new ColorItem("#ffffff","white");Colors.maroon=new ColorItem("#800000","maroon");Colors.red=new ColorItem("#ff0000","red");Colors.purple=new ColorItem("#800080","purple");Colors.fuchsia=new ColorItem("#ff00ff","fuchsia");Colors.green=new ColorItem("#008000","green");Colors.lime=new ColorItem("#00ff00","lime");Colors.olive=new ColorItem("#808000","olive");Colors.yellow=new ColorItem("#ffff00","yellow");Colors.navy=new ColorItem("#000080","navy");Colors.blue=new ColorItem("#0000ff","blue");Colors.teal=new ColorItem("#008080","teal");Colors.aqua=new ColorItem("#00ffff","aqua");Colors.orange=new ColorItem("#ffa500","orange");Colors.aliceBlue=new ColorItem("#f0f8ff","aliceblue");Colors.antiqueWhite=new ColorItem("#faebd7","antiquewhite");Colors.aquaMarine=new ColorItem("#7fffd4","aquamarine");Colors.azure=new ColorItem("#f0ffff","azure");Colors.beige=new ColorItem("#f5f5dc","beige");Colors.bisque=new ColorItem("#ffe4c4","bisque");Colors.blanchedAlmond=new ColorItem("#ffebcd","blanchedalmond");Colors.blueViolet=new ColorItem("#8a2be2","blueviolet");Colors.brown=new ColorItem("#a52a2a","brown");Colors.burlyWood=new ColorItem("#deb887","burlywood");Colors.cadetBlue=new ColorItem("#5f9ea0","cadetblue");Colors.chartReuse=new ColorItem("#7fff00","chartreuse");Colors.chocolate=new ColorItem("#d2691e","chocolate");Colors.coral=new ColorItem("#ff7f50","coral");Colors.cornFlowerBlue=new ColorItem("#6495ed","cornflowerblue");Colors.cornSilk=new ColorItem("#fff8dc","cornsilk");Colors.crimson=new ColorItem("#dc143c","crimson");Colors.cyan=new ColorItem("#00ffff","cyan");Colors.darkBlue=new ColorItem("#00008b","darkblue");Colors.darkCyan=new ColorItem("#008b8b","darkcyan");Colors.darkGoldenRod=new ColorItem("#b8860b","darkgoldenrod");Colors.darkGray=new ColorItem("#a9a9a9","darkgray");Colors.darkGreen=new ColorItem("#006400","darkgreen");Colors.darkGrey=new ColorItem("#a9a9a9","darkgrey");Colors.darkKhaki=new ColorItem("#bdb76b","darkkhaki");Colors.darkMagenta=new ColorItem("#8b008b","darkmagenta");Colors.darkOliveGreen=new ColorItem("#556b2f","darkolivegreen");Colors.darkOrange=new ColorItem("#ff8c00","darkorange");Colors.darkOrchid=new ColorItem("#9932cc","darkorchid");Colors.darkRed=new ColorItem("#8b0000","darkred");Colors.darkSalmon=new ColorItem("#e9967a","darksalmon");Colors.darkSeaGreen=new ColorItem("#8fbc8f","darkseagreen");Colors.darkSlateBlue=new ColorItem("#483d8b","darkslateblue");Colors.darkSlateGray=new ColorItem("#2f4f4f","darkslategray");Colors.darkSlateGrey=new ColorItem("#2f4f4f","darkslategrey");Colors.darkTurquoise=new ColorItem("#00ced1","darkturquoise");Colors.darkViolet=new ColorItem("#9400d3","darkviolet");Colors.deepPink=new ColorItem("#ff1493","deeppink");Colors.deepSkyBlue=new ColorItem("#00bfff","deepskyblue");Colors.dimGray=new ColorItem("#696969","dimgray");Colors.dimGrey=new ColorItem("#696969","dimgrey");Colors.dodgerBlue=new ColorItem("#1e90ff","dodgerblue");Colors.fireBrick=new ColorItem("#b22222","firebrick");Colors.floralWhite=new ColorItem("#fffaf0","floralwhite");Colors.forestGreen=new ColorItem("#228b22","forestgreen");Colors.gainsboro=new ColorItem("#dcdcdc","gainsboro");Colors.ghostWhite=new ColorItem("#f8f8ff","ghostwhite");Colors.gold=new ColorItem("#ffd700","gold");Colors.goldenRod=new ColorItem("#daa520","goldenrod");Colors.greenYellow=new ColorItem("#adff2f","greenyellow");Colors.grey=new ColorItem("#808080","grey");Colors.honeyDew=new ColorItem("#f0fff0","honeydew");Colors.hotPink=new ColorItem("#ff69b4","hotpink");Colors.indianRed=new ColorItem("#cd5c5c","indianred");Colors.indigo=new ColorItem("#4b0082","indigo");Colors.ivory=new ColorItem("#fffff0","ivory");Colors.khaki=new ColorItem("#f0e68c","khaki");Colors.lavender=new ColorItem("#e6e6fa","lavender");Colors.lavenderBlush=new ColorItem("#fff0f5","lavenderblush");Colors.lawnGreen=new ColorItem("#7cfc00","lawngreen");Colors.lemonChiffon=new ColorItem("#fffacd","lemonchiffon");Colors.lightBlue=new ColorItem("#add8e6","lightblue");Colors.lightCoral=new ColorItem("#f08080","lightcoral");Colors.lightCyan=new ColorItem("#e0ffff","lightcyan");Colors.lightGoldenRodYellow=new ColorItem("#fafad2","lightgoldenrodyellow");Colors.lightGray=new ColorItem("#d3d3d3","lightgray");Colors.lightGreen=new ColorItem("#90ee90","lightgreen");Colors.lightGrey=new ColorItem("#d3d3d3","lightgrey");Colors.lightPink=new ColorItem("#ffb6c1","lightpink");Colors.lightSalmon=new ColorItem("#ffa07a","lightsalmon");Colors.lightSeaGreen=new ColorItem("#20b2aa","lightseagreen");Colors.lightSkyBlue=new ColorItem("#87cefa","lightskyblue");Colors.lightSlateGray=new ColorItem("#778899","lightslategray");Colors.lightSlateGrey=new ColorItem("#778899","lightslategrey");Colors.lightSteelBlue=new ColorItem("#b0c4de","lightsteelblue");Colors.lightYellow=new ColorItem("#ffffe0","lightyellow");Colors.limeGreen=new ColorItem("#32cd32","limegreen");Colors.linen=new ColorItem("#faf0e6","linen");Colors.magenta=new ColorItem("#ff00ff","magenta");Colors.mediumAquaMarine=new ColorItem("#66cdaa","mediumaquamarine");Colors.mediumBlue=new ColorItem("#0000cd","mediumblue");Colors.mediumOrchid=new ColorItem("#ba55d3","mediumorchid");Colors.mediumPurple=new ColorItem("#9370db","mediumpurple");Colors.mediumSeaGreen=new ColorItem("#3cb371","mediumseagreen");Colors.mediumSlateBlue=new ColorItem("#7b68ee","mediumslateblue");Colors.mediumSpringGreen=new ColorItem("#00fa9a","mediumspringgreen");Colors.mediumTurquoise=new ColorItem("#48d1cc","mediumturquoise");Colors.mediumVioletred=new ColorItem("#c71585","mediumvioletred");Colors.midNightBlue=new ColorItem("#191970","midnightblue");Colors.mintCream=new ColorItem("#f5fffa","mintcream");Colors.mistyRose=new ColorItem("#ffe4e1","mistyrose");Colors.moccasin=new ColorItem("#ffe4b5","moccasin");Colors.navajoWhite=new ColorItem("#ffdead","navajowhite");Colors.oldLace=new ColorItem("#fdf5e6","oldlace");Colors.oliveDrab=new ColorItem("#6b8e23","olivedrab");Colors.orangeRed=new ColorItem("#ff4500","orangered");Colors.orchid=new ColorItem("#da70d6","orchid");Colors.paleGoldenRod=new ColorItem("#eee8aa","palegoldenrod");Colors.paleGreen=new ColorItem("#98fb98","palegreen");Colors.paleTurquoise=new ColorItem("#afeeee","paleturquoise");Colors.paleVioletRed=new ColorItem("#db7093","palevioletred");Colors.papayaWhip=new ColorItem("#ffefd5","papayawhip");Colors.peachPuff=new ColorItem("#ffdab9","peachpuff");Colors.peru=new ColorItem("#cd853f","peru");Colors.pink=new ColorItem("#ffc0cb","pink");Colors.plum=new ColorItem("#dda0dd","plum");Colors.powderBlue=new ColorItem("#b0e0e6","powderblue");Colors.rosyBrown=new ColorItem("#bc8f8f","rosybrown");Colors.royalBlue=new ColorItem("#4169e1","royalblue");Colors.saddleBrown=new ColorItem("#8b4513","saddlebrown");Colors.salmon=new ColorItem("#fa8072","salmon");Colors.sandyBrown=new ColorItem("#f4a460","sandybrown");Colors.seaGreen=new ColorItem("#2e8b57","seagreen");Colors.seaShell=new ColorItem("#fff5ee","seashell");Colors.sienna=new ColorItem("#a0522d","sienna");Colors.skyBlue=new ColorItem("#87ceeb","skyblue");Colors.slateBlue=new ColorItem("#6a5acd","slateblue");Colors.slateGray=new ColorItem("#708090","slategray");Colors.slateGrey=new ColorItem("#708090","slategrey");Colors.snow=new ColorItem("#fffafa","snow");Colors.springGreen=new ColorItem("#00ff7f","springgreen");Colors.steelBlue=new ColorItem("#4682b4","steelblue");Colors.tan=new ColorItem("#d2b48c","tan");Colors.thistle=new ColorItem("#d8bfd8","thistle");Colors.tomato=new ColorItem("#ff6347","tomato");Colors.turquoise=new ColorItem("#40e0d0","turquoise");Colors.violet=new ColorItem("#ee82ee","violet");Colors.wheat=new ColorItem("#f5deb3","wheat");Colors.whiteSmoke=new ColorItem("#f5f5f5","whitesmoke");Colors.yellowGreen=new ColorItem("#9acd32","yellowgreen");Colors.rebeccaPurple=new ColorItem("#663399","rebeccapurple");Colors.transparent=new ColorItem("#00000000","transparent")}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/Colors");System.register(["./AtomBinder","./AtomWatcher"],(function(_export,_context){"use strict";var AtomBinder,AtomWatcher;function WatchProperty(target,key,descriptor){const{get}=descriptor;const isSetup=Symbol.for(`isSetup${key}`);return{get:function(){const watcher=new AtomWatcher(this,get,(()=>{AtomBinder.refreshValue(this,key)}),this);watcher.init(false);this.registerDisposable(watcher);this[isSetup]=watcher;Object.defineProperty(this,key,descriptor);return get.apply(this)},configurable:true}}_export("default",WatchProperty);return{setters:[function(_AtomBinder){AtomBinder=_AtomBinder.AtomBinder},function(_AtomWatcher){AtomWatcher=_AtomWatcher.AtomWatcher}],execute:function(){}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/WatchProperty");System.register(["@web-atoms/core/dist/style/styled"],(function(_export,_context){"use strict";var styled;return{setters:[function(_webAtomsCoreDistStyleStyled){styled=_webAtomsCoreDistStyleStyled.default}],execute:function(){styled.css`
700
700
  position: absolute;
701
701
  border-radius: 5px;
702
702
  padding: 5px;
@@ -2061,7 +2061,7 @@ html, body {
2061
2061
  padding-left: 5px;
2062
2062
  margin-left: 0px;
2063
2063
  }
2064
- `.withOrder("medium").installGlobal("*[data-date-field=date-field]")}}}));AmdLoader.instance.setup("@web-atoms/web-controls/dist/basic/styles/date-field-style");System.register(["tslib","@web-atoms/core/dist/core/Bind","@web-atoms/core/dist/core/BindableProperty","@web-atoms/core/dist/core/XNode","@web-atoms/core/dist/web/controls/AtomControl","@web-atoms/date-time/dist/DateTime","./Calendar","./InlinePopup","./TimeEditor","@web-atoms/date-time/dist/TimeSpan","./styles/date-field-style"],(function(_export,_context){"use strict";var __decorate,__metadata,Bind,BindableProperty,XNode,AtomControl,DateTime,Calendar,InlinePopup,InlinePopupButton,TimeEditor,TimeSpan,DateField;function hours(){return[{label:"01",value:1},{label:"02",value:2},{label:"03",value:3},{label:"04",value:4},{label:"05",value:5},{label:"06",value:6},{label:"07",value:7},{label:"08",value:8},{label:"09",value:9},{label:"10",value:10},{label:"11",value:11},{label:"12",value:12}]}function minutes(){const items=[];for(let index=0;index<10;index++){items.push({label:"0"+index,value:index})}for(let index=10;index<60;index++){items.push({label:index.toString(),value:index})}return items}_export("default",void 0);return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsCoreDistCoreBind){Bind=_webAtomsCoreDistCoreBind.default},function(_webAtomsCoreDistCoreBindableProperty){BindableProperty=_webAtomsCoreDistCoreBindableProperty.BindableProperty},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsCoreDistWebControlsAtomControl){AtomControl=_webAtomsCoreDistWebControlsAtomControl.AtomControl},function(_webAtomsDateTimeDistDateTime){DateTime=_webAtomsDateTimeDistDateTime.default},function(_Calendar){Calendar=_Calendar.default},function(_InlinePopup){InlinePopup=_InlinePopup.default;InlinePopupButton=_InlinePopup.InlinePopupButton},function(_TimeEditor){TimeEditor=_TimeEditor.default},function(_webAtomsDateTimeDistTimeSpan){TimeSpan=_webAtomsDateTimeDistTimeSpan.default},function(_stylesDateFieldStyle){}],execute:function(){_export("default",DateField=class DateField extends AtomControl{constructor(app,e=document.createElement("button")){super(app,e)}preCreate(){this.prompt="Select";this.enableTime=false;this.value=null;this.format=(d,showTime)=>showTime?d===null||d===void 0?void 0:d.toLocaleString(navigator.language,{month:"short",year:"numeric",day:"numeric",weekday:"short",hour12:true,hour:"numeric",minute:"2-digit"}):d===null||d===void 0?void 0:d.toLocaleDateString(navigator.language,{month:"short",year:"numeric",day:"numeric",weekday:"short"});const owner=this;class CalendarPopup extends InlinePopup{create(){var _a;this.owner=owner;this.type="AM";const now=DateTime.from((_a=owner.value)!==null&&_a!==void 0?_a:DateTime.today.addHours(owner.hour||0).addMinutes(owner.minute||0));this.time=new TimeSpan(0,now.hour,now.minute);super.create();const yearStart=typeof this.owner.yearStart==="number"?this.owner.yearStart:-10;const yearEnd=typeof this.owner.yearEnd==="number"?this.owner.yearEnd:10;const year=typeof this.owner.year==="number"?this.owner.year:now.year;this.render(XNode.create("div",{class:"calendar-popup"},XNode.create(Calendar,{yearStart,yearEnd,year,"event-item-select":Bind.event(((s,e)=>{if(e.detail.disabled){return}this.save(e.detail.value)})),enableFunc:Bind.oneTime((()=>this.owner.enableFunc)),value:Bind.oneWay((()=>this.owner.value))}),this.owner.enableTime&&XNode.create(TimeEditor,{time:Bind.twoWays((()=>this.time))}),XNode.create("button",{class:"clear",text:"Clear","event-click":e=>{e.preventDefault();e.stopImmediatePropagation();e.stopPropagation();this.save()}}),XNode.create("button",{class:"today",text:"Today","event-click":e=>{e.preventDefault();e.stopImmediatePropagation();e.stopPropagation();this.save(DateTime.today.asJSDate)}})));this.runAfterInit((()=>{if(this.element){this.element.scrollIntoView()}}))}save(d){if(!d){this.owner.value=d;this.close(d);return}let date=DateTime.from(d);if(this.owner.enableTime){date=date.add(this.time)}this.owner.value=date.asJSDate;this.close(date)}}this.render(XNode.create(InlinePopupButton,{"data-layout":"flex","data-date-field":"date-field",text:Bind.oneWay((()=>{var _a;return((_a=this.format)===null||_a===void 0?void 0:_a.call(this,this.value,this.enableTime))||this.prompt}))},XNode.create(CalendarPopup,null)))}});__decorate([BindableProperty,__metadata("design:type",Date)],DateField.prototype,"value",void 0);__decorate([BindableProperty,__metadata("design:type",Function)],DateField.prototype,"enableFunc",void 0);__decorate([BindableProperty,__metadata("design:type",Function)],DateField.prototype,"format",void 0);__decorate([BindableProperty,__metadata("design:type",Object)],DateField.prototype,"yearStart",void 0);__decorate([BindableProperty,__metadata("design:type",Object)],DateField.prototype,"yearEnd",void 0);__decorate([BindableProperty,__metadata("design:type",Number)],DateField.prototype,"year",void 0);__decorate([BindableProperty,__metadata("design:type",Number)],DateField.prototype,"hour",void 0);__decorate([BindableProperty,__metadata("design:type",Number)],DateField.prototype,"minute",void 0);__decorate([BindableProperty,__metadata("design:type",String)],DateField.prototype,"prompt",void 0)}}}));AmdLoader.instance.setup("@web-atoms/web-controls/dist/basic/DateField");System.register(["tslib","@web-atoms/web-controls/dist/mobile-app/MobileApp","../../../../model/model","@web-atoms/core/dist/core/XNode","@web-atoms/web-controls/dist/basic/Form","@web-atoms/web-controls/dist/basic/FormField","@web-atoms/web-controls/dist/basic/Switch","@web-atoms/core/dist/core/Bind","../../../../common/controls/drop-downs/user/UserDropDown","../../../../common/controls/buttons/IconButton","@web-atoms/date-time/dist/DateTime","@web-atoms/web-controls/dist/basic/DateField","@web-atoms/web-controls/dist/basic/Select","@web-atoms/core/dist/view-model/Action","@web-atoms/core/dist/core/InjectProperty","../../../../services/files/FileShareService"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,PopupWindowPage,AppFileAccess,XNode,Form,FormField,Switch,Bind,UserDropDown,SaveIconTextButton,DateTime,DateField,Select,Action,InjectProperty,FileShareService,AddSharePage,rights,externalRights;_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsWebControlsDistMobileAppMobileApp){PopupWindowPage=_webAtomsWebControlsDistMobileAppMobileApp.PopupWindowPage},function(_modelModel){AppFileAccess=_modelModel.AppFileAccess},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsWebControlsDistBasicForm){Form=_webAtomsWebControlsDistBasicForm.default},function(_webAtomsWebControlsDistBasicFormField){FormField=_webAtomsWebControlsDistBasicFormField.default},function(_webAtomsWebControlsDistBasicSwitch){Switch=_webAtomsWebControlsDistBasicSwitch.default},function(_webAtomsCoreDistCoreBind){Bind=_webAtomsCoreDistCoreBind.default},function(_commonControlsDropDownsUserUserDropDown){UserDropDown=_commonControlsDropDownsUserUserDropDown.default},function(_commonControlsButtonsIconButton){SaveIconTextButton=_commonControlsButtonsIconButton.SaveIconTextButton},function(_webAtomsDateTimeDistDateTime){DateTime=_webAtomsDateTimeDistDateTime.default},function(_webAtomsWebControlsDistBasicDateField){DateField=_webAtomsWebControlsDistBasicDateField.default},function(_webAtomsWebControlsDistBasicSelect){Select=_webAtomsWebControlsDistBasicSelect.default},function(_webAtomsCoreDistViewModelAction){Action=_webAtomsCoreDistViewModelAction.default},function(_webAtomsCoreDistCoreInjectProperty){InjectProperty=_webAtomsCoreDistCoreInjectProperty.default},function(_servicesFilesFileShareService){FileShareService=_servicesFilesFileShareService.default}],execute:function(){rights=[{label:"Read",value:"read"},{label:"Write",value:"write"},{label:"Delegate (Read+Write+Share)",value:"delegate"}];externalRights=[{label:"Read",value:"read"},{label:"Write",value:"write"}];_export("default",AddSharePage=class AddSharePage extends PopupWindowPage{constructor(){super(...arguments);this.external=false}init(){return __awaiter(this,void 0,void 0,(function*(){this.title=`Create new Share for ${this.parameters.name}`;const fileID=this.parameters.appFileID;this.model=AppFileAccess.create({fileID,expires:DateTime.today.addMonths(1),type:"read",externalUser:{name:"",emailAddress:""}});this.renderer=XNode.create("div",null,XNode.create(Form,null,XNode.create(FormField,{label:this.parameters.isFolder?"Folder":"File"},XNode.create("div",{text:this.parameters.name})),XNode.create("div",{"data-layout":"row"},XNode.create(Switch,{checked:Bind.twoWaysImmediate((()=>this.external))}),XNode.create("div",{text:"External User"})),XNode.create(FormField,{"style-display":Bind.oneWay((()=>!this.external)),label:"Search User"},XNode.create(UserDropDown,{value:Bind.twoWaysImmediate((()=>this.model.userID))})),XNode.create(FormField,{"style-display":Bind.oneWay((()=>!!this.external)),label:"Name"},XNode.create("input",{value:Bind.twoWaysImmediate((()=>this.model.externalUser.name))})),XNode.create(FormField,{"style-display":Bind.oneWay((()=>!!this.external)),label:"Email Address"},XNode.create("input",{value:Bind.twoWaysImmediate((()=>this.model.externalUser.emailAddress))})),XNode.create(FormField,{label:"Rights"},XNode.create(Select,{labelPath:item=>item.label,valuePath:item=>item.value,items:Bind.oneWay((()=>this.external?externalRights:rights)),value:Bind.twoWaysImmediate((()=>this.model.type))})),XNode.create(FormField,{label:"Expires"},XNode.create(DateField,{value:Bind.twoWaysImmediate((()=>this.model.expires))})),XNode.create("div",{"data-layout":"command-row"},XNode.create(SaveIconTextButton,{"data-submit-event":"save-share",text:"Create"}))))}))}saveShare(){return __awaiter(this,void 0,void 0,(function*(){const model=Object.assign({},this.model);if(!this.external){delete model.externalUser}yield this.fileShareService.save(model);model.file=this.parameters;return model}))}});__decorate([InjectProperty,__metadata("design:type",FileShareService)],AddSharePage.prototype,"fileShareService",void 0);__decorate([Action({onEvent:"save-share",close:true}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],AddSharePage.prototype,"saveShare",null)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/web/page/files/shares/AddSharePage");System.register(["tslib","@web-atoms/web-controls/dist/mobile-app/MobileApp","@web-atoms/core/dist/core/XNode","@web-atoms/web-controls/dist/basic/AtomRepeater","@web-atoms/core/dist/core/InjectProperty","../../../../services/files/FileShareService","../../../../common/controls/buttons/IconButton","@web-atoms/core/dist/view-model/Action","@web-atoms/web-controls/dist/PageNavigator","./AddSharePage","../../../../common/date/DateFormats"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,PopupWindowPage,XNode,AtomRepeater,InjectProperty,FileShareService,AddIconTextButton,Action,PageNavigator,AddSharePage,DateFormats,EditSharesPage;_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsWebControlsDistMobileAppMobileApp){PopupWindowPage=_webAtomsWebControlsDistMobileAppMobileApp.PopupWindowPage},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsWebControlsDistBasicAtomRepeater){AtomRepeater=_webAtomsWebControlsDistBasicAtomRepeater.default},function(_webAtomsCoreDistCoreInjectProperty){InjectProperty=_webAtomsCoreDistCoreInjectProperty.default},function(_servicesFilesFileShareService){FileShareService=_servicesFilesFileShareService.default},function(_commonControlsButtonsIconButton){AddIconTextButton=_commonControlsButtonsIconButton.AddIconTextButton},function(_webAtomsCoreDistViewModelAction){Action=_webAtomsCoreDistViewModelAction.default},function(_webAtomsWebControlsDistPageNavigator){PageNavigator=_webAtomsWebControlsDistPageNavigator.default},function(_AddSharePage){AddSharePage=_AddSharePage.default},function(_commonDateDateFormats){DateFormats=_commonDateDateFormats.DateFormats}],execute:function(){_export("default",EditSharesPage=class EditSharesPage extends PopupWindowPage{init(){var _a;return __awaiter(this,void 0,void 0,(function*(){this.title=`${this.parameters.name} - Share Settings`;this.list=(_a=yield this.shareService.list(this.parameters.appFileID))!==null&&_a!==void 0?_a:[];this.renderer=XNode.create("div",null,XNode.create(AtomRepeater,{items:this.list,itemRenderer:item=>XNode.create("div",{"data-layout":"row"},XNode.create("div",{text:item.user.userName}),XNode.create("div",{text:item.type}),item.expires&&XNode.create("div",{text:DateFormats.relative.short(item.expires)}),item.accessCode?XNode.create("i",{title:"Copy Link",class:"fas fa-link"}):XNode.create("span",null))}),XNode.create("div",null,XNode.create(AddIconTextButton,{"data-click-event":"create-share-link",text:"Create Share Link"})));if(!this.list.length){yield this.createShareLink()}}))}createShareLink(){return __awaiter(this,void 0,void 0,(function*(){const item=yield PageNavigator.pushPageForResult(AddSharePage,this.parameters);this.list.add(item)}))}});__decorate([InjectProperty,__metadata("design:type",FileShareService)],EditSharesPage.prototype,"shareService",void 0);__decorate([Action({onEvent:"create-share-link"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],EditSharesPage.prototype,"createShareLink",null)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/web/page/files/shares/EditSharesPage");System.register([],(function(_export,_context){"use strict";var QueryIterator;_export("default",void 0);return{setters:[],execute:function(){_export("default",QueryIterator=class QueryIterator{static first(source,fx){for(const iterator of source){if(fx(iterator)){return iterator}}}firstOrFail(source,fx){for(const iterator of source){if(fx(iterator)){return iterator}}}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/QueryIterator");System.register([],(function(_export,_context){"use strict";var AttachmentFile;_export("AttachmentFile",void 0);return{setters:[],execute:function(){_export("AttachmentFile",AttachmentFile=class AttachmentFile extends File{constructor(fileBits,fileName,options){super(fileBits,fileName,options);this.contentId=options.contentId;this.disposition=options.disposition}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/AttachmentFile");System.register([],(function(_export,_context){"use strict";function*tokenize(text,sep){let start=0;for(;;){const index=text.indexOf(sep,start);if(index===-1){break}yield text.substring(start,index);start=index+1}yield text.substring(start)}function tokenizeMax(text,sep,max=Number.MAX_SAFE_INTEGER){let start=0;const items=[];max--;for(;;){const index=text.indexOf(sep,start);if(index===-1){break}items.push(text.substring(start,index));start=index+1;if(--max===0){break}}items.push(text.substring(start));return items}_export({tokenize,tokenizeMax});return{setters:[],execute:function(){}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/tokenizer");System.register(["./tokenizer"],(function(_export,_context){"use strict";var tokenize,tokenizeMax,parsePairs;return{setters:[function(_tokenizer){tokenize=_tokenizer.tokenize;tokenizeMax=_tokenizer.tokenizeMax}],execute:function(){_export("parsePairs",parsePairs=(text,emptyName)=>{const pairs={toString(){return text}};for(const iterator of tokenize(text,";")){const trimmed=iterator.trim();if(!trimmed){break}const items=tokenizeMax(trimmed,"=",2).map((x=>x.trim()));let[key,value]=items;if(items.length===1){value=key;key=emptyName!==null&&emptyName!==void 0?emptyName:key}try{if(value.startsWith('"')){value=JSON.parse(value)}}catch(_a){}pairs[key]=value}return pairs})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/parsePairs");System.register(["./parsePairs"],(function(_export,_context){"use strict";var parsePairs,HeaderContentType;_export("HeaderContentType",void 0);return{setters:[function(_parsePairs){parsePairs=_parsePairs.parsePairs}],execute:function(){_export("HeaderContentType",HeaderContentType=class HeaderContentType{constructor(type,charset="UTF-8",boundary){this.type=type;this.charset=charset;this.boundary=boundary}parse(text){const items=parsePairs(text,"type");this.type=items.type;this.charset=items.charset;this.boundary=items.boundary}toString(){if(this.boundary){return`${this.type}; charset="${this.charset}"; boundary="${this.boundary}";`}return`${this.type}; charset="${this.charset}";`}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/HeaderContentType");System.register([],(function(_export,_context){"use strict";var toBuffer,RawBuffer;return{setters:[],execute:function(){toBuffer=text=>{const bytes=new Uint8Array(text.length);for(let index=0;index<text.length;index++){bytes[index]=text.charCodeAt(index)}return bytes.buffer};_export("RawBuffer",RawBuffer={decode:(bytesAsString,encoding="utf-8")=>{if(!encoding){return bytesAsString}const te=new TextDecoder(encoding);return te.decode(toBuffer(bytesAsString))},encode:(text,encoding="utf-8")=>{if(!/utf\-?8/i.test(encoding)){throw new Error(`Encoding ${encoding} not supported`)}const te=new TextEncoder;const array=te.encode(text);const a=[];for(const iterator of array){a.push(String.fromCharCode(iterator))}return a.join("")},toBase64Async(blob,asDataUrl=false){return new Promise(((resolve,reject)=>{const reader=new FileReader;reader.onerror=()=>{reject(reader.error)};reader.onload=()=>{const text=reader.result;if(asDataUrl){resolve(text);return}const index=text.indexOf(",");resolve(text.substring(index+1))};reader.readAsDataURL(blob)}))}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/encoder/RawBuffer");System.register(["./RawBuffer"],(function(_export,_context){"use strict";var RawBuffer,isEncodedRegEx,hexToUnicode,decode,isSimpleText,wordEncoding;return{setters:[function(_RawBuffer){RawBuffer=_RawBuffer.RawBuffer}],execute:function(){isEncodedRegEx=/\=\?([^\?\s]+)\?([^\?\s]{1})\?([^\s\?]+)\?\=\s*/gm;hexToUnicode=/(\=([0-9a-f]{2}))|(\_)/gim;decode=text=>text.replace(isEncodedRegEx,((matched,encoding,format,buffer)=>{if(/b/i.test(format)){return RawBuffer.decode(atob(buffer),encoding)}if(/q/i.test(format)){const replaced=buffer.replace(hexToUnicode,((m,group,code)=>{if(m==="_"){return" "}return String.fromCharCode(parseInt(code,16))}));return RawBuffer.decode(replaced,encoding)}return matched}));isSimpleText=/[0-9a-zA-Z\x20]/;_export("wordEncoding",wordEncoding={decode,encode:(word,ifNeeded=false)=>{if(ifNeeded){if(isSimpleText.test(word)){return word}}word=RawBuffer.encode(word);return`=?UTF-8?B?${btoa(word)}?=`}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/encoder/word-encoding");System.register(["./encoder/word-encoding","./parsePairs"],(function(_export,_context){"use strict";var wordEncoding,parsePairs,HeaderContentDisposition;_export("HeaderContentDisposition",void 0);return{setters:[function(_encoderWordEncoding){wordEncoding=_encoderWordEncoding.wordEncoding},function(_parsePairs){parsePairs=_parsePairs.parsePairs}],execute:function(){_export("HeaderContentDisposition",HeaderContentDisposition=class HeaderContentDisposition{constructor(type,filename,name){this.type=type;this.filename=filename;this.name=name}parse(text){const items=parsePairs(text,"type");this.type=items.type;this.filename=items.filename;this.name=items.name}toString(){return`${this.type};\r\n\t\tfilename="${wordEncoding.encode(this.filename)}";`}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/HeaderContentDisposition");System.register([],(function(_export,_context){"use strict";function base64toBlob(base64Data,contentType){contentType=contentType||"";const sliceSize=1024;const byteCharacters=atob(base64Data);const bytesLength=byteCharacters.length;const slicesCount=Math.ceil(bytesLength/sliceSize);const byteArrays=new Array(slicesCount);for(let sliceIndex=0;sliceIndex<slicesCount;++sliceIndex){const begin=sliceIndex*sliceSize;const end=Math.min(begin+sliceSize,bytesLength);const bytes=new Array(end-begin);for(let offset=begin,i=0;offset<end;++i,++offset){bytes[i]=byteCharacters[offset].charCodeAt(0)}byteArrays[sliceIndex]=new Uint8Array(bytes)}return new Blob(byteArrays,{type:contentType})}_export("base64toBlob",base64toBlob);return{setters:[],execute:function(){}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/encoder/base64-to-blob");System.register([],(function(_export,_context){"use strict";var stringFromCharCode,decode,handleTrailingCharacters,regexUnsafeSymbols,encode,quotedPrintable;return{setters:[],execute:function(){stringFromCharCode=String.fromCharCode;decode=function(input){return input.replace(/[\t\x20]$/gm,"").replace(/=(?:\r\n?|\n|$)/g,"").replace(/=([a-fA-F0-9]{2})/g,(function($0,$1){const codePoint=parseInt($1,16);return stringFromCharCode(codePoint)}))};handleTrailingCharacters=function(text){return text.replace(/\x20$/,"=20").replace(/\t$/,"=09")};regexUnsafeSymbols=/[\0-\x08\n-\x1F=\x7F-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g;encode=function(text){const encoded=text.replace(regexUnsafeSymbols,(function(symbol){if(symbol>"ÿ"){throw RangeError("`quotedPrintable.encode()` expects extended ASCII input only. "+"Don’t forget to encode the input first using a character "+"encoding like UTF-8.")}const codePoint=symbol.charCodeAt(0);const hexadecimal=codePoint.toString(16).toUpperCase();return"="+("0"+hexadecimal).slice(-2)}));const LINE_LENGTH=75;const lines=encoded.split(/\r\n?|\n/g);let lineIndex=-1;const lineCount=lines.length;const result=[];let buffer;while(++lineIndex<lineCount){const line=lines[lineIndex];let index=0;const length=line.length;while(index<length){buffer=encoded.slice(index,index+LINE_LENGTH);if(/=$/.test(buffer)){buffer=buffer.slice(0,LINE_LENGTH-1);index+=LINE_LENGTH-1}else if(/=[A-F0-9]$/.test(buffer)){buffer=buffer.slice(0,LINE_LENGTH-2);index+=LINE_LENGTH-2}else{index+=LINE_LENGTH}result.push(buffer)}}const lastLineLength=buffer.length;if(/[\t\x20]$/.test(buffer)){result.pop();if(lastLineLength+2<=LINE_LENGTH+1){result.push(handleTrailingCharacters(buffer))}else{result.push(buffer.slice(0,lastLineLength-1),handleTrailingCharacters(buffer.slice(lastLineLength-1,lastLineLength)))}}return result.join("=\r\n")};_export("quotedPrintable",quotedPrintable={encode,decode,version:"1.0.1"})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/encoder/quoted-printable");System.register(["tslib","../../common/QueryIterator","./AttachmentFile","./HeaderContentType","./HeaderContentDisposition","./encoder/RawBuffer","./encoder/base64-to-blob","./encoder/quoted-printable","./encoder/word-encoding"],(function(_export,_context){"use strict";var __asyncValues,__awaiter,QueryIterator,AttachmentFile,HeaderContentType,HeaderContentDisposition,RawBuffer,base64toBlob,quotedPrintable,wordEncoding,CIMap,MimeNode;_export({CIMap:void 0,MimeNode:void 0});return{setters:[function(_tslib){__asyncValues=_tslib.__asyncValues;__awaiter=_tslib.__awaiter},function(_commonQueryIterator){QueryIterator=_commonQueryIterator.default},function(_AttachmentFile){AttachmentFile=_AttachmentFile.AttachmentFile},function(_HeaderContentType){HeaderContentType=_HeaderContentType.HeaderContentType},function(_HeaderContentDisposition){HeaderContentDisposition=_HeaderContentDisposition.HeaderContentDisposition},function(_encoderRawBuffer){RawBuffer=_encoderRawBuffer.RawBuffer},function(_encoderBase64ToBlob){base64toBlob=_encoderBase64ToBlob.base64toBlob},function(_encoderQuotedPrintable){quotedPrintable=_encoderQuotedPrintable.quotedPrintable},function(_encoderWordEncoding){wordEncoding=_encoderWordEncoding.wordEncoding}],execute:function(){_export("CIMap",CIMap=class CIMap extends Map{constructor(){super(...arguments);this.ci=new Map}set(key,value){if(typeof key==="string"){let ck=this.ci.get(key);if(ck===void 0){ck=key.toLocaleLowerCase();this.ci.set(ck,key)}else{key=ck}}return super.set(key,value)}get(key){if(typeof key==="string"){const ck=key.toLocaleLowerCase();key=this.ci.get(ck)}return super.get(key)}});_export("MimeNode",MimeNode=class MimeNode{static createMessage({html,subject,text="",name="",attachments=[]}){const root=new MimeNode("multipart/mixed");root.setHeader("Subject",subject);if(name){root.setHeader("X-Name",name)}const body=new MimeNode("multipart/alternative");body.children=[];if(html){body.children.push(this.create(html,"text/html"))}if(text){body.children.push(this.create(text,"text/plain"))}root.children=[body];if(attachments){for(const iterator of attachments){root.children.push(this.create(iterator))}}return root}static create(text,type,id){if(typeof text==="string"){const node=new MimeNode(type);node.text=text;return node}const fileNode=new MimeNode(text.type);fileNode.blobData=text;fileNode.contentDisposition=new HeaderContentDisposition(type||"attachment");fileNode.contentDisposition.filename=text.name;fileNode.setHeader("Content-Disposition",fileNode.contentDisposition);if(id){fileNode.setHeader("Content-Id",id)}return fileNode}get text(){var _a,_b,_c;let{encoded}=this;if(!encoded){return}const cte=(_a=this.contentTransferEncoding)===null||_a===void 0?void 0:_a.toLowerCase();switch(cte){case"quoted-printable":encoded=quotedPrintable.decode(encoded);break;case"base64":encoded=btoa(encoded);break}return(_b=this.textContent)!==null&&_b!==void 0?_b:this.textContent=RawBuffer.decode(encoded,(_c=this.contentType)===null||_c===void 0?void 0:_c.charset)}set text(v){this.contentTransferEncoding="quoted-printable";this.textContent=v}get blob(){var _a,_b;if(((_a=this.contentTransferEncoding)===null||_a===void 0?void 0:_a.toLocaleLowerCase())!=="base64"){throw new Error("Not supported")}return(_b=this.blobData)!==null&&_b!==void 0?_b:this.blobData=base64toBlob(this.encoded,this.contentType.type)}set blob(v){this.blobData=v}get contentTransferEncoding(){return this.header("Content-Transfer-Encoding")}set contentTransferEncoding(v){this.setHeader("Content-Transfer-Encoding",v)}get boundary(){return this.contentType.boundary}get descendent(){return this.enumerate()}constructor(type){this.headers=new CIMap;this.contentType=new HeaderContentType(type);this.headers.set("Content-Type",this.contentType)}getFirstChild(contentType,create=false){var _a;contentType=contentType.toLocaleLowerCase();let child=QueryIterator.first(this.descendent,(x=>x.contentType.type===contentType));if(!child&&create){child=new MimeNode(contentType);((_a=this.children)!==null&&_a!==void 0?_a:this.children=[]).push(child)}return child}header(name){return this.headers.get(name)}setHeader(name,value){this.headers.set(name,value)}asFile(){return __awaiter(this,void 0,void 0,(function*(){const text=this.encoded.split("\n").map((x=>x.trim())).join("");const url=`data:${this.contentType.type};base64,${text}`;const blob=yield fetch(url);const af=new AttachmentFile([yield blob.blob()],this.contentDisposition.filename,{type:this.contentType.type,contentId:this.header("Content-Id"),disposition:this.contentDisposition.type});af.node=this;return af}))}attachments(files=[]){var _a;return __awaiter(this,void 0,void 0,(function*(){for(const iterator of this.children){if(iterator.children){yield iterator.attachments(files);continue}if((_a=iterator.contentDisposition)===null||_a===void 0?void 0:_a.type){files.push(yield iterator.asFile())}}return files}))}parse(lines,last=""){var _a,e_1,_b,_c,_d,e_2,_e,_f;var _g;return __awaiter(this,void 0,void 0,(function*(){yield this.parseHeaders(lines);let boundary=this.contentType.boundary;if(!boundary){const data=[];try{for(var _h=true,_j=__asyncValues(lines.read()),_k;_k=yield _j.next(),_a=_k.done,!_a;){_c=_k.value;_h=false;try{const line=_c;const trimmed=line.trimEnd();if(trimmed.length===0){break}if(trimmed===last){break}data.push(line)}finally{_h=true}}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(!_h&&!_a&&(_b=_j.return))yield _b.call(_j)}finally{if(e_1)throw e_1.error}}this.encoded=data.join("\n");return}boundary="--"+boundary;const end=boundary+"--";for(;;){let boundaryFound=false;try{for(var _l=true,_m=(e_2=void 0,__asyncValues(lines.read())),_o;_o=yield _m.next(),_d=_o.done,!_d;){_f=_o.value;_l=false;try{const line=_f;if(line===boundary){boundaryFound=true;break}if(line===end){return}}finally{_l=true}}}catch(e_2_1){e_2={error:e_2_1}}finally{try{if(!_l&&!_d&&(_e=_m.return))yield _e.call(_m)}finally{if(e_2)throw e_2.error}}if(!boundaryFound){break}const child=new MimeNode("");yield child.parse(lines,end);((_g=this.children)!==null&&_g!==void 0?_g:this.children=[]).push(child)}}))}parseHeaders(lines){var _a,e_3,_b,_c;var _d;return __awaiter(this,void 0,void 0,(function*(){let headerName="";let headerValue="";try{for(var _e=true,_f=__asyncValues(lines.read()),_g;_g=yield _f.next(),_a=_g.done,!_a;){_c=_g.value;_e=false;try{const iterator=_c;const value=iterator.trim();if(value.length===0){break}if(/^[\x20\t]/.test(iterator)){headerValue+=wordEncoding.decode(value);continue}if(headerValue){this.setHeader(headerName,headerValue)}const index=value.indexOf(":");headerName=value.substring(0,index);headerValue=wordEncoding.decode(value.substring(index+1).trim())}finally{_e=true}}}catch(e_3_1){e_3={error:e_3_1}}finally{try{if(!_e&&!_a&&(_b=_f.return))yield _b.call(_f)}finally{if(e_3)throw e_3.error}}if(headerValue){this.setHeader(headerName,headerValue)}const ct=this.header("Content-Type");this.contentType.parse(ct);this.setHeader("Content-Type",ct);const cd=this.header("Content-Disposition");if(cd){(_d=this.contentDisposition)!==null&&_d!==void 0?_d:this.contentDisposition=new HeaderContentDisposition;this.contentDisposition.parse(cd);this.setHeader("Content-Disposition",cd)}}))}save(writer){var _a,_b;var _c;return __awaiter(this,void 0,void 0,(function*(){if(this.textContent){this.contentType.charset="UTF-8"}if((_a=this.children)===null||_a===void 0?void 0:_a.length){(_c=this.contentType).boundary||(_c.boundary=`${Date.now()}-${Date.now()}-${Date.now()}`)}for(const[key,element]of this.headers.entries()){switch(key){case"content-disposition":writer.writeLine(`Content-Disposition: ${this.contentDisposition}`);continue;case"content-type":writer.writeLine(`Content-Type:${this.contentType.toString()}`);continue;case"subject":writer.writeLine(`${key}: ${wordEncoding.encode(element,true)}`);continue}writer.writeLine(`${key}: ${element}`)}writer.writeLine("");if((_b=this.children)===null||_b===void 0?void 0:_b.length){const boundary=`--${this.contentType.boundary}`;for(const iterator of this.children){writer.writeLine(boundary);yield iterator.save(writer);writer.writeLine("")}writer.writeLine(boundary+"--");return}if(this.blobData){const base64=yield RawBuffer.toBase64Async(this.blobData);let start=0;const max=80;for(;;){if(start+max>base64.length){writer.writeLine(base64.substring(start));break}writer.writeLine(base64.substring(start,start+max));start+=max}writer.writeLine("");return}let text=this.textContent;if(this.contentTransferEncoding==="quoted-printable"){text=quotedPrintable.encode(RawBuffer.encode(text))}writer.writeLine(RawBuffer.encode(text));writer.writeLine("");return}))}*enumerate(){yield this;if(!this.children){return}for(const iterator of this.children){yield*iterator.enumerate()}}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/MimeNode");System.register(["tslib","../tokenizer"],(function(_export,_context){"use strict";var __asyncGenerator,__await,tokenize,LineStream,StringLineStream,ReadableLineStream;_export({default:void 0,StringLineStream:void 0,ReadableLineStream:void 0});return{setters:[function(_tslib){__asyncGenerator=_tslib.__asyncGenerator;__await=_tslib.__await},function(_tokenizer){tokenize=_tokenizer.tokenize}],execute:function(){_export("default",LineStream=class LineStream{read(){var _a;return __asyncGenerator(this,arguments,(function*read_1(){const g=(_a=this.g)!==null&&_a!==void 0?_a:this.g=this.lines();for(;;){const{value,done}=yield __await(g.next());if(done){break}yield yield __await(value)}}))}});_export("StringLineStream",StringLineStream=class StringLineStream extends LineStream{constructor(text){super();this.text=text}lines(){return __asyncGenerator(this,arguments,(function*lines_1(){for(const iterator of tokenize(this.text,"\n")){yield yield __await(iterator)}}))}});_export("ReadableLineStream",ReadableLineStream=class ReadableLineStream extends LineStream{constructor(readable){super();this.readable=readable}lines(){return __asyncGenerator(this,arguments,(function*lines_2(){const utf8Decoder=new TextDecoder("utf-8");const reader=this.readable.getReader();let{value:chunk,done:readerDone}=yield __await(reader.read());chunk=chunk?utf8Decoder.decode(chunk,{stream:true}):"";const re=/\r\n|\n|\r/gm;let startIndex=0;for(;;){const result=re.exec(chunk);if(!result){if(readerDone){break}const remainder=chunk.substr(startIndex);({value:chunk,done:readerDone}=yield __await(reader.read()));chunk=remainder+(chunk?utf8Decoder.decode(chunk,{stream:true}):"");startIndex=re.lastIndex=0;continue}yield yield __await(chunk.substring(startIndex,result.index));startIndex=re.lastIndex}if(startIndex<chunk.length){yield yield __await(chunk.substr(startIndex))}}))}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/stream/LineStream");System.register([],(function(_export,_context){"use strict";var TextWriter,BlobWriter;_export({default:void 0,BlobWriter:void 0});return{setters:[],execute:function(){_export("default",TextWriter=class TextWriter{});_export("BlobWriter",BlobWriter=class BlobWriter extends TextWriter{constructor(){super(...arguments);this.lines=[]}writeLine(line){this.lines.push(line)}toBlob(){const all=this.lines.join("\n");return new Blob([all],{})}toString(){return this.lines.join("\n")}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/stream/TextWriter");System.register(["tslib","./MimeNode","./stream/LineStream","./stream/TextWriter"],(function(_export,_context){"use strict";var __awaiter,MimeNode,ReadableLineStream,StringLineStream,BlobWriter,MimeMessage;_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter},function(_MimeNode){MimeNode=_MimeNode.MimeNode},function(_streamLineStream){ReadableLineStream=_streamLineStream.ReadableLineStream;StringLineStream=_streamLineStream.StringLineStream},function(_streamTextWriter){BlobWriter=_streamTextWriter.BlobWriter}],execute:function(){_export("default",MimeMessage=class MimeMessage{static load(reader,name,inline){return __awaiter(this,void 0,void 0,(function*(){const node=new MimeNode;if(name){node.setHeader("X-Name",name)}yield node.parse(typeof reader==="string"?new StringLineStream(reader):new ReadableLineStream(reader));const attachments=yield node.attachments();const msg=new MimeMessage(node,attachments);if(inline){yield msg.inlineImages()}return msg}))}get name(){return this.node.header("x-name")}get html(){var _a,_b;const alternative=this.node.getFirstChild("multipart/alternative");return(_b=(_a=alternative===null||alternative===void 0?void 0:alternative.getFirstChild("text/html"))===null||_a===void 0?void 0:_a.text)!==null&&_b!==void 0?_b:""}set html(v){const alternative=this.node.getFirstChild("multipart/alternative",true);const htmlMime=alternative.getFirstChild("text/html",true);htmlMime.contentTransferEncoding="quoted-printable";htmlMime.text=v;htmlMime.contentType.charset="UTF-8"}get text(){var _a,_b;const alternative=this.node.getFirstChild("multipart/alternative");return(_b=(_a=alternative===null||alternative===void 0?void 0:alternative.getFirstChild("text/plain"))===null||_a===void 0?void 0:_a.text)!==null&&_b!==void 0?_b:""}set text(v){const alternative=this.node.getFirstChild("multipart/alternative",true);const htmlMime=alternative.getFirstChild("text/plain",true);htmlMime.contentTransferEncoding="quoted-printable";htmlMime.text=v;htmlMime.contentType.charset="UTF-8"}get subject(){var _a;return(_a=this.node.header("subject"))!==null&&_a!==void 0?_a:""}set subject(v){this.node.setHeader("subject",v)}constructor(node=new MimeNode("multipart/mixed"),attachments=[]){this.node=node;this.attachments=attachments}save(){return __awaiter(this,void 0,void 0,(function*(){const blobWriter=new BlobWriter;yield this.node.save(blobWriter);return blobWriter.toBlob()}))}inlineImages(){return __awaiter(this,void 0,void 0,(function*(){let text=this.html;if(!text){return}for(const iterator of this.attachments){if(iterator.contentId){const encoded=iterator.node.encoded;text=text.split(`cid:${iterator.contentId}`).join(`data://${iterator.type},${encoded}`)}}}))}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/MimeMessage");System.register(["tslib","@web-atoms/web-controls/dist/mobile-app/MobileApp","@web-atoms/core/dist/core/XNode","@web-atoms/core/dist/core/Bind","../../../common/controls/html/InlineHtmlEditorWithToolbar","../../../services/mime-service/MimeNode","@web-atoms/web-controls/dist/basic/Form","@web-atoms/web-controls/dist/basic/FormField","../../../common/controls/buttons/IconButton","@web-atoms/core/dist/view-model/Action","../../../services/mime-service/MimeMessage","@web-atoms/web-controls/dist/basic/AtomRepeater","@web-atoms/core/dist/web/core/AtomUI","../../../services/mime-service/stream/TextWriter","../../../services/files/LocalFileService"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,ContentPage,XNode,Bind,InlineHtmlEditorWithToolbar,MimeNode,Form,FormField,SaveIconTextButton,Action,MimeMessage,AtomRepeater,descendentElementIterator,BlobWriter,LocalFileService,EditTemplatePage;_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsWebControlsDistMobileAppMobileApp){ContentPage=_webAtomsWebControlsDistMobileAppMobileApp.ContentPage},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsCoreDistCoreBind){Bind=_webAtomsCoreDistCoreBind.default},function(_commonControlsHtmlInlineHtmlEditorWithToolbar){InlineHtmlEditorWithToolbar=_commonControlsHtmlInlineHtmlEditorWithToolbar.default},function(_servicesMimeServiceMimeNode){MimeNode=_servicesMimeServiceMimeNode.MimeNode},function(_webAtomsWebControlsDistBasicForm){Form=_webAtomsWebControlsDistBasicForm.default},function(_webAtomsWebControlsDistBasicFormField){FormField=_webAtomsWebControlsDistBasicFormField.default},function(_commonControlsButtonsIconButton){SaveIconTextButton=_commonControlsButtonsIconButton.SaveIconTextButton},function(_webAtomsCoreDistViewModelAction){Action=_webAtomsCoreDistViewModelAction.default},function(_servicesMimeServiceMimeMessage){MimeMessage=_servicesMimeServiceMimeMessage.default},function(_webAtomsWebControlsDistBasicAtomRepeater){AtomRepeater=_webAtomsWebControlsDistBasicAtomRepeater.default},function(_webAtomsCoreDistWebCoreAtomUI){descendentElementIterator=_webAtomsCoreDistWebCoreAtomUI.descendentElementIterator},function(_servicesMimeServiceStreamTextWriter){BlobWriter=_servicesMimeServiceStreamTextWriter.BlobWriter},function(_servicesFilesLocalFileService){LocalFileService=_servicesFilesLocalFileService.default}],execute:function(){_export("default",EditTemplatePage=class EditTemplatePage extends ContentPage{init(){return __awaiter(this,void 0,void 0,(function*(){this.model=yield this.loadModel(this.parameters.file);this.renderer=XNode.create("div",{"data-layout":"center-page-900px"},XNode.create(Form,null,XNode.create(FormField,{label:"File Name:"},XNode.create("input",{value:Bind.twoWaysImmediate((()=>this.model.name))})),XNode.create(FormField,{label:"Subject:"},XNode.create("input",{value:Bind.twoWaysImmediate((()=>this.model.subject))})),XNode.create(InlineHtmlEditorWithToolbar,{inlineImage:true,presenter:Bind.presenter((c=>this.editor=c)),"event-content-ready":()=>this.setupEditable(),content:this.model.htmlBody,"style-min-height":"200px"}),XNode.create(AtomRepeater,{items:this.model.attachments,"data-layout":"flex-wrap-padding",itemRenderer:item=>XNode.create("div",null,XNode.create("i",{class:"fas fa-file"}),XNode.create("span",{text:item.name}))}),XNode.create("div",null,XNode.create(SaveIconTextButton,{"data-click-event":"save-template",text:"Save"}))))}))}loadModel(file){return __awaiter(this,void 0,void 0,(function*(){if(file.appFileID){const data=yield fetch(file.url);const node=yield MimeMessage.load(data.body,file.name);const name=node.name;const htmlBody=node.html;const attachments=node.attachments;const subject=node.subject;return{node:node.node,mime:node,name,subject,htmlBody,attachments}}return{name:"Template 1",subject:"Template Subject",htmlBody:`<div contentEditable="true"><p><br/><br/><br/><br/><br/></p></div>`,attachments:[]}}))}saveTemplate(){var _a,_b;return __awaiter(this,void 0,void 0,(function*(){const{html,text}=this.editor.htmlTextContent;const root=MimeNode.createMessage({subject:this.model.subject,name:this.model.name,html,text,attachments:this.model.attachments});const blobWriter=new BlobWriter;yield root.save(blobWriter);const blob=blobWriter.toBlob();const localFileService=this.resolve(LocalFileService);const file=new File([blob],this.model.name,{type:"message/rfc822"});const appFileID=(_b=(_a=this.parameters.file)===null||_a===void 0?void 0:_a.appFileID)!==null&&_b!==void 0?_b:void 0;const parentID=appFileID?void 0:this.parameters.file.parentID;yield localFileService.uploadWithProgress([file],{appFileID,parentID})}))}setupEditable(){const editor=this.editor.editor;if(editor.isContentEditable){return}for(const node of descendentElementIterator(editor)){if(node.isContentEditable){return}}editor.contentEditable="true"}});__decorate([Action({onEvent:"save-template"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],EditTemplatePage.prototype,"saveTemplate",null)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/web/page/templates/EditTemplatePage");System.register(["tslib","@web-atoms/web-controls/dist/mobile-app/MobileApp","../../../model/model","@web-atoms/core/dist/core/XNode","@web-atoms/web-controls/dist/basic/UploadEvent","@web-atoms/web-controls/dist/basic/AtomRepeater","../../../common/controls/tree/TreeView","@web-atoms/core/dist/core/Bind","@web-atoms/core/dist/view-model/Action","./service/CloudFileService","@web-atoms/core/dist/core/InjectProperty","@web-atoms/core/dist/style/styled","../../../common/NumberFormats","../../../common/controls/drag-drop/FilesDragDrop","@web-atoms/web-controls/dist/basic/PopupButton","@web-atoms/web-controls/dist/PageNavigator","./shares/EditSharesPage","../templates/EditTemplatePage"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,ContentPage,AppFile,XNode,UploadEvent,AtomRepeater,SelectAll,SelectorCheckBox,TreeView,Bind,Action,CloudFileService,InjectProperty,styled,toFileSize,FilesDragDrop,PopupButton,MenuItem,PageNavigator,EditSharesPage,EditTemplatePage,FolderPage,css,getExtension;_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsWebControlsDistMobileAppMobileApp){ContentPage=_webAtomsWebControlsDistMobileAppMobileApp.ContentPage},function(_modelModel){AppFile=_modelModel.AppFile},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsWebControlsDistBasicUploadEvent){UploadEvent=_webAtomsWebControlsDistBasicUploadEvent.default},function(_webAtomsWebControlsDistBasicAtomRepeater){AtomRepeater=_webAtomsWebControlsDistBasicAtomRepeater.default;SelectAll=_webAtomsWebControlsDistBasicAtomRepeater.SelectAll;SelectorCheckBox=_webAtomsWebControlsDistBasicAtomRepeater.SelectorCheckBox},function(_commonControlsTreeTreeView){TreeView=_commonControlsTreeTreeView.default},function(_webAtomsCoreDistCoreBind){Bind=_webAtomsCoreDistCoreBind.default},function(_webAtomsCoreDistViewModelAction){Action=_webAtomsCoreDistViewModelAction.default},function(_serviceCloudFileService){CloudFileService=_serviceCloudFileService.default},function(_webAtomsCoreDistCoreInjectProperty){InjectProperty=_webAtomsCoreDistCoreInjectProperty.default},function(_webAtomsCoreDistStyleStyled){styled=_webAtomsCoreDistStyleStyled.default},function(_commonNumberFormats){toFileSize=_commonNumberFormats.toFileSize},function(_commonControlsDragDropFilesDragDrop){FilesDragDrop=_commonControlsDragDropFilesDragDrop.FilesDragDrop},function(_webAtomsWebControlsDistBasicPopupButton){PopupButton=_webAtomsWebControlsDistBasicPopupButton.default;MenuItem=_webAtomsWebControlsDistBasicPopupButton.MenuItem},function(_webAtomsWebControlsDistPageNavigator){PageNavigator=_webAtomsWebControlsDistPageNavigator.default},function(_sharesEditSharesPage){EditSharesPage=_sharesEditSharesPage.default},function(_templatesEditTemplatePage){EditTemplatePage=_templatesEditTemplatePage.default}],execute:function(){css=styled.css`
2064
+ `.withOrder("medium").installGlobal("*[data-date-field=date-field]")}}}));AmdLoader.instance.setup("@web-atoms/web-controls/dist/basic/styles/date-field-style");System.register(["tslib","@web-atoms/core/dist/core/Bind","@web-atoms/core/dist/core/BindableProperty","@web-atoms/core/dist/core/XNode","@web-atoms/core/dist/web/controls/AtomControl","@web-atoms/date-time/dist/DateTime","./Calendar","./InlinePopup","./TimeEditor","@web-atoms/date-time/dist/TimeSpan","./styles/date-field-style"],(function(_export,_context){"use strict";var __decorate,__metadata,Bind,BindableProperty,XNode,AtomControl,DateTime,Calendar,InlinePopup,InlinePopupButton,TimeEditor,TimeSpan,DateField;function hours(){return[{label:"01",value:1},{label:"02",value:2},{label:"03",value:3},{label:"04",value:4},{label:"05",value:5},{label:"06",value:6},{label:"07",value:7},{label:"08",value:8},{label:"09",value:9},{label:"10",value:10},{label:"11",value:11},{label:"12",value:12}]}function minutes(){const items=[];for(let index=0;index<10;index++){items.push({label:"0"+index,value:index})}for(let index=10;index<60;index++){items.push({label:index.toString(),value:index})}return items}_export("default",void 0);return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsCoreDistCoreBind){Bind=_webAtomsCoreDistCoreBind.default},function(_webAtomsCoreDistCoreBindableProperty){BindableProperty=_webAtomsCoreDistCoreBindableProperty.BindableProperty},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsCoreDistWebControlsAtomControl){AtomControl=_webAtomsCoreDistWebControlsAtomControl.AtomControl},function(_webAtomsDateTimeDistDateTime){DateTime=_webAtomsDateTimeDistDateTime.default},function(_Calendar){Calendar=_Calendar.default},function(_InlinePopup){InlinePopup=_InlinePopup.default;InlinePopupButton=_InlinePopup.InlinePopupButton},function(_TimeEditor){TimeEditor=_TimeEditor.default},function(_webAtomsDateTimeDistTimeSpan){TimeSpan=_webAtomsDateTimeDistTimeSpan.default},function(_stylesDateFieldStyle){}],execute:function(){_export("default",DateField=class DateField extends AtomControl{constructor(app,e=document.createElement("button")){super(app,e)}preCreate(){this.prompt="Select";this.enableTime=false;this.value=null;this.format=(d,showTime)=>showTime?d===null||d===void 0?void 0:d.toLocaleString(navigator.language,{month:"short",year:"numeric",day:"numeric",weekday:"short",hour12:true,hour:"numeric",minute:"2-digit"}):d===null||d===void 0?void 0:d.toLocaleDateString(navigator.language,{month:"short",year:"numeric",day:"numeric",weekday:"short"});const owner=this;class CalendarPopup extends InlinePopup{create(){var _a;this.owner=owner;this.type="AM";const now=DateTime.from((_a=owner.value)!==null&&_a!==void 0?_a:DateTime.today.addHours(owner.hour||0).addMinutes(owner.minute||0));this.time=new TimeSpan(0,now.hour,now.minute);super.create();const yearStart=typeof this.owner.yearStart==="number"?this.owner.yearStart:-10;const yearEnd=typeof this.owner.yearEnd==="number"?this.owner.yearEnd:10;const year=typeof this.owner.year==="number"?this.owner.year:now.year;this.render(XNode.create("div",{class:"calendar-popup"},XNode.create(Calendar,{yearStart,yearEnd,year,"event-item-select":Bind.event(((s,e)=>{if(e.detail.disabled){return}this.save(e.detail.value)})),enableFunc:Bind.oneTime((()=>this.owner.enableFunc)),value:Bind.oneWay((()=>this.owner.value))}),this.owner.enableTime&&XNode.create(TimeEditor,{time:Bind.twoWays((()=>this.time))}),XNode.create("button",{class:"clear",text:"Clear","event-click":e=>{e.preventDefault();e.stopImmediatePropagation();e.stopPropagation();this.save()}}),XNode.create("button",{class:"today",text:"Today","event-click":e=>{e.preventDefault();e.stopImmediatePropagation();e.stopPropagation();this.save(DateTime.today.asJSDate)}})));this.runAfterInit((()=>{if(this.element){this.element.scrollIntoView()}}))}save(d){if(!d){this.owner.value=d;this.close(d);return}let date=DateTime.from(d);if(this.owner.enableTime){date=date.add(this.time)}this.owner.value=date.asJSDate;this.close(date)}}this.render(XNode.create(InlinePopupButton,{"data-layout":"flex","data-date-field":"date-field",text:Bind.oneWay((()=>{var _a;return((_a=this.format)===null||_a===void 0?void 0:_a.call(this,this.value,this.enableTime))||this.prompt}))},XNode.create(CalendarPopup,null)))}});__decorate([BindableProperty,__metadata("design:type",Date)],DateField.prototype,"value",void 0);__decorate([BindableProperty,__metadata("design:type",Function)],DateField.prototype,"enableFunc",void 0);__decorate([BindableProperty,__metadata("design:type",Function)],DateField.prototype,"format",void 0);__decorate([BindableProperty,__metadata("design:type",Object)],DateField.prototype,"yearStart",void 0);__decorate([BindableProperty,__metadata("design:type",Object)],DateField.prototype,"yearEnd",void 0);__decorate([BindableProperty,__metadata("design:type",Number)],DateField.prototype,"year",void 0);__decorate([BindableProperty,__metadata("design:type",Number)],DateField.prototype,"hour",void 0);__decorate([BindableProperty,__metadata("design:type",Number)],DateField.prototype,"minute",void 0);__decorate([BindableProperty,__metadata("design:type",String)],DateField.prototype,"prompt",void 0)}}}));AmdLoader.instance.setup("@web-atoms/web-controls/dist/basic/DateField");System.register(["tslib","@web-atoms/web-controls/dist/mobile-app/MobileApp","../../../../model/model","@web-atoms/core/dist/core/XNode","@web-atoms/web-controls/dist/basic/Form","@web-atoms/web-controls/dist/basic/FormField","@web-atoms/web-controls/dist/basic/Switch","@web-atoms/core/dist/core/Bind","../../../../common/controls/drop-downs/user/UserDropDown","../../../../common/controls/buttons/IconButton","@web-atoms/date-time/dist/DateTime","@web-atoms/web-controls/dist/basic/DateField","@web-atoms/web-controls/dist/basic/Select","@web-atoms/core/dist/view-model/Action","@web-atoms/core/dist/core/InjectProperty","../../../../services/files/FileShareService"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,PopupWindowPage,AppFileAccess,XNode,Form,FormField,Switch,Bind,UserDropDown,SaveIconTextButton,DateTime,DateField,Select,Action,InjectProperty,FileShareService,AddSharePage,rights,externalRights;_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsWebControlsDistMobileAppMobileApp){PopupWindowPage=_webAtomsWebControlsDistMobileAppMobileApp.PopupWindowPage},function(_modelModel){AppFileAccess=_modelModel.AppFileAccess},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsWebControlsDistBasicForm){Form=_webAtomsWebControlsDistBasicForm.default},function(_webAtomsWebControlsDistBasicFormField){FormField=_webAtomsWebControlsDistBasicFormField.default},function(_webAtomsWebControlsDistBasicSwitch){Switch=_webAtomsWebControlsDistBasicSwitch.default},function(_webAtomsCoreDistCoreBind){Bind=_webAtomsCoreDistCoreBind.default},function(_commonControlsDropDownsUserUserDropDown){UserDropDown=_commonControlsDropDownsUserUserDropDown.default},function(_commonControlsButtonsIconButton){SaveIconTextButton=_commonControlsButtonsIconButton.SaveIconTextButton},function(_webAtomsDateTimeDistDateTime){DateTime=_webAtomsDateTimeDistDateTime.default},function(_webAtomsWebControlsDistBasicDateField){DateField=_webAtomsWebControlsDistBasicDateField.default},function(_webAtomsWebControlsDistBasicSelect){Select=_webAtomsWebControlsDistBasicSelect.default},function(_webAtomsCoreDistViewModelAction){Action=_webAtomsCoreDistViewModelAction.default},function(_webAtomsCoreDistCoreInjectProperty){InjectProperty=_webAtomsCoreDistCoreInjectProperty.default},function(_servicesFilesFileShareService){FileShareService=_servicesFilesFileShareService.default}],execute:function(){rights=[{label:"Read",value:"read"},{label:"Write",value:"write"},{label:"Delegate (Read+Write+Share)",value:"delegate"}];externalRights=[{label:"Read",value:"read"},{label:"Write",value:"write"}];_export("default",AddSharePage=class AddSharePage extends PopupWindowPage{constructor(){super(...arguments);this.external=false}init(){return __awaiter(this,void 0,void 0,(function*(){this.title=`Create new Share for ${this.parameters.name}`;const fileID=this.parameters.appFileID;this.model=AppFileAccess.create({fileID,expires:DateTime.today.addMonths(1),type:"read",externalUser:{name:"",emailAddress:""}});this.renderer=XNode.create("div",null,XNode.create(Form,null,XNode.create(FormField,{label:this.parameters.isFolder?"Folder":"File"},XNode.create("div",{text:this.parameters.name})),XNode.create("div",{"data-layout":"row"},XNode.create(Switch,{checked:Bind.twoWaysImmediate((()=>this.external))}),XNode.create("div",{text:"External User"})),XNode.create(FormField,{"style-display":Bind.oneWay((()=>!this.external)),label:"Search User"},XNode.create(UserDropDown,{value:Bind.twoWaysImmediate((()=>this.model.userID))})),XNode.create(FormField,{"style-display":Bind.oneWay((()=>!!this.external)),label:"Name"},XNode.create("input",{value:Bind.twoWaysImmediate((()=>this.model.externalUser.name))})),XNode.create(FormField,{"style-display":Bind.oneWay((()=>!!this.external)),label:"Email Address"},XNode.create("input",{value:Bind.twoWaysImmediate((()=>this.model.externalUser.emailAddress))})),XNode.create(FormField,{label:"Rights"},XNode.create(Select,{labelPath:item=>item.label,valuePath:item=>item.value,items:Bind.oneWay((()=>this.external?externalRights:rights)),value:Bind.twoWaysImmediate((()=>this.model.type))})),XNode.create(FormField,{label:"Expires"},XNode.create(DateField,{value:Bind.twoWaysImmediate((()=>this.model.expires))})),XNode.create("div",{"data-layout":"command-row"},XNode.create(SaveIconTextButton,{"data-submit-event":"save-share",text:"Create"}))))}))}saveShare(){return __awaiter(this,void 0,void 0,(function*(){const model=Object.assign({},this.model);if(!this.external){delete model.externalUser}yield this.fileShareService.save(model);model.file=this.parameters;return model}))}});__decorate([InjectProperty,__metadata("design:type",FileShareService)],AddSharePage.prototype,"fileShareService",void 0);__decorate([Action({onEvent:"save-share",close:true}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],AddSharePage.prototype,"saveShare",null)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/web/page/files/shares/AddSharePage");System.register(["tslib","@web-atoms/web-controls/dist/mobile-app/MobileApp","@web-atoms/core/dist/core/XNode","@web-atoms/web-controls/dist/basic/AtomRepeater","@web-atoms/core/dist/core/InjectProperty","../../../../services/files/FileShareService","../../../../common/controls/buttons/IconButton","@web-atoms/core/dist/view-model/Action","@web-atoms/web-controls/dist/PageNavigator","./AddSharePage","../../../../common/date/DateFormats"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,PopupWindowPage,XNode,AtomRepeater,InjectProperty,FileShareService,AddIconTextButton,Action,PageNavigator,AddSharePage,DateFormats,EditSharesPage;_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsWebControlsDistMobileAppMobileApp){PopupWindowPage=_webAtomsWebControlsDistMobileAppMobileApp.PopupWindowPage},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsWebControlsDistBasicAtomRepeater){AtomRepeater=_webAtomsWebControlsDistBasicAtomRepeater.default},function(_webAtomsCoreDistCoreInjectProperty){InjectProperty=_webAtomsCoreDistCoreInjectProperty.default},function(_servicesFilesFileShareService){FileShareService=_servicesFilesFileShareService.default},function(_commonControlsButtonsIconButton){AddIconTextButton=_commonControlsButtonsIconButton.AddIconTextButton},function(_webAtomsCoreDistViewModelAction){Action=_webAtomsCoreDistViewModelAction.default},function(_webAtomsWebControlsDistPageNavigator){PageNavigator=_webAtomsWebControlsDistPageNavigator.default},function(_AddSharePage){AddSharePage=_AddSharePage.default},function(_commonDateDateFormats){DateFormats=_commonDateDateFormats.DateFormats}],execute:function(){_export("default",EditSharesPage=class EditSharesPage extends PopupWindowPage{init(){var _a;return __awaiter(this,void 0,void 0,(function*(){this.title=`${this.parameters.name} - Share Settings`;this.list=(_a=yield this.shareService.list(this.parameters.appFileID))!==null&&_a!==void 0?_a:[];this.renderer=XNode.create("div",null,XNode.create(AtomRepeater,{items:this.list,itemRenderer:item=>XNode.create("div",{"data-layout":"row"},XNode.create("div",{text:item.user.userName}),XNode.create("div",{text:item.type}),item.expires&&XNode.create("div",{text:DateFormats.relative.short(item.expires)}),item.accessCode?XNode.create("i",{title:"Copy Link",class:"fas fa-link"}):XNode.create("span",null))}),XNode.create("div",null,XNode.create(AddIconTextButton,{"data-click-event":"create-share-link",text:"Create Share Link"})));if(!this.list.length){yield this.createShareLink()}}))}createShareLink(){return __awaiter(this,void 0,void 0,(function*(){const item=yield PageNavigator.pushPageForResult(AddSharePage,this.parameters);this.list.add(item)}))}});__decorate([InjectProperty,__metadata("design:type",FileShareService)],EditSharesPage.prototype,"shareService",void 0);__decorate([Action({onEvent:"create-share-link"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],EditSharesPage.prototype,"createShareLink",null)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/web/page/files/shares/EditSharesPage");System.register([],(function(_export,_context){"use strict";var QueryIterator;_export("default",void 0);return{setters:[],execute:function(){_export("default",QueryIterator=class QueryIterator{static first(source,fx){for(const iterator of source){if(fx(iterator)){return iterator}}}firstOrFail(source,fx){for(const iterator of source){if(fx(iterator)){return iterator}}}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/QueryIterator");System.register([],(function(_export,_context){"use strict";var AttachmentFile;_export("AttachmentFile",void 0);return{setters:[],execute:function(){_export("AttachmentFile",AttachmentFile=class AttachmentFile extends File{constructor(fileBits,fileName,options){super(fileBits,fileName,options);this.contentId=options.contentId;this.disposition=options.disposition}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/AttachmentFile");System.register([],(function(_export,_context){"use strict";function*tokenize(text,sep){let start=0;for(;;){const index=text.indexOf(sep,start);if(index===-1){break}yield text.substring(start,index);start=index+1}yield text.substring(start)}function tokenizeMax(text,sep,max=Number.MAX_SAFE_INTEGER){let start=0;const items=[];max--;for(;;){const index=text.indexOf(sep,start);if(index===-1){break}items.push(text.substring(start,index));start=index+1;if(--max===0){break}}items.push(text.substring(start));return items}_export({tokenize,tokenizeMax});return{setters:[],execute:function(){}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/tokenizer");System.register(["./tokenizer"],(function(_export,_context){"use strict";var tokenize,tokenizeMax,parsePairs;return{setters:[function(_tokenizer){tokenize=_tokenizer.tokenize;tokenizeMax=_tokenizer.tokenizeMax}],execute:function(){_export("parsePairs",parsePairs=(text,emptyName)=>{const pairs={toString(){return text}};for(const iterator of tokenize(text,";")){const trimmed=iterator.trim();if(!trimmed){break}const items=tokenizeMax(trimmed,"=",2).map((x=>x.trim()));let[key,value]=items;if(items.length===1){value=key;key=emptyName!==null&&emptyName!==void 0?emptyName:key}try{if(value.startsWith('"')){value=JSON.parse(value)}}catch(_a){}pairs[key]=value}return pairs})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/parsePairs");System.register(["./parsePairs"],(function(_export,_context){"use strict";var parsePairs,HeaderContentType;_export("HeaderContentType",void 0);return{setters:[function(_parsePairs){parsePairs=_parsePairs.parsePairs}],execute:function(){_export("HeaderContentType",HeaderContentType=class HeaderContentType{constructor(type,charset="UTF-8",boundary){this.type=type;this.charset=charset;this.boundary=boundary}parse(text){const items=parsePairs(text,"type");this.type=items.type;this.charset=items.charset;this.boundary=items.boundary}toString(){if(this.boundary){return`${this.type}; charset="${this.charset}"; boundary="${this.boundary}";`}return`${this.type}; charset="${this.charset}";`}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/HeaderContentType");System.register([],(function(_export,_context){"use strict";var toBuffer,RawBuffer;return{setters:[],execute:function(){toBuffer=text=>{const bytes=new Uint8Array(text.length);for(let index=0;index<text.length;index++){bytes[index]=text.charCodeAt(index)}return bytes.buffer};_export("RawBuffer",RawBuffer={decode:(bytesAsString,encoding="utf-8")=>{if(!encoding){return bytesAsString}const te=new TextDecoder(encoding);return te.decode(toBuffer(bytesAsString))},encode:(text,encoding="utf-8")=>{if(!/utf\-?8/i.test(encoding)){throw new Error(`Encoding ${encoding} not supported`)}const te=new TextEncoder;const array=te.encode(text);const a=[];for(const iterator of array){a.push(String.fromCharCode(iterator))}return a.join("")},toBase64Async(blob,asDataUrl=false){return new Promise(((resolve,reject)=>{const reader=new FileReader;reader.onerror=()=>{reject(reader.error)};reader.onload=()=>{const text=reader.result;if(asDataUrl){resolve(text);return}const index=text.indexOf(",");resolve(text.substring(index+1))};reader.readAsDataURL(blob)}))}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/encoder/RawBuffer");System.register(["./RawBuffer"],(function(_export,_context){"use strict";var RawBuffer,isEncodedRegEx,hexToUnicode,decode,isSimpleText,wordEncoding;return{setters:[function(_RawBuffer){RawBuffer=_RawBuffer.RawBuffer}],execute:function(){isEncodedRegEx=/\=\?([^\?\s]+)\?([^\?\s]{1})\?([^\s\?]+)\?\=\s*/gm;hexToUnicode=/(\=([0-9a-f]{2}))|(\_)/gim;decode=text=>text.replace(isEncodedRegEx,((matched,encoding,format,buffer)=>{if(/b/i.test(format)){return RawBuffer.decode(atob(buffer),encoding)}if(/q/i.test(format)){const replaced=buffer.replace(hexToUnicode,((m,group,code)=>{if(m==="_"){return" "}return String.fromCharCode(parseInt(code,16))}));return RawBuffer.decode(replaced,encoding)}return matched}));isSimpleText=/[0-9a-zA-Z\x20]/;_export("wordEncoding",wordEncoding={decode,encode:(word,ifNeeded=false)=>{if(ifNeeded){if(isSimpleText.test(word)){return word}}word=RawBuffer.encode(word);return`=?UTF-8?B?${btoa(word)}?=`}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/encoder/word-encoding");System.register(["./encoder/word-encoding","./parsePairs"],(function(_export,_context){"use strict";var wordEncoding,parsePairs,HeaderContentDisposition;_export("HeaderContentDisposition",void 0);return{setters:[function(_encoderWordEncoding){wordEncoding=_encoderWordEncoding.wordEncoding},function(_parsePairs){parsePairs=_parsePairs.parsePairs}],execute:function(){_export("HeaderContentDisposition",HeaderContentDisposition=class HeaderContentDisposition{constructor(type,filename,name){this.type=type;this.filename=filename;this.name=name}parse(text){const items=parsePairs(text,"type");this.type=items.type;this.filename=items.filename;this.name=items.name}toString(){return`${this.type};\r\n\t\tfilename="${wordEncoding.encode(this.filename)}";`}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/HeaderContentDisposition");System.register([],(function(_export,_context){"use strict";function base64toBlob(base64Data,contentType){contentType=contentType||"";const sliceSize=1024;const byteCharacters=atob(base64Data);const bytesLength=byteCharacters.length;const slicesCount=Math.ceil(bytesLength/sliceSize);const byteArrays=new Array(slicesCount);for(let sliceIndex=0;sliceIndex<slicesCount;++sliceIndex){const begin=sliceIndex*sliceSize;const end=Math.min(begin+sliceSize,bytesLength);const bytes=new Array(end-begin);for(let offset=begin,i=0;offset<end;++i,++offset){bytes[i]=byteCharacters[offset].charCodeAt(0)}byteArrays[sliceIndex]=new Uint8Array(bytes)}return new Blob(byteArrays,{type:contentType})}_export("base64toBlob",base64toBlob);return{setters:[],execute:function(){}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/encoder/base64-to-blob");System.register([],(function(_export,_context){"use strict";var stringFromCharCode,decode,handleTrailingCharacters,regexUnsafeSymbols,encode,quotedPrintable;return{setters:[],execute:function(){stringFromCharCode=String.fromCharCode;decode=function(input){return input.replace(/[\t\x20]$/gm,"").replace(/=(?:\r\n?|\n|$)/g,"").replace(/=([a-fA-F0-9]{2})/g,(function($0,$1){const codePoint=parseInt($1,16);return stringFromCharCode(codePoint)}))};handleTrailingCharacters=function(text){return text.replace(/\x20$/,"=20").replace(/\t$/,"=09")};regexUnsafeSymbols=/[\0-\x08\n-\x1F=\x7F-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g;encode=function(text){const encoded=text.replace(regexUnsafeSymbols,(function(symbol){if(symbol>"ÿ"){throw RangeError("`quotedPrintable.encode()` expects extended ASCII input only. "+"Don’t forget to encode the input first using a character "+"encoding like UTF-8.")}const codePoint=symbol.charCodeAt(0);const hexadecimal=codePoint.toString(16).toUpperCase();return"="+("0"+hexadecimal).slice(-2)}));const LINE_LENGTH=75;const lines=encoded.split(/\r\n?|\n/g);let lineIndex=-1;const lineCount=lines.length;const result=[];let buffer;while(++lineIndex<lineCount){const line=lines[lineIndex];let index=0;const length=line.length;while(index<length){buffer=encoded.slice(index,index+LINE_LENGTH);if(/=$/.test(buffer)){buffer=buffer.slice(0,LINE_LENGTH-1);index+=LINE_LENGTH-1}else if(/=[A-F0-9]$/.test(buffer)){buffer=buffer.slice(0,LINE_LENGTH-2);index+=LINE_LENGTH-2}else{index+=LINE_LENGTH}result.push(buffer)}}const lastLineLength=buffer.length;if(/[\t\x20]$/.test(buffer)){result.pop();if(lastLineLength+2<=LINE_LENGTH+1){result.push(handleTrailingCharacters(buffer))}else{result.push(buffer.slice(0,lastLineLength-1),handleTrailingCharacters(buffer.slice(lastLineLength-1,lastLineLength)))}}return result.join("=\r\n")};_export("quotedPrintable",quotedPrintable={encode,decode,version:"1.0.1"})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/encoder/quoted-printable");System.register(["tslib","../../common/QueryIterator","./AttachmentFile","./HeaderContentType","./HeaderContentDisposition","./encoder/RawBuffer","./encoder/base64-to-blob","./encoder/quoted-printable","./encoder/word-encoding"],(function(_export,_context){"use strict";var __asyncValues,__awaiter,QueryIterator,AttachmentFile,HeaderContentType,HeaderContentDisposition,RawBuffer,base64toBlob,quotedPrintable,wordEncoding,CIMap,MimeNode;_export({CIMap:void 0,MimeNode:void 0});return{setters:[function(_tslib){__asyncValues=_tslib.__asyncValues;__awaiter=_tslib.__awaiter},function(_commonQueryIterator){QueryIterator=_commonQueryIterator.default},function(_AttachmentFile){AttachmentFile=_AttachmentFile.AttachmentFile},function(_HeaderContentType){HeaderContentType=_HeaderContentType.HeaderContentType},function(_HeaderContentDisposition){HeaderContentDisposition=_HeaderContentDisposition.HeaderContentDisposition},function(_encoderRawBuffer){RawBuffer=_encoderRawBuffer.RawBuffer},function(_encoderBase64ToBlob){base64toBlob=_encoderBase64ToBlob.base64toBlob},function(_encoderQuotedPrintable){quotedPrintable=_encoderQuotedPrintable.quotedPrintable},function(_encoderWordEncoding){wordEncoding=_encoderWordEncoding.wordEncoding}],execute:function(){_export("CIMap",CIMap=class CIMap extends Map{constructor(){super(...arguments);this.ci=new Map}set(key,value){if(typeof key==="string"){let ck=this.ci.get(key);if(ck===void 0){ck=key.toLocaleLowerCase();this.ci.set(ck,key)}else{key=ck}}return super.set(key,value)}get(key){if(typeof key==="string"){const ck=key.toLocaleLowerCase();key=this.ci.get(ck)}return super.get(key)}});_export("MimeNode",MimeNode=class MimeNode{static createMessage({html,subject,text="",name="",attachments=[]}){const root=new MimeNode("multipart/mixed");root.setHeader("Subject",subject);if(name){root.setHeader("X-Name",name)}const body=new MimeNode("multipart/alternative");body.children=[];if(html){body.children.push(this.create(html,"text/html"))}if(text){body.children.push(this.create(text,"text/plain"))}root.children=[body];if(attachments){for(const iterator of attachments){root.children.push(this.create(iterator))}}return root}static create(text,type,id){if(typeof text==="string"){const node=new MimeNode(type);node.text=text;return node}const fileNode=new MimeNode(text.type);fileNode.blobData=text;fileNode.contentDisposition=new HeaderContentDisposition(type||"attachment");fileNode.contentDisposition.filename=text.name;fileNode.setHeader("Content-Disposition",fileNode.contentDisposition);if(id){fileNode.setHeader("Content-Id",id)}return fileNode}get text(){var _a,_b,_c;let{encoded}=this;if(!encoded){return}const cte=(_a=this.contentTransferEncoding)===null||_a===void 0?void 0:_a.toLowerCase();switch(cte){case"quoted-printable":encoded=quotedPrintable.decode(encoded);break;case"base64":encoded=btoa(encoded);break}return(_b=this.textContent)!==null&&_b!==void 0?_b:this.textContent=RawBuffer.decode(encoded,(_c=this.contentType)===null||_c===void 0?void 0:_c.charset)}set text(v){this.contentTransferEncoding="quoted-printable";this.textContent=v}get blob(){var _a,_b;if(((_a=this.contentTransferEncoding)===null||_a===void 0?void 0:_a.toLocaleLowerCase())!=="base64"){throw new Error("Not supported")}return(_b=this.blobData)!==null&&_b!==void 0?_b:this.blobData=base64toBlob(this.encoded,this.contentType.type)}set blob(v){this.blobData=v}get contentTransferEncoding(){return this.header("Content-Transfer-Encoding")}set contentTransferEncoding(v){this.setHeader("Content-Transfer-Encoding",v)}get boundary(){return this.contentType.boundary}get descendent(){return this.enumerate()}constructor(type){this.headers=new CIMap;this.contentType=new HeaderContentType(type);this.headers.set("Content-Type",this.contentType)}getFirstChild(contentType,create=false){var _a;contentType=contentType.toLocaleLowerCase();let child=QueryIterator.first(this.descendent,(x=>x.contentType.type===contentType));if(!child&&create){child=new MimeNode(contentType);((_a=this.children)!==null&&_a!==void 0?_a:this.children=[]).push(child)}return child}header(name){return this.headers.get(name)}setHeader(name,value){this.headers.set(name,value)}asFile(){return __awaiter(this,void 0,void 0,(function*(){const text=this.encoded.split("\n").map((x=>x.trim())).join("");const url=`data:${this.contentType.type};base64,${text}`;const blob=yield fetch(url);const af=new AttachmentFile([yield blob.blob()],this.contentDisposition.filename,{type:this.contentType.type,contentId:this.header("Content-Id"),disposition:this.contentDisposition.type});af.node=this;return af}))}attachments(files=[]){var _a;return __awaiter(this,void 0,void 0,(function*(){for(const iterator of this.children){if(iterator.children){yield iterator.attachments(files);continue}if((_a=iterator.contentDisposition)===null||_a===void 0?void 0:_a.type){files.push(yield iterator.asFile())}}return files}))}parse(lines,last=""){var _a,e_1,_b,_c,_d,e_2,_e,_f;var _g;return __awaiter(this,void 0,void 0,(function*(){yield this.parseHeaders(lines);let boundary=this.contentType.boundary;if(!boundary){const data=[];try{for(var _h=true,_j=__asyncValues(lines.read()),_k;_k=yield _j.next(),_a=_k.done,!_a;){_c=_k.value;_h=false;try{const line=_c;const trimmed=line.trimEnd();if(trimmed.length===0){break}if(trimmed===last){break}data.push(line)}finally{_h=true}}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(!_h&&!_a&&(_b=_j.return))yield _b.call(_j)}finally{if(e_1)throw e_1.error}}this.encoded=data.join("\n");return}boundary="--"+boundary;const end=boundary+"--";for(;;){let boundaryFound=false;try{for(var _l=true,_m=(e_2=void 0,__asyncValues(lines.read())),_o;_o=yield _m.next(),_d=_o.done,!_d;){_f=_o.value;_l=false;try{const line=_f;if(line===boundary){boundaryFound=true;break}if(line===end){return}}finally{_l=true}}}catch(e_2_1){e_2={error:e_2_1}}finally{try{if(!_l&&!_d&&(_e=_m.return))yield _e.call(_m)}finally{if(e_2)throw e_2.error}}if(!boundaryFound){break}const child=new MimeNode("");yield child.parse(lines,end);((_g=this.children)!==null&&_g!==void 0?_g:this.children=[]).push(child)}}))}parseHeaders(lines){var _a,e_3,_b,_c;var _d;return __awaiter(this,void 0,void 0,(function*(){let headerName="";let headerValue="";try{for(var _e=true,_f=__asyncValues(lines.read()),_g;_g=yield _f.next(),_a=_g.done,!_a;){_c=_g.value;_e=false;try{const iterator=_c;const value=iterator.trim();if(value.length===0){break}if(/^[\x20\t]/.test(iterator)){headerValue+=wordEncoding.decode(value);continue}if(headerValue){this.setHeader(headerName,headerValue)}const index=value.indexOf(":");headerName=value.substring(0,index);headerValue=wordEncoding.decode(value.substring(index+1).trim())}finally{_e=true}}}catch(e_3_1){e_3={error:e_3_1}}finally{try{if(!_e&&!_a&&(_b=_f.return))yield _b.call(_f)}finally{if(e_3)throw e_3.error}}if(headerValue){this.setHeader(headerName,headerValue)}const ct=this.header("Content-Type");this.contentType.parse(ct);this.setHeader("Content-Type",ct);const cd=this.header("Content-Disposition");if(cd){(_d=this.contentDisposition)!==null&&_d!==void 0?_d:this.contentDisposition=new HeaderContentDisposition;this.contentDisposition.parse(cd);this.setHeader("Content-Disposition",cd)}}))}save(writer){var _a,_b;var _c;return __awaiter(this,void 0,void 0,(function*(){if(this.textContent){this.contentType.charset="UTF-8"}if((_a=this.children)===null||_a===void 0?void 0:_a.length){(_c=this.contentType).boundary||(_c.boundary=`${Date.now()}-${Date.now()}-${Date.now()}`)}for(const[key,element]of this.headers.entries()){switch(key){case"content-disposition":writer.writeLine(`Content-Disposition: ${this.contentDisposition}`);continue;case"content-type":writer.writeLine(`Content-Type:${this.contentType.toString()}`);continue;case"subject":writer.writeLine(`${key}: ${wordEncoding.encode(element,true)}`);continue}writer.writeLine(`${key}: ${element}`)}writer.writeLine("");if((_b=this.children)===null||_b===void 0?void 0:_b.length){const boundary=`--${this.contentType.boundary}`;for(const iterator of this.children){writer.writeLine(boundary);yield iterator.save(writer);writer.writeLine("")}writer.writeLine(boundary+"--");return}if(this.blobData){const base64=yield RawBuffer.toBase64Async(this.blobData);let start=0;const max=80;for(;;){if(start+max>base64.length){writer.writeLine(base64.substring(start));break}writer.writeLine(base64.substring(start,start+max));start+=max}writer.writeLine("");return}let text=this.text;if(this.contentTransferEncoding==="quoted-printable"){text=quotedPrintable.encode(RawBuffer.encode(text))}writer.writeLine(RawBuffer.encode(text));writer.writeLine("");return}))}*enumerate(){yield this;if(!this.children){return}for(const iterator of this.children){yield*iterator.enumerate()}}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/MimeNode");System.register(["tslib","../tokenizer"],(function(_export,_context){"use strict";var __asyncGenerator,__await,tokenize,LineStream,StringLineStream,ReadableLineStream;_export({default:void 0,StringLineStream:void 0,ReadableLineStream:void 0});return{setters:[function(_tslib){__asyncGenerator=_tslib.__asyncGenerator;__await=_tslib.__await},function(_tokenizer){tokenize=_tokenizer.tokenize}],execute:function(){_export("default",LineStream=class LineStream{read(){var _a;return __asyncGenerator(this,arguments,(function*read_1(){const g=(_a=this.g)!==null&&_a!==void 0?_a:this.g=this.lines();for(;;){const{value,done}=yield __await(g.next());if(done){break}yield yield __await(value)}}))}});_export("StringLineStream",StringLineStream=class StringLineStream extends LineStream{constructor(text){super();this.text=text}lines(){return __asyncGenerator(this,arguments,(function*lines_1(){for(const iterator of tokenize(this.text,"\n")){yield yield __await(iterator)}}))}});_export("ReadableLineStream",ReadableLineStream=class ReadableLineStream extends LineStream{constructor(readable){super();this.readable=readable}lines(){return __asyncGenerator(this,arguments,(function*lines_2(){const utf8Decoder=new TextDecoder("utf-8");const reader=this.readable.getReader();let{value:chunk,done:readerDone}=yield __await(reader.read());chunk=chunk?utf8Decoder.decode(chunk,{stream:true}):"";const re=/\r\n|\n|\r/gm;let startIndex=0;for(;;){const result=re.exec(chunk);if(!result){if(readerDone){break}const remainder=chunk.substr(startIndex);({value:chunk,done:readerDone}=yield __await(reader.read()));chunk=remainder+(chunk?utf8Decoder.decode(chunk,{stream:true}):"");startIndex=re.lastIndex=0;continue}yield yield __await(chunk.substring(startIndex,result.index));startIndex=re.lastIndex}if(startIndex<chunk.length){yield yield __await(chunk.substr(startIndex))}}))}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/stream/LineStream");System.register([],(function(_export,_context){"use strict";var TextWriter,BlobWriter;_export({default:void 0,BlobWriter:void 0});return{setters:[],execute:function(){_export("default",TextWriter=class TextWriter{});_export("BlobWriter",BlobWriter=class BlobWriter extends TextWriter{constructor(){super(...arguments);this.lines=[]}writeLine(line){this.lines.push(line)}toBlob(){const all=this.lines.join("\n");return new Blob([all],{})}toString(){return this.lines.join("\n")}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/stream/TextWriter");System.register(["tslib","./MimeNode","./stream/LineStream","./stream/TextWriter"],(function(_export,_context){"use strict";var __awaiter,MimeNode,ReadableLineStream,StringLineStream,BlobWriter,MimeMessage;_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter},function(_MimeNode){MimeNode=_MimeNode.MimeNode},function(_streamLineStream){ReadableLineStream=_streamLineStream.ReadableLineStream;StringLineStream=_streamLineStream.StringLineStream},function(_streamTextWriter){BlobWriter=_streamTextWriter.BlobWriter}],execute:function(){_export("default",MimeMessage=class MimeMessage{static load(reader,name,inline){return __awaiter(this,void 0,void 0,(function*(){const node=new MimeNode;if(name){node.setHeader("X-Name",name)}yield node.parse(typeof reader==="string"?new StringLineStream(reader):new ReadableLineStream(reader));const attachments=yield node.attachments();const msg=new MimeMessage(node,attachments);if(inline){yield msg.inlineImages()}return msg}))}get name(){return this.node.header("x-name")}get html(){var _a,_b;const alternative=this.node.getFirstChild("multipart/alternative");return(_b=(_a=alternative===null||alternative===void 0?void 0:alternative.getFirstChild("text/html"))===null||_a===void 0?void 0:_a.text)!==null&&_b!==void 0?_b:""}set html(v){const alternative=this.node.getFirstChild("multipart/alternative",true);const htmlMime=alternative.getFirstChild("text/html",true);htmlMime.contentTransferEncoding="quoted-printable";htmlMime.text=v;htmlMime.contentType.charset="UTF-8"}get text(){var _a,_b;const alternative=this.node.getFirstChild("multipart/alternative");return(_b=(_a=alternative===null||alternative===void 0?void 0:alternative.getFirstChild("text/plain"))===null||_a===void 0?void 0:_a.text)!==null&&_b!==void 0?_b:""}set text(v){const alternative=this.node.getFirstChild("multipart/alternative",true);const htmlMime=alternative.getFirstChild("text/plain",true);htmlMime.contentTransferEncoding="quoted-printable";htmlMime.text=v;htmlMime.contentType.charset="UTF-8"}get subject(){var _a;return(_a=this.node.header("subject"))!==null&&_a!==void 0?_a:""}set subject(v){this.node.setHeader("subject",v)}constructor(node=new MimeNode("multipart/mixed"),attachments=[]){this.node=node;this.attachments=attachments}save(){return __awaiter(this,void 0,void 0,(function*(){const blobWriter=new BlobWriter;yield this.node.save(blobWriter);return blobWriter.toBlob()}))}inlineImages(){return __awaiter(this,void 0,void 0,(function*(){let text=this.html;if(!text){return}for(const iterator of this.attachments){if(iterator.contentId){const encoded=iterator.node.encoded;text=text.split(`cid:${iterator.contentId}`).join(`data://${iterator.type},${encoded}`)}}}))}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/mime-service/MimeMessage");System.register(["tslib","@web-atoms/web-controls/dist/mobile-app/MobileApp","@web-atoms/core/dist/core/XNode","@web-atoms/core/dist/core/Bind","../../../common/controls/html/InlineHtmlEditorWithToolbar","../../../services/mime-service/MimeNode","@web-atoms/web-controls/dist/basic/Form","@web-atoms/web-controls/dist/basic/FormField","../../../common/controls/buttons/IconButton","@web-atoms/core/dist/view-model/Action","../../../services/mime-service/MimeMessage","@web-atoms/web-controls/dist/basic/AtomRepeater","@web-atoms/core/dist/web/core/AtomUI","../../../services/mime-service/stream/TextWriter","../../../services/files/LocalFileService"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,ContentPage,XNode,Bind,InlineHtmlEditorWithToolbar,MimeNode,Form,FormField,SaveIconTextButton,Action,MimeMessage,AtomRepeater,descendentElementIterator,BlobWriter,LocalFileService,EditTemplatePage;_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsWebControlsDistMobileAppMobileApp){ContentPage=_webAtomsWebControlsDistMobileAppMobileApp.ContentPage},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsCoreDistCoreBind){Bind=_webAtomsCoreDistCoreBind.default},function(_commonControlsHtmlInlineHtmlEditorWithToolbar){InlineHtmlEditorWithToolbar=_commonControlsHtmlInlineHtmlEditorWithToolbar.default},function(_servicesMimeServiceMimeNode){MimeNode=_servicesMimeServiceMimeNode.MimeNode},function(_webAtomsWebControlsDistBasicForm){Form=_webAtomsWebControlsDistBasicForm.default},function(_webAtomsWebControlsDistBasicFormField){FormField=_webAtomsWebControlsDistBasicFormField.default},function(_commonControlsButtonsIconButton){SaveIconTextButton=_commonControlsButtonsIconButton.SaveIconTextButton},function(_webAtomsCoreDistViewModelAction){Action=_webAtomsCoreDistViewModelAction.default},function(_servicesMimeServiceMimeMessage){MimeMessage=_servicesMimeServiceMimeMessage.default},function(_webAtomsWebControlsDistBasicAtomRepeater){AtomRepeater=_webAtomsWebControlsDistBasicAtomRepeater.default},function(_webAtomsCoreDistWebCoreAtomUI){descendentElementIterator=_webAtomsCoreDistWebCoreAtomUI.descendentElementIterator},function(_servicesMimeServiceStreamTextWriter){BlobWriter=_servicesMimeServiceStreamTextWriter.BlobWriter},function(_servicesFilesLocalFileService){LocalFileService=_servicesFilesLocalFileService.default}],execute:function(){_export("default",EditTemplatePage=class EditTemplatePage extends ContentPage{init(){return __awaiter(this,void 0,void 0,(function*(){this.model=yield this.loadModel(this.parameters.file);this.renderer=XNode.create("div",{"data-layout":"center-page-900px"},XNode.create(Form,null,XNode.create(FormField,{label:"File Name:"},XNode.create("input",{value:Bind.twoWaysImmediate((()=>this.model.name))})),XNode.create(FormField,{label:"Subject:"},XNode.create("input",{value:Bind.twoWaysImmediate((()=>this.model.subject))})),XNode.create(InlineHtmlEditorWithToolbar,{inlineImage:true,presenter:Bind.presenter((c=>this.editor=c)),"event-content-ready":()=>this.setupEditable(),content:this.model.htmlBody,"style-min-height":"200px"}),XNode.create(AtomRepeater,{items:this.model.attachments,"data-layout":"flex-wrap-padding",itemRenderer:item=>XNode.create("div",null,XNode.create("i",{class:"fas fa-file"}),XNode.create("span",{text:item.name}))}),XNode.create("div",null,XNode.create(SaveIconTextButton,{"data-click-event":"save-template",text:"Save"}))))}))}loadModel(file){return __awaiter(this,void 0,void 0,(function*(){if(file.appFileID){const data=yield fetch(file.url);const node=yield MimeMessage.load(data.body,file.name);const name=node.name;const htmlBody=node.html;const attachments=node.attachments;const subject=node.subject;return{node:node.node,mime:node,name,subject,htmlBody,attachments}}return{name:"Template 1",subject:"Template Subject",htmlBody:`<div contentEditable="true"><p><br/><br/><br/><br/><br/></p></div>`,attachments:[]}}))}saveTemplate(){var _a,_b;return __awaiter(this,void 0,void 0,(function*(){const{html,text}=this.editor.htmlTextContent;const root=MimeNode.createMessage({subject:this.model.subject,name:this.model.name,html,text,attachments:this.model.attachments});const blobWriter=new BlobWriter;yield root.save(blobWriter);const blob=blobWriter.toBlob();const localFileService=this.resolve(LocalFileService);const file=new File([blob],this.model.name,{type:"message/rfc822"});const appFileID=(_b=(_a=this.parameters.file)===null||_a===void 0?void 0:_a.appFileID)!==null&&_b!==void 0?_b:void 0;const parentID=appFileID?void 0:this.parameters.file.parentID;yield localFileService.uploadWithProgress([file],{appFileID,parentID})}))}setupEditable(){const editor=this.editor.editor;if(editor.isContentEditable){return}for(const node of descendentElementIterator(editor)){if(node.isContentEditable){return}}editor.contentEditable="true"}});__decorate([Action({onEvent:"save-template"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],EditTemplatePage.prototype,"saveTemplate",null)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/web/page/templates/EditTemplatePage");System.register(["tslib","@web-atoms/web-controls/dist/mobile-app/MobileApp","../../../model/model","@web-atoms/core/dist/core/XNode","@web-atoms/web-controls/dist/basic/UploadEvent","@web-atoms/web-controls/dist/basic/AtomRepeater","../../../common/controls/tree/TreeView","@web-atoms/core/dist/core/Bind","@web-atoms/core/dist/view-model/Action","./service/CloudFileService","@web-atoms/core/dist/core/InjectProperty","@web-atoms/core/dist/style/styled","../../../common/NumberFormats","../../../common/controls/drag-drop/FilesDragDrop","@web-atoms/web-controls/dist/basic/PopupButton","@web-atoms/web-controls/dist/PageNavigator","./shares/EditSharesPage","../templates/EditTemplatePage"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,ContentPage,AppFile,XNode,UploadEvent,AtomRepeater,SelectAll,SelectorCheckBox,TreeView,Bind,Action,CloudFileService,InjectProperty,styled,toFileSize,FilesDragDrop,PopupButton,MenuItem,PageNavigator,EditSharesPage,EditTemplatePage,FolderPage,css,getExtension;_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsWebControlsDistMobileAppMobileApp){ContentPage=_webAtomsWebControlsDistMobileAppMobileApp.ContentPage},function(_modelModel){AppFile=_modelModel.AppFile},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsWebControlsDistBasicUploadEvent){UploadEvent=_webAtomsWebControlsDistBasicUploadEvent.default},function(_webAtomsWebControlsDistBasicAtomRepeater){AtomRepeater=_webAtomsWebControlsDistBasicAtomRepeater.default;SelectAll=_webAtomsWebControlsDistBasicAtomRepeater.SelectAll;SelectorCheckBox=_webAtomsWebControlsDistBasicAtomRepeater.SelectorCheckBox},function(_commonControlsTreeTreeView){TreeView=_commonControlsTreeTreeView.default},function(_webAtomsCoreDistCoreBind){Bind=_webAtomsCoreDistCoreBind.default},function(_webAtomsCoreDistViewModelAction){Action=_webAtomsCoreDistViewModelAction.default},function(_serviceCloudFileService){CloudFileService=_serviceCloudFileService.default},function(_webAtomsCoreDistCoreInjectProperty){InjectProperty=_webAtomsCoreDistCoreInjectProperty.default},function(_webAtomsCoreDistStyleStyled){styled=_webAtomsCoreDistStyleStyled.default},function(_commonNumberFormats){toFileSize=_commonNumberFormats.toFileSize},function(_commonControlsDragDropFilesDragDrop){FilesDragDrop=_commonControlsDragDropFilesDragDrop.FilesDragDrop},function(_webAtomsWebControlsDistBasicPopupButton){PopupButton=_webAtomsWebControlsDistBasicPopupButton.default;MenuItem=_webAtomsWebControlsDistBasicPopupButton.MenuItem},function(_webAtomsWebControlsDistPageNavigator){PageNavigator=_webAtomsWebControlsDistPageNavigator.default},function(_sharesEditSharesPage){EditSharesPage=_sharesEditSharesPage.default},function(_templatesEditTemplatePage){EditTemplatePage=_templatesEditTemplatePage.default}],execute:function(){css=styled.css`
2065
2065
  display: grid;
2066
2066
  grid-template-columns: 200px 1fr;
2067
2067
  gap: 5px;
@@ -4452,6 +4452,31 @@ display: grid;
4452
4452
  pointer-events: none;
4453
4453
  outline: solid 1px green;
4454
4454
  z-index: 22;
4455
+ & > .lt, & > .rt, & > .lb, & > .rb {
4456
+ position: absolute;
4457
+ width: 10px;
4458
+ height: 10px;
4459
+ background-color: blue;
4460
+ border: solid 1px white;
4461
+ display: none;
4462
+ border-radius: 5px;
4463
+ }
4464
+ & > .lt {
4465
+ top: -5px;
4466
+ left: -5px;
4467
+ }
4468
+ & > .rt {
4469
+ top: -5px;
4470
+ right: -5px;
4471
+ }
4472
+ & > .lb {
4473
+ bottom: -5px;
4474
+ left: -5px;
4475
+ }
4476
+ & > .rb {
4477
+ bottom: -5px;
4478
+ right: -5px;
4479
+ }
4455
4480
  & > div {
4456
4481
  pointer-events: all;
4457
4482
  position: absolute;
@@ -4502,7 +4527,7 @@ display: grid;
4502
4527
  z-index: 50;
4503
4528
  }
4504
4529
  }
4505
- `.installGlobal("[data-html-page-editor=html-page-editor]");desktopWidth=992;tabletWidth=768;mobileWidth=480;_export("default",HtmlPageEditor=class HtmlPageEditor extends AtomControl{get htmlPage(){var _a,_b,_c;return(_a=this.lastCommittedHtml)!==null&&_a!==void 0?_a:(_c=(_b=this.htmlDocument)===null||_b===void 0?void 0:_b.documentElement)===null||_c===void 0?void 0:_c.outerHTML}set htmlPage(v){if(!this.element){return}if(!this.ready){setTimeout((()=>{this.htmlPage=v}),100);return}void this.ready.then((()=>{var _a;const dom=new DOMParser;const doc=dom.parseFromString(v,"text/html");let baseElement=doc.querySelector("base");if((_a=baseElement===null||baseElement===void 0?void 0:baseElement.getAttribute("href"))===null||_a===void 0?void 0:_a.startsWith("/api/site/")){baseElement.remove();baseElement=null}if(baseElement){const href=baseElement.getAttribute("href");if(href!==this.baseUrl){this.originalBaseUrl=href;baseElement.setAttribute("href",this.baseUrl)}}else{baseElement=doc.createElement("base");baseElement.setAttribute("href",this.baseUrl);doc.head.insertAdjacentElement("afterbegin",baseElement)}return this.initDocument(doc.documentElement.outerHTML)}))}constructor(app,e){super(app,e);this.selection=new SelectedElement(this);this.undoList=[];this.redoList=[];this.pageVariables=[];this.lastCommittedHtml=null;this.lastCommittedBody=null;this.hover=new SelectedElement(this);this.dropTarget=new SelectedElement(this);this.maxWidth=desktopWidth;this.ready=this.init()}init(){return __awaiter(this,void 0,void 0,(function*(){this.render(XNode.create("div",{"data-html-page-editor":"html-page-editor"},XNode.create("div",{"data-element":"top"},XNode.create(EditorToolbar,{"data-element":"max-width","event-click":()=>this.deferUpdate()},XNode.create("i",{"data-selected":Bind.oneWay((()=>this.maxWidth===desktopWidth)),"event-click":()=>this.maxWidth=desktopWidth,class:"fas fa-desktop"}),XNode.create("i",{"data-selected":Bind.oneWay((()=>this.maxWidth===tabletWidth)),"event-click":()=>this.maxWidth=tabletWidth,class:"fas fa-tablet-screen"}),XNode.create("i",{"data-selected":Bind.oneWay((()=>this.maxWidth===mobileWidth)),"event-click":()=>this.maxWidth=mobileWidth,class:"fas fa-mobile-screen"})),XNode.create(UndoRedoToolbar,null),XNode.create(EditorToolbar,null,XNode.create("i",{"data-click-event":"edit-code",class:"fa-solid fa-code"}))),XNode.create(EditorToolbar,{"data-element":"left"},XNode.create(TextBox,null),XNode.create(Image,null),XNode.create(WrapGrid,null),XNode.create(ImageBox,null),XNode.create(RightImageBox,null),XNode.create(Card,null),XNode.create(ImageCard,null),XNode.create(ColumnBox,null),XNode.create(Columns2,null),XNode.create(Columns3,null),XNode.create(List,null),XNode.create(ImageLink,null),XNode.create(LinkButton,null),XNode.create(InlinePopupButton,{icon:"fas fa-plus","data-layout":"warning-icon-button",alignment:"above",popup:()=>XNode.create(EditorToolbar,null,XNode.create(RowBox,null),XNode.create(VerticalImageBox,null),XNode.create(PriceTable,null),XNode.create(TypeWriterComponent,null),XNode.create(Billboard,null),XNode.create(PDFFlipBook,null),XNode.create(PDFViewer,null),XNode.create(OutlineText,null),XNode.create(Carousel,null),XNode.create(BlogComponent,null),XNode.create(BoxFrame,null),XNode.create(VideoPlayer,null),XNode.create(BackgroundVideo,null),XNode.create(TextMask,null),XNode.create(InjectBox,null),XNode.create(ImageGrid,null),XNode.create(ImageGallery,null),XNode.create(MarqueeText,null),XNode.create(Banner,null))})),XNode.create("div",{"data-element":"editor","style-max-width":Bind.oneWay((()=>this.maxWidth>768?"":this.maxWidth+"px"))},XNode.create("div",{"data-element":"resizer"}),XNode.create("div",{"data-element":"drop-target","style-display":Bind.oneWay((()=>this.dropTarget.element?"":"none")),"style-position":"absolute","style-left":Bind.oneWay((()=>this.dropTarget.left)),"style-top":Bind.oneWay((()=>this.dropTarget.top)),"style-width":Bind.oneWay((()=>this.dropTarget.width)),"style-height":Bind.oneWay((()=>this.dropTarget.height))}),XNode.create("div",{"data-element":"selection","style-left":Bind.oneWay((()=>this.selection.left)),"style-top":Bind.oneWay((()=>this.selection.top)),"style-width":Bind.oneWay((()=>this.selection.width)),"style-height":Bind.oneWay((()=>this.selection.height))},XNode.create("div",null,XNode.create("i",{class:"fa-regular fa-arrow-up","event-click":()=>{if(this.selection.element.parentElement!==this.htmlDocument.body){this.selection.update(this.selection.element.parentElement)}}}),XNode.create("i",{"event-click":()=>{this.selection.setDraggable()},class:"fa-solid fa-up-down-left-right","data-click-event":"start-drag"}),XNode.create("i",{"style-display":Bind.oneWay((()=>this.selection.isImage)),"data-click-event":"change-image",title:"Change Image (Double Click)",class:"fa-solid fa-arrows-rotate-reverse"}),XNode.create("i",{title:"Duplicate","data-click-event":"copy-element",class:"fas fa-copy"}),XNode.create("i",{title:"Move Up","data-click-event":"move-up-element",class:"fa-duotone fa-angles-up"}),XNode.create("i",{title:"Move Down","data-click-event":"move-down-element",class:"fa-duotone fa-angles-down"}),XNode.create("i",{title:"Extract Fragment","data-click-event":"extract-element",class:"fad fa-file-export"}),XNode.create("i",{title:"Delete","data-click-event":"delete-element",class:"fas fa-trash-can"}))),XNode.create("div",{"data-element":"hover","style-left":Bind.oneWay((()=>this.hover.left)),"style-top":Bind.oneWay((()=>this.hover.top)),"style-width":Bind.oneWay((()=>this.hover.width)),"style-height":Bind.oneWay((()=>this.hover.height))},XNode.create("label",{text:Bind.oneWay((()=>this.hover.name))})),XNode.create("div",{"data-element":"content-frame"},XNode.create("iframe",{"data-element":"content-editor",sandbox:"allow-same-origin "}))),XNode.create("div",{"data-element":"right"},XNode.create("button",{"data-click-event":"open-variables","data-layout":"icon-button"},XNode.create("i",{class:"fas fa-code"}),"Variables"),XNode.create(Properties,null)),XNode.create(BreadCrum,{selection:Bind.oneWay((()=>this.selection.element))})));this.contentEditor=this.element.querySelector(`[data-element="content-editor"]`)}))}buildXNode(node){const build=n=>{const e=this.htmlDocument.createElement(n.name);if(n.attributes){for(const key in n.attributes){if(Object.prototype.hasOwnProperty.call(n.attributes,key)){const element=n.attributes[key];e.setAttribute(key,element)}}}if(n.children){for(const iterator of n.children){if(typeof iterator==="string"){e.append(iterator);continue}e.appendChild(build(iterator))}}return e};return build(node)}deleteElement(){var _a;return __awaiter(this,void 0,void 0,(function*(){const current=this.selection.element;let previous=(_a=current.previousElementSibling)!==null&&_a!==void 0?_a:current.parentElement;current.remove();this.commit();if(!previous.textContent){previous=previous.previousElementSibling.lastElementChild}this.setSelection(previous);yield sleep(100);this.selection.update()}))}copyElement(){const current=this.selection.element;const copy=current.cloneNode(true);for(const iterator of descendentElementIterator(copy)){if(iterator.id){iterator.id=`sm-${Date.now()}`}}current.insertAdjacentElement("afterend",copy);this.commit()}moveUpElement(){const current=this.selection.element;const prevSibling=current.previousElementSibling;if(!prevSibling){return}current.remove();prevSibling.insertAdjacentElement("beforebegin",current);this.commit()}moveDownElement(){const current=this.selection.element;const nextSibling=current.nextElementSibling;if(!nextSibling){return}current.remove();nextSibling.insertAdjacentElement("afterend",current);this.commit()}changeImage(){return __awaiter(this,void 0,void 0,(function*(){return this.insertImage({src:prompt("Image Src","")})}))}changeBackgroundImage(){return __awaiter(this,void 0,void 0,(function*(){const img=prompt("Image Src","");this.selection.element.style.setProperty("--styler-background-image",`url(${JSON.stringify(img)})`);return}))}extractElement(){return __awaiter(this,void 0,void 0,(function*(){alert("Not implemented")}))}onKeyUp(d,ke){if(ke.ctrlKey){switch(ke.key){case"z":ke.preventDefault();this.undo();break;case"y":ke.preventDefault();this.redo();break}}}insertImage(...images){var _a;return __awaiter(this,void 0,void 0,(function*(){let img=((_a=this.selection)===null||_a===void 0?void 0:_a.isImage)?this.selection.element:null;const container=img?img.parentElement:this.selection.element;for(let _b of images){const{src,style}=_b,a=__rest(_b,["src","style"]);if(!img){img=this.htmlDocument.createElement("img");container.appendChild(img);container.appendChild(document.createTextNode("\n"))}img.src=src;const i=img;img.onload=()=>{this.selection.update();i.onload=null};if(style){for(const key in style){if(Object.prototype.hasOwnProperty.call(style,key)){const element=style[key];img.style[key]=element}}}if(a){for(const key in a){if(Object.prototype.hasOwnProperty.call(a,key)){const element=a[key];img.setAttribute(key,element)}}}img=null}this.commit()}))}insertElement(e,parent=this.selection.element,preferMain=false){if(preferMain){while(parent.parentElement!==this.htmlDocument.body){parent=parent.parentElement}}parent.appendChild(e);if(!e.id){e.id="sm-"+Date.now().toString()}setTimeout((()=>{this.setSelection(e);this.commit()}),100)}deferUpdate(){var _a,_b;return __awaiter(this,void 0,void 0,(function*(){yield sleep(100);(_a=this.hover)===null||_a===void 0?void 0:_a.update();(_b=this.selection)===null||_b===void 0?void 0:_b.update()}))}setSelection(element,commit=true){var _a;const old=(_a=this.selection)===null||_a===void 0?void 0:_a.element;if(old===null||old===void 0?void 0:old.draggable){old.removeAttribute("draggable")}this.selection.update(element);if(commit){this.commit()}}commit(){var _a;this.redoList.clear();const lastHtml=this.lastHtml;const clone=this.htmlDocument.documentElement.cloneNode(true);const currentHtml=clone.innerHTML;if(lastHtml===currentHtml){return}const body=clone.querySelector("body");body.removeAttribute("contentEditable");body.removeAttribute("editing");const all=clone.querySelectorAll("*");const deleteAll=[];const removeAll=[];for(let index=0;index<all.length;index++){const element=all[index];element.removeAttribute("draggable");if(element.tagName==="INJECT"){deleteAll.push(element)}if(element.getAttribute("data-cursor-style")==="editing"){removeAll.push(element)}}for(const iterator of deleteAll){iterator.innerHTML=""}for(const iterator of removeAll){iterator.remove()}if(clone.querySelector(`[styler-layout="component"]`)){let componentScript=clone.querySelector("[styler-component-script]");if(!componentScript){componentScript=this.htmlDocument.createElement("script");const head=clone.querySelector("head");head.appendChild(componentScript)}componentScript.src=UMD.resolvePath("@social-mail/social-mail-client/component.js");componentScript.setAttribute("styler-component-script","component-script")}if(this.baseUrl){if(!this.originalBaseUrl){(_a=clone.querySelector("base"))===null||_a===void 0?void 0:_a.remove()}else{const baseUrl=clone.querySelector("base");if(baseUrl){baseUrl.setAttribute("href",this.originalBaseUrl)}}}if(!lastHtml){this.lastHtml=currentHtml;this.lastCommittedHtml=clone.outerHTML;this.lastCommittedBody=body.innerHTML;return}this.undoList.add(this.lastHtml);this.lastHtml=currentHtml;this.lastCommittedHtml=clone.outerHTML;this.lastCommittedBody=body.innerHTML;this.element.dispatchEvent(new CustomEvent("htmlPageChanged",{detail:clone.outerHTML,bubbles:true}));AtomBinder.refreshValue(this,"htmlPage");setTimeout((()=>{this.selection.update();this.hover.update()}),100)}undo(){if(!this.undoList.length){return}this.redoList.insert(this.redoList.length,this.htmlDocument.documentElement.innerHTML);const lastHtml=this.undoList.pop();this.htmlDocument.documentElement.innerHTML=lastHtml;this.lastHtml=lastHtml;this.htmlDocument.body.contentEditable="true";this.htmlDocument.body.setAttribute("editing","true")}redo(){if(!this.redoList.length){return}this.undoList.insert(this.undoList.length,this.htmlDocument.documentElement.innerHTML);const lastHtml=this.redoList.pop();this.htmlDocument.documentElement.innerHTML=lastHtml;this.lastHtml=lastHtml;this.htmlDocument.body.contentEditable="true";this.htmlDocument.body.setAttribute("editing","true")}initDocument(v){void this.ready.then((()=>__awaiter(this,void 0,void 0,(function*(){this.htmlDocument=void 0;yield this.loadContentDocument();this.htmlDocument.open();this.htmlDocument.write(v);this.htmlDocument.addEventListener("click",(e=>{const target=e.target;const previous=this.selection.element;if(previous===null||previous===void 0?void 0:previous.isContentEditable){let start=target;while(start){if(previous===target){return}start=start.parentElement}if(previous!==this.htmlDocument.body){previous.removeAttribute("contentEditable")}this.queueCommit()}e.preventDefault();this.setSelection(target)}));this.htmlDocument.addEventListener("dblclick",(e=>{const target=e.target;e.preventDefault();const element=target.nodeType===Node.ELEMENT_NODE?target:target.parentElement;if(/^(IMG|INJECT|VIDEO|PDF)/.test(element.tagName)){this.changeImage().catch(console.error);return}if(element.getAttribute("data-editable")==="false"){return}if(element.hasAttribute("data-web-atoms-view")){return}this.setSelection(element)}));this.htmlDocument.addEventListener("scroll",(e=>{this.hover.update();this.selection.update()}),{passive:true});this.htmlDocument.addEventListener("pointerover",(e=>{let target=e.target;target=target.nodeType===Node.ELEMENT_NODE&&target.tagName?target:target.parentElement;if(this.hover.element===target){return}this.hover.update(target)}),{capture:true});this.htmlDocument.addEventListener("keydown",(e=>{if(e.ctrlKey||e.metaKey){switch(e.key){case"s":this.contentEditor.dispatchEvent(new CustomEvent("savePage",{bubbles:true}));e.preventDefault();break;case"z":this.contentEditor.dispatchEvent(new CustomEvent("undo",{bubbles:true}));e.preventDefault();break;case"y":this.contentEditor.dispatchEvent(new CustomEvent("redo",{bubbles:true}));e.preventDefault();break}}}));this.htmlDocument.addEventListener("input",(()=>this.queueCommit()));InstallDragDropHelper(this);this.htmlDocument.close();EditorCustomElements.register(this.htmlDocument);this.htmlDocument.body.contentEditable="true";this.htmlDocument.body.setAttribute("editing","true");const cursorStyle=this.htmlDocument.createElement("style");cursorStyle.textContent=`* {\n caret-color: currentColor !important;\n }`;cursorStyle.setAttribute("data-cursor-style","editing");this.htmlDocument.head.append(cursorStyle);setTimeout((()=>{this.app.runAsync((()=>__awaiter(this,void 0,void 0,(function*(){yield this.setStylerSheet();this.loadVariables();this.commit()}))))}),10)}))))}queueCommit(){const id=this.lastCommitTimerID;if(id){clearTimeout(id)}this.lastCommitTimerID=setTimeout((()=>this.commit()),1e3)}setStylerSheet(){return __awaiter(this,void 0,void 0,(function*(){const document=this.htmlDocument;let style=document.querySelector(`[styler-style-sheet]`);if(!style){style=document.createElement("style");style.setAttribute("styler-style-sheet","inline");document.head.appendChild(style)}style.textContent=StylerSet.instance.toString()}))}loadVariables(){const onChange=()=>{const document=this.htmlDocument;let style=document.querySelector("[styler-style-variables]");if(!style){style=document.createElement("style");style.setAttribute("styler-style-variables","override");document.head.appendChild(style)}style.textContent=`:root {\n ${this.pageVariables.map((x=>`${x.propertyName}: ${x.currentValue};`)).join("\n\t")}\n }`};this.pageVariables=StylerSet.instance.vars.map((x=>new StylerVariable(x.name,x.value,this.htmlDocument,onChange)))}loadContentDocument(){return __awaiter(this,void 0,void 0,(function*(){this.contentEditor=this.element.querySelector(`[data-element="content-editor"]`);while(!this.htmlDocument){this.htmlDocument=this.contentEditor.contentDocument;yield sleep(100)}}))}});__decorate([BindableProperty,__metadata("design:type",String)],HtmlPageEditor.prototype,"baseUrl",void 0);__decorate([Action({onEvent:"delete-element"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],HtmlPageEditor.prototype,"deleteElement",null);__decorate([Action({onEvent:"copy-element",blockMultipleExecution:false}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],HtmlPageEditor.prototype,"copyElement",null);__decorate([Action({onEvent:"move-up-element",blockMultipleExecution:false}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],HtmlPageEditor.prototype,"moveUpElement",null);__decorate([Action({onEvent:"move-down-element",blockMultipleExecution:false}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],HtmlPageEditor.prototype,"moveDownElement",null);__decorate([Action({onEvent:"change-image"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],HtmlPageEditor.prototype,"changeImage",null);__decorate([Action({onEvent:"change-background-image"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],HtmlPageEditor.prototype,"changeBackgroundImage",null);__decorate([Action({onEvent:"extract-element"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],HtmlPageEditor.prototype,"extractElement",null);__decorate([Action({onEvent:"keyup"}),__metadata("design:type",Function),__metadata("design:paramtypes",[Object,KeyboardEvent]),__metadata("design:returntype",void 0)],HtmlPageEditor.prototype,"onKeyUp",null);__decorate([Action({onEvent:"undo"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],HtmlPageEditor.prototype,"undo",null);__decorate([Action({onEvent:"redo"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],HtmlPageEditor.prototype,"redo",null)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/site-editor/editor/HtmlPageEditor");System.register(["tslib","@web-atoms/web-controls/dist/mobile-app/MobileApp","@web-atoms/core/dist/core/XNode","../../../../common/controls/tree/FileTreeView","@web-atoms/web-controls/dist/basic/AtomRepeater","@web-atoms/core/dist/core/Bind","@web-atoms/core/dist/core/InjectProperty","../service/CloudFileService","@web-atoms/core/dist/style/styled","../../../../common/controls/drag-drop/FilesDragDrop","@web-atoms/core/dist/view-model/Action","@web-atoms/web-controls/dist/basic/UploadEvent","../../../../common/controls/buttons/IconButton","../../../../common/fileUrl"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,PopupWindowPage,XNode,FolderTreeView,AtomRepeater,SelectAll,SelectorCheckBox,Bind,InjectProperty,CloudFileService,styled,FilesDragDrop,Action,UploadEvent,SaveIconTextButton,fileUrl,ChooseMediaPage,css;_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsWebControlsDistMobileAppMobileApp){PopupWindowPage=_webAtomsWebControlsDistMobileAppMobileApp.PopupWindowPage},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_commonControlsTreeFileTreeView){FolderTreeView=_commonControlsTreeFileTreeView.FolderTreeView},function(_webAtomsWebControlsDistBasicAtomRepeater){AtomRepeater=_webAtomsWebControlsDistBasicAtomRepeater.default;SelectAll=_webAtomsWebControlsDistBasicAtomRepeater.SelectAll;SelectorCheckBox=_webAtomsWebControlsDistBasicAtomRepeater.SelectorCheckBox},function(_webAtomsCoreDistCoreBind){Bind=_webAtomsCoreDistCoreBind.default},function(_webAtomsCoreDistCoreInjectProperty){InjectProperty=_webAtomsCoreDistCoreInjectProperty.default},function(_serviceCloudFileService){CloudFileService=_serviceCloudFileService.default},function(_webAtomsCoreDistStyleStyled){styled=_webAtomsCoreDistStyleStyled.default},function(_commonControlsDragDropFilesDragDrop){FilesDragDrop=_commonControlsDragDropFilesDragDrop.FilesDragDrop},function(_webAtomsCoreDistViewModelAction){Action=_webAtomsCoreDistViewModelAction.default},function(_webAtomsWebControlsDistBasicUploadEvent){UploadEvent=_webAtomsWebControlsDistBasicUploadEvent.default},function(_commonControlsButtonsIconButton){SaveIconTextButton=_commonControlsButtonsIconButton.SaveIconTextButton},function(_commonFileUrl){fileUrl=_commonFileUrl.fileUrl}],execute:function(){css=styled.css`
4530
+ `.installGlobal("[data-html-page-editor=html-page-editor]");desktopWidth=992;tabletWidth=768;mobileWidth=480;_export("default",HtmlPageEditor=class HtmlPageEditor extends AtomControl{get htmlPage(){var _a,_b,_c;return(_a=this.lastCommittedHtml)!==null&&_a!==void 0?_a:(_c=(_b=this.htmlDocument)===null||_b===void 0?void 0:_b.documentElement)===null||_c===void 0?void 0:_c.outerHTML}set htmlPage(v){if(!this.element){return}if(!this.ready){setTimeout((()=>{this.htmlPage=v}),100);return}void this.ready.then((()=>{var _a;const dom=new DOMParser;const doc=dom.parseFromString(v,"text/html");let baseElement=doc.querySelector("base");if((_a=baseElement===null||baseElement===void 0?void 0:baseElement.getAttribute("href"))===null||_a===void 0?void 0:_a.startsWith("/api/site/")){baseElement.remove();baseElement=null}if(baseElement){const href=baseElement.getAttribute("href");if(href!==this.baseUrl){this.originalBaseUrl=href;baseElement.setAttribute("href",this.baseUrl)}}else{baseElement=doc.createElement("base");baseElement.setAttribute("href",this.baseUrl);doc.head.insertAdjacentElement("afterbegin",baseElement)}return this.initDocument(doc.documentElement.outerHTML)}))}constructor(app,e){super(app,e);this.selection=new SelectedElement(this);this.undoList=[];this.redoList=[];this.pageVariables=[];this.lastCommittedHtml=null;this.lastCommittedBody=null;this.hover=new SelectedElement(this);this.dropTarget=new SelectedElement(this);this.maxWidth=desktopWidth;this.ready=this.init()}init(){return __awaiter(this,void 0,void 0,(function*(){this.render(XNode.create("div",{"data-html-page-editor":"html-page-editor"},XNode.create("div",{"data-element":"top"},XNode.create(EditorToolbar,{"data-element":"max-width","event-click":()=>this.deferUpdate()},XNode.create("i",{"data-selected":Bind.oneWay((()=>this.maxWidth===desktopWidth)),"event-click":()=>this.maxWidth=desktopWidth,class:"fas fa-desktop"}),XNode.create("i",{"data-selected":Bind.oneWay((()=>this.maxWidth===tabletWidth)),"event-click":()=>this.maxWidth=tabletWidth,class:"fas fa-tablet-screen"}),XNode.create("i",{"data-selected":Bind.oneWay((()=>this.maxWidth===mobileWidth)),"event-click":()=>this.maxWidth=mobileWidth,class:"fas fa-mobile-screen"})),XNode.create(UndoRedoToolbar,null),XNode.create(EditorToolbar,null,XNode.create("i",{"data-click-event":"edit-code",class:"fa-solid fa-code"}))),XNode.create(EditorToolbar,{"data-element":"left"},XNode.create(TextBox,null),XNode.create(Image,null),XNode.create(WrapGrid,null),XNode.create(ImageBox,null),XNode.create(RightImageBox,null),XNode.create(Card,null),XNode.create(ImageCard,null),XNode.create(ColumnBox,null),XNode.create(Columns2,null),XNode.create(Columns3,null),XNode.create(List,null),XNode.create(ImageLink,null),XNode.create(LinkButton,null),XNode.create(InlinePopupButton,{icon:"fas fa-plus","data-layout":"warning-icon-button",alignment:"above",popup:()=>XNode.create(EditorToolbar,null,XNode.create(RowBox,null),XNode.create(VerticalImageBox,null),XNode.create(PriceTable,null),XNode.create(TypeWriterComponent,null),XNode.create(Billboard,null),XNode.create(PDFFlipBook,null),XNode.create(PDFViewer,null),XNode.create(OutlineText,null),XNode.create(Carousel,null),XNode.create(BlogComponent,null),XNode.create(BoxFrame,null),XNode.create(VideoPlayer,null),XNode.create(BackgroundVideo,null),XNode.create(TextMask,null),XNode.create(InjectBox,null),XNode.create(ImageGrid,null),XNode.create(ImageGallery,null),XNode.create(MarqueeText,null),XNode.create(Banner,null))})),XNode.create("div",{"data-element":"editor","style-max-width":Bind.oneWay((()=>this.maxWidth>768?"":this.maxWidth+"px"))},XNode.create("div",{"data-element":"resizer"}),XNode.create("div",{"data-element":"drop-target","style-display":Bind.oneWay((()=>this.dropTarget.element?"":"none")),"style-position":"absolute","style-left":Bind.oneWay((()=>this.dropTarget.left)),"style-top":Bind.oneWay((()=>this.dropTarget.top)),"style-width":Bind.oneWay((()=>this.dropTarget.width)),"style-height":Bind.oneWay((()=>this.dropTarget.height))}),XNode.create("div",{"data-element":"selection","style-left":Bind.oneWay((()=>this.selection.left)),"style-top":Bind.oneWay((()=>this.selection.top)),"style-width":Bind.oneWay((()=>this.selection.width)),"style-height":Bind.oneWay((()=>this.selection.height))},XNode.create("i",{class:"lt"}),XNode.create("i",{class:"rt"}),XNode.create("i",{class:"lb"}),XNode.create("i",{class:"rb"}),XNode.create("div",null,XNode.create("i",{class:"fa-regular fa-arrow-up","event-click":()=>{if(this.selection.element.parentElement!==this.htmlDocument.body){this.selection.update(this.selection.element.parentElement)}}}),XNode.create("i",{"event-click":()=>{this.selection.setDraggable()},class:"fa-solid fa-up-down-left-right","data-click-event":"start-drag"}),XNode.create("i",{"style-display":Bind.oneWay((()=>this.selection.isImage)),"data-click-event":"change-image",title:"Change Image (Double Click)",class:"fa-solid fa-arrows-rotate-reverse"}),XNode.create("i",{title:"Duplicate","data-click-event":"copy-element",class:"fas fa-copy"}),XNode.create("i",{title:"Move Up","data-click-event":"move-up-element",class:"fa-duotone fa-angles-up"}),XNode.create("i",{title:"Move Down","data-click-event":"move-down-element",class:"fa-duotone fa-angles-down"}),XNode.create("i",{title:"Extract Fragment","data-click-event":"extract-element",class:"fad fa-file-export"}),XNode.create("i",{title:"Delete","data-click-event":"delete-element",class:"fas fa-trash-can"}))),XNode.create("div",{"data-element":"hover","style-left":Bind.oneWay((()=>this.hover.left)),"style-top":Bind.oneWay((()=>this.hover.top)),"style-width":Bind.oneWay((()=>this.hover.width)),"style-height":Bind.oneWay((()=>this.hover.height))},XNode.create("label",{text:Bind.oneWay((()=>this.hover.name))})),XNode.create("div",{"data-element":"content-frame"},XNode.create("iframe",{"data-element":"content-editor",sandbox:"allow-same-origin "}))),XNode.create("div",{"data-element":"right"},XNode.create("button",{"data-click-event":"open-variables","data-layout":"icon-button"},XNode.create("i",{class:"fas fa-code"}),"Variables"),XNode.create(Properties,null)),XNode.create(BreadCrum,{selection:Bind.oneWay((()=>this.selection.element))})));this.contentEditor=this.element.querySelector(`[data-element="content-editor"]`)}))}buildXNode(node){const build=n=>{const e=this.htmlDocument.createElement(n.name);if(n.attributes){for(const key in n.attributes){if(Object.prototype.hasOwnProperty.call(n.attributes,key)){const element=n.attributes[key];e.setAttribute(key,element)}}}if(n.children){for(const iterator of n.children){if(typeof iterator==="string"){e.append(iterator);continue}e.appendChild(build(iterator))}}return e};return build(node)}deleteElement(){var _a;return __awaiter(this,void 0,void 0,(function*(){const current=this.selection.element;let previous=(_a=current.previousElementSibling)!==null&&_a!==void 0?_a:current.parentElement;current.remove();this.commit();if(!previous.textContent){previous=previous.previousElementSibling.lastElementChild}this.setSelection(previous);yield sleep(100);this.selection.update()}))}copyElement(){const current=this.selection.element;const copy=current.cloneNode(true);for(const iterator of descendentElementIterator(copy)){if(iterator.id){iterator.id=`sm-${Date.now()}`}}current.insertAdjacentElement("afterend",copy);this.commit()}moveUpElement(){const current=this.selection.element;const prevSibling=current.previousElementSibling;if(!prevSibling){return}current.remove();prevSibling.insertAdjacentElement("beforebegin",current);this.commit()}moveDownElement(){const current=this.selection.element;const nextSibling=current.nextElementSibling;if(!nextSibling){return}current.remove();nextSibling.insertAdjacentElement("afterend",current);this.commit()}changeImage(){return __awaiter(this,void 0,void 0,(function*(){return this.insertImage({src:prompt("Image Src","")})}))}changeBackgroundImage(){return __awaiter(this,void 0,void 0,(function*(){const img=prompt("Image Src","");this.selection.element.style.setProperty("--styler-background-image",`url(${JSON.stringify(img)})`);return}))}extractElement(){return __awaiter(this,void 0,void 0,(function*(){alert("Not implemented")}))}onKeyUp(d,ke){if(ke.ctrlKey){switch(ke.key){case"z":ke.preventDefault();this.undo();break;case"y":ke.preventDefault();this.redo();break}}}insertImage(...images){var _a;return __awaiter(this,void 0,void 0,(function*(){let img=((_a=this.selection)===null||_a===void 0?void 0:_a.isImage)?this.selection.element:null;const container=img?img.parentElement:this.selection.element;for(let _b of images){const{src,style}=_b,a=__rest(_b,["src","style"]);if(!img){img=this.htmlDocument.createElement("img");container.appendChild(img);container.appendChild(document.createTextNode("\n"))}img.src=src;const i=img;img.onload=()=>{this.selection.update();i.onload=null};if(style){for(const key in style){if(Object.prototype.hasOwnProperty.call(style,key)){const element=style[key];img.style[key]=element}}}if(a){for(const key in a){if(Object.prototype.hasOwnProperty.call(a,key)){const element=a[key];img.setAttribute(key,element)}}}img=null}this.commit()}))}insertElement(e,parent=this.selection.element,preferMain=false){if(preferMain){while(parent.parentElement!==this.htmlDocument.body){parent=parent.parentElement}}parent.appendChild(e);if(!e.id){e.id="sm-"+Date.now().toString()}setTimeout((()=>{this.setSelection(e);this.commit()}),100)}deferUpdate(){var _a,_b;return __awaiter(this,void 0,void 0,(function*(){yield sleep(100);(_a=this.hover)===null||_a===void 0?void 0:_a.update();(_b=this.selection)===null||_b===void 0?void 0:_b.update()}))}setSelection(element,commit=true){var _a;const old=(_a=this.selection)===null||_a===void 0?void 0:_a.element;if(old===null||old===void 0?void 0:old.draggable){old.removeAttribute("draggable")}this.selection.update(element);if(commit){this.commit()}}commit(){var _a;this.redoList.clear();const lastHtml=this.lastHtml;const clone=this.htmlDocument.documentElement.cloneNode(true);const currentHtml=clone.innerHTML;if(lastHtml===currentHtml){return}const body=clone.querySelector("body");body.removeAttribute("contentEditable");body.removeAttribute("editing");const all=clone.querySelectorAll("*");const deleteAll=[];const removeAll=[];for(let index=0;index<all.length;index++){const element=all[index];element.removeAttribute("draggable");if(element.tagName==="INJECT"){deleteAll.push(element)}if(element.getAttribute("data-cursor-style")==="editing"){removeAll.push(element)}}for(const iterator of deleteAll){iterator.innerHTML=""}for(const iterator of removeAll){iterator.remove()}if(clone.querySelector(`[styler-layout="component"]`)){let componentScript=clone.querySelector("[styler-component-script]");if(!componentScript){componentScript=this.htmlDocument.createElement("script");const head=clone.querySelector("head");head.appendChild(componentScript)}componentScript.src=UMD.resolvePath("@social-mail/social-mail-client/component.js");componentScript.setAttribute("styler-component-script","component-script")}if(this.baseUrl){if(!this.originalBaseUrl){(_a=clone.querySelector("base"))===null||_a===void 0?void 0:_a.remove()}else{const baseUrl=clone.querySelector("base");if(baseUrl){baseUrl.setAttribute("href",this.originalBaseUrl)}}}if(!lastHtml){this.lastHtml=currentHtml;this.lastCommittedHtml=clone.outerHTML;this.lastCommittedBody=body.innerHTML;return}this.undoList.add(this.lastHtml);this.lastHtml=currentHtml;this.lastCommittedHtml=clone.outerHTML;this.lastCommittedBody=body.innerHTML;this.element.dispatchEvent(new CustomEvent("htmlPageChanged",{detail:clone.outerHTML,bubbles:true}));AtomBinder.refreshValue(this,"htmlPage");setTimeout((()=>{this.selection.update();this.hover.update()}),100)}undo(){if(!this.undoList.length){return}this.redoList.insert(this.redoList.length,this.htmlDocument.documentElement.innerHTML);const lastHtml=this.undoList.pop();this.htmlDocument.documentElement.innerHTML=lastHtml;this.lastHtml=lastHtml;this.htmlDocument.body.contentEditable="true";this.htmlDocument.body.setAttribute("editing","true")}redo(){if(!this.redoList.length){return}this.undoList.insert(this.undoList.length,this.htmlDocument.documentElement.innerHTML);const lastHtml=this.redoList.pop();this.htmlDocument.documentElement.innerHTML=lastHtml;this.lastHtml=lastHtml;this.htmlDocument.body.contentEditable="true";this.htmlDocument.body.setAttribute("editing","true")}initDocument(v){void this.ready.then((()=>__awaiter(this,void 0,void 0,(function*(){this.htmlDocument=void 0;yield this.loadContentDocument();this.htmlDocument.open();this.htmlDocument.write(v);this.htmlDocument.addEventListener("click",(e=>{const target=e.target;const previous=this.selection.element;if(previous===null||previous===void 0?void 0:previous.isContentEditable){let start=target;while(start){if(previous===target){return}start=start.parentElement}if(previous!==this.htmlDocument.body){previous.removeAttribute("contentEditable")}this.queueCommit()}e.preventDefault();this.setSelection(target)}));this.htmlDocument.addEventListener("dblclick",(e=>{const target=e.target;e.preventDefault();const element=target.nodeType===Node.ELEMENT_NODE?target:target.parentElement;if(/^(IMG|INJECT|VIDEO|PDF)/.test(element.tagName)){this.changeImage().catch(console.error);return}if(element.getAttribute("data-editable")==="false"){return}if(element.hasAttribute("data-web-atoms-view")){return}this.setSelection(element)}));this.htmlDocument.addEventListener("scroll",(e=>{this.hover.update();this.selection.update()}),{passive:true});this.htmlDocument.addEventListener("pointerover",(e=>{let target=e.target;target=target.nodeType===Node.ELEMENT_NODE&&target.tagName?target:target.parentElement;if(this.hover.element===target){return}this.hover.update(target)}),{capture:true});this.htmlDocument.addEventListener("keydown",(e=>{if(e.ctrlKey||e.metaKey){switch(e.key){case"s":this.contentEditor.dispatchEvent(new CustomEvent("savePage",{bubbles:true}));e.preventDefault();break;case"z":this.contentEditor.dispatchEvent(new CustomEvent("undo",{bubbles:true}));e.preventDefault();break;case"y":this.contentEditor.dispatchEvent(new CustomEvent("redo",{bubbles:true}));e.preventDefault();break}}}));this.htmlDocument.addEventListener("input",(()=>this.queueCommit()));InstallDragDropHelper(this);this.htmlDocument.close();EditorCustomElements.register(this.htmlDocument);this.htmlDocument.body.contentEditable="true";this.htmlDocument.body.setAttribute("editing","true");const cursorStyle=this.htmlDocument.createElement("style");cursorStyle.textContent=`* {\n caret-color: currentColor !important;\n }`;cursorStyle.setAttribute("data-cursor-style","editing");this.htmlDocument.head.append(cursorStyle);setTimeout((()=>{this.app.runAsync((()=>__awaiter(this,void 0,void 0,(function*(){yield this.setStylerSheet();this.loadVariables();this.commit()}))))}),10)}))))}queueCommit(){const id=this.lastCommitTimerID;if(id){clearTimeout(id)}this.lastCommitTimerID=setTimeout((()=>this.commit()),1e3)}setStylerSheet(){return __awaiter(this,void 0,void 0,(function*(){const document=this.htmlDocument;let style=document.querySelector(`[styler-style-sheet]`);if(!style){style=document.createElement("style");style.setAttribute("styler-style-sheet","inline");document.head.appendChild(style)}style.textContent=StylerSet.instance.toString()}))}loadVariables(){const onChange=()=>{const document=this.htmlDocument;let style=document.querySelector("[styler-style-variables]");if(!style){style=document.createElement("style");style.setAttribute("styler-style-variables","override");document.head.appendChild(style)}style.textContent=`:root {\n ${this.pageVariables.map((x=>`${x.propertyName}: ${x.currentValue};`)).join("\n\t")}\n }`};this.pageVariables=StylerSet.instance.vars.map((x=>new StylerVariable(x.name,x.value,this.htmlDocument,onChange)))}loadContentDocument(){return __awaiter(this,void 0,void 0,(function*(){this.contentEditor=this.element.querySelector(`[data-element="content-editor"]`);while(!this.htmlDocument){this.htmlDocument=this.contentEditor.contentDocument;yield sleep(100)}}))}});__decorate([BindableProperty,__metadata("design:type",String)],HtmlPageEditor.prototype,"baseUrl",void 0);__decorate([Action({onEvent:"delete-element"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],HtmlPageEditor.prototype,"deleteElement",null);__decorate([Action({onEvent:"copy-element",blockMultipleExecution:false}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],HtmlPageEditor.prototype,"copyElement",null);__decorate([Action({onEvent:"move-up-element",blockMultipleExecution:false}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],HtmlPageEditor.prototype,"moveUpElement",null);__decorate([Action({onEvent:"move-down-element",blockMultipleExecution:false}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],HtmlPageEditor.prototype,"moveDownElement",null);__decorate([Action({onEvent:"change-image"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],HtmlPageEditor.prototype,"changeImage",null);__decorate([Action({onEvent:"change-background-image"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],HtmlPageEditor.prototype,"changeBackgroundImage",null);__decorate([Action({onEvent:"extract-element"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],HtmlPageEditor.prototype,"extractElement",null);__decorate([Action({onEvent:"keyup"}),__metadata("design:type",Function),__metadata("design:paramtypes",[Object,KeyboardEvent]),__metadata("design:returntype",void 0)],HtmlPageEditor.prototype,"onKeyUp",null);__decorate([Action({onEvent:"undo"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],HtmlPageEditor.prototype,"undo",null);__decorate([Action({onEvent:"redo"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],HtmlPageEditor.prototype,"redo",null)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/site-editor/editor/HtmlPageEditor");System.register(["tslib","@web-atoms/web-controls/dist/mobile-app/MobileApp","@web-atoms/core/dist/core/XNode","../../../../common/controls/tree/FileTreeView","@web-atoms/web-controls/dist/basic/AtomRepeater","@web-atoms/core/dist/core/Bind","@web-atoms/core/dist/core/InjectProperty","../service/CloudFileService","@web-atoms/core/dist/style/styled","../../../../common/controls/drag-drop/FilesDragDrop","@web-atoms/core/dist/view-model/Action","@web-atoms/web-controls/dist/basic/UploadEvent","../../../../common/controls/buttons/IconButton","../../../../common/fileUrl"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,PopupWindowPage,XNode,FolderTreeView,AtomRepeater,SelectAll,SelectorCheckBox,Bind,InjectProperty,CloudFileService,styled,FilesDragDrop,Action,UploadEvent,SaveIconTextButton,fileUrl,ChooseMediaPage,css;_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_webAtomsWebControlsDistMobileAppMobileApp){PopupWindowPage=_webAtomsWebControlsDistMobileAppMobileApp.PopupWindowPage},function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_commonControlsTreeFileTreeView){FolderTreeView=_commonControlsTreeFileTreeView.FolderTreeView},function(_webAtomsWebControlsDistBasicAtomRepeater){AtomRepeater=_webAtomsWebControlsDistBasicAtomRepeater.default;SelectAll=_webAtomsWebControlsDistBasicAtomRepeater.SelectAll;SelectorCheckBox=_webAtomsWebControlsDistBasicAtomRepeater.SelectorCheckBox},function(_webAtomsCoreDistCoreBind){Bind=_webAtomsCoreDistCoreBind.default},function(_webAtomsCoreDistCoreInjectProperty){InjectProperty=_webAtomsCoreDistCoreInjectProperty.default},function(_serviceCloudFileService){CloudFileService=_serviceCloudFileService.default},function(_webAtomsCoreDistStyleStyled){styled=_webAtomsCoreDistStyleStyled.default},function(_commonControlsDragDropFilesDragDrop){FilesDragDrop=_commonControlsDragDropFilesDragDrop.FilesDragDrop},function(_webAtomsCoreDistViewModelAction){Action=_webAtomsCoreDistViewModelAction.default},function(_webAtomsWebControlsDistBasicUploadEvent){UploadEvent=_webAtomsWebControlsDistBasicUploadEvent.default},function(_commonControlsButtonsIconButton){SaveIconTextButton=_commonControlsButtonsIconButton.SaveIconTextButton},function(_commonFileUrl){fileUrl=_commonFileUrl.fileUrl}],execute:function(){css=styled.css`
4506
4531
  display: grid;
4507
4532
  grid-template-columns: 200px 1fr;
4508
4533
  grid-template-rows: auto 1fr;