(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-269ecd61"],{"1e7b":function(e,t,r){},"704f":function(e,t,r){"use strict";r.r(t);var n=r("8336"),o=r("b0af"),a=r("99d9"),i=r("8fea"),c=r("169a"),l=r("132d"),u=r("2fa4"),s=r("3a2f"),f=function(){var e=this,t=e._self._c;return t("div",[t(o["a"],{staticClass:"mainCardHeight"},[t(a["d"],[t("h2",[e._v("Standard Operating Procedure Remediations")]),t(u["a"]),t(n["a"],{attrs:{outlined:"",color:"primary"},on:{click:function(t){return e.onNew()}}},[e._v("Add New")]),t(n["a"],{attrs:{outlined:"",color:"primary"},on:{click:e.refresh}},[e._v("Refresh")])],1),t(a["c"],{staticClass:"dense-table"},[t(i["a"],{attrs:{"hide-default-footer":"",loading:e.isLoading,headers:e.headers,items:e.sops,"fixed-header":""},scopedSlots:e._u([{key:"item",fn:function(r){var n=r.item;r.select;return[t("tr",{on:{dblclick:function(t){return e.onEdit(n)}}},[t("td",{staticStyle:{"white-space":"nowrap",width:"30px"}},[t(s["a"],{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var o=r.on;return[t(l["a"],e._g({on:{click:function(t){return e.onEdit(n)}}},o),[e._v("edit")])]}}],null,!0)},[t("span",[e._v("Edit this record")])]),t(s["a"],{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(r){var o=r.on;return[t(l["a"],e._g({on:{click:function(t){e.selectedRec=n,e.onDelete=!0}}},o),[e._v("delete")])]}}],null,!0)},[t("span",[e._v("Delete this record")])])],1),t("td",[e._v(e._s(n.label))]),t("td",{staticStyle:{"white-space":"nowrap",width:"100px"},domProps:{innerHTML:e._s(e.formatDateWithHTML(n.updatedate))}})])]}}])})],1)],1),e.onManage?t(c["a"],{attrs:{width:"850"},model:{value:e.onManage,callback:function(t){e.onManage=t},expression:"onManage"}},[t("manage-sops",{on:{close:function(t){e.onManage=!1},save:e.onSave},model:{value:e.selectedRec,callback:function(t){e.selectedRec=t},expression:"selectedRec"}})],1):e._e(),e.onDelete?t(c["a"],{attrs:{width:"300"},model:{value:e.onDelete,callback:function(t){e.onDelete=t},expression:"onDelete"}},[t(o["a"],[t(a["d"],[t("h2",[e._v("Delete "+e._s(e.selectedRec.label))])]),t(a["c"],[e._v("Are you sure?")]),t(a["a"],[t(u["a"]),t(n["a"],{attrs:{color:"error"},on:{click:e.onConfirmDelete}},[e._v("Confirm Delete")])],1)],1)],1):e._e()],1)},d=[],h=r("d0eb"),p=r("62ad"),v=r("4bd4"),y=r("0fd9"),b=r("8654"),m=function(){var e=this,t=e._self._c;return t(o["a"],[t(a["d"],[t("h2",[e._v(e._s(e.rec.id?"Edit ":"New ")+" SOP Remediation")]),t(u["a"]),t(n["a"],{attrs:{outlined:"",color:"primary"},on:{click:e.onCancel}},[e._v("Cancel")])],1),t(a["c"],{staticClass:"dense-table"},[t(v["a"],{model:{value:e.valid,callback:function(t){e.valid=t},expression:"valid"}},[t(y["a"],{attrs:{align:"center",justify:"center"}},[t(p["a"],{staticClass:"pr-1",attrs:{md:"12"}},[t(b["a"],{attrs:{label:"Standard Operating Procedure",counter:"45",rules:[e.rules.requiredNoblanks]},model:{value:e.rec.label,callback:function(t){e.$set(e.rec,"label",t)},expression:"rec.label"}})],1)],1),t(y["a"],{staticClass:"mt-3"},[t("RichTextEditor",{attrs:{placeholder:"Remediation Plan if SOP is not followed."},model:{value:e.rec.remediationPlan,callback:function(t){e.$set(e.rec,"remediationPlan",t)},expression:"rec.remediationPlan"}})],1)],1)],1),t(a["a"],{staticClass:"justify-center"},[t(n["a"],{attrs:{color:"primary",disabled:!e.valid},on:{click:e.onSave}},[e._v("Save")])],1)],1)},g=[],w=r("743e"),O=r("d67f");function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){S(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function S(e,t,r){return(t=_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _(e){var t=k(e,"string");return"symbol"==x(t)?t:t+""}function k(e,t){if("object"!=x(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var E={name:"manage-sops",props:["value"],components:{RichTextEditor:w["a"]},data:function(){return{rec:null,valid:!1,rules:{requiredNoblanks:function(e){return!!e&&null!=e.match(/^(?!\s*$).+/g)||"Required."}}}},beforeMount:function(){this.refresh()},methods:{refresh:function(){this.rec=P({},this.value)},onCancel:function(){this.$emit("close")},onSave:function(){this.valid?(this.$emit("input",this.rec),this.$emit("save",this.rec)):O["a"].error("Form Entries Incomplete or Invalid")}}},L=E,C=r("2877"),D=Object(C["a"])(L,m,g,!1,null,null,null),R=D.exports,A=r("a9b3"),M=r("2f62");function N(e){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},N(e)}function T(e,t){return F(e)||U(e,t)||I(e,t)||G()}function G(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function I(e,t){if(e){if("string"==typeof e)return $(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$(e,t):void 0}}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function U(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],l=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}function F(e){if(Array.isArray(e))return e}function q(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */q=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var a=t&&t.prototype instanceof b?t:b,i=Object.create(a.prototype),c=new C(n||[]);return o(i,"_invoke",{value:_(e,r,c)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var d="suspendedStart",h="suspendedYield",p="executing",v="completed",y={};function b(){}function m(){}function g(){}var w={};u(w,i,(function(){return this}));var O=Object.getPrototypeOf,x=O&&O(O(D([])));x&&x!==r&&n.call(x,i)&&(w=x);var j=g.prototype=b.prototype=Object.create(w);function P(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(o,a,i,c){var l=f(e[o],e,a);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==N(s)&&n.call(s,"__await")?t.resolve(s.__await).then((function(e){r("next",e,i,c)}),(function(e){r("throw",e,i,c)})):t.resolve(s).then((function(e){u.value=e,i(u)}),(function(e){return r("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function _(t,r,n){var o=d;return function(a,i){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var l=k(c,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?v:h,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function D(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(N(t)+" is not iterable")}return m.prototype=g,o(j,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=u(g,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,u(e,l,"GeneratorFunction")),e.prototype=Object.create(j),e},t.awrap=function(e){return{__await:e}},P(S.prototype),u(S.prototype,c,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new S(s(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},P(j),u(j,l,"Generator"),u(j,i,(function(){return this})),u(j,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=D,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:D(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function H(e,t,r,n,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void r(e)}c.done?t(l):Promise.resolve(l).then(n,o)}function J(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){H(a,n,o,i,c,"next",e)}function c(e){H(a,n,o,i,c,"throw",e)}i(void 0)}))}}function Y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(r),!0).forEach((function(t){V(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function V(e,t,r){return(t=W(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function W(e){var t=z(e,"string");return"symbol"==N(t)?t:t+""}function z(e,t){if("object"!=N(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=N(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var K={name:"sops",computed:B({},Object(M["c"])(["getUser"])),mixins:[A["a"]],components:{ManageSops:R},data:function(){return{sops:[],isLoading:!1,onManage:!1,onDelete:!1,selectedRec:null,headers:[{text:"Actions",sortable:!1},{text:"Label",align:"left",sortable:!0,value:"label"},{text:"Updated",align:"left",sortable:!0,value:"updatedate"}]}},beforeMount:function(){this.refresh()},methods:{refresh:function(){var e=this;return J(q().mark((function t(){var r;return q().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.isLoading=!0,t.prev=1,t.next=4,h["a"].get("StandardOperatingProcedures",e.getUser.apitoken,{});case 4:r=t.sent,r&&1===r.length?(e.sops=r[0],e.isLoading=!1):O["a"].error("An error occurred. Please try again."),t.next=11;break;case 8:t.prev=8,t.t0=t["catch"](1),O["a"].error("An error occurred. Please try again.");case 11:case"end":return t.stop()}}),t,null,[[1,8]])})))()},onNew:function(){this.selectedRec={label:"",remediationPlan:""},this.onManage=!0},onEdit:function(e){this.selectedRec=e,this.onManage=!0},onConfirmDelete:function(){var e=this;return J(q().mark((function t(){var r,n,o;return q().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,h["a"].destroy("StandardOperatingProcedures",e.selectedRec.id,e.getUser.apitoken);case 3:r=t.sent,n=T(r,2),o=n[0],n[1],o?(O["a"].success("Record deleted."),e.onDelete=!1,e.selectedRec=null,e.refresh()):O["a"].error("An error occurred. Please try again."),t.next=13;break;case 10:t.prev=10,t.t0=t["catch"](0),O["a"].error("An error occurred. Please try again.");case 13:case"end":return t.stop()}}),t,null,[[0,10]])})))()},onSave:function(){var e=this;return J(q().mark((function t(){var r,n,o,a;return q().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,r=B({},e.selectedRec),t.next=4,h["a"].patch("StandardOperatingProcedures",e.getUser.apitoken,r);case 4:n=t.sent,o=T(n,2),a=o[0],o[1],a?(O["a"].success("Record Updated."),e.onManage=!1,e.selectedRec=null,e.refresh()):O["a"].error("An error occurred. Please try again."),t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](0),O["a"].error("An error occurred. Please try again.");case 14:case"end":return t.stop()}}),t,null,[[0,11]])})))()}}},Q=K,X=Object(C["a"])(Q,f,d,!1,null,null,null);t["default"]=X.exports},"743e":function(e,t,r){"use strict";var n=function(){var e=this,t=e._self._c;return t("tiptap-vuetify",{attrs:{extensions:e.extensions,placeholder:e.placeholder,"max-height":e.height},on:{input:function(t){return e.$emit("input",e.editableContent)}},model:{value:e.editableContent,callback:function(t){e.editableContent=t},expression:"editableContent"}})},o=[],a=r("3f38"),i={props:{value:{required:!0},placeholder:{type:String,default:"Text goes here"},height:{type:String,default:"350px"},showControls:{type:Boolean,default:!0}},components:{TiptapVuetify:a["o"]},beforeMount:function(){this.editableContent=this.value,this.showControls&&(this.extensions=this.totalExtensions)},watch:{value:function(e,t){this.editableContent=e}},data:function(){return{editableContent:null,extensions:[],totalExtensions:[[a["g"],{options:{levels:[1,2,3]}}],a["b"],a["j"],a["n"],a["q"],a["d"],a["e"],a["m"],a["c"],a["l"],a["k"],a["a"],a["f"],a["i"],a["h"]]}}},c=i,l=(r("d1ad"),r("2877")),u=Object(l["a"])(c,n,o,!1,null,null,null);t["a"]=u.exports},d1ad:function(e,t,r){"use strict";r("1e7b")}}]);
//# sourceMappingURL=chunk-269ecd61.9921048a.js.map