@stratusjs/angular 0.7.4 → 0.7.5

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 (48) hide show
  1. package/dist/angular.bundle.js +1501 -557
  2. package/dist/angular.bundle.min.js +1 -1
  3. package/package.json +2 -2
  4. package/src/editor/quill-break-blot.plugin.js +38 -0
  5. package/src/editor/quill-break-blot.plugin.js.map +1 -0
  6. package/src/editor/quill-break-blot.plugin.min.js +1 -0
  7. package/src/editor/quill-html-edit.plugin.js +164 -0
  8. package/src/editor/quill-html-edit.plugin.js.map +1 -0
  9. package/src/editor/quill-html-edit.plugin.min.js +1 -0
  10. package/src/editor/quill-image-format.plugin.js +50 -0
  11. package/src/editor/quill-image-format.plugin.js.map +1 -0
  12. package/src/editor/quill-image-format.plugin.min.js +1 -0
  13. package/src/editor/quill-input-button.plugin.js +98 -0
  14. package/src/editor/quill-input-button.plugin.js.map +1 -0
  15. package/src/editor/quill-input-button.plugin.min.js +1 -0
  16. package/src/froala/editor/froala-editor.directive.js +328 -0
  17. package/src/froala/editor/froala-editor.directive.js.map +1 -0
  18. package/src/froala/editor/froala-editor.directive.min.js +1 -0
  19. package/src/froala/editor/froala-editor.module.js +37 -0
  20. package/src/froala/editor/froala-editor.module.js.map +1 -0
  21. package/src/froala/editor/froala-editor.module.min.js +1 -0
  22. package/src/froala/editor/index.js +22 -0
  23. package/src/froala/editor/index.js.map +1 -0
  24. package/src/froala/editor/index.min.js +1 -0
  25. package/src/froala/plugins/image_manager.js +364 -0
  26. package/src/froala/plugins/image_manager.js.map +1 -0
  27. package/src/froala/plugins/image_manager.min.js +1 -0
  28. package/src/froala/plugins/inputButton.js +2 -0
  29. package/src/froala/plugins/inputButton.js.map +1 -1
  30. package/src/froala/plugins/inputButton.min.js +1 -1
  31. package/src/froala/plugins/inputButton.ts +2 -2
  32. package/src/froala/plugins/linkManager.js +2 -2
  33. package/src/froala/plugins/linkManager.js.map +1 -1
  34. package/src/froala/plugins/linkManager.min.js +1 -1
  35. package/src/froala/plugins/linkManager.ts +4 -4
  36. package/src/froala/view/froala-view.directive.js +49 -0
  37. package/src/froala/view/froala-view.directive.js.map +1 -0
  38. package/src/froala/view/froala-view.directive.min.js +1 -0
  39. package/src/froala/view/froala-view.module.js +37 -0
  40. package/src/froala/view/froala-view.module.js.map +1 -0
  41. package/src/froala/view/froala-view.module.min.js +1 -0
  42. package/src/froala/view/index.js +22 -0
  43. package/src/froala/view/index.js.map +1 -0
  44. package/src/froala/view/index.min.js +1 -0
  45. package/src/root/root.component.js +43 -0
  46. package/src/root/root.component.js.map +1 -0
  47. package/src/root/root.component.min.js +1 -0
  48. package/src/core/dialog.interface.js.map +0 -1
@@ -1,6 +1,6 @@
1
- System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/environment', '@stratusjs/core/misc', '@stratusjs/angularjs/services/model', '@stratusjs/angularjs/services/registry', '@stratusjs/core/events/eventManager', 'html2pdf', 'font-awesome', 'froala-plugins', 'froala-embedly', 'froala-font-awesome', 'froala-image-tui', 'froala-editor', '@stratusjs/core/datastore/xhr', '@agentepsilon/decko', 'toastify-js', '@stratusjs/angularjs/services/collection', 'zone.js/dist/zone'], (function (exports) {
1
+ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/environment', '@stratusjs/core/misc', '@stratusjs/angularjs/services/model', '@stratusjs/angularjs/services/registry', '@stratusjs/core/events/eventManager', 'html2pdf', 'font-awesome', 'froala-plugins', 'froala-embedly', 'froala-font-awesome', 'froala-image-tui', 'froala-editor', '@stratusjs/core/datastore/xhr', '@agentepsilon/decko', '@stratusjs/angular/core/root.component', 'toastify-js', '@stratusjs/angularjs/services/collection', 'zone.js/dist/zone'], (function (exports) {
2
2
  'use strict';
