import "./chunk-N43HULMD.js";
import "./chunk-SKZXPA6D.js";
import "./chunk-GA4FZ3DX.js";
import "./chunk-5IIA45LM.js";
import "./chunk-MPJFGFS5.js";
import {
  ClientDatatableComponent
} from "./chunk-3RTU34A3.js";
import "./chunk-YWQICJL7.js";
import "./chunk-BP5JJWGC.js";
import {
  MonacoEditorModule
} from "./chunk-62OL73TD.js";
import "./chunk-IGGXREIH.js";
import {
  ToastrService
} from "./chunk-2YLAF7RI.js";
import {
  CommonSharedModule,
  DynamicFontSizeDirective,
  Store
} from "./chunk-7NQGM4EA.js";
import {
  CheckboxControlValueAccessor,
  DefaultValueAccessor,
  FormArrayName,
  FormBuilder,
  FormControlName,
  FormGroupDirective,
  FormGroupName,
  MinValidator,
  NgControlStatus,
  NgControlStatusGroup,
  NgSelectOption,
  NumberValueAccessor,
  RadioControlValueAccessor,
  ReactiveFormsModule,
  SelectControlValueAccessor,
  TranslatePipe,
  TranslateService,
  Validators,
  ɵNgNoValidate,
  ɵNgSelectMultipleOption
} from "./chunk-NLYGDKUR.js";
import {
  animate,
  style,
  transition,
  trigger
} from "./chunk-ZEL7H2AL.js";
import {
  ActivatedRoute,
  GridApiService,
  LocalStorageService,
  Router,
  commonConfig
} from "./chunk-P7K2QEDI.js";
import {
  Location,
  NgClass,
  NgForOf,
  NgIf,
  Title,
  ɵsetClassDebugInfo,
  ɵɵStandaloneFeature,
  ɵɵadvance,
  ɵɵdefineComponent,
  ɵɵdirectiveInject,
  ɵɵelement,
  ɵɵelementEnd,
  ɵɵelementStart,
  ɵɵgetCurrentView,
  ɵɵlistener,
  ɵɵloadQuery,
  ɵɵnextContext,
  ɵɵpipe,
  ɵɵpipeBind1,
  ɵɵproperty,
  ɵɵpropertyInterpolate,
  ɵɵpureFunction1,
  ɵɵpureFunction2,
  ɵɵqueryRefresh,
  ɵɵresetView,
  ɵɵrestoreView,
  ɵɵtemplate,
  ɵɵtext,
  ɵɵtextInterpolate,
  ɵɵtextInterpolate1,
  ɵɵviewQuery
} from "./chunk-GKZIWABI.js";
import {
  __async,
  __spreadProps,
  __spreadValues
} from "./chunk-CVWHNZRK.js";

