Guest User

Untitled

a guest
Oct 24th, 2017
553
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 293.98 KB | None | 0 0
  1. function activateTab(e, a) {
  2. "use strict";
  3. for (var t = 0; t < e.length; t++) e[t] = !1;
  4. return e[a] = !0, e
  5. }
  6. var calcu_slope = function(x, y, avg_x, avg_y) {
  7. var a = 0,
  8. b = 0;
  9. for (var i = 0; i < x.length; i++) {
  10. a += (x[i] - avg_x) * (x[i] - avg_x);
  11. b += (x[i] - avg_x) * (y[i] - avg_y);
  12. }
  13. return b / a;
  14. };
  15. var calcu_steyx = function(x, y, avg_x, avg_y) {
  16. var a = 0,
  17. b = 0,
  18. c = 0;
  19. for (var i = 0; i < x.length; i++) {
  20. a += (x[i] - avg_x) * (x[i] - avg_x);
  21. b += (y[i] - avg_y) * (y[i] - avg_y);
  22. c += (x[i] - avg_x) * (y[i] - avg_y);
  23. }
  24.  
  25. return Math.sqrt((b - c * c / a) / (x.length - 2));
  26. };
  27. var calcu_rsq = function(x, y, avg_x, avg_y) {
  28. var a = 0,
  29. b = 0,
  30. c = 0;
  31. for (var i = 0; i < x.length; i++) {
  32. a += (x[i] - avg_x) * (x[i] - avg_x);
  33. b += (y[i] - avg_y) * (y[i] - avg_y);
  34. c += (x[i] - avg_x) * (y[i] - avg_y);
  35. }
  36.  
  37. return c / Math.sqrt(a * b);
  38. };
  39. var add_calcu_record = function() {
  40. var x = [],
  41. y = [],
  42. input_x, input_y;
  43. for (var i = 0;; i++) {
  44. input_x = document.getElementById("input_x_" + i);
  45. input_y = document.getElementById("input_y_" + i);
  46. if (input_x == null || input_y == null || input_x == undefined || input_y == undefined || input_x.value == "" || input_y.value == "")
  47. break;
  48. x.push(parseInt(input_x.value));
  49. y.push(parseInt(input_y.value));
  50. }
  51. var new_id = x.length;
  52. var new_row = "<tr>\n" +
  53. "<td>" + (new_id + 1) + "</td>\n" +
  54. "<td><input type=\"number\" id=\"input_x_" + new_id + "\" value=\"1\" onchange=\"calcu_regression()\"></td>\n" +
  55. "<td><input type=\"number\" id=\"input_y_" + new_id + "\" value=\"1\" onchange=\"calcu_regression()\"></td>\n" +
  56. "</tr>";
  57. var org_html = document.getElementById("regression_inputs").innerHTML;
  58. document.getElementById("regression_inputs").innerHTML = org_html + new_row;
  59. calcu_regression();
  60. };
  61. var del_calcu_record = function() {
  62. var x = [],
  63. y = [],
  64. input_x, input_y;
  65. for (var i = 0;; i++) {
  66. input_x = document.getElementById("input_x_" + i);
  67. input_y = document.getElementById("input_y_" + i);
  68. if (input_x == null || input_y == null || input_x == undefined || input_y == undefined || input_x.value == "" || input_y.value == "")
  69. break;
  70. x.push(parseInt(input_x.value));
  71. y.push(parseInt(input_y.value));
  72. }
  73. var new_id = x.length;
  74. var new_row = "";
  75. for (var i = 0; i < x.length - 1; i++) {
  76. new_row += "<tr>\n" +
  77. "<td>5</td>\n" +
  78. "<td><input type=\"number\" id=\"input_x_" + i + "\" value=\"" + x[i] + "\" onchange=\"calcu_regression()\"></td>\n" +
  79. "<td><input type=\"number\" id=\"input_y_" + i + "\" value=\"" + y[i] + "\" onchange=\"calcu_regression()\"></td>\n" +
  80. "</tr>";
  81. }
  82. document.getElementById("regression_inputs").innerHTML = new_row;
  83. calcu_regression();
  84. };
  85. var calcu_regression = function() {
  86. var x = [],
  87. y = [],
  88. sum_x = 0,
  89. sum_y = 0,
  90. input_x, input_y;
  91. for (var i = 0;; i++) {
  92. input_x = document.getElementById("input_x_" + i);
  93. input_y = document.getElementById("input_y_" + i);
  94. if (input_x == null || input_y == null || input_x == undefined || input_y == undefined || input_x.value == "" || input_y.value == "")
  95. break;
  96. x.push(parseInt(input_x.value));
  97. y.push(parseInt(input_y.value));
  98. sum_x += parseInt(input_x.value);
  99. sum_y += parseInt(input_y.value);
  100. }
  101. if (x.length < 3) return;
  102. var avg_x = sum_x / x.length;
  103. var avg_y = sum_y / y.length;
  104. var c = [],
  105. d = [],
  106. sum_c = 0;
  107. var hh_coeff = calcu_slope(x, y, avg_x, avg_y);
  108. var intercept_coeff = avg_y - hh_coeff * avg_x;
  109. var std_error = calcu_steyx(x, y, avg_x, avg_y);
  110. var multiple_r = calcu_rsq(x, y, avg_x, avg_y);
  111. var r_square = multiple_r * multiple_r;
  112.  
  113. for (var i = 0; i < x.length; i++) {
  114. c.push((x[i] - avg_x) * (x[i] - avg_x));
  115. d.push(intercept_coeff + hh_coeff * x[i]);
  116. sum_c += (x[i] - avg_x) * (x[i] - avg_x);
  117. }
  118.  
  119. var intercept_stderr = Math.sqrt(avg_x * avg_x / sum_c + 1 / x.length) * std_error;
  120. var hh_stderr = Math.sqrt(std_error * std_error / sum_c);
  121. var intercept_tstat = intercept_coeff / intercept_stderr;
  122. var hh_tstat = hh_coeff / hh_stderr;
  123.  
  124. var regression_df = 1;
  125. var residual_df = x.length - 2;
  126. var total_df = x.length - 1;
  127. var regression_ss = 0;
  128. var residual_ss = 0;
  129. var total_ss = 0;
  130. for (var i = 0; i < d.length; i++) {
  131. regression_ss += (d[i] - avg_y) * (d[i] - avg_y);
  132. residual_ss += (y[i] - d[i]) * (y[i] - d[i]);
  133. total_ss += (y[i] - avg_y) * (y[i] - avg_y);
  134. }
  135. var regression_ms = regression_ss / regression_df;
  136. var residual_ms = residual_ss / residual_df;
  137. var regression_f = regression_ms / residual_ms;
  138. var ad_r_square = 1 - residual_ms / (total_ss / total_df);
  139. var intercept_lower = intercept_coeff - 3.18244631 * intercept_stderr;
  140. var intercept_upper = intercept_coeff + 3.18244631 * intercept_stderr;
  141. var hh_lower = hh_coeff - 3.18244631 * hh_stderr;
  142. var hh_upper = hh_coeff + 3.18244631 * hh_stderr;
  143.  
  144. document.getElementById("r_square").innerHTML = r_square;
  145. document.getElementById("multiple_r").innerHTML = multiple_r;
  146. document.getElementById("ad_r_square").innerHTML = ad_r_square;
  147. document.getElementById("observations").innerHTML = x.length;
  148. document.getElementById("hh_coeff").innerHTML = hh_coeff;
  149. document.getElementById("intercept_coeff").innerHTML = intercept_coeff;
  150. document.getElementById("std_error").innerHTML = std_error;
  151. document.getElementById("intercept_stderr").innerHTML = intercept_stderr;
  152. document.getElementById("hh_stderr").innerHTML = hh_stderr;
  153. document.getElementById("intercept_tstat").innerHTML = intercept_tstat;
  154. document.getElementById("hh_tstat").innerHTML = hh_tstat;
  155. document.getElementById("regression_df").innerHTML = regression_df;
  156. document.getElementById("residual_df").innerHTML = residual_df;
  157. document.getElementById("total_df").innerHTML = total_df;
  158. document.getElementById("regression_ss").innerHTML = regression_ss;
  159. document.getElementById("residual_ss").innerHTML = residual_ss;
  160. document.getElementById("total_ss").innerHTML = total_ss;
  161. document.getElementById("regression_ms").innerHTML = regression_ms;
  162. document.getElementById("residual_ms").innerHTML = residual_ms;
  163. document.getElementById("regression_f").innerHTML = regression_f;
  164. document.getElementById("intercept_lower").innerHTML = intercept_lower;
  165. document.getElementById("intercept_upper").innerHTML = intercept_upper;
  166. document.getElementById("hh_lower").innerHTML = hh_lower;
  167. document.getElementById("hh_upper").innerHTML = hh_upper;
  168. };
  169.  
  170. function loadCharter(e) {
  171. "use strict";
  172. var a = {};
  173. return e && (a = e.currentProject), {
  174. Id: a.Id,
  175. Name: a.Name,
  176. DateTimeCreated: new Date(a.DateTimeCreated),
  177. BusinessUnit: a.BusinessUnit,
  178. Sponsor: [],
  179. Location: a.Location,
  180. Lead: [],
  181. Type: a.Type,
  182. BusinessImpact: a.BusinessImpact,
  183. BusinessImpactValue: a.BusinessImpactValue,
  184. ProblemStatement: a.ProblemStatement,
  185. Goals: a.Goals,
  186. Scope: a.Scope,
  187. stakeholders: [],
  188. CoreTeam: [],
  189. gateReviewDefine: {
  190. status: {
  191. opened: !1
  192. },
  193. val: a.DefineReviewDate ? new Date(a.DefineReviewDate) : ""
  194. },
  195. gateReviewMeasure: {
  196. status: {
  197. opened: !1
  198. },
  199. val: a.MeasureReviewDate ? new Date(a.MeasureReviewDate) : ""
  200. },
  201. gateReviewImprove: {
  202. status: {
  203. opened: !1
  204. },
  205. val: a.ImproveReviewDate ? new Date(a.ImproveReviewDate) : ""
  206. },
  207. gateReviewControl: {
  208. status: {
  209. opened: !1
  210. },
  211. val: a.ControlReviewDate ? new Date(a.ControlReviewDate) : ""
  212. },
  213. gateReviewAnalyze: {
  214. status: {
  215. opened: !1
  216. },
  217. val: a.AnalyzeReviewDate ? new Date(a.AnalyzeReviewDate) : ""
  218. }
  219. }
  220. }
  221.  
  222.  
  223. function populateMdContactVariable(e, a) {
  224. "use strict";
  225. var t = [];
  226. e instanceof Array || (e = [e]);
  227. for (var o = 0; e && o < e.length; o++) e[o] = parseInt(e[o]);
  228. for (var o = 0; a && o < a.length; o++) - 1 !== e.indexOf(parseInt(a[o].id)) && t.push(a[o]);
  229. return t
  230. }
  231.  
  232. function loadWalkthrough() {
  233. "use strict";
  234. var e = {},
  235. a = "",
  236. t = 0;
  237. return angular.forEach(document.querySelectorAll(".l6_step"), function(o, r) {
  238. a !== $(o).parent().attr("data-phase-component") && (a = $(o).parent().attr("data-phase-component"), t = 0), e[a] || (e[a] = {
  239. steps: [],
  240. currentStep: 0
  241. }), $(o).hasClass("l6_spacer") || (e[a].steps.push(o), $(o).attr("data-step", t), t > 0 && $(o).hide(), t++)
  242. }), e
  243. }
  244.  
  245. function validateField(e, a) {
  246. "use strict";
  247. var t = $(e).closest(".l6_step").attr("data-step"),
  248. o = $(e).closest(".l6_step").attr("data-step-required"),
  249. r = !0;
  250. if (o) {
  251. o = o.split(",");
  252. for (var n = 0; o && n < o.length; n++)
  253. if (o[n].indexOf(".")) {
  254. for (var i = o[n].split("."), s = a, l = 0; i && l < i.length; l++) s = s[i[l]];
  255. s || (r = !1)
  256. } else a[o[n]] || (r = !1)
  257. }
  258. return {
  259. currentStep: parseInt(t),
  260. isVerified: r
  261. }
  262. }
  263.  
  264. function moveNextStep(e) {
  265. "use strict";
  266. if (e.steps[e.currentStep + 1]) {
  267. e.currentStep += 1;
  268. var a = $(e.steps[e.currentStep]);
  269. a.parent();
  270. $(a).show(), setTimeout(function() {
  271. $("body").animate({
  272. scrollTop: a.offset().top - 260
  273. }, "slow")
  274. }, 100)
  275. }
  276. return console.log("MOVING NEXT STEP"), console.log(e), e
  277. }
  278.  
  279. function resetWalkthrough(e) {
  280. "use strict";
  281. for (var a = 1; a < e.steps.length; a++) $(e.steps[a]).hide();
  282. return e.currentStep = 0, e
  283. }
  284.  
  285. function completePhaseComponent(e, a, t, o, r) {
  286. "use strict";
  287. var n = o.getPhaseComponentDetail(e, a),
  288. i = {};
  289. i.Status = "working" === n.Status ? "complete" : "working";
  290. var s = [o.buildFilter("Id", null, "is", n.Id)];
  291. o.sync(o.buildRequest("update", ["phasecomponents"], null, [s], [i]), function(e) {
  292. e.success ? o.updatePhaseComponentDetail(n.ProjectId, function(e) {
  293. r(e)
  294. }) : r(e)
  295. })
  296. }
  297.  
  298. function saveCharter(e, a, t, o, r) {
  299. "use strict";
  300. var n = angular.copy(e),
  301. i = n.stakeholders;
  302. delete n.stakeholders, n.Sponsor = n.Sponsor[0] ? n.Sponsor[0].id : null, n.Lead = n.Lead[0] ? n.Lead[0].id : null;
  303. for (var s = [], l = 0; n.CoreTeam && l < n.CoreTeam.length; l++) s.push(n.CoreTeam[l].id);
  304. n.CoreTeam = JSON.stringify(s), n.DefineReviewDate = n.gateReviewDefine.val, n.MeasureReviewDate = n.gateReviewMeasure.val, n.AnalyzeReviewDate = n.gateReviewAnalyze.val, n.ImproveReviewDate = n.gateReviewImprove.val, n.ControlReviewDate = n.gateReviewControl.val, n.BusinessImpactValue = n.BusinessImpactValue || 0;
  305. n.Id;
  306. delete n.Id, delete n.PhaseData, delete n.DateTimeCreated, delete n.LastUpdated, delete n.CreatedBy, delete n.CompletionPercentage, delete n.gateReviewDefine, delete n.gateReviewMeasure, delete n.gateReviewAnalyze, delete n.gateReviewImprove, delete n.gateReviewControl;
  307. var c = null;
  308. "add" !== a && (c = [t.buildFilter("Id", null, "is", e.Id)]), t.sync(t.buildRequest(a, ["projects"], null, c, [n]), function(e) {
  309. e.success ? "add" == a ? t.loadProject(e.data.Id, function(a) {
  310. for (var n = [], s = [], l = [], c = t.getPhaseComponentDetail("Define", "Charter"), u = 0; i && u < i.length; u++) s.push("definestakeholders"), n.push(i[u].id), l.push({
  311. ProjectId: e.data.Id,
  312. PhaseId: c.PhaseId,
  313. PhaseComponentId: c.Id,
  314. UserId: i[u].id
  315. });
  316. t.sync(t.buildRequest("add", s, null, null, l), function(a) {
  317. o.logSuccess("Charter Successfully Saved!"), r && r(e.data)
  318. })
  319. }) : (o.logSuccess("Charter Successfully Saved!"), r && r(e.data)) : o.logError(e.data[0])
  320. })
  321. }! function() {
  322. "use strict";
  323. angular.module("app", ["app.core", "app.chart", "app.ui", "app.ui.form", "app.ui.form.validation", "app.ui.map", "app.page", "app.table", "app.project", "app.dashboard", "easypiechart", "ui.tree", "ngMap", "textAngular", "ngCookies"])
  324. }(),
  325. function() {
  326. "use strict";
  327. angular.module("app.chart", ["chart.js", "gantt", "gantt.table", "gantt.tooltips", "gantt.tree", "gantt.resizeSensor", "gantt.groups"])
  328. }(),
  329. function() {
  330. "use strict";
  331. angular.module("app.core", ["ngAnimate", "ngAria", "ngMessages", "ngWizard", "ngFileUpload", "app.layout", "app.i18n", "ngMaterial", "ui.router", "ui.bootstrap", "duScroll", "ui.mask"])
  332. }(),
  333. function() {
  334. "use strict";
  335. angular.module("app.dashboard", ["angular-scroll-animate"])
  336. }(),
  337. function() {
  338. "use strict";
  339. angular.module("app.ui.form", [])
  340. }(),
  341. function() {
  342. "use strict";
  343. angular.module("app.ui.form.validation", ["validation.match"])
  344. }(),
  345. function() {
  346. "use strict";
  347. angular.module("app.layout", [])
  348. }(),
  349. function() {
  350. "use strict";
  351. angular.module("app.ui.map", [])
  352. }(),
  353. function() {
  354. "use strict";
  355. angular.module("app.page", ["ngFileUpload"])
  356. }(),
  357. function() {
  358. "use strict";
  359. angular.module("app.project", [])
  360. }(),
  361. function() {
  362. "use strict";
  363. angular.module("app.table", [])
  364. }(),
  365. function() {
  366. "use strict";
  367. angular.module("app.ui", ["ngMaterial"])
  368. }(),
  369. function() {
  370. "use strict";
  371.  
  372. function e(e) {
  373. e.easypiechartsm1 = {}, e.easypiechartsm2 = {}, e.easypiechartsm3 = {}, e.easypiechartsm4 = {}, e.easypiechart = {}, e.easypiechart2 = {}, e.easypiechart3 = {}, e.easypiechartsm1 = {
  374. percent: 36,
  375. options: {
  376. animate: {
  377. duration: 1500,
  378. enabled: !1
  379. },
  380. barColor: e.color.primary,
  381. lineCap: "round",
  382. size: 120,
  383. lineWidth: 5
  384. }
  385. }, e.easypiechartsm2 = {
  386. percent: 45,
  387. options: {
  388. animate: {
  389. duration: 1500,
  390. enabled: !1
  391. },
  392. barColor: e.color.warning,
  393. lineCap: "round",
  394. size: 120,
  395. lineWidth: 5
  396. }
  397. }, e.easypiechartsm3 = {
  398. percent: 75,
  399. options: {
  400. animate: {
  401. duration: 1500,
  402. enabled: !1
  403. },
  404. barColor: e.color.danger,
  405. lineCap: "round",
  406. size: 120,
  407. lineWidth: 5
  408. }
  409. }, e.easypiechartsm4 = {
  410. percent: 66,
  411. options: {
  412. animate: {
  413. duration: 1500,
  414. enabled: !1
  415. },
  416. barColor: e.color.primary,
  417. lineCap: "round",
  418. size: 120,
  419. lineWidth: 5
  420. }
  421. }, e.easypiechart = {
  422. percent: 65,
  423. options: {
  424. animate: {
  425. duration: 1e3,
  426. enabled: !0
  427. },
  428. barColor: e.color.primary,
  429. lineCap: "round",
  430. size: 180,
  431. lineWidth: 5
  432. }
  433. }, e.easypiechart2 = {
  434. percent: 35,
  435. options: {
  436. animate: {
  437. duration: 1e3,
  438. enabled: !0
  439. },
  440. barColor: e.color.success,
  441. lineCap: "round",
  442. size: 180,
  443. lineWidth: 10
  444. }
  445. }, e.easypiechart3 = {
  446. percent: 68,
  447. options: {
  448. animate: {
  449. duration: 1e3,
  450. enabled: !0
  451. },
  452. barColor: e.color.info,
  453. lineCap: "square",
  454. size: 180,
  455. lineWidth: 20,
  456. scaleLength: 0
  457. }
  458. }
  459. }
  460.  
  461. function a(e) {
  462. e.demoData1 = {}, e.simpleChart1 = {}, e.simpleChart2 = {}, e.simpleChart3 = {}, e.tristateChart1 = {}, e.largeChart1 = {}, e.largeChart2 = {}, e.largeChart3 = {}, e.demoData1 = {
  463. data: [3, 1, 2, 2, 4, 6, 4, 5, 2, 4, 5, 3, 4, 6, 4, 7],
  464. options: {
  465. type: "line",
  466. lineColor: "#fff",
  467. highlightLineColor: "#fff",
  468. fillColor: e.color.success,
  469. spotColor: !1,
  470. minSpotColor: !1,
  471. maxSpotColor: !1,
  472. width: "100%",
  473. height: "150px"
  474. }
  475. }, e.simpleChart1 = {
  476. data: [3, 1, 2, 3, 5, 3, 4, 2],
  477. options: {
  478. type: "line",
  479. lineColor: e.color.primary,
  480. fillColor: "#fafafa",
  481. spotColor: !1,
  482. minSpotColor: !1,
  483. maxSpotColor: !1
  484. }
  485. }, e.simpleChart2 = {
  486. data: [3, 1, 2, 3, 5, 3, 4, 2],
  487. options: {
  488. type: "bar",
  489. barColor: e.color.primary
  490. }
  491. }, e.simpleChart3 = {
  492. data: [3, 1, 2, 3, 5, 3, 4, 2],
  493. options: {
  494. type: "pie",
  495. sliceColors: [e.color.primary, e.color.success, e.color.info, e.color.infoAlt, e.color.warning, e.color.danger]
  496. }
  497. }, e.tristateChart1 = {
  498. data: [1, 2, -3, -5, 3, 1, -4, 2],
  499. options: {
  500. type: "tristate",
  501. posBarColor: e.color.success,
  502. negBarColor: e.color.danger
  503. }
  504. }, e.largeChart1 = {
  505. data: [3, 1, 2, 3, 5, 3, 4, 2],
  506. options: {
  507. type: "line",
  508. lineColor: e.color.info,
  509. highlightLineColor: "#fff",
  510. fillColor: e.color.info,
  511. spotColor: !1,
  512. minSpotColor: !1,
  513. maxSpotColor: !1,
  514. width: "100%",
  515. height: "150px"
  516. }
  517. }, e.largeChart2 = {
  518. data: [3, 1, 2, 3, 5, 3, 4, 2],
  519. options: {
  520. type: "bar",
  521. barColor: e.color.success,
  522. barWidth: 10,
  523. width: "100%",
  524. height: "150px"
  525. }
  526. }, e.largeChart3 = {
  527. data: [3, 1, 2, 3, 5],
  528. options: {
  529. type: "pie",
  530. sliceColors: [e.color.primary, e.color.success, e.color.info, e.color.infoAlt, e.color.warning, e.color.danger],
  531. width: "150px",
  532. height: "150px"
  533. }
  534. }, e.infoChart1 = {
  535. data: [10, 11, 13, 12, 11, 10, 11, 12, 13, 14, 15, 13, 14, 12, 13, 15, 11, 13, 11, 15, 6],
  536. options: {
  537. type: "bar",
  538. barColor: e.color.primary,
  539. barWidth: 3,
  540. width: "100%",
  541. height: "26px"
  542. }
  543. }, e.infoChart2 = {
  544. data: [10, 11, 12, 13, 14, 15, 14, 13, 12, 11, 15, 14, 13, 14, 12, 13, 15, 13, 11, 11, 12, 6],
  545. options: {
  546. type: "bar",
  547. barColor: e.color.success,
  548. barWidth: 3,
  549. width: "100%",
  550. height: "26px"
  551. }
  552. }, e.infoChart3 = {
  553. data: [13, 14, 15, 14, 12, 10, 11, 12, 13, 14, 15, 13, 14, 12, 13, 15, 11, 13, 11, 15, 6],
  554. options: {
  555. type: "bar",
  556. barColor: e.color.danger,
  557. barWidth: 3,
  558. width: "100%",
  559. height: "26px"
  560. }
  561. }, e.infoChart4 = {
  562. data: [12, 11, 13, 12, 11, 10, 11, 12, 11, 12, 15, 13, 14, 12, 13, 15, 11, 13, 11, 15, 6],
  563. options: {
  564. type: "bar",
  565. barColor: e.color.warning,
  566. barWidth: 3,
  567. width: "100%",
  568. height: "26px"
  569. }
  570. }
  571. }
  572. angular.module("app.chart").controller("EasyPieChartCtrl", ["$scope", e]).controller("SparklineCtrl", ["$scope", a])
  573. }(),
  574. function() {
  575. "use strict";
  576.  
  577. function e() {
  578. function e(e, a, t) {
  579. var o, r, n;
  580. o = e.data, r = e.options, n = $.plot(a[0], o, r)
  581. }
  582. var a = {
  583. restrict: "A",
  584. scope: {
  585. data: "=",
  586. options: "="
  587. },
  588. link: e
  589. };
  590. return a
  591. }
  592.  
  593. function a() {
  594. function e(e, a, t) {
  595. var o, r, n, i, s, l, c, u, d;
  596. o = [], r = [], c = 200, d = 200, s = function(e, a, t) {
  597. function o() {
  598. var o, r, n, i;
  599. for (e.length > 0 && (e = e.slice(1)); e.length < c;) r = e.length > 0 ? e[e.length - 1] : (a + t) / 2, i = r + 4 * Math.random() - 2, a > i ? i = a : i > t && (i = t), e.push(i);
  600. for (n = [], o = 0; o < e.length;) n.push([o, e[o]]), ++o;
  601. return n
  602. }
  603. return o
  604. }, n = s(o, 28, 42), i = s(r, 56, 72), u = function() {
  605. l.setData([n(), i()]), l.draw(), setTimeout(u, d)
  606. }, l = $.plot(a[0], [n(), i()], {
  607. series: {
  608. lines: {
  609. show: !0,
  610. fill: !0
  611. },
  612. shadowSize: 0
  613. },
  614. yaxis: {
  615. min: 0,
  616. max: 100
  617. },
  618. xaxis: {
  619. show: !1
  620. },
  621. grid: {
  622. hoverable: !0,
  623. borderWidth: 1,
  624. borderColor: "#eeeeee"
  625. },
  626. colors: ["#3F51B5", "#C5CAE9"]
  627. }), u()
  628. }
  629. var a = {
  630. restrict: "A",
  631. link: e
  632. };
  633. return a
  634. }
  635.  
  636. function t() {
  637. function e(e, a, t) {
  638. var o, r, n, i;
  639. o = e.data, r = e.options, n = void 0, i = function() {
  640. a.sparkline(o, r)
  641. }, $(window).resize(function(e) {
  642. clearTimeout(n), n = setTimeout(i, 200)
  643. }), i()
  644. }
  645. var a = {
  646. restrict: "A",
  647. scope: {
  648. data: "=",
  649. options: "="
  650. },
  651. link: e
  652. };
  653. return a
  654. }
  655. angular.module("app.chart").directive("flotChart", e).directive("flotChartRealtime", a).directive("sparkline", t)
  656. }(),
  657. function() {
  658. "use strict";
  659.  
  660. function e(e, a) {
  661. e.bar = {}, e.line = {}, e.radar = {}, e.polarArea = {}, e.doughnut = {}, e.pie = {}, Chart.defaults.global.tooltipCornerRadius = 2, Chart.defaults.global.colours = [{
  662. fillColor: "rgba(63,81,181,0.3)",
  663. strokeColor: "rgba(63,81,181,1)",
  664. pointColor: "rgba(63,81,181,1)",
  665. pointStrokeColor: "#fff",
  666. pointHighlightFill: "#fff",
  667. pointHighlightStroke: "rgba(63,81,181,0.8)"
  668. }, {
  669. fillColor: "rgba(187,187,187,0.3)",
  670. strokeColor: "rgba(187,187,187,1)",
  671. pointColor: "rgba(187,187,187,1)",
  672. pointStrokeColor: "#fff",
  673. pointHighlightFill: "#fff",
  674. pointHighlightStroke: "rgba(187,187,187,0.8)"
  675. }, {
  676. fillColor: "rgba(76,175,80,0.3)",
  677. strokeColor: "rgba(76,175,80,1)",
  678. pointColor: "rgba(76,175,80,1)",
  679. pointStrokeColor: "#fff",
  680. pointHighlightFill: "#fff",
  681. pointHighlightStroke: "rgba(76,175,80,0.8)"
  682. }, {
  683. fillColor: "rgba(244,67,54,0.3)",
  684. strokeColor: "rgba(244,67,54,1)",
  685. pointColor: "rgba(244,67,54,1)",
  686. pointStrokeColor: "#fff",
  687. pointHighlightFill: "#fff",
  688. pointHighlightStroke: "rgba(244,67,54,0.8)"
  689. }, {
  690. fillColor: "rgba(255,193,7,0.3)",
  691. strokeColor: "rgba(255,193,7,1)",
  692. pointColor: "rgba(255,193,7,1)",
  693. pointStrokeColor: "#fff",
  694. pointHighlightFill: "#fff",
  695. pointHighlightStroke: "rgba(255,193,7,0.8)"
  696. }, {
  697. fillColor: "rgba(77,83,96,0.3)",
  698. strokeColor: "rgba(77,83,96,1)",
  699. pointColor: "rgba(77,83,96,1)",
  700. pointStrokeColor: "#fff",
  701. pointHighlightFill: "#fff",
  702. pointHighlightStroke: "rgba(77,83,96,1)"
  703. }], e.bar = {
  704. labels: ["2009", "2010", "2011", "2012", "2013", "2014"],
  705. series: ["A", "B"],
  706. data: [
  707. [59, 40, 61, 26, 55, 40],
  708. [38, 80, 19, 66, 27, 90]
  709. ],
  710. options: {
  711. barValueSpacing: 15
  712. }
  713. }, e.line = {
  714. labels: ["January", "February", "March", "April", "May", "June", "July"],
  715. series: ["A", "B"],
  716. data: [
  717. [28, 48, 40, 19, 86, 27, 90],
  718. [65, 55, 75, 55, 65, 50, 55]
  719. ],
  720. options: {}
  721. }, e.radar = {
  722. labels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"],
  723. data: [
  724. [65, 59, 90, 81, 56, 55, 40],
  725. [28, 48, 40, 19, 96, 27, 100]
  726. ]
  727. }, e.polarArea = {
  728. labels: ["Download Sales", "In-Store Sales", "Mail-Order Sales", "Tele Sales", "Corporate Sales"],
  729. data: [300, 500, 100, 40, 120]
  730. }, e.doughnut = {
  731. labels: ["Download Sales", "In-Store Sales", "Mail-Order Sales"],
  732. data: [300, 500, 100]
  733. }, e.pie = {
  734. labels: ["Download Sales", "In-Store Sales", "Mail-Order Sales"],
  735. data: [300, 500, 100]
  736. }
  737. }
  738. angular.module("app.chart").controller("ChartjsCtrl", ["$scope", "$rootScope", e])
  739. }(),
  740. function() {
  741. "use strict";
  742.  
  743. function e(e) {
  744. var a, t, o, r, n, i, s, l;
  745. e.line1 = {}, e.line2 = {}, e.area = {}, e.barChartCleanH = {}, e.barChartCleanV = {}, e.combo1 = {}, e.combo2 = {}, e.barChartStacked = {}, e.barChartVertical = {}, e.barChartHorizontal = {}, e.pieChart = {}, e.donutChart = {}, e.donutChartHarmony = {}, e.donutNationality = {}, e.combo3 = {}, e.line3 = {}, e.tmp = {}, e.line3.data = [{
  746. label: "Too",
  747. data: [
  748. [0, 19],
  749. [1, 29],
  750. [2, 38],
  751. [3, 45],
  752. [4, 51],
  753. [5, 63],
  754. [6, 71],
  755. [7, 75],
  756. [8, 78],
  757. [9, 76],
  758. [10, 78]
  759. ],
  760. lines: {
  761. show: !0,
  762. fill: !0,
  763. lineWidth: 2,
  764. fillColor: {
  765. colors: ["rgba(255,255,255,.1)", "rgba(79,195,247,.8)"]
  766. }
  767. }
  768. }], e.line3.options = {
  769. grid: {
  770. borderWidth: 0,
  771. borderColor: "#f0f0f0",
  772. margin: 0,
  773. minBorderMargin: 0,
  774. labelMargin: 20,
  775. hoverable: !0,
  776. clickable: !0
  777. },
  778. tooltip: !0,
  779. tooltipOpts: {
  780. content: "%s X: %x Y: %y",
  781. shifts: {
  782. y: 25
  783. },
  784. defaultTheme: !1
  785. },
  786. legend: {
  787. labelBoxBorderColor: "#ccc",
  788. show: !1,
  789. noColumns: 0
  790. },
  791. series: {
  792. stack: !0,
  793. shadowSize: 0,
  794. highlightColor: "rgba(30,120,120,.5)"
  795. },
  796. xaxis: {
  797. tickLength: 0,
  798. tickDecimals: 0,
  799. show: !0,
  800. min: 2,
  801. font: {
  802. style: "normal",
  803. color: "#666666"
  804. }
  805. },
  806. yaxis: {
  807. ticks: 3,
  808. tickDecimals: 0,
  809. show: !0,
  810. tickColor: "#f0f0f0",
  811. font: {
  812. style: "normal",
  813. color: "#666666"
  814. }
  815. },
  816. points: {
  817. show: !0,
  818. radius: 2,
  819. symbol: "circle"
  820. },
  821. colors: [e.color.info]
  822. }, e.donutNationality.data = [{
  823. label: "United States",
  824. data: 40
  825. }, {
  826. label: "United Kingdom",
  827. data: 10
  828. }, {
  829. label: "Canada",
  830. data: 20
  831. }, {
  832. label: "Germany",
  833. data: 12
  834. }, {
  835. label: "Japan",
  836. data: 18
  837. }], e.donutNationality.options = {
  838. series: {
  839. pie: {
  840. show: !0,
  841. innerRadius: .75,
  842. stroke: {
  843. width: 0
  844. }
  845. }
  846. },
  847. colors: [e.color.success, e.color.primary, e.color.infoAlt, e.color.info, e.color.warning],
  848. grid: {
  849. hoverable: !0,
  850. clickable: !0,
  851. borderWidth: 0,
  852. color: "#ccc"
  853. },
  854. legend: {
  855. show: !0
  856. },
  857. tooltip: !0,
  858. tooltipOpts: {
  859. content: "%s: %p.0%",
  860. defaultTheme: !0
  861. }
  862. }, n = {}, n.data1 = [
  863. [1, 15],
  864. [2, 20],
  865. [3, 14],
  866. [4, 10],
  867. [5, 10],
  868. [6, 20]
  869. ], e.line1.data = [{
  870. data: n.data1,
  871. label: "Trend"
  872. }], e.line1.options = {
  873. series: {
  874. lines: {
  875. show: !0,
  876. fill: !0,
  877. fillColor: {
  878. colors: [{
  879. opacity: 0
  880. }, {
  881. opacity: .3
  882. }]
  883. }
  884. },
  885. points: {
  886. show: !0,
  887. lineWidth: 2,
  888. fill: !0,
  889. fillColor: "#ffffff",
  890. symbol: "circle",
  891. radius: 5
  892. }
  893. },
  894. colors: [e.color.primary, e.color.infoAlt],
  895. tooltip: !0,
  896. tooltipOpts: {
  897. defaultTheme: !1
  898. },
  899. grid: {
  900. hoverable: !0,
  901. clickable: !0,
  902. tickColor: "#f9f9f9",
  903. borderWidth: 1,
  904. borderColor: "#eeeeee"
  905. },
  906. xaxis: {
  907. ticks: [
  908. [1, "Jan."],
  909. [2, "Feb."],
  910. [3, "Mar."],
  911. [4, "Apr."],
  912. [5, "May"],
  913. [6, "June"],
  914. [7, "July"],
  915. [8, "Aug."],
  916. [9, "Sept."],
  917. [10, "Oct."],
  918. [11, "Nov."],
  919. [12, "Dec."]
  920. ]
  921. }
  922. }, i = {}, i.data1 = [
  923. [1, 20],
  924. [2, 14],
  925. [3, 16],
  926. [4, 22],
  927. [5, 28],
  928. [6, 38]
  929. ], i.data2 = [
  930. [1, 26],
  931. [2, 24],
  932. [3, 22],
  933. [4, 22],
  934. [5, 20],
  935. [6, 16]
  936. ], e.line2.data = [{
  937. data: i.data1,
  938. label: "Profit"
  939. }, {
  940. data: i.data2,
  941. label: "Cost",
  942. yaxis: 2
  943. }], e.line2.options = {
  944. series: {
  945. lines: {
  946. show: !0,
  947. fill: !1
  948. },
  949. points: {
  950. show: !0,
  951. lineWidth: 2,
  952. fill: !0,
  953. fillColor: "#fff",
  954. symbol: "circle",
  955. radius: 5
  956. },
  957. shadowSize: 0
  958. },
  959. grid: {
  960. hoverable: !0,
  961. clickable: !0,
  962. tickColor: "#f9f9f9",
  963. borderWidth: 1,
  964. borderColor: "#eeeeee"
  965. },
  966. colors: [e.color.primary, e.color.success],
  967. tooltip: !0,
  968. tooltipOpts: {
  969. defaultTheme: !1
  970. },
  971. xaxis: {
  972. ticks: [
  973. [1, "Jan."],
  974. [2, "Feb."],
  975. [3, "Mar."],
  976. [4, "Apr."],
  977. [5, "May"],
  978. [6, "June"],
  979. [7, "July"],
  980. [8, "Aug."],
  981. [9, "Sept."],
  982. [10, "Oct."],
  983. [11, "Nov."],
  984. [12, "Dec."]
  985. ]
  986. },
  987. yaxes: [{
  988. min: 0,
  989. max: 50
  990. }, {
  991. min: 0,
  992. max: 50,
  993. position: "right"
  994. }]
  995. }, a = {}, a.data1 = [
  996. [2017, 15],
  997. [2018, 20],
  998. [2019, 10],
  999. [2020, 5],
  1000. [2021, 9]
  1001. ], a.data2 = [
  1002. [2017, 15],
  1003. [2018, 16],
  1004. [2019, 22],
  1005. [2020, 14],
  1006. [2021, 12]
  1007. ], e.area.data = [{
  1008. data: a.data1,
  1009. label: "Value A",
  1010. lines: {
  1011. fill: !0
  1012. }
  1013. }, {
  1014. data: a.data2,
  1015. label: "Value B",
  1016. points: {
  1017. show: !0
  1018. },
  1019. yaxis: 2
  1020. }], e.area.options = {
  1021. series: {
  1022. lines: {
  1023. show: !0,
  1024. fill: !1
  1025. },
  1026. points: {
  1027. show: !0,
  1028. lineWidth: 2,
  1029. fill: !0,
  1030. fillColor: "#ffffff",
  1031. symbol: "circle",
  1032. radius: 5
  1033. },
  1034. shadowSize: 0
  1035. },
  1036. grid: {
  1037. hoverable: !0,
  1038. clickable: !0,
  1039. tickColor: "#f9f9f9",
  1040. borderWidth: 1,
  1041. borderColor: "#eeeeee"
  1042. },
  1043. colors: [e.color.success, e.color.danger],
  1044. tooltip: !0,
  1045. tooltipOpts: {
  1046. defaultTheme: !1
  1047. },
  1048. xaxis: {
  1049. mode: "time"
  1050. },
  1051. yaxes: [{}, {
  1052. position: "right"
  1053. }]
  1054. }, o = {}, o.dataH1 = [
  1055. [40, 1],
  1056. [59, 2],
  1057. [50, 3],
  1058. [81, 4],
  1059. [56, 5]
  1060. ], o.dataH2 = [
  1061. [28, 1],
  1062. [48, 2],
  1063. [90, 3],
  1064. [19, 4],
  1065. [45, 5]
  1066. ], o.dataV1 = [
  1067. [1, 28],
  1068. [2, 48],
  1069. [3, 90],
  1070. [4, 19],
  1071. [5, 45],
  1072. [6, 58]
  1073. ], o.dataV2 = [
  1074. [1, 40],
  1075. [2, 59],
  1076. [3, 50],
  1077. [4, 81],
  1078. [5, 56],
  1079. [6, 49]
  1080. ], e.barChartCleanH.data = [{
  1081. label: " A",
  1082. data: o.dataH1,
  1083. bars: {
  1084. order: 0,
  1085. fillColor: {
  1086. colors: [{
  1087. opacity: .3
  1088. }, {
  1089. opacity: .3
  1090. }]
  1091. }
  1092. }
  1093. }, {
  1094. label: " B",
  1095. data: o.dataH2,
  1096. bars: {
  1097. order: 1,
  1098. fillColor: {
  1099. colors: [{
  1100. opacity: .3
  1101. }, {
  1102. opacity: .3
  1103. }]
  1104. }
  1105. }
  1106. }], e.barChartCleanH.options = {
  1107. series: {
  1108. stack: !0,
  1109. bars: {
  1110. show: !0,
  1111. fill: 1,
  1112. barWidth: .35,
  1113. align: "center",
  1114. horizontal: !0
  1115. }
  1116. },
  1117. grid: {
  1118. show: !0,
  1119. aboveData: !1,
  1120. color: "#eaeaea",
  1121. hoverable: !0,
  1122. borderWidth: 1,
  1123. borderColor: "#eaeaea"
  1124. },
  1125. tooltip: !0,
  1126. tooltipOpts: {
  1127. defaultTheme: !1
  1128. },
  1129. colors: [e.color.gray, e.color.primary, e.color.info, e.color.danger]
  1130. }, e.barChartCleanV.data = [{
  1131. label: " A",
  1132. data: o.dataV1,
  1133. bars: {
  1134. order: 0,
  1135. fillColor: {
  1136. colors: [{
  1137. opacity: .3
  1138. }, {
  1139. opacity: .3
  1140. }]
  1141. }
  1142. }
  1143. }, {
  1144. label: " B",
  1145. data: o.dataV2,
  1146. bars: {
  1147. order: 1,
  1148. fillColor: {
  1149. colors: [{
  1150. opacity: .3
  1151. }, {
  1152. opacity: .3
  1153. }]
  1154. }
  1155. }
  1156. }], e.barChartCleanV.options = {
  1157. series: {
  1158. stack: !0,
  1159. bars: {
  1160. show: !0,
  1161. fill: 1,
  1162. barWidth: .25,
  1163. align: "center",
  1164. horizontal: !1
  1165. }
  1166. },
  1167. grid: {
  1168. show: !0,
  1169. aboveData: !1,
  1170. color: "#eaeaea",
  1171. hoverable: !0,
  1172. borderWidth: 1,
  1173. borderColor: "#eaeaea"
  1174. },
  1175. tooltip: !0,
  1176. tooltipOpts: {
  1177. defaultTheme: !1
  1178. },
  1179. colors: [e.color.gray, e.color.primary, e.color.info, e.color.danger]
  1180. }, e.combo3.data = [{
  1181. label: "WOM channels",
  1182. bars: {
  1183. show: !0,
  1184. fill: !0,
  1185. barWidth: .5,
  1186. align: "center",
  1187. order: 1,
  1188. fillColor: {
  1189. colors: [{
  1190. opacity: 1
  1191. }, {
  1192. opacity: 1
  1193. }]
  1194. }
  1195. },
  1196. data: [
  1197. [0, 75],
  1198. [1, 62],
  1199. [2, 45],
  1200. [3, 60],
  1201. [4, 73],
  1202. [5, 50],
  1203. [6, 31],
  1204. [7, 56],
  1205. [8, 70],
  1206. [9, 63],
  1207. [10, 49],
  1208. [11, 72],
  1209. [12, 76],
  1210. [13, 67],
  1211. [14, 46],
  1212. [15, 51],
  1213. [16, 69],
  1214. [17, 59],
  1215. [18, 85],
  1216. [19, 67],
  1217. [20, 56]
  1218. ]
  1219. }, {
  1220. label: "Viral channels",
  1221. curvedLines: {
  1222. apply: !0
  1223. },
  1224. lines: {
  1225. show: !0,
  1226. fill: !0,
  1227. fillColor: {
  1228. colors: [{
  1229. opacity: .7
  1230. }, {
  1231. opacity: 1
  1232. }]
  1233. }
  1234. },
  1235. data: [
  1236. [2, 0],
  1237. [3, 5],
  1238. [4, 20],
  1239. [5, 15],
  1240. [6, 30],
  1241. [7, 28],
  1242. [8, 25],
  1243. [9, 40],
  1244. [10, 60],
  1245. [11, 40],
  1246. [12, 43],
  1247. [13, 32],
  1248. [14, 36],
  1249. [15, 23],
  1250. [16, 12],
  1251. [17, 15],
  1252. [18, 0]
  1253. ]
  1254. }, {
  1255. label: "Paid channels",
  1256. curvedLines: {
  1257. apply: !0
  1258. },
  1259. lines: {
  1260. show: !0,
  1261. fill: !0,
  1262. fillColor: {
  1263. colors: [{
  1264. opacity: .7
  1265. }, {
  1266. opacity: 1
  1267. }]
  1268. }
  1269. },
  1270. data: [
  1271. [4, 1],
  1272. [5, 6],
  1273. [6, 15],
  1274. [7, 8],
  1275. [8, 16],
  1276. [9, 9],
  1277. [10, 25],
  1278. [11, 12],
  1279. [12, 50],
  1280. [13, 20],
  1281. [14, 25],
  1282. [15, 12],
  1283. [16, 0]
  1284. ]
  1285. }], e.combo3.options = {
  1286. colors: [e.color.gray, e.color.success, e.color.info, e.color.info],
  1287. series: {
  1288. shadowSize: 1,
  1289. curvedLines: {
  1290. active: !0
  1291. }
  1292. },
  1293. xaxis: {
  1294. font: {
  1295. color: "#607685"
  1296. }
  1297. },
  1298. yaxis: {
  1299. font: {
  1300. color: "#607685"
  1301. }
  1302. },
  1303. grid: {
  1304. hoverable: !0,
  1305. clickable: !0,
  1306. borderWidth: 0,
  1307. color: "#ccc"
  1308. },
  1309. tooltip: !0
  1310. }, s = [
  1311. [1, 70],
  1312. [2, 55],
  1313. [3, 68],
  1314. [4, 81],
  1315. [5, 56],
  1316. [6, 55],
  1317. [7, 68],
  1318. [8, 45],
  1319. [9, 35]
  1320. ], l = [
  1321. [1, 28],
  1322. [2, 48],
  1323. [3, 30],
  1324. [4, 60],
  1325. [5, 100],
  1326. [6, 50],
  1327. [7, 10],
  1328. [8, 25],
  1329. [9, 50]
  1330. ], e.combo1.data = [{
  1331. label: " A",
  1332. data: s,
  1333. bars: {
  1334. order: 0,
  1335. fillColor: {
  1336. colors: [{
  1337. opacity: .3
  1338. }, {
  1339. opacity: .3
  1340. }]
  1341. },
  1342. show: !0,
  1343. fill: 1,
  1344. barWidth: .3,
  1345. align: "center",
  1346. horizontal: !1
  1347. }
  1348. }, {
  1349. data: l,
  1350. curvedLines: {
  1351. apply: !0
  1352. },
  1353. lines: {
  1354. show: !0,
  1355. fill: !0,
  1356. fillColor: {
  1357. colors: [{
  1358. opacity: .2
  1359. }, {
  1360. opacity: .2
  1361. }]
  1362. }
  1363. }
  1364. }, {
  1365. data: l,
  1366. label: "D",
  1367. points: {
  1368. show: !0
  1369. }
  1370. }], e.combo1.options = {
  1371. series: {
  1372. curvedLines: {
  1373. active: !0
  1374. },
  1375. points: {
  1376. lineWidth: 2,
  1377. fill: !0,
  1378. fillColor: "#ffffff",
  1379. symbol: "circle",
  1380. radius: 4
  1381. }
  1382. },
  1383. grid: {
  1384. hoverable: !0,
  1385. clickable: !0,
  1386. tickColor: "#f9f9f9",
  1387. borderWidth: 1,
  1388. borderColor: "#eeeeee"
  1389. },
  1390. tooltip: !0,
  1391. tooltipOpts: {
  1392. defaultTheme: !1
  1393. },
  1394. colors: [e.color.gray, e.color.primary, e.color.primary]
  1395. }, e.combo2.data = [{
  1396. data: s,
  1397. curvedLines: {
  1398. apply: !0
  1399. },
  1400. lines: {
  1401. show: !0,
  1402. fill: !0,
  1403. fillColor: {
  1404. colors: [{
  1405. opacity: .2
  1406. }, {
  1407. opacity: .2
  1408. }]
  1409. }
  1410. }
  1411. }, {
  1412. data: s,
  1413. label: "C",
  1414. points: {
  1415. show: !0
  1416. }
  1417. }, {
  1418. data: l,
  1419. curvedLines: {
  1420. apply: !0
  1421. },
  1422. lines: {
  1423. show: !0,
  1424. fill: !0,
  1425. fillColor: {
  1426. colors: [{
  1427. opacity: .2
  1428. }, {
  1429. opacity: .2
  1430. }]
  1431. }
  1432. }
  1433. }, {
  1434. data: l,
  1435. label: "D",
  1436. points: {
  1437. show: !0
  1438. }
  1439. }], e.combo2.options = {
  1440. series: {
  1441. curvedLines: {
  1442. active: !0
  1443. },
  1444. points: {
  1445. lineWidth: 2,
  1446. fill: !0,
  1447. fillColor: "#ffffff",
  1448. symbol: "circle",
  1449. radius: 4
  1450. }
  1451. },
  1452. grid: {
  1453. hoverable: !0,
  1454. clickable: !0,
  1455. tickColor: "#f9f9f9",
  1456. borderWidth: 1,
  1457. borderColor: "#eeeeee"
  1458. },
  1459. tooltip: !0,
  1460. tooltipOpts: {
  1461. defaultTheme: !1
  1462. },
  1463. colors: [e.color.gray, e.color.gray, e.color.primary, e.color.primary]
  1464. }, t = {}, t.data1 = [
  1465. [2009, 10],
  1466. [2010, 5],
  1467. [2011, 5],
  1468. [2012, 20],
  1469. [2013, 28]
  1470. ], t.data2 = [
  1471. [2009, 22],
  1472. [2010, 14],
  1473. [2011, 12],
  1474. [2012, 19],
  1475. [2013, 22]
  1476. ], t.data3 = [
  1477. [2009, 30],
  1478. [2010, 20],
  1479. [2011, 19],
  1480. [2012, 13],
  1481. [2013, 20]
  1482. ], e.barChartStacked.data = [{
  1483. label: "Value A",
  1484. data: t.data1
  1485. }, {
  1486. label: "Value B",
  1487. data: t.data2
  1488. }, {
  1489. label: "Value C",
  1490. data: t.data3
  1491. }], e.barChartStacked.options = {
  1492. series: {
  1493. stack: !0,
  1494. bars: {
  1495. show: !0,
  1496. fill: 1,
  1497. barWidth: .3,
  1498. align: "center",
  1499. horizontal: !1,
  1500. order: 1
  1501. }
  1502. },
  1503. grid: {
  1504. hoverable: !0,
  1505. borderWidth: 1,
  1506. borderColor: "#eeeeee"
  1507. },
  1508. tooltip: !0,
  1509. tooltipOpts: {
  1510. defaultTheme: !1
  1511. },
  1512. colors: [e.color.success, e.color.info, e.color.warning, e.color.danger]
  1513. }, e.barChartVertical.data = [{
  1514. label: "Value A",
  1515. data: t.data1,
  1516. bars: {
  1517. order: 0
  1518. }
  1519. }, {
  1520. label: "Value B",
  1521. data: t.data2,
  1522. bars: {
  1523. order: 1
  1524. }
  1525. }, {
  1526. label: "Value C",
  1527. data: t.data3,
  1528. bars: {
  1529. order: 2
  1530. }
  1531. }], e.barChartVertical.options = {
  1532. series: {
  1533. stack: !0,
  1534. bars: {
  1535. show: !0,
  1536. fill: 1,
  1537. barWidth: .2,
  1538. align: "center",
  1539. horizontal: !1
  1540. }
  1541. },
  1542. grid: {
  1543. hoverable: !0,
  1544. borderWidth: 1,
  1545. borderColor: "#eeeeee"
  1546. },
  1547. yaxis: {
  1548. max: 40
  1549. },
  1550. tooltip: !0,
  1551. tooltipOpts: {
  1552. defaultTheme: !1
  1553. },
  1554. colors: [e.color.success, e.color.info, e.color.warning, e.color.danger]
  1555. }, r = {}, r.data1 = [
  1556. [85, 10],
  1557. [50, 20],
  1558. [55, 30]
  1559. ], r.data2 = [
  1560. [77, 10],
  1561. [60, 20],
  1562. [70, 30]
  1563. ], r.data3 = [
  1564. [100, 10],
  1565. [70, 20],
  1566. [55, 30]
  1567. ], e.barChartHorizontal.data = [{
  1568. label: "Value A",
  1569. data: r.data1,
  1570. bars: {
  1571. order: 1
  1572. }
  1573. }, {
  1574. label: "Value B",
  1575. data: r.data2,
  1576. bars: {
  1577. order: 2
  1578. }
  1579. }, {
  1580. label: "Value C",
  1581. data: r.data3,
  1582. bars: {
  1583. order: 3
  1584. }
  1585. }], e.barChartHorizontal.options = {
  1586. series: {
  1587. stack: !0,
  1588. bars: {
  1589. show: !0,
  1590. fill: 1,
  1591. barWidth: 1,
  1592. align: "center",
  1593. horizontal: !0
  1594. }
  1595. },
  1596. grid: {
  1597. hoverable: !0,
  1598. borderWidth: 1,
  1599. borderColor: "#eeeeee"
  1600. },
  1601. tooltip: !0,
  1602. tooltipOpts: {
  1603. defaultTheme: !1
  1604. },
  1605. colors: [e.color.success, e.color.info, e.color.warning, e.color.danger]
  1606. }, e.pieChart.data = [{
  1607. label: "New User",
  1608. data: 22
  1609. }, {
  1610. label: "Returning User",
  1611. data: 78
  1612. }], e.pieChart.options = {
  1613. series: {
  1614. pie: {
  1615. show: !0
  1616. }
  1617. },
  1618. legend: {
  1619. show: !0
  1620. },
  1621. grid: {
  1622. hoverable: !0,
  1623. clickable: !0
  1624. },
  1625. colors: [e.color.gray, e.color.info],
  1626. tooltip: !0,
  1627. tooltipOpts: {
  1628. content: "%p.0%, %s",
  1629. defaultTheme: !1
  1630. }
  1631. }, e.donutChart.data = [{
  1632. label: "Download Sales",
  1633. data: 12
  1634. }, {
  1635. label: "In-Store Sales",
  1636. data: 30
  1637. }, {
  1638. label: "Mail-Order Sales",
  1639. data: 20
  1640. }, {
  1641. label: "Online Sales",
  1642. data: 19
  1643. }], e.donutChart.options = {
  1644. series: {
  1645. pie: {
  1646. show: !0,
  1647. innerRadius: .5
  1648. }
  1649. },
  1650. legend: {
  1651. show: !0
  1652. },
  1653. grid: {
  1654. hoverable: !0,
  1655. clickable: !0
  1656. },
  1657. colors: [e.color.primary, e.color.success, e.color.info, e.color.warning, e.color.danger],
  1658. tooltip: !0,
  1659. tooltipOpts: {
  1660. content: "%p.0%, %s",
  1661. defaultTheme: !1
  1662. }
  1663. }, e.donutChartHarmony.data = [{
  1664. label: "Direct Traffic",
  1665. data: 12
  1666. }, {
  1667. label: "Referrals Traffic",
  1668. data: 30
  1669. }, {
  1670. label: "Search Traffic",
  1671. data: 20
  1672. }, {
  1673. label: "Social Traffic",
  1674. data: 19
  1675. }, {
  1676. label: "Mail Traffic",
  1677. data: 15
  1678. }], e.donutChartHarmony.options = {
  1679. series: {
  1680. pie: {
  1681. show: !0,
  1682. innerRadius: .55
  1683. }
  1684. },
  1685. legend: {
  1686. show: !1
  1687. },
  1688. grid: {
  1689. hoverable: !0,
  1690. clickable: !0
  1691. },
  1692. colors: ["#1BB7A0", "#39B5B9", "#52A3BB", "#619CC4", "#6D90C5"],
  1693. tooltip: !0,
  1694. tooltipOpts: {
  1695. content: "%p.0%, %s",
  1696. defaultTheme: !1
  1697. }
  1698. }
  1699. }
  1700. angular.module("app.chart").controller("FlotChartCtrl", ["$scope", e])
  1701. }(),
  1702. function() {
  1703. "use strict";
  1704.  
  1705. function e(e, a, t, o, r) {
  1706. e.projectId = t.pid, e.data = [], e.options = {
  1707. mode: "custom",
  1708. scale: "day",
  1709. sideMode: "TreeTable",
  1710. daily: !1,
  1711. width: 1,
  1712. zoom: 1,
  1713. columns: ["model.name", "from", "to", "duration", "complete", "daysremain", "innerlink"],
  1714. treeTableColumns: ["from", "to", "duration", "complete", "daysremain"],
  1715. rowContent: '<a href="javascript:;" ng-click="scope.handleRowClick(row.model)">{{row.model.name}}</i>',
  1716. columnsHeaders: {
  1717. "model.name": "Phase",
  1718. from: "Start",
  1719. to: "End",
  1720. duration: "Duration (Days)",
  1721. complete: "% Complete",
  1722. daysremain: "Days Remaining"
  1723. },
  1724. headerContents: {
  1725. duration: '<i class="test">{{getHeader()}}</i>'
  1726. },
  1727. classes: {
  1728. from: "gantt-col-rotated",
  1729. to: "gantt-col-rotated",
  1730. duration: "gantt-col-rotated",
  1731. complete: "gantt-col-rotated",
  1732. daysremain: "gantt-col-rotated"
  1733. },
  1734. currentDate: "line",
  1735. currentDateValue: new Date,
  1736. columnsFormatters: {
  1737. from: function(e) {
  1738. return void 0 !== e ? e.format("M/DD/YY") : void 0
  1739. },
  1740. to: function(e) {
  1741. return void 0 !== e ? e.format("M/DD/YY") : void 0
  1742. }
  1743. }
  1744. }, e.scrollEvent = function(e) {
  1745. angular.equals(e.direction, "left") ? console.log("Scroll event: Left") : angular.equals(e.direction, "right") && console.log("Scroll event: Right")
  1746. }, e.handleRowClick = function(e) {
  1747. r.path(e.columnContents.innerlink)
  1748. }, o.loadProject(e.projectId, function(t) {
  1749. if (t.success) {
  1750. e.projectDetail = a.currentProject, e.phaseData = a.phaseData;
  1751. var n = ["Define", "Measure", "Analyze", "Improve", "Control"],
  1752. i = {},
  1753. s = {};
  1754. if (e.projectDetail.ControlReviewDate) {
  1755. var l = moment(e.projectDetail.DateTimeCreated, "YYYYMMDD"),
  1756. c = moment(e.projectDetail.ControlReviewDate, "YYYYMMDD");
  1757. i = {
  1758. name: "Project Timeline",
  1759. columnContents: {
  1760. duration: c.diff(l, "days"),
  1761. complete: Math.round(e.projectDetail.CompletionPercentage) + "%",
  1762. daysremain: c.diff(new Date, "days"),
  1763. innerlink: ""
  1764. },
  1765. tasks: [{
  1766. name: "",
  1767. from: l,
  1768. to: c,
  1769. color: "#bcbcbc"
  1770. }]
  1771. }, e.data.push(i)
  1772. }
  1773. for (var u = 0; u < n.length; u++) {
  1774. var d = [],
  1775. p = 0,
  1776. h = 0,
  1777. g = 0,
  1778. m = o.getPhaseDetail(n[u]);
  1779. i = {
  1780. name: n[u] + " Phase",
  1781. children: []
  1782. };
  1783. var f = 0;
  1784. for (var v in m)
  1785. if (f++, m[v].DateTimeStarted) {
  1786. i.children.push(m[v].Name);
  1787. var D = moment(m[v].DateTimeStarted, "YYYYMMDD"),
  1788. C = moment(m[v].LastUpdated, "YYYYMMDD"),
  1789. y = C.diff(D, "days");
  1790. s = {
  1791. name: m[v].Name,
  1792. tasks: [{
  1793. name: "",
  1794. from: D,
  1795. to: C,
  1796. color: "#bcbcbc"
  1797. }],
  1798. columnContents: {
  1799. duration: y,
  1800. complete: "working" !== m[v].Status ? '<i class="fa fa-check"></i>' : "",
  1801. daysremain: "",
  1802. innerlink: n[u].toLowerCase() + "/" + e.projectId + "/" + f
  1803. }
  1804. }, "working" !== m[v].Status && g++, d.push(s), p += y
  1805. }
  1806. var b = moment(e.projectDetail[n[u] + "ReviewDate"]).diff(moment(), "days");
  1807. h = g / Object.keys(m).length * 100, i.columnContents = {
  1808. duration: p,
  1809. complete: Math.round(h) + "%",
  1810. daysremain: b,
  1811. innerlink: n[u].toLowerCase() + "/" + e.projectId + "/1"
  1812. }, e.data.push(i), e.data.push.apply(e.data, d)
  1813. }
  1814. } else r.path("/dashboard")
  1815. })
  1816. }
  1817. angular.module("app.chart").controller("GanttCtrl", ["$scope", "$rootScope", "$stateParams", "DataSyncService", "$location", e])
  1818. }(),
  1819. function() {
  1820. "use strict";
  1821.  
  1822. function e(e, a, t) {
  1823. -1 === $.inArray(t.path(), ["/page/signin", "/page/signup", "/page/forgot-password"]) ? (e.currentProject = {}, e.contactList = {
  1824. lastUpdate: "",
  1825. contacts: []
  1826. }, a.loadContacts(function(a) {
  1827. e.contactList.contacts = a, e.contactList.lastUpdate = moment()
  1828. }), e.phaseDataModel = {
  1829. Define: {
  1830. completedTasks: 0,
  1831. totalTasks: 0
  1832. },
  1833. Measure: {
  1834. completedTasks: 0,
  1835. totalTasks: 0
  1836. },
  1837. Analyze: {
  1838. completedTasks: 0,
  1839. totalTasks: 0
  1840. },
  1841. Improve: {
  1842. completedTasks: 0,
  1843. totalTasks: 0
  1844. },
  1845. Control: {
  1846. completedTasks: 0,
  1847. totalTasks: 0
  1848. }
  1849. }, e.phaseData = angular.copy(e.phaseDataModel)) : e.globals = {};
  1850. var o = [{
  1851. name: "Fade up",
  1852. "class": "animate-fade-up"
  1853. }, {
  1854. name: "Scale up",
  1855. "class": "ainmate-scale-up"
  1856. }, {
  1857. name: "Slide in from right",
  1858. "class": "ainmate-slide-in-right"
  1859. }, {
  1860. name: "Flip Y",
  1861. "class": "animate-flip-y"
  1862. }],
  1863. r = new Date,
  1864. n = r.getFullYear(),
  1865. i = {
  1866. brand: "L6Σ",
  1867. year: n,
  1868. layout: "wide",
  1869. menu: "vertical",
  1870. fixedHeader: !0,
  1871. fixedSidebar: !0,
  1872. pageTransition: o[0],
  1873. skin: "15"
  1874. },
  1875. s = {
  1876. primary: "#009688",
  1877. success: "#8BC34A",
  1878. info: "#00BCD4",
  1879. infoAlt: "#7E57C2",
  1880. warning: "#EB9C17",
  1881. danger: "#F44336",
  1882. gray: "#EDF0F1"
  1883. };
  1884. return {
  1885. pageTransitionOpts: o,
  1886. main: i,
  1887. color: s
  1888. }
  1889. }
  1890.  
  1891. function a(e) {
  1892. var a = e.extendPalette("cyan", {
  1893. contrastLightColors: "500 600 700 800 900",
  1894. contrastStrongLightColors: "500 600 700 800 900"
  1895. }),
  1896. t = e.extendPalette("light-green", {
  1897. contrastLightColors: "500 600 700 800 900",
  1898. contrastStrongLightColors: "500 600 700 800 900"
  1899. });
  1900. e.definePalette("cyanAlt", a).definePalette("lightGreenAlt", t), e.theme("default").primaryPalette("teal", {
  1901. "default": "500"
  1902. }).accentPalette("cyanAlt", {
  1903. "default": "500"
  1904. }).warnPalette("red", {
  1905. "default": "500"
  1906. }).backgroundPalette("grey")
  1907. }
  1908. angular.module("app.core").factory("appConfig", ["$rootScope", "DataSyncService", "$location", e]).config(["$mdThemingProvider", a])
  1909. }(),
  1910. function() {
  1911. "use strict";
  1912.  
  1913. function e(e, a, t, o, r, n) {
  1914. e.pageTransitionOpts = r.pageTransitionOpts, e.main = r.main, e.color = r.color, e.$watch("main", function(t, o) {
  1915. "horizontal" === t.menu && "vertical" === o.menu && a.$broadcast("nav:reset"), t.fixedHeader === !1 && t.fixedSidebar === !0 && (o.fixedHeader === !1 && o.fixedSidebar === !1 && (e.main.fixedHeader = !0, e.main.fixedSidebar = !0), o.fixedHeader === !0 && o.fixedSidebar === !0 && (e.main.fixedHeader = !1, e.main.fixedSidebar = !1)), t.fixedSidebar === !0 && (e.main.fixedHeader = !0), t.fixedHeader === !1 && (e.main.fixedSidebar = !1)
  1916. }, !0), e.logout = function() {
  1917. n.ClearCredentials()
  1918. }, e.userDetails = a.globals.userDetails, a.$on("$userDetailPopulated", function(t) {
  1919. e.userDetails = a.globals.userDetails
  1920. }), a.$on("$stateChangeSuccess", function(e, a, t) {
  1921. o.scrollTo(0, 0)
  1922. })
  1923. }
  1924. angular.module("app").controller("AppCtrl", ["$scope", "$rootScope", "$state", "$document", "appConfig", "AuthenticationService", e])
  1925. }(),
  1926. function() {
  1927. "use strict";
  1928.  
  1929. function e(e, a, t, o) {
  1930. var r = {};
  1931. return r.Login = function(e, t, o) {
  1932. //a.defaults.headers.common.Authorization = ""
  1933. a.post("https://api.l6elite.com/login", {
  1934. email: e,
  1935. password: t
  1936. }).then(function(e) {
  1937. e.success = !0, o(e)
  1938. }, function(e) {
  1939. e.success = !1, o(e)
  1940. })
  1941. }, r.UpdateCredentials = function(r, n) {
  1942. var i = e.encode(r + ":" + n);
  1943. a.defaults.headers.common.Authorization = "Basic " + i, o.globals.currentUser.authdata = i, t.put("globals", JSON.stringify(o.globals))
  1944. }, r.SetCredentials = function(r, n) {
  1945. var i = e.encode(r + ":" + n);
  1946. o.globals = {
  1947. currentUser: {
  1948. email: r,
  1949. authdata: i
  1950. }
  1951. }, a.defaults.headers.common.Authorization = "Basic " + i, t.put("globals", JSON.stringify(o.globals))
  1952. }, r.ClearCredentials = function() {
  1953. o.globals = {}, t.remove("globals"), a.defaults.headers.common.Authorization = "Basic "
  1954. }, r
  1955. }
  1956.  
  1957. function a() {
  1958. var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  1959. return {
  1960. encode: function(a) {
  1961. var t, o, r, n, i, s = "",
  1962. l = "",
  1963. c = "",
  1964. u = 0;
  1965. do t = a.charCodeAt(u++), o = a.charCodeAt(u++), l = a.charCodeAt(u++), r = t >> 2, n = (3 & t) << 4 | o >> 4, i = (15 & o) << 2 | l >> 6, c = 63 & l, isNaN(o) ? i = c = 64 : isNaN(l) && (c = 64), s = s + e.charAt(r) + e.charAt(n) + e.charAt(i) + e.charAt(c), t = o = l = "", r = n = i = c = ""; while (u < a.length);
  1966. return s
  1967. },
  1968. decode: function(a) {
  1969. var t, o, r, n, i, s = "",
  1970. l = "",
  1971. c = "",
  1972. u = 0,
  1973. d = /[^A-Za-z0-9\+\/\=]/g;
  1974. d.exec(a) && window.alert("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."), a = a.replace(/[^A-Za-z0-9\+\/\=]/g, "");
  1975. do r = e.indexOf(a.charAt(u++)), n = e.indexOf(a.charAt(u++)), i = e.indexOf(a.charAt(u++)), c = e.indexOf(a.charAt(u++)), t = r << 2 | n >> 4, o = (15 & n) << 4 | i >> 2, l = (3 & i) << 6 | c, s += String.fromCharCode(t), 64 != i && (s += String.fromCharCode(o)), 64 != c && (s += String.fromCharCode(l)), t = o = l = "", r = n = i = c = ""; while (u < a.length);
  1976. return s
  1977. }
  1978. }
  1979. }
  1980. angular.module("app").factory("AuthenticationService", ["Base64", "$http", "$cookies", "$rootScope", e]).factory("Base64", [a])
  1981. }(),
  1982. function() {
  1983. "use strict";
  1984.  
  1985. function e(e, a, t, o) {
  1986. -1 === $.inArray(a.path(), ["/page/signin", "/page/signup", "/page/forgot-password"]) && (e.globals = t.get("globals") || {}, "object" != typeof e.globals && (e.globals = JSON.parse(e.globals)), e.globals.currentUser && (o.defaults.headers.common.Authorization = "Basic " + e.globals.currentUser.authdata)), e.$on("$locationChangeStart", function(t, o, r) {
  1987. r.indexOf("svg_editor") > -1 && window.location.reload();
  1988. var n = -1 === $.inArray(a.path(), ["/page/signin", "/page/signup", "/page/forgot-password"]),
  1989. i = e.globals.currentUser;
  1990. n && !i && a.path("/page/signin")
  1991. })
  1992. }
  1993. angular.module("app").config(["$stateProvider", "$urlRouterProvider", function(e, a) {
  1994. var t, o, r, n;
  1995. t = ["page/404", "page/500", "page/forgot-password", "page/lock-screen", "page/profile", "page/signin"], o = [{
  1996. url: "project",
  1997. config: {
  1998. url: "/project/:pid",
  1999. templateUrl: "app/project/project.html"
  2000. }
  2001. }, {
  2002. url: "projecthistory",
  2003. config: {
  2004. url: "/projecthistory",
  2005. templateUrl: "app/project/project-history.html"
  2006. }
  2007. }, {
  2008. url: "newproject",
  2009. config: {
  2010. url: "/newproject",
  2011. templateUrl: "app/project/project-new.html"
  2012. }
  2013. }, {
  2014. url: "define",
  2015. config: {
  2016. url: "/define/:pid/:tid",
  2017. templateUrl: "app/project/project-define.html"
  2018. }
  2019. }, {
  2020. url: "measure",
  2021. config: {
  2022. url: "/measure/:pid/:tid",
  2023. templateUrl: "app/project/project-measure.html"
  2024. }
  2025. }, {
  2026. url: "svgeditor",
  2027. config: {
  2028. url: "/svg_editor/:process/:pid",
  2029. templateUrl: "app/project/project-svgeditor.html"
  2030. }
  2031. }, {
  2032. url: "analyze",
  2033. config: {
  2034. url: "/analyze/:pid/:tid",
  2035. templateUrl: "app/project/project-analyze.html"
  2036. }
  2037. }, {
  2038. url: "improve",
  2039. config: {
  2040. url: "/improve/:pid/:tid",
  2041. templateUrl: "app/project/project-improve.html"
  2042. }
  2043. }, {
  2044. url: "control",
  2045. config: {
  2046. url: "/control/:pid/:tid",
  2047. templateUrl: "app/project/project-control.html"
  2048. }
  2049. }, {
  2050. url: "user-settings",
  2051. config: {
  2052. url: "/user-settings",
  2053. templateUrl: "app/page/user-settings.html"
  2054. }
  2055. }], r = function(a) {
  2056. var t, o;
  2057. return o = "/" + a, t = {
  2058. url: o,
  2059. templateUrl: "app/" + a + ".html"
  2060. }, e.state(a, t), e
  2061. }, n = function(a) {
  2062. return e.state(a.url, a.config), e
  2063. }, t.forEach(function(e) {
  2064. return r(e)
  2065. }), o.forEach(function(e) {
  2066. return n(e)
  2067. }), a.when("/", "/dashboard").otherwise("/dashboard"), e.state("dashboard", {
  2068. url: "/dashboard",
  2069. templateUrl: "app/dashboard/dashboard.html"
  2070. })
  2071. }]).run(e), e.$inject = ["$rootScope", "$location", "$cookies", "$http"]
  2072. }(),
  2073. function() {
  2074. "use strict";
  2075.  
  2076. function e(e, a, t, o) {
  2077. var r = {};
  2078. return r.syncPromise = function(t) {
  2079. return e.post("https://api.l6elite.com", t).then(function(e) {
  2080. return a.$broadcast("preloader:hide"), e.data
  2081. }, function(e) {
  2082. return a.$broadcast("preloader:hide"), e.data
  2083. })
  2084. }, r.sync = function(t, o) {
  2085. a.$broadcast("preloader:active"), e.post("https://api.l6elite.com", t).then(function(e) {
  2086. a.$broadcast("preloader:hide"), e.success = !0, o(e)
  2087. }, function(e) {
  2088. a.$broadcast("preloader:hide"), e.success = !1, o(e)
  2089. })
  2090. }, r.post = function(t, o, r) {
  2091. a.$broadcast("preloader:active"), e.post(t, o).then(function(e) {
  2092. a.$broadcast("preloader:hide"), e.success = !0, r(e)
  2093. }, function(e) {
  2094. a.$broadcast("preloader:hide"), e.success = !1, r(e)
  2095. })
  2096. }, r.buildRequest = function(e, a, t, o, r, n) {
  2097. var i = {
  2098. A: e,
  2099. T: a instanceof Array ? a : [a]
  2100. };
  2101. return t && (i.C = t), o && (i.F = o), r && (i.V = r), n ? i.CO = n : i.CO = !1, i
  2102. }, r.buildFilter = function(e, a, t, o, r, n, i, s) {
  2103. var l = {};
  2104. return e && (l.c = e), a && (l.j = a),
  2105. t && (l.op = t), o && (l.v = o), r && (l.ob = r), n && (l.o = n), i && (l.l = i), s && (l.ao = s), l
  2106. }, r.loadProject = function(e, t, r) {
  2107. var n = {};
  2108. if (a.currentProject && a.currentProject.Id == e) n.success = !0, t(n);
  2109. else if (o.get("currentProject")) {
  2110. var i = JSON.parse(o.get("currentProject"));
  2111. i.Id == e ? (a.currentProject = angular.copy(i), a.phaseData = angular.copy(JSON.parse(o.get("phaseData"))), n.success = !0, t(n)) : r = !0
  2112. } else r = !0;
  2113. if (r) {
  2114. var s = this.buildFilter("Id", null, "is", e);
  2115. this.sync(this.buildRequest("get", ["projects"], null, [s]), function(e) {
  2116. if (e.success) {
  2117. a.phaseData = angular.copy(a.phaseDataModel), a.currentProject = e.data[0], a.currentProject.BusinessImpactValue = parseFloat(a.currentProject.BusinessImpactValue), a.currentProject.tasksLeft = 0;
  2118. for (var r = 0; e.data[0] && e.data[0].PhaseData && r < e.data[0].PhaseData.length; r++) {
  2119. var n = e.data[0].PhaseData[r];
  2120. a.phaseData[n.PhaseName].totalTasks += 1, "complete" == n.Status ? a.phaseData[n.PhaseName].completedTasks += 1 : a.currentProject.tasksLeft++
  2121. }
  2122. o.put("currentProject", JSON.stringify(a.currentProject)), o.put("phaseData", JSON.stringify(a.phaseData)), t(e)
  2123. } else t(e)
  2124. })
  2125. }
  2126. }, r.loadContacts = function(e, t) {
  2127. var o = [{
  2128. id: null,
  2129. name: "",
  2130. email: "",
  2131. image: "",
  2132. _lowername: ""
  2133. }, {
  2134. id: 0,
  2135. name: "New Contact",
  2136. email: "",
  2137. image: "",
  2138. _lowername: "newcontact"
  2139. }];
  2140. if (a.contactList.contacts.length < 1 || moment().isAfter(a.contactList.lastUpdate.add(10, "minutes")) || t) {
  2141. var n = r.buildFilter("Status", null, "isnot", "inactive"),
  2142. i = ["Id", "Status", "FirstName", "LastName", "EmailAddress", "Phone", "WorkTitle", "ProfileImageUrl"];
  2143. r.sync(r.buildRequest("get", ["users"], [i], [n]), function(t) {
  2144. if (t.success) {
  2145. for (var r = t.data, n = 0; r && n < r.length; n++) o.push({
  2146. name: r[n].FirstName + " " + r[n].LastName,
  2147. email: r[n].EmailAddress,
  2148. image: r[n].ProfileImageUrl || "images/generic-profile.png",
  2149. _lowername: (r[n].FirstName + r[n].LastName).toLowerCase(),
  2150. id: r[n].Id,
  2151. selected: !1,
  2152. status: r[n].Status,
  2153. worktitle: r[n].WorkTitle
  2154. });
  2155. a.contactList.lastUpdate = moment(), a.contactList.contacts = o, e(o)
  2156. }
  2157. })
  2158. } else o = a.contactList.contacts, e(o)
  2159. }, r.getPhaseComponentDetail = function(e, t) {
  2160. for (var o = a.currentProject.PhaseData, r = {}, n = 0; o && n < o.length; n++) o[n].PhaseName === e && o[n].Name === t && (r = o[n]);
  2161. return r
  2162. }, r.updatePhaseComponentDetail = function(e, t) {
  2163. var o = [r.buildFilter("ProjectId", null, "is", e)];
  2164. r.sync(r.buildRequest("get", ["phasecomponents"], null, o), function(e) {
  2165. e.success && (a.currentProject.PhaseData = e.data, t && t(e))
  2166. })
  2167. }, r.getPhaseDetail = function(e) {
  2168. for (var t = a.currentProject.PhaseData, o = {}, r = 0; t && r < t.length; r++) t[r].PhaseName === e && (o[t[r].Name.replace(/ /g, "_").replace(/&/g, "n").replace(/-/g, "")] = t[r]);
  2169. return o
  2170. }, r.getAllAccessLevels = function(e) {
  2171. this.sync(this.buildRequest("get", ["accesslevels"], null, null), function(a) {
  2172. e(a)
  2173. })
  2174. }, r.syncTableRowData = function(e, a, o, n, i, s) {
  2175. var l = [],
  2176. c = [],
  2177. u = [],
  2178. d = [];
  2179. if (i !== !0 && i !== !1 && (i = !0), n.length > 0 && (console.log("TO DELETE -->"), console.log(n), c = r.buildFilter("Id", null, "anyof", n), r.sync(r.buildRequest("delete", [e], null, [c]), function(e) {
  2180. e.success ? i && t.logSuccess("Row Successfully Deleted!") : i && t.logError("Oops! Row Was Not Deleted! Try Again!")
  2181. })), d = [], console.log("TO UPDATE -->"), console.log(o), o.length > 0) {
  2182. for (var p = 0; o && p < o.length; p++) d.push(e), c = r.buildFilter("Id", null, "is", o[p].Id), l.push(c), delete o[p].Id, u.push(o[p]);
  2183. r.sync(r.buildRequest("update", d, null, l, u), function(e) {
  2184. e.success ? i && t.logSuccess("Successfully Updated!") : i && t.logError("Oops! The Update Failed! Try Again!")
  2185. })
  2186. }
  2187. if (d = [], u = [], console.log("TO ADD -->"), console.log(a), a.length > 0) {
  2188. for (var p = 0; a && p < a.length; p++) d.push(e), u.push(a[p]);
  2189. r.sync(r.buildRequest("add", d, null, null, u), function(e) {
  2190. e.success ? (i && t.logSuccess("New Data Successfully Added!"), s && s(e)) : i && t.logError("Oops! Data Was Not Added! Try Again!")
  2191. })
  2192. }
  2193. }, r.getUserSubordinates = function(e) {
  2194. var t = [];
  2195. t.push(this.buildFilter("ReportsTo", null, "is", a.globals.userDetails.Id)), this.sync(this.buildRequest("get", ["users"], null, [t]), function(a) {
  2196. e(a)
  2197. })
  2198. }, r.getScopeChange = function(e, a) {
  2199. var t = [];
  2200. t.push(this.buildFilter("DateTimeCreated", null, "onorafter", moment().subtract(1, "day").format("M/D/YYYY"))), t.push({
  2201. ao: "and"
  2202. }), t.push(this.buildFilter("FieldLabel", null, "is", "Scope")), t.push({
  2203. andorsplit: "and"
  2204. }), t.push(this.buildFilter("UserId", null, "anyof", e)), this.sync(this.buildRequest("get", ["actiontracking"], null, [t]), function(e) {
  2205. a(e)
  2206. })
  2207. }, r.getActionTimeline = function(e, a, t) {
  2208. var o = [];
  2209. o.push(this.buildFilter("UserId", null, "anyof", e)), o.push({
  2210. ao: "and"
  2211. }), a ? o.push(this.buildFilter("Id", null, "lt", a, "Id", "DESC", 50)) : o.push(this.buildFilter("Id", null, "gte", 1, "Id", "DESC", 50)), this.sync(this.buildRequest("get", ["actiontracking"], null, [o]), function(e) {
  2212. t(e)
  2213. })
  2214. }, r.exportData = function(t, o, r) {
  2215. var n = {
  2216. data_type: t,
  2217. filters: o
  2218. };
  2219. a.$broadcast("preloader:active"), e.post("https://api.l6elite.com/exportdata", n).then(function(e) {
  2220. a.$broadcast("preloader:hide"), e.success = !0, r(e)
  2221. }, function(e) {
  2222. a.$broadcast("preloader:hide"), e.success = !1, r(e)
  2223. })
  2224. }, r
  2225. }
  2226. angular.module("app.core").factory("DataSyncService", ["$http", "$rootScope", "logger", "$cookies", e])
  2227. }(),
  2228. function() {
  2229. "use strict";
  2230.  
  2231. function e(e) {
  2232. return function(a, t, o) {
  2233. var r;
  2234. o.$observe("goTo", function(e) {
  2235. r = e
  2236. }), t.bind("click", function() {
  2237. a.$apply(function() {
  2238. e.path(r)
  2239. })
  2240. })
  2241. }
  2242. }
  2243.  
  2244. function a() {
  2245. return {
  2246. require: "ngModel",
  2247. link: function(e, a, t, o) {
  2248. a.bind("blur", function() {
  2249. e.$apply(function() {
  2250. o.$setViewValue(a.html())
  2251. })
  2252. }), o.$render = function(e) {
  2253. a.html(e)
  2254. }, a.bind("keydown", function(e) {
  2255. var t = 27 == e.which,
  2256. r = e.target;
  2257. t && (o.$setViewValue(a.html()), r.blur(), e.preventDefault())
  2258. })
  2259. }
  2260. }
  2261. }
  2262.  
  2263. function t(e, a) {
  2264. return {
  2265. require: "ngModel",
  2266. controller: ["$scope", function(a) {
  2267. a.addedUser = {}, a.showSoftUserAdd = function(t, o, r, n) {
  2268. var i = e.open({
  2269. templateUrl: "softusereditor.html",
  2270. controller: ["$scope", "$rootScope", "DataSyncService", "logger", "$uibModalInstance", function(e, a, t, o, r) {
  2271. e.dSchema = {
  2272. EmailAddress: "",
  2273. FirstName: "",
  2274. LastName: "",
  2275. WorkTitle: "",
  2276. ProfileImageUrl: "",
  2277. Phone: "",
  2278. City: "",
  2279. State: "",
  2280. Zip: ""
  2281. }, e.userData = angular.copy(e.dSchema), e.addSoftUser = function() {
  2282. var n = [];
  2283. n.push(e.userData), t.sync(t.buildRequest("add", ["users"], null, null, n), function(t) {
  2284. if (t.success) {
  2285. var n = t.data;
  2286. a.contactList.contacts.push({
  2287. name: n.FirstName + " " + n.LastName,
  2288. email: n.EmailAddress,
  2289. image: n.ProfileImageUrl,
  2290. _lowername: (n.FirstName + n.LastName).toLowerCase(),
  2291. id: n.Id
  2292. }), r.close(n), e.userData = angular.copy(e.dSchema)
  2293. } else o.logError(t.data[0])
  2294. })
  2295. }, e.closeModal = function() {
  2296. r.dismiss("cancel")
  2297. }
  2298. }],
  2299. resolve: {
  2300. addedUser: function() {
  2301. return a.addedUser
  2302. }
  2303. }
  2304. });
  2305. i.result.then(function(e) {
  2306. a.$broadcast("setUserSelectValue", e.Id)
  2307. })
  2308. }
  2309. }],
  2310. link: function(e, a, t, o) {
  2311. e.$watch(function() {
  2312. return o.$modelValue
  2313. }, function(a) {
  2314. "0" === a && e.showSoftUserAdd()
  2315. }), e.$on("setUserSelectValue", function(e, a) {
  2316. o.$setViewValue(a)
  2317. })
  2318. }
  2319. }
  2320. }
  2321. angular.module("app.core").directive("goTo", ["$location", e]).directive("contenteditable", [a]).directive("userSelect", ["$uibModal", "DataSyncService", t])
  2322. }(),
  2323. function() {
  2324. function e(e) {
  2325. e.useStaticFilesLoader({
  2326. prefix: "i18n/",
  2327. suffix: ".json"
  2328. }), e.preferredLanguage("en"), e.useSanitizeValueStrategy("sanitize")
  2329. }
  2330.  
  2331. function a(e, a) {
  2332. function t(t) {
  2333. switch (t) {
  2334. case "English":
  2335. a.use("en");
  2336. break;
  2337. case "Español":
  2338. a.use("es");
  2339. break;
  2340. case "中文":
  2341. a.use("zh");
  2342. break;
  2343. case "日本語":
  2344. a.use("ja");
  2345. break;
  2346. case "Portugal":
  2347. a.use("pt");
  2348. break;
  2349. case "Русский язык":
  2350. a.use("ru")
  2351. }
  2352. return e.lang = t
  2353. }
  2354.  
  2355. function o() {
  2356. var a;
  2357. switch (a = e.lang) {
  2358. case "English":
  2359. return "flags-american";
  2360. case "Español":
  2361. return "flags-spain";
  2362. case "中文":
  2363. return "flags-china";
  2364. case "Portugal":
  2365. return "flags-portugal";
  2366. case "日本語":
  2367. return "flags-japan";
  2368. case "Русский язык":
  2369. return "flags-russia"
  2370. }
  2371. }
  2372. e.lang = "English", e.setLang = t, e.getFlag = o
  2373. }
  2374. angular.module("app.i18n", ["pascalprecht.translate"]).config(["$translateProvider", e]).controller("LangCtrl", ["$scope", "$translate", a])
  2375. }(),
  2376. function() {
  2377. "use strict";
  2378.  
  2379. function e(e, a, t, o) {
  2380. console.log("Dashboard Controller Instantiated"), e.activeProjects = [], e.projectTimeline = [], e.scopeChange = "UNCHANGED", e.scopeChanges = [], e.subordinates = [], e.costAvoidance = 0, e.costAvoidanceChar = "", e.timeTracking = "ON TRACK", a.currentProject = {}, a.contactList = {
  2381. lastUpdate: "",
  2382. contacts: []
  2383. }, t.loadContacts(function(e) {
  2384. a.contactList.contacts = e, a.contactList.lastUpdate = moment()
  2385. }), a.phaseDataModel = {
  2386. Define: {
  2387. completedTasks: 0,
  2388. totalTasks: 0
  2389. },
  2390. Measure: {
  2391. completedTasks: 0,
  2392. totalTasks: 0
  2393. },
  2394. Analyze: {
  2395. completedTasks: 0,
  2396. totalTasks: 0
  2397. },
  2398. Improve: {
  2399. completedTasks: 0,
  2400. totalTasks: 0
  2401. },
  2402. Control: {
  2403. completedTasks: 0,
  2404. totalTasks: 0
  2405. }
  2406. }, a.phaseData = angular.copy(a.phaseDataModel), t.getUserSubordinates(function(o) {
  2407. var r = [a.globals.userDetails.Id];
  2408. if (o.success)
  2409. for (var n = 0; o.data && n < o.data.length; n++) o.data[n].Id && r.push(o.data[n].Id);
  2410. e.subordinates = r;
  2411. var i = [t.buildFilter("CreatedBy", null, "anyof", r), {
  2412. andor: "and"
  2413. }, t.buildFilter("Status", null, "is", "active")];
  2414. t.sync(t.buildRequest("get", ["projects"], null, [i]), function(a) {
  2415. a.success ? (e.activeProjects = a.data, "object" != typeof e.activeProjects && (e.activeProjects = []), e.activeProjects instanceof Array || (e.activeProjects = [e.activeProjects])) : e.activeProjects = [], e.getCostAvoidance(), e.getTimeTrack();
  2416. for (var t = 0; e.activeProjects && t < e.activeProjects.length; t++) e.activeProjects[t].chart = {
  2417. percent: Math.round(e.activeProjects[t].CompletionPercentage),
  2418. options: {
  2419. animate: {
  2420. duration: 1500,
  2421. enabled: !1
  2422. },
  2423. barColor: e.color.primary,
  2424. lineCap: "round",
  2425. size: 120,
  2426. lineWidth: 5
  2427. }
  2428. }
  2429. }), e.getScopeChanges(), e.getProjectTimeline(null)
  2430. }), e.getTimeTrack = function() {
  2431. for (var a = "ON TRACK", t = 0; e.activeProjects && t < e.activeProjects.length; t++) {
  2432. for (var o = e.activeProjects[t], r = {
  2433. Define: {
  2434. rd: moment(o.DefineReviewDate),
  2435. incomplete: 0
  2436. },
  2437. Measure: {
  2438. rd: moment(o.MeasureReviewDate),
  2439. incomplete: 0
  2440. },
  2441. Analyze: {
  2442. rd: moment(o.AnalyzeReviewDate),
  2443. incomplete: 0
  2444. },
  2445. Improve: {
  2446. rd: moment(o.ImproveReviewDate),
  2447. incomplete: 0
  2448. },
  2449. Control: {
  2450. rd: moment(o.ControlReviewDate),
  2451. incomplete: 0
  2452. }
  2453. }, n = 0; o.PhaseData && n < o.PhaseData.length; n++) {
  2454. var i = o.PhaseData[n];
  2455. if ("complete" !== i.Status) {
  2456. var s = moment().diff(r[i.PhaseName].rd, "days");
  2457. if (s > 0) {
  2458. a = "OFF TRACK";
  2459. break
  2460. }
  2461. if (Math.abs(s) <= r[i.PhaseName].incomplete) {
  2462. a = "OFF TRACK";
  2463. break
  2464. }
  2465. r[i.PhaseName].incomplete++
  2466. }
  2467. }
  2468. if ("OFF TRACK" == a) break
  2469. }
  2470. e.timeTracking = a
  2471. }, e.getCostAvoidance = function() {
  2472. for (var a = 0, t = 0; e.activeProjects && t < e.activeProjects.length; t++) a += parseInt(e.activeProjects[t].BusinessImpactValue);
  2473. return Math.abs(Number(a)) > 1e12 ? (e.costAvoidance = Math.round(Math.abs(Number(a)) / 1e12 * 10) / 10, void(e.costAvoidanceChar = "tr")) : Math.abs(Number(a)) > 1e9 ? (e.costAvoidance = Math.round(Math.abs(Number(a)) / 1e9 * 10) / 10, void(e.costAvoidanceChar = "b")) : Math.abs(Number(a)) > 1e6 ? (e.costAvoidance = Math.round(Math.abs(Number(a)) / 1e6 * 10) / 10, void(e.costAvoidanceChar = "m")) : Math.abs(Number(a)) > 1e3 ? (e.costAvoidance = Math.round(Math.abs(Number(a)) / 1e3 * 10) / 10, void(e.costAvoidanceChar = "k")) : void(e.costAvoidance = Math.round(10 * Math.abs(Number(a))) / 10)
  2474. }, e.getScopeChanges = function() {
  2475. t.getScopeChange(e.subordinates, function(a) {
  2476. a.success ? (e.scopeChange = "CHANGED", e.scopeChanges = a.data) : e.scopeChange = "UNCHANGED"
  2477. })
  2478. }, e.getProjectTimeline = function(a) {
  2479. t.getActionTimeline(e.subordinates, a, function(a) {
  2480. a.success && e.buildProjectTimeline(a.data)
  2481. })
  2482. }, e.buildProjectTimeline = function(a) {
  2483. function t(e) {
  2484. for (var a = r; a == r;) a = n[Math.floor(4 * Math.random())];
  2485. return e + a
  2486. }
  2487. for (var o = null, r = "btn-success", n = ["success", "primary", "info", "warning", "danger"], i = 0; a && i < a.length; i++) {
  2488. var s = moment(a[i].DateTimeCreated, "YYYYMMDD").diff(moment(), "days");
  2489. 0 === s && s != o ? (e.projectTimeline.push({
  2490. BadgeColor: "btn-success",
  2491. NewDay: "Today"
  2492. }), o = 0) : 1 === s && s != o ? (e.projectTimeline.push({
  2493. BadgeColor: t("btn-"),
  2494. NewDay: "Yesterday"
  2495. }), o = 1) : s != o && (e.projectTimeline.push({
  2496. BadgeColor: t("btn-"),
  2497. NewDay: moment(a[i].DateTimeCreated).format("ll")
  2498. }), o = s), a[i].Caption && e.projectTimeline.push({
  2499. ProjectId: a[i].ProjectId,
  2500. HeaderColor: t("text-"),
  2501. BadgeColor: t("btn-"),
  2502. DateTime: 0 == s ? moment(a[i].DateTimeCreated).fromNow() : moment(a[i].DateTimeCreated).format("LT"),
  2503. Icon: a[i].Icon,
  2504. Caption: a[i].Caption,
  2505. isAlt: i % 2 === 0 ? !1 : !0
  2506. })
  2507. }
  2508. }, e.animateElementIn = function(e) {
  2509. e.removeClass("timeline-hidden"), e.addClass("bounce-in")
  2510. }, e.animateElementOut = function(e) {
  2511. e.addClass("timeline-hidden"), e.removeClass("bounce-in")
  2512. }
  2513. }
  2514. angular.module("app.dashboard").controller("dashboardCtrl", ["$scope", "$rootScope", "DataSyncService", "$timeout", e])
  2515. }(),
  2516. function() {
  2517. "use strict";
  2518.  
  2519. function e(e) {
  2520. e.user = {
  2521. title: "Developer",
  2522. email: "ipsum@lorem.com",
  2523. firstName: "",
  2524. lastName: "",
  2525. company: "Google",
  2526. address: "1600 Amphitheatre Pkwy",
  2527. city: "Mountain View",
  2528. state: "CA",
  2529. biography: "Loves kittens, snowboarding, and can type at 130 WPM.\n\nAnd rumor has it she bouldered up Castle Craig!",
  2530. postalCode: "94043"
  2531. }, e.states = "AL AK AZ AR CA CO CT DE FL GA HI ID IL IN IA KS KY LA ME MD MA MI MN MS MO MT NE NV NH NJ NM NY NC ND OH OK OR PA RI SC SD TN TX UT VT VA WA WV WI WY".split(" ").map(function(e) {
  2532. return {
  2533. abbrev: e
  2534. }
  2535. })
  2536. }
  2537.  
  2538. function a(e) {
  2539. e.checkbox = {}, e.checkbox.cb1 = !0, e.checkbox.cb2 = !1, e.checkbox.cb3 = !1, e.checkbox.cb4 = !1, e.checkbox.cb5 = !1, e.checkbox.cb6 = !0, e.checkbox.cb7 = !0, e.checkbox.cb8 = !0, e.items = [1, 2, 3, 4, 5], e.selected = [], e.toggle = function(e, a) {
  2540. var t = a.indexOf(e);
  2541. t > -1 ? a.splice(t, 1) : a.push(e)
  2542. }, e.exists = function(e, a) {
  2543. return a.indexOf(e) > -1
  2544. }
  2545. }
  2546.  
  2547. function t(e) {
  2548. e.radio = {
  2549. group1: "Banana",
  2550. group2: "2",
  2551. group3: "Primary"
  2552. }, e.radioData = [{
  2553. label: "Radio: disabled",
  2554. value: "1",
  2555. isDisabled: !0
  2556. }, {
  2557. label: "Radio: disabled, Checked",
  2558. value: "2",
  2559. isDisabled: !0
  2560. }], e.contacts = [{
  2561. id: 1,
  2562. fullName: "Maria Guadalupe",
  2563. lastName: "Guadalupe",
  2564. title: "CEO, Found"
  2565. }, {
  2566. id: 2,
  2567. fullName: "Gabriel García Marquéz",
  2568. lastName: "Marquéz",
  2569. title: "VP Sales & Marketing"
  2570. }, {
  2571. id: 3,
  2572. fullName: "Miguel de Cervantes",
  2573. lastName: "Cervantes",
  2574. title: "Manager, Operations"
  2575. }, {
  2576. id: 4,
  2577. fullName: "Pacorro de Castel",
  2578. lastName: "Castel",
  2579. title: "Security"
  2580. }], e.selectedIndex = 2, e.selectedUser = function() {
  2581. var a = e.selectedIndex - 1;
  2582. return e.contacts[a].lastName
  2583. }
  2584. }
  2585.  
  2586. function o(e) {
  2587. e.color = {
  2588. red: 97,
  2589. green: 211,
  2590. blue: 140
  2591. }, e.rating1 = 3, e.rating2 = 2, e.rating3 = 4, e.disabled1 = 0, e.disabled2 = 70, e.user = {
  2592. title: "Developer",
  2593. email: "ipsum@lorem.com",
  2594. firstName: "",
  2595. lastName: "",
  2596. company: "Google",
  2597. address: "1600 Amphitheatre Pkwy",
  2598. city: "Mountain View",
  2599. state: "CA",
  2600. biography: "Loves kittens, snowboarding, and can type at 130 WPM.\n\nAnd rumor has it she bouldered up Castle Craig!",
  2601. postalCode: "94043"
  2602. }, e.select1 = "1", e.toppings = [{
  2603. category: "meat",
  2604. name: "Pepperoni"
  2605. }, {
  2606. category: "meat",
  2607. name: "Sausage"
  2608. }, {
  2609. category: "meat",
  2610. name: "Ground Beef"
  2611. }, {
  2612. category: "meat",
  2613. name: "Bacon"
  2614. }, {
  2615. category: "veg",
  2616. name: "Mushrooms"
  2617. }, {
  2618. category: "veg",
  2619. name: "Onion"
  2620. }, {
  2621. category: "veg",
  2622. name: "Green Pepper"
  2623. }, {
  2624. category: "veg",
  2625. name: "Green Olives"
  2626. }], e.favoriteTopping = e.toppings[0].name, e.switchData = {
  2627. cb1: !0,
  2628. cbs: !1,
  2629. cb4: !0,
  2630. color1: !0,
  2631. color2: !0,
  2632. color3: !0
  2633. }, e.switchOnChange = function(a) {
  2634. e.message = "The switch is now: " + a
  2635. }
  2636. }
  2637.  
  2638. function r(e, a, t, o) {
  2639. function r(e) {
  2640. alert("Sorry! You'll need to create a Constituion for " + e + " first!")
  2641. }
  2642.  
  2643. function n(o) {
  2644. var r, n = o ? e.states.filter(c(o)) : e.states;
  2645. return e.simulateQuery ? (r = t.defer(), a(function() {
  2646. r.resolve(n)
  2647. }, 1e3 * Math.random(), !1), r.promise) : n
  2648. }
  2649.  
  2650. function i(e) {}
  2651.  
  2652. function s(e) {}
  2653.  
  2654. function l() {
  2655. var e = "Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware, Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana, Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana, Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina, North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina, South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia, Wisconsin, Wyoming";
  2656. return e.split(/, +/g).map(function(e) {
  2657. return {
  2658. value: e.toLowerCase(),
  2659. display: e
  2660. }
  2661. })
  2662. }
  2663.  
  2664. function c(e) {
  2665. var a = angular.lowercase(e);
  2666. return function(e) {
  2667. return 0 === e.value.indexOf(a)
  2668. }
  2669. }
  2670. var e = this;
  2671. e.simulateQuery = !1, e.isDisabled = !1, e.states = l(), e.querySearch = n, e.selectedItemChange = s, e.searchTextChange = i, e.newState = r
  2672. }
  2673.  
  2674. function n(e) {
  2675. e.myDate = new Date, e.minDate = new Date(e.myDate.getFullYear(), e.myDate.getMonth() - 2, e.myDate.getDate()), e.maxDate = new Date(e.myDate.getFullYear(), e.myDate.getMonth() + 2, e.myDate.getDate())
  2676. }
  2677.  
  2678. function i(e) {
  2679. e.today = function() {
  2680. e.dt = new Date
  2681. }, e.today(), e.clear = function() {
  2682. e.dt = null
  2683. }, e.disabled = function(e, a) {
  2684. return "day" === a && (0 === e.getDay() || 6 === e.getDay())
  2685. }, e.toggleMin = function() {
  2686. e.minDate = e.minDate ? null : new Date
  2687. }, e.toggleMin(), e.maxDate = new Date(2020, 5, 22), e.open = function(a) {
  2688. e.status.opened = !0
  2689. }, e.setDate = function(a, t, o) {
  2690. e.dt = new Date(a, t, o)
  2691. }, e.dateOptions = {
  2692. formatYear: "yy",
  2693. startingDay: 1
  2694. }, e.formats = ["dd-MMMM-yyyy", "yyyy/MM/dd", "dd.MM.yyyy", "shortDate"], e.format = e.formats[0], e.status = {
  2695. opened: !1
  2696. };
  2697. var a = new Date;
  2698. a.setDate(a.getDate() + 1);
  2699. var t = new Date;
  2700. t.setDate(a.getDate() + 2), e.events = [{
  2701. date: a,
  2702. status: "full"
  2703. }, {
  2704. date: t,
  2705. status: "partially"
  2706. }], e.getDayClass = function(a, t) {
  2707. if ("day" === t)
  2708. for (var o = new Date(a).setHours(0, 0, 0, 0), r = 0; r < e.events.length; r++) {
  2709. var n = new Date(e.events[r].date).setHours(0, 0, 0, 0);
  2710. if (o === n) return e.events[r].status
  2711. }
  2712. return ""
  2713. }
  2714. }
  2715.  
  2716. function s(e) {
  2717. e.mytime = new Date, e.hstep = 1, e.mstep = 15, e.options = {
  2718. hstep: [1, 2, 3],
  2719. mstep: [1, 5, 10, 15, 25, 30]
  2720. }, e.ismeridian = !0, e.toggleMode = function() {
  2721. return e.ismeridian = !e.ismeridian
  2722. }, e.update = function() {
  2723. var a;
  2724. return a = new Date, a.setHours(14), a.setMinutes(0), e.mytime = a
  2725. }, e.changed = function() {}, e.clear = function() {
  2726. return e.mytime = null
  2727. }
  2728. }
  2729.  
  2730. function l(e) {
  2731. e.selected = void 0, e.states = ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Dakota", "North Carolina", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"]
  2732. }
  2733.  
  2734. function c(e) {
  2735. e.rate = 7, e.max = 10, e.isReadonly = !1, e.hoveringOver = function(a) {
  2736. return e.overStar = a, e.percent = 100 * (a / e.max)
  2737. }, e.ratingStates = [{
  2738. stateOn: "glyphicon-ok-sign",
  2739. stateOff: "glyphicon-ok-circle"
  2740. }, {
  2741. stateOn: "glyphicon-star",
  2742. stateOff: "glyphicon-star-empty"
  2743. }, {
  2744. stateOn: "glyphicon-heart",
  2745. stateOff: "glyphicon-ban-circle"
  2746. }, {
  2747. stateOn: "glyphicon-heart"
  2748. }, {
  2749. stateOff: "glyphicon-off"
  2750. }]
  2751. }
  2752. angular.module("app.ui.form").controller("InputCtrl", ["$scope", e]).controller("CheckboxCtrl", ["$scope", a]).controller("RadioCtrl", ["$scope", t]).controller("FormCtrl", ["$scope", o]).controller("MaterialAutocompleteCtrl", ["$scope", "$timeout", "$q", "$log", r]).controller("MaterialDatepickerCtrl", ["$scope", n]).controller("DatepickerDemoCtrl", ["$scope", i]).controller("TimepickerDemoCtrl", ["$scope", s]).controller("TypeaheadCtrl", ["$scope", l]).controller("RatingDemoCtrl", ["$scope", c])
  2753. }(),
  2754. function() {
  2755. "use strict";
  2756.  
  2757. function e() {
  2758. return {
  2759. restrict: "A",
  2760. link: function(e, a) {
  2761. a.slider()
  2762. }
  2763. }
  2764. }
  2765.  
  2766. function a() {
  2767. return {
  2768. restrict: "A",
  2769. compile: function(e, a) {
  2770. return e.addClass("ui-spinner"), {
  2771. post: function() {
  2772. e.spinner()
  2773. }
  2774. }
  2775. }
  2776. }
  2777. }
  2778.  
  2779. function t() {
  2780. return {
  2781. restrict: "A",
  2782. link: function(e, a) {
  2783. a.steps()
  2784. }
  2785. }
  2786. }
  2787. angular.module("app.ui.form").directive("uiRangeSlider", e).directive("uiSpinner", a).directive("uiWizardForm", t)
  2788. }(),
  2789. function() {
  2790. "use strict";
  2791.  
  2792. function e(e) {
  2793. var a;
  2794. e.form = {
  2795. required: "",
  2796. minlength: "",
  2797. maxlength: "",
  2798. length_rage: "",
  2799. type_something: "",
  2800. confirm_type: "",
  2801. foo: "",
  2802. email: "",
  2803. url: "",
  2804. num: "",
  2805. minVal: "",
  2806. maxVal: "",
  2807. valRange: "",
  2808. pattern: ""
  2809. }, a = angular.copy(e.form), e.revert = function() {
  2810. return e.form = angular.copy(a), e.form_constraints.$setPristine()
  2811. }, e.canRevert = function() {
  2812. return !angular.equals(e.form, a) || !e.form_constraints.$pristine
  2813. }, e.canSubmit = function() {
  2814. return e.form_constraints.$valid && !angular.equals(e.form, a)
  2815. }, e.submitForm = function() {
  2816. return e.showInfoOnSubmit = !0, e.revert()
  2817. }
  2818. }
  2819.  
  2820. function a(e) {
  2821. var a;
  2822. e.user = {
  2823. email: "",
  2824. passowrd: ""
  2825. }, a = angular.copy(e.user), e.revert = function() {
  2826. e.user = angular.copy(a), e.materialLoginForm.$setPristine(), e.materialLoginForm.$setUntouched()
  2827. }, e.canRevert = function() {
  2828. return !angular.equals(e.user, a) || !e.materialLoginForm.$pristine
  2829. }, e.canSubmit = function() {
  2830. return e.materialLoginForm.$valid && !angular.equals(e.user, a)
  2831. }, e.submitForm = function() {
  2832. return e.showInfoOnSubmit = !0, e.revert()
  2833. }
  2834. }
  2835.  
  2836. function t(e) {
  2837. var a;
  2838. e.user = {
  2839. name: "",
  2840. email: "",
  2841. passowrd: ""
  2842. }, a = angular.copy(e.user), e.revert = function() {
  2843. e.user = angular.copy(a), e.materialSignUpForm.$setPristine(), e.materialSignUpForm.$setUntouched()
  2844. }, e.canRevert = function() {
  2845. return !angular.equals(e.user, a) || !e.materialSignUpForm.$pristine
  2846. }, e.canSubmit = function() {
  2847. return e.materialSignUpForm.$valid && !angular.equals(e.user, a)
  2848. }, e.submitForm = function() {
  2849. return e.showInfoOnSubmit = !0, e.revert()
  2850. }
  2851. }
  2852.  
  2853. function o(e) {
  2854. var a;
  2855. e.user = {
  2856. email: "",
  2857. password: ""
  2858. }, e.showInfoOnSubmit = !1, a = angular.copy(e.user), e.revert = function() {
  2859. return e.user = angular.copy(a), e.form_signin.$setPristine()
  2860. }, e.canRevert = function() {
  2861. return !angular.equals(e.user, a) || !e.form_signin.$pristine
  2862. }, e.canSubmit = function() {
  2863. return e.form_signin.$valid && !angular.equals(e.user, a)
  2864. }, e.submitForm = function() {
  2865. return e.showInfoOnSubmit = !0, e.revert()
  2866. }
  2867. }
  2868.  
  2869. function r(e) {
  2870. var a;
  2871. e.user = {
  2872. name: "",
  2873. email: "",
  2874. password: "",
  2875. confirmPassword: "",
  2876. age: ""
  2877. }, e.showInfoOnSubmit = !1, a = angular.copy(e.user), e.revert = function() {
  2878. return e.user = angular.copy(a), e.form_signup.$setPristine(), e.form_signup.confirmPassword.$setPristine()
  2879. }, e.canRevert = function() {
  2880. return !angular.equals(e.user, a) || !e.form_signup.$pristine
  2881. }, e.canSubmit = function() {
  2882. return e.form_signup.$valid && !angular.equals(e.user, a)
  2883. }, e.submitForm = function() {
  2884. return e.showInfoOnSubmit = !0, e.revert()
  2885. }
  2886. }
  2887. angular.module("app.ui.form.validation").controller("FormConstraintsCtrl", ["$scope", e]).controller("MaterialLoginCtrl", ["$scope", a]).controller("MaterialSignUpCtrl", ["$scope", t]).controller("SigninCtrl", ["$scope", o]).controller("SignupCtrl", ["$scope", r])
  2888. }(),
  2889. function() {
  2890. "use strict";
  2891.  
  2892. function e(e, a, t, o, r, n) {
  2893. e.isDisabled = !1, e.selectedItem = null, e.searchText = "", e.searchResults = [], e.lastSearchVal = "", e.userDetails = a.globals.userDetails, e.profileImage = e.userDetails ? e.userDetails.ProfileImageUrl : "images/generic-profile.png", e.querySearch = function(o) {
  2894. if (o.length > 2 && o != e.lastSearchVal) {
  2895. var r = [];
  2896. if (0 === o.indexOf("PROJ")) {
  2897. var i = o.slice(4, o.length);
  2898. r.push(t.buildFilter("Id", null, "is", i))
  2899. } else r.push(t.buildFilter("Name", null, "contains", o));
  2900. var s = n.post("https://api.l6elite.com", t.buildRequest("get", ["projects"], null, [r])).then(function(e) {
  2901. return a.$broadcast("preloader:hide"), e.data
  2902. }, function(e) {
  2903. return a.$broadcast("preloader:hide"), []
  2904. });
  2905. return s
  2906. }
  2907. }, a.$on("$userDetailPopulated", function(t) {
  2908. e.userDetails = a.globals.userDetails, e.profileImage = e.userDetails ? e.userDetails.ProfileImageUrl : "images/generic-profile.png"
  2909. }), e.selectedItemChange = function(e) {
  2910. e && o.path("/project/" + e.Id)
  2911. }
  2912. }
  2913. angular.module("app.layout").controller("L6HeaderCtrl", ["$scope", "$rootScope", "DataSyncService", "$location", "$timeout", "$http", e])
  2914. }(),
  2915. function() {
  2916. "use strict";
  2917.  
  2918. function e(e) {
  2919. return {
  2920. restrict: "A",
  2921. template: '<span class="bar"></span>',
  2922. link: function(e, a, t) {
  2923. a.addClass("preloaderbar hide"), e.$on("$stateChangeStart", function(e) {
  2924. a.removeClass("hide").addClass("active")
  2925. }), e.$on("$stateChangeSuccess", function(e, t, o, r) {
  2926. e.targetScope.$watch("$viewContentLoaded", function() {
  2927. a.addClass("hide").removeClass("active")
  2928. })
  2929. }), e.$on("preloader:active", function(e) {
  2930. a.removeClass("hide").addClass("active")
  2931. }), e.$on("preloader:hide", function(e) {
  2932. a.addClass("hide").removeClass("active")
  2933. })
  2934. }
  2935. }
  2936. }
  2937. angular.module("app.layout").directive("uiPreloader", ["$rootScope", e])
  2938. }(),
  2939. function() {
  2940. function e() {
  2941. $("#loader-container").fadeOut("slow")
  2942. }
  2943. $(window).load(function() {
  2944. setTimeout(e, 1e3)
  2945. })
  2946. }(),
  2947. function() {
  2948. "use strict";
  2949.  
  2950. function e(e) {
  2951. function a(a, t, o) {
  2952. var r;
  2953. r = $("#app"), t.on("click", function(a) {
  2954. return r.hasClass("nav-collapsed-min") ? r.removeClass("nav-collapsed-min") : (r.addClass("nav-collapsed-min"), e.$broadcast("nav:reset")), a.preventDefault()
  2955. })
  2956. }
  2957. var t = {
  2958. restrict: "A",
  2959. link: a
  2960. };
  2961. return t
  2962. }
  2963.  
  2964. function a() {
  2965. function e(e, a, t) {
  2966. var o, r, n, i, s, l, c, u, d, p, h;
  2967. p = 250, c = $(window), i = a.find("ul").parent("li"), i.append('<i class="fa fa-angle-down icon-has-ul-h"></i>'), o = i.children("a"), o.append('<i class="fa fa-angle-down icon-has-ul"></i>'), s = a.children("li").not(i), r = s.children("a"), n = $("#app"), l = $("#nav-container"), o.on("click", function(e) {
  2968. var a, t;
  2969. return n.hasClass("nav-collapsed-min") || l.hasClass("nav-horizontal") && c.width() >= 768 ? !1 : (t = $(this), a = t.parent("li"), i.not(a).removeClass("open").find("ul").slideUp(p), a.toggleClass("open").find("ul").stop().slideToggle(p), void e.preventDefault())
  2970. }), r.on("click", function(e) {
  2971. i.removeClass("open").find("ul").slideUp(p)
  2972. }), e.$on("nav:reset", function(e) {
  2973. i.removeClass("open").find("ul").slideUp(p)
  2974. }), u = void 0, d = c.width(), h = function() {
  2975. var e;
  2976. e = c.width(), 768 > e && n.removeClass("nav-collapsed-min"), 768 > d && e >= 768 && l.hasClass("nav-horizontal") && i.removeClass("open").find("ul").slideUp(p), d = e
  2977. }, c.resize(function() {
  2978. var e;
  2979. clearTimeout(e), e = setTimeout(h, 300)
  2980. })
  2981. }
  2982. var a = {
  2983. restrict: "A",
  2984. link: e
  2985. };
  2986. return a
  2987. }
  2988.  
  2989. function t() {
  2990. function e(e, a, t, o) {
  2991. var r, n, i;
  2992. n = a.find("a"), i = function() {
  2993. return o.path()
  2994. }, r = function(e, a) {
  2995. return a = "#" + a, angular.forEach(e, function(e) {
  2996. var t, o, r;
  2997. return o = angular.element(e), t = o.parent("li"), r = o.attr("href"), t.hasClass("active") && t.removeClass("active"), 0 === a.indexOf(r) ? t.addClass("active") : void 0
  2998. })
  2999. }, r(n, o.path()), e.$watch(i, function(e, a) {
  3000. return e !== a ? r(n, o.path()) : void 0
  3001. })
  3002. }
  3003. var a = {
  3004. restrict: "A",
  3005. controller: ["$scope", "$element", "$attrs", "$location", e]
  3006. };
  3007. return a
  3008. }
  3009.  
  3010. function o() {
  3011. function e(e, a, t) {
  3012. a.on("click", function() {
  3013. return $("#app").toggleClass("on-canvas")
  3014. })
  3015. }
  3016. var a = {
  3017. restrict: "A",
  3018. link: e
  3019. };
  3020. return a
  3021. }
  3022. angular.module("app.layout").directive("toggleNavCollapsedMin", ["$rootScope", e]).directive("collapseNav", a).directive("highlightActive", t).directive("toggleOffCanvas", o)
  3023. }(),
  3024. function() {
  3025. "use strict";
  3026.  
  3027. function e(e) {
  3028. var a;
  3029. e.worldMap = {}, a = [{
  3030. latLng: [40.71, -74],
  3031. name: "New York"
  3032. }, {
  3033. latLng: [39.9, 116.4],
  3034. name: "Beijing"
  3035. }, {
  3036. latLng: [31.23, 121.47],
  3037. name: "Shanghai"
  3038. }, {
  3039. latLng: [-33.86, 151.2],
  3040. name: "Sydney"
  3041. }, {
  3042. latLng: [-37.81, 144.96],
  3043. name: "Melboune"
  3044. }, {
  3045. latLng: [37.33, -121.89],
  3046. name: "San Jose"
  3047. }, {
  3048. latLng: [1.3, 103.8],
  3049. name: "Singapore"
  3050. }, {
  3051. latLng: [47.6, -122.33],
  3052. name: "Seattle"
  3053. }, {
  3054. latLng: [41.87, -87.62],
  3055. name: "Chicago"
  3056. }, {
  3057. latLng: [37.77, -122.41],
  3058. name: "San Francisco"
  3059. }, {
  3060. latLng: [32.71, -117.16],
  3061. name: "San Diego"
  3062. }, {
  3063. latLng: [51.5, -.12],
  3064. name: "London"
  3065. }, {
  3066. latLng: [48.85, 2.35],
  3067. name: "Paris"
  3068. }, {
  3069. latLng: [52.52, 13.4],
  3070. name: "Berlin"
  3071. }, {
  3072. latLng: [-26.2, 28.04],
  3073. name: "Johannesburg"
  3074. }, {
  3075. latLng: [35.68, 139.69],
  3076. name: "Tokyo"
  3077. }, {
  3078. latLng: [13.72, 100.52],
  3079. name: "Bangkok"
  3080. }, {
  3081. latLng: [37.56, 126.97],
  3082. name: "Seoul"
  3083. }, {
  3084. latLng: [41.87, 12.48],
  3085. name: "Roma"
  3086. }, {
  3087. latLng: [45.42, -75.69],
  3088. name: "Ottawa"
  3089. }, {
  3090. latLng: [55.75, 37.61],
  3091. name: "Moscow"
  3092. }, {
  3093. latLng: [-22.9, -43.19],
  3094. name: "Rio de Janeiro"
  3095. }], e.worldMap = {
  3096. map: "world_mill_en",
  3097. markers: a,
  3098. normalizeFunction: "polynomial",
  3099. backgroundColor: null,
  3100. zoomOnScroll: !1,
  3101. regionStyle: {
  3102. initial: {
  3103. fill: "#EEEFF3"
  3104. },
  3105. hover: {
  3106. fill: e.color.primary
  3107. }
  3108. },
  3109. markerStyle: {
  3110. initial: {
  3111. fill: "#BF616A",
  3112. stroke: "rgba(191,97,106,.8)",
  3113. "fill-opacity": 1,
  3114. "stroke-width": 9,
  3115. "stroke-opacity": .5
  3116. },
  3117. hover: {
  3118. stroke: "black",
  3119. "stroke-width": 2
  3120. }
  3121. }
  3122. }
  3123. }
  3124. angular.module("app.ui.map").controller("jvectormapCtrl", ["$scope", e])
  3125. }(),
  3126. function() {
  3127. "use strict";
  3128.  
  3129. function e() {
  3130. return {
  3131. restrict: "A",
  3132. scope: {
  3133. options: "="
  3134. },
  3135. link: function(e, a, t) {
  3136. var o;
  3137. o = e.options, a.vectorMap(o)
  3138. }
  3139. }
  3140. }
  3141. angular.module("app.ui.map").directive("uiJvectormap", e)
  3142. }(),
  3143. function() {
  3144. "use strict";
  3145.  
  3146. function e(e, a) {
  3147. var t, o, r;
  3148. e.printInvoice = function() {
  3149. t = document.getElementById("invoice").innerHTML, o = document.body.innerHTML, r = window.open(), r.document.open(), r.document.write('<html><head><link rel="stylesheet" type="text/css" href="styles/main.css" /></head><body onload="window.print()">' + t + "</html>"), r.document.close()
  3150. }
  3151. }
  3152.  
  3153. function a(e, a, t, o, r, n, i, s, l, c) {
  3154. e.loginError = !1, e.email = "", e.password = "", e.showEULA = function(a) {
  3155. var s = c.confirm().title("EULA").content('<p class="lead">By accessing this demo and clicking the "I Agree" button below, you are acknowledging and accepting the terms of the following End User License Agreement:</p><div style="max-height:300px;overflow:auto"><p>L6 Elite is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. L6 Elite is licensed, not sold.</p> <h4>End User License Agreement</h4> <p>This End User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and Wallace & Associates with regard to the copyrighted Software L6 Elite (herein referred to as "SOFTWARE PRODUCT" or "SOFTWARE") provided with this EULA.</p> <p>The SOFTWARE PRODUCT includes computer software, the associated media, any printed materials, and any "online" or electronic documentation. Use of any software and related documentation ("Software") provided to you by Wallace & Associates in whatever form or media, will constitute your acceptance of these terms, unless separate terms are provided by the software supplier, in which case certain additional or different terms may apply.</p><p>If you do not agree with the terms of this EULA, do not download, install, copy or use the Software. By installing, copying or otherwise using the SOFTWARE PRODUCT, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA, Wallace & Associates is unwilling to license the SOFTWARE PRODUCT to you.</p><p>1. <b>Eligible Licensees</b>. This Software is available for license solely to SOFTWARE owners, with no right of duplication or further distribution, licensing, or sub-licensing. IF YOU DO NOT OWN THE SOFTWARE OR DO NOT HAVE EXPLICIT CONSENT BY WALLACE & ASSOCIATES TO ACCESS THE SOFTWARE, THEN DO NOT DOWNLOAD, INSTALL, COPY OR USE THE SOFTWARE.</p> <p>2. <b>License Grant</b>. Wallace & Associates grants to you a personal, non-transferable and non-exclusive right to use the copy of the Software provided with this EULA. You agree you will not copy the Software except as necessary to use it on a single computer. You agree that you may not copy the written materials accompanying the Software. Modifying, translating, renting, copying, transferring or assigning all or part of the Software, or any rights granted hereunder, to any other persons and removing any proprietary notices, labels or marks from the Software is strictly prohibited. Furthermore, you hereby agree not to create derivative works based on the Software. You may not transfer this Software.</p> <p>3. <b>Copyright</b>. The Software is licensed, not sold. You acknowledge that no title to the intellectual property in the Software is transferred to you. You further acknowledge that title and full ownership rights to the Software will remain the exclusive property of Wallace & Associates and/or its suppliers, and you will not acquire any rights to the Software, except as expressly set forth above. All copies of the Software will contain the same proprietary notices as contained in or on the Software. All title and copyrights in and to the SOFTWARE PRODUCT (including but not limited to any images, photographs, animations, video, audio, music, text and "applets," incorporated into the SOFTWARE PRODUCT), the accompanying printed materials, and any copies of the SOFTWARE PRODUCT, are owned by Wallace & Associates or its suppliers. The SOFTWARE PRODUCT is protected by copyright laws and international treaty provisions. You may not copy the printed materials accompanying the SOFTWARE PRODUCT.</p> <p>4. <b>Reverse Engineering</b>. You agree that you will not attempt, and if you are a corporation, you will use your best efforts to prevent your employees and contractors from attempting to reverse compile, modify, translate or disassemble the Software in whole or in part. Any failure to comply with the above or any other terms and conditions contained herein will result in the automatic termination of this license and the reversion of the rights granted hereunder to Wallace & Associates. </p><p>5. <b>Disclaimer of Warranty</b>. The Software is provided "AS IS" without warranty of any kind. Wallace & Associates and its suppliers disclaim and make no express or implied warranties and specifically disclaim the warranties of merchantability, fitness for a particular purpose and non-infringement of third-party rights. The entire risk as to the quality and performance of the Software is with you. Neither Wallace & Associates nor its suppliers warrant that the functions contained in the Software will meet your requirements or that the operation of the Software will be uninterrupted or error-free. Wallace & Associates IS NOT OBLIGATED TO PROVIDE ANY UPDATES TO THE SOFTWARE.</p> <p>6. <b>Limitation of Liability</b>. Wallace & Associates'
  3156. entire liability and your exclusive remedy under this EULA shall not exceed the price paid
  3157. for the Software,
  3158. if any.In no event shall Wallace & Associates or its suppliers be liable to you
  3159. for any consequential, special, incidental or indirect damages of any kind arising out of the use or inability to use the software, even
  3160. if Wallace & Associates or its supplier has been advised of the possibility of such damages, or any claim by a third party. < /p><p>7. <b>Rental</b > .You may not loan, rent, or lease the SOFTWARE. < /p><p>8. <b>Upgrades</b > .If the SOFTWARE is an upgrade from an earlier release or previously released version, you now may use that upgraded product only in accordance with this EULA.If the SOFTWARE PRODUCT is an upgrade of a software program which you licensed as a single product, the SOFTWARE PRODUCT may be used only as part of that single product package and may not be separated
  3161. for use on more than one computer. < /p> <p>9. <b>OEM Product Support</b > .Product support
  3162. for the SOFTWARE PRODUCT IS provided by Wallace & Associates.For product support, please call Wallace & Associates.Should you have any questions concerning this, please refer to the address and contact information provided in the documentation. < /p> <p>10. <b>No Liability for Consequential Damages</b > .In no event shall Wallace & Associates or its suppliers be liable
  3163. for any damages whatsoever(including, without limitation, incidental, direct, indirect special and consequential damages, damages
  3164. for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use or inability to use this "Your Company"
  3165. product, even
  3166. if Wallace & Associates has been advised of the possibility of such damages.Because some states / countries do not allow the exclusion or limitation of liability
  3167. for
  3168. consequential or incidental damages, the above limitation may not apply to you. < /p> <p>11. <b>Indemnification By You</b > .If you distribute the Software in violation of this Agreement, you agree to indemnify, hold harmless and defend Wallace & Associates and its suppliers from and against any claims or lawsuits, including attorney 's fees that arise or result from the use or distribution of the Software in violation of this Agreement.</p><p style="max-height:300px;overflow:auto">').ariaLabel("EULA").ok("I Agree").cancel("I Disagree");
  3169. c.show(s).then(function() {
  3170. i.SetCredentials(e.email, e.password), n.globals.userDetails = a.data, r.put("globals", JSON.stringify(n.globals)), o(function() {
  3171. t.path("/dashboard")
  3172. }, 800)
  3173. }, function() {
  3174. window.location = "https://api.l6elite.com"
  3175. })
  3176. }, e.clearLoginError = function() {
  3177. e.loginError = !1
  3178. }, e.login = function() {
  3179. return "" == e.email || "" == e.password || -1 == e.email.indexOf("l6elite") ? (e.loginError = "Either the email address or password provided are incorrect!", o(function() {
  3180. e.clearLoginError()
  3181. }, 5e3), !1) : (i.ClearCredentials(), void i.Login(e.email, e.password, function(a) {
  3182. a.success ? e.showEULA(a) : (e.loginError = "Either the email address or password provided are incorrect!", o(function() {
  3183. e.clearLoginError()
  3184. }, 5e3))
  3185. }))
  3186. }, e.resetPassword = function() {
  3187. deb
  3188. return e.email ? void l.post("https://api.l6elite.com/passwordreset", {
  3189. EmailAddress: e.email
  3190. }, function(e) {
  3191. e.success ? s.logSuccess("Password Successfully Reset! An Email Has Been Sent To The User!") : s.logError("An Error Occurred. Please Verify The Email Address Is Correct!")
  3192. }) : (s.logError("Please Provide A Valid Email Address!"), !1)
  3193. }, e.signup = function() {
  3194. t.url("/")
  3195. }, e.reset = function() {
  3196. t.url("/")
  3197. }, e.unlock = function() {
  3198. t.url("/")
  3199. }
  3200. }
  3201.  
  3202. function t(e, a, t, o, r, n, i, s, l) {
  3203. e.loginError = !1, e.email = "", e.password = "", e.clearLoginError = function() {
  3204. e.loginError = !1
  3205. }, e.login = function() {
  3206. return "" == e.email || "" == e.password ? (e.loginError = "Either the email address or password provided are incorrect!", o(function() {
  3207. e.clearLoginError()
  3208. }, 5e3), !1) : (i.ClearCredentials(), void i.Login(e.email, e.password, function(a) {
  3209. a.success ? (i.SetCredentials(e.email, e.password), n.globals.userDetails = a.data, n.$broadcast("$userDetailPopulated", a.data), r.put("globals", JSON.stringify(n.globals)), t.path("/dashboard")) : (e.loginError = "Either the email address or password provided are incorrect!", o(function() {
  3210. e.clearLoginError()
  3211. }, 5e3))
  3212. }))
  3213. }, e.resetPassword = function() {
  3214. return e.email ? void l.post("https://api.l6elite.com/passwordreset", {
  3215. EmailAddress: e.email
  3216. }, function(e) {
  3217. e.success ? s.logSuccess("Password Successfully Reset! An Email Has Been Sent To The User!") : s.logError("An Error Occurred. Please Verify The Email Address Is Correct!")
  3218. }) : (s.logError("Please Provide A Valid Email Address!"), !1)
  3219. }, e.signup = function() {
  3220. t.url("/")
  3221. }, e.reset = function() {
  3222. t.url("/")
  3223. }, e.unlock = function() {
  3224. t.url("/")
  3225. }
  3226. }
  3227.  
  3228. function o(e, a, t, o, r, n, i, s, l) {
  3229. e.currentUser = a.globals.userDetails, e.currentUserOrig = angular.copy(e.currentUser), e.passwordChange = {
  3230. currentPassword: "",
  3231. newPassword: "",
  3232. confirmNewPassword: ""
  3233. };
  3234. var c;
  3235. e.deleteProfileImage = function() {
  3236. e.currentUser.ProfileImageUrl = "images/generic-profile.png"
  3237. }, e.uploadFiles = function(a, t) {
  3238. e.f = a, e.errFile = t && t[0], a && (a.upload = i.upload({
  3239. url: "https://api.l6elite.com/imageupload",
  3240. data: {
  3241. file: a
  3242. }
  3243. }), a.upload.then(function(t) {
  3244. a.result = t.data, e.currentUser.ProfileImageUrl = t.data
  3245. }, function(e) {
  3246. e.status > 0 && r.logError(e.status + ": " + e.data)
  3247. }, function(e) {
  3248. a.progress = Math.min(100, parseInt(100 * e.loaded / e.total))
  3249. }))
  3250. }, e.changePassword = function() {
  3251. c = s.open({
  3252. templateUrl: "passwordeditor.html",
  3253. scope: e,
  3254. size: "md",
  3255. controller: ["$scope", "$uibModalInstance", function(e, a) {
  3256. e.closeModal = function() {
  3257. a.dismiss("cancel")
  3258. }
  3259. }]
  3260. })
  3261. }, e.submitPasswordChange = function() {
  3262. if (!e.passwordChange.newPassword) return r.logError("Please Provide A New Password!"), !1;
  3263. if (!e.passwordChange.confirmNewPassword) return r.logError("Please Confirm Your New Password!"), !1;
  3264. if (e.passwordChange.newPassword !== e.passwordChange.confirmNewPassword) return r.logError("Your New Password and Confirmation Do Not Match!"), !1;
  3265. var a = o.buildFilter("Id", null, "is", e.currentUser.Id),
  3266. t = {
  3267. Password: e.passwordChange.newPassword,
  3268. CurrentPassword: e.passwordChange.currentPassword
  3269. };
  3270. o.sync(o.buildRequest("update", ["users"], null, [a], [t]), function(a) {
  3271. a.success ? (r.logSuccess("Password Successfully Updated!"), l.UpdateCredentials(e.currentUser.EmailAddress, e.passwordChange.newPassword), e.passwordChange = {
  3272. currentPassword: "",
  3273. newPassword: "",
  3274. confirmNewPassword: ""
  3275. }, c.dismiss("cancel")) : r.logError("Unable To Change Password! Check That The Current Password Is Correct!")
  3276. })
  3277. }, e.saveUserProfile = function() {
  3278. if (!angular.equals(e.currentUser, e.currentUserOrig)) {
  3279. if (!e.currentUser.EmailAddress || e.profileForm.EmailAddress.$invalid) return r.logError("Please Provide A Valid Email Address!"), !1;
  3280. var i = angular.copy(e.currentUser),
  3281. s = o.buildFilter("Id", null, "is", e.currentUser.Id);
  3282. delete i.IsLoggedIn, delete i.LastLogin, delete i.LastUpdated, delete i.DateTimeCreated, delete i.CreatedBy, delete i.ClientId, delete i.Status, delete i.AccessLevelId, delete i.TimeZone, delete i.Id, o.sync(o.buildRequest("update", ["users"], null, [s], [i]), function(o) {
  3283. o.success ? (r.logSuccess("User Profile Successfully Saved!"), e.currentUser.EmailAddress != e.currentUserOrig.EmailAddress && (l.ClearCredentials(), t.path("/login")), e.currentUserOrig = angular.copy(e.currentUser), a.globals.userDetails = e.currentUser, n.put("globals", JSON.stringify(a.globals))) : r.logError(o.data[0])
  3284. })
  3285. }
  3286. }
  3287. }
  3288. angular.module("app.page").controller("invoiceCtrl", ["$scope", "$window", e]).controller("authCtrl", ["$scope", "$window", "$location", "$timeout", "$cookies", "$rootScope", "AuthenticationService", "logger", "DataSyncService", t]).controller("demoAuthCtrl", ["$scope", "$window", "$location", "$timeout", "$cookies", "$rootScope", "AuthenticationService", "logger", "DataSyncService", "$mdDialog", a]).controller("ProfileCtrl", ["$scope", "$rootScope", "$location", "DataSyncService", "logger", "$cookies", "Upload", "$uibModal", "AuthenticationService", o])
  3289. }(),
  3290. function() {
  3291. "use strict";
  3292.  
  3293. function e() {
  3294. function e(e, a, t) {
  3295. var o, r;
  3296. r = function() {
  3297. return t.path()
  3298. }, o = function(e) {
  3299. switch (a.removeClass("body-wide body-err body-lock body-auth"), e) {
  3300. case "/404":
  3301. case "/page/404":
  3302. case "/page/500":
  3303. return a.addClass("body-wide body-err");
  3304. case "/page/signin":
  3305. case "/page/signup":
  3306. case "/page/forgot-password":
  3307. return a.addClass("body-wide body-auth");
  3308. case "/page/lock-screen":
  3309. return a.addClass("body-wide body-lock")
  3310. }
  3311. }, o(t.path()), e.$watch(r, function(e, a) {
  3312. return e !== a ? o(t.path()) : void 0
  3313. })
  3314. }
  3315. var a = {
  3316. restrict: "A",
  3317. controller: ["$scope", "$element", "$location", e]
  3318. };
  3319. return a
  3320. }
  3321. angular.module("app.page").directive("customPage", e)
  3322. }(),
  3323. function() {
  3324. "use strict";
  3325.  
  3326. function e(e, a, t, o, r, n, i, s) {
  3327. console.log("Project Controller Instantiated"), a.currentProject = {}, e.projectId = t.pid, e.projectDetail = {
  3328. Name: ""
  3329. }, o.loadProject(e.projectId, function(t) {
  3330. t.success ? (e.projectDetail = a.currentProject, e.phaseData = a.phaseData) : r.path("/dashboard")
  3331. }), e.deleteProject = function() {
  3332. i.show(i.confirm().title("Delete This Project?").content("Are you positive you would like to delete this project? It will be gone forever! You can archive it instead if you still want to have the ability to search for it in the future!").ariaLabel("Confirm Deletion").ok("Get Rid Of It!").cancel("Wait! Keep it!")).then(function() {
  3333. var a = [];
  3334. a.push(o.buildFilter("Id", null, "is", e.projectDetail.Id)), o.sync(o.buildRequest("delete", ["projects"], null, [a]), function(e) {
  3335. e.success ? (n.logSuccess("Project Succesfully Deleted!"), r.path("/dashboard")) : n.logError("An Error Occurred While Deleting The Project")
  3336. })
  3337. })
  3338. }, e.archiveProject = function() {
  3339. i.show(i.confirm().title("Archive This Project?").content("Are you sure you would like to archive this project? You can search for it in the search bar or in your project history later if needed.").ariaLabel("Confirm Archive").ok("Archive It!").cancel("Wait! Keep it!")).then(function() {
  3340. var a = [],
  3341. t = {
  3342. Status: "complete"
  3343. };
  3344. a.push(o.buildFilter("Id", null, "is", e.projectDetail.Id)), o.sync(o.buildRequest("update", ["projects"], null, [a], [t]), function(e) {
  3345. e.success ? (n.logSuccess("Project Succesfully Archived!"), r.path("/dashboard")) : n.logError("An Error Occurred While Archiving The Project")
  3346. })
  3347. })
  3348. }, e.reOpenProject = function() {
  3349. var a = [],
  3350. t = {
  3351. Status: "active"
  3352. };
  3353. a.push(o.buildFilter("Id", null, "is", e.projectDetail.Id)), o.sync(o.buildRequest("update", ["projects"], null, [a], [t]), function(e) {
  3354. e.success ? (n.logSuccess("Project Succesfully Re-Opened!"), s.reload()) : n.logError("An Error Occurred While Attempting To Re-Open The Project")
  3355. })
  3356. }
  3357. }
  3358.  
  3359. function a(e, a, t, o, r, n, i, s) {
  3360. function l(a) {
  3361. e.currentStep = a;
  3362. var t = $(e.steps[a]);
  3363. $(t).show(), $("body").animate({
  3364. scrollTop: t.offset().top - 260
  3365. }, "slow")
  3366. }
  3367.  
  3368. function c(a) {
  3369. return Boolean(e.steps[a])
  3370. }
  3371. e.steps = [], $("#next_link").show(), e.currentStep = 0, e.diagramOpts = ["", "SIPOC", "Value Stream Diagram"], angular.forEach(document.querySelectorAll(".l6_step"), function(a, t) {
  3372. e.steps.push(a), $(a).attr("data-step", t), t > 0 && !$(a).hasClass("l6_spacer") && $(a).hide()
  3373. }), e.nextStep = function() {
  3374. c(e.currentStep + 1) && l(e.currentStep + 1), c(e.currentStep + 2) || $("#next_link").hide()
  3375. }, e.prevStep = function() {
  3376. c(e.currentStep - 1) && l(e.currentStep - 1)
  3377. }, e.validateField = function(a) {
  3378. var t = $(a.currentTarget).closest(".l6_step").attr("data-step"),
  3379. o = $(a.currentTarget).closest(".l6_step").attr("data-step-required"),
  3380. r = !0;
  3381. if (o) {
  3382. o = o.split(",");
  3383. for (var n = 0; o && n < o.length; n++)
  3384. if (o[n].indexOf(".")) {
  3385. for (var i = o[n].split("."), s = e.projectCharter, l = 0; i && l < i.length; l++) s = s[i[l]];
  3386. s || (r = !1)
  3387. } else e.projectCharter[o[n]] || (r = !1)
  3388. }
  3389. return e.currentStep = parseInt(t), "" !== a.currentTarget.value && r ? void e.nextStep() : !1
  3390. }, e.projectCharter = loadCharter(), e.openCalendar = function(a) {
  3391. e.projectCharter[a].status.opened = !0
  3392. }, o.loadContacts(function(a) {
  3393. e.allContacts = a, e.projectCharter.Lead = populateMdContactVariable([e.currentProject.Lead], e.allContacts), e.projectCharter.Sponsor = populateMdContactVariable([e.currentProject.Sponsor], e.allContacts), e.projectCharter.CoreTeam = populateMdContactVariable([e.currentProject.CoreTeam], e.allContacts)
  3394. }), e.querySearch = function(a) {
  3395. var t = a ? e.allContacts.filter(e.createFilterFor(a)) : [];
  3396. return t
  3397. }, e.createFilterFor = function(e) {
  3398. var a = angular.lowercase(e);
  3399. return function(e) {
  3400. return -1 !== e._lowername.indexOf(a)
  3401. }
  3402. }, e.buildProject = function() {
  3403. saveCharter(e.projectCharter, "add", o, i, function(e) {
  3404. n.path("/define/" + e.Id + "/1")
  3405. })
  3406. }, e.skipWalkthrough = function() {
  3407. var a = s.confirm().title("Diagram Type").content("What diagram would you like to use for this project?").ariaLabel("Diagram type").ok("Value Stream Diagram").cancel("SIPOC");
  3408. s.show(a).then(function() {
  3409. e.projectCharter.DiagramType = "Value Stream Diagram", saveCharter(e.projectCharter, "add", o, i, function(e) {
  3410. n.path("/define/" + e.Id + "/1")
  3411. })
  3412. }, function() {
  3413. e.projectCharter.DiagramType = "SIPOC", saveCharter(e.projectCharter, "add", o, i, function(e) {
  3414. n.path("/define/" + e.Id + "/1")
  3415. })
  3416. })
  3417. }, e.filterSelected = !0
  3418. }
  3419.  
  3420. function t(e, a, t, o, r, n, i, s) {
  3421. e.allContacts = [], e.selectedUsers = [], e.accessLevels = [], e.userToastShown = !1, e.selectedUser = {}, e.selectedAccessLevel = {}, e.selectedAccessLevelOptions = [], e.accessleveloptions = [], e.dSchema = {
  3422. EmailAddress: "",
  3423. FirstName: "",
  3424. LastName: "",
  3425. WorkTitle: "",
  3426. ProfileImageUrl: "",
  3427. Phone: "",
  3428. City: "",
  3429. State: "",
  3430. Zip: ""
  3431. }, t.getAllAccessLevels(function(a) {
  3432. a.success && (e.accessLevels = a.data)
  3433. }), t.sync(t.buildRequest("get", ["accessleveloptions"]), function(a) {
  3434. a.success && (e.accessLevelOptions = a.data)
  3435. }), e.resetPassword = function() {
  3436. t.post("https://api.l6elite.com/passwordreset", {
  3437. EmailAddress: e.selectedUser.EmailAddress
  3438. }, function(e) {
  3439. e.success ? r.logSuccess("Password Successfully Reset! User Notified!") : r.logError("An Error Occurred. Please Verify The Email Address Is Correct!")
  3440. })
  3441. }, e.checkSelectedUsers = function(a) {
  3442. -1 != e.selectedUsers.indexOf(a.id) ? e.selectedUsers.splice(e.selectedUsers.indexOf(a.id), 1) : e.selectedUsers.push(a.id), e.selectedUsers.length > 0 && !e.userToastShown ? (n.show({
  3443. controller: "UserManagementCtrl",
  3444. templateUrl: "user-selected-toast.html",
  3445. hideDelay: !1,
  3446. position: "top right"
  3447. }), e.userToastShown = !0) : e.selectedUsers.length < 1 && (e.userToastShown = !1)
  3448. }, e.showUserEditor = function(a) {
  3449. if (a) {
  3450. e.selectedUser.ReportsTo = null;
  3451. var o = [t.buildFilter("Id", null, "is", a)];
  3452. t.sync(t.buildRequest("get", ["users"], null, o), function(a) {
  3453. if (a.success) {
  3454. e.selectedUser = a.data[0], "" == e.selectedUser.ProfileImageUrl && (e.selectedUser.ProfileImageUrl = "images/generic-profile.png");
  3455. i.open({
  3456. templateUrl: "usereditor.html",
  3457. scope: e,
  3458. size: "lg",
  3459. controller: ["$scope", "$uibModalInstance", function(e, a) {
  3460. e.closeModal = function() {
  3461. a.dismiss("cancel")
  3462. }
  3463. }]
  3464. })
  3465. }
  3466. })
  3467. } else {
  3468. i.open({
  3469. templateUrl: "usereditor.html",
  3470. scope: e,
  3471. size: "lg",
  3472. controller: ["$scope", "$uibModalInstance", function(e, a) {
  3473. e.closeModal = function() {
  3474. a.dismiss("cancel")
  3475. }
  3476. }]
  3477. })
  3478. }
  3479. }, e.deleteProfileImage = function() {
  3480. e.selectedUser.ProfileImageUrl = "images/generic-profile.png"
  3481. }, e.uploadFiles = function(a, t) {
  3482. e.f = a, e.errFile = t && t[0], a && (a.upload = s.upload({
  3483. url: "https://api.l6elite.com/imageupload",
  3484. data: {
  3485. file: a
  3486. }
  3487. }), a.upload.then(function(t) {
  3488. a.result = t.data, e.selectedUser.ProfileImageUrl = t.data
  3489. }, function(e) {
  3490. e.status > 0 && r.logError(e.status + ": " + e.data)
  3491. }, function(e) {
  3492. a.progress = Math.min(100, parseInt(100 * e.loaded / e.total))
  3493. }))
  3494. }, e.loadNewUser = function() {
  3495. e.selectedUser = {}, e.selectedUser.ProfileImageUrl = "images/generic-profile.png", e.showUserEditor()
  3496. }, e.submitUser = function() {
  3497. console.log(e.selectedUser)
  3498. }, e.closeToast = function() {
  3499. n.hide()
  3500. }, e.userData = angular.copy(e.dSchema), t.loadContacts(function(a) {
  3501. e.allContacts = a
  3502. }), e.submitUser = function() {
  3503. var a = "add",
  3504. o = null;
  3505. e.selectedUser.Id && (a = "update", o = [t.buildFilter("Id", null, "is", e.selectedUser.Id)]), "" == e.selectedUser.ReportsTo && (e.selectedUser.ReportsTo = null), delete e.selectedUser.DateCreated, delete e.selectedUser.LastUpdated, t.sync(t.buildRequest(a, ["users"], null, o, [e.selectedUser]), function(o) {
  3506. o.success ? (r.logSuccess("add" == a ? "User Successfully Added!" : "User Successfully Updated!"), t.loadContacts(function(a) {
  3507. e.allContacts = a
  3508. }, !0)) : r.logError(o.error || "An error occurred while saving the user! Try again!")
  3509. })
  3510. }, e.addUser = function() {
  3511. var o = [];
  3512. o.push(e.userData), t.sync(t.buildRequest("add", ["users"], null, null, o), function(t) {
  3513. if (t.success) {
  3514. var o = t.data;
  3515. a.contactList.contacts.push({
  3516. name: o.FirstName + " " + o.LastName,
  3517. email: o.EmailAddress,
  3518. image: o.ProfileImageUrl,
  3519. _lowername: (o.FirstName + o.LastName).toLowerCase(),
  3520. id: o.Id
  3521. }), e.userData = angular.copy(e.dSchema)
  3522. } else r.logError(t.data[0])
  3523. })
  3524. }, e.editAccessLevel = function(a) {
  3525. e.selectedAccessLevel = a, e.selectedAccessLevel.selectedOptions = [], console.log(e.accessLevelOptions), console.log(e.selectedAccessLevel);
  3526. for (var t = 0; t < e.accessLevelOptions.length; t++)
  3527. for (var o = 0; a.Details && o < a.Details.length; o++) parseInt(a.Details[o].AccessLevelOptionId) === parseInt(e.accessLevelOptions[t].Id) && e.selectedAccessLevel.selectedOptions.push(e.accessLevelOptions[t]);
  3528. i.open({
  3529. templateUrl: "accessleveleditor.html",
  3530. scope: e,
  3531. size: "md",
  3532. controller: ["$scope", "$uibModalInstance", function(e, a) {
  3533. e.closeModal = function() {
  3534. a.dismiss("cancel")
  3535. }
  3536. }]
  3537. })
  3538. }, e.loadNewAccessLevel = function() {
  3539. e.selectedAccessLevel = {
  3540. ClientId: "",
  3541. selectedOptions: []
  3542. };
  3543. i.open({
  3544. templateUrl: "accessleveleditor.html",
  3545. scope: e,
  3546. size: "md",
  3547. controller: ["$scope", "$uibModalInstance", function(e, a) {
  3548. e.closeModal = function() {
  3549. a.dismiss("cancel")
  3550. }
  3551. }]
  3552. })
  3553. }, e.submitAccessLevel = function() {
  3554. var a = (angular.copy(e.selectedAccessLevel.selectedAccessLevelOptions), angular.copy(e.selectedAccessLevel)),
  3555. o = "add",
  3556. n = null;
  3557. if (e.selectedAccessLevel.Id && (o = "update"), "update" == o) {
  3558. if (e.selectedAccessLevel.Details) {
  3559. for (var i = [], s = 0; s < e.selectedAccessLevel.Details.length; s++) i.push(e.selectedAccessLevel.Details[s].Id);
  3560. n = [t.buildFilter("Id", null, "anyof", i)], t.sync(t.buildRequest("delete", ["accessleveldetails"], null, n), function(e) {
  3561. console.log("DELETE DETAILS RESPONSE"), console.log(e)
  3562. })
  3563. }
  3564. n = [t.buildFilter("Id", null, "is", e.selectedAccessLevel.Id)]
  3565. }
  3566. delete a.selectedOptions, delete a.Details, delete a.DateTimeCreated, delete a.LastUpdated, delete a.ClientId, t.sync(t.buildRequest(o, ["accesslevels"], null, n, [a]), function(n) {
  3567. if (n.success)
  3568. if ("update" == o && (n.data = {
  3569. Id: a.Id
  3570. }), e.selectedAccessLevel.selectedOptions) {
  3571. for (var i = [], s = [], l = 0; l < e.selectedAccessLevel.selectedOptions.length; l++) {
  3572. var c = {
  3573. AccessLevelId: n.data.Id,
  3574. AccessLevelOptionId: e.selectedAccessLevel.selectedOptions[l].Id
  3575. };
  3576. s.push("accessleveldetails"), i.push(c)
  3577. }
  3578. t.sync(t.buildRequest("add", s, null, null, i), function(a) {
  3579. a.success && (t.getAllAccessLevels(function(a) {
  3580. a.success && (e.accessLevels = a.data)
  3581. }), r.logSuccess("Access Level Successfully Saved!"))
  3582. })
  3583. } else n.success && r.logSuccess("Access Level Successfully Saved!")
  3584. })
  3585. }, e.querySearch = function(a) {
  3586. var t = a ? e.allContacts.filter(e.createFilterFor(a)) : [];
  3587. return t
  3588. }, e.createFilterFor = function(e) {
  3589. var a = angular.lowercase(e);
  3590. return function(e) {
  3591. return -1 !== e._lowername.indexOf(a)
  3592. }
  3593. }, e.filterSelected = !0
  3594. }
  3595.  
  3596. function o(e, a, t, o, r, n) {
  3597. function i(a) {
  3598. $(svgEditor.loadFromString(a.Svg)), e.svgData = a, e.svgData.ProjectId = e.projectId, e.svgData.PhaseId = l.PhaseId, e.svgData.PhaseComponentId = l.Id
  3599. }
  3600. e.projectId = a.pid, e.process = a.process, e.processLower = e.process.toLowerCase(), e.tabRef = {
  3601. define: 7,
  3602. measure: 5,
  3603. improve: 1,
  3604. analyze: 3
  3605. }, e.svgData = {}, t.shouldReloadSVGEditor && (t.shouldReloadSVGEditor = !1, window.location.reload());
  3606. var s, l = {};
  3607. o.loadProject(e.projectId, function(a) {
  3608. a.success ? ("Analyze" == e.process ? (l = o.getPhaseComponentDetail(e.process, "Hypothesis Map"), s = [], s.push(o.buildFilter("ProjectId", null, "is", e.projectId)), s.push({
  3609. ao: "and"
  3610. }), s.push(o.buildFilter("PhaseId", null, "is", l.PhaseId)), s.push({
  3611. andorsplit: "and"
  3612. }), s.push(o.buildFilter("PhaseComponentId", null, "is", l.Id)), o.sync(o.buildRequest("get", ["valuestreamdiagram"], null, [s]), function(e) {
  3613. $(svgEditor.init), e.success && i(e.data[0])
  3614. })) : (l = o.getPhaseComponentDetail(e.process, "Value Stream Diagram"), s = [], s.push(o.buildFilter("ProjectId", null, "is", e.projectId)), s.push({
  3615. ao: "and"
  3616. }), s.push(o.buildFilter("PhaseId", null, "is", l.PhaseId)), s.push({
  3617. andorsplit: "and"
  3618. }), s.push(o.buildFilter("PhaseComponentId", null, "is", l.Id)), o.sync(o.buildRequest("get", ["valuestreamdiagram"], null, [s]), function(a) {
  3619. if ($(svgEditor.init), a.success) i(a.data[0]);
  3620. else if ("Define" !== e.process) {
  3621. var t = o.getPhaseComponentDetail("Measure" === e.process ? "Define" : "Improve" === e.process ? "Measure" : "", "Value Stream Diagram");
  3622. s = [], s.push(o.buildFilter("ProjectId", null, "is", e.projectId)), s.push({
  3623. ao: "and"
  3624. }), s.push(o.buildFilter("PhaseId", null, "is", t.PhaseId)), s.push({
  3625. andorsplit: "and"
  3626. }), s.push(o.buildFilter("PhaseComponentId", null, "is", t.Id)), o.sync(o.buildRequest("get", ["valuestreamdiagram"], null, [s]), function(a) {
  3627. a.success ? (delete a.data[0].Id, i(a.data[0])) : "Measure" !== e.process && (t = o.getPhaseComponentDetail("Improve" === e.process ? "Define" : "", "Value Stream Diagram"), s = [], s.push(o.buildFilter("ProjectId", null, "is", e.projectId)), s.push({
  3628. ao: "and"
  3629. }), s.push(o.buildFilter("PhaseId", null, "is", t.PhaseId)), s.push({
  3630. andorsplit: "and"
  3631. }), s.push(o.buildFilter("PhaseComponentId", null, "is", t.Id)), o.sync(o.buildRequest("get", ["valuestreamdiagram"], null, [s]), function(e) {
  3632. e.success && (delete e.data[0].Id, i(e.data[0]))
  3633. }))
  3634. })
  3635. }
  3636. })), t.shouldReloadSVGEditor = !0) : r.path("/dashboard")
  3637. }), e.saveSVG = function() {
  3638. var a = "Analyze" == e.process ? "Hypothesis Map" : "Value Stream Diagram",
  3639. t = "Analyze" == e.process ? "analyzehypothesismap" : "valuestreamdiagram",
  3640. r = $(svgEditor.canvas.getSvgString());
  3641. if (r[0].outerHTML !== e.svgData.Svg) {
  3642. e.svgData.Svg = r[0].outerHTML, l = o.getPhaseComponentDetail(e.process, a);
  3643. var i = [],
  3644. s = [],
  3645. c = [],
  3646. u = angular.copy(e.svgData);
  3647. u.Id ? (delete u.DateTimeCreated, delete u.LastUpdated, i.push(u)) : (u.ProjectId = e.projectId, u.PhaseId = l.PhaseId, u.PhaseComponentId = l.Id, c.push(u)), o.syncTableRowData(t, c, i, s)
  3648. } else n.logSuccess("Data Saved!")
  3649. }
  3650. }
  3651. angular.module("app.project").controller("ProjectCtrl", ["$scope", "$rootScope", "$stateParams", "DataSyncService", "$location", "logger", "$mdDialog", "$state", e]).controller("ProjectNewCtrl", ["$scope", "$rootScope", "$stateParams", "DataSyncService", "$anchorScroll", "$location", "logger", "$mdDialog", a]).controller("SvgEditorCtrl", ["$scope", "$stateParams", "$rootScope", "DataSyncService", "$location", "logger", o]).controller("UserManagementCtrl", ["$scope", "$rootScope", "DataSyncService", "$location", "logger", "$mdToast", "$uibModal", "Upload", t])
  3652. }(),
  3653. function() {
  3654. "use strict";
  3655.  
  3656. function e() {
  3657. var e = {};
  3658. return e.cleanData = function(e) {
  3659. for (var a = [], t = 0; e && t < e.length; t++) "" != e[t] && parseFloat(e[t]) && a.push(e[t]);
  3660. return a
  3661. }, e.calculateMean = function(e) {
  3662. for (var a = 0, t = 0; e && t < e.length; t++) a += e[t];
  3663. return Math.round(a / e.length * 1e5) / 1e5
  3664. }, e.calculateVariance = function(e, a) {
  3665. for (var t = 0, o = 0; e && o < e.length; o++) t += Math.pow(parseFloat(e[o]) - a, 2);
  3666. return Math.round(t / (e.length - 1) * 1e5) / 1e5
  3667. }, e.calculateStandardDeviation = function(e) {
  3668. return Math.round(1e5 * Math.sqrt(e)) / 1e5
  3669. }, e.calculatePopStandardDeviation = function(e, a) {
  3670. return Math.round(1e5 * Math.sqrt(a / e.length)) / 1e5
  3671. }, e.calculatePopVariance = function(e, a) {
  3672. return Math.round(a / e.length * 1e5) / 1e5
  3673. }, e.calculateStandardErrorMean = function(e) {
  3674. var a = this.calculateMean(e),
  3675. t = this.calculateStandardDeviation(this.calculateVariance(e, a));
  3676. return Math.round(t / Math.sqrt(e.length)) / 1e5
  3677. }, e.calculateTDistribution = function(e, a) {
  3678. var t = this.calculateMean(e),
  3679. o = this.calculateStandardDeviation(this.calculateVariance(e, t));
  3680. return Math.round((t - a) / (o / Math.sqrt(e.length)) * 1e5) / 1e5
  3681. }, e.calculateChiSquared = function(e, a) {
  3682. for (var t = 0, o = 0; e && o < e.length; o++) t += Math.pow(a[o] - e[o], 2) / e[o]
  3683. }, e.getChiSquaredDistribution = function() {
  3684. return {
  3685. p_vals: [.995, .99, .975, .95, .9, .75, .5, .25, .1, .05, .01],
  3686. distribution: {
  3687. 1: [0, 0, .001, .004, .016, 2.706, 3.841, 5.024, 6.635, 7.879],
  3688. 2: [.01, .02, .051, .103, .211, 4.605, 5.991, 7.378, 9.21, 10.597],
  3689. 3: [.072, .115, .216, .352, .584, 6.251, 7.815, 9.348, 11.345, 12.838],
  3690. 4: [.207, .297, .484, .711, 1.064, 7.779, 9.488, 11.143, 13.277, 14.86],
  3691. 5: [.412, .554, .831, 1.145, 1.61, 9.236, 11.07, 12.833, 15.086, 16.75],
  3692. 6: [.676, .872, 1.237, 1.635, 2.204, 10.645, 12.592, 14.449, 16.812, 18.548],
  3693. 7: [.989, 1.239, 1.69, 2.167, 2.833, 12.017, 14.067, 16.013, 18.475, 20.278],
  3694. 8: [1.344, 1.646, 2.18, 2.733, 3.49, 13.362, 15.507, 17.535, 20.09, 21.955],
  3695. 9: [1.735, 2.088, 2.7, 3.325, 4.168, 14.684, 16.919, 19.023, 21.666, 23.589],
  3696. 10: [2.156, 2.558, 3.247, 3.94, 4.865, 15.987, 18.307, 20.483, 23.209, 25.188],
  3697. 11: [2.603, 3.053, 3.816, 4.575, 5.578, 17.275, 19.675, 21.92, 24.725, 26.757],
  3698. 12: [3.074, 3.571, 4.404, 5.226, 6.304, 18.549, 21.026, 23.337, 26.217, 28.3],
  3699. 13: [3.565, 4.107, 5.009, 5.892, 7.042, 19.812, 22.362, 24.736, 27.688, 29.819],
  3700. 14: [4.075, 4.66, 5.629, 6.571, 7.79, 21.064, 23.685, 26.119, 29.141, 31.319],
  3701. 15: [4.601, 5.229, 6.262, 7.261, 8.547, 22.307, 24.996, 27.488, 30.578, 32.801],
  3702. 16: [5.142, 5.812, 6.908, 7.962, 9.312, 23.542, 26.296, 28.845, 32, 34.267],
  3703. 17: [5.697, 6.408, 7.564, 8.672, 10.085, 24.769, 27.587, 30.191, 33.409, 35.718],
  3704. 18: [6.265, 7.015, 8.231, 9.39, 10.865, 25.989, 28.869, 31.526, 34.805, 37.156],
  3705. 19: [6.844, 7.633, 8.907, 10.117, 11.651, 27.204, 30.144, 32.852, 36.191, 38.582],
  3706. 20: [7.434, 8.26, 9.591, 10.851, 12.443, 28.412, 31.41, 34.17, 37.566, 39.997],
  3707. 21: [8.034, 8.897, 10.283, 11.591, 13.24, 29.615, 32.671, 35.479, 38.932, 41.401],
  3708. 22: [8.643, 9.542, 10.982, 12.338, 14.041, 30.813, 33.924, 36.781, 40.289, 42.796],
  3709. 23: [9.26, 10.196, 11.689, 13.091, 14.848, 32.007, 35.172, 38.076, 41.638, 44.181],
  3710. 24: [9.886, 10.856, 12.401, 13.848, 15.659, 33.196, 36.415, 39.364, 42.98, 45.559],
  3711. 25: [10.52, 11.524, 13.12, 14.611, 16.473, 34.382, 37.652, 40.646, 44.314, 46.928],
  3712. 26: [11.16, 12.198, 13.844, 15.379, 17.292, 35.563, 38.885, 41.923, 45.642, 48.29],
  3713. 27: [11.808, 12.879, 14.573, 16.151, 18.114, 36.741, 40.113, 43.195, 46.963, 49.645],
  3714. 28: [12.461, 13.565, 15.308, 16.928, 18.939, 37.916, 41.337, 44.461, 48.278, 50.993],
  3715. 29: [13.121, 14.256, 16.047, 17.708, 19.768, 39.087, 42.557, 45.722, 49.588, 52.336],
  3716. 30: [13.787, 14.953, 16.791, 18.493, 20.599, 40.256, 43.773, 46.979, 50.892, 53.672],
  3717. 40: [20.707, 22.164, 24.433, 26.509, 29.051, 51.805, 55.758, 59.342, 63.691, 66.766],
  3718. 50: [27.991, 29.707, 32.357, 34.764, 37.689, 63.167, 67.505, 71.42, 76.154, 79.49],
  3719. 60: [35.534, 37.485, 40.482, 43.188, 46.459, 74.397, 79.082, 83.298, 88.379, 91.952],
  3720. 70: [43.275, 45.442, 48.758, 51.739, 55.329, 85.527, 90.531, 95.023, 100.425, 104.215],
  3721. 80: [51.172, 53.54, 57.153, 60.391, 64.278, 96.578, 101.879, 106.629, 112.329, 116.321],
  3722. 90: [59.196, 61.754, 65.647, 69.126, 73.291, 107.565, 113.145, 118.136, 124.116, 128.299],
  3723. 100: [67.328, 70.065, 74.222, 77.929, 82.358, 118.498, 124.342, 129.561, 135.807, 140.169]
  3724. }
  3725. }
  3726. }, e.getPValue = function(e, a) {}, e
  3727. }
  3728. angular.module("app.core").factory("StatCalc", [e])
  3729. }(),
  3730. function() {
  3731. "use strict";
  3732.  
  3733. function e(e, a) {
  3734. function t(a) {
  3735. var t, o;
  3736. return o = (a - 1) * e.numPerPage, t = o + e.numPerPage, e.currentPageStores = e.filteredStores.slice(o, t)
  3737. }
  3738.  
  3739. function o() {
  3740. return e.select(1), e.currentPage = 1, e.row = ""
  3741. }
  3742.  
  3743. function r() {
  3744. return e.select(1), e.currentPage = 1
  3745. }
  3746.  
  3747. function n() {
  3748. return e.select(1), e.currentPage = 1
  3749. }
  3750.  
  3751. function i() {
  3752. return e.filteredStores = a("filter")(e.stores, e.searchKeywords), e.onFilterChange()
  3753. }
  3754.  
  3755. function s(t) {
  3756. return e.row !== t ? (e.row = t, e.filteredStores = a("orderBy")(e.stores, t), e.onOrderChange()) : void 0
  3757. }
  3758. var l;
  3759. e.stores = [], e.searchKeywords = "", e.filteredStores = [], e.row = "", e.select = t, e.onFilterChange = o, e.onNumPerPageChange = r, e.onOrderChange = n, e.search = i, e.order = s, e.numPerPageOpt = [3, 5, 10, 20], e.numPerPage = e.numPerPageOpt[2], e.currentPage = 1, e.currentPage = [], e.stores = [{
  3760. name: "Nijiya Market",
  3761. price: "$$",
  3762. sales: 292,
  3763. rating: 4
  3764. }, {
  3765. name: "Eat On Monday Truck",
  3766. price: "$",
  3767. sales: 119,
  3768. rating: 4.3
  3769. }, {
  3770. name: "Tea Era",
  3771. price: "$",
  3772. sales: 874,
  3773. rating: 4
  3774. }, {
  3775. name: "Rogers Deli",
  3776. price: "$",
  3777. sales: 347,
  3778. rating: 4.2
  3779. }, {
  3780. name: "MoBowl",
  3781. price: "$$$",
  3782. sales: 24,
  3783. rating: 4.6
  3784. }, {
  3785. name: "The Milk Pail Market",
  3786. price: "$",
  3787. sales: 543,
  3788. rating: 4.5
  3789. }, {
  3790. name: "Nob Hill Foods",
  3791. price: "$$",
  3792. sales: 874,
  3793. rating: 4
  3794. }, {
  3795. name: "Scratch",
  3796. price: "$$$",
  3797. sales: 643,
  3798. rating: 3.6
  3799. }, {
  3800. name: "Gochi Japanese Fusion Tapas",
  3801. price: "$$$",
  3802. sales: 56,
  3803. rating: 4.1
  3804. }, {
  3805. name: "Cost Plus World Market",
  3806. price: "$$",
  3807. sales: 79,
  3808. rating: 4
  3809. }, {
  3810. name: "Bumble Bee Health Foods",
  3811. price: "$$",
  3812. sales: 43,
  3813. rating: 4.3
  3814. }, {
  3815. name: "Costco",
  3816. price: "$$",
  3817. sales: 219,
  3818. rating: 3.6
  3819. }, {
  3820. name: "Red Rock Coffee Co",
  3821. price: "$",
  3822. sales: 765,
  3823. rating: 4.1
  3824. }, {
  3825. name: "99 Ranch Market",
  3826. price: "$",
  3827. sales: 181,
  3828. rating: 3.4
  3829. }, {
  3830. name: "Mi Pueblo Food Center",
  3831. price: "$",
  3832. sales: 78,
  3833. rating: 4
  3834. }, {
  3835. name: "Cucina Venti",
  3836. price: "$$",
  3837. sales: 163,
  3838. rating: 3.3
  3839. }, {
  3840. name: "Sufi Coffee Shop",
  3841. price: "$",
  3842. sales: 113,
  3843. rating: 3.3
  3844. }, {
  3845. name: "Dana Street Roasting",
  3846. price: "$",
  3847. sales: 316,
  3848. rating: 4.1
  3849. }, {
  3850. name: "Pearl Cafe",
  3851. price: "$",
  3852. sales: 173,
  3853. rating: 3.4
  3854. }, {
  3855. name: "Posh Bagel",
  3856. price: "$",
  3857. sales: 140,
  3858. rating: 4
  3859. }, {
  3860. name: "Artisan Wine Depot",
  3861. price: "$$",
  3862. sales: 26,
  3863. rating: 4.1
  3864. }, {
  3865. name: "Hong Kong Chinese Bakery",
  3866. price: "$",
  3867. sales: 182,
  3868. rating: 3.4
  3869. }, {
  3870. name: "Starbucks",
  3871. price: "$$",
  3872. sales: 97,
  3873. rating: 3.7
  3874. }, {
  3875. name: "Tapioca Express",
  3876. price: "$",
  3877. sales: 301,
  3878. rating: 3
  3879. }, {
  3880. name: "House of Bagels",
  3881. price: "$",
  3882. sales: 82,
  3883. rating: 4.4
  3884. }], (l = function() {
  3885. return e.search(), e.select(e.currentPage)
  3886. })()
  3887. }
  3888. angular.module("app.table").controller("TableCtrl", ["$scope", "$filter", e])
  3889. }(),
  3890. function() {
  3891. "use strict";
  3892.  
  3893. function e() {
  3894. var e = this;
  3895. e.readonly = !1, e.fruitNames = ["Apple", "Banana", "Orange"], e.roFruitNames = angular.copy(e.fruitNames), e.tags = [], e.vegObjs = [{
  3896. name: "Broccoli",
  3897. type: "Brassica"
  3898. }, {
  3899. name: "Cabbage",
  3900. type: "Brassica"
  3901. }, {
  3902. name: "Carrot",
  3903. type: "Umbelliferous"
  3904. }], e.newVeg = function(e) {
  3905. return {
  3906. name: e,
  3907. type: "unknown"
  3908. }
  3909. }
  3910. }
  3911.  
  3912. function a(e, a) {
  3913. e.status = " ", e.showAlert = function(e) {
  3914. a.show(a.alert().parent(angular.element(document.querySelector("#popupContainer"))).clickOutsideToClose(!0).title("This is an alert title").content("You can specify some description text in here.").ariaLabel("Alert Dialog Demo").ok("Got it!").targetEvent(e))
  3915. }, e.showConfirm = function(t) {
  3916. var o = a.confirm().title("Would you like to delete your debt?").content('All of the banks have agreed to <span class="debt-be-gone">forgive</span> you your debts.').ariaLabel("Lucky day").targetEvent(t).ok("Please do it!").cancel("Sounds like a scam");
  3917. a.show(o).then(function() {
  3918. e.status = "You decided to get rid of your debt."
  3919. }, function() {
  3920. e.status = "You decided to keep your debt."
  3921. })
  3922. }, e.showAdvanced = function(o) {
  3923. a.show({
  3924. controller: t,
  3925. templateUrl: "dialog1.tmpl.html",
  3926. parent: angular.element(document.body),
  3927. targetEvent: o,
  3928. clickOutsideToClose: !0
  3929. }).then(function(a) {
  3930. e.status = 'You said the information was "' + a + '".'
  3931. }, function() {
  3932. e.status = "You cancelled the dialog."
  3933. })
  3934. }, e.openOffscreen = function() {
  3935. a.show(a.alert().clickOutsideToClose(!0).title("Opening from offscreen").content("Closing to offscreen").ariaLabel("Offscreen Demo").ok("Amazing!").openFrom({
  3936. top: 50,
  3937. width: 30,
  3938. height: 80
  3939. }).closeTo({
  3940. left: 1500
  3941. }))
  3942. }
  3943. }
  3944.  
  3945. function t(e, a) {
  3946. e.hide = function() {
  3947. a.hide()
  3948. }, e.cancel = function() {
  3949. a.cancel()
  3950. }, e.answer = function(e) {
  3951. a.hide(e)
  3952. }
  3953. }
  3954.  
  3955. function o(e, a) {
  3956. var t = [{
  3957. title: "One",
  3958. content: "Tabs will become paginated if there isn't enough room for them."
  3959. }, {
  3960. title: "Two",
  3961. content: "You can swipe left and right on a mobile device to change tabs."
  3962. }, {
  3963. title: "Three",
  3964. content: "You can bind the selected tab via the selected attribute on the md-tabs element."
  3965. }, {
  3966. title: "Four",
  3967. content: "If you set the selected tab binding to -1, it will leave no tab selected."
  3968. }, {
  3969. title: "Five",
  3970. content: "If you remove a tab, it will try to select a new one."
  3971. }, {
  3972. title: "Six",
  3973. content: "There's an ink bar that follows the selected tab, you can turn it off if you want."
  3974. }, {
  3975. title: "Seven",
  3976. content: "If you set ng-disabled on a tab, it becomes unselectable. If the currently selected tab becomes disabled, it will try to select the next tab."
  3977. }, {
  3978. title: "Eight",
  3979. content: "If you look at the source, you're using tabs to look at a demo for tabs. Recursion!"
  3980. }, {
  3981. title: "Nine",
  3982. content: 'If you set md-theme="green" on the md-tabs element, you\'ll get green tabs.'
  3983. }, {
  3984. title: "Ten",
  3985. content: "If you're still reading this, you should just go check out the API docs for tabs!"
  3986. }],
  3987. o = null,
  3988. r = null;
  3989. e.tabs = t, e.selectedIndex = 2, e.$watch("selectedIndex", function(e, a) {
  3990. r = o, o = t[e]
  3991. }), e.addTab = function(e, a) {
  3992. a = a || e + " Content View", t.push({
  3993. title: e,
  3994. content: a,
  3995. disabled: !1
  3996. })
  3997. }, e.removeTab = function(e) {
  3998. var a = t.indexOf(e);
  3999. t.splice(a, 1)
  4000. }
  4001. }
  4002.  
  4003. function r(e, a) {
  4004. var t = this,
  4005. o = 0,
  4006. r = 0;
  4007. t.modes = [], t.activated = !0, t.determinateValue = 30, t.toggleActivation = function() {
  4008. t.activated || (t.modes = []), t.activated && (o = r = 0)
  4009. }, a(function() {
  4010. t.determinateValue += 1, t.determinateValue > 100 && (t.determinateValue = 30), 5 > o && !t.modes[o] && t.activated && (t.modes[o] = "indeterminate"), r++ % 4 == 0 && o++
  4011. }, 100, 0, !0)
  4012. }
  4013.  
  4014. function n(e, a) {
  4015. var t = this,
  4016. o = 0,
  4017. r = 0;
  4018. t.mode = "query", t.activated = !0, t.determinateValue = 30, t.determinateValue2 = 30, t.modes = [], t.toggleActivation = function() {
  4019. t.activated || (t.modes = []), t.activated && (o = r = 0, t.determinateValue = 30, t.determinateValue2 = 30)
  4020. }, a(function() {
  4021. t.determinateValue += 1, t.determinateValue2 += 1.5, t.determinateValue > 100 && (t.determinateValue = 30), t.determinateValue2 > 100 && (t.determinateValue2 = 30), 2 > o && !t.modes[o] && t.activated && (t.modes[o] = 0 == o ? "buffer" : "query"), r++ % 4 == 0 && o++, 2 == o && (t.contained = "indeterminate")
  4022. }, 100, 0, !0), a(function() {
  4023. t.mode = "query" == t.mode ? "determinate" : "query"
  4024. }, 7200, 0, !0)
  4025. }
  4026.  
  4027. function i(e, a, t) {
  4028. function o() {
  4029. var a = e.toastPosition;
  4030. a.bottom && r.top && (a.top = !1), a.top && r.bottom && (a.bottom = !1), a.right && r.left && (a.left = !1), a.left && r.right && (a.right = !1), r = angular.extend({}, a)
  4031. }
  4032. var r = {
  4033. bottom: !1,
  4034. top: !0,
  4035. left: !1,
  4036. right: !0
  4037. };
  4038. e.toastPosition = angular.extend({}, r), e.getToastPosition = function() {
  4039. return o(), Object.keys(e.toastPosition).filter(function(a) {
  4040. return e.toastPosition[a]
  4041. }).join(" ")
  4042. }, e.showCustomToast = function() {
  4043. a.show({
  4044. controller: "ToastCustomDemo",
  4045. templateUrl: "toast-template.html",
  4046. parent: t[0].querySelector("#toastBounds"),
  4047. hideDelay: 6e3,
  4048. position: e.getToastPosition()
  4049. })
  4050. }, e.showSimpleToast = function() {
  4051. a.show(a.simple().content("Simple Toast!").position(e.getToastPosition()).hideDelay(3e3))
  4052. }, e.showActionToast = function() {
  4053. var t = a.simple().content("Action Toast!").action("OK").highlightAction(!1).position(e.getToastPosition());
  4054. a.show(t).then(function(e) {
  4055. "ok" == e && alert("You clicked 'OK'.")
  4056. })
  4057. }
  4058. }
  4059.  
  4060. function s(e, a) {
  4061. e.closeToast = function() {
  4062. a.hide()
  4063. }
  4064. }
  4065.  
  4066. function l(e) {
  4067. e.demo = {
  4068. showTooltip: !1,
  4069. tipDirection: ""
  4070. }, e.$watch("demo.tipDirection", function(a) {
  4071. a && a.length && (e.demo.showTooltip = !0)
  4072. })
  4073. }
  4074.  
  4075. function c(e) {
  4076. var a = "images/g1.jpg";
  4077. e.messages = [{
  4078. face: a,
  4079. what: "Brunch this weekend?",
  4080. who: "Min Li Chan",
  4081. when: "3:08PM",
  4082. notes: " I'll be in your neighborhood doing errands"
  4083. }, {
  4084. face: a,
  4085. what: "Brunch this weekend?",
  4086. who: "Min Li Chan",
  4087. when: "3:08PM",
  4088. notes: " I'll be in your neighborhood doing errands"
  4089. }, {
  4090. face: a,
  4091. what: "Brunch this weekend?",
  4092. who: "Min Li Chan",
  4093. when: "3:08PM",
  4094. notes: " I'll be in your neighborhood doing errands"
  4095. }, {
  4096. face: a,
  4097. what: "Brunch this weekend?",
  4098. who: "Min Li Chan",
  4099. when: "3:08PM",
  4100. notes: " I'll be in your neighborhood doing errands"
  4101. }, {
  4102. face: a,
  4103. what: "Brunch this weekend?",
  4104. who: "Min Li Chan",
  4105. when: "3:08PM",
  4106. notes: " I'll be in your neighborhood doing errands"
  4107. }, {
  4108. face: a,
  4109. what: "Brunch this weekend?",
  4110. who: "Min Li Chan",
  4111. when: "3:08PM",
  4112. notes: " I'll be in your neighborhood doing errands"
  4113. }, {
  4114. face: a,
  4115. what: "Brunch this weekend?",
  4116. who: "Min Li Chan",
  4117. when: "3:08PM",
  4118. notes: " I'll be in your neighborhood doing errands"
  4119. }, {
  4120. face: a,
  4121. what: "Brunch this weekend?",
  4122. who: "Min Li Chan",
  4123. when: "3:08PM",
  4124. notes: " I'll be in your neighborhood doing errands"
  4125. }, {
  4126. face: a,
  4127. what: "Brunch this weekend?",
  4128. who: "Min Li Chan",
  4129. when: "3:08PM",
  4130. notes: " I'll be in your neighborhood doing errands"
  4131. }, {
  4132. face: a,
  4133. what: "Brunch this weekend?",
  4134. who: "Min Li Chan",
  4135. when: "3:08PM",
  4136. notes: " I'll be in your neighborhood doing errands"
  4137. }, {
  4138. face: a,
  4139. what: "Brunch this weekend?",
  4140. who: "Min Li Chan",
  4141. when: "3:08PM",
  4142. notes: " I'll be in your neighborhood doing errands"
  4143. }]
  4144. }
  4145.  
  4146. function u() {
  4147. var e = this;
  4148. e.userState = "",
  4149. e.states = "AL AK AZ AR CA CO CT DE FL GA HI ID IL IN IA KS KY LA ME MD MA MI MN MS MO MT NE NV NH NJ NM NY NC ND OH OK OR PA RI SC SD TN TX UT VT VA WA WV WI WY".split(" ").map(function(e) {
  4150. return {
  4151. abbrev: e
  4152. }
  4153. }), e.sizes = ["small (12-inch)", "medium (14-inch)", "large (16-inch)", "insane (42-inch)"], e.toppings = [{
  4154. category: "meat",
  4155. name: "Pepperoni"
  4156. }, {
  4157. category: "meat",
  4158. name: "Sausage"
  4159. }, {
  4160. category: "meat",
  4161. name: "Ground Beef"
  4162. }, {
  4163. category: "meat",
  4164. name: "Bacon"
  4165. }, {
  4166. category: "veg",
  4167. name: "Mushrooms"
  4168. }, {
  4169. category: "veg",
  4170. name: "Onion"
  4171. }, {
  4172. category: "veg",
  4173. name: "Green Pepper"
  4174. }, {
  4175. category: "veg",
  4176. name: "Green Olives"
  4177. }]
  4178. }
  4179. angular.module("app.ui").controller("ChipsBasicDemoCtrl", e).controller("DialogDemo", ["$scope", "$mdDialog", a]).controller("TabsDemo", ["$scope", "$log", o]).controller("ProgressCircularDemo", ["$scope", "$interval", r]).controller("ProgressLinearDemo", ["$scope", "$interval", n]).controller("ToastDemo", ["$scope", "$mdToast", "$document", i]).controller("ToastCustomDemo", ["$scope", "$mdToast", s]).controller("TooltipDemo", ["$scope", l]).controller("SubheaderDemo", ["$scope", c]).controller("SelectDemo", u)
  4180. }(),
  4181. function() {
  4182. "use strict";
  4183.  
  4184. function e(e, a) {
  4185. e.start = function() {
  4186. a.$broadcast("preloader:active")
  4187. }, e.complete = function() {
  4188. a.$broadcast("preloader:hide")
  4189. }
  4190. }
  4191.  
  4192. function a(e, a) {
  4193. e.toppings = [{
  4194. name: "Pepperoni",
  4195. wanted: !0
  4196. }, {
  4197. name: "Sausage",
  4198. wanted: !1
  4199. }, {
  4200. name: "Black Olives",
  4201. wanted: !0
  4202. }], e.settings = [{
  4203. name: "Wi-Fi",
  4204. extraScreen: "Wi-fi menu",
  4205. icon: "zmdi zmdi-wifi-alt",
  4206. enabled: !0
  4207. }, {
  4208. name: "Bluetooth",
  4209. extraScreen: "Bluetooth menu",
  4210. icon: "zmdi zmdi-bluetooth",
  4211. enabled: !1
  4212. }], e.messages = [{
  4213. id: 1,
  4214. title: "Message A",
  4215. selected: !1
  4216. }, {
  4217. id: 2,
  4218. title: "Message B",
  4219. selected: !0
  4220. }, {
  4221. id: 3,
  4222. title: "Message C",
  4223. selected: !0
  4224. }], e.people = [{
  4225. name: "Janet Perkins",
  4226. img: "img/100-0.jpeg",
  4227. newMessage: !0
  4228. }, {
  4229. name: "Mary Johnson",
  4230. img: "img/100-1.jpeg",
  4231. newMessage: !1
  4232. }, {
  4233. name: "Peter Carlsson",
  4234. img: "img/100-2.jpeg",
  4235. newMessage: !1
  4236. }], e.goToPerson = function(e, t) {
  4237. a.show(a.alert().title("Navigating").content("Inspect " + e).ariaLabel("Person inspect demo").ok("Neat!").targetEvent(t))
  4238. }, e.navigateTo = function(e, t) {
  4239. a.show(a.alert().title("Navigating").content("Imagine being taken to " + e).ariaLabel("Navigation demo").ok("Neat!").targetEvent(t))
  4240. }, e.doSecondaryAction = function(e) {
  4241. a.show(a.alert().title("Secondary Action").content("Secondary actions can be used for one click actions").ariaLabel("Secondary click demo").ok("Neat!").targetEvent(e))
  4242. }
  4243. }
  4244.  
  4245. function t(e, a) {
  4246. e.notify = function(e) {
  4247. switch (e) {
  4248. case "info":
  4249. return a.log("Heads up! This alert needs your attention, but it's not super important.");
  4250. case "success":
  4251. return a.logSuccess("Well done! You successfully read this important alert message.");
  4252. case "warning":
  4253. return a.logWarning("Warning! Best check yo self, you're not looking too good.");
  4254. case "error":
  4255. return a.logError("Oh snap! Change a few things up and try submitting again.")
  4256. }
  4257. }
  4258. }
  4259.  
  4260. function o(e) {
  4261. e.alerts = [{
  4262. type: "success",
  4263. msg: "Well done! You successfully read this important alert message."
  4264. }, {
  4265. type: "info",
  4266. msg: "Heads up! This alert needs your attention, but it is not super important."
  4267. }, {
  4268. type: "warning",
  4269. msg: "Warning! Best check yo self, you're not looking too good."
  4270. }, {
  4271. type: "danger",
  4272. msg: "Oh snap! Change a few things up and try submitting again."
  4273. }], e.addAlert = function() {
  4274. var a, t;
  4275. switch (a = Math.ceil(4 * Math.random()), t = void 0, a) {
  4276. case 0:
  4277. t = "info";
  4278. break;
  4279. case 1:
  4280. t = "success";
  4281. break;
  4282. case 2:
  4283. t = "info";
  4284. break;
  4285. case 3:
  4286. t = "warning";
  4287. break;
  4288. case 4:
  4289. t = "danger"
  4290. }
  4291. return e.alerts.push({
  4292. type: t,
  4293. msg: "Another alert!"
  4294. })
  4295. }, e.closeAlert = function(a) {
  4296. return e.alerts.splice(a, 1)
  4297. }
  4298. }
  4299.  
  4300. function r(e) {
  4301. e.max = 200, e.random = function() {
  4302. var a, t;
  4303. t = Math.floor(100 * Math.random()), a = void 0, a = 25 > t ? "success" : 50 > t ? "info" : 75 > t ? "warning" : "danger", e.showWarning = "danger" === a || "warning" === a, e.dynamic = t, e.type = a
  4304. }, e.random()
  4305. }
  4306.  
  4307. function n(e) {
  4308. e.oneAtATime = !0, e.groups = [{
  4309. title: "Dynamic Group Header - 1",
  4310. content: "Dynamic Group Body - 1"
  4311. }, {
  4312. title: "Dynamic Group Header - 2",
  4313. content: "Dynamic Group Body - 2"
  4314. }, {
  4315. title: "Dynamic Group Header - 3",
  4316. content: "Dynamic Group Body - 3"
  4317. }], e.items = ["Item 1", "Item 2", "Item 3"], e.status = {
  4318. isFirstOpen: !0,
  4319. isFirstOpen1: !0
  4320. }, e.addItem = function() {
  4321. var a;
  4322. a = e.items.length + 1, e.items.push("Item " + a)
  4323. }
  4324. }
  4325.  
  4326. function i(e) {
  4327. e.isCollapsed = !1
  4328. }
  4329.  
  4330. function s(e, a, t) {
  4331. e.items = ["item1", "item2", "item3"], e.animationsEnabled = !0, e.open = function(o) {
  4332. var r = a.open({
  4333. animation: e.animationsEnabled,
  4334. templateUrl: "myModalContent.html",
  4335. controller: "ModalInstanceCtrl",
  4336. size: o,
  4337. resolve: {
  4338. items: function() {
  4339. return e.items
  4340. }
  4341. }
  4342. });
  4343. r.result.then(function(a) {
  4344. e.selected = a
  4345. }, function() {
  4346. t.info("Modal dismissed at: " + new Date)
  4347. })
  4348. }, e.toggleAnimation = function() {
  4349. e.animationsEnabled = !e.animationsEnabled
  4350. }
  4351. }
  4352.  
  4353. function l(e, a, t) {
  4354. e.items = t, e.selected = {
  4355. item: e.items[0]
  4356. }, e.ok = function() {
  4357. a.close(e.selected.item)
  4358. }, e.cancel = function() {
  4359. a.dismiss("cancel")
  4360. }
  4361. }
  4362.  
  4363. function c(e) {
  4364. e.totalItems = 64, e.currentPage = 4, e.setPage = function(a) {
  4365. e.currentPage = a
  4366. }, e.maxSize = 5, e.bigTotalItems = 175, e.bigCurrentPage = 1
  4367. }
  4368.  
  4369. function u(e) {
  4370. e.tabs = [{
  4371. title: "Dynamic Title 1",
  4372. content: "Dynamic content 1. Consectetur adipisicing elit. Nihil, quidem, officiis, et ex laudantium sed cupiditate voluptatum libero nobis sit illum voluptates beatae ab. Ad, repellendus non sequi et at."
  4373. }, {
  4374. title: "Disabled",
  4375. content: "Dynamic content 2. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil, quidem, officiis, et ex laudantium sed cupiditate voluptatum libero nobis sit illum voluptates beatae ab. Ad, repellendus non sequi et at.",
  4376. disabled: !0
  4377. }], e.navType = "pills"
  4378. }
  4379.  
  4380. function d(e) {
  4381. e.list = [{
  4382. id: 1,
  4383. title: "Item 1",
  4384. items: []
  4385. }, {
  4386. id: 2,
  4387. title: "Item 2",
  4388. items: [{
  4389. id: 21,
  4390. title: "Item 2.1",
  4391. items: [{
  4392. id: 211,
  4393. title: "Item 2.1.1",
  4394. items: []
  4395. }, {
  4396. id: 212,
  4397. title: "Item 2.1.2",
  4398. items: []
  4399. }]
  4400. }]
  4401. }, {
  4402. id: 3,
  4403. title: "Item 3",
  4404. items: []
  4405. }, {
  4406. id: 4,
  4407. title: "Item 4",
  4408. items: [{
  4409. id: 41,
  4410. title: "Item 4.1",
  4411. items: []
  4412. }]
  4413. }, {
  4414. id: 5,
  4415. title: "Item 5",
  4416. items: []
  4417. }], e.selectedItem = {}, e.options = {}, e.remove = function(e) {
  4418. e.remove()
  4419. }, e.toggle = function(e) {
  4420. e.toggle()
  4421. }, e.newSubItem = function(e) {
  4422. var a;
  4423. a = e.$modelValue, a.items.push({
  4424. id: 10 * a.id + a.items.length,
  4425. title: a.title + "." + (a.items.length + 1),
  4426. items: []
  4427. })
  4428. }
  4429. }
  4430.  
  4431. function p(e, a, t) {
  4432. var o, r;
  4433. for (r = [], o = 0; 8 > o;) r[o] = new google.maps.Marker({
  4434. title: "Marker: " + o
  4435. }), o++;
  4436. e.GenerateMapMarkers = function() {
  4437. var a, t, n, i, s;
  4438. for (a = new Date, e.date = a.toLocaleString(), s = Math.floor(4 * Math.random()) + 4, o = 0; s > o;) t = 43.66 + Math.random() / 100, n = -79.4103 + Math.random() / 100, i = new google.maps.LatLng(t, n), r[o].setPosition(i), r[o].setMap(e.map), o++
  4439. }, t(e.GenerateMapMarkers, 2e3)
  4440. }
  4441. angular.module("app.ui").controller("LoaderCtrl", ["$scope", "$rootScope", e]).controller("ListCtrl", ["$scope", "$mdDialog", a]).controller("NotifyCtrl", ["$scope", "logger", t]).controller("AlertDemoCtrl", ["$scope", o]).controller("ProgressDemoCtrl", ["$scope", r]).controller("AccordionDemoCtrl", ["$scope", n]).controller("CollapseDemoCtrl", ["$scope", i]).controller("ModalDemoCtrl", ["$scope", "$uibModal", "$log", s]).controller("ModalInstanceCtrl", ["$scope", "$uibModalInstance", "items", l]).controller("PaginationDemoCtrl", ["$scope", c]).controller("TabsDemoCtrl", ["$scope", u]).controller("TreeDemoCtrl", ["$scope", d]).controller("MapDemoCtrl", ["$scope", "$http", "$interval", p])
  4442. }(),
  4443. function() {
  4444. "use strict";
  4445.  
  4446. function e() {
  4447. function e(e, a) {
  4448. e.addClass("ui-wave");
  4449. var t, o, r, n;
  4450. e.off("click").on("click", function(e) {
  4451. var a = $(this);
  4452. 0 === a.find(".ink").length && a.prepend("<span class='ink'></span>"), t = a.find(".ink"), t.removeClass("wave-animate"), t.height() || t.width() || (o = Math.max(a.outerWidth(), a.outerHeight()), t.css({
  4453. height: o,
  4454. width: o
  4455. })), r = e.pageX - a.offset().left - t.width() / 2, n = e.pageY - a.offset().top - t.height() / 2, t.css({
  4456. top: n + "px",
  4457. left: r + "px"
  4458. }).addClass("wave-animate")
  4459. })
  4460. }
  4461. var a = {
  4462. restrict: "A",
  4463. compile: e
  4464. };
  4465. return a
  4466. }
  4467.  
  4468. function a() {
  4469. function e(e, a) {
  4470. var t, o;
  4471. o = function() {
  4472. var e, r, n, i, s, l;
  4473. return l = new Date, e = l.getHours(), r = l.getMinutes(), n = l.getSeconds(), r = t(r), n = t(n), s = e + ":" + r + ":" + n, a.html(s), i = setTimeout(o, 500)
  4474. }, t = function(e) {
  4475. return 10 > e && (e = "0" + e), e
  4476. }, o()
  4477. }
  4478. var a = {
  4479. restrict: "A",
  4480. link: e
  4481. };
  4482. return a
  4483. }
  4484.  
  4485. function t() {
  4486. return {
  4487. restrict: "A",
  4488. compile: function(e, a) {
  4489. return e.on("click", function(e) {
  4490. e.stopPropagation()
  4491. })
  4492. }
  4493. }
  4494. }
  4495.  
  4496. function o() {
  4497. return {
  4498. restrict: "A",
  4499. link: function(e, a, t) {
  4500. return a.slimScroll({
  4501. height: t.scrollHeight || "100%"
  4502. })
  4503. }
  4504. }
  4505. }
  4506. angular.module("app.ui").directive("uiWave", e).directive("uiTime", a).directive("uiNotCloseOnClick", t).directive("slimScroll", o)
  4507. }(),
  4508. function() {
  4509. "use strict";
  4510.  
  4511. function e() {
  4512. var e;
  4513. return toastr.options = {
  4514. closeButton: !0,
  4515. positionClass: "toast-bottom-right",
  4516. timeOut: "3000"
  4517. }, e = function(e, a) {
  4518. return toastr[a](e)
  4519. }, {
  4520. log: function(a) {
  4521. e(a, "info")
  4522. },
  4523. logWarning: function(a) {
  4524. e(a, "warning")
  4525. },
  4526. logSuccess: function(a) {
  4527. e(a, "success")
  4528. },
  4529. logError: function(a) {
  4530. e(a, "error")
  4531. }
  4532. }
  4533. }
  4534. angular.module("app.ui").factory("logger", e)
  4535. }(),
  4536. function() {
  4537. "use strict";
  4538.  
  4539. function ProjectAnalyzeCtrl($scope, $rootScope, $stateParams, DataSyncService, $location, logger, $sce, $timeout, Upload) {
  4540. $scope.projectId = $stateParams.pid, $scope.activeTab = [!0, !1, !1, !1, !1, !1, !1], $scope.activeTab = activateTab($scope.activeTab, $stateParams.tid - 1);
  4541. var phaseComponentDetail = {},
  4542. filter;
  4543. $scope.walkthroughs = {
  4544. fmea: !1,
  4545. critx: !1
  4546. }, $scope.dSchema = {
  4547. fmea: {
  4548. Input: "",
  4549. FailureMode: "",
  4550. FailureEffects: "",
  4551. Severity: 1,
  4552. Causes: "",
  4553. Likelihood: 1,
  4554. CurrentControls: "",
  4555. Detection: 1,
  4556. Rpn: 0,
  4557. ActionsRecommended: "",
  4558. Resp: "",
  4559. ActionsTaken: "",
  4560. ActionPlanSeverity: "",
  4561. ActionPlanLikelihood: "",
  4562. ActionPlanDetection: "",
  4563. ActionPlanRpn: ""
  4564. },
  4565. critx: {
  4566. Input: "",
  4567. PracticalTheory: "",
  4568. XMeasurement: "",
  4569. StatTested: "",
  4570. ToolUsed: "",
  4571. Ho: "",
  4572. Ha: "",
  4573. Results: "",
  4574. PracticalConclusions: "",
  4575. NextSteps: ""
  4576. }
  4577. }, DataSyncService.loadProject($scope.projectId, function(response) {
  4578. response.success ? ($scope.projectDetail = $rootScope.currentProject, DataSyncService.loadContacts(function(e) {
  4579. $scope.allContacts = e
  4580. }), $scope.phaseDetail = DataSyncService.getPhaseDetail("Analyze"), $scope.paretoData = null, phaseComponentDetail = DataSyncService.getPhaseComponentDetail("Analyze", "Pareto Chart"), filter = [], filter.push(DataSyncService.buildFilter("ProjectId", null, "is", $scope.projectId)), filter.push({
  4581. ao: "and"
  4582. }), filter.push(DataSyncService.buildFilter("PhaseId", null, "is", phaseComponentDetail.PhaseId)), filter.push({
  4583. andorsplit: "and"
  4584. }), filter.push(DataSyncService.buildFilter("PhaseComponentId", null, "is", phaseComponentDetail.Id)), DataSyncService.sync(DataSyncService.buildRequest("get", ["chartexceldata"], null, [filter]), function(e) {
  4585. e.success && $scope.buildPareto(e.data[0].ExcelFileData)
  4586. }), $scope.uploadParetoFile = function(e, a) {
  4587. phaseComponentDetail = DataSyncService.getPhaseComponentDetail("Analyze", "Pareto Chart"), $scope.f = e, $scope.errFile = a && a[0], e && (e.upload = Upload.upload({
  4588. url: "https://api.l6elite.com",
  4589. data: {
  4590. file: e,
  4591. T: ["chartexceldata"],
  4592. A: "upload",
  4593. V: [{
  4594. ProjectId: $scope.projectId,
  4595. PhaseId: phaseComponentDetail.PhaseId,
  4596. PhaseComponentId: phaseComponentDetail.Id
  4597. }]
  4598. }
  4599. }), e.upload.then(function(e) {
  4600. $scope.paretoData = e.data, $scope.buildPareto(e.data.ExcelFileData)
  4601. }, function(e) {
  4602. e.status > 0 && logger.logError(e.status + ": " + e.data)
  4603. }, function(a) {
  4604. e.progress = Math.min(100, parseInt(100 * a.loaded / a.total))
  4605. }))
  4606. }, $scope.buildPareto = function(e) {
  4607. $scope.paretoData || ($scope.paretoData = {});
  4608. var a = [],
  4609. t = [],
  4610. o = [],
  4611. r = 0;
  4612. for (var n in e)
  4613. if (n > 1) {
  4614. if (!parseFloat(e[n].B) && 0 !== e[n].B) return logger.logError("Data Contains Illegal Values. Data Should Only Contain Numeric Values!"), !1;
  4615. e[n].B > r ? (a.push([e[n].A, e[n].B]), t.push([e[n].A, e[n].C]), o.push(e[n].A)) : (a.unshift([e[n].A, e[n].B]), t.unshift([e[n].A, e[n].C]), o.unshift(e[n].A))
  4616. }
  4617. $scope.paretoData.data = [{
  4618. data: a,
  4619. bars: {
  4620. order: 0,
  4621. fillColor: {
  4622. colors: [{
  4623. opacity: .3
  4624. }, {
  4625. opacity: .3
  4626. }]
  4627. },
  4628. show: !0,
  4629. fill: 1,
  4630. barWidth: .3,
  4631. align: "center",
  4632. horizontal: !1
  4633. }
  4634. }, {
  4635. data: t,
  4636. curvedLines: {
  4637. apply: !0
  4638. },
  4639. lines: {
  4640. show: !0,
  4641. fill: !0,
  4642. fillColor: {
  4643. colors: [{
  4644. opacity: .2
  4645. }, {
  4646. opacity: .2
  4647. }]
  4648. }
  4649. }
  4650. }, {
  4651. data: t,
  4652. points: {
  4653. show: !0
  4654. },
  4655. yaxis: 2
  4656. }], $scope.paretoData.options = {
  4657. xaxis: {
  4658. mode: "categories"
  4659. },
  4660. yaxes: [{}, {
  4661. position: "right"
  4662. }],
  4663. series: {
  4664. curvedLines: {
  4665. active: !0
  4666. },
  4667. points: {
  4668. lineWidth: 2,
  4669. fill: !0,
  4670. fillColor: "#ffffff",
  4671. symbol: "circle",
  4672. radius: 4
  4673. }
  4674. },
  4675. grid: {
  4676. hoverable: !0,
  4677. clickable: !0,
  4678. tickColor: "#f9f9f9",
  4679. borderWidth: 1,
  4680. borderColor: "#eeeeee"
  4681. },
  4682. tooltip: !0,
  4683. tooltipOpts: {
  4684. defaultTheme: !1
  4685. },
  4686. colors: [$scope.color.gray, $scope.color.primary, $scope.color.primary]
  4687. }
  4688. }, $scope.fmeaData = [], $scope.fmeaDataOrig = [], $scope.getFmea = function() {
  4689. phaseComponentDetail = DataSyncService.getPhaseComponentDetail("Analyze", "FMEA"), filter = [], filter.push(DataSyncService.buildFilter("ProjectId", null, "is", $scope.projectId)), filter.push({
  4690. ao: "and"
  4691. }), filter.push(DataSyncService.buildFilter("PhaseId", null, "is", phaseComponentDetail.PhaseId)), filter.push({
  4692. andorsplit: "and"
  4693. }), filter.push(DataSyncService.buildFilter("PhaseComponentId", null, "is", phaseComponentDetail.Id)), DataSyncService.sync(DataSyncService.buildRequest("get", ["analyzefmea"], null, [filter]), function(e) {
  4694. e.success ? ($scope.fmeaData = e.data, $scope.fmeaDataOrig = angular.copy($scope.fmeaData)) : $scope.showWalkthrough("fmea", $scope.fmeaData)
  4695. })
  4696. }, $scope.getFmea(), $scope.submitFmea = function() {
  4697. phaseComponentDetail = DataSyncService.getPhaseComponentDetail("Analyze", "FMEA");
  4698. for (var e = [], a = [], t = [], o = 0; o < $scope.fmeaData.length; o++)
  4699. if (!angular.equals($scope.fmeaData[o], $scope.fmeaDataOrig[o])) {
  4700. var r = angular.copy($scope.fmeaData[o]);
  4701. r.Id && r.isDeleted ? (a.push(r.Id), $scope.fmeaData[o].Id = !1) : r.Id ? (delete r.DateTimeCreated, delete r.LastUpdated, e.push(r)) : r.Id || r.isDeleted || (r.ProjectId = $scope.projectId, r.PhaseId = phaseComponentDetail.PhaseId, r.PhaseComponentId = phaseComponentDetail.Id, t.push(r))
  4702. }
  4703. DataSyncService.syncTableRowData("analyzefmea", t, e, a, null, function() {
  4704. $scope.getFmea()
  4705. })
  4706. }, $scope.critXData = [], $scope.critXDataOrig = [], $scope.getCritX = function() {
  4707. phaseComponentDetail = DataSyncService.getPhaseComponentDetail("Analyze", "Critical X"), filter = [], filter.push(DataSyncService.buildFilter("ProjectId", null, "is", $scope.projectId)), filter.push({
  4708. ao: "and"
  4709. }), filter.push(DataSyncService.buildFilter("PhaseId", null, "is", phaseComponentDetail.PhaseId)), filter.push({
  4710. andorsplit: "and"
  4711. }), filter.push(DataSyncService.buildFilter("PhaseComponentId", null, "is", phaseComponentDetail.Id)), DataSyncService.sync(DataSyncService.buildRequest("get", ["analyzecriticalx"], null, [filter]), function(e) {
  4712. e.success ? ($scope.critXData = e.data, $scope.critXDataOrig = angular.copy($scope.critXData)) : $scope.showWalkthrough("critx", $scope.critXData)
  4713. })
  4714. }, $scope.getCritX(), $scope.submitCritX = function() {
  4715. phaseComponentDetail = DataSyncService.getPhaseComponentDetail("Analyze", "Critical X");
  4716. for (var e = [], a = [], t = [], o = 0; o < $scope.critXData.length; o++)
  4717. if (!angular.equals($scope.critXData[o], $scope.critXDataOrig[o])) {
  4718. var r = angular.copy($scope.critXData[o]);
  4719. r.Id && r.isDeleted ? (a.push(r.Id), $scope.critXData[o].Id = !1) : r.Id ? (delete r.DateTimeCreated, delete r.LastUpdated, e.push(r)) : r.Id || r.isDeleted || (r.ProjectId = $scope.projectId, r.PhaseId = phaseComponentDetail.PhaseId, r.PhaseComponentId = phaseComponentDetail.Id, t.push(r))
  4720. }
  4721. DataSyncService.syncTableRowData("analyzecriticalx", t, e, a, null, function() {
  4722. $scope.getCritX()
  4723. })
  4724. }, $scope.HypothesisMap = {}, $scope.diagramType = $rootScope.currentProject.DiagramType, phaseComponentDetail = DataSyncService.getPhaseComponentDetail("Analyze", "Hypothesis Map"), filter = [], filter.push(DataSyncService.buildFilter("ProjectId", null, "is", $scope.projectId)), filter.push({
  4725. ao: "and"
  4726. }), filter.push(DataSyncService.buildFilter("PhaseId", null, "is", phaseComponentDetail.PhaseId)), filter.push({
  4727. andorsplit: "and"
  4728. }), filter.push(DataSyncService.buildFilter("PhaseComponentId", null, "is", phaseComponentDetail.Id)), DataSyncService.sync(DataSyncService.buildRequest("get", ["analyzehypothesismap"], null, [filter]), function(e) {
  4729. e.success && ($scope.HypothesisMap = e.data[0], $scope.HypothesisMap.hasHypothesisMap = $scope.HypothesisMap.hasOwnProperty("Svg") && "" != $scope.HypothesisMap.Svg ? !0 : !1, $scope.analyzeHypothesisMap = $sce.trustAsHtml($scope.HypothesisMap.Svg))
  4730. }), $scope.regressionData = null, $scope.regressionStats = {
  4731. FR: 0,
  4732. RRSQ: 0,
  4733. residual_values: [],
  4734. output_value: 0,
  4735. RMEAN: 0,
  4736. mean1: 0,
  4737. mean2: 0,
  4738. ESQV: 0,
  4739. VR1: 0,
  4740. VR2: 0,
  4741. FR1: 0,
  4742. SR2: 0,
  4743. MAE: 0,
  4744. MAE: 0,
  4745. DW: 0,
  4746. NCON: 0,
  4747. predicted: []
  4748. }, phaseComponentDetail = DataSyncService.getPhaseComponentDetail("Analyze", "Regression"), filter = [], filter.push(DataSyncService.buildFilter("ProjectId", null, "is", $scope.projectId)), filter.push({
  4749. ao: "and"
  4750. }), filter.push(DataSyncService.buildFilter("PhaseId", null, "is", phaseComponentDetail.PhaseId)), filter.push({
  4751. andorsplit: "and"
  4752. }), filter.push(DataSyncService.buildFilter("PhaseComponentId", null, "is", phaseComponentDetail.Id)), DataSyncService.sync(DataSyncService.buildRequest("get", ["chartexceldata"], null, [filter]), function(e) {
  4753. e.success && $scope.buildRegression(e.data[0].ExcelFileData)
  4754. }), $scope.uploadRegressionFile = function(e, a) {
  4755. phaseComponentDetail = DataSyncService.getPhaseComponentDetail("Analyze", "Regression"), $scope.f = e, $scope.errFile = a && a[0], e && (e.upload = Upload.upload({
  4756. url: "https://api.l6elite.com",
  4757. data: {
  4758. file: e,
  4759. T: ["chartexceldata"],
  4760. A: "upload",
  4761. V: [{
  4762. ProjectId: $scope.projectId,
  4763. PhaseId: phaseComponentDetail.PhaseId,
  4764. PhaseComponentId: phaseComponentDetail.Id
  4765. }]
  4766. }
  4767. }), e.upload.then(function(e) {
  4768. $scope.regressionData = e.data, $scope.buildRegression(e.data.ExcelFileData)
  4769. }, function(e) {
  4770. e.status > 0 && logger.logError(e.status + ": " + e.data)
  4771. }, function(a) {
  4772. e.progress = Math.min(100, parseInt(100 * a.loaded / a.total))
  4773. }))
  4774. }, $scope.buildRegression = function(data) {
  4775. function makeArray2(e, a) {
  4776. var t;
  4777. this.length = e + 1;
  4778. for (var t = 0; e + 1 >= t; t++) this[t] = new makeArray(a)
  4779. }
  4780.  
  4781. function makeArray(e) {
  4782. var a;
  4783. this.length = e + 1;
  4784. for (var a = 0; e + 1 >= a; a++) this[a] = 0
  4785. }
  4786.  
  4787. function buildData(e) {
  4788. N = 0, Y = [0];
  4789. var a = 1;
  4790. for (var t in e) {
  4791. if (M = 0, a > 1)
  4792. for (var o in e[t]) "A" !== o && (N++, M++);
  4793. a++
  4794. }
  4795. }
  4796.  
  4797. function det(e) {
  4798. var a = e.length - 1;
  4799. if (1 === a) return e[1][1];
  4800. for (var t, o = 0, r = 1, t = 1; a >= t; t++) {
  4801. if (0 !== e[1][t]) {
  4802. for (var n, i, s, l = new makeArray2(a - 1, a - 1), n = 1; a - 1 >= n; n++) {
  4803. s = t > n ? n : n + 1;
  4804. for (var i = 1; a - 1 >= i; i++) l[i][n] = e[i + 1][s]
  4805. }
  4806. o += e[1][t] * r * det(l)
  4807. }
  4808. r = -r
  4809. }
  4810. return o
  4811. }
  4812.  
  4813. function inverse(e) {
  4814. var a = e.length - 1,
  4815. t = new makeArray2(a, a),
  4816. o = det(e);
  4817. if (0 === o) alert("singular matrix--check data");
  4818. else
  4819. for (var r, n, r = 1; a >= r; r++)
  4820. for (var n = 1; a >= n; n++) {
  4821. for (var i, s, l, c, u = new makeArray2(a - 1, a - 1), i = 1; a - 1 >= i; i++) {
  4822. l = n > i ? i : i + 1;
  4823. for (var s = 1; a - 1 >= s; s++) c = r > s ? s : s + 1, u[s][i] = e[c][l]
  4824. }
  4825. var d = (r + n) / 2;
  4826. if (d == Math.round(d)) var p = 1;
  4827. else var p = -1;
  4828. t[n][r] = det(u) * p / o
  4829. }
  4830. return t
  4831. }
  4832.  
  4833. function shiftRight(e, a) {
  4834. if (0 === a) return e;
  4835. var t = 1,
  4836. o = a;
  4837. 0 > o && (o = -o);
  4838. for (var r = 1; o >= r; r++) t = 10 * t;
  4839. return a > 0 ? t * e : e / t
  4840. }
  4841.  
  4842. function roundSigDig(e, a) {
  4843. if (0 === e) return 0;
  4844. if (Math.abs(e) < 1e-12) return 0;
  4845. var t = Math.floor(Math.log(Math.abs(e)) / Math.log(10)) - a,
  4846. o = shiftRight(Math.round(shiftRight(Math.abs(e), -t)), t);
  4847. return e > 0 ? o : -o
  4848. }
  4849.  
  4850. function stripSpaces(e) {
  4851. for (OutString = "", Count = 0; Count < e.length; Count++) TempChar = e.substring(Count, Count + 1), " " != TempChar && (OutString += TempChar);
  4852. return OutString
  4853. }
  4854.  
  4855. function buildxy(data) {
  4856. e = 2.718281828459045, pi = 3.141592653589793, abort = !1, N = 0;
  4857. var searching = !0,
  4858. numvariables = 4;
  4859. numvariables = "" == document.theForm[10].value ? 1 : "" == document.theForm[11].value ? 2 : "" == document.theForm[12].value ? 3 : 4;
  4860. for (var i = 0; 15 >= i; i++) theString1 = stripSpaces(document.theForm[3 + 6 * i].value), "" == theString1 && (searching = !1), theString2 = stripSpaces(document.theForm[4 + 6 * i].value), numvariables >= 2 && "" == theString2 && (searching = !1), theString3 = stripSpaces(document.theForm[5 + 6 * i].value), numvariables >= 3 && "" == theString3 && (searching = !1), theString4 = stripSpaces(document.theForm[6 + 6 * i].value), numvariables >= 4 && "" == theString4 && (searching = !1), searching && !abort && (N++, X[1][N] = eval(theString1), numvariables >= 2 && (X[2][N] = eval(theString2)), numvariables >= 3 && (X[3][N] = eval(theString3)), numvariables >= 4 && (X[4][N] = eval(theString4)), theString = stripSpaces(document.theForm[7 + 6 * i].value), "" == theString ? (alert("You have not entered a y-value for data point number " + N), abort = !0) : Y[N] = eval(theString));
  4861. M = numvariables, abort || (0 == N ? (alert("Enter data first"), abort = !0) : M + 1 > N && (alert("You have entered too few data points"), abort = !0))
  4862. }
  4863.  
  4864. function linregr() {
  4865. if (!abort) {
  4866. var e, a, t, o, r = new makeArray(M + 1),
  4867. n = new makeArray2(M + 1, M + 1),
  4868. i = new makeArray2(M + 1, M + 1);
  4869. for (a = 1; N >= a; a++) X[0][a] = 1;
  4870. for (a = 1; M + 1 >= a; a++) {
  4871. for (o = 0, e = 1; N >= e; e++) o += X[a - 1][e] * Y[e];
  4872. for (r[a] = o, t = 1; M + 1 >= t; t++) {
  4873. for (o = 0, e = 1; N >= e; e++) o += X[a - 1][e] * X[t - 1][e];
  4874. n[a][t] = o
  4875. }
  4876. }
  4877. for (i = inverse(n), e = 0; M >= e; e++) {
  4878. for (o = 0, t = 1; M + 1 >= t; t++) o += i[e + 1][t] * r[t];
  4879. regrCoeff[e] = o
  4880. }
  4881. }
  4882. }
  4883.  
  4884. function calc() {
  4885. buildxy(), linregr();
  4886. var e = "Y = " + roundSigDig(regrCoeff[0], sigDig);
  4887. for (i = 1; i <= M; i++) e += " + (" + roundSigDig(regrCoeff[i], sigDig) + ")X" + i;
  4888. for ($regressionStats.output_value = e, i = 0; i <= N - 1; i++) {
  4889. for (y = regrCoeff[0], j = 1; j <= M; j++) y += regrCoeff[j] * X[j][i + 1];
  4890. document.theForm[8 + 6 * i].value = roundSigDig(y, sigDig)
  4891. }
  4892. for (i = N; i <= maxN - 1; i++) document.theForm[8 + 6 * i].value = ""
  4893. }
  4894.  
  4895. function checkData(e) {
  4896. var a = [];
  4897. N = 0, Y = [0];
  4898. var t = 1;
  4899. for (var o in e) {
  4900. a.push(e[o]), M = 0;
  4901. var r = 1;
  4902. if (t > 1) {
  4903. for (var n in e[o]) {
  4904. if ("A" == n && "" == e[o][n]) return !1;
  4905. "" == e[o][n] && (e[o][n] = 0), "A" == n ? Y.push(e[o][n]) : X[r - 1][t - 1] = e[o][n], N++, M++, r++
  4906. }
  4907. }
  4908. t++
  4909. }
  4910. return N = t - 2, M -= 1, a
  4911. }
  4912.  
  4913. function calc2(data) {
  4914. function Norm(e) {
  4915. e = Math.abs(e);
  4916. var a = 1 + e * (.04986735 + e * (.02114101 + e * (.00327763 + e * (380036e-10 + e * (488906e-10 + 5383e-9 * e)))));
  4917. return a *= a, a *= a, a *= a, 1 / (a * a)
  4918. }
  4919.  
  4920. function ANorm(e) {
  4921. for (var a = .5, t = .5, o = 0; t > 1e-6;) o = 1 / a - 1, t /= 2, Norm(o) > e ? a -= t : a += t;
  4922. return o
  4923. }
  4924.  
  4925. function Fmt(e) {
  4926. var a;
  4927. return a = e >= 0 ? "" + (e + 5e-5) : "" + (e - 5e-5), a.substring(0, a.indexOf(".") + 5)
  4928. }
  4929.  
  4930. function FishF(e, a, t) {
  4931. var o = t / (a * e + t);
  4932. if (a % 2 === 0) return StatCom(1 - o, t, a + t - 4, t - 2) * Math.pow(o, t / 2);
  4933. if (t % 2 === 0) return 1 - StatCom(o, a, a + t - 4, a - 2) * Math.pow(1 - o, a / 2);
  4934. var r = Math.atan(Math.sqrt(a * e / t)),
  4935. n = r / PiD2,
  4936. i = Math.sin(r),
  4937. s = Math.cos(r);
  4938. if (t > 1 && (n += i * s * StatCom(s * s, 2, t - 3, -1) / PiD2), 1 == a) return 1 - n;
  4939. var l = 4 * StatCom(i * i, t + 1, a + t - 4, t - 2) * i * Math.pow(s, t) / Pi;
  4940. if (1 == t) return 1 - n + l / 2;
  4941. for (var c = 2;
  4942. (t - 1) / 2 >= c;) l = l * c / (c - .5), c += 1;
  4943. return 1 - n + l
  4944. }
  4945.  
  4946. function StatCom(e, a, t, o) {
  4947. for (var r = 1, n = r, i = a; t >= i;) r = r * e * i / (i - o), n += r, i += 2;
  4948. return n
  4949. }
  4950.  
  4951. function AFishF(e, a, t) {
  4952. for (var o = .5, r = .5, n = 0; r > 1e-10;) n = 1 / o - 1, r /= 2, FishF(n, a, t) > e ? o -= r : o += r;
  4953. return n
  4954. }
  4955. if (data = checkData(data), !data) return logger.logError("Data Is Not Formatted Properly! Verify All Rows Have A Valid X And Y Value!"), !1;
  4956. linregr();
  4957. for (var predicted = [], residual = [], output = "Y = " + roundSigDig(regrCoeff[0], sigDig), SE = 0, ST = 0, i = 1; M >= i; i++) output += " + (" + roundSigDig(regrCoeff[i], sigDig) + ")X" + i;
  4958. for ($scope.regressionStats.output_value = output, $scope.regressionStats.residual_values = [], $scope.regressionStats.predicted = [], i = 0; N - 1 >= i; i++) {
  4959. for (var y = regrCoeff[0], j = 1; M >= j; j++) y += regrCoeff[j] * X[j][i + 1];
  4960. $scope.regressionStats.predicted.push(roundSigDig(y, sigDig)), predicted[i] = roundSigDig(y, sigDig), residual[i] = Y[i + 1] - predicted[i], $scope.regressionStats.residual_values.push(Math.round(residual[i] * Math.pow(10, 4)) / Math.pow(10, 4)), SE += residual[i], ST += Y[i + 1]
  4961. }
  4962. var MSE = 0,
  4963. MST = 0;
  4964. MSE = SE / N, MST = ST / N;
  4965. var SSE = 0,
  4966. SST = 0;
  4967. for (i = 1; N >= i; i++) SSE += (residual[i - 1] - MSE) * (residual[i - 1] - MSE), SST += (Y[i] - MST) * (Y[i] - MST);
  4968. var FR, RRSQ;
  4969. for (RRSQ = 1 - SSE / SST, FR = (N - M - 1) * (SST - SSE) / (M * SSE), $scope.regressionStats.FR = FR, $scope.regressionStats.RRSQ = RRSQ, i = N; maxN - 1 >= i; i++);
  4970. var Pi = Math.PI,
  4971. PiD2 = Pi / 2,
  4972. PiD4 = Pi / 4,
  4973. Pi2 = 2 * Pi,
  4974. e = 2.718281828459045,
  4975. e10 = 1.1051709180756477,
  4976. Deg = 180 / Pi,
  4977. SUME = 0,
  4978. StdE = 0;
  4979. for (i = 0; N - 1 > i; i++) SUME += residual[i];
  4980. var len = N - 1,
  4981. mid = Math.floor(len / 2),
  4982. SUME1 = 0,
  4983. SUME2 = 0,
  4984. NE1 = 0,
  4985. NE2 = 0;
  4986. for (i = 0; mid > i; i++) SUME1 += residual[i], NE1++;
  4987. for (i = mid; len > i; i++) SUME2 += residual[i], NE2++;
  4988. var mean1 = SUME1 / NE1,
  4989. mean2 = SUME2 / NE2,
  4990. XE = SUME / len,
  4991. XE1 = Math.round(1e7 * XE) / 1e7,
  4992. mn1 = Math.round(1e7 * mean1) / 1e7,
  4993. mn2 = Math.round(1e7 * mean2) / 1e7;
  4994. for ($scope.regressionStats.RMEAN = XE1, $scope.regressionStats.mean1 = mn1, $scope.regressionStats.mean2 = mn2, i = 0; N - 1 > i; i++) StdE += Math.pow(residual[i] - XE, 2);
  4995. var V1 = StdE / (len - 2),
  4996. Vari2 = Math.round(1e7 * V1) / 1e7;
  4997. $scope.regressionStats.ESQV = Vari2;
  4998. var StdE1 = 0,
  4999. StdE2 = 0;
  5000. for (i = 0; mid > i; i++) StdE1 += Math.pow(residual[i] - mean1, 2);
  5001. for (i = mid; len > i; i++) StdE2 += Math.pow(residual[i] - mean2, 2);
  5002. var VR1 = StdE1 / (NE1 - 2),
  5003. var1 = Math.round(1e7 * VR1) / 1e7;
  5004. $scope.regressionStats.VR1 = var1;
  5005. var VR2 = StdE2 / (NE2 - 2),
  5006. var2 = Math.round(1e7 * VR2) / 1e7;
  5007. $scope.regressionStats.VR2 = var2;
  5008. var listA = [],
  5009. listB = [],
  5010. listC = [],
  5011. listA2 = [],
  5012. a1 = 0,
  5013. sumA = 0;
  5014. for (i = 1; len > i; i++) listA[a1] = parseFloat(residual[i]), sumA += parseFloat(residual[i]), a1++;
  5015. var a4 = 0,
  5016. sumA2 = 0;
  5017. for (i = 2; len > i; i++) listA2[a4] = parseFloat(residual[i]), sumA2 += parseFloat(residual[i]), a4++;
  5018. var a2 = 0,
  5019. sumB = 0;
  5020. for (i = 0; len - 1 > i; i++) listB[a2] = parseFloat(residual[i]), sumB += parseFloat(residual[i]), a2++;
  5021. var a3 = 0,
  5022. sumC = 0;
  5023. for (i = 0; len - 2 > i; i++) listC[a3] = parseFloat(residual[i]), sumC += parseFloat(residual[i]), a3++;
  5024. var meanA = sumA / a1,
  5025. meanA2 = sumA2 / a4,
  5026. meanB = sumB / a2,
  5027. meanC = sumC / a3,
  5028. varA = 0,
  5029. varB = 0,
  5030. covarAB = 0;
  5031. for (i = 0; i < listA.length; i++) varA += Math.pow(listA[i] - meanA, 2), varB += Math.pow(listB[i] - meanB, 2), covarAB += (listB[i] - meanB) * (listA[i] - meanA);
  5032. var R1 = covarAB / Math.sqrt(varA * varB),
  5033. R11 = Math.round(1e7 * R1) / 1e7;
  5034. $scope.regressionStats.FR1 = R11;
  5035. var varA2 = 0,
  5036. varC = 0,
  5037. covarA2C = 0;
  5038. for (i = 0; i < listA2.length; i++) varA2 += Math.pow(listA2[i] - meanA2, 2), varC += Math.pow(listC[i] - meanC, 2), covarA2C += (listA2[i] - meanA2) * (listC[i] - meanC);
  5039. var R2 = covarA2C / Math.sqrt(varA2 * varC),
  5040. R21 = Math.round(1e7 * R2) / 1e7;
  5041. $scope.regressionStats.SR2 = R21;
  5042. var ERR = residual[0],
  5043. SUMABSERR = Math.abs(ERR),
  5044. SSE = residual[0] * residual[0],
  5045. DWNN = 0,
  5046. DWND = residual[0] * residual[0],
  5047. SUMERR = residual[0],
  5048. DWN = 0,
  5049. MAE = 0;
  5050. for (i = 1; N > i; i++) ERR = residual[i], SUMERR += ERR, SUMABSERR += Math.abs(ERR), DWNN += (residual[i] - residual[i - 1]) * (residual[i] - residual[i - 1]), DWND += residual[i] * residual[i], SSE += ERR * ERR;
  5051. var MAE = SUMABSERR / N,
  5052. DW = DWNN / DWND;
  5053. MAE = Math.round(1e5 * MAE) / 1e5, $scope.regressionStats.MAE = MAE, DW = Math.round(1e5 * DW) / 1e5, $scope.regressionStats.DW = DW;
  5054. var SUMF = 0,
  5055. FXX = 0,
  5056. FX = 0,
  5057. xvalN = [],
  5058. freq = [];
  5059. for (i = 0; len > i; i++) xvalN[i] = residual[i], freq[i] = 1;
  5060. for (var i2 = 0; i2 < xvalN.length; i2++) SUMF += parseFloat(freq[i2]), FX += parseFloat(xvalN[i2]) * parseFloat(freq[i2]), FXX += parseFloat(freq[i2]) * Math.pow(parseFloat(xvalN[i2]), 2);
  5061. var SN2 = FXX - FX * FX / SUMF;
  5062. SN2 /= SUMF;
  5063. for (var stdN = Math.sqrt(SN2), meanN = FX / SUMF, zval = [], i3 = 0; i3 < xvalN.length; i3++) zval[i3] = (xvalN[i3] - meanN) / stdN;
  5064. var zvalS = [];
  5065. for (i = 0; i < zval.length; i++) zvalS[i] = zval[i];
  5066. for (i = 0; i < zvalS.length - 1; i++)
  5067. for (j = i + 1; j < zvalS.length; j++)
  5068. if (eval(zvalS[j]) < eval(zvalS[i])) {
  5069. var temp = zvalS[i];
  5070. zvalS[i] = zvalS[j], zvalS[j] = temp
  5071. }
  5072. var freqS = [];
  5073. for (i = 0; i < freq.length; i++) freqS[i] = freq[i];
  5074. for (i = 0; i < zval.length; i++)
  5075. for (j = 0; j < zval.length; j++) zvalS[i] == zval[j] && (freqS[i] = freq[j]);
  5076. for (var fval = [], F1 = 0, i6 = 0; i6 < zvalS.length; i6++) F1 = Norm(zvalS[i6]), zvalS[i6] >= 0 ? fval[i6] = 1 - F1 / 2 : fval[i6] = F1 / 2, F1 = 0;
  5077. var jval = [];
  5078. jval[0] = freqS[0] / SUMF;
  5079. for (var i7 = 1; i7 < zvalS.length; i7++) jval[i7] = jval[i7 - 1] + freqS[i7] / SUMF;
  5080. var DP = [];
  5081. for (DP[0] = Math.abs(jval[0] - fval[0]), i = 1; N > i; i++) {
  5082. var A = Math.abs(jval[i] - fval[i]),
  5083. B = Math.abs(fval[i] - jval[i - 1]);
  5084. DP[i] = Math.max(A, B)
  5085. }
  5086. for (i = 0; i < DP.length - 1; i++)
  5087. for (j = i + 1; j < DP.length; j++) eval(DP[j]) < eval(DP[i]) && (temp = DP[i], DP[i] = DP[j], DP[j] = temp);
  5088. var DPP = DP[DP.length - 1],
  5089. D = DPP,
  5090. td = D + "",
  5091. A0 = Math.sqrt(SUMF),
  5092. C1 = A0 - .01 + .85 / A0,
  5093. D15 = .775 / C1,
  5094. D10 = .819 / C1,
  5095. D05 = .895 / C1,
  5096. D025 = .995 / C1,
  5097. t2N = D;
  5098. t2N > D025 ? $scope.regressionStats.NCON = "Evidence against normality" : D025 >= t2N && t2N > D05 ? $scope.regressionStats.NCON = "Sufficient evidence against normality" : D05 >= t2N && t2N > D10 ? $scope.regressionStats.NCON = "Suggestive evidence against normality" : D10 >= t2N && t2N > D15 ? $scope.regressionStats.NCON = "Little evidence against normality" : D15 >= t2N ? $scope.regressionStats.NCON = "No evidences against normality" : $scope.regressionStats.NCON = "Evidence against normality"
  5099. }
  5100. $scope.regressionData || ($scope.regressionData = {});
  5101. var N = 0,
  5102. maxN = 16,
  5103. M = 4;
  5104. buildData(data);
  5105. var X = new makeArray2(M, N),
  5106. Y = [],
  5107. SX = 0,
  5108. SY = 0,
  5109. SXX = 0,
  5110. SXY = 0,
  5111. SYY = 0,
  5112. m = 0,
  5113. abort = !1,
  5114. regrCoeff = [],
  5115. sigDig = 3;
  5116. calc2(data)
  5117. }, $scope.gateReviewData = [], $scope.gateReviewDataOrig = [], phaseComponentDetail = DataSyncService.getPhaseComponentDetail("Analyze", "Gate Review"), filter = [], filter.push(DataSyncService.buildFilter("ProjectId", null, "is", $scope.projectId)), filter.push({
  5118. ao: "and"
  5119. }), filter.push(DataSyncService.buildFilter("PhaseId", null, "is", phaseComponentDetail.PhaseId)), filter.push({
  5120. andorsplit: "and"
  5121. }), filter.push(DataSyncService.buildFilter("PhaseComponentId", null, "is", phaseComponentDetail.Id)), DataSyncService.sync(DataSyncService.buildRequest("get", ["gatereview"], null, [filter]), function(e) {
  5122. e.success && ($scope.gateReviewData = $scope.addArrayIndexId(e.data), $scope.gateReviewDataOrig = angular.copy($scope.gateReviewData))
  5123. }), $scope.gateReviewAddRow = function(e) {
  5124. $scope.gateReviewData.push({
  5125. arrayId: $scope.gateReviewData.length,
  5126. Quadrant: e,
  5127. Detail: " "
  5128. })
  5129. }, $scope.submitGateReview = function() {
  5130. phaseComponentDetail = DataSyncService.getPhaseComponentDetail("Analyze", "Gate Review");
  5131. for (var e = [], a = [], t = [], o = 0; o < $scope.gateReviewData.length; o++)
  5132. if (!angular.equals($scope.gateReviewData[o], $scope.gateReviewDataOrig[o])) {
  5133. var r = angular.copy($scope.gateReviewData[o]);
  5134. r.Id && r.isDeleted ? (a.push(r.Id), $scope.gateReviewData[o].Id = !1) : r.Id ? (delete r.DateTimeCreated, delete r.LastUpdated, delete r.arrayId, e.push(r)) : r.Id || r.isDeleted || (r.ProjectId = $scope.projectId, r.PhaseId = phaseComponentDetail.PhaseId, r.PhaseComponentId = phaseComponentDetail.Id, delete r.arrayId, t.push(r))
  5135. }
  5136. DataSyncService.syncTableRowData("gatereview", t, e, a), $scope.gateReviewDataOrig = angular.copy($scope.gateReviewData)
  5137. }) : $location.path("/project/" + $stateParams.pid)
  5138. }), $scope.exportData = function(e, a) {
  5139. var t = DataSyncService.getPhaseComponentDetail("Analyze", a),
  5140. o = [];
  5141. o.push(DataSyncService.buildFilter("ProjectId", null, "is", $scope.projectId)), o.push({
  5142. ao: "and"
  5143. }), o.push(DataSyncService.buildFilter("PhaseId", null, "is", t.PhaseId)), o.push({
  5144. andorsplit: "and"
  5145. }), o.push(DataSyncService.buildFilter("PhaseComponentId", null, "is", t.Id)), DataSyncService.exportData(e, o, function(e) {
  5146. window.open(e.data)
  5147. })
  5148. }, $scope.addArrayIndexId = function(e) {
  5149. for (var a = 0; a < e.length; a++) e[a].arrayId = a;
  5150. return e
  5151. }, $scope.addRow = function(e, a) {
  5152. e.push(angular.copy($scope.dSchema[a]))
  5153. }, $scope.deleteRow = function(e, a) {
  5154. e[a].isDeleted = !0
  5155. }, $scope.activateTab = function(e) {
  5156. $scope.activeTab = activateTab($scope.activeTab, e)
  5157. }, $scope.completePhaseComponent = function(e, a) {
  5158. completePhaseComponent(e, a, $scope.projectId, DataSyncService, function(e) {
  5159. e.success && (logger.logSuccess("Phase Updated!"), $scope.phaseDetail = DataSyncService.getPhaseDetail("Analyze"))
  5160. })
  5161. }, $timeout(function() {
  5162. $scope.walkthrough = loadWalkthrough()
  5163. }, 500), $scope.validateField = function(e, a) {
  5164. e = e.currentTarget ? e.currentTarget : $("#" + e);
  5165. var t = validateField(e, a),
  5166. o = $(e).closest(".l6_step").parent().attr("data-phase-component");
  5167. $scope.walkthrough[o].currentStep = t.currentStep, t.isVerified && ($scope.walkthrough[o] = moveNextStep($scope.walkthrough[o]))
  5168. }, $scope.showWalkthrough = function(e, a) {
  5169. $scope.addRow(a, e), $scope.walkthroughs[e] = !0
  5170. }, $scope.hideWalkthrough = function(e) {
  5171. $scope.walkthroughs[e] = !1, $scope.walkthrough[e] = resetWalkthrough($scope.walkthrough[e])
  5172. }
  5173. }
  5174. angular.module("app.project").controller("ProjectAnalyzeCtrl", ["$scope", "$rootScope", "$stateParams", "DataSyncService", "$location", "logger", "$sce", "$timeout", "Upload", ProjectAnalyzeCtrl])
  5175. }(),
  5176. function() {
  5177. "use strict";
  5178.  
  5179. function e(e, a, t, o, r, n, i, s, l) {
  5180. e.projectId = t.pid, e.activeTab = [!0, !1, !1, !1], e.activeTab = activateTab(e.activeTab, t.tid - 1);
  5181. var c, u = {};
  5182. e.walkthroughs = {
  5183. control_plan: !1,
  5184. test_plan: !1
  5185. }, e.dSchema = {
  5186. test_plan: {
  5187. Subject: "",
  5188. Area: "",
  5189. Description: "",
  5190. Details: "",
  5191. ExpectedBenefits: "",
  5192. ResponsibleParty: null,
  5193. EstimatedCost: "",
  5194. Timing: "",
  5195. Status: "",
  5196. Comments: ""
  5197. },
  5198. control_plan: {
  5199. ProcessSteps: "",
  5200. Kpiv: "",
  5201. Kpov: "",
  5202. SpecificationCharacteristic: "",
  5203. Lsl: "",
  5204. Usl: "",
  5205. UnitOfMeasure: "",
  5206. DataDescription: "",
  5207. MeasurementMethod: "",
  5208. SampleSize: "",
  5209. MeasurementFrequency: "",
  5210. WhoMeasures: "",
  5211. WhereRecorded: "",
  5212. CorrectiveAction: "",
  5213. ApplicableSop: ""
  5214. }
  5215. }, o.loadProject(e.projectId, function(i) {
  5216. i.success ? (e.projectDetail = a.currentProject, o.loadContacts(function(a) {
  5217. e.allContacts = a
  5218. }), e.phaseDetail = o.getPhaseDetail("Control"), e.scpData = null, u = o.getPhaseComponentDetail("Control", "SCP Chart"), c = [], c.push(o.buildFilter("ProjectId", null, "is", e.projectId)), c.push({
  5219. ao: "and"
  5220. }), c.push(o.buildFilter("PhaseId", null, "is", u.PhaseId)), c.push({
  5221. andorsplit: "and"
  5222. }), c.push(o.buildFilter("PhaseComponentId", null, "is", u.Id)), o.sync(o.buildRequest("get", ["chartexceldata"], null, [c]), function(a) {
  5223. a.success && e.buildSCP(a.data[0].ExcelFileData)
  5224. }), e.uploadSCPFile = function(a, t) {
  5225. u = o.getPhaseComponentDetail("Control", "SCP Chart"), e.f = a, e.errFile = t && t[0], a && (a.upload = s.upload({
  5226. url: "https://api.l6elite.com",
  5227. data: {
  5228. file: a,
  5229. T: ["chartexceldata"],
  5230. A: "upload",
  5231. V: [{
  5232. ProjectId: e.projectId,
  5233. PhaseId: u.PhaseId,
  5234. PhaseComponentId: u.Id
  5235. }]
  5236. }
  5237. }), a.upload.then(function(a) {
  5238. e.scpData = a.data, e.buildSCP(a.data.ExcelFileData)
  5239. }, function(e) {
  5240. e.status > 0 && n.logError(e.status + ": " + e.data)
  5241. }, function(e) {
  5242. a.progress = Math.min(100, parseInt(100 * e.loaded / e.total))
  5243. }))
  5244. }, e.buildSCP = function(a) {
  5245. e.scpData || (e.scpData = {});
  5246. var t = [],
  5247. o = [],
  5248. r = 0,
  5249. i = 0,
  5250. s = 0,
  5251. l = 0,
  5252. c = 0;
  5253. for (var u in a) {
  5254. var d = 0;
  5255. if (u > 1) {
  5256. var p = [];
  5257. for (var h in a[u])
  5258. if ("A" != h) {
  5259. var g = a[u][h];
  5260. if (null != g && "" != g) {
  5261. if (!parseFloat(g) && 0 !== g) return n.logError("Data Contains Illegal Values. Data Should Only Contain Numeric Values!"), !1;
  5262. p.push(g), d++
  5263. }
  5264. }
  5265. p.length > 0 && (r = d, t.push([parseInt(c), math.mean(p)]), o.push(math.mean(p)), c++);
  5266. }
  5267. }
  5268. o.sort(), i = math.round(math.mean(o), 2);
  5269. var m = math.std(o) / math.sqrt(r);
  5270. s = math.round(i + 3 * m, 2), l = math.round(i - 3 * m, 2), e.lineAvg = i, e.lineUCL = s, e.lineLCL = l;
  5271. var f = i / 4;
  5272. e.scpData.data = [{
  5273. data: t,
  5274. lines: {
  5275. show: !0
  5276. }
  5277. }, {
  5278. data: t,
  5279. points: {
  5280. show: !0
  5281. }
  5282. }], e.scpData.options = {
  5283. yaxis: {
  5284. min: l - f,
  5285. max: s + f
  5286. },
  5287. series: {
  5288. points: {
  5289. lineWidth: 2,
  5290. fill: !0,
  5291. fillColor: "#ffffff",
  5292. symbol: "circle",
  5293. radius: 4
  5294. }
  5295. },
  5296. grid: {
  5297. hoverable: !0,
  5298. clickable: !0,
  5299. tickColor: "#f9f9f9",
  5300. borderWidth: 1,
  5301. borderColor: "#eeeeee",
  5302. markings: [{
  5303. color: "#000",
  5304. lineWidth: 1,
  5305. yaxis: {
  5306. from: i,
  5307. to: i
  5308. }
  5309. }, {
  5310. color: "#ff0000",
  5311. lineWidth: 1,
  5312. yaxis: {
  5313. from: s,
  5314. to: s
  5315. }
  5316. }, {
  5317. color: "#ff0000",
  5318. lineWidth: 1,
  5319. yaxis: {
  5320. from: l,
  5321. to: l
  5322. }
  5323. }]
  5324. },
  5325. tooltip: !0,
  5326. tooltipOpts: {
  5327. defaultTheme: !1
  5328. },
  5329. colors: [e.color.gray, e.color.primary, e.color.primary]
  5330. }
  5331. }, e.controlPlanData = [], e.controlPlanDataOrig = [], e.getControlPlan = function() {
  5332. u = o.getPhaseComponentDetail("Control", "Control Plan"), c = [], c.push(o.buildFilter("ProjectId", null, "is", e.projectId)), c.push({
  5333. ao: "and"
  5334. }), c.push(o.buildFilter("PhaseId", null, "is", u.PhaseId)), c.push({
  5335. andorsplit: "and"
  5336. }), c.push(o.buildFilter("PhaseComponentId", null, "is", u.Id)), o.sync(o.buildRequest("get", ["measurecontrolplan"], null, [c]), function(a) {
  5337. a.success ? (e.controlPlanData = a.data, e.controlPlanDataOrig = angular.copy(e.controlPlanData)) : e.showWalkthrough("control_plan", e.controlPlanData)
  5338. })
  5339. }, e.getControlPlan(), e.submitControlPlan = function() {
  5340. u = o.getPhaseComponentDetail("Control", "Control Plan");
  5341. for (var a = [], t = [], r = [], n = 0; n < e.controlPlanData.length; n++)
  5342. if (!angular.equals(e.controlPlanData[n], e.controlPlanDataOrig[n])) {
  5343. var i = angular.copy(e.controlPlanData[n]);
  5344. i.Id && i.isDeleted ? (t.push(i.Id), e.controlPlanData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, delete i.arrayId, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = u.PhaseId, i.PhaseComponentId = u.Id, r.push(i))
  5345. }
  5346. o.syncTableRowData("measurecontrolplan", r, a, t, null, function() {
  5347. e.getControlPlan()
  5348. })
  5349. }, e.productTestPlanData = [], e.productTestPlanDataOrig = [], e.trainerTestPlanData = [], e.trainerTestPlanDataOrig = [], e.employeesTestPlanData = [], e.employeesTestPlanDataOrig = [], e.getTestPlan = function() {
  5350. u = o.getPhaseComponentDetail("Control", "Test Plan"), c = [], c.push(o.buildFilter("ProjectId", null, "is", e.projectId)), c.push({
  5351. ao: "and"
  5352. }), c.push(o.buildFilter("PhaseId", null, "is", u.PhaseId)), c.push({
  5353. andorsplit: "and"
  5354. }), c.push(o.buildFilter("PhaseComponentId", null, "is", u.Id)), o.sync(o.buildRequest("get", ["controltestplan"], null, [c]), function(a) {
  5355. if (a.success) {
  5356. for (var t = a.data, o = 0; o < t.length; o++) "process" == t[o].Subject ? e.productTestPlanData.push(t[o]) : "trainer" == t[o].Subject ? e.trainerTestPlanData.push(t[o]) : "employees" == t[o].Subject && e.employeesTestPlanData.push(t[o]);
  5357. e.productTestPlanDataOrig = angular.copy(e.productTestPlanData), e.trainerTestPlanDataOrig = angular.copy(e.trainerTestPlanData), e.employeesTestPlanDataOrig = angular.copy(e.employeesTestPlanData)
  5358. } else e.showWalkthrough("test_plan", e.productTestPlanData)
  5359. })
  5360. }, e.getTestPlan(), e.submitTestPlan = function() {
  5361. u = o.getPhaseComponentDetail("Control", "Test Plan");
  5362. for (var a = [], t = [], r = [], n = 0; n < e.productTestPlanData.length; n++)
  5363. if (!angular.equals(e.productTestPlanData[n], e.productTestPlanDataOrig[n])) {
  5364. var i = angular.copy(e.productTestPlanData[n]);
  5365. i.Subject = "process", i.Id && i.isDeleted ? (t.push(i.Id), e.productTestPlanData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = u.PhaseId, i.PhaseComponentId = u.Id, r.push(i))
  5366. }
  5367. for (var n = 0; n < e.trainerTestPlanData.length; n++)
  5368. if (!angular.equals(e.trainerTestPlanData[n], e.trainerTestPlanDataOrig[n])) {
  5369. var i = angular.copy(e.trainerTestPlanData[n]);
  5370. i.Subject = "trainer", i.Id && i.isDeleted ? (t.push(i.Id), e.trainerTestPlanData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = u.PhaseId, i.PhaseComponentId = u.Id, r.push(i))
  5371. }
  5372. for (var n = 0; n < e.employeesTestPlanData.length; n++)
  5373. if (!angular.equals(e.employeesTestPlanData[n], e.employeesTestPlanDataOrig[n])) {
  5374. var i = angular.copy(e.employeesTestPlanData[n]);
  5375. i.Subject = "employees", i.Id && i.isDeleted ? (t.push(i.Id), e.employeesTestPlanData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = u.PhaseId, i.PhaseComponentId = u.Id, r.push(i))
  5376. }
  5377. o.syncTableRowData("controltestplan", r, a, t, null, function() {
  5378. e.getTestPlan()
  5379. })
  5380. }, e.hypothesisTestData = null, u = o.getPhaseComponentDetail("Control", "Hypothesis Test"), c = [], c.push(o.buildFilter("ProjectId", null, "is", e.projectId)), c.push({
  5381. ao: "and"
  5382. }), c.push(o.buildFilter("PhaseId", null, "is", u.PhaseId)), c.push({
  5383. andorsplit: "and"
  5384. }), c.push(o.buildFilter("PhaseComponentId", null, "is", u.Id)), o.sync(o.buildRequest("get", ["chartexceldata"], null, [c]), function(a) {
  5385. a.success && e.buildHypothesisTest(a.data[0].ExcelFileData)
  5386. }), e.uploadHypothesisTestFile = function(a, t) {
  5387. e.f = a, e.errFile = t && t[0], u = o.getPhaseComponentDetail("Control", "Hypothesis Test"), a && (a.upload = s.upload({
  5388. url: "https://api.l6elite.com",
  5389. data: {
  5390. file: a,
  5391. T: ["chartexceldata"],
  5392. A: "upload",
  5393. V: [{
  5394. ProjectId: e.projectId,
  5395. PhaseId: u.PhaseId,
  5396. PhaseComponentId: u.Id
  5397. }]
  5398. }
  5399. }), a.upload.then(function(a) {
  5400. e.buildHypothesisTest(a.data.ExcelFileData)
  5401. }, function(e) {
  5402. e.status > 0 && n.logError(e.status + ": " + e.data)
  5403. }, function(e) {
  5404. a.progress = Math.min(100, parseInt(100 * e.loaded / e.total))
  5405. }))
  5406. }, e.buildHypothesisTest = function(e) {}, e.gateReviewData = [], e.gateReviewDataOrig = [], u = o.getPhaseComponentDetail("Control", "Gate Review"), c = [], c.push(o.buildFilter("ProjectId", null, "is", e.projectId)), c.push({
  5407. ao: "and"
  5408. }), c.push(o.buildFilter("PhaseId", null, "is", u.PhaseId)), c.push({
  5409. andorsplit: "and"
  5410. }), c.push(o.buildFilter("PhaseComponentId", null, "is", u.Id)), o.sync(o.buildRequest("get", ["gatereview"], null, [c]), function(a) {
  5411. a.success && (e.gateReviewData = e.addArrayIndexId(a.data), e.gateReviewDataOrig = angular.copy(e.gateReviewData))
  5412. }), e.gateReviewAddRow = function(a) {
  5413. e.gateReviewData.push({
  5414. arrayId: e.gateReviewData.length,
  5415. Quadrant: a,
  5416. Detail: " "
  5417. })
  5418. }, e.submitGateReview = function() {
  5419. u = o.getPhaseComponentDetail("Control", "Gate Review");
  5420. for (var a = [], t = [], r = [], n = 0; n < e.gateReviewData.length; n++)
  5421. if (!angular.equals(e.gateReviewData[n], e.gateReviewDataOrig[n])) {
  5422. var i = angular.copy(e.gateReviewData[n]);
  5423. i.Id && i.isDeleted ? (t.push(i.Id), e.gateReviewData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, delete i.arrayId, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = u.PhaseId, i.PhaseComponentId = u.Id, delete i.arrayId, r.push(i))
  5424. }
  5425. o.syncTableRowData("gatereview", r, a, t), e.gateReviewDataOrig = angular.copy(e.gateReviewData)
  5426. }) : r.path("/project/" + t.pid)
  5427. }), e.exportData = function(a, t) {
  5428. var r = o.getPhaseComponentDetail("Control", t),
  5429. n = [];
  5430. n.push(o.buildFilter("ProjectId", null, "is", e.projectId)), n.push({
  5431. ao: "and"
  5432. }), n.push(o.buildFilter("PhaseId", null, "is", r.PhaseId)), n.push({
  5433. andorsplit: "and"
  5434. }), n.push(o.buildFilter("PhaseComponentId", null, "is", r.Id)), o.exportData(a, n, function(e) {
  5435. window.open(e.data)
  5436. })
  5437. }, e.addArrayIndexId = function(e) {
  5438. for (var a = 0; a < e.length; a++) e[a].arrayId = a;
  5439. return e
  5440. }, e.addRow = function(a, t) {
  5441. a.push(angular.copy(e.dSchema[t]))
  5442. }, e.deleteRow = function(e, a) {
  5443. e[a].isDeleted = !0
  5444. }, e.activateTab = function(a) {
  5445. e.activeTab = activateTab(e.activeTab, a)
  5446. }, e.completePhaseComponent = function(a, t) {
  5447. completePhaseComponent(a, t, e.projectId, o, function(a) {
  5448. a.success && (n.logSuccess("Phase Updated!"), e.phaseDetail = o.getPhaseDetail("Control"))
  5449. })
  5450. }, l(function() {
  5451. e.walkthrough = loadWalkthrough()
  5452. }, 500), e.validateField = function(a, t) {
  5453. a = a.currentTarget ? a.currentTarget : $("#" + a);
  5454. var o = validateField(a, t),
  5455. r = $(a).closest(".l6_step").parent().attr("data-phase-component");
  5456. e.walkthrough[r].currentStep = o.currentStep, o.isVerified && (e.walkthrough[r] = moveNextStep(e.walkthrough[r]))
  5457. }, e.showWalkthrough = function(a, t) {
  5458. e.addRow(t, a), e.walkthroughs[a] = !0
  5459. }, e.hideWalkthrough = function(a) {
  5460. e.walkthroughs[a] = !1, e.walkthrough[a] = resetWalkthrough(e.walkthrough[a])
  5461. }
  5462. }
  5463. angular.module("app.project").controller("ProjectControlCtrl", ["$scope", "$rootScope", "$stateParams", "DataSyncService", "$location", "logger", "$sce", "Upload", "$timeout", "StatCalc", e])
  5464. }(),
  5465. function() {
  5466. "use strict";
  5467.  
  5468. function e(e, a, t, o, r, n, i, s) {
  5469. e.walkthroughs = {
  5470. voc_ccr: !1,
  5471. risk_management: !1,
  5472. raci: !1,
  5473. stakeholders: !1,
  5474. communication: !1
  5475. }, e.projectId = t.pid, e.activeTab = [!0, !1, !1, !1, !1, !1, !1, !1, !1], e.activeTab = activateTab(e.activeTab, t.tid - 1), e.phaseDetail = {};
  5476. var l, c = {};
  5477. e.dSchema = {
  5478. voc_ccr: {
  5479. Item: "",
  5480. Quantity: 0,
  5481. CustomerIssues: "",
  5482. CustomerRequirements: ""
  5483. },
  5484. risk_management: {
  5485. DateEntered: "",
  5486. CategoryArea: "",
  5487. SpecificRisk: "",
  5488. Severity: "",
  5489. Likelihood: "",
  5490. Detectibility: "",
  5491. RiskPriority: "",
  5492. MitigationSteps: "",
  5493. PersonAccountable: [],
  5494. DueDate: "",
  5495. ContingencyPlan: ""
  5496. },
  5497. stakeholders: {
  5498. UserId: null,
  5499. SupportCategory: "",
  5500. ResistanceType: "",
  5501. ResistanceLevel: "",
  5502. ResistanceStrategy: ""
  5503. },
  5504. sipoc: {
  5505. Suppliers: "",
  5506. Inputs: "",
  5507. Outputs: "",
  5508. Processes: "",
  5509. Customers: "",
  5510. ProcessMeasures: "",
  5511. OutputMeasures: ""
  5512. },
  5513. communication: {
  5514. Media: "",
  5515. Purpose: "",
  5516. Owner: "",
  5517. Frequency: "",
  5518. DayTime: "",
  5519. Length: ""
  5520. }
  5521. }, o.loadProject(e.projectId, function(s) {
  5522. e.allContacts = [], s.success ? (e.projectDetail = a.currentProject, e.diagramType = a.currentProject.DiagramType, e.phaseDetail = o.getPhaseDetail("Define"), e.projectCharter = loadCharter(a), o.loadContacts(function(t) {
  5523. e.allContacts = t, e.projectCharter.Lead = populateMdContactVariable([a.currentProject.Lead], e.allContacts), e.projectCharter.Sponsor = populateMdContactVariable([a.currentProject.Sponsor], e.allContacts), e.projectCharter.CoreTeam = populateMdContactVariable(a.currentProject.CoreTeam ? JSON.parse(a.currentProject.CoreTeam) : [], e.allContacts)
  5524. }), e.submitCharter = function() {
  5525. saveCharter(e.projectCharter, "update", o, n)
  5526. }, e.$watch("projectCharter", function() {
  5527. e.projectCharter.Sponsor.length > 1 && e.projectCharter.Sponsor.pop(), e.projectCharter.Lead.length > 1 && e.projectCharter.Lead.pop()
  5528. }, !0), e.vocCcrData = [], e.vocCcrDataOrig = [], e.getVocCCR = function() {
  5529. c = o.getPhaseComponentDetail("Define", "VOC & CCR"), l = [], l.push(o.buildFilter("ProjectId", null, "is", e.projectId)), l.push({
  5530. ao: "and"
  5531. }), l.push(o.buildFilter("PhaseId", null, "is", c.PhaseId)), l.push({
  5532. andorsplit: "and"
  5533. }), l.push(o.buildFilter("PhaseComponentId", null, "is", c.Id)), o.sync(o.buildRequest("get", ["definevocccr"], null, [l]), function(a) {
  5534. a.success ? (e.vocCcrData = a.data, e.vocCcrDataOrig = angular.copy(e.vocCcrData)) : e.showWalkthrough("voc_ccr", e.vocCcrData)
  5535. })
  5536. }, e.getVocCCR(), e.submitVocCcr = function() {
  5537. c = o.getPhaseComponentDetail("Define", "VOC & CCR");
  5538. for (var a = [], t = [], r = [], n = 0; n < e.vocCcrData.length; n++)
  5539. if (!angular.equals(e.vocCcrData[n], e.vocCcrDataOrig[n])) {
  5540. var i = angular.copy(e.vocCcrData[n]);
  5541. i.Id && i.isDeleted ? (t.push(i.Id), e.vocCcrData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = c.PhaseId, i.PhaseComponentId = c.Id, r.push(i))
  5542. }
  5543. for (var n = e.vocCcrData.length; n--;)("" == e.vocCcrData[n].Tool && "" == e.vocCcrData[n].Quantity && "" == e.vocCcrData[n].CustomerIssues && "" == e.vocCcrData[n].CustomerRequirements || !e.vocCcrData[n].hasOwnProperty("Tool")) && e.vocCcrData.splice(n, 1);
  5544. o.syncTableRowData("definevocccr", r, a, t, null, function(a) {
  5545. e.getVocCCR()
  5546. })
  5547. }, e.riskManagementData = [], e.riskManagementDataOrig = [], e.getRiskManagement = function() {
  5548. c = o.getPhaseComponentDetail("Define", "Risk Management"), l = [], l.push(o.buildFilter("ProjectId", null, "is", e.projectId)), l.push({
  5549. ao: "and"
  5550. }), l.push(o.buildFilter("PhaseId", null, "is", c.PhaseId)), l.push({
  5551. andorsplit: "and"
  5552. }), l.push(o.buildFilter("PhaseComponentId", null, "is", c.Id)), o.sync(o.buildRequest("get", ["defineriskmanagement"], null, [l]), function(a) {
  5553. if (a.success) {
  5554. for (var t = 0; t < a.data.length; t++) a.data[t].DateEntered = moment(a.data[t].DateEntered).format("MM/DD/YYYY"), a.data[t].DueDate = new Date(a.data[t].DueDate);
  5555. e.riskManagementData = a.data, e.riskManagementDataOrig = angular.copy(e.riskManagementData)
  5556. } else e.showWalkthrough("risk_management", e.riskManagementData)
  5557. })
  5558. }, e.getRiskManagement(), e.submitRiskManagement = function() {
  5559. c = o.getPhaseComponentDetail("Define", "Risk Management");
  5560. for (var a = [], t = [], r = [], n = 0; n < e.riskManagementData.length; n++)
  5561. if (!angular.equals(e.riskManagementData[n], e.riskManagementDataOrig[n])) {
  5562. var i = angular.copy(e.riskManagementData[n]);
  5563. i.Id && i.isDeleted ? (t.push(i.Id), e.riskManagementData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = c.PhaseId, i.PhaseComponentId = c.Id, r.push(i)), i.DateEntered = new Date(i.DateEntered), i.DueDate = new Date(i.DueDate)
  5564. }
  5565. for (var n = e.riskManagementData.length; n--;)("" == e.riskManagementData[n].DateEntered && "" == e.riskManagementData[n].CategoryArea && "" == e.riskManagementData[n].SpecificRisk || !e.riskManagementData[n].hasOwnProperty("DateEntered")) && e.riskManagementData.splice(n, 1);
  5566. o.syncTableRowData("defineriskmanagement", r, a, t, null, function() {
  5567. e.getRiskManagement()
  5568. })
  5569. }, e.RACIData = {}, e.raciOwners = [], e.getRaciData = function() {
  5570. c = o.getPhaseComponentDetail("Define", "RACI"), l = [], l.push(o.buildFilter("ProjectId", null, "is", e.projectId)), l.push({
  5571. ao: "and"
  5572. }), l.push(o.buildFilter("PhaseId", null, "is", c.PhaseId)), l.push({
  5573. andorsplit: "and"
  5574. }), l.push(o.buildFilter("PhaseComponentId", null, "is", c.Id)), o.sync(o.buildRequest("get", ["defineraci"], null, [l]), function(a) {
  5575. if (a.success) {
  5576. var t = a.data;
  5577. e.RACIData = {}, e.raciOwners = JSON.parse(t[0].Owners);
  5578. for (var o = 0; o < t.length; o++) e.RACIData[t[o].Activity] = {
  5579. id: t[o].Id,
  5580. label: t[o].Activity,
  5581. data: JSON.parse(t[o].Raci)
  5582. }
  5583. } else e.showRACIWalkthrough()
  5584. })
  5585. }, e.getRaciData(), e.addRACIColumn = function() {
  5586. var a = "New",
  5587. t = 1;
  5588. if (-1 != e.raciOwners.indexOf("New")) {
  5589. do t++; while (e.raciOwners.indexOf("New" + t) > -1);
  5590. a += t
  5591. }
  5592. e.raciOwners.push(a);
  5593. for (var o in e.RACIData) e.RACIData[o].data.push("")
  5594. }, e.addRACILine = function(a) {
  5595. var t = 1,
  5596. o = "New";
  5597. if (a) var o = a;
  5598. else if (e.RACIData.hasOwnProperty("New")) {
  5599. do t++; while (e.RACIData.hasOwnProperty("New" + t));
  5600. o += t
  5601. }
  5602. e.RACIData[o] = {
  5603. label: a ? a : "New",
  5604. data: []
  5605. };
  5606. for (var r = 0; r < e.raciOwners.length; r++) e.RACIData[o].data.push("")
  5607. }, e.deleteRaciRow = function(a) {
  5608. e.RACIData[a].isDeleted = !0
  5609. }, e.deleteRaciCol = function(a) {
  5610. e.raciOwners.splice(a, 1);
  5611. for (var t in e.RACIData) e.RACIData[t].data.splice(a, 1)
  5612. }, e.submitRACI = function() {
  5613. c = o.getPhaseComponentDetail("Define", "RACI");
  5614. var a = [],
  5615. t = [],
  5616. r = [];
  5617. for (var n in e.RACIData) {
  5618. var i = e.RACIData[n],
  5619. s = {
  5620. Activity: i.label,
  5621. Owners: JSON.stringify(e.raciOwners),
  5622. Raci: JSON.stringify(i.data),
  5623. ProjectId: e.projectId,
  5624. PhaseId: c.PhaseId,
  5625. PhaseComponentId: c.Id
  5626. };
  5627. i.hasOwnProperty("id") && i.isDeleted ? (t.push(e.RACIData[n].id), delete e.RACIData[n]) : i.hasOwnProperty("id") ? (s.Id = i.id, a.push(s)) : i.isDeleted || r.push(s)
  5628. }
  5629. o.syncTableRowData("defineraci", r, a, t, null, function() {
  5630. e.getRaciData()
  5631. })
  5632. }, e.stakeholderData = [], e.stakeholderDataOrig = [], e.getStakeHolders = function() {
  5633. c = o.getPhaseComponentDetail("Define", "Stakeholders"), l = [], l.push(o.buildFilter("ProjectId", null, "is", e.projectId)), l.push({
  5634. ao: "and"
  5635. }), l.push(o.buildFilter("PhaseId", null, "is", c.PhaseId)), l.push({
  5636. andorsplit: "and"
  5637. }), l.push(o.buildFilter("PhaseComponentId", null, "is", c.Id)), o.sync(o.buildRequest("get", ["definestakeholders"], null, [l]), function(a) {
  5638. if (a.success) {
  5639. var t = a.data;
  5640. t instanceof Array || (t = [t]);
  5641. for (var o = [], r = 0; t && r < t.length; r++) o.push(t[r].UserId);
  5642. e.stakeholderData = a.data, e.stakeholderDataOrig = angular.copy(e.stakeholderData), e.projectCharter.stakeholders = populateMdContactVariable(o, e.allContacts)
  5643. } else e.showWalkthrough("stakeholders", e.stakeholderData)
  5644. })
  5645. }, e.getStakeHolders(), e.submitStakeholders = function() {
  5646. c = o.getPhaseComponentDetail("Define", "Stakeholders");
  5647. for (var a = [], t = [], r = [], n = 0; n < e.stakeholderData.length; n++)
  5648. if (!angular.equals(e.stakeholderData[n], e.stakeholderDataOrig[n])) {
  5649. var i = angular.copy(e.stakeholderData[n]);
  5650. i.Id && i.isDeleted ? (t.push(i.Id), e.stakeholderData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = c.PhaseId, i.PhaseComponentId = c.Id, r.push(i))
  5651. }
  5652. o.syncTableRowData("definestakeholders", r, a, t, null, function() {
  5653. e.getStakeHolders()
  5654. })
  5655. }, e.sipocData = [], e.sipocDataOrig = [], e.getSipoc = function() {
  5656. c = o.getPhaseComponentDetail("Define", "SIPOC"), l = [], l.push(o.buildFilter("ProjectId", null, "is", e.projectId)), l.push({
  5657. ao: "and"
  5658. }), l.push(o.buildFilter("PhaseId", null, "is", c.PhaseId)), l.push({
  5659. andorsplit: "and"
  5660. }), l.push(o.buildFilter("PhaseComponentId", null, "is", c.Id)), o.sync(o.buildRequest("get", ["definesipoc"], null, [l]), function(a) {
  5661. a.success ? (e.sipocData = a.data, e.sipocDataOrig = angular.copy(e.sipocData)) : e.showWalkthrough("sipoc", e.sipocData)
  5662. })
  5663. }, e.getSipoc(), e.submitSipoc = function() {
  5664. c = o.getPhaseComponentDetail("Define", "SIPOC");
  5665. for (var a = [], t = [], r = [], n = 0; n < e.sipocData.length; n++)
  5666. if (!angular.equals(e.sipocData[n], e.sipocDataOrig[n])) {
  5667. var i = angular.copy(e.sipocData[n]);
  5668. i.Id && i.isDeleted ? (t.push(i.Id), e.sipocData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = c.PhaseId, i.PhaseComponentId = c.Id, r.push(i))
  5669. }
  5670. e.sipocDataOrig = angular.copy(e.sipocData), o.syncTableRowData("definesipoc", r, a, t, null, function() {
  5671. e.getSipoc()
  5672. })
  5673. }, e.valueStreamDiagram = {}, c = o.getPhaseComponentDetail("Define", "Value Stream Diagram"), l = [], l.push(o.buildFilter("ProjectId", null, "is", e.projectId)), l.push({
  5674. ao: "and"
  5675. }), l.push(o.buildFilter("PhaseId", null, "is", c.PhaseId)), l.push({
  5676. andorsplit: "and"
  5677. }), l.push(o.buildFilter("PhaseComponentId", null, "is", c.Id)), o.sync(o.buildRequest("get", ["valuestreamdiagram"], null, [l]), function(a) {
  5678. a.success && (e.valueStreamDiagram = a.data[0], e.defineValueStreamDiagram = i.trustAsHtml(e.valueStreamDiagram.Svg), e.valueStreamDiagram.hasProcessMap = e.valueStreamDiagram.hasOwnProperty("Svg") && "" != e.valueStreamDiagram.Svg ? !0 : !1)
  5679. }), e.communicationData = [], e.communicationDataOrig = [], e.getCommData = function() {
  5680. c = o.getPhaseComponentDetail("Define", "Communication"), l = [], l.push(o.buildFilter("ProjectId", null, "is", e.projectId)), l.push({
  5681. ao: "and"
  5682. }), l.push(o.buildFilter("PhaseId", null, "is", c.PhaseId)), l.push({
  5683. andorsplit: "and"
  5684. }), l.push(o.buildFilter("PhaseComponentId", null, "is", c.Id)), o.sync(o.buildRequest("get", ["definecommunication"], null, [l]), function(a) {
  5685. a.success ? (e.communicationData = a.data, e.communicationDataOrig = angular.copy(e.communicationData)) : e.showWalkthrough("communication", e.communicationData)
  5686. })
  5687. }, e.getCommData(), e.submitCommunication = function() {
  5688. c = o.getPhaseComponentDetail("Define", "Communication");
  5689. for (var a = [], t = [], r = [], n = 0; n < e.communicationData.length; n++)
  5690. if (!angular.equals(e.communicationData[n], e.communicationDataOrig[n])) {
  5691. var i = angular.copy(e.communicationData[n]);
  5692. i.Id && i.isDeleted ? (t.push(i.Id), e.communicationData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = c.PhaseId, i.PhaseComponentId = c.Id, r.push(i))
  5693. }
  5694. o.syncTableRowData("definecommunication", r, a, t, null, function() {
  5695. e.getCommData()
  5696. })
  5697. }, e.gateReviewData = [], e.gateReviewDataOrig = [], e.getGateReview = function() {
  5698. c = o.getPhaseComponentDetail("Define", "Gate Review"), l = [], l.push(o.buildFilter("ProjectId", null, "is", e.projectId)), l.push({
  5699. ao: "and"
  5700. }), l.push(o.buildFilter("PhaseId", null, "is", c.PhaseId)), l.push({
  5701. andorsplit: "and"
  5702. }), l.push(o.buildFilter("PhaseComponentId", null, "is", c.Id)), o.sync(o.buildRequest("get", ["definegatereview"], null, [l]), function(a) {
  5703. a.success && (e.gateReviewData = e.addArrayIndexId(a.data), e.gateReviewDataOrig = angular.copy(e.gateReviewData))
  5704. })
  5705. }, e.getGateReview(), e.gateReviewAddRow = function(a) {
  5706. console.log(e.gateReviewData), e.gateReviewData.push({
  5707. arrayId: e.gateReviewData.length,
  5708. Quadrant: a,
  5709. Detail: " "
  5710. })
  5711. }, e.submitGateReview = function() {
  5712. c = o.getPhaseComponentDetail("Define", "Gate Review");
  5713. for (var a = [], t = [], r = [], n = 0; n < e.gateReviewData.length; n++)
  5714. if (!angular.equals(e.gateReviewData[n], e.gateReviewDataOrig[n])) {
  5715. var i = angular.copy(e.gateReviewData[n]);
  5716. i.Id && i.isDeleted ? (t.push(i.Id), e.gateReviewData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, delete i.arrayId, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = c.PhaseId, i.PhaseComponentId = c.Id, delete i.arrayId, r.push(i))
  5717. }
  5718. o.syncTableRowData("definegatereview", r, a, t, null, function() {
  5719. e.getGateReview()
  5720. })
  5721. }) : r.path("/project/" + t.pid)
  5722. }), e.exportData = function(a, t) {
  5723. var r = o.getPhaseComponentDetail("Define", t),
  5724. n = [];
  5725. n.push(o.buildFilter("ProjectId", null, "is", e.projectId)), n.push({
  5726. ao: "and"
  5727. }), n.push(o.buildFilter("PhaseId", null, "is", r.PhaseId)), n.push({
  5728. andorsplit: "and"
  5729. }), n.push(o.buildFilter("PhaseComponentId", null, "is", r.Id)), o.exportData(a, n, function(e) {
  5730. window.open(e.data)
  5731. })
  5732. }, e.addArrayIndexId = function(e) {
  5733. for (var a = 0; a < e.length; a++) e[a].arrayId = a;
  5734. return e
  5735. }, e.addRow = function(a, t) {
  5736. a.push(angular.copy(e.dSchema[t]))
  5737. }, e.deleteRow = function(e, a) {
  5738. e[a].isDeleted = !0
  5739. }, e.querySearch = function(a) {
  5740. var t = a ? e.allContacts.filter(e.createFilterFor(a)) : [];
  5741. return t
  5742. }, e.createFilterFor = function(e) {
  5743. var a = angular.lowercase(e);
  5744. return function(e) {
  5745. return -1 !== e._lowername.indexOf(a)
  5746. }
  5747. }, e.completePhaseComponent = function(a, t) {
  5748. completePhaseComponent(a, t, e.projectId, o, function(a) {
  5749. a.success && (n.logSuccess("Phase Updated!"), e.phaseDetail = o.getPhaseDetail("Define"))
  5750. })
  5751. }, e.filterSelected = !0, e.activateTab = function(a) {
  5752. e.activeTab = activateTab(e.activeTab, a)
  5753. }, e.openCalendar = function(a) {
  5754. e.projectCharter[a].status.opened = !0
  5755. }, s(function() {
  5756. e.walkthrough = loadWalkthrough()
  5757. }, 500), e.validateField = function(a, t) {
  5758. console.log(t), a = a.currentTarget ? a.currentTarget : $("#" + a);
  5759. var o = validateField(a, t),
  5760. r = $(a).closest(".l6_step").parent().attr("data-phase-component");
  5761. console.log($(a).parent()), e.walkthrough[r].currentStep = o.currentStep, o.isVerified && (e.walkthrough[r] = moveNextStep(e.walkthrough[r]))
  5762. }, e.raciWalkthroughData = {
  5763. activity: "",
  5764. owner: "",
  5765. responsibility: ""
  5766. }, e.submitRACIWalkthrough = function() {
  5767. e.RACIData.hasOwnProperty(e.raciWalkthroughData.activity) ? 1 !== e.raciOwners.indexOf(e.raciWalkthroughData.owner) ? e.RACIData[e.raciWalkthroughData.activity].data[e.raciOwners.indexOf(e.raciWalkthroughData.owner)] = e.raciWalkthroughData.responsibility : (e.addRACIColumn(), e.raciOwners[e.raciOwners.length - 1] = e.raciWalkthroughData.owner, e.RACIData[e.raciWalkthroughData.activity].data[e.raciOwners.length - 1] = e.raciWalkthroughData.responsibility) : (e.addRACILine(e.raciWalkthroughData.activity), e.RACIData[e.raciWalkthroughData.activity].label = e.raciWalkthroughData.activity, -1 !== e.raciOwners.indexOf(e.raciWalkthroughData.owner) ? e.RACIData[e.raciWalkthroughData.activity].data[e.raciOwners.indexOf(e.raciWalkthroughData.owner)] = e.raciWalkthroughData.responsibility : (e.addRACIColumn(), e.raciOwners[e.raciOwners.length - 1] = e.raciWalkthroughData.owner, e.RACIData[e.raciWalkthroughData.activity].data[e.raciOwners.length - 1] = e.raciWalkthroughData.responsibility)), e.hideWalkthrough("raci")
  5768. }, e.showRACIWalkthrough = function() {
  5769. e.raciWalkthroughData = {
  5770. activity: "",
  5771. owner: "",
  5772. responsibility: ""
  5773. }, e.walkthroughs.raci = !0
  5774. }, e.showWalkthrough = function(a, t) {
  5775. e.addRow(t, a), e.walkthroughs[a] = !0
  5776. }, e.hideWalkthrough = function(a) {
  5777. e.walkthroughs[a] = !1, e.walkthrough[a] = resetWalkthrough(e.walkthrough[a])
  5778. }
  5779. }
  5780. angular.module("app.project").controller("ProjectDefineCtrl", ["$scope", "$rootScope", "$stateParams", "DataSyncService", "$location", "logger", "$sce", "$timeout", e])
  5781. }(),
  5782. function() {
  5783. "use strict";
  5784.  
  5785. function e(e, a, t, o, r) {
  5786. e.ProjectHistoryData = [], o.getUserSubordinates(function(t) {
  5787. var r = [a.globals.userDetails.Id];
  5788. if (t.success)
  5789. for (var n = 0; t.data && n < t.data.length; n++) t.data[n].Id && r.push(t.data[n].Id);
  5790. e.subordinates = r;
  5791. var i = [o.buildFilter("CreatedBy", null, "anyof", r)];
  5792. o.sync(o.buildRequest("get", ["projects"], null, [i]), function(a) {
  5793. a.success ? (e.allProjects = a.data, "object" != typeof e.allProjects && (e.allProjects = []), e.allProjects instanceof Array || (e.allProjects = [e.allProjects])) : e.allProjects = [], o.loadContacts(function(a) {
  5794. for (var t = {}, o = 0; e.allProjects && o < e.allProjects.length; o++) {
  5795. var r = "",
  5796. n = moment(e.allProjects[o].DateTimeCreated).format("MMMM YYYY"),
  5797. i = e.allProjects[o];
  5798. t[n] || (t[n] = []);
  5799. for (var s = 0; a && s < a.length; s++)
  5800. if (a[s].id == i.CreatedBy) {
  5801. r = a[s].name + " (" + a[s].worktitle + ")";
  5802. break
  5803. }
  5804. i.CreatedBy = r, i.CompletionPercentage = parseInt(i.CompletionPercentage), t[n].push(i)
  5805. }
  5806. for (var l in t) e.ProjectHistoryData.push({
  5807. date: l,
  5808. projects: t[l]
  5809. })
  5810. })
  5811. })
  5812. })
  5813. }
  5814. angular.module("app.project").controller("ProjectHistoryCtrl", ["$scope", "$rootScope", "$stateParams", "DataSyncService", "$location", e])
  5815. }(),
  5816. function() {
  5817. "use strict";
  5818.  
  5819. function e(e, a, t, o, r, n, i, s) {
  5820. e.projectId = t.pid, e.activeTab = [!0, !1, !1], e.activeTab = activateTab(e.activeTab, t.tid - 1);
  5821. var l, c = {};
  5822. e.walkthroughs = {
  5823. improvementPlan: !1
  5824. }, e.dSchema = {
  5825. improvementPlan: {
  5826. Process: "",
  5827. Goal: "",
  5828. ActionNeeded: "",
  5829. ResourceResponsible: "",
  5830. Challenges: "",
  5831. Measures: ""
  5832. }
  5833. }, o.loadProject(e.projectId, function(n) {
  5834. n.success ? (e.projectDetail = a.currentProject, e.diagramType = a.currentProject.DiagramType, "Value Stream Diagram" !== e.diagramType && e.activeTab[0] === !0 && (e.activeTab[0] = !1, e.activeTab[1] = !0), e.phaseDetail = o.getPhaseDetail("Improve"), e.valueStreamDiagram = {}, c = o.getPhaseComponentDetail("Improve", "Value Stream Diagram"), l = [], l.push(o.buildFilter("ProjectId", null, "is", e.projectId)), l.push({
  5835. ao: "and"
  5836. }), l.push(o.buildFilter("PhaseId", null, "is", c.PhaseId)), l.push({
  5837. andorsplit: "and"
  5838. }), l.push(o.buildFilter("PhaseComponentId", null, "is", c.Id)), o.sync(o.buildRequest("get", ["valuestreamdiagram"], null, [l]), function(a) {
  5839. if (a.success) e.valueStreamDiagram = a.data[0], e.valueStreamDiagram.hasProcessMap = e.valueStreamDiagram.hasOwnProperty("Svg") && "" != e.valueStreamDiagram.Svg ? !0 : !1, e.improveValueStreamDiagram = i.trustAsHtml(e.valueStreamDiagram.Svg);
  5840. else {
  5841. var t = o.getPhaseComponentDetail("Measure", "Value Stream Diagram");
  5842. l = [], l.push(o.buildFilter("ProjectId", null, "is", e.projectId)), l.push({
  5843. ao: "and"
  5844. }), l.push(o.buildFilter("PhaseId", null, "is", t.PhaseId)), l.push({
  5845. andorsplit: "and"
  5846. }), l.push(o.buildFilter("PhaseComponentId", null, "is", t.Id)), o.sync(o.buildRequest("get", ["valuestreamdiagram"], null, [l]), function(a) {
  5847. a.success ? (e.valueStreamDiagram = a.data[0], e.improveValueStreamDiagram = i.trustAsHtml(e.valueStreamDiagram.Svg), e.valueStreamDiagram.hasProcessMap = e.valueStreamDiagram.hasOwnProperty("Svg") && "" != e.valueStreamDiagram.Svg ? !0 : !1) : (t = o.getPhaseComponentDetail("Define", "Value Stream Diagram"), l = [], l.push(o.buildFilter("ProjectId", null, "is", e.projectId)), l.push({
  5848. ao: "and"
  5849. }), l.push(o.buildFilter("PhaseId", null, "is", t.PhaseId)), l.push({
  5850. andorsplit: "and"
  5851. }), l.push(o.buildFilter("PhaseComponentId", null, "is", t.Id)), o.sync(o.buildRequest("get", ["valuestreamdiagram"], null, [l]), function(a) {
  5852. a.success && (e.valueStreamDiagram = a.data[0], e.improveValueStreamDiagram = i.trustAsHtml(e.valueStreamDiagram.Svg), e.valueStreamDiagram.hasProcessMap = e.valueStreamDiagram.hasOwnProperty("Svg") && "" != e.valueStreamDiagram.Svg ? !0 : !1)
  5853. }))
  5854. })
  5855. }
  5856. }), e.improvementPlanData = [], e.improvementPlanDataOrig = [], e.getImprovementPlan = function() {
  5857. c = o.getPhaseComponentDetail("Improve", "Improvement Plan"), l = [], l.push(o.buildFilter("ProjectId", null, "is", e.projectId)), l.push({
  5858. ao: "and"
  5859. }), l.push(o.buildFilter("PhaseId", null, "is", c.PhaseId)), l.push({
  5860. andorsplit: "and"
  5861. }), l.push(o.buildFilter("PhaseComponentId", null, "is", c.Id)), o.sync(o.buildRequest("get", ["improveimprovementplan"], null, [l]), function(a) {
  5862. a.success ? (e.improvementPlanData = a.data, e.improvementPlanDataOrig = angular.copy(e.improvementPlanData)) : e.showWalkthrough("improvementPlan", e.improvementPlanData)
  5863. })
  5864. }, e.getImprovementPlan(), e.submitImprovementPlan = function() {
  5865. c = o.getPhaseComponentDetail("Improve", "Improvement Plan");
  5866. for (var a = [], t = [], r = [], n = 0; n < e.improvementPlanData.length; n++)
  5867. if (!angular.equals(e.improvementPlanData[n], e.improvementPlanDataOrig[n])) {
  5868. var i = angular.copy(e.improvementPlanData[n]);
  5869. i.Id && i.isDeleted ? (t.push(i.Id), e.improvementPlanData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = c.PhaseId, i.PhaseComponentId = c.Id, r.push(i))
  5870. }
  5871. o.syncTableRowData("improveimprovementplan", r, a, t, null, function() {
  5872. e.getImprovementPlan()
  5873. })
  5874. }, e.gateReviewData = [], e.gateReviewDataOrig = [], c = o.getPhaseComponentDetail("Improve", "Gate Review"), l = [], l.push(o.buildFilter("ProjectId", null, "is", e.projectId)), l.push({
  5875. ao: "and"
  5876. }), l.push(o.buildFilter("PhaseId", null, "is", c.PhaseId)), l.push({
  5877. andorsplit: "and"
  5878. }), l.push(o.buildFilter("PhaseComponentId", null, "is", c.Id)), o.sync(o.buildRequest("get", ["gatereview"], null, [l]), function(a) {
  5879. a.success && (e.gateReviewData = e.addArrayIndexId(a.data), e.gateReviewDataOrig = angular.copy(e.gateReviewData))
  5880. }), e.gateReviewAddRow = function(a) {
  5881. e.gateReviewData.push({
  5882. arrayId: e.gateReviewData.length,
  5883. Quadrant: a,
  5884. Detail: " "
  5885. })
  5886. }, e.submitGateReview = function() {
  5887. c = o.getPhaseComponentDetail("Improve", "Gate Review");
  5888. for (var a = [], t = [], r = [], n = 0; n < e.gateReviewData.length; n++)
  5889. if (!angular.equals(e.gateReviewData[n], e.gateReviewDataOrig[n])) {
  5890. var i = angular.copy(e.gateReviewData[n]);
  5891. i.Id && i.isDeleted ? (t.push(i.Id), e.gateReviewData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, delete i.arrayId, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = c.PhaseId, i.PhaseComponentId = c.Id, delete i.arrayId, r.push(i))
  5892. }
  5893. o.syncTableRowData("gatereview", r, a, t), e.gateReviewDataOrig = angular.copy(e.gateReviewData)
  5894. }) : r.path("/project/" + t.pid), o.loadContacts(function(a) {
  5895. e.allContacts = a
  5896. })
  5897. }), e.exportData = function(a, t) {
  5898. var r = o.getPhaseComponentDetail("Improve", t),
  5899. n = [];
  5900. n.push(o.buildFilter("ProjectId", null, "is", e.projectId)), n.push({
  5901. ao: "and"
  5902. }), n.push(o.buildFilter("PhaseId", null, "is", r.PhaseId)), n.push({
  5903. andorsplit: "and"
  5904. }), n.push(o.buildFilter("PhaseComponentId", null, "is", r.Id)), o.exportData(a, n, function(e) {
  5905. window.open(e.data)
  5906. })
  5907. }, e.addArrayIndexId = function(e) {
  5908. for (var a = 0; a < e.length; a++) e[a].arrayId = a;
  5909. return e
  5910. }, e.addRow = function(a, t) {
  5911. a.push(angular.copy(e.dSchema[t]))
  5912. }, e.deleteRow = function(e, a) {
  5913. e[a].isDeleted = !0
  5914. }, e.activateTab = function(a) {
  5915. e.activeTab = activateTab(e.activeTab, a)
  5916. }, e.completePhaseComponent = function(a, t) {
  5917. completePhaseComponent(a, t, e.projectId, o, function(a) {
  5918. a.success && (n.logSuccess("Phase Updated!"), e.phaseDetail = o.getPhaseDetail("Improve"))
  5919. })
  5920. }, s(function() {
  5921. e.walkthrough = loadWalkthrough()
  5922. }, 500), e.validateField = function(a, t) {
  5923. a = a.currentTarget ? a.currentTarget : $("#" + a);
  5924. var o = validateField(a, t),
  5925. r = $(a).closest(".l6_step").parent().attr("data-phase-component");
  5926. e.walkthrough[r].currentStep = o.currentStep, o.isVerified && (e.walkthrough[r] = moveNextStep(e.walkthrough[r]))
  5927. }, e.showWalkthrough = function(a, t) {
  5928. e.addRow(t, a), e.walkthroughs[a] = !0
  5929. }, e.hideWalkthrough = function(a) {
  5930. e.walkthroughs[a] = !1, e.walkthrough[a] = resetWalkthrough(e.walkthrough[a])
  5931. }
  5932. }
  5933. angular.module("app.project").controller("ProjectImproveCtrl", ["$scope", "$rootScope", "$stateParams", "DataSyncService", "$location", "logger", "$sce", "$timeout", e])
  5934. }(),
  5935. function() {
  5936. "use strict";
  5937.  
  5938. function e(e, a, t, o, r, n, i, s, l) {
  5939. e.walkthroughs = {
  5940. non_value_analysis: !1,
  5941. cne_matrix: !1,
  5942. collection_plan: !1,
  5943. "control-plan": !1,
  5944. histogram: !1
  5945. }, e.projectId = t.pid, e.activeTab = [!0, !1, !1, !1, !1, !1], e.activeTab = activateTab(e.activeTab, t.tid - 1);
  5946. var c, u = {};
  5947. e.dSchema = {
  5948. non_value_analysis: {
  5949. Waste: "",
  5950. Improvements: ""
  5951. },
  5952. collection_plan: {
  5953. Measure: "",
  5954. MeasureType: "",
  5955. DataType: "",
  5956. OperationalDefinition: "",
  5957. Specification: "",
  5958. Target: "",
  5959. DataCollectionForm: "",
  5960. Sampling: "",
  5961. BaselineSigma: ""
  5962. },
  5963. control_plan: {
  5964. ProcessSteps: "",
  5965. Ctq: "",
  5966. SpecificationCharacteristic: "",
  5967. Lsl: "",
  5968. Usl: "",
  5969. UnitOfMeasure: "",
  5970. DataDescription: "",
  5971. MeasurementMethod: "",
  5972. SampleSize: "",
  5973. MeasurementFrequency: "",
  5974. WhoMeasures: "",
  5975. WhereRecorded: "",
  5976. CorrectiveAction: "",
  5977. ApplicableSop: ""
  5978. }
  5979. }, o.loadProject(e.projectId, function(d) {
  5980. if (d.success) {
  5981. e.projectDetail = a.currentProject, e.diagramType = a.currentProject.DiagramType, o.loadContacts(function(a) {
  5982. e.allContacts = a
  5983. }), e.phaseDetail = o.getPhaseDetail("Measure"), e.nonValueAnalysisData = [], e.nonValueAnalysisDataOrig = [], e.getNonValueAnalysis = function() {
  5984. u = o.getPhaseComponentDetail("Measure", "Non-Value Analysis"), c = [], c.push(o.buildFilter("ProjectId", null, "is", e.projectId)), c.push({
  5985. ao: "and"
  5986. }), c.push(o.buildFilter("PhaseId", null, "is", u.PhaseId)), c.push({
  5987. andorsplit: "and"
  5988. }), c.push(o.buildFilter("PhaseComponentId", null, "is", u.Id)), o.sync(o.buildRequest("get", ["measurenonvalueanalysis"], null, [c]), function(a) {
  5989. a.success ? (e.nonValueAnalysisData = a.data, e.nonValueAnalysisDataOrig = angular.copy(e.nonValueAnalysisData)) : e.showWalkthrough("non_value_analysis", e.nonValueAnalysisData)
  5990. })
  5991. }, e.getNonValueAnalysis(), e.submitNonValueAnalysis = function() {
  5992. u = o.getPhaseComponentDetail("Measure", "Non-Value Analysis");
  5993. for (var a = [], t = [], r = [], n = 0; n < e.nonValueAnalysisData.length; n++)
  5994. if (!angular.equals(e.nonValueAnalysisData[n], e.nonValueAnalysisDataOrig[n])) {
  5995. var i = angular.copy(e.nonValueAnalysisData[n]);
  5996. i.Id && i.isDeleted ? (t.push(i.Id), e.nonValueAnalysisData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated,
  5997. delete i.LastUpdated, delete i.arrayId, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = u.PhaseId, i.PhaseComponentId = u.Id, r.push(i))
  5998. }
  5999. o.syncTableRowData("measurenonvalueanalysis", r, a, t, null, function() {
  6000. e.getNonValueAnalysis()
  6001. })
  6002. }, e.ceMatrixRowData = [], e.ceMatrixRowDataOrig = [], e.ceMatrixOutputData = [], e.ceMatrixOutputDataOrig = [], e.ceMatrixColData = [], e.ceMatrixColDataOrig = [];
  6003. var p = !0;
  6004. u = o.getPhaseComponentDetail("Measure", "C&E Matrix"), e.loadCEMatrixData = function() {
  6005. c = [], c.push(o.buildFilter("ProjectId", null, "is", e.projectId)), c.push({
  6006. ao: "and"
  6007. }), c.push(o.buildFilter("PhaseId", null, "is", u.PhaseId)), c.push({
  6008. andorsplit: "and"
  6009. }), c.push(o.buildFilter("PhaseComponentId", null, "is", u.Id)), o.sync(o.buildRequest("get", ["analyzecematrix"], null, [c]), function(a) {
  6010. if (a.success) {
  6011. 1 == a.data.length && "" == a.data[0].ProcessInput && (e.walkthroughs.cne_matrix = !0), u = o.getPhaseComponentDetail("Measure", "C&E Matrix"), e.ceMatrixRowData = a.data, e.ceMatrixRowDataOrig = angular.copy(e.ceMatrixRowData);
  6012. for (var t = [], r = 0; r < e.ceMatrixRowData.length; r++) t.push(e.ceMatrixRowData[r].Id);
  6013. var n = [];
  6014. n.push(o.buildFilter("MatrixId", null, "anyof", t)), o.sync(o.buildRequest("get", ["analyzecematrixdata"], null, [n]), function(a) {
  6015. u = o.getPhaseComponentDetail("Measure", "C&E Matrix"), a.success && (e.ceMatrixColData = a.data, e.ceMatrixColDataOrig = angular.copy(e.ceMatrixColData));
  6016. var t = [];
  6017. t.push(o.buildFilter("ProjectId", null, "is", e.projectId)), t.push({
  6018. ao: "and"
  6019. }), t.push(o.buildFilter("PhaseId", null, "is", u.PhaseId)), t.push({
  6020. andorsplit: "and"
  6021. }), t.push(o.buildFilter("PhaseComponentId", null, "is", u.Id)), o.sync(o.buildRequest("get", ["analyzecematrixoutputs"], null, [t]), function(a) {
  6022. if (a.success) {
  6023. e.ceMatrixOutputData = a.data, e.ceMatrixOutputDataOrig = angular.copy(e.ceMatrixOutputData);
  6024. for (var t = 0; t < e.ceMatrixRowData.length; t++) {
  6025. e.ceMatrixRowData[t].colData = [];
  6026. for (var o = 0; o < e.ceMatrixOutputData.length; o++) {
  6027. for (var r = !1, n = 0; n < e.ceMatrixColData.length; n++) e.ceMatrixColData[n].MatrixId == e.ceMatrixRowData[t].Id && e.ceMatrixColData[n].MatrixOutputId == e.ceMatrixOutputData[o].Id && (e.ceMatrixRowData[t].colData.push(e.ceMatrixColData[n]), r = !0);
  6028. r || e.ceMatrixRowData[t].colData.push({
  6029. MatrixId: e.ceMatrixRowData[t].Id,
  6030. MatrixOutputId: e.ceMatrixOutputData[o].Id,
  6031. Correlation: ""
  6032. })
  6033. }
  6034. }
  6035. }
  6036. e.calculateTotals(), p = !1
  6037. })
  6038. })
  6039. } else {
  6040. u = o.getPhaseComponentDetail("Measure", "C&E Matrix");
  6041. var i = [];
  6042. i.push(o.buildFilter("ProjectId", null, "is", e.projectId)), i.push({
  6043. ao: "and"
  6044. }), i.push(o.buildFilter("PhaseId", null, "is", u.PhaseId)), i.push({
  6045. andorsplit: "and"
  6046. }), i.push(o.buildFilter("PhaseComponentId", null, "is", u.Id)), o.sync(o.buildRequest("get", ["analyzecematrixoutputs"], null, [i]), function(a) {
  6047. a.success ? (1 == a.data.length && "" == a.data[0].ProcessOutput && (e.walkthroughs.cne_matrix = !0), e.ceMatrixOutputData = a.data, e.ceMatrixOutputDataOrig = angular.copy(e.ceMatrixOutputData)) : e.showCNEWalkthrough(), p = !1
  6048. })
  6049. }
  6050. })
  6051. }, e.deleteCEColumn = function(a) {
  6052. e.ceMatrixOutputData[a].isDeleted = !0, e.ceMatrixOutputData[a].Importance = 0;
  6053. for (var t = 0; t < e.ceMatrixRowData.length; t++) e.ceMatrixRowData[t].colData[a].isDeleted = !0, e.ceMatrixRowData[t].colData[a].Correlation = 0
  6054. }, e.deleteCERow = function(a) {
  6055. e.ceMatrixRowData[a].isDeleted = !0;
  6056. for (var t = 0; t < e.ceMatrixRowData[a].colData.length; t++) e.ceMatrixRowData[a].colData[t].isDeleted = !0, e.ceMatrixRowData[a].colData[t].Correlation = 0
  6057. }, e.addCEMatrixRow = function() {
  6058. u = o.getPhaseComponentDetail("Measure", "C&E Matrix");
  6059. var a = [],
  6060. t = {
  6061. ProjectId: e.projectId,
  6062. PhaseId: u.PhaseId,
  6063. PhaseComponentId: u.Id,
  6064. ProcessStep: "",
  6065. ProcessInput: ""
  6066. };
  6067. o.sync(o.buildRequest("add", ["analyzecematrix"], null, null, [t]), function(t) {
  6068. if (t.success) {
  6069. for (var o = t.data.Id, r = 0; r < e.ceMatrixOutputData.length; r++) {
  6070. var n = {
  6071. MatrixId: o,
  6072. MatrixOutputId: e.ceMatrixOutputData[r].Id,
  6073. Correlation: ""
  6074. };
  6075. a.push(n)
  6076. }
  6077. t.data.colData = a, e.ceMatrixRowData.push(t.data), e.ceMatrixRowDataOrig = angular.copy(e.ceMatrixRowData)
  6078. }
  6079. })
  6080. }, e.addCEMatrixColumn = function() {
  6081. u = o.getPhaseComponentDetail("Measure", "C&E Matrix");
  6082. var a = {
  6083. ProjectId: e.projectId,
  6084. PhaseId: u.PhaseId,
  6085. PhaseComponentId: u.Id,
  6086. ProcessOutput: "",
  6087. Importance: ""
  6088. };
  6089. o.sync(o.buildRequest("add", ["analyzecematrixoutputs"], null, null, [a]), function(a) {
  6090. if (a.success) {
  6091. var t = a.data.Id;
  6092. e.ceMatrixOutputData.push(a.data);
  6093. for (var o = 0; o < e.ceMatrixRowData.length; o++) e.ceMatrixRowData[o].colData.push({
  6094. MatrixId: e.ceMatrixRowData[o].Id,
  6095. MatrixOutputId: t,
  6096. Correlation: ""
  6097. });
  6098. e.ceMatrixOutputDataOrig = angular.copy(e.ceMatrixOutputData)
  6099. } else n.logError("Oops! An Error Occurred While Trying To Add A Column. Are You Still Connected To The Internet?")
  6100. })
  6101. }, e.showCNEWalkthrough = function() {
  6102. return e.addCEMatrixColumn(), e.addCEMatrixRow(), e.walkthroughs.cne_matrix = !0, !1
  6103. }, e.submitCEMatrix = function() {
  6104. u = o.getPhaseComponentDetail("Measure", "C&E Matrix");
  6105. for (var a = [], t = [], r = [], n = [], i = [], s = 0; s < e.ceMatrixOutputData.length; s++) {
  6106. var c = angular.copy(e.ceMatrixOutputData[s]);
  6107. c.Id && c.isDeleted ? (t.push(c.Id), e.ceMatrixOutputData[s].Id = !1) : c.Id && (delete c.DateTimeCreated, delete c.LastUpdated, a.push(c))
  6108. }
  6109. o.syncTableRowData("analyzecematrixoutputs", r, a, t, !1), e.ceMatrixOutputDataOrig = angular.copy(e.ceMatrixOutputData), a = [], t = [], r = [];
  6110. for (var s = 0; s < e.ceMatrixRowData.length; s++) {
  6111. var c = angular.copy(e.ceMatrixRowData[s]);
  6112. if (c.Id && c.isDeleted) t.push(c.Id), e.ceMatrixRowData[s].Id = !1;
  6113. else if (c.Id) {
  6114. for (var d = 0; c.colData && d < c.colData.length; d++) {
  6115. var p = angular.copy(c.colData[d]);
  6116. p.Id && !p.isDeleted ? (delete p.DateTimeCreated, delete p.LastUpdated, n.push(p)) : p.isDeleted || i.push(p)
  6117. }
  6118. delete c.DateTimeCreated, delete c.LastUpdated, delete c.colData, delete c.rowTotal, a.push(c)
  6119. }
  6120. }
  6121. o.syncTableRowData("analyzecematrix", r, a, t, !1), o.syncTableRowData("analyzecematrixdata", i, n, []), e.ceMatrixRowDataOrig = angular.copy(e.ceMatrixRowData), l(function() {
  6122. e.loadCEMatrixData()
  6123. }, 1200)
  6124. }, e.loadCEMatrixData(), e.collectionPlanData = [], e.collectionPlanDataOrig = [], e.getCollectionPlan = function() {
  6125. u = o.getPhaseComponentDetail("Measure", "Collection Plan"), c = [], c.push(o.buildFilter("ProjectId", null, "is", e.projectId)), c.push({
  6126. ao: "and"
  6127. }), c.push(o.buildFilter("PhaseId", null, "is", u.PhaseId)), c.push({
  6128. andorsplit: "and"
  6129. }), c.push(o.buildFilter("PhaseComponentId", null, "is", u.Id)), o.sync(o.buildRequest("get", ["measurecollectionplan"], null, [c]), function(a) {
  6130. a.success ? (e.collectionPlanData = a.data, e.collectionPlanDataOrig = angular.copy(e.collectionPlanData)) : e.showWalkthrough("collection_plan", e.collectionPlanData)
  6131. })
  6132. }, e.getCollectionPlan(), e.submitCollectionPlan = function() {
  6133. u = o.getPhaseComponentDetail("Measure", "Collection Plan");
  6134. for (var a = [], t = [], r = [], n = 0; n < e.collectionPlanData.length; n++)
  6135. if (!angular.equals(e.collectionPlanData[n], e.collectionPlanDataOrig[n])) {
  6136. var i = angular.copy(e.collectionPlanData[n]);
  6137. i.Id && i.isDeleted ? (t.push(i.Id), e.collectionPlanData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, delete i.arrayId, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = u.PhaseId, i.PhaseComponentId = u.Id, r.push(i))
  6138. }
  6139. o.syncTableRowData("measurecollectionplan", r, a, t, null, function() {
  6140. e.getCollectionPlan()
  6141. })
  6142. }, e.histogramData = null, u = o.getPhaseComponentDetail("Measure", "Histogram"), c = [], c.push(o.buildFilter("ProjectId", null, "is", e.projectId)), c.push({
  6143. ao: "and"
  6144. }), c.push(o.buildFilter("PhaseId", null, "is", u.PhaseId)), c.push({
  6145. andorsplit: "and"
  6146. }), c.push(o.buildFilter("PhaseComponentId", null, "is", u.Id)), o.sync(o.buildRequest("get", ["chartexceldata"], null, [c]), function(a) {
  6147. a.success && e.buildHistogram(a.data[0].ExcelFileData)
  6148. }), e.uploadHistogramFile = function(a, t) {
  6149. e.f = a, e.errFile = t && t[0], u = o.getPhaseComponentDetail("Measure", "Histogram"), a && (a.upload = s.upload({
  6150. url: "https://api.l6elite.com",
  6151. data: {
  6152. file: a,
  6153. T: ["chartexceldata"],
  6154. A: "upload",
  6155. V: [{
  6156. ProjectId: e.projectId,
  6157. PhaseId: u.PhaseId,
  6158. PhaseComponentId: u.Id
  6159. }]
  6160. }
  6161. }), a.upload.then(function(a) {
  6162. e.buildHistogram(a.data.ExcelFileData)
  6163. }, function(e) {
  6164. e.status > 0 && n.logError(e.status + ": " + e.data)
  6165. }, function(e) {
  6166. a.progress = Math.min(100, parseInt(100 * e.loaded / e.total))
  6167. }))
  6168. }, e.buildHistogram = function(a) {
  6169. var t = [],
  6170. o = {},
  6171. r = 0;
  6172. for (var i in a)
  6173. if (i > 1) {
  6174. var s = a[i];
  6175. for (var l in s)
  6176. if (null !== s[l] && "" !== s[l]) {
  6177. var c = s[l];
  6178. if (!parseFloat(c) && 0 !== c) return n.logError("Data Contains Illegal Values. Data Should Only Contain Numeric Values!"), !1;
  6179. o.hasOwnProperty(c) ? o[c] += 1 : o[c] = 1, r++
  6180. }
  6181. }
  6182. for (var u in o) t.push(u);
  6183. t.sort();
  6184. var d = t[t.length - 1] - t[0],
  6185. p = Math.round(Math.sqrt(r));
  6186. 10 > p && (p = 10);
  6187. for (var h = d / p, g = t[0] - h, m = [], f = [], v = 1; p >= v; v++) {
  6188. var D = Math.round(10 * g) / 10,
  6189. C = Math.round(10 * (g + h)) / 10,
  6190. y = 0;
  6191. m.push(D + " - " + C);
  6192. for (var b = 0; b < t.length; b++) t[b] >= D && t[b] <= C && (y += o[t[b]]);
  6193. f.push(y), g = 1 > h ? C + .1 : C + 1
  6194. }
  6195. e.histogramData = {
  6196. labels: m,
  6197. data: [f],
  6198. options: {
  6199. barValueSpacing: 5
  6200. },
  6201. range: Math.round(10 * d) / 10,
  6202. cWidth: Math.round(10 * h) / 10
  6203. }
  6204. }, e.controlPlanData = [], e.controlPlanDataOrig = [], e.getControlPlan = function() {
  6205. u = o.getPhaseComponentDetail("Measure", "Control Plan"), c = [], c.push(o.buildFilter("ProjectId", null, "is", e.projectId)), c.push({
  6206. ao: "and"
  6207. }), c.push(o.buildFilter("PhaseId", null, "is", u.PhaseId)), c.push({
  6208. andorsplit: "and"
  6209. }), c.push(o.buildFilter("PhaseComponentId", null, "is", u.Id)), o.sync(o.buildRequest("get", ["measurecontrolplan"], null, [c]), function(a) {
  6210. a.success ? (e.controlPlanData = a.data, e.controlPlanDataOrig = angular.copy(e.controlPlanData)) : e.showWalkthrough("control_plan", e.controlPlanData)
  6211. })
  6212. }, e.getControlPlan(), e.submitControlPlan = function() {
  6213. u = o.getPhaseComponentDetail("Measure", "Control Plan");
  6214. for (var a = [], t = [], r = [], n = 0; n < e.controlPlanData.length; n++)
  6215. if (!angular.equals(e.controlPlanData[n], e.controlPlanDataOrig[n])) {
  6216. var i = angular.copy(e.controlPlanData[n]);
  6217. i.Id && i.isDeleted ? (t.push(i.Id), e.controlPlanData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, delete i.arrayId, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = u.PhaseId, i.PhaseComponentId = u.Id, r.push(i))
  6218. }
  6219. o.syncTableRowData("measurecontrolplan", r, a, t, null, function() {
  6220. e.getControlPlan()
  6221. })
  6222. }, e.valueStreamDiagram = {}, u = o.getPhaseComponentDetail("Measure", "Value Stream Diagram"), c = [], c.push(o.buildFilter("ProjectId", null, "is", e.projectId)), c.push({
  6223. ao: "and"
  6224. }), c.push(o.buildFilter("PhaseId", null, "is", u.PhaseId)), c.push({
  6225. andorsplit: "and"
  6226. }), c.push(o.buildFilter("PhaseComponentId", null, "is", u.Id)), o.sync(o.buildRequest("get", ["valuestreamdiagram"], null, [c]), function(a) {
  6227. if (a.success) e.valueStreamDiagram = a.data[0], e.valueStreamDiagram.hasProcessMap = e.valueStreamDiagram.hasOwnProperty("Svg") && "" != e.valueStreamDiagram.Svg ? !0 : !1, e.measureValueStreamDiagram = i.trustAsHtml(e.valueStreamDiagram.Svg);
  6228. else {
  6229. var t = o.getPhaseComponentDetail("Define", "Value Stream Diagram");
  6230. c = [], c.push(o.buildFilter("ProjectId", null, "is", e.projectId)), c.push(o.buildFilter("PhaseId", null, "is", t.PhaseId)), c.push(o.buildFilter("PhaseComponentId", null, "is", t.Id)), o.sync(o.buildRequest("get", ["valuestreamdiagram"], null, [c]), function(a) {
  6231. a.success && (e.valueStreamDiagram = a.data[0], e.measureValueStreamDiagram = i.trustAsHtml(e.valueStreamDiagram.Svg), e.valueStreamDiagram.hasProcessMap = e.valueStreamDiagram.hasOwnProperty("Svg") && "" != e.valueStreamDiagram.Svg ? !0 : !1)
  6232. })
  6233. }
  6234. }), e.gateReviewData = [], e.gateReviewDataOrig = [], e.getGateReview = function() {
  6235. u = o.getPhaseComponentDetail("Measure", "Gate Review"), c = [], c.push(o.buildFilter("ProjectId", null, "is", e.projectId)), c.push({
  6236. ao: "and"
  6237. }), c.push(o.buildFilter("PhaseId", null, "is", u.PhaseId)), c.push({
  6238. andorsplit: "and"
  6239. }), c.push(o.buildFilter("PhaseComponentId", null, "is", u.Id)), o.sync(o.buildRequest("get", ["gatereview"], null, [c]), function(a) {
  6240. a.success && (e.gateReviewData = e.addArrayIndexId(a.data), e.gateReviewDataOrig = angular.copy(e.gateReviewData))
  6241. })
  6242. }, e.getGateReview(), e.gateReviewAddRow = function(a) {
  6243. e.gateReviewData.push({
  6244. arrayId: e.gateReviewData.length,
  6245. Quadrant: a,
  6246. Detail: " "
  6247. })
  6248. }, e.submitGateReview = function() {
  6249. u = o.getPhaseComponentDetail("Measure", "Gate Review");
  6250. for (var a = [], t = [], r = [], n = 0; n < e.gateReviewData.length; n++)
  6251. if (!angular.equals(e.gateReviewData[n], e.gateReviewDataOrig[n])) {
  6252. var i = angular.copy(e.gateReviewData[n]);
  6253. i.Id && i.isDeleted ? (t.push(i.Id), e.gateReviewData[n].Id = !1) : i.Id ? (delete i.DateTimeCreated, delete i.LastUpdated, delete i.arrayId, a.push(i)) : i.Id || i.isDeleted || (i.ProjectId = e.projectId, i.PhaseId = u.PhaseId, i.PhaseComponentId = u.Id, delete i.arrayId, r.push(i))
  6254. }
  6255. o.syncTableRowData("gatereview", r, a, t, null, function() {
  6256. e.getGateReview()
  6257. })
  6258. }
  6259. } else r.path("/project/" + t.pid)
  6260. }), e.exportData = function(a, t) {
  6261. var r = o.getPhaseComponentDetail("Measure", t),
  6262. n = [];
  6263. n.push(o.buildFilter("ProjectId", null, "is", e.projectId)), n.push({
  6264. ao: "and"
  6265. }), n.push(o.buildFilter("PhaseId", null, "is", r.PhaseId)), n.push({
  6266. andorsplit: "and"
  6267. }), n.push(o.buildFilter("PhaseComponentId", null, "is", r.Id)), o.exportData(a, n, function(e) {
  6268. window.open(e.data)
  6269. })
  6270. }, e.addRow = function(a, t) {
  6271. a.push(angular.copy(e.dSchema[t]))
  6272. }, e.deleteRow = function(e, a) {
  6273. e[a].isDeleted = !0
  6274. }, e.addArrayIndexId = function(e) {
  6275. for (var a = 0; a < e.length; a++) e[a].arrayId = a;
  6276. return e
  6277. }, e.activateTab = function(a) {
  6278. e.activeTab = activateTab(e.activeTab, a)
  6279. }, e.completePhaseComponent = function(a, t) {
  6280. completePhaseComponent(a, t, e.projectId, o, function(a) {
  6281. a.success && (n.logSuccess("Phase Updated!"), e.phaseDetail = o.getPhaseDetail("Measure"))
  6282. })
  6283. }, e.calculateTotals = function() {
  6284. for (var a = 0; a < e.ceMatrixRowData.length; a++) {
  6285. for (var t = 0, o = 0; o < e.ceMatrixRowData[a].colData.length; o++) t += ("" != e.ceMatrixRowData[a].colData[o].Correlation ? parseInt(e.ceMatrixRowData[a].colData[o].Correlation) : 0) * (e.ceMatrixOutputData[o].Importance ? parseInt(e.ceMatrixOutputData[o].Importance) : 0);
  6286. e.ceMatrixRowData[a].rowTotal = t
  6287. }
  6288. }, l(function() {
  6289. e.walkthrough = loadWalkthrough()
  6290. }, 500), e.validateField = function(a, t) {
  6291. a = a.currentTarget ? a.currentTarget : $("#" + a);
  6292. var o = validateField(a, t),
  6293. r = $(a).closest(".l6_step").parent().attr("data-phase-component");
  6294. e.walkthrough[r].currentStep = o.currentStep, o.isVerified && (e.walkthrough[r] = moveNextStep(e.walkthrough[r]))
  6295. }, e.showWalkthrough = function(a, t) {
  6296. e.addRow(t, a), e.walkthroughs[a] = !0
  6297. }, e.hideWalkthrough = function(a) {
  6298. e.walkthroughs[a] = !1, e.walkthrough[a] = resetWalkthrough(e.walkthrough[a])
  6299. }
  6300. }
  6301.  
  6302. function a(e) {
  6303. e.$watch("cd.Correlation", function(a, t) {
  6304. e.firstLoad || e.calculateTotals()
  6305. }), e.$watch("matrixOP.Importance", function(a, t) {
  6306. e.firstLoad || e.calculateTotals()
  6307. })
  6308. }
  6309. angular.module("app.project").controller("ProjectMeasureCtrl", ["$scope", "$rootScope", "$stateParams", "DataSyncService", "$location", "logger", "$sce", "Upload", "$timeout", e]).controller("ProjectAnalyzeCEItemCtrl", ["$scope", a])
  6310. }();
Add Comment
Please, Sign In to add comment