3
- var Stratus, _, uniqueId$3, snakeCase, head, isEmpty, isUndefined, isString, extend$1, debounce$2, isNumber, isBoolean, isArray$1, clone, isFunction$1, set, isNil, includes, isObject$2, assignIn, forEach, cookie, isJSON, safeUniqueId, Model, Registry, EventManager$1, FroalaEditor, XHR, debounce$1, Toastify, Collection;
3
+ var Stratus, _, uniqueId$3, snakeCase, head, isEmpty, isUndefined, isString, extend$1, debounce$2, isNumber, isBoolean, isArray$1, clone, isFunction$1, set, isNil, includes, isObject$2, assignIn, forEach, cookie, isJSON, safeUniqueId, Model, Registry, EventManager$1, FroalaEditor, XHR, debounce$1, RootComponent$1, Toastify, Collection;
4
4
  return {
5
5
  setters: [function (module) {
6
6
  Stratus = module.Stratus;
@@ -42,6 +42,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
42
42
  XHR = module.XHR;
43
43
  }, function (module) {
44
44
  debounce$1 = module.debounce;
45
+ }, function (module) {
46
+ RootComponent$1 = module.RootComponent;
45
47
  }, function (module) {
46
48
  Toastify = module["default"];
47
49
  }, function (module) {
@@ -56675,8 +56677,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
56675
56677
  const systemDir$c = '@stratusjs/angular';
56676
56678
  const moduleName$d = 'citation-dialog';
56677
56679
  const parentModuleName$6 = 'editor';
56678
- const min$g = !cookie('env') ? '.min' : '';
56679
- const localDir$h = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$c}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
56680
+ const min$h = !cookie('env') ? '.min' : '';
56681
+ const localDir$i = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$c}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
56680
56682
  let CitationDialogComponent = exports('CitationDialogComponent', class CitationDialogComponent extends ResponsiveComponent {
56681
56683
  constructor(dialogRef, data, fb, snackBar, iconRegistry, sanitizer, ref) {
56682
56684
  super();
@@ -56698,7 +56700,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
56698
56700
  ngOnInit() {
56699
56701
  this.uid = uniqueId$3(`sa_${snakeCase(moduleName$d)}_component_`);
56700
56702
  Stratus.Instances[this.uid] = this;
56701
- Stratus.Internals.CssLoader(`${localDir$h}${parentModuleName$6}/${moduleName$d}.component${min$g}.css`);
56703
+ Stratus.Internals.CssLoader(`${localDir$i}${parentModuleName$6}/${moduleName$d}.component${min$h}.css`);
56702
56704
  this.model = this.data.model;
56703
56705
  this.property = this.data.property;
56704
56706
  this.editor = this.data.editor;
@@ -56816,7 +56818,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
56816
56818
  exports('CitationDialogComponent', CitationDialogComponent = __decorate$p([
56817
56819
  Component({
56818
56820
  selector: `sa-${moduleName$d}`,
56819
- templateUrl: `${localDir$h}/${parentModuleName$6}/${moduleName$d}.component${min$g}.html`,
56821
+ templateUrl: `${localDir$i}/${parentModuleName$6}/${moduleName$d}.component${min$h}.html`,
56820
56822
  }),
56821
56823
  __param$7(1, Inject(MAT_DIALOG_DATA)),
56822
56824
  __metadata$l("design:paramtypes", [MatDialogRef, Object, FormBuilder,
@@ -56903,8 +56905,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
56903
56905
  const systemDir$b = '@stratusjs/angular';
56904
56906
  const moduleName$c = 'link-dialog';
56905
56907
  const parentModuleName$5 = 'editor';
56906
- const min$f = !cookie('env') ? '.min' : '';
56907
- const localDir$g = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$b}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
56908
+ const min$g = !cookie('env') ? '.min' : '';
56909
+ const localDir$h = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$b}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
56908
56910
  let LinkDialogComponent = exports('LinkDialogComponent', class LinkDialogComponent extends ResponsiveComponent {
56909
56911
  constructor(dialogRef, data, fb, backend, snackBar, iconRegistry, sanitizer, ref) {
56910
56912
  super();
@@ -56940,7 +56942,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
56940
56942
  ngOnInit() {
56941
56943
  this.uid = _.uniqueId(`sa_${_.snakeCase(moduleName$c)}_component_`);
56942
56944
  Stratus.Instances[this.uid] = this;
56943
- Stratus.Internals.CssLoader(`${localDir$g}${parentModuleName$5}/${moduleName$c}.component${min$f}.css`)
56945
+ Stratus.Internals.CssLoader(`${localDir$h}${parentModuleName$5}/${moduleName$c}.component${min$g}.css`)
56944
56946
  .then(() => {
56945
56947
  this.isStyled = true;
56946
56948
  this.refresh();
@@ -57230,7 +57232,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
57230
57232
  exports('LinkDialogComponent', LinkDialogComponent = __decorate$n([
57231
57233
  Component({
57232
57234
  selector: `sa-${moduleName$c}`,
57233
- templateUrl: `${localDir$g}/${parentModuleName$5}/${moduleName$c}.component${min$f}.html`,
57235
+ templateUrl: `${localDir$h}/${parentModuleName$5}/${moduleName$c}.component${min$g}.html`,
57234
57236
  }),
57235
57237
  __param$6(1, Inject(MAT_DIALOG_DATA)),
57236
57238
  __metadata$j("design:paramtypes", [MatDialogRef, Object, FormBuilder,
@@ -57256,8 +57258,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
57256
57258
  const systemDir$a = '@stratusjs/angular';
57257
57259
  const moduleName$b = 'media-dialog';
57258
57260
  const parentModuleName$4 = 'editor';
57259
- const min$e = !cookie('env') ? '.min' : '';
57260
- const localDir$f = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$a}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
57261
+ const min$f = !cookie('env') ? '.min' : '';
57262
+ const localDir$g = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$a}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
57261
57263
  let MediaDialogComponent = exports('MediaDialogComponent', class MediaDialogComponent extends ResponsiveComponent {
57262
57264
  constructor(dialogRef, data, fb, backend, snackBar, ref) {
57263
57265
  super();
@@ -57281,7 +57283,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
57281
57283
  ngOnInit() {
57282
57284
  this.uid = _.uniqueId(`sa_${_.snakeCase(moduleName$b)}_component_`);
57283
57285
  Stratus.Instances[this.uid] = this;
57284
- Stratus.Internals.CssLoader(`${localDir$f}/${parentModuleName$4}/${moduleName$b}.component${min$e}.css`);
57286
+ Stratus.Internals.CssLoader(`${localDir$g}/${parentModuleName$4}/${moduleName$b}.component${min$f}.css`);
57285
57287
  this.model = this.data.model;
57286
57288
  this.property = this.data.property;
57287
57289
  this.editor = this.data.editor;
@@ -57520,7 +57522,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
57520
57522
  exports('MediaDialogComponent', MediaDialogComponent = __decorate$m([
57521
57523
  Component({
57522
57524
  selector: `sa-${moduleName$b}`,
57523
- templateUrl: `${localDir$f}/${parentModuleName$4}/${moduleName$b}.component${min$e}.html`,
57525
+ templateUrl: `${localDir$g}/${parentModuleName$4}/${moduleName$b}.component${min$f}.html`,
57524
57526
  }),
57525
57527
  __param$5(1, Inject(MAT_DIALOG_DATA)),
57526
57528
  __metadata$i("design:paramtypes", [MatDialogRef, Object, FormBuilder,
@@ -57959,8 +57961,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
57959
57961
  const systemDir$9 = '@stratusjs/angular';
57960
57962
  const moduleName$a = 'code-view-dialog';
57961
57963
  const parentModuleName$3 = 'editor';
57962
- const min$d = !cookie('env') ? '.min' : '';
57963
- const localDir$e = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$9}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
57964
+ const min$e = !cookie('env') ? '.min' : '';
57965
+ const localDir$f = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$9}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
57964
57966
  let CodeViewDialogComponent = exports('CodeViewDialogComponent', class CodeViewDialogComponent extends ResponsiveComponent {
57965
57967
  constructor(dialogRef, data, ref, fb, ngZone) {
57966
57968
  super();
@@ -57983,7 +57985,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
57983
57985
  ngOnInit() {
57984
57986
  this.uid = _.uniqueId(`sa_${_.snakeCase(moduleName$a)}_component_`);
57985
57987
  Stratus.Instances[this.uid] = this;
57986
- Stratus.Internals.CssLoader(`${localDir$e}/${parentModuleName$3}/${moduleName$a}.component${min$d}.css`);
57988
+ Stratus.Internals.CssLoader(`${localDir$f}/${parentModuleName$3}/${moduleName$a}.component${min$e}.css`);
57987
57989
  this.model = this.data.model;
57988
57990
  this.property = this.data.property;
57989
57991
  const dataControl = this.form.get('dataString');
@@ -58015,7 +58017,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
58015
58017
  exports('CodeViewDialogComponent', CodeViewDialogComponent = __decorate$l([
58016
58018
  Component({
58017
58019
  selector: `sa-${moduleName$a}`,
58018
- templateUrl: `${localDir$e}/${parentModuleName$3}/${moduleName$a}.component${min$d}.html`,
58020
+ templateUrl: `${localDir$f}/${parentModuleName$3}/${moduleName$a}.component${min$e}.html`,
58019
58021
  }),
58020
58022
  __param$4(1, Inject(MAT_DIALOG_DATA)),
58021
58023
  __metadata$h("design:paramtypes", [MatDialogRef, Object, ChangeDetectorRef,
@@ -80847,6 +80849,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
80847
80849
  console.log('[restoreSnapshot]is focused:', this.editor.core.hasFocus());
80848
80850
  }
80849
80851
  this.editor.events.disableBlur();
80852
+ this.editor.events.focus();
80850
80853
  this.editor.snapshot.restore(this.snapshot);
80851
80854
  this.editor.events.enableBlur();
80852
80855
  return true;
@@ -80866,6 +80869,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
80866
80869
  console.log('[restoreSelection]is focused:', this.editor.core.hasFocus());
80867
80870
  }
80868
80871
  this.editor.events.disableBlur();
80872
+ this.editor.events.focus();
80869
80873
  this.editor.selection.restore();
80870
80874
  this.editor.events.enableBlur();
80871
80875
  return true;
@@ -80893,8 +80897,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
80893
80897
  const systemDir$8 = '@stratusjs/angular';
80894
80898
  const moduleName$9 = 'citationManager';
80895
80899
  const parentModuleName$2 = 'froala/plugins';
80896
- const min$c = !cookie('env') ? '.min' : '';
80897
- const localDir$d = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$8}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
80900
+ const min$d = !cookie('env') ? '.min' : '';
80901
+ const localDir$e = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$8}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
80898
80902
  extend$1(FroalaEditor.POPUP_TEMPLATES, {
80899
80903
  'citationManager.toolbar': '[_BUTTONS_]'
80900
80904
  });
@@ -80905,7 +80909,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
80905
80909
  let inputButton;
80906
80910
  const debug = false;
80907
80911
  function _init() {
80908
- Stratus.Internals.CssLoader(`${localDir$d}${parentModuleName$2}/${moduleName$9}${min$c}.css`);
80912
+ Stratus.Internals.CssLoader(`${localDir$e}${parentModuleName$2}/${moduleName$9}${min$d}.css`);
80909
80913
  inputButton = new InputButtonPlugin({
80910
80914
  name: 'Citation Manager',
80911
80915
  eventName: 'citation-input',
@@ -81072,7 +81076,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
81072
81076
  editor.link.insert(link.url, link.text, attrs);
81073
81077
  },
81074
81078
  autoSaveSelection: true,
81075
- maintainSnapshot: true,
81076
81079
  autoRestoreSelection: true,
81077
81080
  debug
81078
81081
  });
@@ -81095,8 +81098,9 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
81095
81098
  FroalaEditor.RegisterCommand('linkManager', {
81096
81099
  title: 'Insert from Link Library',
81097
81100
  undo: false,
81098
- focus: false,
81101
+ focus: true,
81099
81102
  modal: true,
81103
+ refreshOnCallback: false,
81100
81104
  callback() {
81101
81105
  this.linkManager.onClick();
81102
81106
  },
@@ -84646,8 +84650,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
84646
84650
  const systemPackage = '@stratusjs/angular';
84647
84651
  const froalaPackage = 'froala-editor';
84648
84652
  const moduleName$8 = 'editor';
84649
- const min$b = !cookie('env') ? '.min' : '';
84650
- const localDir$c = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemPackage}/*`].replace(/[^\/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
84653
+ const min$c = !cookie('env') ? '.min' : '';
84654
+ const localDir$d = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemPackage}/*`].replace(/[^\/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
84651
84655
  const froalaDir = `${Stratus.BaseUrl}${boot.configuration.paths[froalaPackage].replace(/js\/[^\/]*$/, '')}`;
84652
84656
  const has$2 = (object, path) => _.has(object, path) && !_.isEmpty(_.get(object, path));
84653
84657
  let EditorComponent = exports('EditorComponent', class EditorComponent extends RootComponent {
@@ -85188,12 +85192,12 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
85188
85192
  this.uid = _.uniqueId(`sa_${_.snakeCase(moduleName$8)}_component_`);
85189
85193
  Stratus.Instances[this.uid] = this;
85190
85194
  Stratus.Internals.LoadCss([
85191
- `${localDir$c}${moduleName$8}/${moduleName$8}.component${min$b}.css`,
85192
- `${froalaDir}css/froala_editor.pkgd${min$b}.css`,
85193
- `${froalaDir}css/themes/dark${min$b}.css`,
85194
- `${froalaDir}css/third_party/embedly${min$b}.css`,
85195
- `${froalaDir}css/third_party/font_awesome${min$b}.css`,
85196
- `${froalaDir}css/third_party/image_tui${min$b}.css`,
85195
+ `${localDir$d}${moduleName$8}/${moduleName$8}.component${min$c}.css`,
85196
+ `${froalaDir}css/froala_editor.pkgd${min$c}.css`,
85197
+ `${froalaDir}css/themes/dark${min$c}.css`,
85198
+ `${froalaDir}css/third_party/embedly${min$c}.css`,
85199
+ `${froalaDir}css/third_party/font_awesome${min$c}.css`,
85200
+ `${froalaDir}css/third_party/image_tui${min$c}.css`,
85197
85201
  ]).then(() => {
85198
85202
  this.styled = true;
85199
85203
  this.refresh();
@@ -85596,7 +85600,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
85596
85600
  exports('EditorComponent', EditorComponent = __decorate$k([
85597
85601
  Component({
85598
85602
  selector: `sa-${moduleName$8}`,
85599
- templateUrl: `${localDir$c}/${moduleName$8}/${moduleName$8}.component${min$b}.html`,
85603
+ templateUrl: `${localDir$d}/${moduleName$8}/${moduleName$8}.component${min$c}.html`,
85600
85604
  }),
85601
85605
  __metadata$g("design:paramtypes", [DomSanitizer,
85602
85606
  ChangeDetectorRef,
@@ -122928,8 +122932,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
122928
122932
  };
122929
122933
  const systemDir$7 = '@stratusjs/angular';
122930
122934
  const moduleName$7 = 'base';
122931
- const min$a = !cookie('env') ? '.min' : '';
122932
- const localDir$b = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$7}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
122935
+ const min$b = !cookie('env') ? '.min' : '';
122936
+ const localDir$c = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$7}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
122933
122937
  let BaseComponent = exports('BaseComponent', class BaseComponent extends RootComponent {
122934
122938
  constructor(sanitizer, ref, elementRef) {
122935
122939
  super();
@@ -123006,7 +123010,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
123006
123010
  exports('BaseComponent', BaseComponent = __decorate$h([
123007
123011
  Component({
123008
123012
  selector: 'sa-base',
123009
- templateUrl: `${localDir$b}/${moduleName$7}/${moduleName$7}.component${min$a}.html`,
123013
+ templateUrl: `${localDir$c}/${moduleName$7}/${moduleName$7}.component${min$b}.html`,
123010
123014
  }),
123011
123015
  __metadata$f("design:paramtypes", [DomSanitizer,
123012
123016
  ChangeDetectorRef,
@@ -123027,8 +123031,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
123027
123031
  };
123028
123032
  const systemDir$6 = '@stratusjs/angular';
123029
123033
  const moduleName$6 = 'confirm-dialog';
123030
- const min$9 = !cookie('env') ? '.min' : '';
123031
- const localDir$a = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$6}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
123034
+ const min$a = !cookie('env') ? '.min' : '';
123035
+ const localDir$b = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$6}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
123032
123036
  let ConfirmDialogComponent = exports('ConfirmDialogComponent', class ConfirmDialogComponent {
123033
123037
  constructor(dialogRef, data) {
123034
123038
  this.dialogRef = dialogRef;
@@ -123044,7 +123048,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
123044
123048
  exports('ConfirmDialogComponent', ConfirmDialogComponent = __decorate$g([
123045
123049
  Component({
123046
123050
  selector: `sa-${moduleName$6}`,
123047
- templateUrl: `${localDir$a}/${moduleName$6}/${moduleName$6}.component${min$9}.html`,
123051
+ templateUrl: `${localDir$b}/${moduleName$6}/${moduleName$6}.component${min$a}.html`,
123048
123052
  }),
123049
123053
  __param$3(1, Inject(MAT_DIALOG_DATA)),
123050
123054
  __metadata$e("design:paramtypes", [MatDialogRef, Object])
@@ -123061,8 +123065,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
123061
123065
  };
123062
123066
  const systemDir$5 = '@stratusjs/angular';
123063
123067
  const moduleName$5 = 'media-selector';
123064
- const min$8 = !cookie('env') ? '.min' : '';
123065
- const localDir$9 = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$5}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
123068
+ const min$9 = !cookie('env') ? '.min' : '';
123069
+ const localDir$a = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$5}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
123066
123070
  const has$1 = (object, path) => _.has(object, path) && !_.isEmpty(_.get(object, path));
123067
123071
  let MediaSelectorComponent = exports('MediaSelectorComponent', class MediaSelectorComponent extends RootComponent {
123068
123072
  constructor(iconRegistry, sanitizer, ref, elementRef, viewportRuler) {
@@ -123133,7 +123137,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
123133
123137
  media_selector_audio: `${Stratus.BaseUrl}sitetheorymedia/images/mediaTypeIcons/media-icon-audio.svg`,
123134
123138
  media_selector_document: `${Stratus.BaseUrl}sitetheorymedia/images/mediaTypeIcons/media-icon-document.svg`
123135
123139
  }, (value, key) => iconRegistry.addSvgIcon(key, sanitizer.bypassSecurityTrustResourceUrl(value)).getNamedSvgIcon(key));
123136
- Stratus.Internals.CssLoader(`${localDir$9}${moduleName$5}/${moduleName$5}.component${min$8}.css`)
123140
+ Stratus.Internals.CssLoader(`${localDir$a}${moduleName$5}/${moduleName$5}.component${min$9}.css`)
123137
123141
  .then(() => {
123138
123142
  this.styled = true;
123139
123143
  this.refresh();
@@ -123431,7 +123435,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
123431
123435
  exports('MediaSelectorComponent', MediaSelectorComponent = __decorate$f([
123432
123436
  Component({
123433
123437
  selector: `sa-${moduleName$5}`,
123434
- templateUrl: `${localDir$9}/${moduleName$5}/${moduleName$5}.component${min$8}.html`,
123438
+ templateUrl: `${localDir$a}/${moduleName$5}/${moduleName$5}.component${min$9}.html`,
123435
123439
  }),
123436
123440
  __metadata$d("design:paramtypes", [MatIconRegistry,
123437
123441
  DomSanitizer,
@@ -123461,8 +123465,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
123461
123465
  };
123462
123466
  const systemDir$4 = '@stratusjs/angular';
123463
123467
  const moduleName$4 = 'selector';
123464
- const min$7 = !cookie('env') ? '.min' : '';
123465
- const localDir$8 = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$4}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
123468
+ const min$8 = !cookie('env') ? '.min' : '';
123469
+ const localDir$9 = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$4}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
123466
123470
  const has = (object, path) => _.has(object, path) && !_.isEmpty(_.get(object, path));
123467
123471
  let SelectorComponent = exports('SelectorComponent', class SelectorComponent extends RootComponent {
123468
123472
  constructor(iconRegistry, sanitizer, ref, elementRef) {
@@ -123490,7 +123494,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
123490
123494
  selector_status: `${Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/visibility.svg`,
123491
123495
  selector_edit: `${Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/edit.svg`
123492
123496
  }, (value, key) => iconRegistry.addSvgIcon(key, sanitizer.bypassSecurityTrustResourceUrl(value)).getNamedSvgIcon(key));
123493
- Stratus.Internals.CssLoader(`${localDir$8}${moduleName$4}/${moduleName$4}.component${min$7}.css`)
123497
+ Stratus.Internals.CssLoader(`${localDir$9}${moduleName$4}/${moduleName$4}.component${min$8}.css`)
123494
123498
  .then(() => {
123495
123499
  this.styled = true;
123496
123500
  this.refresh();
@@ -123716,7 +123720,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
123716
123720
  exports('SelectorComponent', SelectorComponent = __decorate$e([
123717
123721
  Component({
123718
123722
  selector: `sa-${moduleName$4}`,
123719
- templateUrl: `${localDir$8}/${moduleName$4}/${moduleName$4}.component${min$7}.html`,
123723
+ templateUrl: `${localDir$9}/${moduleName$4}/${moduleName$4}.component${min$8}.html`,
123720
123724
  }),
123721
123725
  __metadata$c("design:paramtypes", [MatIconRegistry,
123722
123726
  DomSanitizer,
@@ -123747,8 +123751,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
123747
123751
  };
123748
123752
  const systemDir$3 = '@stratusjs/angular';
123749
123753
  const moduleName$3 = 'tree';
123750
- const min$6 = !cookie('env') ? '.min' : '';
123751
- const localDir$7 = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$3}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
123754
+ const min$7 = !cookie('env') ? '.min' : '';
123755
+ const localDir$8 = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$3}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
123752
123756
  let TreeComponent = exports('TreeComponent', class TreeComponent extends RootComponent {
123753
123757
  constructor(iconRegistry, sanitizer, backend, ref, elementRef, document) {
123754
123758
  super();
@@ -123784,7 +123788,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
123784
123788
  this.uid = _.uniqueId(`sa_${_.snakeCase(moduleName$3)}_component_`);
123785
123789
  Stratus.Instances[this.uid] = this;
123786
123790
  this.hydrate(this.elementRef, this.sanitizer, ["title", "uid", "isInitialized", "isDestroyed", "isStyled", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "type", "property", "_", "Stratus", "registry", "fetched", "data", "collection", "model", "dataSub", "onChange", "subscriber", "unsettled", "svgIcons", "isSingleClick", "dblClickWait", "dropLists", "dropListIdMap", "dropListMap", "expandedNodeSet", "dragging", "expandTimeout", "expandDelay", "dropData", "cdkDropListSortingDisabled", "dropDebug", "tree", "treeMap", "metaMap", "dataSource", "treeControl", "iconRegistry", "sanitizer", "backend", "ref", "elementRef", "document", "ngOnInit", "ngOnDestroy", "refresh", "remove", "removeNode", "nodeIsEqual", "fetchData", "dataDefer", "dataRef", "trackDropLists", "setExpanded", "setExpandedClick", "setExpandedDblClick", "onDragDrop", "onDragMove", "showDragData", "clearDragData", "buildNodePatch", "getSvg", "addSvgIcon", "hydrate", "disableRefresh", "stagger", "reloading"]);
123787
- Stratus.Internals.CssLoader(`${localDir$7}/${moduleName$3}/${moduleName$3}.component${min$6}.css`)
123791
+ Stratus.Internals.CssLoader(`${localDir$8}/${moduleName$3}/${moduleName$3}.component${min$7}.css`)
123788
123792
  .then(() => {
123789
123793
  this.isStyled = true;
123790
123794
  this.refresh();
@@ -124248,7 +124252,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
124248
124252
  exports('TreeComponent', TreeComponent = __decorate$d([
124249
124253
  Component({
124250
124254
  selector: `sa-${moduleName$3}`,
124251
- templateUrl: `${localDir$7}/${moduleName$3}/${moduleName$3}.component${min$6}.html`,
124255
+ templateUrl: `${localDir$8}/${moduleName$3}/${moduleName$3}.component${min$7}.html`,
124252
124256
  }),
124253
124257
  __param$2(5, Inject(DOCUMENT)),
124254
124258
  __metadata$b("design:paramtypes", [MatIconRegistry,
@@ -124274,8 +124278,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
124274
124278
  const systemDir$2 = '@stratusjs/angular';
124275
124279
  const moduleName$2 = 'tree-dialog';
124276
124280
  const parentModuleName$1 = 'tree';
124277
- const min$5 = !cookie('env') ? '.min' : '';
124278
- const localDir$6 = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$2}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
124281
+ const min$6 = !cookie('env') ? '.min' : '';
124282
+ const localDir$7 = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$2}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
124279
124283
  let TreeDialogComponent = exports('TreeDialogComponent', class TreeDialogComponent extends ResponsiveComponent {
124280
124284
  constructor(dialogRef, data, fb, ref) {
124281
124285
  super();
@@ -124299,7 +124303,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
124299
124303
  ngOnInit() {
124300
124304
  this.uid = _.uniqueId(`sa_${_.snakeCase(moduleName$2)}_component_`);
124301
124305
  Stratus.Instances[this.uid] = this;
124302
- Stratus.Internals.CssLoader(`${localDir$6}/${parentModuleName$1}/${moduleName$2}.component${min$5}.css`)
124306
+ Stratus.Internals.CssLoader(`${localDir$7}/${parentModuleName$1}/${moduleName$2}.component${min$6}.css`)
124303
124307
  .then(() => {
124304
124308
  this.isStyled = true;
124305
124309
  })
@@ -124449,7 +124453,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
124449
124453
  exports('TreeDialogComponent', TreeDialogComponent = __decorate$c([
124450
124454
  Component({
124451
124455
  selector: `sa-${moduleName$2}`,
124452
- templateUrl: `${localDir$6}/${parentModuleName$1}/${moduleName$2}.component${min$5}.html`,
124456
+ templateUrl: `${localDir$7}/${parentModuleName$1}/${moduleName$2}.component${min$6}.html`,
124453
124457
  }),
124454
124458
  __param$1(1, Inject(MAT_DIALOG_DATA)),
124455
124459
  __metadata$a("design:paramtypes", [MatDialogRef, Object, FormBuilder,
@@ -124468,8 +124472,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
124468
124472
  const systemDir$1 = '@stratusjs/angular';
124469
124473
  const moduleName$1 = 'tree-node';
124470
124474
  const parentModuleName = 'tree';
124471
- const min$4 = !cookie('env') ? '.min' : '';
124472
- const localDir$5 = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$1}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
124475
+ const min$5 = !cookie('env') ? '.min' : '';
124476
+ const localDir$6 = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir$1}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
124473
124477
  let TreeNodeComponent = exports('TreeNodeComponent', class TreeNodeComponent extends ResponsiveComponent {
124474
124478
  constructor(dialog, ref) {
124475
124479
  super();
@@ -124487,7 +124491,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
124487
124491
  ngOnInit() {
124488
124492
  this.uid = _.uniqueId(`sa_${_.snakeCase(moduleName$1)}_component_`);
124489
124493
  Stratus.Instances[this.uid] = this;
124490
- Stratus.Internals.CssLoader(`${localDir$5}/${parentModuleName}/${moduleName$1}.component${min$4}.css`)
124494
+ Stratus.Internals.CssLoader(`${localDir$6}/${parentModuleName}/${moduleName$1}.component${min$5}.css`)
124491
124495
  .then(() => {
124492
124496
  this.isStyled = true;
124493
124497
  this.refresh();
@@ -124698,7 +124702,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
124698
124702
  exports('TreeNodeComponent', TreeNodeComponent = __decorate$b([
124699
124703
  Component({
124700
124704
  selector: `sa-${moduleName$1}`,
124701
- templateUrl: `${localDir$5}/${parentModuleName}/${moduleName$1}.component${min$4}.html`,
124705
+ templateUrl: `${localDir$6}/${parentModuleName}/${moduleName$1}.component${min$5}.html`,
124702
124706
  }),
124703
124707
  __metadata$9("design:paramtypes", [MatDialog,
124704
124708
  ChangeDetectorRef])
@@ -124802,11 +124806,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
124802
124806
  /** Width of the map. Set this to `null` if you'd like to control the width through CSS. */
124803
124807
  this.width = DEFAULT_WIDTH;
124804
124808
  this._options = DEFAULT_OPTIONS;
124805
- /**
124806
- * See
124807
- * https://developers.google.com/maps/documentation/javascript/events#auth-errors
124808
- */
124809
- this.authFailure = new EventEmitter();
124810
124809
  /**
124811
124810
  * See
124812
124811
  * https://developers.google.com/maps/documentation/javascript/reference/map#Map.bounds_changed
@@ -124907,13 +124906,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
124907
124906
  'https://developers.google.com/maps/documentation/javascript/' +
124908
124907
  'tutorial#Loading_the_Maps_API');
124909
124908
  }
124910
- this._existingAuthFailureCallback = googleMapsWindow.gm_authFailure;
124911
- googleMapsWindow.gm_authFailure = () => {
124912
- if (this._existingAuthFailureCallback) {
124913
- this._existingAuthFailureCallback();
124914
- }
124915
- this.authFailure.emit();
124916
- };
124917
124909
  }
124918
124910
  }
124919
124911
  set center(center) {
@@ -124962,10 +124954,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
124962
124954
  }
124963
124955
  ngOnDestroy() {
124964
124956
  this._eventManager.destroy();
124965
- if (this._isBrowser) {
124966
- const googleMapsWindow = window;
124967
- googleMapsWindow.gm_authFailure = this._existingAuthFailureCallback;
124968
- }
124969
124957
  }
124970
124958
  /**
124971
124959
  * See
@@ -125152,7 +125140,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
125152
125140
  center: [{ type: Input }],
125153
125141
  zoom: [{ type: Input }],
125154
125142
  options: [{ type: Input }],
125155
- authFailure: [{ type: Output }],
125156
125143
  boundsChanged: [{ type: Output }],
125157
125144
  centerChanged: [{ type: Output }],
125158
125145
  mapClick: [{ type: Output }],
@@ -125505,131 +125492,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
125505
125492
  circleRightclick: [{ type: Output }]
125506
125493
  };
125507
125494
 
125508
- /**
125509
- * @license
125510
- * Copyright Google LLC All Rights Reserved.
125511
- *
125512
- * Use of this source code is governed by an MIT-style license that can be
125513
- * found in the LICENSE file at https://angular.io/license
125514
- */
125515
- /**
125516
- * Angular component that renders a Google Maps Directions Renderer via the Google Maps
125517
- * JavaScript API.
125518
- *
125519
- * See developers.google.com/maps/documentation/javascript/reference/directions#DirectionsRenderer
125520
- */
125521
- class MapDirectionsRenderer {
125522
- constructor(_googleMap, _ngZone) {
125523
- this._googleMap = _googleMap;
125524
- this._ngZone = _ngZone;
125525
- this._eventManager = new MapEventManager(this._ngZone);
125526
- /**
125527
- * See developers.google.com/maps/documentation/javascript/reference/directions
125528
- * #DirectionsRenderer.directions_changed
125529
- */
125530
- this.directionsChanged = this._eventManager.getLazyEmitter('directions_changed');
125531
- }
125532
- /**
125533
- * See developers.google.com/maps/documentation/javascript/reference/directions
125534
- * #DirectionsRendererOptions.directions
125535
- */
125536
- set directions(directions) {
125537
- this._directions = directions;
125538
- }
125539
- /**
125540
- * See developers.google.com/maps/documentation/javascript/reference/directions
125541
- * #DirectionsRendererOptions
125542
- */
125543
- set options(options) {
125544
- this._options = options;
125545
- }
125546
- ngOnInit() {
125547
- if (this._googleMap._isBrowser) {
125548
- // Create the object outside the zone so its events don't trigger change detection.
125549
- // We'll bring it back in inside the `MapEventManager` only for the events that the
125550
- // user has subscribed to.
125551
- this._ngZone.runOutsideAngular(() => {
125552
- this.directionsRenderer = new google.maps.DirectionsRenderer(this._combineOptions());
125553
- });
125554
- this._assertInitialized();
125555
- this.directionsRenderer.setMap(this._googleMap.googleMap);
125556
- this._eventManager.setTarget(this.directionsRenderer);
125557
- }
125558
- }
125559
- ngOnChanges(changes) {
125560
- if (this.directionsRenderer) {
125561
- if (changes['options']) {
125562
- this.directionsRenderer.setOptions(this._combineOptions());
125563
- }
125564
- if (changes['directions'] && this._directions !== undefined) {
125565
- this.directionsRenderer.setDirections(this._directions);
125566
- }
125567
- }
125568
- }
125569
- ngOnDestroy() {
125570
- this._eventManager.destroy();
125571
- if (this.directionsRenderer) {
125572
- this.directionsRenderer.setMap(null);
125573
- }
125574
- }
125575
- /**
125576
- * See developers.google.com/maps/documentation/javascript/reference/directions
125577
- * #DirectionsRenderer.getDirections
125578
- */
125579
- getDirections() {
125580
- this._assertInitialized();
125581
- return this.directionsRenderer.getDirections();
125582
- }
125583
- /**
125584
- * See developers.google.com/maps/documentation/javascript/reference/directions
125585
- * #DirectionsRenderer.getPanel
125586
- */
125587
- getPanel() {
125588
- this._assertInitialized();
125589
- return this.directionsRenderer.getPanel();
125590
- }
125591
- /**
125592
- * See developers.google.com/maps/documentation/javascript/reference/directions
125593
- * #DirectionsRenderer.getRouteIndex
125594
- */
125595
- getRouteIndex() {
125596
- this._assertInitialized();
125597
- return this.directionsRenderer.getRouteIndex();
125598
- }
125599
- _combineOptions() {
125600
- const options = this._options || {};
125601
- return Object.assign(Object.assign({}, options), { directions: this._directions || options.directions, map: this._googleMap.googleMap });
125602
- }
125603
- _assertInitialized() {
125604
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
125605
- if (!this._googleMap.googleMap) {
125606
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
125607
- 'Please wait for the API to load before trying to interact with it.');
125608
- }
125609
- if (!this.directionsRenderer) {
125610
- throw Error('Cannot interact with a Google Map Directions Renderer before it has been ' +
125611
- 'initialized. Please wait for the Directions Renderer to load before trying ' +
125612
- 'to interact with it.');
125613
- }
125614
- }
125615
- }
125616
- }
125617
- MapDirectionsRenderer.decorators = [
125618
- { type: Directive, args: [{
125619
- selector: 'map-directions-renderer',
125620
- exportAs: 'mapDirectionsRenderer',
125621
- },] }
125622
- ];
125623
- MapDirectionsRenderer.ctorParameters = () => [
125624
- { type: GoogleMap },
125625
- { type: NgZone }
125626
- ];
125627
- MapDirectionsRenderer.propDecorators = {
125628
- directions: [{ type: Input }],
125629
- options: [{ type: Input }],
125630
- directionsChanged: [{ type: Output }]
125631
- };
125632
-
125633
125495
  /**
125634
125496
  * @license
125635
125497
  * Copyright Google LLC All Rights Reserved.
@@ -126298,20 +126160,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126298
126160
  set options(options) {
126299
126161
  this._options = options;
126300
126162
  }
126301
- /**
126302
- * Icon to be used for the marker.
126303
- * See: https://developers.google.com/maps/documentation/javascript/reference/marker#Icon
126304
- */
126305
- set icon(icon) {
126306
- this._icon = icon;
126307
- }
126308
- /**
126309
- * Whether the marker is visible.
126310
- * See: developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.visible
126311
- */
126312
- set visible(value) {
126313
- this._visible = value;
126314
- }
126315
126163
  ngOnInit() {
126316
126164
  if (this._googleMap._isBrowser) {
126317
126165
  // Create the object outside the zone so its events don't trigger change detection.
@@ -126326,7 +126174,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126326
126174
  }
126327
126175
  }
126328
126176
  ngOnChanges(changes) {
126329
- const { marker, _title, _position, _label, _clickable, _icon, _visible } = this;
126177
+ const { marker, _title, _position, _label, _clickable } = this;
126330
126178
  if (marker) {
126331
126179
  if (changes['options']) {
126332
126180
  marker.setOptions(this._combineOptions());
@@ -126343,12 +126191,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126343
126191
  if (changes['clickable'] && _clickable !== undefined) {
126344
126192
  marker.setClickable(_clickable);
126345
126193
  }
126346
- if (changes['icon'] && _icon) {
126347
- marker.setIcon(_icon);
126348
- }
126349
- if (changes['visible'] && _visible !== undefined) {
126350
- marker.setVisible(_visible);
126351
- }
126352
126194
  }
126353
126195
  }
126354
126196
  ngOnDestroy() {
@@ -126460,9 +126302,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126460
126302
  }
126461
126303
  /** Creates a combined options object using the passed-in options and the individual inputs. */
126462
126304
  _combineOptions() {
126463
- var _a, _b;
126464
126305
  const options = this._options || DEFAULT_MARKER_OPTIONS;
126465
- return Object.assign(Object.assign({}, options), { title: this._title || options.title, position: this._position || options.position, label: this._label || options.label, clickable: (_a = this._clickable) !== null && _a !== void 0 ? _a : options.clickable, map: this._googleMap.googleMap, icon: this._icon || options.icon, visible: (_b = this._visible) !== null && _b !== void 0 ? _b : options.visible });
126306
+ return Object.assign(Object.assign({}, options), { title: this._title || options.title, position: this._position || options.position, label: this._label || options.label, clickable: this._clickable !== undefined ? this._clickable : options.clickable, map: this._googleMap.googleMap });
126466
126307
  }
126467
126308
  _assertInitialized() {
126468
126309
  if (typeof ngDevMode === 'undefined' || ngDevMode) {
@@ -126493,8 +126334,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126493
126334
  label: [{ type: Input }],
126494
126335
  clickable: [{ type: Input }],
126495
126336
  options: [{ type: Input }],
126496
- icon: [{ type: Input }],
126497
- visible: [{ type: Input }],
126498
126337
  animationChanged: [{ type: Output }],
126499
126338
  mapClick: [{ type: Output }],
126500
126339
  clickableChanged: [{ type: Output }],
@@ -126525,8 +126364,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126525
126364
  * Use of this source code is governed by an MIT-style license that can be
126526
126365
  * found in the LICENSE file at https://angular.io/license
126527
126366
  */
126528
- /** Default options for a clusterer. */
126529
- const DEFAULT_CLUSTERER_OPTIONS = {};
126530
126367
  /**
126531
126368
  * Angular component for implementing a Google Maps Marker Clusterer.
126532
126369
  *
@@ -126551,8 +126388,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126551
126388
  * googlemaps.github.io/v3-utility-library/modules/_google_markerclustererplus.html#clusteringend
126552
126389
  */
126553
126390
  this.clusteringend = this._eventManager.getLazyEmitter('clusteringend');
126554
- /** Emits when a cluster has been clicked. */
126555
- this.clusterClick = this._eventManager.getLazyEmitter('click');
126556
126391
  this._canInitialize = this._googleMap._isBrowser;
126557
126392
  }
126558
126393
  set averageCenter(averageCenter) {
@@ -126603,17 +126438,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126603
126438
  set zoomOnClick(zoomOnClick) {
126604
126439
  this._zoomOnClick = zoomOnClick;
126605
126440
  }
126606
- set options(options) {
126607
- this._options = options;
126608
- }
126609
126441
  ngOnInit() {
126610
126442
  if (this._canInitialize) {
126611
- const clustererWindow = window;
126612
- if (!clustererWindow.MarkerClusterer && (typeof ngDevMode === 'undefined' || ngDevMode)) {
126613
- throw Error('MarkerClusterer class not found, cannot construct a marker cluster. ' +
126614
- 'Please install the MarkerClustererPlus library: ' +
126615
- 'https://github.com/googlemaps/js-markerclustererplus');
126616
- }
126617
126443
  // Create the object outside the zone so its events don't trigger change detection.
126618
126444
  // We'll bring it back in inside the `MapEventManager` only for the events that the
126619
126445
  // user has subscribed to.
@@ -126632,9 +126458,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126632
126458
  ngOnChanges(changes) {
126633
126459
  const { markerClusterer: clusterer, ariaLabelFn, _averageCenter, _batchSizeIE, _calculator, _styles, _clusterClass, _enableRetinaIcons, _gridSize, _ignoreHidden, _imageExtension, _imagePath, _imageSizes, _maxZoom, _minimumClusterSize, _title, _zIndex, _zoomOnClick } = this;
126634
126460
  if (clusterer) {
126635
- if (changes['options']) {
126636
- clusterer.setOptions(this._combineOptions());
126637
- }
126638
126461
  if (changes['ariaLabelFn']) {
126639
126462
  clusterer.ariaLabelFn = ariaLabelFn;
126640
126463
  }
@@ -126644,7 +126467,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126644
126467
  if (changes['batchSizeIE'] && _batchSizeIE !== undefined) {
126645
126468
  clusterer.setBatchSizeIE(_batchSizeIE);
126646
126469
  }
126647
- if (changes['calculator'] && !!_calculator) {
126470
+ if (changes['calculator'] && _calculator) {
126648
126471
  clusterer.setCalculator(_calculator);
126649
126472
  }
126650
126473
  if (changes['clusterClass'] && _clusterClass !== undefined) {
@@ -126777,9 +126600,26 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126777
126600
  return this.markerClusterer.getZoomOnClick();
126778
126601
  }
126779
126602
  _combineOptions() {
126780
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
126781
- const options = this._options || DEFAULT_CLUSTERER_OPTIONS;
126782
- return Object.assign(Object.assign({}, options), { ariaLabelFn: (_a = this.ariaLabelFn) !== null && _a !== void 0 ? _a : options.ariaLabelFn, averageCenter: (_b = this._averageCenter) !== null && _b !== void 0 ? _b : options.averageCenter, batchSize: (_c = this.batchSize) !== null && _c !== void 0 ? _c : options.batchSize, batchSizeIE: (_d = this._batchSizeIE) !== null && _d !== void 0 ? _d : options.batchSizeIE, calculator: (_e = this._calculator) !== null && _e !== void 0 ? _e : options.calculator, clusterClass: (_f = this._clusterClass) !== null && _f !== void 0 ? _f : options.clusterClass, enableRetinaIcons: (_g = this._enableRetinaIcons) !== null && _g !== void 0 ? _g : options.enableRetinaIcons, gridSize: (_h = this._gridSize) !== null && _h !== void 0 ? _h : options.gridSize, ignoreHidden: (_j = this._ignoreHidden) !== null && _j !== void 0 ? _j : options.ignoreHidden, imageExtension: (_k = this._imageExtension) !== null && _k !== void 0 ? _k : options.imageExtension, imagePath: (_l = this._imagePath) !== null && _l !== void 0 ? _l : options.imagePath, imageSizes: (_m = this._imageSizes) !== null && _m !== void 0 ? _m : options.imageSizes, maxZoom: (_o = this._maxZoom) !== null && _o !== void 0 ? _o : options.maxZoom, minimumClusterSize: (_p = this._minimumClusterSize) !== null && _p !== void 0 ? _p : options.minimumClusterSize, styles: (_q = this._styles) !== null && _q !== void 0 ? _q : options.styles, title: (_r = this._title) !== null && _r !== void 0 ? _r : options.title, zIndex: (_s = this._zIndex) !== null && _s !== void 0 ? _s : options.zIndex, zoomOnClick: (_t = this._zoomOnClick) !== null && _t !== void 0 ? _t : options.zoomOnClick });
126603
+ return {
126604
+ ariaLabelFn: this.ariaLabelFn,
126605
+ averageCenter: this._averageCenter,
126606
+ batchSize: this.batchSize,
126607
+ batchSizeIE: this._batchSizeIE,
126608
+ calculator: this._calculator,
126609
+ clusterClass: this._clusterClass,
126610
+ enableRetinaIcons: this._enableRetinaIcons,
126611
+ gridSize: this._gridSize,
126612
+ ignoreHidden: this._ignoreHidden,
126613
+ imageExtension: this._imageExtension,
126614
+ imagePath: this._imagePath,
126615
+ imageSizes: this._imageSizes,
126616
+ maxZoom: this._maxZoom,
126617
+ minimumClusterSize: this._minimumClusterSize,
126618
+ styles: this._styles,
126619
+ title: this._title,
126620
+ zIndex: this._zIndex,
126621
+ zoomOnClick: this._zoomOnClick,
126622
+ };
126783
126623
  }
126784
126624
  _watchForMarkerChanges() {
126785
126625
  this._assertInitialized();
@@ -126862,10 +126702,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126862
126702
  title: [{ type: Input }],
126863
126703
  zIndex: [{ type: Input }],
126864
126704
  zoomOnClick: [{ type: Input }],
126865
- options: [{ type: Input }],
126866
126705
  clusteringbegin: [{ type: Output }],
126867
126706
  clusteringend: [{ type: Output }],
126868
- clusterClick: [{ type: Output }],
126869
126707
  _markers: [{ type: ContentChildren, args: [MapMarker, { descendants: true },] }]
126870
126708
  };
126871
126709
 
@@ -127265,7 +127103,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
127265
127103
  /**
127266
127104
  * See
127267
127105
  * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.boundsChanged
127268
- */ this.boundsChanged = this._eventManager.getLazyEmitter('bounds_changed');
127106
+ */
127107
+ this.boundsChanged = this._eventManager.getLazyEmitter('bounds_changed');
127269
127108
  /**
127270
127109
  * See
127271
127110
  * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.click
@@ -127566,132 +127405,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
127566
127405
  },] }
127567
127406
  ];
127568
127407
 
127569
- /**
127570
- * @license
127571
- * Copyright Google LLC All Rights Reserved.
127572
- *
127573
- * Use of this source code is governed by an MIT-style license that can be
127574
- * found in the LICENSE file at https://angular.io/license
127575
- */
127576
- /**
127577
- * Angular directive that renders a Google Maps heatmap via the Google Maps JavaScript API.
127578
- *
127579
- * See: https://developers.google.com/maps/documentation/javascript/reference/visualization
127580
- */
127581
- class MapHeatmapLayer {
127582
- constructor(_googleMap, _ngZone) {
127583
- this._googleMap = _googleMap;
127584
- this._ngZone = _ngZone;
127585
- }
127586
- /**
127587
- * Data shown on the heatmap.
127588
- * See: https://developers.google.com/maps/documentation/javascript/reference/visualization
127589
- */
127590
- set data(data) {
127591
- this._data = data;
127592
- }
127593
- /**
127594
- * Options used to configure the heatmap. See:
127595
- * developers.google.com/maps/documentation/javascript/reference/visualization#HeatmapLayerOptions
127596
- */
127597
- set options(options) {
127598
- this._options = options;
127599
- }
127600
- ngOnInit() {
127601
- var _a, _b;
127602
- if (this._googleMap._isBrowser) {
127603
- if (!((_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.visualization) && (typeof ngDevMode === 'undefined' || ngDevMode)) {
127604
- throw Error('Namespace `google.maps.visualization` not found, cannot construct heatmap. ' +
127605
- 'Please install the Google Maps JavaScript API with the "visualization" library: ' +
127606
- 'https://developers.google.com/maps/documentation/javascript/visualization');
127607
- }
127608
- // Create the object outside the zone so its events don't trigger change detection.
127609
- // We'll bring it back in inside the `MapEventManager` only for the events that the
127610
- // user has subscribed to.
127611
- this._ngZone.runOutsideAngular(() => {
127612
- this.heatmap = new google.maps.visualization.HeatmapLayer(this._combineOptions());
127613
- });
127614
- this._assertInitialized();
127615
- this.heatmap.setMap(this._googleMap.googleMap);
127616
- }
127617
- }
127618
- ngOnChanges(changes) {
127619
- const { _data, heatmap } = this;
127620
- if (heatmap) {
127621
- if (changes['options']) {
127622
- heatmap.setOptions(this._combineOptions());
127623
- }
127624
- if (changes['data'] && _data !== undefined) {
127625
- heatmap.setData(this._normalizeData(_data));
127626
- }
127627
- }
127628
- }
127629
- ngOnDestroy() {
127630
- if (this.heatmap) {
127631
- this.heatmap.setMap(null);
127632
- }
127633
- }
127634
- /**
127635
- * Gets the data that is currently shown on the heatmap.
127636
- * See: developers.google.com/maps/documentation/javascript/reference/visualization#HeatmapLayer
127637
- */
127638
- getData() {
127639
- this._assertInitialized();
127640
- return this.heatmap.getData();
127641
- }
127642
- /** Creates a combined options object using the passed-in options and the individual inputs. */
127643
- _combineOptions() {
127644
- const options = this._options || {};
127645
- return Object.assign(Object.assign({}, options), { data: this._normalizeData(this._data || options.data || []), map: this._googleMap.googleMap });
127646
- }
127647
- /**
127648
- * Most Google Maps APIs support both `LatLng` objects and `LatLngLiteral`. The latter is more
127649
- * convenient to write out, because the Google Maps API doesn't have to have been loaded in order
127650
- * to construct them. The `HeatmapLayer` appears to be an exception that only allows a `LatLng`
127651
- * object, or it throws a runtime error. Since it's more convenient and we expect that Angular
127652
- * users will load the API asynchronously, we allow them to pass in a `LatLngLiteral` and we
127653
- * convert it to a `LatLng` object before passing it off to Google Maps.
127654
- */
127655
- _normalizeData(data) {
127656
- const result = [];
127657
- data.forEach(item => {
127658
- result.push(isLatLngLiteral(item) ? new google.maps.LatLng(item.lat, item.lng) : item);
127659
- });
127660
- return result;
127661
- }
127662
- /** Asserts that the heatmap object has been initialized. */
127663
- _assertInitialized() {
127664
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
127665
- if (!this._googleMap.googleMap) {
127666
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
127667
- 'Please wait for the API to load before trying to interact with it.');
127668
- }
127669
- if (!this.heatmap) {
127670
- throw Error('Cannot interact with a Google Map HeatmapLayer before it has been ' +
127671
- 'initialized. Please wait for the heatmap to load before trying to interact with it.');
127672
- }
127673
- }
127674
- }
127675
- }
127676
- MapHeatmapLayer.decorators = [
127677
- { type: Directive, args: [{
127678
- selector: 'map-heatmap-layer',
127679
- exportAs: 'mapHeatmapLayer',
127680
- },] }
127681
- ];
127682
- MapHeatmapLayer.ctorParameters = () => [
127683
- { type: GoogleMap },
127684
- { type: NgZone }
127685
- ];
127686
- MapHeatmapLayer.propDecorators = {
127687
- data: [{ type: Input }],
127688
- options: [{ type: Input }]
127689
- };
127690
- /** Asserts that an object is a `LatLngLiteral`. */
127691
- function isLatLngLiteral(value) {
127692
- return value && typeof value.lat === 'number' && typeof value.lng === 'number';
127693
- }
127694
-
127695
127408
  /**
127696
127409
  * @license
127697
127410
  * Copyright Google LLC All Rights Reserved.
@@ -127704,7 +127417,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
127704
127417
  MapBaseLayer,
127705
127418
  MapBicyclingLayer,
127706
127419
  MapCircle,
127707
- MapDirectionsRenderer,
127708
127420
  MapGroundOverlay,
127709
127421
  MapInfoWindow,
127710
127422
  MapKmlLayer,
@@ -127715,7 +127427,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
127715
127427
  MapRectangle,
127716
127428
  MapTrafficLayer,
127717
127429
  MapTransitLayer,
127718
- MapHeatmapLayer,
127719
127430
  ];
127720
127431
  class GoogleMapsModule {
127721
127432
  }
@@ -127726,95 +127437,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
127726
127437
  },] }
127727
127438
  ];
127728
127439
 
127729
- /**
127730
- * @license
127731
- * Copyright Google LLC All Rights Reserved.
127732
- *
127733
- * Use of this source code is governed by an MIT-style license that can be
127734
- * found in the LICENSE file at https://angular.io/license
127735
- */
127736
- /**
127737
- * Angular service that wraps the Google Maps DirectionsService from the Google Maps JavaScript
127738
- * API.
127739
- *
127740
- * See developers.google.com/maps/documentation/javascript/reference/directions#DirectionsService
127741
- */
127742
- class MapDirectionsService {
127743
- constructor(_ngZone) {
127744
- this._ngZone = _ngZone;
127745
- }
127746
- /**
127747
- * See
127748
- * developers.google.com/maps/documentation/javascript/reference/directions
127749
- * #DirectionsService.route
127750
- */
127751
- route(request) {
127752
- return new Observable(observer => {
127753
- // Initialize the `DirectionsService` lazily since the Google Maps API may
127754
- // not have been loaded when the provider is instantiated.
127755
- if (!this._directionsService) {
127756
- this._directionsService = new google.maps.DirectionsService();
127757
- }
127758
- const callback = (result, status) => {
127759
- this._ngZone.run(() => {
127760
- observer.next({ result, status });
127761
- observer.complete();
127762
- });
127763
- };
127764
- this._directionsService.route(request, callback);
127765
- });
127766
- }
127767
- }
127768
- MapDirectionsService.ɵprov = ɵɵdefineInjectable({ factory: function MapDirectionsService_Factory() { return new MapDirectionsService(ɵɵinject(NgZone)); }, token: MapDirectionsService, providedIn: "root" });
127769
- MapDirectionsService.decorators = [
127770
- { type: Injectable, args: [{ providedIn: 'root' },] }
127771
- ];
127772
- MapDirectionsService.ctorParameters = () => [
127773
- { type: NgZone }
127774
- ];
127775
-
127776
- /**
127777
- * @license
127778
- * Copyright Google LLC All Rights Reserved.
127779
- *
127780
- * Use of this source code is governed by an MIT-style license that can be
127781
- * found in the LICENSE file at https://angular.io/license
127782
- */
127783
- /**
127784
- * Angular service that wraps the Google Maps Geocoder from the Google Maps JavaScript API.
127785
- * See developers.google.com/maps/documentation/javascript/reference/geocoder#Geocoder
127786
- */
127787
- class MapGeocoder {
127788
- constructor(_ngZone) {
127789
- this._ngZone = _ngZone;
127790
- }
127791
- /**
127792
- * See developers.google.com/maps/documentation/javascript/reference/geocoder#Geocoder.geocode
127793
- */
127794
- geocode(request) {
127795
- return new Observable(observer => {
127796
- // Initialize the `Geocoder` lazily since the Google Maps API may
127797
- // not have been loaded when the provider is instantiated.
127798
- if (!this._geocoder) {
127799
- this._geocoder = new google.maps.Geocoder();
127800
- }
127801
- this._geocoder.geocode(request, (results, status) => {
127802
- this._ngZone.run(() => {
127803
- observer.next({ results, status });
127804
- observer.complete();
127805
- });
127806
- });
127807
- });
127808
- }
127809
- }
127810
- MapGeocoder.ɵprov = ɵɵdefineInjectable({ factory: function MapGeocoder_Factory() { return new MapGeocoder(ɵɵinject(NgZone)); }, token: MapGeocoder, providedIn: "root" });
127811
- MapGeocoder.decorators = [
127812
- { type: Injectable, args: [{ providedIn: 'root' },] }
127813
- ];
127814
- MapGeocoder.ctorParameters = () => [
127815
- { type: NgZone }
127816
- ];
127817
-
127818
127440
  var __decorate$a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
127819
127441
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
127820
127442
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -127835,7 +127457,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
127835
127457
  };
127836
127458
  const packageName$6 = 'map';
127837
127459
  const systemDir = `@stratusjs/${packageName$6}`;
127838
- const localDir$4 = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '').replace(/angular\/dist\/$/, 'map/src/')}`;
127460
+ const localDir$5 = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '').replace(/angular\/dist\/$/, 'map/src/')}`;
127839
127461
  const moduleName = 'map';
127840
127462
  const devGoogleMapsKey = 'AIzaSyBAyMH-A99yD5fHQPz7uzqk8glNJYGEqus';
127841
127463
  class Watcher {
@@ -127933,7 +127555,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
127933
127555
  this.highestMarkerZIndex = 0;
127934
127556
  this.uid = safeUniqueId('sa', moduleName, 'component');
127935
127557
  Stratus.Instances[this.uid] = this;
127936
- Stratus.Internals.CssLoader(`${localDir$4}/${moduleName}.component.css`)
127558
+ Stratus.Internals.CssLoader(`${localDir$5}/${moduleName}.component.css`)
127937
127559
  .then(() => {
127938
127560
  this.styled = true;
127939
127561
  })
@@ -128394,7 +128016,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128394
128016
  MapComponent = __decorate$a([
128395
128017
  Component({
128396
128018
  selector: `sa-${moduleName}`,
128397
- templateUrl: `${localDir$4}/${moduleName}.component.html`
128019
+ templateUrl: `${localDir$5}/${moduleName}.component.html`
128398
128020
  }),
128399
128021
  __metadata$8("design:paramtypes", [KeyValueDiffers,
128400
128022
  Window,
@@ -128457,11 +128079,25 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128457
128079
  step((generator = generator.apply(thisArg, _arguments || [])).next());
128458
128080
  });
128459
128081
  };
128082
+ class StripeComponent extends RootComponent$1 {
128083
+ constructor() {
128084
+ super(...arguments);
128085
+ this.styled = false;
128086
+ this.initialized = false;
128087
+ }
128088
+ }
128089
+ __decorate$8([
128090
+ Input(),
128091
+ __metadata$7("design:type", String)
128092
+ ], StripeComponent.prototype, "elementId", void 0);
128093
+ class StripeListComponent extends StripeComponent {
128094
+ }
128460
128095
  let StripeService = class StripeService {
128461
128096
  constructor() {
128462
128097
  this.publishKey = '';
128463
128098
  this.Stripe = {};
128464
- this.collections = [];
128099
+ this.instanceOnEmitters = {};
128100
+ this.collections = {};
128465
128101
  this.initializing = false;
128466
128102
  this.initialized = false;
128467
128103
  Stratus.Services.Stripe = this;
@@ -128575,12 +128211,29 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128575
128211
  return this.Stripe.stripe.confirmCardSetup(clientSecret, stripeData, options);
128576
128212
  });
128577
128213
  }
128578
- registerCollection(collection) {
128579
- this.collections.push(collection);
128214
+ registerCollection(component, collection) {
128215
+ this.collections[component.uid] = { uid: component.uid, component, collection };
128580
128216
  }
128581
- fetchCollections() {
128582
- this.collections.forEach((collection) => {
128583
- collection.fetch().then();
128217
+ fetchCollections(uid) {
128218
+ return __awaiter$6(this, void 0, void 0, function* () {
128219
+ let uids;
128220
+ if (isString(uid) &&
128221
+ uid.length > 0) {
128222
+ uids = [uid];
128223
+ }
128224
+ else {
128225
+ uids = Object.keys(this.collections);
128226
+ }
128227
+ const uidList = [];
128228
+ uids.forEach((uidName) => {
128229
+ if (Object.prototype.hasOwnProperty.call(this.collections, uidName)) {
128230
+ uidList.push(() => __awaiter$6(this, void 0, void 0, function* () {
128231
+ yield this.collections[uidName].collection.fetch();
128232
+ this.emitManual('collectionUpdated', uidName, this.collections[uidName].component, this.collections[uidName].collection);
128233
+ }));
128234
+ }
128235
+ });
128236
+ yield Promise.all(uidList.map(fn => fn()));
128584
128237
  });
128585
128238
  }
128586
128239
  createElement(id, publishKey, paymentMethodType, options, mountElement) {
@@ -128644,6 +128297,53 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128644
128297
  this.currentElement = undefined;
128645
128298
  }
128646
128299
  }
128300
+ emit(emitterName, component, ...variables) {
128301
+ this.emitManual(emitterName, component.elementId, component, variables);
128302
+ }
128303
+ emitManual(emitterName, uid, component, ...variables) {
128304
+ var _a, _b;
128305
+ var _c, _d;
128306
+ if (Object.prototype.hasOwnProperty.call(this.instanceOnEmitters, uid) &&
128307
+ Object.prototype.hasOwnProperty.call(this.instanceOnEmitters[uid], emitterName)) {
128308
+ Object.values(this.instanceOnEmitters[uid][emitterName]).forEach((emitter) => {
128309
+ try {
128310
+ emitter(component, variables);
128311
+ }
128312
+ catch (e) {
128313
+ console.error(e, 'issue sending back emitter on', uid, emitterName, emitter);
128314
+ }
128315
+ });
128316
+ }
128317
+ if (emitterName === 'init') {
128318
+ (_a = (_c = this.instanceOnEmitters)[uid]) !== null && _a !== void 0 ? _a : (_c[uid] = {});
128319
+ (_b = (_d = this.instanceOnEmitters[uid])[emitterName]) !== null && _b !== void 0 ? _b : (_d[emitterName] = {});
128320
+ }
128321
+ }
128322
+ removeOnManual(emitterName, emitterId, onId) {
128323
+ if (Object.prototype.hasOwnProperty.call(this.instanceOnEmitters, emitterId) &&
128324
+ Object.prototype.hasOwnProperty.call(this.instanceOnEmitters[emitterId], emitterName) &&
128325
+ Object.prototype.hasOwnProperty.call(this.instanceOnEmitters[emitterId][emitterName], onId)) {
128326
+ delete this.instanceOnEmitters[emitterId][emitterName][onId];
128327
+ }
128328
+ }
128329
+ on(uid, emitterName, callback) {
128330
+ if (emitterName === 'init' &&
128331
+ Object.prototype.hasOwnProperty.call(this.instanceOnEmitters, uid) &&
128332
+ Object.prototype.hasOwnProperty.call(this.instanceOnEmitters[uid], emitterName) &&
128333
+ Object.prototype.hasOwnProperty.call(Stratus.Instances, uid)) {
128334
+ callback(Stratus.Instances[uid]);
128335
+ return;
128336
+ }
128337
+ if (!Object.prototype.hasOwnProperty.call(this.instanceOnEmitters, uid)) {
128338
+ this.instanceOnEmitters[uid] = {};
128339
+ }
128340
+ if (!Object.prototype.hasOwnProperty.call(this.instanceOnEmitters[uid], emitterName)) {
128341
+ this.instanceOnEmitters[uid][emitterName] = {};
128342
+ }
128343
+ const onId = uniqueId$3();
128344
+ this.instanceOnEmitters[uid][emitterName][onId] = callback;
128345
+ return () => { this.removeOnManual(uid, emitterName, onId); };
128346
+ }
128647
128347
  };
128648
128348
  StripeService = __decorate$8([
128649
128349
  Injectable({
@@ -128673,11 +128373,11 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128673
128373
  step((generator = generator.apply(thisArg, _arguments || [])).next());
128674
128374
  });
128675
128375
  };
128676
- const min$3 = !cookie('env') ? '.min' : '';
128376
+ const min$4 = !cookie('env') ? '.min' : '';
128677
128377
  const packageName$5 = 'stripe';
128678
128378
  const componentName$5 = 'payment-method';
128679
- const localDir$3 = `${Stratus.BaseUrl}${Stratus.DeploymentPath}@stratusjs/${packageName$5}/src/`;
128680
- let StripePaymentMethodComponent = class StripePaymentMethodComponent extends RootComponent {
128379
+ const localDir$4 = `${Stratus.BaseUrl}${Stratus.DeploymentPath}@stratusjs/${packageName$5}/src/`;
128380
+ let StripePaymentMethodComponent = class StripePaymentMethodComponent extends StripeComponent {
128681
128381
  constructor(elementRef, sanitizer, Stripe, dialogRef, dialogData) {
128682
128382
  super();
128683
128383
  this.elementRef = elementRef;
@@ -128688,8 +128388,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128688
128388
  this.title = `${packageName$5}_${componentName$5}_component`;
128689
128389
  this.urlRoot = '/Api';
128690
128390
  this.paymentMethodApiPath = 'PaymentMethod';
128691
- this.styled = false;
128692
- this.initialized = false;
128693
128391
  this.cardComplete = false;
128694
128392
  this.cardSaved = false;
128695
128393
  this.formPending = false;
@@ -128701,7 +128399,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128701
128399
  this.uid = safeUniqueId('sa', snakeCase(this.title));
128702
128400
  Stratus.Instances[this.uid] = this;
128703
128401
  this.elementId = this.elementId || this.uid;
128704
- Stratus.Internals.CssLoader(`${localDir$3}${componentName$5}.component${min$3}.css`)
128402
+ Stratus.Internals.CssLoader(`${localDir$4}${componentName$5}.component${min$4}.css`)
128705
128403
  .then(() => {
128706
128404
  this.styled = true;
128707
128405
  })
@@ -128709,7 +128407,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128709
128407
  console.error('CSS Failed to load for Component:', this);
128710
128408
  this.styled = false;
128711
128409
  });
128712
- this.hydrate(this.elementRef, this.sanitizer, ["title", "uid", "elementId", "_", "urlRoot", "paymentMethodApiPath", "styled", "initialized", "cardComplete", "cardSaved", "formPending", "clientSecret", "publishKey", "formMessage", "detailedBillingInfo", "defaultBillingInfo", "billingInfo", "cardId", "elementRef", "sanitizer", "Stripe", "dialogRef", "dialogData", "ngOnInit", "isEditable", "isBillingDetailsFilled", "isSubmittable", "saveCard", "dialogClose", "ngOnDestroy", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh"]);
128410
+ this.hydrate(this.elementRef, this.sanitizer, ["title", "_", "urlRoot", "paymentMethodApiPath", "cardComplete", "cardSaved", "formPending", "clientSecret", "publishKey", "formMessage", "detailedBillingInfo", "defaultBillingInfo", "billingInfo", "cardId", "elementRef", "sanitizer", "Stripe", "dialogRef", "dialogData", "ngOnInit", "isEditable", "isBillingDetailsFilled", "isSubmittable", "saveCard", "dialogClose", "ngOnDestroy", "uid", "elementId", "styled", "initialized", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh"]);
128713
128411
  if (!isEmpty(this.dialogData)) {
128714
128412
  const keysPossible = ["clientSecret", "publishKey", "formMessage", "urlRoot", "paymentMethodApiPath", "detailedBillingInfo", "defaultBillingInfo"];
128715
128413
  Object.keys(this.dialogData).forEach((attr) => {
@@ -128799,7 +128497,13 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128799
128497
  yield model.save();
128800
128498
  this.cardSaved = true;
128801
128499
  this.formPending = false;
128802
- this.Stripe.fetchCollections();
128500
+ yield this.Stripe.fetchCollections();
128501
+ const cardDetails = {
128502
+ type: 'card',
128503
+ name: this.billingInfo.name,
128504
+ email: this.billingInfo.email
128505
+ };
128506
+ this.Stripe.emitManual('paymentMethodCreated', 'Stripe', this, cardDetails);
128803
128507
  }
128804
128508
  else {
128805
128509
  this.formPending = false;
@@ -128821,10 +128525,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128821
128525
  super.ngOnDestroy();
128822
128526
  }
128823
128527
  };
128824
- __decorate$7([
128825
- Input(),
128826
- __metadata$6("design:type", String)
128827
- ], StripePaymentMethodComponent.prototype, "elementId", void 0);
128828
128528
  __decorate$7([
128829
128529
  Input(),
128830
128530
  __metadata$6("design:type", String)
@@ -128856,7 +128556,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128856
128556
  StripePaymentMethodComponent = __decorate$7([
128857
128557
  Component({
128858
128558
  selector: `sa-${packageName$5}-${componentName$5}`,
128859
- templateUrl: `${localDir$3}${componentName$5}.component${min$3}.html`,
128559
+ templateUrl: `${localDir$4}${componentName$5}.component${min$4}.html`,
128860
128560
  }),
128861
128561
  __param(3, Optional()),
128862
128562
  __param(4, Optional()),
@@ -128885,24 +128585,24 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128885
128585
  step((generator = generator.apply(thisArg, _arguments || [])).next());
128886
128586
  });
128887
128587
  };
128888
- const min$2 = !cookie('env') ? '.min' : '';
128588
+ const min$3 = !cookie('env') ? '.min' : '';
128889
128589
  const packageName$4 = 'stripe';
128890
128590
  const componentName$4 = 'payment-method-item';
128891
- const localDir$2 = `${Stratus.BaseUrl}${Stratus.DeploymentPath}@stratusjs/${packageName$4}/src/`;
128892
- let StripePaymentMethodItemComponent = class StripePaymentMethodItemComponent extends RootComponent {
128893
- constructor(dialog, elementRef, sanitizer) {
128591
+ const localDir$3 = `${Stratus.BaseUrl}${Stratus.DeploymentPath}@stratusjs/${packageName$4}/src/`;
128592
+ let StripePaymentMethodItemComponent = class StripePaymentMethodItemComponent extends StripeComponent {
128593
+ constructor(dialog, elementRef, sanitizer, Stripe) {
128894
128594
  super();
128895
128595
  this.dialog = dialog;
128896
128596
  this.elementRef = elementRef;
128897
128597
  this.sanitizer = sanitizer;
128598
+ this.Stripe = Stripe;
128898
128599
  this.title = `${packageName$4}_${componentName$4}_component`;
128899
128600
  this.editable = false;
128900
- this.styled = false;
128901
- this.initialized = false;
128601
+ this.urlRoot = '/Api';
128902
128602
  this.uid = safeUniqueId('sa', snakeCase(this.title));
128903
128603
  Stratus.Instances[this.uid] = this;
128904
128604
  this.elementId = this.elementId || this.uid;
128905
- Stratus.Internals.CssLoader(`${localDir$2}${componentName$4}.component${min$2}.css`)
128605
+ Stratus.Internals.CssLoader(`${localDir$3}${componentName$4}.component${min$3}.css`)
128906
128606
  .then(() => {
128907
128607
  this.styled = true;
128908
128608
  })
@@ -128910,15 +128610,18 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128910
128610
  console.error('CSS Failed to load for Component:', this);
128911
128611
  this.styled = false;
128912
128612
  });
128913
- this.hydrate(this.elementRef, this.sanitizer, ["title", "uid", "elementId", "model", "editable", "styled", "initialized", "dialog", "elementRef", "sanitizer", "ngOnInit", "getCardLogoUrl", "isExpired", "isExpiring", "deletePM", "deletePMConfirmation", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
128613
+ this.hydrate(this.elementRef, this.sanitizer, ["title", "model", "editable", "urlRoot", "dialog", "elementRef", "sanitizer", "Stripe", "ngOnInit", "getCardLogoUrl", "isExpired", "isExpiring", "deletePM", "deletePMConfirmation", "uid", "elementId", "styled", "initialized", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
128914
128614
  }
128915
128615
  ngOnInit() {
128916
128616
  return __awaiter$4(this, void 0, void 0, function* () {
128917
128617
  this.initialized = true;
128618
+ if (this.urlRoot) {
128619
+ this.model.urlRoot = `${this.urlRoot}${this.model.target ? '/' + this.model.target : ''}`;
128620
+ }
128918
128621
  });
128919
128622
  }
128920
128623
  getCardLogoUrl(brand) {
128921
- return `${localDir$2}/images/card/${brand}.png`;
128624
+ return `${localDir$3}/images/card/${brand}.png`;
128922
128625
  }
128923
128626
  isExpired() {
128924
128627
  if (this.model.pending) {
@@ -128972,22 +128675,12 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128972
128675
  if (!dialogResult) {
128973
128676
  return;
128974
128677
  }
128975
- let collection;
128976
- if (this.model.collection) {
128977
- collection = this.model.collection;
128978
- }
128979
128678
  yield this.model.destroy();
128980
- if (collection) {
128981
- collection.fetch();
128982
- }
128679
+ this.Stripe.fetchCollections();
128983
128680
  }));
128984
128681
  return dialog;
128985
128682
  }
128986
128683
  };
128987
- __decorate$6([
128988
- Input(),
128989
- __metadata$5("design:type", String)
128990
- ], StripePaymentMethodItemComponent.prototype, "elementId", void 0);
128991
128684
  __decorate$6([
128992
128685
  Input(),
128993
128686
  __metadata$5("design:type", Model)
@@ -128996,14 +128689,19 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128996
128689
  Input(),
128997
128690
  __metadata$5("design:type", Object)
128998
128691
  ], StripePaymentMethodItemComponent.prototype, "editable", void 0);
128692
+ __decorate$6([
128693
+ Input(),
128694
+ __metadata$5("design:type", Object)
128695
+ ], StripePaymentMethodItemComponent.prototype, "urlRoot", void 0);
128999
128696
  StripePaymentMethodItemComponent = __decorate$6([
129000
128697
  Component({
129001
128698
  selector: `sa-${packageName$4}-${componentName$4}`,
129002
- templateUrl: `${localDir$2}${componentName$4}.component${min$2}.html`,
128699
+ templateUrl: `${localDir$3}${componentName$4}.component${min$3}.html`,
129003
128700
  }),
129004
128701
  __metadata$5("design:paramtypes", [MatDialog,
129005
128702
  ElementRef,
129006
- DomSanitizer])
128703
+ DomSanitizer,
128704
+ StripeService])
129007
128705
  ], StripePaymentMethodItemComponent);
129008
128706
 
129009
128707
  var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
@@ -129024,19 +128722,28 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129024
128722
  step((generator = generator.apply(thisArg, _arguments || [])).next());
129025
128723
  });
129026
128724
  };
128725
+ const min$2 = !cookie('env') ? '.min' : '';
129027
128726
  const packageName$3 = 'stripe';
129028
128727
  const componentName$3 = 'payment-method-item-display';
129029
- let StripePaymentMethodItemDisplayComponent = class StripePaymentMethodItemDisplayComponent extends RootComponent {
128728
+ const localDir$2 = `${Stratus.BaseUrl}${Stratus.DeploymentPath}@stratusjs/${packageName$3}/src/`;
128729
+ let StripePaymentMethodItemDisplayComponent = class StripePaymentMethodItemDisplayComponent extends StripeComponent {
129030
128730
  constructor(elementRef, sanitizer) {
129031
128731
  super();
129032
128732
  this.elementRef = elementRef;
129033
128733
  this.sanitizer = sanitizer;
129034
128734
  this.title = `${packageName$3}_${componentName$3}_component`;
129035
- this.initialized = false;
129036
128735
  this.uid = safeUniqueId('sa', snakeCase(this.title));
129037
128736
  Stratus.Instances[this.uid] = this;
129038
128737
  this.elementId = this.elementId || this.uid;
129039
- this.hydrate(this.elementRef, this.sanitizer, ["title", "uid", "initialized", "elementId", "model", "name", "brand", "last4", "expMonth", "expYear", "elementRef", "sanitizer", "ngOnInit", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
128738
+ Stratus.Internals.CssLoader(`${localDir$2}${componentName$3}.component${min$2}.css`)
128739
+ .then(() => {
128740
+ this.styled = true;
128741
+ })
128742
+ .catch(() => {
128743
+ console.error('CSS Failed to load for Component:', this);
128744
+ this.styled = false;
128745
+ });
128746
+ this.hydrate(this.elementRef, this.sanitizer, ["title", "model", "name", "brand", "last4", "expMonth", "expYear", "elementRef", "sanitizer", "ngOnInit", "uid", "elementId", "styled", "initialized", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
129040
128747
  }
129041
128748
  ngOnInit() {
129042
128749
  return __awaiter$3(this, void 0, void 0, function* () {
@@ -129077,10 +128784,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129077
128784
  });
129078
128785
  }
129079
128786
  };
129080
- __decorate$5([
129081
- Input(),
129082
- __metadata$4("design:type", String)
129083
- ], StripePaymentMethodItemDisplayComponent.prototype, "elementId", void 0);
129084
128787
  __decorate$5([
129085
128788
  Input(),
129086
128789
  __metadata$4("design:type", String)
@@ -129132,7 +128835,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129132
128835
  const packageName$2 = 'stripe';
129133
128836
  const componentName$2 = 'payment-method-list';
129134
128837
  const localDir$1 = `${Stratus.BaseUrl}${Stratus.DeploymentPath}@stratusjs/${packageName$2}/src/`;
129135
- let StripePaymentMethodListComponent = class StripePaymentMethodListComponent extends RootComponent {
128838
+ let StripePaymentMethodListComponent = class StripePaymentMethodListComponent extends StripeListComponent {
129136
128839
  constructor(elementRef, ref, sanitizer, Stripe) {
129137
128840
  super();
129138
128841
  this.elementRef = elementRef;
@@ -129140,8 +128843,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129140
128843
  this.sanitizer = sanitizer;
129141
128844
  this.Stripe = Stripe;
129142
128845
  this.title = `${packageName$2}_${componentName$2}_component`;
129143
- this.styled = false;
129144
- this.initialized = false;
129145
128846
  this.urlRoot = '/Api';
129146
128847
  this.paymentMethodApiPath = 'PaymentMethod';
129147
128848
  this.addCardButtonText = 'Add Payment Method';
@@ -129158,7 +128859,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129158
128859
  console.error('CSS Failed to load for Component:', this);
129159
128860
  this.styled = false;
129160
128861
  });
129161
- this.hydrate(this.elementRef, this.sanitizer, ["title", "uid", "elementId", "styled", "initialized", "urlRoot", "paymentMethodApiPath", "addCardButtonText", "disabled", "property", "detailedBillingInfo", "defaultBillingName", "defaultBillingEmail", "defaultBillingPhone", "defaultBillingZip", "defaultBillingState", "defaultBillingCity", "defaultBillingAddress1", "defaultBillingAddress2", "defaultBillingInfo", "paymentCollection", "elementRef", "ref", "sanitizer", "Stripe", "ngOnInit", "fetchPaymentMethods", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
128862
+ this.hydrate(this.elementRef, this.sanitizer, ["title", "urlRoot", "paymentMethodApiPath", "addCardButtonText", "disabled", "property", "detailedBillingInfo", "defaultBillingName", "defaultBillingEmail", "defaultBillingPhone", "defaultBillingZip", "defaultBillingState", "defaultBillingCity", "defaultBillingAddress1", "defaultBillingAddress2", "defaultBillingInfo", "elementRef", "ref", "sanitizer", "Stripe", "ngOnInit", "collection", "uid", "elementId", "styled", "initialized", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
129162
128863
  const apiOptions = {
129163
128864
  autoSave: false,
129164
128865
  target: this.paymentMethodApiPath,
@@ -129167,7 +128868,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129167
128868
  if (this.urlRoot) {
129168
128869
  apiOptions.urlRoot = this.urlRoot;
129169
128870
  }
129170
- this.paymentCollection = new Collection(apiOptions);
128871
+ this.collection = new Collection(apiOptions);
129171
128872
  if (this.defaultBillingName) {
129172
128873
  this.defaultBillingInfo.name = this.defaultBillingName;
129173
128874
  }
@@ -129195,22 +128896,16 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129195
128896
  }
129196
128897
  ngOnInit() {
129197
128898
  return __awaiter$2(this, void 0, void 0, function* () {
129198
- yield this.fetchPaymentMethods();
129199
- this.Stripe.registerCollection(this.paymentCollection);
128899
+ this.Stripe.registerCollection(this, this.collection);
128900
+ this.Stripe.fetchCollections(this.uid).then();
129200
128901
  this.initialized = true;
129201
- });
129202
- }
129203
- fetchPaymentMethods() {
129204
- return __awaiter$2(this, void 0, void 0, function* () {
129205
- yield this.paymentCollection.fetch();
129206
- yield this.refresh();
128902
+ this.Stripe.emit('init', this);
128903
+ this.Stripe.on(this.uid, 'collectionUpdated', (_source, _collection) => {
128904
+ this.refresh();
128905
+ });
129207
128906
  });
129208
128907
  }
129209
128908
  };
129210
- __decorate$4([
129211
- Input(),
129212
- __metadata$3("design:type", String)
129213
- ], StripePaymentMethodListComponent.prototype, "elementId", void 0);
129214
128909
  __decorate$4([
129215
128910
  Input(),
129216
128911
  __metadata$3("design:type", String)
@@ -129300,7 +128995,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129300
128995
  const packageName$1 = 'stripe';
129301
128996
  const componentName$1 = 'payment-method-selector';
129302
128997
  const localDir = `${Stratus.BaseUrl}${Stratus.DeploymentPath}@stratusjs/${packageName$1}/src/`;
129303
- let StripePaymentMethodSelectorComponent = class StripePaymentMethodSelectorComponent extends RootComponent {
128998
+ let StripePaymentMethodSelectorComponent = class StripePaymentMethodSelectorComponent extends StripeListComponent {
129304
128999
  constructor(elementRef, fb, ref, sanitizer, Stripe) {
129305
129000
  super();
129306
129001
  this.elementRef = elementRef;
@@ -129309,11 +129004,10 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129309
129004
  this.sanitizer = sanitizer;
129310
129005
  this.Stripe = Stripe;
129311
129006
  this.title = `${packageName$1}_${componentName$1}_component`;
129312
- this.styled = false;
129313
- this.initialized = false;
129314
129007
  this.urlRoot = '/Api';
129315
129008
  this.paymentMethodApiPath = 'PaymentMethod';
129316
129009
  this.addCardButtonText = 'Add Payment Method';
129010
+ this.selectCardButtonText = 'Select Default Payment Method';
129317
129011
  this.disabled = false;
129318
129012
  this.defaultBillingInfo = { address: {} };
129319
129013
  this.fieldName = 'paymentSelection';
@@ -129336,7 +129030,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129336
129030
  this.styled = false;
129337
129031
  this.refresh().then();
129338
129032
  });
129339
- this.hydrate(this.elementRef, this.sanitizer, ["title", "uid", "elementId", "styled", "initialized", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "registryModel", "paymentMethodApiPath", "addCardButtonText", "disabled", "property", "detailedBillingInfo", "defaultBillingName", "defaultBillingEmail", "defaultBillingPhone", "defaultBillingZip", "defaultBillingState", "defaultBillingCity", "defaultBillingAddress1", "defaultBillingAddress2", "defaultBillingInfo", "fieldName", "fieldNameId", "registry", "fetched", "model", "dataSub", "subscriber", "form", "paymentCollection", "elementRef", "fb", "ref", "sanitizer", "Stripe", "ngOnInit", "fetchPaymentMethods", "valueChanged", "normalizeOut", "normalizeIn", "fetchData", "objectComparisonFunction", "dataDefer", "dataRef", "handleObservableError", "isPMExpired", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
129033
+ this.hydrate(this.elementRef, this.sanitizer, ["title", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "registryModel", "paymentMethodApiPath", "addCardButtonText", "selectCardButtonText", "disabled", "property", "detailedBillingInfo", "defaultBillingName", "defaultBillingEmail", "defaultBillingPhone", "defaultBillingZip", "defaultBillingState", "defaultBillingCity", "defaultBillingAddress1", "defaultBillingAddress2", "defaultBillingInfo", "fieldName", "fieldNameId", "registry", "fetched", "model", "dataSub", "subscriber", "form", "paymentSelect", "elementRef", "fb", "ref", "sanitizer", "Stripe", "ngOnInit", "valueChanged", "normalizeOut", "normalizeIn", "fetchData", "objectComparisonFunction", "dataDefer", "dataRef", "handleObservableError", "isPMExpired", "selectorListClose", "selectorListOpen", "collection", "uid", "elementId", "styled", "initialized", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
129340
129034
  const apiOptions = {
129341
129035
  autoSave: false,
129342
129036
  target: this.paymentMethodApiPath,
@@ -129345,7 +129039,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129345
129039
  if (this.urlRoot) {
129346
129040
  apiOptions.urlRoot = this.urlRoot;
129347
129041
  }
129348
- this.paymentCollection = new Collection(apiOptions);
129042
+ this.collection = new Collection(apiOptions);
129349
129043
  if (this.defaultBillingName) {
129350
129044
  this.defaultBillingInfo.name = this.defaultBillingName;
129351
129045
  }
@@ -129411,16 +129105,28 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129411
129105
  return;
129412
129106
  }
129413
129107
  this.valueChanged(value);
129414
- });
129415
- yield this.fetchPaymentMethods();
129416
- this.Stripe.registerCollection(this.paymentCollection);
129108
+ }).then();
129109
+ this.Stripe.registerCollection(this, this.collection);
129110
+ this.Stripe.fetchCollections(this.uid).then();
129417
129111
  this.initialized = true;
129418
- });
129419
- }
129420
- fetchPaymentMethods() {
129421
- return __awaiter$1(this, void 0, void 0, function* () {
129422
- yield this.paymentCollection.fetch();
129423
- yield this.refresh();
129112
+ this.Stripe.emit('init', this);
129113
+ this.Stripe.on(this.uid, 'collectionUpdated', (_source, _collection) => {
129114
+ this.refresh();
129115
+ this.selectorListClose();
129116
+ });
129117
+ this.Stripe.on('Stripe', 'paymentMethodCreated', (_source, details) => {
129118
+ const newCardDetails = details[0];
129119
+ if (!isEmpty(newCardDetails.type) &&
129120
+ !isEmpty(newCardDetails.name) &&
129121
+ !isEmpty(newCardDetails.email)) {
129122
+ const newPM = this.collection.models.slice(-1)[0];
129123
+ if (newPM.get('type') === newCardDetails.type &&
129124
+ newPM.get('name') === newCardDetails.name &&
129125
+ newPM.get('email') === newCardDetails.email) {
129126
+ this.valueChanged(newPM);
129127
+ }
129128
+ }
129129
+ });
129424
129130
  });
129425
129131
  }
129426
129132
  valueChanged(value) {
@@ -129496,11 +129202,23 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129496
129202
  }
129497
129203
  return paymentMethod.data.exp_month < month;
129498
129204
  }
129205
+ selectorListClose(ev) {
129206
+ if (ev) {
129207
+ ev.preventDefault();
129208
+ }
129209
+ if (this.paymentSelect && this.paymentSelect.panelOpen) {
129210
+ this.paymentSelect.close();
129211
+ }
129212
+ }
129213
+ selectorListOpen(ev) {
129214
+ if (ev) {
129215
+ ev.preventDefault();
129216
+ }
129217
+ if (this.paymentSelect && !this.paymentSelect.panelOpen) {
129218
+ this.paymentSelect.open();
129219
+ }
129220
+ }
129499
129221
  };
129500
- __decorate$3([
129501
- Input(),
129502
- __metadata$2("design:type", String)
129503
- ], StripePaymentMethodSelectorComponent.prototype, "elementId", void 0);
129504
129222
  __decorate$3([
129505
129223
  Input(),
129506
129224
  __metadata$2("design:type", String)
@@ -129545,6 +129263,10 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129545
129263
  Input(),
129546
129264
  __metadata$2("design:type", String)
129547
129265
  ], StripePaymentMethodSelectorComponent.prototype, "addCardButtonText", void 0);
129266
+ __decorate$3([
129267
+ Input(),
129268
+ __metadata$2("design:type", String)
129269
+ ], StripePaymentMethodSelectorComponent.prototype, "selectCardButtonText", void 0);
129548
129270
  __decorate$3([
129549
129271
  Input(),
129550
129272
  __metadata$2("design:type", Object)
@@ -129589,6 +129311,10 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129589
129311
  Input(),
129590
129312
  __metadata$2("design:type", String)
129591
129313
  ], StripePaymentMethodSelectorComponent.prototype, "defaultBillingAddress2", void 0);
129314
+ __decorate$3([
129315
+ ViewChild('paymentSelect', { static: false }),
129316
+ __metadata$2("design:type", MatSelect)
129317
+ ], StripePaymentMethodSelectorComponent.prototype, "paymentSelect", void 0);
129592
129318
  StripePaymentMethodSelectorComponent = __decorate$3([
129593
129319
  Component({
129594
129320
  selector: `sa-${packageName$1}-${componentName$1}`,
@@ -129622,7 +129348,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129622
129348
  };
129623
129349
  const packageName = 'stripe';
129624
129350
  const componentName = 'setup-intent';
129625
- let StripeSetupIntentComponent = class StripeSetupIntentComponent extends RootComponent {
129351
+ let StripeSetupIntentComponent = class StripeSetupIntentComponent extends StripeComponent {
129626
129352
  constructor(elementRef, sanitizer, dialog) {
129627
129353
  super();
129628
129354
  this.elementRef = elementRef;
@@ -129639,7 +129365,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129639
129365
  this.uid = safeUniqueId('sa', snakeCase(this.title));
129640
129366
  Stratus.Instances[this.uid] = this;
129641
129367
  this.elementId = this.elementId || this.uid;
129642
- this.hydrate(this.elementRef, this.sanitizer, ["title", "uid", "elementId", "styled", "initialized", "newPaymentMethodPrompt", "newPaymentMethodPending", "urlRoot", "paymentMethodApiPath", "addCardButtonText", "detailedBillingInfo", "defaultBillingInfo", "elementRef", "sanitizer", "dialog", "ngOnInit", "addPaymentMethod", "inputPaymentMethod", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
129368
+ this.hydrate(this.elementRef, this.sanitizer, ["title", "styled", "initialized", "newPaymentMethodPrompt", "newPaymentMethodPending", "urlRoot", "paymentMethodApiPath", "addCardButtonText", "detailedBillingInfo", "defaultBillingInfo", "elementRef", "sanitizer", "dialog", "ngOnInit", "addPaymentMethod", "inputPaymentMethod", "uid", "elementId", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
129643
129369
  }
129644
129370
  ngOnInit() {
129645
129371
  this.initialized = true;
@@ -129712,10 +129438,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129712
129438
  });
129713
129439
  }
129714
129440
  };
129715
- __decorate$2([
129716
- Input(),
129717
- __metadata$1("design:type", String)
129718
- ], StripeSetupIntentComponent.prototype, "elementId", void 0);
129719
129441
  __decorate$2([
129720
129442
  Input(),
129721
129443
  __metadata$1("design:type", String)
@@ -161376,6 +161098,1228 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
161376
161098
  })
161377
161099
  .catch(err => console.error('@stratusjs/angular failed to initialize!', err));
161378
161100
 
161101
+ System.register(["quill"], function (exports_1, context_1) {
161102
+ var quill_1, debug, Logger, QuillHtmlEditPlugin;
161103
+ context_1 && context_1.id;
161104
+ function $create(elName) {
161105
+ return document.createElement(elName);
161106
+ }
161107
+ function $setAttr(el, key, value) {
161108
+ return el.setAttribute(key, value);
161109
+ }
161110
+ function launchPopupEditor(quill, options) {
161111
+ const htmlFromEditor = quill.container.querySelector('.ql-editor').innerHTML;
161112
+ const popupContainer = $create('div');
161113
+ const overlayContainer = $create('div');
161114
+ const msg = options.msg || 'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced';
161115
+ const cancelText = options.cancelText || 'Cancel';
161116
+ const okText = options.okText || 'Ok';
161117
+ $setAttr(overlayContainer, 'class', 'ql-html-overlayContainer');
161118
+ $setAttr(popupContainer, 'class', 'ql-html-popupContainer');
161119
+ const popupTitle = $create('i');
161120
+ $setAttr(popupTitle, 'class', 'ql-html-popupTitle');
161121
+ popupTitle.innerText = msg;
161122
+ const textContainer = $create('div');
161123
+ textContainer.appendChild(popupTitle);
161124
+ $setAttr(textContainer, 'class', 'ql-html-textContainer');
161125
+ const textArea = $create('textarea');
161126
+ $setAttr(textArea, 'class', 'ql-html-textArea');
161127
+ textArea.value = formatHTML(htmlFromEditor);
161128
+ const buttonCancel = $create('button');
161129
+ buttonCancel.innerHTML = cancelText;
161130
+ $setAttr(buttonCancel, 'class', 'ql-html-buttonCancel');
161131
+ const buttonOk = $create('button');
161132
+ buttonOk.innerHTML = okText;
161133
+ const buttonGroup = $create('div');
161134
+ $setAttr(buttonGroup, 'class', 'ql-html-buttonGroup');
161135
+ buttonGroup.appendChild(buttonCancel);
161136
+ buttonGroup.appendChild(buttonOk);
161137
+ textContainer.appendChild(textArea);
161138
+ textContainer.appendChild(buttonGroup);
161139
+ popupContainer.appendChild(textContainer);
161140
+ overlayContainer.appendChild(popupContainer);
161141
+ document.body.appendChild(overlayContainer);
161142
+ buttonCancel.onclick = () => {
161143
+ document.body.removeChild(overlayContainer);
161144
+ };
161145
+ overlayContainer.onclick = buttonCancel.onclick;
161146
+ popupContainer.onclick = (e) => {
161147
+ e.preventDefault();
161148
+ e.stopPropagation();
161149
+ };
161150
+ buttonOk.onclick = () => {
161151
+ const output = textArea.value.split(/\r?\n/g).map((el) => el.trim());
161152
+ const noNewlines = output.join('');
161153
+ quill.container.querySelector('.ql-editor').innerHTML = noNewlines;
161154
+ document.body.removeChild(overlayContainer);
161155
+ };
161156
+ }
161157
+ function formatHTML(code) {
161158
+ const whitespace = ' '.repeat(2);
161159
+ let currentIndent = 0;
161160
+ const newlineChar = '\n';
161161
+ let char = null;
161162
+ let nextChar = null;
161163
+ let result = '';
161164
+ for (let pos = 0; pos <= code.length; pos++) {
161165
+ char = code.substr(pos, 1);
161166
+ nextChar = code.substr(pos + 1, 1);
161167
+ const isBrTag = code.substr(pos, 4) === '<br>';
161168
+ const isOpeningTag = char === '<' && nextChar !== '/' && !isBrTag;
161169
+ const isClosingTag = char === '<' && nextChar === '/' && !isBrTag;
161170
+ if (isBrTag) {
161171
+ result += newlineChar;
161172
+ currentIndent--;
161173
+ pos += 4;
161174
+ }
161175
+ if (isOpeningTag) {
161176
+ result += newlineChar + whitespace.repeat(currentIndent);
161177
+ currentIndent++;
161178
+ }
161179
+ else if (isClosingTag) {
161180
+ if (--currentIndent < 0) {
161181
+ currentIndent = 0;
161182
+ }
161183
+ result += newlineChar + whitespace.repeat(currentIndent);
161184
+ }
161185
+ else if (char === ' ' && nextChar === ' ') {
161186
+ char = '';
161187
+ }
161188
+ else if (char === newlineChar) {
161189
+ if (code.substr(pos, code.substr(pos).indexOf('<')).trim() === '') {
161190
+ char = '';
161191
+ }
161192
+ }
161193
+ result += char;
161194
+ }
161195
+ Logger.log('formatHTML', {
161196
+ before: code,
161197
+ after: result
161198
+ });
161199
+ return result;
161200
+ }
161201
+ return {
161202
+ setters: [
161203
+ function (quill_1_1) {
161204
+ quill_1 = quill_1_1;
161205
+ }
161206
+ ],
161207
+ execute: function () {
161208
+ debug = false;
161209
+ Logger = {
161210
+ prefixString() {
161211
+ return `</> quill-html-edit-button: `;
161212
+ },
161213
+ get log() {
161214
+ if (!debug) {
161215
+ return () => { };
161216
+ }
161217
+ const boundLogFn = console.log.bind(console, this.prefixString());
161218
+ return boundLogFn;
161219
+ }
161220
+ };
161221
+ QuillHtmlEditPlugin = class QuillHtmlEditPlugin {
161222
+ constructor(quill, options) {
161223
+ debug = options && options.debug;
161224
+ Logger.log('logging enabled');
161225
+ const toolbarModule = quill.getModule('toolbar');
161226
+ if (!toolbarModule) {
161227
+ throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');
161228
+ }
161229
+ this.registerDivModule();
161230
+ const toolbarEl = toolbarModule.container;
161231
+ const buttonContainer = $create('span');
161232
+ $setAttr(buttonContainer, 'class', 'ql-formats');
161233
+ const button = $create('button');
161234
+ button.innerHTML = options.buttonHTML || '&lt;&gt;';
161235
+ button.title = options.buttonTitle || 'Show HTML source';
161236
+ button.onclick = (e) => {
161237
+ e.preventDefault();
161238
+ launchPopupEditor(quill, options);
161239
+ };
161240
+ buttonContainer.appendChild(button);
161241
+ toolbarEl.appendChild(buttonContainer);
161242
+ }
161243
+ registerDivModule() {
161244
+ const Block = quill_1.default.import('blots/block');
161245
+ class Div extends Block {
161246
+ }
161247
+ Div.tagName = 'div';
161248
+ Div.blotName = 'div';
161249
+ Div.allowedChildren = Block.allowedChildren;
161250
+ Div.allowedChildren.push(Block);
161251
+ quill_1.default.register(Div);
161252
+ }
161253
+ };
161254
+ exports_1("QuillHtmlEditPlugin", QuillHtmlEditPlugin);
161255
+ exports_1("default", QuillHtmlEditPlugin);
161256
+ }
161257
+ };
161258
+ });
161259
+
161260
+ System.register(["quill", "@stratusjs/core/environment"], function (exports_1, context_1) {
161261
+ var quill_1, environment_1, Break, Embed, QuillBreak;
161262
+ context_1 && context_1.id;
161263
+ return {
161264
+ setters: [
161265
+ function (quill_1_1) {
161266
+ quill_1 = quill_1_1;
161267
+ },
161268
+ function (environment_1_1) {
161269
+ environment_1 = environment_1_1;
161270
+ }
161271
+ ],
161272
+ execute: function () {
161273
+ Break = quill_1.default.import('blots/break');
161274
+ Embed = quill_1.default.import('blots/embed');
161275
+ QuillBreak = class QuillBreak extends Break {
161276
+ length() {
161277
+ return 1;
161278
+ }
161279
+ value() {
161280
+ return '\n';
161281
+ }
161282
+ insertInto(parent, ref) {
161283
+ if (environment_1.cookie('env')) {
161284
+ console.log('insertInto:', parent, ref);
161285
+ }
161286
+ Embed.prototype.insertInto.call(this, parent, ref);
161287
+ }
161288
+ };
161289
+ exports_1("QuillBreak", QuillBreak);
161290
+ QuillBreak.blotName = 'break';
161291
+ QuillBreak.tagName = 'BR';
161292
+ }
161293
+ };
161294
+ });
161295
+
161296
+ System.register(["quill"], function (exports_1, context_1) {
161297
+ var quill_1, BaseImage, ATTRIBUTES, QuillImageFormatPlugin;
161298
+ context_1 && context_1.id;
161299
+ return {
161300
+ setters: [
161301
+ function (quill_1_1) {
161302
+ quill_1 = quill_1_1;
161303
+ }
161304
+ ],
161305
+ execute: function () {
161306
+ BaseImage = quill_1.default.import('formats/image');
161307
+ ATTRIBUTES = [
161308
+ 'alt',
161309
+ 'height',
161310
+ 'width',
161311
+ 'stratus-src',
161312
+ 'stratusSrc'
161313
+ ];
161314
+ QuillImageFormatPlugin = class QuillImageFormatPlugin extends BaseImage {
161315
+ constructor() {
161316
+ super(...arguments);
161317
+ this.blotName = 'imageCustom';
161318
+ this.tagName = 'IMG';
161319
+ }
161320
+ format(name, value) {
161321
+ console.log('format:', name, value, this.domNode.getAttribute('src'));
161322
+ if (ATTRIBUTES.indexOf(name) === -1) {
161323
+ super.format(name, value);
161324
+ return;
161325
+ }
161326
+ if (!value) {
161327
+ this.domNode.removeAttribute(name);
161328
+ return;
161329
+ }
161330
+ if (name === 'stratus-src') {
161331
+ console.log('stratus-src:', value);
161332
+ }
161333
+ if (name === 'stratusSrc') {
161334
+ console.log('stratusSrc:', value);
161335
+ }
161336
+ this.domNode.setAttribute(name, value);
161337
+ }
161338
+ };
161339
+ exports_1("QuillImageFormatPlugin", QuillImageFormatPlugin);
161340
+ }
161341
+ };
161342
+ });
161343
+
161344
+ System.register(["@stratusjs/runtime/stratus", "lodash", "quill"], function (exports_1, context_1) {
161345
+ var stratus_1, lodash_1, quill_1, QuillInputButtonPlugin;
161346
+ context_1 && context_1.id;
161347
+ return {
161348
+ setters: [
161349
+ function (stratus_1_1) {
161350
+ stratus_1 = stratus_1_1;
161351
+ },
161352
+ function (lodash_1_1) {
161353
+ lodash_1 = lodash_1_1;
161354
+ },
161355
+ function (quill_1_1) {
161356
+ quill_1 = quill_1_1;
161357
+ }
161358
+ ],
161359
+ execute: function () {
161360
+ QuillInputButtonPlugin = class QuillInputButtonPlugin {
161361
+ constructor(quill, options) {
161362
+ this.debug = false;
161363
+ this.buttonHTML = '<i class="fas fa-carrot"></i>';
161364
+ this.buttonTitle = 'Input Button';
161365
+ this.name = 'inputButton';
161366
+ this.eventName = 'input-button';
161367
+ this.uid = lodash_1.default.uniqueId(`quill_input_button_`);
161368
+ stratus_1.Stratus.Instances[this.uid] = this;
161369
+ this.debug = options && options.debug;
161370
+ if (!options || typeof options !== 'object') {
161371
+ options = {};
161372
+ }
161373
+ this.buttonHTML = options.buttonHTML || this.buttonHTML;
161374
+ this.buttonTitle = options.buttonTitle || this.buttonTitle;
161375
+ this.name = options.name || this.name;
161376
+ this.eventName = options.eventName || this.eventName;
161377
+ this.createToolbarModule(quill);
161378
+ }
161379
+ createToolbarModule(quill) {
161380
+ const toolbarModule = quill.getModule('toolbar');
161381
+ if (!toolbarModule) {
161382
+ throw new Error(`quill.${this.name} requires the "toolbar" module`);
161383
+ }
161384
+ this.registerDivModule();
161385
+ const toolbarEl = toolbarModule.container;
161386
+ const buttonContainer = document.createElement('span');
161387
+ buttonContainer.setAttribute('class', 'ql-formats');
161388
+ const button = document.createElement('button');
161389
+ button.innerHTML = this.buttonHTML;
161390
+ button.title = this.buttonTitle;
161391
+ button.onclick = (e) => {
161392
+ e.preventDefault();
161393
+ this.onClick(quill);
161394
+ };
161395
+ buttonContainer.appendChild(button);
161396
+ toolbarEl.appendChild(buttonContainer);
161397
+ }
161398
+ registerDivModule() {
161399
+ const Block = quill_1.default.import('blots/block');
161400
+ class Div extends Block {
161401
+ }
161402
+ Div.tagName = 'div';
161403
+ Div.blotName = 'div';
161404
+ Div.allowedChildren = Block.allowedChildren;
161405
+ Div.allowedChildren.push(Block);
161406
+ quill_1.default.register(Div);
161407
+ }
161408
+ findUID(el) {
161409
+ if ('uid' in el.dataset) {
161410
+ return el.dataset.uid;
161411
+ }
161412
+ return this.findUID(el.parentElement);
161413
+ }
161414
+ getInstance(uid) {
161415
+ if (!(uid in stratus_1.Stratus.Instances)) {
161416
+ return undefined;
161417
+ }
161418
+ return stratus_1.Stratus.Instances[uid];
161419
+ }
161420
+ onClick(quill) {
161421
+ const container = quill.container;
161422
+ const uid = this.findUID(container);
161423
+ const instance = this.getInstance(uid);
161424
+ if (!instance) {
161425
+ return;
161426
+ }
161427
+ instance.trigger(this.eventName, null, this);
161428
+ }
161429
+ trigger(name, data, callee) {
161430
+ if (this.debug) {
161431
+ console.log(`quill.${this.name}.trigger:`, name, data, callee);
161432
+ }
161433
+ }
161434
+ };
161435
+ exports_1("QuillInputButtonPlugin", QuillInputButtonPlugin);
161436
+ }
161437
+ };
161438
+ });
161439
+
161440
+ System.register(["reflect-metadata", "lodash", "@angular/core"], function (exports_1, context_1) {
161441
+ var lodash_1, core_1, RootComponent;
161442
+ context_1 && context_1.id;
161443
+ return {
161444
+ setters: [
161445
+ function (_1) {
161446
+ },
161447
+ function (lodash_1_1) {
161448
+ lodash_1 = lodash_1_1;
161449
+ },
161450
+ function (core_1_1) {
161451
+ core_1 = core_1_1;
161452
+ }
161453
+ ],
161454
+ execute: function () {
161455
+ RootComponent = class RootComponent {
161456
+ hydrate(elementRef, sanitizer, attrs) {
161457
+ lodash_1.default.forEach(attrs, (attr) => {
161458
+ const metaDataKeys = Reflect.getMetadataKeys(this, attr);
161459
+ if (!lodash_1.default.includes(metaDataKeys, 'design:type')) {
161460
+ return;
161461
+ }
161462
+ const attrKebab = lodash_1.default.kebabCase(attr);
161463
+ const variants = [
161464
+ attrKebab,
161465
+ 'data-' + attrKebab
161466
+ ];
161467
+ const variant = lodash_1.default.find(variants, (v) => elementRef.nativeElement.hasAttribute(v));
161468
+ if (lodash_1.default.isEmpty(variant)) {
161469
+ return;
161470
+ }
161471
+ const value = sanitizer.sanitize(core_1.SecurityContext.HTML, elementRef.nativeElement.getAttribute(variant));
161472
+ lodash_1.default.set(this, attr, value);
161473
+ });
161474
+ }
161475
+ };
161476
+ exports_1("RootComponent", RootComponent);
161477
+ }
161478
+ };
161479
+ });
161480
+
161481
+ System.register(["@angular/forms", "@angular/core", "froala-editor"], function (exports_1, context_1) {
161482
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
161483
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
161484
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
161485
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
161486
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
161487
+ };
161488
+ var __metadata = (this && this.__metadata) || function (k, v) {
161489
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
161490
+ };
161491
+ var FroalaEditorDirective_1, forms_1, core_1, froala_editor_1, FroalaEditorDirective;
161492
+ context_1 && context_1.id;
161493
+ return {
161494
+ setters: [
161495
+ function (forms_1_1) {
161496
+ forms_1 = forms_1_1;
161497
+ },
161498
+ function (core_1_1) {
161499
+ core_1 = core_1_1;
161500
+ },
161501
+ function (froala_editor_1_1) {
161502
+ froala_editor_1 = froala_editor_1_1;
161503
+ }
161504
+ ],
161505
+ execute: function () {
161506
+ FroalaEditorDirective = FroalaEditorDirective_1 = class FroalaEditorDirective {
161507
+ constructor(el, zone) {
161508
+ this.zone = zone;
161509
+ this._opts = {
161510
+ immediateAngularModelUpdate: false,
161511
+ angularIgnoreAttrs: null
161512
+ };
161513
+ this.SPECIAL_TAGS = ['img', 'button', 'input', 'a'];
161514
+ this.INNER_HTML_ATTR = 'innerHTML';
161515
+ this._hasSpecialTag = false;
161516
+ this._editorInitialized = false;
161517
+ this._oldModel = null;
161518
+ this.froalaModelChange = new core_1.EventEmitter();
161519
+ this.froalaInit = new core_1.EventEmitter();
161520
+ this.onChange = (_) => {
161521
+ };
161522
+ this.onTouched = () => {
161523
+ };
161524
+ const element = el.nativeElement;
161525
+ if (this.SPECIAL_TAGS.indexOf(element.tagName.toLowerCase()) != -1) {
161526
+ this._hasSpecialTag = true;
161527
+ }
161528
+ this._element = element;
161529
+ this.zone = zone;
161530
+ }
161531
+ set froalaEditor(opts) {
161532
+ this._opts = this.clone(opts || this._opts);
161533
+ this._opts = Object.assign({}, this._opts);
161534
+ }
161535
+ set froalaModel(content) {
161536
+ this.updateEditor(content);
161537
+ }
161538
+ writeValue(content) {
161539
+ this.updateEditor(content);
161540
+ }
161541
+ registerOnChange(fn) {
161542
+ this.onChange = fn;
161543
+ }
161544
+ registerOnTouched(fn) {
161545
+ this.onTouched = fn;
161546
+ }
161547
+ clone(item) {
161548
+ const me = this;
161549
+ if (!item) {
161550
+ return item;
161551
+ }
161552
+ const types = [Number, String, Boolean];
161553
+ let result;
161554
+ types.forEach((type) => {
161555
+ if (item instanceof type) {
161556
+ result = type(item);
161557
+ }
161558
+ });
161559
+ if (typeof result === 'undefined') {
161560
+ if (Object.prototype.toString.call(item) === '[object Array]') {
161561
+ result = [];
161562
+ item.forEach((child, index, array) => {
161563
+ result[index] = me.clone(child);
161564
+ });
161565
+ }
161566
+ else if (typeof item === 'object') {
161567
+ if (item.nodeType && typeof item.cloneNode === 'function') {
161568
+ result = item.cloneNode(true);
161569
+ }
161570
+ else if (!item.prototype) {
161571
+ if (item instanceof Date) {
161572
+ result = new Date(item);
161573
+ }
161574
+ else {
161575
+ result = {};
161576
+ for (const i in item) {
161577
+ result[i] = me.clone(item[i]);
161578
+ }
161579
+ }
161580
+ }
161581
+ else {
161582
+ {
161583
+ result = item;
161584
+ }
161585
+ }
161586
+ }
161587
+ else {
161588
+ result = item;
161589
+ }
161590
+ }
161591
+ return result;
161592
+ }
161593
+ updateEditor(content) {
161594
+ if (JSON.stringify(this._oldModel) === JSON.stringify(content)) {
161595
+ return;
161596
+ }
161597
+ if (!this._hasSpecialTag) {
161598
+ this._oldModel = content;
161599
+ }
161600
+ else {
161601
+ this._model = content;
161602
+ }
161603
+ if (this._editorInitialized) {
161604
+ if (!this._hasSpecialTag) {
161605
+ this._editor.html.set(content);
161606
+ }
161607
+ else {
161608
+ this.setContent();
161609
+ }
161610
+ }
161611
+ else {
161612
+ if (!this._hasSpecialTag) {
161613
+ this._element.innerHTML = content || '';
161614
+ }
161615
+ else {
161616
+ this.setContent();
161617
+ }
161618
+ }
161619
+ }
161620
+ updateModel() {
161621
+ this.zone.run(() => {
161622
+ let modelContent = null;
161623
+ if (this._hasSpecialTag) {
161624
+ const attributeNodes = this._element.attributes;
161625
+ const attrs = {};
161626
+ for (let i = 0; i < attributeNodes.length; i++) {
161627
+ const attrName = attributeNodes[i].name;
161628
+ if (this._opts.angularIgnoreAttrs && this._opts.angularIgnoreAttrs.indexOf(attrName) != -1) {
161629
+ continue;
161630
+ }
161631
+ attrs[attrName] = attributeNodes[i].value;
161632
+ }
161633
+ if (this._element.innerHTML) {
161634
+ attrs[this.INNER_HTML_ATTR] = this._element.innerHTML;
161635
+ }
161636
+ modelContent = attrs;
161637
+ }
161638
+ else {
161639
+ const returnedHtml = this._editor.html.get();
161640
+ if (typeof returnedHtml === 'string') {
161641
+ modelContent = returnedHtml;
161642
+ }
161643
+ }
161644
+ if (this._oldModel !== modelContent) {
161645
+ this._oldModel = modelContent;
161646
+ this.froalaModelChange.emit(modelContent);
161647
+ this.onChange(modelContent);
161648
+ }
161649
+ });
161650
+ }
161651
+ registerEvent(eventName, callback) {
161652
+ if (!eventName || !callback) {
161653
+ return;
161654
+ }
161655
+ if (!this._opts.events) {
161656
+ this._opts.events = {};
161657
+ }
161658
+ this._opts.events[eventName] = callback;
161659
+ }
161660
+ initListeners() {
161661
+ const self = this;
161662
+ if (this._editor.events) {
161663
+ this._editor.events.on('contentChanged', function () {
161664
+ self.updateModel();
161665
+ });
161666
+ this._editor.events.on('mousedown', function () {
161667
+ setTimeout(function () {
161668
+ self.onTouched();
161669
+ }, 0);
161670
+ });
161671
+ if (this._opts.immediateAngularModelUpdate) {
161672
+ this._editor.events.on('keyup', function () {
161673
+ setTimeout(function () {
161674
+ self.updateModel();
161675
+ }, 0);
161676
+ });
161677
+ }
161678
+ }
161679
+ this._editorInitialized = true;
161680
+ }
161681
+ createEditor() {
161682
+ if (this._editorInitialized) {
161683
+ return;
161684
+ }
161685
+ this.setContent(true);
161686
+ this.zone.runOutsideAngular(() => {
161687
+ if (!this._opts.events) {
161688
+ this._opts.events = {};
161689
+ }
161690
+ this.registerEvent('initialized', this._opts.events && this._opts.events.initialized);
161691
+ const existingInitCallback = this._opts.events.initialized;
161692
+ if (!this._opts.events.initialized || !this._opts.events.initialized.overridden) {
161693
+ this._opts.events.initialized = () => {
161694
+ this.initListeners();
161695
+ existingInitCallback && existingInitCallback.call(this._editor, this);
161696
+ };
161697
+ this._opts.events.initialized.overridden = true;
161698
+ }
161699
+ this._editor = new froala_editor_1.default(this._element, this._opts);
161700
+ });
161701
+ }
161702
+ setHtml() {
161703
+ this._editor.html.set(this._model || '');
161704
+ this._editor.undo.reset();
161705
+ this._editor.undo.saveStep();
161706
+ }
161707
+ setContent(firstTime = false) {
161708
+ const self = this;
161709
+ if (this._model || this._model === '') {
161710
+ this._oldModel = this._model;
161711
+ if (this._hasSpecialTag) {
161712
+ const tags = this._model;
161713
+ if (tags) {
161714
+ for (const attr in tags) {
161715
+ if (tags.hasOwnProperty(attr) && attr != this.INNER_HTML_ATTR) {
161716
+ this._element.setAttribute(attr, tags[attr]);
161717
+ }
161718
+ }
161719
+ if (tags.hasOwnProperty(this.INNER_HTML_ATTR)) {
161720
+ this._element.innerHTML = tags[this.INNER_HTML_ATTR];
161721
+ }
161722
+ }
161723
+ }
161724
+ else {
161725
+ if (firstTime) {
161726
+ this.registerEvent('initialized', function () {
161727
+ self.setHtml();
161728
+ });
161729
+ }
161730
+ else {
161731
+ self.setHtml();
161732
+ }
161733
+ }
161734
+ }
161735
+ }
161736
+ destroyEditor() {
161737
+ if (this._editorInitialized) {
161738
+ this._editor.destroy();
161739
+ this._editorInitialized = false;
161740
+ }
161741
+ }
161742
+ getEditor() {
161743
+ if (this._element) {
161744
+ return this._editor;
161745
+ }
161746
+ return null;
161747
+ }
161748
+ generateManualController() {
161749
+ const controls = {
161750
+ initialize: this.createEditor.bind(this),
161751
+ destroy: this.destroyEditor.bind(this),
161752
+ getEditor: this.getEditor.bind(this),
161753
+ };
161754
+ this.froalaInit.emit(controls);
161755
+ }
161756
+ ngAfterViewInit() {
161757
+ if (!this.froalaInit.observers.length) {
161758
+ this.createEditor();
161759
+ }
161760
+ else {
161761
+ this.generateManualController();
161762
+ }
161763
+ }
161764
+ ngOnDestroy() {
161765
+ this.destroyEditor();
161766
+ }
161767
+ };
161768
+ __decorate([
161769
+ core_1.Input(),
161770
+ __metadata("design:type", Object),
161771
+ __metadata("design:paramtypes", [Object])
161772
+ ], FroalaEditorDirective.prototype, "froalaEditor", null);
161773
+ __decorate([
161774
+ core_1.Input(),
161775
+ __metadata("design:type", Object),
161776
+ __metadata("design:paramtypes", [Object])
161777
+ ], FroalaEditorDirective.prototype, "froalaModel", null);
161778
+ __decorate([
161779
+ core_1.Output(),
161780
+ __metadata("design:type", core_1.EventEmitter)
161781
+ ], FroalaEditorDirective.prototype, "froalaModelChange", void 0);
161782
+ __decorate([
161783
+ core_1.Output(),
161784
+ __metadata("design:type", core_1.EventEmitter)
161785
+ ], FroalaEditorDirective.prototype, "froalaInit", void 0);
161786
+ FroalaEditorDirective = FroalaEditorDirective_1 = __decorate([
161787
+ core_1.Directive({
161788
+ selector: '[froalaEditor]',
161789
+ exportAs: 'froalaEditor',
161790
+ providers: [
161791
+ {
161792
+ provide: forms_1.NG_VALUE_ACCESSOR, useExisting: core_1.forwardRef(() => FroalaEditorDirective_1),
161793
+ multi: true
161794
+ }
161795
+ ]
161796
+ }),
161797
+ __metadata("design:paramtypes", [core_1.ElementRef, core_1.NgZone])
161798
+ ], FroalaEditorDirective);
161799
+ exports_1("FroalaEditorDirective", FroalaEditorDirective);
161800
+ }
161801
+ };
161802
+ });
161803
+
161804
+ System.register(["@angular/core", "@stratusjs/angular/froala/editor/froala-editor.directive"], function (exports_1, context_1) {
161805
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
161806
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
161807
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
161808
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
161809
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
161810
+ };
161811
+ var FroalaEditorModule_1, core_1, froala_editor_directive_1, FroalaEditorModule;
161812
+ context_1 && context_1.id;
161813
+ return {
161814
+ setters: [
161815
+ function (core_1_1) {
161816
+ core_1 = core_1_1;
161817
+ },
161818
+ function (froala_editor_directive_1_1) {
161819
+ froala_editor_directive_1 = froala_editor_directive_1_1;
161820
+ }
161821
+ ],
161822
+ execute: function () {
161823
+ FroalaEditorModule = FroalaEditorModule_1 = class FroalaEditorModule {
161824
+ static forRoot() {
161825
+ return { ngModule: FroalaEditorModule_1, providers: [] };
161826
+ }
161827
+ };
161828
+ FroalaEditorModule = FroalaEditorModule_1 = __decorate([
161829
+ core_1.NgModule({
161830
+ declarations: [froala_editor_directive_1.FroalaEditorDirective],
161831
+ exports: [froala_editor_directive_1.FroalaEditorDirective]
161832
+ })
161833
+ ], FroalaEditorModule);
161834
+ exports_1("FroalaEditorModule", FroalaEditorModule);
161835
+ }
161836
+ };
161837
+ });
161838
+
161839
+ System.register(["@stratusjs/angular/froala/editor/froala-editor.directive", "@stratusjs/angular/froala/editor/froala-editor.module"], function (exports_1, context_1) {
161840
+ context_1 && context_1.id;
161841
+ return {
161842
+ setters: [
161843
+ function (froala_editor_directive_1_1) {
161844
+ exports_1({
161845
+ "FroalaEditorDirective": froala_editor_directive_1_1["FroalaEditorDirective"]
161846
+ });
161847
+ },
161848
+ function (froala_editor_module_1_1) {
161849
+ exports_1({
161850
+ "FroalaEditorModule": froala_editor_module_1_1["FroalaEditorModule"]
161851
+ });
161852
+ }
161853
+ ],
161854
+ execute: function () {
161855
+ }
161856
+ };
161857
+ });
161858
+
161859
+ System.register(["@angular/core", "@stratusjs/angular/froala/view/froala-view.directive"], function (exports_1, context_1) {
161860
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
161861
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
161862
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
161863
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
161864
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
161865
+ };
161866
+ var FroalaViewModule_1, core_1, froala_view_directive_1, FroalaViewModule;
161867
+ context_1 && context_1.id;
161868
+ return {
161869
+ setters: [
161870
+ function (core_1_1) {
161871
+ core_1 = core_1_1;
161872
+ },
161873
+ function (froala_view_directive_1_1) {
161874
+ froala_view_directive_1 = froala_view_directive_1_1;
161875
+ }
161876
+ ],
161877
+ execute: function () {
161878
+ FroalaViewModule = FroalaViewModule_1 = class FroalaViewModule {
161879
+ static forRoot() {
161880
+ return { ngModule: FroalaViewModule_1, providers: [] };
161881
+ }
161882
+ };
161883
+ FroalaViewModule = FroalaViewModule_1 = __decorate([
161884
+ core_1.NgModule({
161885
+ declarations: [froala_view_directive_1.FroalaViewDirective],
161886
+ exports: [froala_view_directive_1.FroalaViewDirective]
161887
+ })
161888
+ ], FroalaViewModule);
161889
+ exports_1("FroalaViewModule", FroalaViewModule);
161890
+ }
161891
+ };
161892
+ });
161893
+
161894
+ System.register(["@angular/core"], function (exports_1, context_1) {
161895
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
161896
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
161897
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
161898
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
161899
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
161900
+ };
161901
+ var __metadata = (this && this.__metadata) || function (k, v) {
161902
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
161903
+ };
161904
+ var core_1, FroalaViewDirective;
161905
+ context_1 && context_1.id;
161906
+ return {
161907
+ setters: [
161908
+ function (core_1_1) {
161909
+ core_1 = core_1_1;
161910
+ }
161911
+ ],
161912
+ execute: function () {
161913
+ FroalaViewDirective = class FroalaViewDirective {
161914
+ constructor(renderer, element) {
161915
+ this.renderer = renderer;
161916
+ this._element = element.nativeElement;
161917
+ }
161918
+ set froalaView(content) {
161919
+ this._element.innerHTML = content;
161920
+ }
161921
+ ngAfterViewInit() {
161922
+ this.renderer.addClass(this._element, 'fr-view');
161923
+ }
161924
+ };
161925
+ __decorate([
161926
+ core_1.Input(),
161927
+ __metadata("design:type", String),
161928
+ __metadata("design:paramtypes", [String])
161929
+ ], FroalaViewDirective.prototype, "froalaView", null);
161930
+ FroalaViewDirective = __decorate([
161931
+ core_1.Directive({
161932
+ selector: '[froalaView]'
161933
+ }),
161934
+ __metadata("design:paramtypes", [core_1.Renderer2, core_1.ElementRef])
161935
+ ], FroalaViewDirective);
161936
+ exports_1("FroalaViewDirective", FroalaViewDirective);
161937
+ }
161938
+ };
161939
+ });
161940
+
161941
+ System.register(["@stratusjs/angular/froala/view/froala-view.directive", "@stratusjs/angular/froala/view/froala-view.module"], function (exports_1, context_1) {
161942
+ context_1 && context_1.id;
161943
+ return {
161944
+ setters: [
161945
+ function (froala_view_directive_1_1) {
161946
+ exports_1({
161947
+ "FroalaViewDirective": froala_view_directive_1_1["FroalaViewDirective"]
161948
+ });
161949
+ },
161950
+ function (froala_view_module_1_1) {
161951
+ exports_1({
161952
+ "FroalaViewModule": froala_view_module_1_1["FroalaViewModule"]
161953
+ });
161954
+ }
161955
+ ],
161956
+ execute: function () {
161957
+ }
161958
+ };
161959
+ });
161960
+
161961
+ /*!
161962
+ * froala_editor v3.2.3 (https://www.froala.com/wysiwyg-editor)
161963
+ * License https://froala.com/wysiwyg-editor/terms/
161964
+ * Copyright 2014-2020 Froala Labs
161965
+ */
161966
+ System.register(["froala-editor"], function (exports_1, context_1) {
161967
+ var froala_editor_1;
161968
+ context_1 && context_1.id;
161969
+ return {
161970
+ setters: [
161971
+ function (froala_editor_1_1) {
161972
+ froala_editor_1 = froala_editor_1_1;
161973
+ }
161974
+ ],
161975
+ execute: function () {
161976
+ /*!
161977
+ * froala_editor v3.2.3 (https://www.froala.com/wysiwyg-editor)
161978
+ * License https://froala.com/wysiwyg-editor/terms/
161979
+ * Copyright 2014-2020 Froala Labs
161980
+ */
161981
+ if (((froala_editor_1.default && froala_editor_1.default.hasOwnProperty('default') ? froala_editor_1.default.default : froala_editor_1.default),
161982
+ Object.assign(froala_editor_1.default.DEFAULTS, {
161983
+ imageManagerLoadURL: 'https://i.froala.com/load-files',
161984
+ imageManagerLoadMethod: 'get',
161985
+ imageManagerLoadParams: {},
161986
+ imageManagerPreloader: null,
161987
+ imageManagerDeleteURL: '',
161988
+ imageManagerDeleteMethod: 'post',
161989
+ imageManagerDeleteParams: {},
161990
+ imageManagerPageSize: 12,
161991
+ imageManagerScrollOffset: 20,
161992
+ imageManagerToggleTags: !0,
161993
+ }),
161994
+ (froala_editor_1.default.PLUGINS.imageManagerCustom = (s) => {
161995
+ let g, l, i, o, d, m, c, f, u, p, h, v = s.$, M = 'image_manager', e = 10, b = 11, w = 12, C = 13, L = 14, D = 15, t = 21, r = 22, n = {};
161996
+ function y() {
161997
+ let e = v(window).outerWidth();
161998
+ return e < 768 ? 2 : e < 1200 ? 3 : 4;
161999
+ }
162000
+ function I() {
162001
+ d.empty();
162002
+ for (let e = 0; e < h; e++) {
162003
+ d.append('<div class="fr-list-column"></div>');
162004
+ }
162005
+ }
162006
+ function P() {
162007
+ if (u < c.length
162008
+ && (d.outerHeight() <= i.outerHeight() + s.opts.imageManagerScrollOffset
162009
+ || i.scrollTop() + s.opts.imageManagerScrollOffset > d.outerHeight() - i.outerHeight())) {
162010
+ f++;
162011
+ for (let e = s.opts.imageManagerPageSize * (f - 1); e < Math.min(c.length, s.opts.imageManagerPageSize * f); e++) {
162012
+ a(c[e]);
162013
+ }
162014
+ }
162015
+ }
162016
+ function a(n) {
162017
+ let i = new Image(), o = v(document.createElement('div'))
162018
+ .attr('class', 'fr-image-container fr-empty fr-image-' + p++)
162019
+ .attr('data-loading', s.language.translate('Loading') + '..')
162020
+ .attr('data-deleting', s.language.translate('Deleting') + '..');
162021
+ R(!1),
162022
+ (i.onload = function () {
162023
+ o.height(Math.floor((o.width() / i.width) * i.height));
162024
+ let t = v(document.createElement('img'));
162025
+ if (n.thumb) {
162026
+ t.attr('src', n.thumb);
162027
+ }
162028
+ else {
162029
+ if ((O(L, n), !n.url)) {
162030
+ return O(D, n), !1;
162031
+ }
162032
+ t.attr('src', n.url);
162033
+ }
162034
+ if ((n.url && t.attr('data-url', n.url), n.tag)) {
162035
+ if ((l.find('.fr-modal-more.fr-not-available').removeClass('fr-not-available'), l.find('.fr-modal-tags').show(), 0 <= n.tag.indexOf(','))) {
162036
+ for (let e = n.tag.split(','), a = 0; a < e.length; a++) {
162037
+ (e[a] =
162038
+ e[a].trim()), 0 === m.find('a[title="'.concat(e[a], '"]')).length && m.append('<a role="button" title="'.concat(e[a], '">').concat(e[a], '</a>'));
162039
+ }
162040
+ t.attr('data-tag', e.join());
162041
+ }
162042
+ else {
162043
+ 0 === m.find('a[title="'.concat(n.tag.trim(), '"]')).length && m.append('<a role="button" title="'.concat(n.tag.trim(), '">').concat(n.tag.trim(), '</a>')), t.attr('data-tag', n.tag.trim());
162044
+ }
162045
+ }
162046
+ for (let r in (n.name && t.attr('alt', n.name), n)) {
162047
+ n.hasOwnProperty(r) && 'thumb' !== r && 'url' !== r && 'tag' !== r && t.attr('data-'.concat(r), n[r]);
162048
+ }
162049
+ o
162050
+ .append(t)
162051
+ .append(v(s.icon.create('imageManagerDelete')).addClass('fr-delete-img').attr('title', s.language.translate('Delete')))
162052
+ .append(v(s.icon.create('imageManagerInsert')).addClass('fr-insert-img').attr('title', s.language.translate('Insert'))),
162053
+ m.find('.fr-selected-tag').each(function (e, a) {
162054
+ j(t, a.text) || o.hide();
162055
+ }),
162056
+ t.on('load', function () {
162057
+ o.removeClass('fr-empty'),
162058
+ o.height('auto'),
162059
+ u++,
162060
+ E(T(parseInt(t
162061
+ .parent()
162062
+ .attr('class')
162063
+ .match(/fr-image-(\d+)/)[1], 10) + 1)),
162064
+ R(!1),
162065
+ u % s.opts.imageManagerPageSize === 0 && P();
162066
+ }),
162067
+ s.events.trigger('imageManager.imageLoaded', [t]);
162068
+ }),
162069
+ (i.onerror = () => {
162070
+ u++,
162071
+ o.remove(),
162072
+ E(T(parseInt(o.attr('class').match(/fr-image-(\d+)/)[1], 10) + 1)),
162073
+ O(e, n),
162074
+ u % s.opts.imageManagerPageSize === 0 && P();
162075
+ }),
162076
+ (i.src = n.thumb || n.url),
162077
+ S().append(o);
162078
+ }
162079
+ function S() {
162080
+ let r, n;
162081
+ return (d.find('.fr-list-column').each((e, a) => {
162082
+ let t = v(a);
162083
+ 0 === e ? ((n = t.outerHeight()), (r = t)) : t.outerHeight() < n && ((n = t.outerHeight()), (r = t));
162084
+ }),
162085
+ r);
162086
+ }
162087
+ function T(e) {
162088
+ e === undefined && (e = 0);
162089
+ for (let a = [], t = p - 1; e <= t; t--) {
162090
+ let r = d.find('.fr-image-'.concat(t));
162091
+ r.length && (a.push(r), v(document.createElement('div')).attr('id', 'fr-image-hidden-container').append(r), d.find('.fr-image-'.concat(t)).remove());
162092
+ }
162093
+ return a;
162094
+ }
162095
+ function E(e) {
162096
+ for (let a = e.length - 1; 0 <= a; a--) {
162097
+ S().append(e[a]);
162098
+ }
162099
+ }
162100
+ function R(e) {
162101
+ if ((e === undefined && (e = !0), !g.isVisible())) {
162102
+ return !0;
162103
+ }
162104
+ let a = y();
162105
+ if (a !== h) {
162106
+ h = a;
162107
+ let t = T();
162108
+ I(), E(t);
162109
+ }
162110
+ s.modals.resize(M), e && P();
162111
+ }
162112
+ function U(e) {
162113
+ for (let a, t = e[0].attributes, r = t.length, n = {}; r--;) {
162114
+ t[r] && 'src' !== (a = t[r].name) && (n[a] = t[r].value);
162115
+ }
162116
+ return n;
162117
+ }
162118
+ function x(e) {
162119
+ let a = v(e.currentTarget).siblings('img'), t = g.data('instance') || s, r = g.data('current-image');
162120
+ if ((s.modals.hide(M), t.image.showProgressBar(), r)) {
162121
+ r.data('fr-old-src', r.attr('src')), r.trigger('click');
162122
+ }
162123
+ else {
162124
+ t.events.focus(!0), t.selection.restore();
162125
+ let n = t.position.getBoundingRect(), i = n.left + n.width / 2 + v(s.doc).scrollLeft(), o = n.top + n.height + v(s.doc).scrollTop();
162126
+ t.popups.setContainer('image.insert', s.$sc), t.popups.show('image.insert', i, o);
162127
+ }
162128
+ t.image.insert(a.data('url'), !1, U(a), r);
162129
+ }
162130
+ function H(e) {
162131
+ let i = v(e.currentTarget).siblings('img'), a = s.language.translate('Are you sure? Image will be deleted.');
162132
+ confirm(a) &&
162133
+ (s.opts.imageManagerDeleteURL
162134
+ ? !1 !== s.events.trigger('imageManager.beforeDeleteImage', [i]) &&
162135
+ (i.parent().addClass('fr-image-deleting'),
162136
+ v(this).ajax({
162137
+ method: s.opts.imageManagerDeleteMethod,
162138
+ url: s.opts.imageManagerDeleteURL,
162139
+ data: Object.assign(Object.assign({ src: i.attr('src') }, U(i)), s.opts.imageManagerDeleteParams),
162140
+ crossDomain: s.opts.requestWithCORS,
162141
+ withCredentials: s.opts.requestWithCredentials,
162142
+ headers: s.opts.requestHeaders,
162143
+ done(e, a, t) {
162144
+ s.events.trigger('imageManager.imageDeleted', [e]);
162145
+ let r = T(parseInt(i
162146
+ .parent()
162147
+ .attr('class')
162148
+ .match(/fr-image-(\d+)/)[1], 10) + 1);
162149
+ i.parent().remove(),
162150
+ E(r),
162151
+ (function n() {
162152
+ g.find('#fr-modal-tags > a').each(function () {
162153
+ 0 === g.find('#fr-image-list [data-tag*="'.concat(v(this).text(), '"]')).length && v(this).removeClass('fr-selected-tag').hide();
162154
+ }),
162155
+ _();
162156
+ })(),
162157
+ R(!0);
162158
+ },
162159
+ fail(e) {
162160
+ O(t, e.response || e.responseText);
162161
+ },
162162
+ }))
162163
+ : O(r));
162164
+ }
162165
+ function O(e, a) {
162166
+ 10 <= e && e < 20
162167
+ ? o.hide()
162168
+ : 20 <= e && e < 30 && v('.fr-image-deleting').removeClass('fr-image-deleting'), s.events.trigger('imageManager.error', [
162169
+ { code: e, message: n[e] },
162170
+ a
162171
+ ]);
162172
+ }
162173
+ function q() {
162174
+ let e = l.find('.fr-modal-head-line').outerHeight(), a = m.outerHeight();
162175
+ l.toggleClass('fr-show-tags'), l.hasClass('fr-show-tags')
162176
+ ? (l.css('height', e + a), i.css('marginTop', e + a), m.find('a').css('opacity', 1))
162177
+ : (l.css('height', e), i.css('marginTop', e), m.find('a').css('opacity', 0));
162178
+ }
162179
+ function _() {
162180
+ let e = m.find('.fr-selected-tag');
162181
+ 0 < e.length
162182
+ ? (d.find('img').parents().show(),
162183
+ e.each((e, r) => {
162184
+ d.find('img').each(function (e, a) {
162185
+ let t = v(a);
162186
+ j(t, r.text) || t.parent().hide();
162187
+ });
162188
+ }))
162189
+ : d.find('img').parents().show(),
162190
+ E(T()),
162191
+ P();
162192
+ }
162193
+ function k(e) {
162194
+ e.preventDefault();
162195
+ let a = v(e.currentTarget);
162196
+ a.toggleClass('fr-selected-tag'), s.opts.imageManagerToggleTags && a.siblings('a').removeClass('fr-selected-tag'), _();
162197
+ }
162198
+ function j(e, a) {
162199
+ for (let t = (e.attr('data-tag') || '').split(','), r = 0; r < t.length; r++) {
162200
+ if (t[r] === a) {
162201
+ return !0;
162202
+ }
162203
+ }
162204
+ return !1;
162205
+ }
162206
+ return ((n[e] = 'Image cannot be loaded from the passed link.'),
162207
+ (n[b] = 'Error during load images request.'),
162208
+ (n[w] = 'Missing imageManagerLoadURL option.'),
162209
+ (n[C] = 'Parsing load response failed.'),
162210
+ (n[L] = 'Missing image thumb.'),
162211
+ (n[D] = 'Missing image URL.'),
162212
+ (n[t] = 'Error during delete image request.'),
162213
+ (n[r] = 'Missing imageManagerDeleteURL option.'),
162214
+ {
162215
+ require: ['image'],
162216
+ _init: function z() {
162217
+ if (!s.$wp && 'IMG' !== s.el.tagName) {
162218
+ return !1;
162219
+ }
162220
+ },
162221
+ show: function G() {
162222
+ if (!g) {
162223
+ let e, a = '<button class="fr-command fr-btn fr-modal-more fr-not-available" id="fr-modal-more-'
162224
+ .concat(s.sid, '"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24""><path d="')
162225
+ .concat(froala_editor_1.default.SVG.tags, '"/></svg></button><h4 data-text="true">')
162226
+ .concat(s.language.translate('Manage Images'), '</h4></div>\n <div class="fr-modal-tags" id="fr-modal-tags">');
162227
+ (e = s.opts.imageManagerPreloader
162228
+ ? '<img class="fr-preloader" id="fr-preloader" alt="'.concat(s.language.translate('Loading'), '.." src="').concat(s.opts.imageManagerPreloader, '" style="display: none;">')
162229
+ : '<span class="fr-preloader" id="fr-preloader" style="display: none;">'.concat(s.language.translate('Loading'), '</span>')),
162230
+ (e += '<div class="fr-image-list" id="fr-image-list"></div>');
162231
+ let t = s.modals.create(M, a, e);
162232
+ (g = t.$modal), (l = t.$head), (i = t.$body);
162233
+ }
162234
+ g.data('current-image', s.image.get()),
162235
+ s.modals.show(M),
162236
+ o ||
162237
+ (function r() {
162238
+ (o = g.find('#fr-preloader')),
162239
+ (d = g.find('#fr-image-list')),
162240
+ (m = g.find('#fr-modal-tags')),
162241
+ (h = y()),
162242
+ I(),
162243
+ l.css('height', l.find('.fr-modal-head-line').outerHeight()),
162244
+ s.events.$on(v(s.o_win), 'resize', () => {
162245
+ R(!!c);
162246
+ }),
162247
+ s.events.bindClick(d, '.fr-insert-img', x),
162248
+ s.events.bindClick(d, '.fr-delete-img', H),
162249
+ s.helpers.isMobile() &&
162250
+ (s.events.bindClick(d, 'div.fr-image-container', (e) => {
162251
+ g.find('.fr-mobile-selected').removeClass('fr-mobile-selected'),
162252
+ v(e.currentTarget).addClass('fr-mobile-selected');
162253
+ }),
162254
+ g.on(s._mousedown, () => {
162255
+ g.find('.fr-mobile-selected').removeClass('fr-mobile-selected');
162256
+ })),
162257
+ g.on(s._mousedown + ' ' + s._mouseup, (e) => {
162258
+ e.stopPropagation();
162259
+ }),
162260
+ g.on(s._mousedown, '*', () => {
162261
+ s.events.disableBlur();
162262
+ }),
162263
+ i.on('scroll', P),
162264
+ s.events.bindClick(g, 'button#fr-modal-more-'.concat(s.sid), q),
162265
+ s.events.bindClick(m, 'a', k);
162266
+ })(),
162267
+ (function n() {
162268
+ o.show(),
162269
+ d.find('.fr-list-column').empty(),
162270
+ s.opts.imageManagerLoadURL
162271
+ ? v(this).ajax({
162272
+ url: s.opts.imageManagerLoadURL,
162273
+ method: s.opts.imageManagerLoadMethod,
162274
+ data: s.opts.imageManagerLoadParams,
162275
+ crossDomain: s.opts.requestWithCORS,
162276
+ withCredentials: s.opts.requestWithCredentials,
162277
+ headers: s.opts.requestHeaders,
162278
+ done(e, a, t) {
162279
+ s.events.trigger('imageManager.imagesLoaded', [e]),
162280
+ (function r(e, a) {
162281
+ try {
162282
+ d.find('.fr-list-column').empty(), (p = u = f = 0), (c = JSON.parse(e)), P();
162283
+ }
162284
+ catch (t) {
162285
+ O(C, a);
162286
+ }
162287
+ })(e, t.response),
162288
+ o.hide();
162289
+ },
162290
+ fail(e) {
162291
+ O(b, e.response || e.responseText);
162292
+ },
162293
+ })
162294
+ : O(w);
162295
+ })();
162296
+ },
162297
+ hide: function N() {
162298
+ s.modals.hide(M);
162299
+ },
162300
+ });
162301
+ }),
162302
+ !froala_editor_1.default.PLUGINS.image)) {
162303
+ throw new Error('Image manager plugin requires image plugin.');
162304
+ }
162305
+ froala_editor_1.default.DEFAULTS.imageInsertButtons.push('imageManagerCustom'),
162306
+ froala_editor_1.default.RegisterCommand('imageManagerCustom', {
162307
+ title: 'Browse',
162308
+ undo: !1,
162309
+ focus: !1,
162310
+ modal: !0,
162311
+ callback() {
162312
+ this.imageManagerCustom.show();
162313
+ },
162314
+ plugin: 'imageManagerCustom',
162315
+ }),
162316
+ froala_editor_1.default.DefineIcon('imageManagerCustom', { NAME: 'folder', SVG_KEY: 'imageManager' }),
162317
+ froala_editor_1.default.DefineIcon('imageManagerCustomInsert', { NAME: 'plus', SVG_KEY: 'add' }),
162318
+ froala_editor_1.default.DefineIcon('imageManagerCustomDelete', { NAME: 'trash', SVG_KEY: 'remove' });
162319
+ }
162320
+ };
162321
+ });
162322
+
161379
162323
  FroalaEditor.DEFAULTS = Object.assign(FroalaEditor.DEFAULTS, {});
161380
162324
  FroalaEditor.PLUGINS.menuButton = function menuButton(editor) {
161381
162325
  let inputButton;