// src/app/@lcp-framework/pages/import-template/import-template.component.ts
var _c0 = ["monacoEditor"];
var _c1 = (a0, a1) => ({ "md:grid-cols-6": a0, "md:grid-cols-5": a1 });
var _c2 = (a0) => ({ "is-invalid": a0 });
var _c3 = (a0) => ({ "border-red-500": a0 });
function ImportTemplateComponent_div_24_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 48);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.getErrorMessage("name"), " ");
  }
}
function ImportTemplateComponent_div_31_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 48);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.getErrorMessage("slug"), " ");
  }
}
function ImportTemplateComponent_div_38_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 48);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.getErrorMessage("description"), " ");
  }
}
function ImportTemplateComponent_div_54_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 48);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.getErrorMessage("status_id"), " ");
  }
}
function ImportTemplateComponent_div_66_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 48);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.getErrorMessage("job_type"), " ");
  }
}
function ImportTemplateComponent_div_67_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 11)(1, "label", 49);
    \u0275\u0275text(2, "Batch Process Count");
    \u0275\u0275elementEnd();
    \u0275\u0275element(3, "input", 50);
    \u0275\u0275elementEnd();
  }
}
function ImportTemplateComponent_div_75_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 48);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.getErrorMessage("max_row_count"), " ");
  }
}
function ImportTemplateComponent_div_82_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 48);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.getErrorMessage("header_row"), " ");
  }
}
function ImportTemplateComponent_div_89_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 48);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.getErrorMessage("data_start_row"), " ");
  }
}
function ImportTemplateComponent_div_96_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 48);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.getErrorMessage("data_end_row"), " ");
  }
}
function ImportTemplateComponent_div_112_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 48);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.getErrorMessage("ignore_error_rows"), " ");
  }
}
function ImportTemplateComponent_div_128_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 48);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.getErrorMessage("is_admin_module"), " ");
  }
}
function ImportTemplateComponent_div_144_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 48);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.getErrorMessage("is_send_mail"), " ");
  }
}
function ImportTemplateComponent_div_145_option_7_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "option", 55);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const row_r2 = ctx.$implicit;
    \u0275\u0275property("value", row_r2.slug);
    \u0275\u0275advance();
    \u0275\u0275textInterpolate(row_r2.name);
  }
}
function ImportTemplateComponent_div_145_div_8_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 48);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext(2);
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.getErrorMessage("email_process_slug"), " ");
  }
}
function ImportTemplateComponent_div_145_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 11)(1, "label", 51);
    \u0275\u0275text(2);
    \u0275\u0275pipe(3, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(4, "select", 52)(5, "option", 53);
    \u0275\u0275text(6, "Select Email Process");
    \u0275\u0275elementEnd();
    \u0275\u0275template(7, ImportTemplateComponent_div_145_option_7_Template, 2, 2, "option", 54);
    \u0275\u0275elementEnd();
    \u0275\u0275template(8, ImportTemplateComponent_div_145_div_8_Template, 2, 1, "div", 14);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance(2);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(3, 3, "form_label_email_process_slug"));
    \u0275\u0275advance(5);
    \u0275\u0275property("ngForOf", ctx_r0.emailprocesslist);
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", ctx_r0.isFieldInvalid("email_process_slug"));
  }
}
function ImportTemplateComponent_div_150_div_23_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 118);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext(2);
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.getLineItemErrorMessage("field_name"), " ");
  }
}
function ImportTemplateComponent_div_150_option_44_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "option", 55);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const table_r4 = ctx.$implicit;
    \u0275\u0275property("value", table_r4);
    \u0275\u0275advance();
    \u0275\u0275textInterpolate(table_r4);
  }
}
function ImportTemplateComponent_div_150_option_53_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "option", 55);
    \u0275\u0275text(1);
    \u0275\u0275pipe(2, "translate");
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const type_r5 = ctx.$implicit;
    \u0275\u0275property("value", type_r5.value);
    \u0275\u0275advance();
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(2, 2, type_r5.label));
  }
}
function ImportTemplateComponent_div_150_div_84_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 69)(1, "label", 119);
    \u0275\u0275text(2);
    \u0275\u0275pipe(3, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(4, "div", 71);
    \u0275\u0275element(5, "input", 120);
    \u0275\u0275elementEnd()();
  }
  if (rf & 2) {
    \u0275\u0275advance(2);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(3, 1, "form_label_enum_values"), " ");
  }
}
function ImportTemplateComponent_div_150_div_91_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 89)(1, "label", 121);
    \u0275\u0275text(2);
    \u0275\u0275pipe(3, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(4, "div", 71);
    \u0275\u0275element(5, "input", 122);
    \u0275\u0275elementEnd()();
  }
  if (rf & 2) {
    \u0275\u0275advance(2);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(3, 1, "form_label_individual_column"), " ");
  }
}
function ImportTemplateComponent_div_150_div_98_option_9_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "option", 55);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const table_r6 = ctx.$implicit;
    \u0275\u0275property("value", table_r6);
    \u0275\u0275advance();
    \u0275\u0275textInterpolate(table_r6);
  }
}
function ImportTemplateComponent_div_150_div_98_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 88)(1, "div", 69)(2, "label", 123);
    \u0275\u0275text(3);
    \u0275\u0275pipe(4, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(5, "div", 71)(6, "select", 124)(7, "option", 80);
    \u0275\u0275text(8, "Select Table");
    \u0275\u0275elementEnd();
    \u0275\u0275template(9, ImportTemplateComponent_div_150_div_98_option_9_Template, 2, 2, "option", 54);
    \u0275\u0275elementEnd()()();
    \u0275\u0275elementStart(10, "div", 69)(11, "label", 125);
    \u0275\u0275text(12);
    \u0275\u0275pipe(13, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(14, "div", 71);
    \u0275\u0275element(15, "input", 126);
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(16, "div", 127);
    \u0275\u0275element(17, "input", 128);
    \u0275\u0275elementStart(18, "label", 129);
    \u0275\u0275text(19);
    \u0275\u0275pipe(20, "translate");
    \u0275\u0275elementEnd()()();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext(2);
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(4, 4, "form_label_foreign_table"), " ");
    \u0275\u0275advance(6);
    \u0275\u0275property("ngForOf", ctx_r0.tables_list);
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(13, 6, "form_label_foreign_column"), " ");
    \u0275\u0275advance(7);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(20, 8, "form_label_foreign_can_create"), " ");
  }
}
function ImportTemplateComponent_div_150_div_99_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 108)(1, "div", 69)(2, "label", 130);
    \u0275\u0275text(3);
    \u0275\u0275pipe(4, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(5, "div", 71);
    \u0275\u0275element(6, "textarea", 131);
    \u0275\u0275elementEnd()()();
  }
  if (rf & 2) {
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(4, 1, "form_label_foreign_query"), " ");
  }
}
function ImportTemplateComponent_div_150_div_117_div_1_Template(rf, ctx) {
  if (rf & 1) {
    const _r7 = \u0275\u0275getCurrentView();
    \u0275\u0275elementStart(0, "div", 134);
    \u0275\u0275element(1, "input", 135)(2, "input", 136);
    \u0275\u0275elementStart(3, "div", 137)(4, "button", 138);
    \u0275\u0275listener("click", function ImportTemplateComponent_div_150_div_117_div_1_Template_button_click_4_listener() {
      const i_r8 = \u0275\u0275restoreView(_r7).index;
      const ctx_r0 = \u0275\u0275nextContext(3);
      return \u0275\u0275resetView(ctx_r0.removeExpressionRule(i_r8));
    });
    \u0275\u0275text(5, "Remove");
    \u0275\u0275elementEnd()()();
  }
  if (rf & 2) {
    const i_r8 = ctx.index;
    \u0275\u0275property("formGroupName", i_r8);
  }
}
function ImportTemplateComponent_div_150_div_117_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 132);
    \u0275\u0275template(1, ImportTemplateComponent_div_150_div_117_div_1_Template, 6, 1, "div", 133);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext(2);
    \u0275\u0275advance();
    \u0275\u0275property("ngForOf", ctx_r0.expressionRules.controls);
  }
}
function ImportTemplateComponent_div_150_Template(rf, ctx) {
  if (rf & 1) {
    const _r3 = \u0275\u0275getCurrentView();
    \u0275\u0275elementStart(0, "div", 56);
    \u0275\u0275element(1, "div", 57);
    \u0275\u0275elementStart(2, "div", 58)(3, "div", 59)(4, "div", 60)(5, "div", 61)(6, "h3", 62);
    \u0275\u0275text(7);
    \u0275\u0275pipe(8, "translate");
    \u0275\u0275pipe(9, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(10, "button", 63);
    \u0275\u0275listener("click", function ImportTemplateComponent_div_150_Template_button_click_10_listener() {
      \u0275\u0275restoreView(_r3);
      const ctx_r0 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r0.cancelLineItemEdit());
    });
    \u0275\u0275elementStart(11, "span", 64);
    \u0275\u0275text(12, "Close");
    \u0275\u0275elementEnd();
    \u0275\u0275element(13, "i", 65);
    \u0275\u0275elementEnd()()();
    \u0275\u0275elementStart(14, "div", 66)(15, "form", 67);
    \u0275\u0275listener("ngSubmit", function ImportTemplateComponent_div_150_Template_form_ngSubmit_15_listener() {
      \u0275\u0275restoreView(_r3);
      const ctx_r0 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r0.onLineItemSubmit());
    });
    \u0275\u0275elementStart(16, "div", 68)(17, "div", 69)(18, "label", 70);
    \u0275\u0275text(19);
    \u0275\u0275pipe(20, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(21, "div", 71);
    \u0275\u0275element(22, "input", 72);
    \u0275\u0275template(23, ImportTemplateComponent_div_150_div_23_Template, 2, 1, "div", 73);
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(24, "div", 69)(25, "label", 74);
    \u0275\u0275text(26);
    \u0275\u0275pipe(27, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(28, "div", 71);
    \u0275\u0275element(29, "input", 75);
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(30, "div", 69)(31, "label", 76);
    \u0275\u0275text(32);
    \u0275\u0275pipe(33, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(34, "div", 71);
    \u0275\u0275element(35, "input", 77);
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(36, "div", 69)(37, "label", 78);
    \u0275\u0275text(38);
    \u0275\u0275pipe(39, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(40, "div", 71)(41, "select", 79)(42, "option", 80);
    \u0275\u0275text(43, "Select Table");
    \u0275\u0275elementEnd();
    \u0275\u0275template(44, ImportTemplateComponent_div_150_option_44_Template, 2, 2, "option", 54);
    \u0275\u0275elementEnd()()();
    \u0275\u0275elementStart(45, "div", 69)(46, "label", 81);
    \u0275\u0275text(47);
    \u0275\u0275pipe(48, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(49, "div", 71)(50, "select", 82)(51, "option", 80);
    \u0275\u0275text(52, "Select Field Type");
    \u0275\u0275elementEnd();
    \u0275\u0275template(53, ImportTemplateComponent_div_150_option_53_Template, 3, 4, "option", 54);
    \u0275\u0275elementEnd()()();
    \u0275\u0275elementStart(54, "div", 69)(55, "label", 83);
    \u0275\u0275text(56);
    \u0275\u0275pipe(57, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(58, "div", 71);
    \u0275\u0275element(59, "input", 84);
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(60, "div", 69)(61, "label", 85);
    \u0275\u0275text(62);
    \u0275\u0275pipe(63, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(64, "div", 71);
    \u0275\u0275element(65, "input", 86);
    \u0275\u0275elementEnd()()();
    \u0275\u0275elementStart(66, "div", 87)(67, "div", 88)(68, "div", 89);
    \u0275\u0275element(69, "input", 90);
    \u0275\u0275elementStart(70, "label", 91);
    \u0275\u0275text(71);
    \u0275\u0275pipe(72, "translate");
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(73, "div", 89);
    \u0275\u0275element(74, "input", 92);
    \u0275\u0275elementStart(75, "label", 93);
    \u0275\u0275text(76);
    \u0275\u0275pipe(77, "translate");
    \u0275\u0275elementEnd()()();
    \u0275\u0275elementStart(78, "div", 94)(79, "div", 89);
    \u0275\u0275element(80, "input", 95);
    \u0275\u0275elementStart(81, "label", 96);
    \u0275\u0275text(82);
    \u0275\u0275pipe(83, "translate");
    \u0275\u0275elementEnd()();
    \u0275\u0275template(84, ImportTemplateComponent_div_150_div_84_Template, 6, 3, "div", 97);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(85, "div", 94)(86, "div", 89);
    \u0275\u0275element(87, "input", 98);
    \u0275\u0275elementStart(88, "label", 99);
    \u0275\u0275text(89);
    \u0275\u0275pipe(90, "translate");
    \u0275\u0275elementEnd()();
    \u0275\u0275template(91, ImportTemplateComponent_div_150_div_91_Template, 6, 3, "div", 100);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(92, "div", 101)(93, "div", 89);
    \u0275\u0275element(94, "input", 102);
    \u0275\u0275elementStart(95, "label", 103);
    \u0275\u0275text(96);
    \u0275\u0275pipe(97, "translate");
    \u0275\u0275elementEnd()();
    \u0275\u0275template(98, ImportTemplateComponent_div_150_div_98_Template, 21, 10, "div", 104)(99, ImportTemplateComponent_div_150_div_99_Template, 7, 3, "div", 105);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(100, "div", 101)(101, "div", 89);
    \u0275\u0275element(102, "input", 106);
    \u0275\u0275elementStart(103, "label", 107);
    \u0275\u0275text(104);
    \u0275\u0275pipe(105, "translate");
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(106, "div", 108)(107, "div", 69)(108, "label", 109);
    \u0275\u0275text(109);
    \u0275\u0275pipe(110, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(111, "div", 71);
    \u0275\u0275element(112, "textarea", 110);
    \u0275\u0275elementEnd()()()();
    \u0275\u0275elementStart(113, "div", 101)(114, "div", 111)(115, "label", 112);
    \u0275\u0275text(116, "Expression Rules");
    \u0275\u0275elementEnd();
    \u0275\u0275template(117, ImportTemplateComponent_div_150_div_117_Template, 2, 1, "div", 113);
    \u0275\u0275elementStart(118, "button", 114);
    \u0275\u0275listener("click", function ImportTemplateComponent_div_150_Template_button_click_118_listener() {
      \u0275\u0275restoreView(_r3);
      const ctx_r0 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r0.addExpressionRule());
    });
    \u0275\u0275text(119, "+ Add Expression Rule");
    \u0275\u0275elementEnd()()()();
    \u0275\u0275elementStart(120, "div", 115)(121, "button", 116);
    \u0275\u0275listener("click", function ImportTemplateComponent_div_150_Template_button_click_121_listener() {
      \u0275\u0275restoreView(_r3);
      const ctx_r0 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r0.cancelLineItemEdit());
    });
    \u0275\u0275text(122);
    \u0275\u0275pipe(123, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(124, "button", 117);
    \u0275\u0275text(125);
    \u0275\u0275pipe(126, "translate");
    \u0275\u0275pipe(127, "translate");
    \u0275\u0275elementEnd()()()()()()();
  }
  if (rf & 2) {
    let tmp_17_0;
    let tmp_19_0;
    let tmp_21_0;
    let tmp_22_0;
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance(7);
    \u0275\u0275textInterpolate1(" ", ctx_r0.editingItemIndex !== -1 ? \u0275\u0275pipeBind1(8, 28, "title_edit_import_template_line_item") : \u0275\u0275pipeBind1(9, 30, "title_add_import_template_line_item"), " ");
    \u0275\u0275advance(8);
    \u0275\u0275property("formGroup", ctx_r0.lineItemForm);
    \u0275\u0275advance(4);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(20, 32, "form_label_field_name"), " ");
    \u0275\u0275advance(3);
    \u0275\u0275property("ngClass", \u0275\u0275pureFunction1(66, _c3, ctx_r0.isLineItemFieldInvalid("field_name")));
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", ctx_r0.isLineItemFieldInvalid("field_name"));
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(27, 34, "form_label_display_name"), " ");
    \u0275\u0275advance(6);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(33, 36, "form_label_order_no"), " ");
    \u0275\u0275advance(6);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(39, 38, "form_label_field_table"), " ");
    \u0275\u0275advance(6);
    \u0275\u0275property("ngForOf", ctx_r0.tables_list);
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(48, 40, "form_label_field_type"), " ");
    \u0275\u0275advance(6);
    \u0275\u0275property("ngForOf", ctx_r0.field_types);
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(57, 42, "form_label_default_value"), " ");
    \u0275\u0275advance(6);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(63, 44, "form_label_check_reg_exp"), " ");
    \u0275\u0275advance(9);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(72, 46, "form_label_is_nullable"));
    \u0275\u0275advance(5);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(77, 48, "form_label_is_multiple"));
    \u0275\u0275advance(6);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(83, 50, "form_label_is_enum"));
    \u0275\u0275advance(2);
    \u0275\u0275property("ngIf", (tmp_17_0 = ctx_r0.lineItemForm.get("is_enum")) == null ? null : tmp_17_0.value);
    \u0275\u0275advance(5);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(90, 52, "form_label_is_individual"));
    \u0275\u0275advance(2);
    \u0275\u0275property("ngIf", (tmp_19_0 = ctx_r0.lineItemForm.get("is_individual")) == null ? null : tmp_19_0.value);
    \u0275\u0275advance(5);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(97, 54, "form_label_is_foreign"));
    \u0275\u0275advance(2);
    \u0275\u0275property("ngIf", (tmp_21_0 = ctx_r0.lineItemForm.get("is_foreign")) == null ? null : tmp_21_0.value);
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", (tmp_22_0 = ctx_r0.lineItemForm.get("is_foreign")) == null ? null : tmp_22_0.value);
    \u0275\u0275advance(5);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(105, 56, "form_label_is_unique"));
    \u0275\u0275advance(5);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(110, 58, "form_label_unique_query"), " ");
    \u0275\u0275advance(8);
    \u0275\u0275property("ngIf", ctx_r0.expressionRules && ctx_r0.expressionRules.length > 0);
    \u0275\u0275advance(5);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(123, 60, "cancel"), " ");
    \u0275\u0275advance(2);
    \u0275\u0275property("disabled", ctx_r0.lineItemForm.invalid);
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.editingItemIndex !== -1 ? \u0275\u0275pipeBind1(126, 62, "update") : \u0275\u0275pipeBind1(127, 64, "add"), " ");
  }
}
function ImportTemplateComponent_div_151_Template(rf, ctx) {
  if (rf & 1) {
    const _r9 = \u0275\u0275getCurrentView();
    \u0275\u0275elementStart(0, "div", 56);
    \u0275\u0275element(1, "div", 57);
    \u0275\u0275elementStart(2, "div", 58)(3, "div", 59)(4, "div", 60)(5, "div", 61)(6, "h3", 62);
    \u0275\u0275text(7);
    \u0275\u0275pipe(8, "translate");
    \u0275\u0275pipe(9, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(10, "button", 63);
    \u0275\u0275listener("click", function ImportTemplateComponent_div_151_Template_button_click_10_listener() {
      \u0275\u0275restoreView(_r9);
      const ctx_r0 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r0.cancelLineQueryEdit());
    });
    \u0275\u0275elementStart(11, "span", 64);
    \u0275\u0275text(12, "Close");
    \u0275\u0275elementEnd();
    \u0275\u0275element(13, "i", 65);
    \u0275\u0275elementEnd()()();
    \u0275\u0275elementStart(14, "div", 139)(15, "form", 140);
    \u0275\u0275listener("ngSubmit", function ImportTemplateComponent_div_151_Template_form_ngSubmit_15_listener() {
      \u0275\u0275restoreView(_r9);
      const ctx_r0 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r0.onLineQuerySubmit());
    });
    \u0275\u0275elementStart(16, "div", 141)(17, "div", 142)(18, "label", 143);
    \u0275\u0275text(19);
    \u0275\u0275pipe(20, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275element(21, "input", 144);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(22, "div", 142)(23, "label", 76);
    \u0275\u0275text(24);
    \u0275\u0275pipe(25, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275element(26, "input", 77);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(27, "div", 89);
    \u0275\u0275element(28, "input", 145);
    \u0275\u0275elementStart(29, "label", 146);
    \u0275\u0275text(30);
    \u0275\u0275pipe(31, "translate");
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(32, "div", 89);
    \u0275\u0275element(33, "input", 147);
    \u0275\u0275elementStart(34, "label", 99);
    \u0275\u0275text(35);
    \u0275\u0275pipe(36, "translate");
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(37, "div", 89);
    \u0275\u0275element(38, "input", 148);
    \u0275\u0275elementStart(39, "label", 149);
    \u0275\u0275text(40);
    \u0275\u0275pipe(41, "translate");
    \u0275\u0275elementEnd()()();
    \u0275\u0275elementStart(42, "div", 142)(43, "label", 150);
    \u0275\u0275text(44);
    \u0275\u0275pipe(45, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275element(46, "textarea", 151);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(47, "div", 115)(48, "button", 116);
    \u0275\u0275listener("click", function ImportTemplateComponent_div_151_Template_button_click_48_listener() {
      \u0275\u0275restoreView(_r9);
      const ctx_r0 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r0.cancelLineQueryEdit());
    });
    \u0275\u0275text(49);
    \u0275\u0275pipe(50, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(51, "button", 117);
    \u0275\u0275text(52);
    \u0275\u0275pipe(53, "translate");
    \u0275\u0275pipe(54, "translate");
    \u0275\u0275elementEnd()()()()()()();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance(7);
    \u0275\u0275textInterpolate1(" ", ctx_r0.editingQueryIndex !== -1 ? \u0275\u0275pipeBind1(8, 11, "title_edit_import_template_line_query") : \u0275\u0275pipeBind1(9, 13, "title_add_import_template_line_query"), " ");
    \u0275\u0275advance(8);
    \u0275\u0275property("formGroup", ctx_r0.lineQueryForm);
    \u0275\u0275advance(4);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(20, 15, "form_label_query_name"), " ");
    \u0275\u0275advance(5);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(25, 17, "form_label_order_no"), " ");
    \u0275\u0275advance(6);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(31, 19, "form_label_allow_multiple"));
    \u0275\u0275advance(5);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(36, 21, "form_label_is_individual"));
    \u0275\u0275advance(5);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(41, 23, "form_label_before_lineitems"));
    \u0275\u0275advance(4);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(45, 25, "form_label_query_string"), " ");
    \u0275\u0275advance(5);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(50, 27, "cancel"), " ");
    \u0275\u0275advance(2);
    \u0275\u0275property("disabled", ctx_r0.lineQueryForm.invalid);
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", ctx_r0.editingQueryIndex !== -1 ? \u0275\u0275pipeBind1(53, 29, "update") : \u0275\u0275pipeBind1(54, 31, "add"), " ");
  }
}
function viewMandatoryValidator() {
  return (control) => {
    const selectedOptions = control.value;
    if (Array.isArray(selectedOptions) && selectedOptions.includes("view")) {
      return null;
    }
    return { viewMandatory: true };
  };
}
var _ImportTemplateComponent = class _ImportTemplateComponent {
  constructor(fb, gridApiService, toastr, route, router, localStorageService, storeData, location, translate, titleService) {
    this.fb = fb;
    this.gridApiService = gridApiService;
    this.toastr = toastr;
    this.route = route;
    this.router = router;
    this.localStorageService = localStorageService;
    this.storeData = storeData;
    this.location = location;
    this.translate = translate;
    this.titleService = titleService;
    this.items = [];
    this.queries = [];
    this.action_types = [];
    this.field_types = [];
    this.tables_list = [];
    this.wizard_type_list = [];
    this.id = null;
    this.editTitle = false;
    this.submitted = false;
    this.commonConfig = commonConfig;
    this.existing_actions = [];
    this.redirect_url = "import_template";
    this.rowsLength = 26;
    this.selectedItem = null;
    this.editingItemIndex = -1;
    this.selectedQuery = null;
    this.editingQueryIndex = -1;
    this.editorOptions = { theme: "vs-dark", language: "json", tabSize: 1, insertSpaces: true };
    this.htmlEditorOptions = __spreadProps(__spreadValues({}, this.editorOptions), { language: "html" });
    this.isDarkTheme = true;
    this._originalItems = [];
    this._originalQueries = [];
    this.emailprocesslist = [];
    this.insert_json_schema = {
      // it will be removed
      action: ["insert", "insert", "insert"],
      table: ["import_templates", "import_template_line_items", "import_template_queries"],
      table_mapping: ["table1", "table2", "table3"],
      data: {
        table1: [],
        table2: [],
        table3: []
      }
    };
    this.update_json_schema = {
      // it will be removed
      action: ["update", "hard_delete", "insert", "hard_delete", "insert"],
      table: ["import_templates", "import_template_line_items", "import_template_line_items", "import_template_queries", "import_template_queries"],
      table_mapping: ["table1", "table2", "table3", "table4", "table5"],
      data: {
        table1: [],
        table3: [],
        table5: []
      },
      conditions: {
        table1: [],
        table2: [],
        table4: []
      }
    };
    this.isItemModalOpen = false;
    this.isQueryModalOpen = false;
    this.itemsTableConfig = {
      columns: [
        { key: "field_name", label: "Field Name", sortable: true, searchable: true },
        { key: "display_name", label: "Display Name", sortable: true, searchable: true },
        { key: "field_table", label: "Field Table", sortable: true, searchable: true },
        { key: "order_no", label: "Order No", sortable: true, searchable: true },
        { key: "field_type_id", label: "Field Type", sortable: true, searchable: true },
        {
          key: "actions",
          label: "Actions",
          type: "button",
          actions: [
            {
              icon: "fa-solid fa-edit",
              onClick: (item) => this.editLineItem(item),
              class: "   mr-4",
              tooltip: "Edit Item"
            },
            {
              icon: "fa-solid fa-trash",
              onClick: (item) => this.removeItem(item),
              class: "  ",
              tooltip: "Delete Item"
            }
          ]
        }
      ],
      pageSizes: [5, 10, 25, 50],
      defaultPageSize: 5,
      searchable: true,
      headerConfig: {
        title: "Import Template Line Items",
        showHeader: true,
        addButton: {
          show: true,
          label: "Add New",
          icon: "fa-solid fa-plus",
          onClick: () => this.initNewLineItem(),
          disabled: false,
          class: "btn-primary flex items-center rounded-md border border-[#e0e6ed] px-4 py-2 font-semibold dark:border-[#253b5c] dark:bg-[#1b2e4b] dark:text-white-dark"
        },
        enableFilter: true,
        enableColumnSelector: true,
        enableExport: true
      }
    };
    this.queriesTableConfig = {
      columns: [
        { key: "query_name", label: "Query Name", sortable: true, searchable: true },
        { key: "order_no", label: "Order No", sortable: true, searchable: true },
        { key: "allow_multiple", label: "Allow Multiple", sortable: true, searchable: true },
        { key: "is_individual", label: "Is Individual", sortable: true, searchable: true },
        { key: "before_lineitems", label: "Before Line Items", sortable: true, searchable: true },
        { key: "query_string", label: "Query String", sortable: true, searchable: true },
        {
          key: "actions",
          label: "Actions",
          type: "button",
          actions: [
            {
              icon: "fa-solid fa-edit",
              onClick: (item) => this.editQueryItem(item),
              class: "   mr-4",
              tooltip: "Edit Query"
            },
            {
              icon: "fa-solid fa-trash",
              onClick: (item) => this.removeQuery(item),
              class: "  ",
              tooltip: "Delete Query"
            }
          ]
        }
      ],
      pageSizes: [5, 10, 25, 50],
      defaultPageSize: 5,
      searchable: true,
      headerConfig: {
        title: "Import Template Line Queries",
        showHeader: true,
        addButton: {
          show: true,
          label: "Add New",
          icon: "fa-solid fa-plus",
          onClick: () => this.initNewLineQuery(),
          disabled: false,
          class: "btn-primary flex items-center rounded-md border border-[#e0e6ed] px-4 py-2 font-semibold dark:border-[#253b5c] dark:bg-[#1b2e4b] dark:text-white-dark"
        },
        enableFilter: true,
        enableColumnSelector: true,
        enableExport: true
      }
    };
    this.showEmailProcessSlug = false;
    this.initStore();
  }
  ngOnInit() {
    this.id = this.route.snapshot.params["id"] || null;
    this.getEmailTemplateProcessList();
    this.initForm();
    this.field_types = this.commonConfig.field_types;
    this.action_types = this.commonConfig.action_types;
    this.wizard_type_list = this.commonConfig.wizard_type;
    this.fetchAllTables();
    if (!this.id) {
      this.editTitle = false;
    } else {
      this.editTitle = true;
      this.loadData(this.id);
    }
    this.titleChange();
  }
  toggleEmailProcessSlug(value) {
    this.showEmailProcessSlug = value;
  }
  getEmailTemplateProcessList() {
    const params = {
      company_id: 1,
      print_query: true,
      primary_table: "email_templates",
      start_index: 0,
      limit_range: 1,
      sort_columns: [["email_templates.id", "asc"]],
      select_columns: [["email_templates.*"]]
    };
    this.gridApiService.getAllList(params).subscribe((response) => {
      if (response.status && response.code === 200) {
        console.log(response);
        this.emailprocesslist = response.data.records;
      }
    }, (error) => {
      const key = "error";
      const errorMessage = this.translate.instant(key);
      this.toastr.error(errorMessage, "Error");
    });
  }
  initStore() {
    return __async(this, null, function* () {
      this.storeData.select((d) => d.index).subscribe((d) => {
        this.store = d;
      });
    });
  }
  initLineItemForm() {
    this.lineItemForm = this.fb.group({
      field_name: ["", [Validators.required, Validators.maxLength(100)]],
      display_name: ["", [Validators.required, Validators.maxLength(100)]],
      order_no: ["", [Validators.required, Validators.min(0)]],
      field_table: ["", Validators.required],
      default_value: [""],
      check_reg_exp: [""],
      is_nullable: [false],
      is_unique: [false],
      is_foreign: [false],
      is_multiple: [false],
      is_enum: [false],
      enum_values: [""],
      is_individual: [false],
      individual_column: [""],
      foreign_table: [""],
      foreign_column: [""],
      foreign_can_create: [false],
      foreign_query: [""],
      unique_query: [""],
      expression_rules: this.fb.array([this.createExpressionRule()]),
      field_type_id: ["", Validators.required]
    });
    this.addFormArraySubscriptions();
    this.expressionRules.controls.forEach((ruleGroup) => {
      ruleGroup.valueChanges.subscribe(() => {
        this.lineItemForm.updateValueAndValidity();
      });
    });
  }
  createExpressionRule() {
    return this.fb.group({
      expression: ["", Validators.required],
      message: ["", Validators.required]
    });
  }
  get expressionRules() {
    const arr = this.lineItemForm.get("expression_rules");
    console.log("expressionRules length:", arr?.length);
    return arr;
  }
  addExpressionRule() {
    const ruleGroup = this.fb.group({
      expression: ["", Validators.required],
      message: ["", Validators.required]
    });
    this.expressionRules.push(ruleGroup);
    this.lineItemForm.updateValueAndValidity();
  }
  removeExpressionRule(index) {
    this.expressionRules.removeAt(index);
    this.lineItemForm.updateValueAndValidity();
  }
  initLineQueryForm() {
    this.lineQueryForm = this.fb.group({
      query_string: ["", [Validators.required]],
      order_no: ["", [Validators.required, Validators.min(0)]],
      query_name: ["", [Validators.required, Validators.min(0)]],
      allow_multiple: [false],
      is_individual: [false],
      before_lineitems: [false]
    });
  }
  addFormArraySubscriptions() {
    this.lineItemForm.get("is_foreign")?.valueChanges.subscribe((value) => {
      const foreignControls = ["foreign_table", "foreign_column", "foreign_can_create", "foreign_query"];
      foreignControls.forEach((control) => {
        const formControl = this.lineItemForm.get(control);
        if (value) {
          formControl?.enable();
        } else {
          formControl?.disable();
        }
      });
    });
    this.lineItemForm.get("is_enum")?.valueChanges.subscribe((value) => {
      const enumControl = this.lineItemForm.get("enum_values");
      if (value) {
        enumControl?.enable();
      } else {
        enumControl?.disable();
      }
    });
    this.lineItemForm.get("is_individual")?.valueChanges.subscribe((value) => {
      const individualColumn = this.lineItemForm.get("individual_column");
      if (value) {
        individualColumn?.enable();
      } else {
        individualColumn?.disable();
      }
    });
  }
  initNewLineItem() {
    this.editingItemIndex = -1;
    this.selectedItem = {};
    this.lineItemForm.reset({
      is_nullable: false,
      is_unique: false,
      is_foreign: false,
      is_multiple: false,
      is_enum: false,
      is_individual: false,
      foreign_can_create: false,
      foreign_query: "",
      unique_query: ""
    });
    this.lineItemForm.setControl("expression_rules", this.fb.array([]));
    this.lineItemForm.updateValueAndValidity();
    this.isItemModalOpen = true;
  }
  initNewLineQuery() {
    this.editingQueryIndex = -1;
    this.selectedQuery = {};
    this.lineQueryForm.reset({
      query_string: "",
      order_no: "",
      query_name: "",
      allow_multiple: false,
      is_individual: false,
      before_lineitems: false
    });
    this.isQueryModalOpen = true;
  }
  editQueryItem(index) {
    this.selectedQuery = index;
    this.editingQueryIndex = this.queriesData.findIndex((q) => q === index);
    this.lineQueryForm.patchValue(index);
    this.isQueryModalOpen = true;
  }
  editLineItem(index) {
    this.selectedItem = index;
    this.editingItemIndex = this._originalItems.findIndex((i) => i.field_name === index.field_name);
    this.lineItemForm.patchValue(index);
    const expressionArray = this.fb.array((index.expression_rules || []).map((rule) => {
      return this.fb.group({
        expression: [rule.expression || "", Validators.required],
        message: [rule.message || "", Validators.required]
      });
    }));
    this.lineItemForm.setControl("expression_rules", expressionArray);
    this.lineItemForm.updateValueAndValidity();
    this.isItemModalOpen = true;
  }
  cancelLineItemEdit() {
    this.selectedItem = null;
    this.editingItemIndex = -1;
    this.lineItemForm.reset();
    this.isItemModalOpen = false;
  }
  cancelLineQueryEdit() {
    this.selectedQuery = null;
    this.editingQueryIndex = -1;
    this.lineQueryForm.reset();
    this.isQueryModalOpen = false;
  }
  onLineItemSubmit() {
    if (this.lineItemForm.valid) {
      const itemsArray = this.form.get("items");
      const formValue = this.lineItemForm.value;
      if (this.editingItemIndex !== -1) {
        itemsArray.setControl(this.editingItemIndex, this.createItemFormGroup(formValue));
        this._originalItems[this.editingItemIndex] = __spreadValues({}, formValue);
      } else {
        itemsArray.push(this.createItemFormGroup(formValue));
        this._originalItems.push(__spreadValues({}, formValue));
      }
      this.onItemsDataChange(this._originalItems);
      this.isItemModalOpen = false;
      this.cancelLineItemEdit();
    }
  }
  onLineQuerySubmit() {
    if (this.lineQueryForm.valid) {
      const queriesArray = this.form.get("queries");
      const formValue = this.lineQueryForm.value;
      if (this.editingQueryIndex !== -1) {
        queriesArray.at(this.editingQueryIndex).patchValue(formValue);
        this._originalQueries[this.editingQueryIndex] = __spreadValues(__spreadValues({}, this._originalQueries[this.editingQueryIndex]), formValue);
      } else {
        queriesArray.push(this.fb.group(formValue));
        this._originalQueries.push(__spreadValues({}, formValue));
      }
      this.isQueryModalOpen = false;
      this.cancelLineQueryEdit();
    }
  }
  getFieldTypeName(typeId) {
    const fieldType = this.field_types.find((type) => type.value === typeId);
    return fieldType ? fieldType.label : "";
  }
  isLineItemFieldInvalid(fieldName) {
    const field = this.lineItemForm?.get(fieldName);
    return field ? field.invalid && (field.touched || this.submitted) : false;
  }
  isLineQueryFieldInvalid(fieldName) {
    const field = this.lineQueryForm?.get(fieldName);
    return field ? field.invalid && (field.touched || this.submitted) : false;
  }
  titleChange() {
    const title = this.editTitle ? "title_edit_entity" : "title_add_entity";
    const translateTitle = this.translate.instant(title);
    this.titleService.setTitle(translateTitle);
  }
  decimalValidator(control) {
    const value = control.value;
    if (value !== null && value !== void 0 && !/^\d+(\.\d{1,2})?$/.test(value)) {
      return { decimalInvalid: true };
    }
    return null;
  }
  initForm() {
    this.form = this.fb.group({
      name: ["", [Validators.required, Validators.maxLength(100)]],
      slug: [""],
      description: ["", Validators.required],
      max_row_count: ["", Validators.required],
      header_row: ["", Validators.required],
      data_start_row: ["", Validators.required],
      data_end_row: ["", Validators.required],
      is_admin_module: [false],
      ignore_error_rows: [false],
      is_send_mail: [false],
      email_process_slug: ["mail-import"],
      status_id: [1],
      job_type: ["direct"],
      batch_process_count: [50],
      items: this.fb.array([]),
      queries: this.fb.array([])
    });
    this.initLineItemForm();
    this.initLineQueryForm();
  }
  updateFormValidation(entityType) {
    this.form.clearValidators();
    const itemsControl = this.form.get("items");
    const queriesControl = this.form.get("queries");
    this.form.updateValueAndValidity();
  }
  constructRedirectUrl() {
    const currentUrl = this.router.url;
    let updatedUrl = currentUrl.replace(/\/edit\/\d+$/, "");
    this.redirect_url = updatedUrl.replace(/\/add$/, "");
  }
  toggleTheme() {
    this.isDarkTheme = !this.isDarkTheme;
    this.editorOptions = __spreadProps(__spreadValues({}, this.editorOptions), {
      theme: this.isDarkTheme ? "vs-dark" : "vs-light"
    });
  }
  fetchAllTables() {
    this.gridApiService.getAllTables().subscribe((response) => {
      if (response.status && response.code === 200) {
        this.tables_list = response.data;
      }
    }, (error) => {
      const key = "error";
      const errorMessage = this.translate.instant(key);
      this.toastr.error(errorMessage, "Error");
    });
  }
  removeItem(item) {
    const items = this.form.get("items");
    const index = items.controls.findIndex((control) => control.value.field_name === item.field_name);
    if (index !== -1) {
      items.removeAt(index);
      if (this._originalItems && this._originalItems[index]) {
        this._originalItems.splice(index, 1);
      }
      console.log(`Item with field_name: ${item.field_name} removed at index: ${index}`);
    } else {
      this.toastr.warning(`Item with field_name: ${item.field_name} not found.`);
    }
  }
  removeQuery(query) {
    const queries = this.form.get("queries");
    const index = queries.controls.findIndex((control) => control.value.query_name === query.query_name);
    if (index !== -1) {
      queries.removeAt(index);
      if (this._originalQueries && this._originalQueries[index]) {
        this._originalQueries.splice(index, 1);
      }
      console.log(`Query with query_name: ${query.query_name} removed at index: ${index}`);
    } else {
      this.toastr.warning(`Query with query_name: ${query.query_name} not found.`);
    }
  }
  get itemsControls() {
    return this.form.get("items").controls;
  }
  get queriesControls() {
    return this.form.get("queries").controls;
  }
  loadData(id) {
    const params = {
      company_id: 1,
      print_query: true,
      primary_table: "import_templates",
      start_index: 0,
      limit_range: 1,
      sort_columns: [["import_templates.id", "desc"]],
      search_all: [
        {
          column_name: "import_templates.uuid",
          value: id,
          operator: "="
        }
      ],
      select_columns: [
        ["import_templates.*"],
        [
          "CASE WHEN COUNT(import_template_line_items.id) = 0 THEN null ELSE COALESCE(Json_agg(DISTINCT jsonb_build_object('expression_rules', import_template_line_items.expression_rules,'field_name', import_template_line_items.field_name, 'display_name', import_template_line_items.display_name, 'field_table', import_template_line_items.field_table, 'order_no', import_template_line_items.order_no, 'default_value', import_template_line_items.default_value, 'check_reg_exp', import_template_line_items.check_reg_exp, 'is_nullable', import_template_line_items.is_nullable, 'is_unique', import_template_line_items.is_unique, 'is_foreign', import_template_line_items.is_foreign, 'is_multiple', import_template_line_items.is_multiple, 'is_enum', import_template_line_items.is_enum, 'enum_values', import_template_line_items.enum_values,'is_individual', import_template_line_items.is_individual, 'individual_column', import_template_line_items.individual_column, 'foreign_table', import_template_line_items.foreign_table, 'foreign_column', import_template_line_items.foreign_column, 'foreign_can_create', import_template_line_items.foreign_can_create,'foreign_query',import_template_line_items.foreign_query,'unique_query',import_template_line_items.unique_query, 'field_type_id', import_template_line_items.field_type_id))) END",
          "items"
        ],
        [
          "CASE WHEN COUNT(import_template_queries.id) = 0 THEN null ELSE COALESCE(Json_agg(DISTINCT jsonb_build_object('query_string', import_template_queries.query_string,'query_name', import_template_queries.query_name,'allow_multiple', import_template_queries.allow_multiple,'is_individual',import_template_queries.is_individual,'before_lineitems',import_template_queries.before_lineitems, 'order_no', import_template_queries.order_no))) END",
          "queries"
        ]
      ],
      includes: [
        {
          table_name: "import_template_line_items",
          join_type: "LEFT",
          join_condition: `import_templates.id = import_template_line_items.import_template_id`
        },
        {
          table_name: "import_template_queries",
          join_type: "LEFT",
          join_condition: `import_templates.id = import_template_queries.import_template_id`
        }
      ],
      group_by: ["import_templates.id"]
    };
    this.gridApiService.getAllList(params).subscribe((response) => {
      if (response.status && response.code === 200) {
        const entity = response.data.records[0];
        this.form.patchValue({
          name: entity.name,
          slug: entity.slug,
          description: entity.description,
          max_row_count: entity.max_row_count,
          header_row: entity.header_row,
          data_start_row: entity.data_start_row,
          data_end_row: entity.data_end_row,
          ignore_error_rows: entity.ignore_error_rows,
          is_admin_module: entity.is_admin_module,
          is_send_mail: entity.is_send_mail,
          email_process_slug: entity.email_process_slug,
          job_type: entity.job_type,
          batch_process_count: entity.batch_process_count,
          status_id: entity.status_id
        });
        if (entity.is_send_mail) {
          this.showEmailProcessSlug = true;
        }
        const items = this.form.get("items");
        if (entity.items && entity.items.length > 0) {
          this._originalItems = [...entity.items];
          entity.items.forEach((item) => {
            items.push(this.fb.group({
              field_name: [item.field_name, Validators.required],
              display_name: [item.display_name, Validators.required],
              order_no: [item.order_no, [Validators.required, Validators.min(0)]],
              field_table: [item.field_table, Validators.required],
              default_value: [item.default_value],
              check_reg_exp: [item.check_reg_exp],
              is_nullable: [item.is_nullable],
              is_unique: [item.is_unique],
              is_foreign: [item.is_foreign],
              is_multiple: [item.is_multiple],
              is_enum: [item.is_enum],
              enum_values: [item.enum_values],
              is_individual: [item.is_individual],
              individual_column: [item.individual_column],
              foreign_table: [item.foreign_table],
              foreign_column: [item.foreign_column],
              foreign_can_create: [item.foreign_can_create],
              foreign_query: [item.foreign_query],
              unique_query: [item.unique_query],
              expression_rules: this.fb.array((item.expression_rules || []).map((rule) => this.fb.group({
                expression: [rule.expression, Validators.required],
                message: [rule.message, Validators.required]
              }))),
              field_type_id: [item.field_type_id, Validators.required]
            }));
          });
        }
        const queries = this.form.get("queries");
        if (entity.queries && entity.queries.length > 0) {
          this._originalQueries = [...entity.queries];
          entity.queries.forEach((query) => {
            queries.push(this.fb.group({
              query_string: [query.query_string, Validators.required],
              order_no: [query.order_no, [Validators.required, Validators.min(0)]],
              query_name: [query.query_name, Validators.required],
              allow_multiple: [query.allow_multiple],
              is_individual: [query.is_individual],
              before_lineitems: [query.before_lineitems]
            }));
          });
        }
      }
    }, (error) => {
      const key = "error";
      const errorMessage = this.translate.instant(key);
      this.toastr.error(errorMessage, "Error");
    });
  }
  getAddParams(formData) {
    const master = [
      {
        name: formData.name,
        status_id: formData.status_id,
        slug: formData.slug,
        description: formData.description,
        max_row_count: formData.max_row_count,
        header_row: formData.header_row,
        data_start_row: formData.data_start_row,
        data_end_row: formData.data_end_row,
        ignore_error_rows: formData.ignore_error_rows,
        is_admin_module: formData.is_admin_module,
        is_send_mail: formData.is_send_mail,
        email_process_slug: formData.email_process_slug,
        job_type: formData.job_type,
        batch_process_count: formData.batch_process_count
      }
    ];
    if (formData.items && formData.items.length > 0) {
      const items = formData.items.map((item) => ({
        import_template_id: "@table1.id",
        field_name: item.field_name,
        display_name: item.display_name,
        order_no: item.order_no,
        field_table: item.field_table,
        default_value: item.default_value,
        check_reg_exp: item.check_reg_exp,
        is_nullable: item.is_nullable,
        is_unique: item.is_unique,
        is_foreign: item.is_foreign,
        is_multiple: item.is_multiple,
        is_enum: item.is_enum,
        enum_values: item.is_enum ? item.enum_values ? item.enum_values : null : null,
        is_individual: item.is_individual,
        individual_column: item.is_individual ? item.individual_column ? item.individual_column : null : null,
        foreign_table: item.is_foreign ? item.foreign_table ? item.foreign_table : null : null,
        foreign_column: item.is_foreign ? item.foreign_column ? item.foreign_column : null : null,
        foreign_can_create: item.is_foreign ? item.foreign_can_create ? item.foreign_can_create : false : false,
        foreign_query: item.is_foreign ? item.foreign_query ? item.foreign_query : null : null,
        //unique_query: item.is_unique ? (item.unique_query ? item.unique_query : null) : null,
        unique_query: item.unique_query,
        expression_rules: JSON.stringify(item.expression_rules?.map((rule) => ({
          expression: rule.expression,
          message: rule.message
        })) || []),
        field_type_id: item.field_type_id
      }));
      this.insert_json_schema.data["table2"] = items;
    }
    if (formData.queries && formData.queries.length > 0) {
      const queries = formData.queries.map((query) => ({
        import_template_id: "@table1.id",
        query_string: query.query_string,
        order_no: query.order_no,
        query_name: query.query_name,
        allow_multiple: query.allow_multiple,
        is_individual: query.is_individual,
        before_lineitems: query.before_lineitems
      }));
      this.insert_json_schema.data["table3"] = queries;
    }
    this.insert_json_schema.data["table1"] = master;
    return this.insert_json_schema;
  }
  getEditParams(formData, id) {
    const master = [
      {
        name: formData.name,
        status_id: formData.status_id,
        slug: formData.slug,
        description: formData.description,
        max_row_count: formData.max_row_count,
        header_row: formData.header_row,
        data_start_row: formData.data_start_row,
        data_end_row: formData.data_end_row,
        ignore_error_rows: formData.ignore_error_rows,
        is_admin_module: formData.is_admin_module,
        is_send_mail: formData.is_send_mail,
        email_process_slug: formData.email_process_slug,
        job_type: formData.job_type,
        batch_process_count: formData.batch_process_count
      }
    ];
    this.update_json_schema.data["table1"] = master;
    this.update_json_schema.conditions["table1"] = [{ uuid: id }];
    this.update_json_schema.conditions["table2"] = [{ import_template_id: "@table1.id" }];
    this.update_json_schema.conditions["table4"] = [{ import_template_id: "@table1.id" }];
    if (formData.items && formData.items.length > 0) {
      const items = formData.items.map((item) => ({
        import_template_id: "@table1.id",
        field_name: item.field_name,
        display_name: item.display_name,
        order_no: item.order_no,
        field_table: item.field_table,
        default_value: item.default_value,
        check_reg_exp: item.check_reg_exp,
        is_nullable: item.is_nullable,
        is_unique: item.is_unique,
        is_foreign: item.is_foreign,
        is_multiple: item.is_multiple,
        is_enum: item.is_enum,
        enum_values: item.is_enum ? item.enum_values ? item.enum_values : null : null,
        is_individual: item.is_individual,
        individual_column: item.is_individual ? item.individual_column ? item.individual_column : null : null,
        foreign_table: item.is_foreign ? item.foreign_table ? item.foreign_table : null : null,
        foreign_column: item.is_foreign ? item.foreign_column ? item.foreign_column : null : null,
        foreign_can_create: item.is_foreign ? item.foreign_can_create ? item.foreign_can_create : false : false,
        foreign_query: item.is_foreign ? item.foreign_query ? item.foreign_query : null : null,
        //unique_query: item.is_unique ? (item.unique_query ? item.unique_query : null) : null,
        unique_query: item.unique_query,
        expression_rules: JSON.stringify(item.expression_rules?.map((rule) => ({
          expression: rule.expression,
          message: rule.message
        })) || []),
        field_type_id: item.field_type_id
      }));
      this.update_json_schema.data["table3"] = items;
    }
    if (formData.queries && formData.queries.length > 0) {
      const queries = formData.queries.map((query) => ({
        import_template_id: "@table1.id",
        query_string: query.query_string,
        order_no: query.order_no,
        query_name: query.query_name,
        allow_multiple: query.allow_multiple,
        is_individual: query.is_individual,
        before_lineitems: query.before_lineitems
      }));
      this.update_json_schema.data["table5"] = queries;
    }
    return this.update_json_schema;
  }
  prepareJSON(data) {
    return JSON.stringify(JSON.parse(data));
  }
  prettyJSON(data) {
    return JSON.stringify(JSON.parse(JSON.stringify(data).replace(/@table(\w+)/g, "##table$1")), null, 2);
  }
  onSubmit() {
    this.submitted = true;
    const formData = this.form.value;
    const payload = this.id ? this.getEditParams(formData, this.id) : this.getAddParams(formData);
    this.gridApiService.executeRecords(payload).subscribe((response) => {
      if (response.status && response.code === 200) {
        let key;
        if (this.id) {
          key = "record_updated_successfully";
        } else {
          key = "record_inserted_successfully";
        }
        const successMessage = this.translate.instant(key);
        this.toastr.success(successMessage);
        this.router.navigate([this.redirect_url]);
      } else {
        const key = response.message;
        const errorMessage = this.translate.instant(key);
        this.toastr.error(errorMessage, "Error");
      }
    }, (error) => {
      const key = "error";
      const errorMessage = this.translate.instant(key);
      this.toastr.error(errorMessage, "Error");
    });
  }
  isFieldInvalid(fieldName) {
    const field = this.form.get(fieldName);
    return field ? field.invalid && (field.touched || this.submitted) : false;
  }
  isFormInvalid() {
    return this.form.invalid || this.itemsControls.length === 0 || this.queriesControls.length === 0;
  }
  logFormStatus() {
    Object.keys(this.form.controls).forEach((field) => {
      const control = this.form.get(field);
      if (control) {
        console.log(`Field: ${field}, Status: ${control.status}, Errors: ${JSON.stringify(control.errors)}`);
      }
    });
  }
  getErrorMessage(fieldName) {
    const field = this.form.get(fieldName);
    if (field) {
      if (field.hasError("required")) {
        return "required_message";
      }
      if (field.hasError("maxlength")) {
        return `Maximum length exceeded (${field.errors?.["maxlength"].requiredLength} characters allowed)`;
      }
      if (field.hasError("min")) {
        return `Minimum value is ${field.errors?.["min"].min}`;
      }
      if (field.hasError("viewMandatory")) {
        return '"view" option is mandatory';
      }
    }
    return "";
  }
  isItemFieldInvalid(index, fieldName) {
    const items = this.form.get("items");
    const field = items.at(index).get(fieldName);
    return field ? field.invalid && (field.touched || this.submitted) : false;
  }
  isQueryFieldInvalid(index, fieldName) {
    const queries = this.form.get("queries");
    const field = queries.at(index).get(fieldName);
    return field ? field.invalid && (field.touched || this.submitted) : false;
  }
  getItemErrorMessage(index, fieldName) {
    const items = this.form.get("items");
    const field = items.at(index).get(fieldName);
    if (field) {
      if (field.hasError("required")) {
        return "required_message";
      }
      if (field.hasError("maxlength")) {
        return `Maximum length exceeded (${field.errors?.["maxlength"].requiredLength} characters allowed)`;
      }
      if (field.hasError("min")) {
        return `Minimum value is ${field.errors?.["min"].min}`;
      }
    }
    return "";
  }
  getQueryErrorMessage(index, fieldName) {
    const queries = this.form.get("queries");
    const field = queries.at(index).get(fieldName);
    if (field) {
      if (field.hasError("required")) {
        return "required_message";
      }
      if (field.hasError("maxlength")) {
        return `Maximum length exceeded (${field.errors?.["maxlength"].requiredLength} characters allowed)`;
      }
      if (field.hasError("min")) {
        return `Minimum value is ${field.errors?.["min"].min}`;
      }
    }
    return "";
  }
  getLineItemErrorMessage(fieldName) {
    const field = this.lineItemForm.get(fieldName);
    if (field) {
      if (field.hasError("required")) {
        return "required_message";
      }
      if (field.hasError("maxlength")) {
        return `Maximum length exceeded (${field.errors?.["maxlength"].requiredLength} characters allowed)`;
      }
      if (field.hasError("min")) {
        return `Minimum value is ${field.errors?.["min"].min}`;
      }
    }
    return "";
  }
  getQueryItemErrorMessage(fieldName) {
    const field = this.lineQueryForm.get(fieldName);
    if (field) {
      if (field.hasError("required")) {
        return "required_message";
      }
      if (field.hasError("maxlength")) {
        return `Maximum length exceeded (${field.errors?.["maxlength"].requiredLength} characters allowed)`;
      }
      if (field.hasError("min")) {
        return `Minimum value is ${field.errors?.["min"].min}`;
      }
    }
    return "";
  }
  // Items Table Methods
  get itemsData() {
    return this.form.get("items").controls.map((control) => control.value);
  }
  get queriesData() {
    return this.form.get("queries").controls.map((control) => control.value);
  }
  createItemFormGroup(item) {
    return this.fb.group({
      field_name: [item.field_name, Validators.required],
      display_name: [item.display_name, Validators.required],
      order_no: [item.order_no, [Validators.required, Validators.min(0)]],
      field_table: [item.field_table, Validators.required],
      default_value: [item.default_value],
      check_reg_exp: [item.check_reg_exp],
      is_nullable: [item.is_nullable],
      is_unique: [item.is_unique],
      is_foreign: [item.is_foreign],
      is_multiple: [item.is_multiple],
      is_enum: [item.is_enum],
      enum_values: [item.enum_values],
      is_individual: [item.is_individual],
      individual_column: [item.individual_column],
      foreign_table: [item.foreign_table],
      foreign_column: [item.foreign_column],
      foreign_can_create: [item.foreign_can_create],
      foreign_query: [item.foreign_query],
      unique_query: [item.unique_query],
      expression_rules: this.fb.array((item.expression_rules || []).map((rule) => this.fb.group({
        expression: [rule.expression, Validators.required],
        message: [rule.message, Validators.required]
      }))),
      field_type_id: [item.field_type_id, Validators.required]
    });
  }
  createQueryFormGroup(query) {
    return this.fb.group({
      query_string: [query.query_string, Validators.required],
      order_no: [query.order_no, [Validators.required, Validators.min(0)]],
      query_name: [query.query_name, Validators.required],
      allow_multiple: [query.allow_multiple],
      is_individual: [query.is_individual],
      before_lineitems: [query.before_lineitems]
    });
  }
  onItemsDataChange(data) {
    const items = this.form.get("items");
    items.clear();
    const itemsToUse = !data || data.length === 0 ? this._originalItems : data;
    itemsToUse.forEach((item) => {
      items.push(this.createItemFormGroup(item));
    });
  }
  onQueriesDataChange(data) {
    const queries = this.form.get("queries");
    queries.clear();
    const queriesToUse = !data || data.length === 0 ? this._originalQueries : data;
    queriesToUse.forEach((query) => {
      queries.push(this.createQueryFormGroup(query));
    });
  }
  onItemsSortChange(sort) {
    const items = [...this.itemsData];
    items.sort((a, b) => {
      const aVal = a[sort.column];
      const bVal = b[sort.column];
      return sort.direction === "asc" ? aVal > bVal ? 1 : -1 : aVal < bVal ? 1 : -1;
    });
    this.onItemsDataChange(items);
  }
  onQueriesSortChange(sort) {
    const queries = [...this.queriesData];
    queries.sort((a, b) => {
      const aVal = a[sort.column];
      const bVal = b[sort.column];
      return sort.direction === "asc" ? aVal > bVal ? 1 : -1 : aVal < bVal ? 1 : -1;
    });
    this.onQueriesDataChange(queries);
  }
};
_ImportTemplateComponent.\u0275fac = function ImportTemplateComponent_Factory(t) {
  return new (t || _ImportTemplateComponent)(\u0275\u0275directiveInject(FormBuilder), \u0275\u0275directiveInject(GridApiService), \u0275\u0275directiveInject(ToastrService), \u0275\u0275directiveInject(ActivatedRoute), \u0275\u0275directiveInject(Router), \u0275\u0275directiveInject(LocalStorageService), \u0275\u0275directiveInject(Store), \u0275\u0275directiveInject(Location), \u0275\u0275directiveInject(TranslateService), \u0275\u0275directiveInject(Title));
};
_ImportTemplateComponent.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _ImportTemplateComponent, selectors: [["app-import-template"]], viewQuery: function ImportTemplateComponent_Query(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275viewQuery(_c0, 5);
  }
  if (rf & 2) {
    let _t;
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.monacoEditor = _t.first);
  }
}, standalone: true, features: [\u0275\u0275StandaloneFeature], decls: 152, vars: 147, consts: [[3, "formGroup"], [1, "panel"], [1, "flex", "flex-wrap", "justify-between"], [1, "text-md", "font-bold", "uppercase"], [1, "relative", "inline-flex", "align-middle"], ["appDynamicFontSize", "body", "type", "button", 1, "btn", "btn-danger", "mr-5", "ltr:rounded-r", "rtl:rounded-l", 3, "click"], ["appDynamicFontSize", "body", "type", "button", 1, "btn", "btn-outline-secondary", "ltr:rounded-r", "rtl:rounded-l", 3, "click", "disabled"], [1, "my-3", "border-[#e0e6ed]", "dark:border-[#1b2e4b]"], [1, "mt-2"], [1, "flex", "flex-col", "justify-between"], [1, "grid", "grid-cols-1", "gap-2", 3, "ngClass"], [1, "mt-0"], ["for", "name", 1, "required-mark", "mb-2", "block", "font-medium"], ["id", "name", "type", "text", "formControlName", "name", "appDynamicFontSize", "body", 1, "form-input", "w-full", 3, "placeholder", "ngClass"], ["class", "invalid-feedback mt-1 text-danger", 4, "ngIf"], ["for", "slug", 1, "required-mark", "mb-2", "block", "font-medium"], ["id", "slug", "type", "text", "formControlName", "slug", "appDynamicFontSize", "body", 1, "form-input", "w-full", 3, "placeholder", "ngClass"], ["for", "description", 1, "required-mark", "mb-2", "block", "font-medium"], ["id", "description", "type", "text", "formControlName", "description", "appDynamicFontSize", "body", 1, "form-input", "w-full", 3, "placeholder", "ngClass"], ["for", "status_id", 1, "required-mark", "mb-2", "block", "font-medium"], [1, "flex", "items-center", "space-x-4"], [1, "flex", "cursor-pointer", "items-center"], ["type", "radio", "formControlName", "status_id", "appDynamicFontSize", "body", 1, "form-radio", 3, "value"], [1, "ml-2", "text-white-dark"], ["for", "job_type", 1, "required-mark", "mb-2", "block", "font-medium"], ["id", "job_type", "formControlName", "job_type", 1, "form-select", "block", "sm:text-sm"], ["disabled", "", "selected", ""], ["value", "direct"], ["value", "scheduled"], ["class", "mt-0", 4, "ngIf"], [1, "mt-3", "grid", "grid-cols-1", "gap-2", "md:grid-cols-6"], ["for", "max_row_count", 1, "required-mark", "mb-2", "block", "font-medium"], ["id", "max_row_count", "type", "number", "formControlName", "max_row_count", "appDynamicFontSize", "body", 1, "form-input", "w-full", 3, "placeholder", "ngClass"], ["for", "header_row", 1, "required-mark", "mb-2", "block", "font-medium"], ["id", "header_row", "type", "number", "formControlName", "header_row", "appDynamicFontSize", "body", 1, "form-input", "w-full", 3, "placeholder", "ngClass"], ["for", "data_start_row", 1, "required-mark", "mb-2", "block", "font-medium"], ["id", "data_start_row", "type", "number", "formControlName", "data_start_row", "appDynamicFontSize", "body", 1, "form-input", "w-full", 3, "placeholder", "ngClass"], ["for", "data_end_row", 1, "required-mark", "mb-2", "block", "font-medium"], ["id", "data_end_row", "type", "number", "formControlName", "data_end_row", "appDynamicFontSize", "body", 1, "form-input", "w-full", 3, "placeholder", "ngClass"], ["for", "ignore_error_rows", 1, "required-mark", "mb-2", "block", "font-medium"], ["type", "radio", "formControlName", "ignore_error_rows", "appDynamicFontSize", "body", 1, "form-radio", 3, "value"], ["for", "is_admin_module", 1, "required-mark", "mb-2", "block", "font-medium"], ["type", "radio", "formControlName", "is_admin_module", "appDynamicFontSize", "body", 1, "form-radio", 3, "value"], ["for", "is_send_mail", 1, "required-mark", "mb-2", "block", "font-medium"], ["type", "radio", "formControlName", "is_send_mail", "appDynamicFontSize", "body", 1, "form-radio", 3, "change", "value"], [1, "panel", "mt-5"], [3, "dataChange", "sortChange", "data", "config"], ["class", "fixed inset-0 z-50 overflow-y-auto", 4, "ngIf"], [1, "invalid-feedback", "mt-1", "text-danger"], ["for", "batch_process_count", 1, "required-mark", "mb-2", "block", "font-medium"], ["type", "number", "id", "batch_process_count", "formControlName", "batch_process_count", "min", "1", 1, "form-input", "block", "sm:text-sm"], ["for", "email_process_slug", 1, "required-mark", "mb-2", "block", "font-medium"], ["id", "email_process_slug", "formControlName", "email_process_slug", 1, "form-select", "block", "sm:text-sm"], ["disabled", "", "selected", "", "value", ""], [3, "value", 4, "ngFor", "ngForOf"], [3, "value"], [1, "fixed", "inset-0", "z-50", "overflow-y-auto"], [1, "fixed", "inset-0", "bg-black/50", "transition-opacity", "dark:bg-black/70"], [1, "flex", "min-h-screen", "items-center", "justify-center", "p-2", "sm:p-4"], [1, "relative", "w-full", "max-w-4xl", "transform", "overflow-hidden", "rounded-lg", "bg-white", "shadow-xl", "transition-all", "dark:border", "dark:border-gray-700", "dark:bg-gray-800"], [1, "border-b", "bg-gray-50", "px-4", "py-3", "dark:border-gray-700", "dark:bg-gray-900", "sm:px-6"], [1, "flex", "items-center", "justify-between"], [1, "text-base", "font-medium", "text-gray-900", "dark:text-gray-100", "sm:text-lg"], ["type", "button", 1, "rounded-md", "p-2", "text-gray-400", "hover:text-gray-900", "focus:outline-none", "focus:ring-2", "focus:ring-blue-500", "dark:hover:text-gray-100", 3, "click"], [1, "sr-only"], [1, "fa-solid", "fa-xmark"], [1, "px-4", "py-4", "sm:px-6"], [1, "space-y-6", 3, "ngSubmit", "formGroup"], [1, "grid", "grid-cols-1", "gap-x-4", "gap-y-6", "sm:grid-cols-2", "lg:grid-cols-3"], [1, "col-span-1"], ["for", "field_name", 1, "required-mark", "form-label"], [1, "mt-1"], ["id", "field_name", "type", "text", "formControlName", "field_name", 1, "form-input", "w-full", 3, "ngClass"], ["class", "mt-1 text-sm text-red-600 dark:text-red-400", 4, "ngIf"], ["for", "display_name", 1, "required-mark", "form-label"], ["id", "display_name", "type", "text", "formControlName", "display_name", 1, "form-input", "w-full"], ["for", "order_no", 1, "required-mark", "form-label"], ["id", "order_no", "type", "number", "formControlName", "order_no", 1, "form-input", "w-full"], ["for", "field_table", 1, "required-mark", "form-label"], ["id", "field_table", "formControlName", "field_table", 1, "form-select", "block", "sm:text-sm"], ["value", ""], ["for", "field_type_id", 1, "required-mark", "form-label"], ["id", "field_type_id", "formControlName", "field_type_id", 1, "form-select", "block", "sm:text-sm"], ["for", "default_value", 1, "form-label"], ["id", "default_value", "type", "text", "formControlName", "default_value", 1, "form-input", "w-full"], ["for", "check_reg_exp", 1, "form-label"], ["id", "check_reg_exp", "type", "text", "formControlName", "check_reg_exp", 1, "form-input", "w-full"], [1, "space-y-6"], [1, "grid", "grid-cols-1", "gap-4", "sm:grid-cols-2", "lg:grid-cols-3"], [1, "flex", "items-center", "space-x-3"], ["type", "checkbox", "id", "is_nullable", "formControlName", "is_nullable", 1, "form-checkbox", "h-4", "w-4", "rounded", "border-gray-300", "text-blue-600", "focus:ring-blue-500", "dark:border-gray-600", "dark:bg-gray-700"], ["for", "is_nullable", 1, "form-label"], ["type", "checkbox", "id", "is_multiple", "formControlName", "is_multiple", 1, "form-checkbox", "h-4", "w-4", "rounded", "border-gray-300", "text-blue-600", "focus:ring-blue-500", "dark:border-gray-600", "dark:bg-gray-700"], ["for", "is_multiple", 1, "form-label"], [1, "grid", "grid-cols-1", "gap-4", "sm:grid-cols-2"], ["type", "checkbox", "id", "is_enum", "formControlName", "is_enum", 1, "form-checkbox", "h-4", "w-4", "rounded", "border-gray-300", "text-blue-600", "focus:ring-blue-500", "dark:border-gray-600", "dark:bg-gray-700"], ["for", "is_enum", 1, "form-label"], ["class", "col-span-1", 4, "ngIf"], ["type", "checkbox", "id", "is_individual", "formControlName", "is_individual", 1, "form-checkbox", "h-4", "w-4", "rounded", "border-gray-300", "text-blue-600", "focus:ring-blue-500", "dark:border-gray-600", "dark:bg-gray-700"], ["for", "is_individual", 1, "form-label"], ["class", "flex items-center space-x-3", 4, "ngIf"], [1, "space-y-4"], ["type", "checkbox", "id", "is_foreign", "formControlName", "is_foreign", 1, "form-checkbox", "h-4", "w-4", "rounded", "border-gray-300", "text-blue-600", "focus:ring-blue-500", "dark:border-gray-600", "dark:bg-gray-700"], ["for", "is_foreign", 1, "form-label"], ["class", "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3", 4, "ngIf"], ["class", "grid grid-cols-1 gap-4 sm:grid-cols-1 lg:grid-cols-1", 4, "ngIf"], ["type", "checkbox", "id", "is_unique", "formControlName", "is_unique", 1, "form-checkbox", "h-4", "w-4", "rounded", "border-gray-300", "text-blue-600", "focus:ring-blue-500", "dark:border-gray-600", "dark:bg-gray-700"], ["for", "is_unique", 1, "form-label"], [1, "grid", "grid-cols-1", "gap-4", "sm:grid-cols-1", "lg:grid-cols-1"], ["for", "unique_query", 1, "form-label"], ["id", "unique_query", "formControlName", "unique_query", 1, "form-textarea", "block", "sm:text-sm"], [1, "col-span-full"], [1, "form-label"], ["formArrayName", "expression_rules", 4, "ngIf"], ["type", "button", 1, "btn", "btn-sm", "bg-green-600", "text-white", 3, "click"], [1, "sticky", "bottom-0", "flex", "justify-end", "space-x-4", "border-t", "border-gray-200", "bg-white", "px-4", "py-3", "dark:border-gray-700", "dark:bg-gray-800"], ["type", "button", 1, "btn", "rounded-md", "border", "border-gray-300", "bg-white", "px-4", "py-2", "text-sm", "font-medium", "text-gray-700", "shadow-sm", "hover:bg-gray-50", "focus:outline-none", "focus:ring-2", "focus:ring-blue-500", "dark:border-gray-600", "dark:bg-gray-700", "dark:text-gray-300", "dark:hover:bg-gray-600", 3, "click"], ["type", "submit", 1, "btn", "rounded-md", "bg-blue-600", "px-4", "py-2", "text-sm", "font-medium", "text-white", "shadow-sm", "hover:bg-blue-700", "focus:outline-none", "focus:ring-2", "focus:ring-blue-500", "dark:bg-blue-700", "dark:hover:bg-blue-600", 3, "disabled"], [1, "mt-1", "text-sm", "text-red-600", "dark:text-red-400"], ["for", "enum_values", 1, "form-label"], ["id", "enum_values", "type", "text", "formControlName", "enum_values", 1, "form-input", "w-full"], ["for", "individual_column", 1, "form-label"], ["id", "individual_column", "type", "text", "formControlName", "individual_column", 1, "form-input", "w-full"], ["for", "foreign_table", 1, "form-label"], ["id", "foreign_table", "formControlName", "foreign_table", 1, "form-select", "block", "sm:text-sm"], ["for", "foreign_column", 1, "form-label"], ["id", "foreign_column", "type", "text", "formControlName", "foreign_column", 1, "form-input", "w-full"], [1, "col-span-1", "flex", "items-center", "space-x-3"], ["type", "checkbox", "id", "foreign_can_create", "formControlName", "foreign_can_create", 1, "form-checkbox", "h-4", "w-4", "rounded", "border-gray-300", "text-blue-600", "focus:ring-blue-500", "dark:border-gray-600", "dark:bg-gray-700"], ["for", "foreign_can_create", 1, "form-label"], ["for", "foreign_query", 1, "form-label"], ["id", "foreign_query", "formControlName", "foreign_query", 1, "form-textarea", "block", "sm:text-sm"], ["formArrayName", "expression_rules"], ["class", "mb-3 grid grid-cols-2 gap-4", 3, "formGroupName", 4, "ngFor", "ngForOf"], [1, "mb-3", "grid", "grid-cols-2", "gap-4", 3, "formGroupName"], ["type", "text", "formControlName", "expression", "placeholder", "Expression", 1, "form-input"], ["type", "text", "formControlName", "message", "placeholder", "Validation message", 1, "form-input"], [1, "col-span-2", "text-right"], ["type", "button", 1, "text-sm", "text-red-600", 3, "click"], [1, "max-h-[calc(90vh-10rem)]", "overflow-y-auto", "px-4", "py-4", "sm:px-6"], [1, "space-y-4", 3, "ngSubmit", "formGroup"], [1, "grid", "grid-cols-1", "gap-4", "sm:grid-cols-2", "lg:grid-cols-5"], [1, "space-y-2"], ["for", "query_name", 1, "required-mark", "form-label"], ["id", "query_name", "type", "text", "formControlName", "query_name", 1, "form-input", "w-full"], ["type", "checkbox", "id", "allow_multiple", "formControlName", "allow_multiple", 1, "form-checkbox", "h-5", "w-5", "rounded", "border-gray-300", "text-blue-600", "focus:ring-blue-500", "dark:border-gray-600", "dark:bg-gray-700"], ["for", "allow_multiple", 1, "form-label"], ["type", "checkbox", "id", "is_individual", "formControlName", "is_individual", 1, "form-checkbox", "h-5", "w-5", "rounded", "border-gray-300", "text-blue-600", "focus:ring-blue-500", "dark:border-gray-600", "dark:bg-gray-700"], ["type", "checkbox", "id", "before_lineitems", "formControlName", "before_lineitems", 1, "form-checkbox", "h-5", "w-5", "rounded", "border-gray-300", "text-blue-600", "focus:ring-blue-500", "dark:border-gray-600", "dark:bg-gray-700"], ["for", "before_lineitems", 1, "form-label"], ["for", "query_string", 1, "required-mark", "form-label"], ["id", "query_string", "formControlName", "query_string", "rows", "17", 1, "form-textarea"]], template: function ImportTemplateComponent_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 0)(1, "div", 1)(2, "div", 2)(3, "div", 3);
    \u0275\u0275text(4);
    \u0275\u0275pipe(5, "translate");
    \u0275\u0275pipe(6, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(7, "div", 4)(8, "button", 5);
    \u0275\u0275listener("click", function ImportTemplateComponent_Template_button_click_8_listener() {
      return ctx.location.back();
    });
    \u0275\u0275text(9);
    \u0275\u0275pipe(10, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(11, "button", 6);
    \u0275\u0275listener("click", function ImportTemplateComponent_Template_button_click_11_listener() {
      return ctx.onSubmit();
    });
    \u0275\u0275text(12);
    \u0275\u0275pipe(13, "translate");
    \u0275\u0275elementEnd()()();
    \u0275\u0275element(14, "hr", 7);
    \u0275\u0275elementStart(15, "div", 8)(16, "div", 9)(17, "div", 10)(18, "div", 11)(19, "label", 12);
    \u0275\u0275text(20);
    \u0275\u0275pipe(21, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275element(22, "input", 13);
    \u0275\u0275pipe(23, "translate");
    \u0275\u0275template(24, ImportTemplateComponent_div_24_Template, 2, 1, "div", 14);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(25, "div", 11)(26, "label", 15);
    \u0275\u0275text(27);
    \u0275\u0275pipe(28, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275element(29, "input", 16);
    \u0275\u0275pipe(30, "translate");
    \u0275\u0275template(31, ImportTemplateComponent_div_31_Template, 2, 1, "div", 14);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(32, "div", 11)(33, "label", 17);
    \u0275\u0275text(34);
    \u0275\u0275pipe(35, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275element(36, "input", 18);
    \u0275\u0275pipe(37, "translate");
    \u0275\u0275template(38, ImportTemplateComponent_div_38_Template, 2, 1, "div", 14);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(39, "div", 11)(40, "label", 19);
    \u0275\u0275text(41);
    \u0275\u0275pipe(42, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(43, "div", 20)(44, "label", 21);
    \u0275\u0275element(45, "input", 22);
    \u0275\u0275elementStart(46, "span", 23);
    \u0275\u0275text(47);
    \u0275\u0275pipe(48, "translate");
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(49, "label", 21);
    \u0275\u0275element(50, "input", 22);
    \u0275\u0275elementStart(51, "span", 23);
    \u0275\u0275text(52);
    \u0275\u0275pipe(53, "translate");
    \u0275\u0275elementEnd()()();
    \u0275\u0275template(54, ImportTemplateComponent_div_54_Template, 2, 1, "div", 14);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(55, "div", 11)(56, "label", 24);
    \u0275\u0275text(57);
    \u0275\u0275pipe(58, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(59, "select", 25)(60, "option", 26);
    \u0275\u0275text(61, "Select Import Job");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(62, "option", 27);
    \u0275\u0275text(63, "Direct");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(64, "option", 28);
    \u0275\u0275text(65, "Scheduled");
    \u0275\u0275elementEnd()();
    \u0275\u0275template(66, ImportTemplateComponent_div_66_Template, 2, 1, "div", 14);
    \u0275\u0275elementEnd();
    \u0275\u0275template(67, ImportTemplateComponent_div_67_Template, 4, 0, "div", 29);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(68, "div", 30)(69, "div", 11)(70, "label", 31);
    \u0275\u0275text(71);
    \u0275\u0275pipe(72, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275element(73, "input", 32);
    \u0275\u0275pipe(74, "translate");
    \u0275\u0275template(75, ImportTemplateComponent_div_75_Template, 2, 1, "div", 14);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(76, "div", 11)(77, "label", 33);
    \u0275\u0275text(78);
    \u0275\u0275pipe(79, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275element(80, "input", 34);
    \u0275\u0275pipe(81, "translate");
    \u0275\u0275template(82, ImportTemplateComponent_div_82_Template, 2, 1, "div", 14);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(83, "div", 11)(84, "label", 35);
    \u0275\u0275text(85);
    \u0275\u0275pipe(86, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275element(87, "input", 36);
    \u0275\u0275pipe(88, "translate");
    \u0275\u0275template(89, ImportTemplateComponent_div_89_Template, 2, 1, "div", 14);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(90, "div", 11)(91, "label", 37);
    \u0275\u0275text(92);
    \u0275\u0275pipe(93, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275element(94, "input", 38);
    \u0275\u0275pipe(95, "translate");
    \u0275\u0275template(96, ImportTemplateComponent_div_96_Template, 2, 1, "div", 14);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(97, "div", 11)(98, "label", 39);
    \u0275\u0275text(99);
    \u0275\u0275pipe(100, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(101, "div", 20)(102, "label", 21);
    \u0275\u0275element(103, "input", 40);
    \u0275\u0275elementStart(104, "span", 23);
    \u0275\u0275text(105);
    \u0275\u0275pipe(106, "translate");
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(107, "label", 21);
    \u0275\u0275element(108, "input", 40);
    \u0275\u0275elementStart(109, "span", 23);
    \u0275\u0275text(110);
    \u0275\u0275pipe(111, "translate");
    \u0275\u0275elementEnd()()();
    \u0275\u0275template(112, ImportTemplateComponent_div_112_Template, 2, 1, "div", 14);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(113, "div", 11)(114, "label", 41);
    \u0275\u0275text(115);
    \u0275\u0275pipe(116, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(117, "div", 20)(118, "label", 21);
    \u0275\u0275element(119, "input", 42);
    \u0275\u0275elementStart(120, "span", 23);
    \u0275\u0275text(121);
    \u0275\u0275pipe(122, "translate");
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(123, "label", 21);
    \u0275\u0275element(124, "input", 42);
    \u0275\u0275elementStart(125, "span", 23);
    \u0275\u0275text(126);
    \u0275\u0275pipe(127, "translate");
    \u0275\u0275elementEnd()()();
    \u0275\u0275template(128, ImportTemplateComponent_div_128_Template, 2, 1, "div", 14);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(129, "div", 11)(130, "label", 43);
    \u0275\u0275text(131);
    \u0275\u0275pipe(132, "translate");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(133, "div", 20)(134, "label", 21)(135, "input", 44);
    \u0275\u0275listener("change", function ImportTemplateComponent_Template_input_change_135_listener() {
      return ctx.toggleEmailProcessSlug(true);
    });
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(136, "span", 23);
    \u0275\u0275text(137);
    \u0275\u0275pipe(138, "translate");
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(139, "label", 21)(140, "input", 44);
    \u0275\u0275listener("change", function ImportTemplateComponent_Template_input_change_140_listener() {
      return ctx.toggleEmailProcessSlug(false);
    });
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(141, "span", 23);
    \u0275\u0275text(142);
    \u0275\u0275pipe(143, "translate");
    \u0275\u0275elementEnd()()();
    \u0275\u0275template(144, ImportTemplateComponent_div_144_Template, 2, 1, "div", 14);
    \u0275\u0275elementEnd();
    \u0275\u0275template(145, ImportTemplateComponent_div_145_Template, 9, 5, "div", 29);
    \u0275\u0275elementEnd()()()();
    \u0275\u0275elementStart(146, "div", 45)(147, "app-client-datatable", 46);
    \u0275\u0275listener("dataChange", function ImportTemplateComponent_Template_app_client_datatable_dataChange_147_listener($event) {
      return ctx.onItemsDataChange($event);
    })("sortChange", function ImportTemplateComponent_Template_app_client_datatable_sortChange_147_listener($event) {
      return ctx.onItemsSortChange($event);
    });
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(148, "div", 45)(149, "app-client-datatable", 46);
    \u0275\u0275listener("dataChange", function ImportTemplateComponent_Template_app_client_datatable_dataChange_149_listener($event) {
      return ctx.onQueriesDataChange($event);
    })("sortChange", function ImportTemplateComponent_Template_app_client_datatable_sortChange_149_listener($event) {
      return ctx.onQueriesSortChange($event);
    });
    \u0275\u0275elementEnd()()();
    \u0275\u0275template(150, ImportTemplateComponent_div_150_Template, 128, 68, "div", 47)(151, ImportTemplateComponent_div_151_Template, 55, 33, "div", 47);
  }
  if (rf & 2) {
    let tmp_5_0;
    let tmp_26_0;
    \u0275\u0275property("formGroup", ctx.form);
    \u0275\u0275advance(4);
    \u0275\u0275textInterpolate(ctx.editTitle ? \u0275\u0275pipeBind1(5, 68, "title_edit_import_template") : \u0275\u0275pipeBind1(6, 70, "title_add_import_template"));
    \u0275\u0275advance(5);
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(10, 72, "back"), " ");
    \u0275\u0275advance(2);
    \u0275\u0275property("disabled", ctx.isFormInvalid());
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", \u0275\u0275pipeBind1(13, 74, "submit"), " ");
    \u0275\u0275advance(5);
    \u0275\u0275property("ngClass", \u0275\u0275pureFunction2(130, _c1, ((tmp_5_0 = ctx.form.get("job_type")) == null ? null : tmp_5_0.value) === "scheduled", ((tmp_5_0 = ctx.form.get("job_type")) == null ? null : tmp_5_0.value) !== "scheduled"));
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(21, 76, "form_label_name"));
    \u0275\u0275advance(2);
    \u0275\u0275propertyInterpolate("placeholder", \u0275\u0275pipeBind1(23, 78, "form_label_name_placeholder"));
    \u0275\u0275property("ngClass", \u0275\u0275pureFunction1(133, _c2, ctx.isFieldInvalid("name")));
    \u0275\u0275advance(2);
    \u0275\u0275property("ngIf", ctx.isFieldInvalid("name"));
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(28, 80, "form_label_slug"));
    \u0275\u0275advance(2);
    \u0275\u0275propertyInterpolate("placeholder", \u0275\u0275pipeBind1(30, 82, "form_label_slug_placeholder"));
    \u0275\u0275property("ngClass", \u0275\u0275pureFunction1(135, _c2, ctx.isFieldInvalid("slug")));
    \u0275\u0275advance(2);
    \u0275\u0275property("ngIf", ctx.isFieldInvalid("slug"));
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(35, 84, "form_label_description"));
    \u0275\u0275advance(2);
    \u0275\u0275propertyInterpolate("placeholder", \u0275\u0275pipeBind1(37, 86, "form_label_description_placeholder"));
    \u0275\u0275property("ngClass", \u0275\u0275pureFunction1(137, _c2, ctx.isFieldInvalid("description")));
    \u0275\u0275advance(2);
    \u0275\u0275property("ngIf", ctx.isFieldInvalid("description"));
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(42, 88, "form_label_status"));
    \u0275\u0275advance(4);
    \u0275\u0275property("value", 1);
    \u0275\u0275advance(2);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(48, 90, "table_status_val_0"));
    \u0275\u0275advance(3);
    \u0275\u0275property("value", 2);
    \u0275\u0275advance(2);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(53, 92, "table_status_val_1"));
    \u0275\u0275advance(2);
    \u0275\u0275property("ngIf", ctx.isFieldInvalid("status_id"));
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(58, 94, "form_label_job_type"));
    \u0275\u0275advance(9);
    \u0275\u0275property("ngIf", ctx.isFieldInvalid("job_type"));
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", ((tmp_26_0 = ctx.form.get("job_type")) == null ? null : tmp_26_0.value) === "scheduled");
    \u0275\u0275advance(4);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(72, 96, "form_label_max_row_count"));
    \u0275\u0275advance(2);
    \u0275\u0275propertyInterpolate("placeholder", \u0275\u0275pipeBind1(74, 98, "form_label_max_row_count_placeholder"));
    \u0275\u0275property("ngClass", \u0275\u0275pureFunction1(139, _c2, ctx.isFieldInvalid("max_row_count")));
    \u0275\u0275advance(2);
    \u0275\u0275property("ngIf", ctx.isFieldInvalid("max_row_count"));
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(79, 100, "form_label_header_row"));
    \u0275\u0275advance(2);
    \u0275\u0275propertyInterpolate("placeholder", \u0275\u0275pipeBind1(81, 102, "form_label_header_row_placeholder"));
    \u0275\u0275property("ngClass", \u0275\u0275pureFunction1(141, _c2, ctx.isFieldInvalid("header_row")));
    \u0275\u0275advance(2);
    \u0275\u0275property("ngIf", ctx.isFieldInvalid("header_row"));
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(86, 104, "form_label_data_start_row"));
    \u0275\u0275advance(2);
    \u0275\u0275propertyInterpolate("placeholder", \u0275\u0275pipeBind1(88, 106, "form_label_data_start_row_placeholder"));
    \u0275\u0275property("ngClass", \u0275\u0275pureFunction1(143, _c2, ctx.isFieldInvalid("data_start_row")));
    \u0275\u0275advance(2);
    \u0275\u0275property("ngIf", ctx.isFieldInvalid("data_start_row"));
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(93, 108, "form_label_data_end_row"));
    \u0275\u0275advance(2);
    \u0275\u0275propertyInterpolate("placeholder", \u0275\u0275pipeBind1(95, 110, "form_label_data_end_row_placeholder"));
    \u0275\u0275property("ngClass", \u0275\u0275pureFunction1(145, _c2, ctx.isFieldInvalid("data_end_row")));
    \u0275\u0275advance(2);
    \u0275\u0275property("ngIf", ctx.isFieldInvalid("data_end_row"));
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(100, 112, "form_label_ignore_error_rows"));
    \u0275\u0275advance(4);
    \u0275\u0275property("value", true);
    \u0275\u0275advance(2);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(106, 114, "table_status_val_0"));
    \u0275\u0275advance(3);
    \u0275\u0275property("value", false);
    \u0275\u0275advance(2);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(111, 116, "table_status_val_1"));
    \u0275\u0275advance(2);
    \u0275\u0275property("ngIf", ctx.isFieldInvalid("ignore_error_rows"));
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(116, 118, "form_label_is_admin_module"));
    \u0275\u0275advance(4);
    \u0275\u0275property("value", true);
    \u0275\u0275advance(2);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(122, 120, "table_status_val_0"));
    \u0275\u0275advance(3);
    \u0275\u0275property("value", false);
    \u0275\u0275advance(2);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(127, 122, "table_status_val_1"));
    \u0275\u0275advance(2);
    \u0275\u0275property("ngIf", ctx.isFieldInvalid("is_admin_module"));
    \u0275\u0275advance(3);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(132, 124, "form_label_is_sendmail"));
    \u0275\u0275advance(4);
    \u0275\u0275property("value", true);
    \u0275\u0275advance(2);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(138, 126, "table_status_val_0"));
    \u0275\u0275advance(3);
    \u0275\u0275property("value", false);
    \u0275\u0275advance(2);
    \u0275\u0275textInterpolate(\u0275\u0275pipeBind1(143, 128, "table_status_val_1"));
    \u0275\u0275advance(2);
    \u0275\u0275property("ngIf", ctx.isFieldInvalid("is_send_mail"));
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", ctx.showEmailProcessSlug);
    \u0275\u0275advance(2);
    \u0275\u0275property("data", ctx.itemsData)("config", ctx.itemsTableConfig);
    \u0275\u0275advance(2);
    \u0275\u0275property("data", ctx.queriesData)("config", ctx.queriesTableConfig);
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", ctx.isItemModalOpen);
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", ctx.isQueryModalOpen);
  }
}, dependencies: [
  CommonSharedModule,
  NgClass,
  NgForOf,
  NgIf,
  \u0275NgNoValidate,
  NgSelectOption,
  \u0275NgSelectMultipleOption,
  DefaultValueAccessor,
  NumberValueAccessor,
  CheckboxControlValueAccessor,
  SelectControlValueAccessor,
  RadioControlValueAccessor,
  NgControlStatus,
  NgControlStatusGroup,
  MinValidator,
  DynamicFontSizeDirective,
  TranslatePipe,
  MonacoEditorModule,
  ReactiveFormsModule,
  FormGroupDirective,
  FormControlName,
  FormGroupName,
  FormArrayName,
  ClientDatatableComponent
], styles: ["\n\n.monaco-editor-container[_ngcontent-%COMP%] {\n  display: flex;\n  flex-direction: column;\n  height: 50vh;\n  resize: vertical;\n  overflow: auto;\n  min-height: 60vh;\n  max-height: 100vh;\n}\n.monaco-editor[_ngcontent-%COMP%] {\n  flex: 1;\n  width: 100%;\n}\n/*# sourceMappingURL=import-template.component.css.map */"], data: { animation: [
  trigger("toggleAnimation", [
    transition(":enter", [style({ opacity: 0, transform: "scale(0.95)" }), animate("100ms ease-out", style({ opacity: 1, transform: "scale(1)" }))]),
    transition(":leave", [animate("75ms", style({ opacity: 0, transform: "scale(0.95)" }))])
  ])
] } });
var ImportTemplateComponent = _ImportTemplateComponent;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(ImportTemplateComponent, { className: "ImportTemplateComponent", filePath: "src\\app\\@lcp-framework\\pages\\import-template\\import-template.component.ts", lineNumber: 93 });
})();
export {
  ImportTemplateComponent,
  viewMandatoryValidator
};
//# sourceMappingURL=chunk-R7H655GG.js.map
