!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){var n=[],r=n.slice,i=n.concat,o=n.push,a=n.indexOf,s={},l=s.toString,u=s.hasOwnProperty,c={},f=function(e,t){return new f.fn.init(e,t)},d=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,h=/-([\da-z])/gi,m=function(e,t){return t.toUpperCase()};function g(e){var t="length"in e&&e.length,n=f.type(e);return"function"!==n&&!f.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e))}f.fn=f.prototype={jquery:"1.11.3",constructor:f,selector:"",length:0,toArray:function(){return r.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:r.call(this)},pushStack:function(e){var t=f.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return f.each(this,e,t)},map:function(e){return this.pushStack(f.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:o,sort:n.sort,splice:n.splice},f.extend=f.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{},s++),"object"==typeof a||f.isFunction(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(i=arguments[s]))for(r in i)e=a[r],a!==(n=i[r])&&(u&&n&&(f.isPlainObject(n)||(t=f.isArray(n)))?(t?(t=!1,o=e&&f.isArray(e)?e:[]):o=e&&f.isPlainObject(e)?e:{},a[r]=f.extend(u,o,n)):void 0!==n&&(a[r]=n));return a},f.extend({expando:"jQuery"+("1.11.3"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===f.type(e)},isArray:Array.isArray||function(e){return"array"===f.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!f.isArray(e)&&e-parseFloat(e)+1>=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==f.type(e)||e.nodeType||f.isWindow(e))return!1;try{if(e.constructor&&!u.call(e,"constructor")&&!u.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}if(c.ownLast)for(t in e)return u.call(e,t);for(t in e);return void 0===t||u.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?s[l.call(e)]||"object":typeof e},globalEval:function(t){t&&f.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(p,"ms-").replace(h,m)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r=0,i=e.length,o=g(e);if(n){if(o)for(;r<i&&!1!==t.apply(e[r],n);r++);else for(r in e)if(!1===t.apply(e[r],n))break}else if(o)for(;r<i&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(d,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(g(Object(e))?f.merge(n,"string"==typeof e?[e]:e):o.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(a)return a.call(t,e,n);for(r=t.length,n=n?n<0?Math.max(0,r+n):n:0;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;)e[i++]=t[r++];if(n!=n)for(;void 0!==t[r];)e[i++]=t[r++];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,o=0,a=e.length,s=[];if(g(e))for(;o<a;o++)null!=(r=t(e[o],o,n))&&s.push(r);else for(o in e)null!=(r=t(e[o],o,n))&&s.push(r);return i.apply([],s)},guid:1,proxy:function(e,t){var n,i,o;if("string"==typeof t&&(o=e[t],t=e,e=o),f.isFunction(e))return n=r.call(arguments,2),(i=function(){return e.apply(t||this,n.concat(r.call(arguments)))}).guid=e.guid=e.guid||f.guid++,i},now:function(){return+new Date},support:c}),f.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){s["[object "+t+"]"]=t.toLowerCase()});var y=function(e){var t,n,r,i,o,a,s,l,u,c,f,d,p,h,m,g,y,v,b,x="sizzle"+1*new Date,w=e.document,T=0,C=0,N=ae(),E=ae(),k=ae(),S=function(e,t){return e===t&&(f=!0),0},A=1<<31,D={}.hasOwnProperty,j=[],L=j.pop,H=j.push,q=j.push,_=j.slice,M=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},F="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",O="[\\x20\\t\\r\\n\\f]",B="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",P=B.replace("w","w#"),R="\\["+O+"*("+B+")(?:"+O+"*([*^$|!~]?=)"+O+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+P+"))|)"+O+"*\\]",W=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+R+")*)|.*)\\)|)",$=new RegExp(O+"+","g"),z=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),I=new RegExp("^"+O+"*,"+O+"*"),X=new RegExp("^"+O+"*([>+~]|"+O+")"+O+"*"),U=new RegExp("="+O+"*([^\\]'\"]*?)"+O+"*\\]","g"),V=new RegExp(W),J=new RegExp("^"+P+"$"),Y={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B.replace("w","w*")+")"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^"+O+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=/'|\\/g,ne=new RegExp("\\\\([\\da-f]{1,6}"+O+"?|("+O+")|.)","ig"),re=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},ie=function(){d()};try{q.apply(j=_.call(w.childNodes),w.childNodes),j[w.childNodes.length].nodeType}catch(e){q={apply:j.length?function(e,t){H.apply(e,_.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function oe(e,t,r,i){var o,s,u,c,f,h,y,v,T,C;if((t?t.ownerDocument||t:w)!==p&&d(t),t=t||p,r=r||[],c=t.nodeType,"string"!=typeof e||!e||1!==c&&9!==c&&11!==c)return r;if(!i&&m){if(11!==c&&(o=Z.exec(e)))if(u=o[1]){if(9===c){if(!(s=t.getElementById(u))||!s.parentNode)return r;if(s.id===u)return r.push(s),r}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(u))&&b(t,s)&&s.id===u)return r.push(s),r}else{if(o[2])return q.apply(r,t.getElementsByTagName(e)),r;if((u=o[3])&&n.getElementsByClassName)return q.apply(r,t.getElementsByClassName(u)),r}if(n.qsa&&(!g||!g.test(e))){if(v=y=x,T=t,C=1!==c&&e,1===c&&"object"!==t.nodeName.toLowerCase()){for(h=a(e),(y=t.getAttribute("id"))?v=y.replace(te,"\\$&"):t.setAttribute("id",v),v="[id='"+v+"'] ",f=h.length;f--;)h[f]=v+ge(h[f]);T=ee.test(e)&&he(t.parentNode)||t,C=h.join(",")}if(C)try{return q.apply(r,T.querySelectorAll(C)),r}catch(e){}finally{y||t.removeAttribute("id")}}}return l(e.replace(z,"$1"),t,r,i)}function ae(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function se(e){return e[x]=!0,e}function le(e){var t=p.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ue(e,t){for(var n=e.split("|"),i=e.length;i--;)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||A)-(~e.sourceIndex||A);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function de(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pe(e){return se(function(t){return t=+t,se(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function he(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},d=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==p&&9===a.nodeType&&a.documentElement?(p=a,h=a.documentElement,(i=a.defaultView)&&i!==i.top&&(i.addEventListener?i.addEventListener("unload",ie,!1):i.attachEvent&&i.attachEvent("onunload",ie)),m=!o(a),n.attributes=le(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=le(function(e){return e.appendChild(a.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=K.test(a.getElementsByClassName),n.getById=le(function(e){return h.appendChild(e).id=x,!a.getElementsByName||!a.getElementsByName(x).length}),n.getById?(r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},r.filter.ID=function(e){var t=e.replace(ne,re);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(ne,re);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(m)return t.getElementsByClassName(e)},y=[],g=[],(n.qsa=K.test(a.querySelectorAll))&&(le(function(e){h.appendChild(e).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\f]' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+O+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+O+"*(?:value|"+F+")"),e.querySelectorAll("[id~="+x+"-]").length||g.push("~="),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]")}),le(function(e){var t=a.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+O+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=K.test(v=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&le(function(e){n.disconnectedMatch=v.call(e,"div"),v.call(e,"[s!='']:x"),y.push("!=",W)}),g=g.length&&new RegExp(g.join("|")),y=y.length&&new RegExp(y.join("|")),t=K.test(h.compareDocumentPosition),b=t||K.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},S=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===a||e.ownerDocument===w&&b(w,e)?-1:t===a||t.ownerDocument===w&&b(w,t)?1:c?M(c,e)-M(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],l=[t];if(!i||!o)return e===a?-1:t===a?1:i?-1:o?1:c?M(c,e)-M(c,t):0;if(i===o)return ce(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;s[r]===l[r];)r++;return r?ce(s[r],l[r]):s[r]===w?-1:l[r]===w?1:0},a):p},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&d(e),t=t.replace(U,"='$1']"),n.matchesSelector&&m&&(!y||!y.test(t))&&(!g||!g.test(t)))try{var r=v.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,p,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==p&&d(e),b(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==p&&d(e);var i=r.attrHandle[t.toLowerCase()],o=i&&D.call(r.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(S),f){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ne,re),e[3]=(e[3]||e[4]||e[5]||"").replace(ne,re),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ne,re).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,f,d,p,h,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(g){if(o){for(;m;){for(f=t;f=f[m];)if(s?f.nodeName.toLowerCase()===y:1===f.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&v){for(p=(u=(c=g[x]||(g[x]={}))[e]||[])[0]===T&&u[1],d=u[0]===T&&u[2],f=p&&g.childNodes[p];f=++p&&f&&f[m]||(d=p=0)||h.pop();)if(1===f.nodeType&&++d&&f===t){c[e]=[T,p,d];break}}else if(v&&(u=(t[x]||(t[x]={}))[e])&&u[0]===T)d=u[1];else for(;(f=++p&&f&&f[m]||(d=p=0)||h.pop())&&((s?f.nodeName.toLowerCase()!==y:1!==f.nodeType)||!++d||(v&&((f[x]||(f[x]={}))[e]=[T,d]),f!==t)););return(d-=i)===r||d%r==0&&d/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=M(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(z,"$1"));return r[x]?se(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(ne,re),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return J.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(ne,re).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:pe(function(){return[0]}),last:pe(function(e,t){return[t-1]}),eq:pe(function(e,t,n){return[n<0?n+t:n]}),even:pe(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:pe(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:pe(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:pe(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=de(t);function me(){}function ge(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function ye(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=C++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,u=[T,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if((s=(l=t[x]||(t[x]={}))[r])&&s[0]===T&&s[1]===o)return u[2]=s[2];if(l[r]=u,u[2]=e(t,n,a))return!0}}}function ve(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,u=null!=t;s<l;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),u&&t.push(s)));return a}function xe(e,t,n,r,i,o){return r&&!r[x]&&(r=xe(r)),i&&!i[x]&&(i=xe(i,o)),se(function(o,a,s,l){var u,c,f,d=[],p=[],h=a.length,m=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)oe(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),g=!e||!o&&t?m:be(m,d,e,s,l),y=n?i||(o?e:h||r)?[]:a:g;if(n&&n(g,y,s,l),r)for(u=be(y,p),r(u,[],s,l),c=u.length;c--;)(f=u[c])&&(y[p[c]]=!(g[p[c]]=f));if(o){if(i||e){if(i){for(u=[],c=y.length;c--;)(f=y[c])&&u.push(g[c]=f);i(null,y=[],u,l)}for(c=y.length;c--;)(f=y[c])&&(u=i?M(o,f):d[c])>-1&&(o[u]=!(a[u]=f))}}else y=be(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):q.apply(a,y)})}function we(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],l=a?1:0,c=ye(function(e){return e===t},s,!0),f=ye(function(e){return M(t,e)>-1},s,!0),d=[function(e,n,r){var i=!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];l<o;l++)if(n=r.relative[e[l].type])d=[ye(ve(d),n)];else{if((n=r.filter[e[l].type].apply(null,e[l].matches))[x]){for(i=++l;i<o&&!r.relative[e[i].type];i++);return xe(l>1&&ve(d),l>1&&ge(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,l<i&&we(e.slice(l,i)),i<o&&we(e=e.slice(i)),i<o&&ge(e))}d.push(n)}return ve(d)}return me.prototype=r.filters=r.pseudos,r.setFilters=new me,a=oe.tokenize=function(e,t){var n,i,o,a,s,l,u,c=E[e+" "];if(c)return t?0:c.slice(0);for(s=e,l=[],u=r.preFilter;s;){for(a in n&&!(i=I.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),n=!1,(i=X.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(z," ")}),s=s.slice(n.length)),r.filter)!(i=Y[a].exec(s))||u[a]&&!(i=u[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?oe.error(e):E(e,l).slice(0)},s=oe.compile=function(e,t){var n,i=[],o=[],s=k[e+" "];if(!s){for(t||(t=a(e)),n=t.length;n--;)(s=we(t[n]))[x]?i.push(s):o.push(s);(s=k(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,l,c){var f,d,h,m=0,g="0",y=o&&[],v=[],b=u,x=o||i&&r.find.TAG("*",c),w=T+=null==b?1:Math.random()||.1,C=x.length;for(c&&(u=a!==p&&a);g!==C&&null!=(f=x[g]);g++){if(i&&f){for(d=0;h=e[d++];)if(h(f,a,s)){l.push(f);break}c&&(T=w)}n&&((f=!h&&f)&&m--,o&&y.push(f))}if(m+=g,n&&g!==m){for(d=0;h=t[d++];)h(y,v,a,s);if(o){if(m>0)for(;g--;)y[g]||v[g]||(v[g]=L.call(l));v=be(v)}q.apply(l,v),c&&!o&&v.length>0&&m+t.length>1&&oe.uniqueSort(l)}return c&&(T=w,u=b),y};return n?se(o):o}(o,i))).selector=e}return s},l=oe.select=function(e,t,i,o){var l,u,c,f,d,p="function"==typeof e&&e,h=!o&&a(e=p.selector||e);if(i=i||[],1===h.length){if((u=h[0]=h[0].slice(0)).length>2&&"ID"===(c=u[0]).type&&n.getById&&9===t.nodeType&&m&&r.relative[u[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(ne,re),t)||[])[0]))return i;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(l=Y.needsContext.test(e)?0:u.length;l--&&(c=u[l],!r.relative[f=c.type]);)if((d=r.find[f])&&(o=d(c.matches[0].replace(ne,re),ee.test(u[0].type)&&he(t.parentNode)||t))){if(u.splice(l,1),!(e=o.length&&ge(u)))return q.apply(i,o),i;break}}return(p||s(e,h))(o,t,!m,i,ee.test(e)&&he(t.parentNode)||t),i},n.sortStable=x.split("").sort(S).join("")===x,n.detectDuplicates=!!f,d(),n.sortDetached=le(function(e){return 1&e.compareDocumentPosition(p.createElement("div"))}),le(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ue("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&le(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ue("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),le(function(e){return null==e.getAttribute("disabled")})||ue(F,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);f.find=y,f.expr=y.selectors,f.expr[":"]=f.expr.pseudos,f.unique=y.uniqueSort,f.text=y.getText,f.isXMLDoc=y.isXML,f.contains=y.contains;var v=f.expr.match.needsContext,b=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,x=/^.[^:#\[\.,]*$/;function w(e,t,n){if(f.isFunction(t))return f.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return f.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(x.test(t))return f.filter(t,e,n);t=f.filter(t,e)}return f.grep(e,function(e){return f.inArray(e,t)>=0!==n})}f.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?f.find.matchesSelector(r,e)?[r]:[]:f.find.matches(e,f.grep(t,function(e){return 1===e.nodeType}))},f.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(f(e).filter(function(){for(t=0;t<i;t++)if(f.contains(r[t],this))return!0}));for(t=0;t<i;t++)f.find(e,r[t],n);return(n=this.pushStack(i>1?f.unique(n):n)).selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(w(this,e||[],!1))},not:function(e){return this.pushStack(w(this,e||[],!0))},is:function(e){return!!w(this,"string"==typeof e&&v.test(e)?f(e):e||[],!1).length}});var T,C=e.document,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(f.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(!(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e))||!n[1]&&t)return!t||t.jquery?(t||T).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof f?t[0]:t,f.merge(this,f.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),b.test(n[1])&&f.isPlainObject(t))for(n in t)f.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}if((r=C.getElementById(n[2]))&&r.parentNode){if(r.id!==n[2])return T.find(e);this.length=1,this[0]=r}return this.context=C,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):f.isFunction(e)?void 0!==T.ready?T.ready(e):e(f):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),f.makeArray(e,this))}).prototype=f.fn,T=f(C);var E=/^(?:parents|prev(?:Until|All))/,k={children:!0,contents:!0,next:!0,prev:!0};function S(e,t){do{e=e[t]}while(e&&1!==e.nodeType);return e}f.extend({dir:function(e,t,n){for(var r=[],i=e[t];i&&9!==i.nodeType&&(void 0===n||1!==i.nodeType||!f(i).is(n));)1===i.nodeType&&r.push(i),i=i[t];return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),f.fn.extend({has:function(e){var t,n=f(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(f.contains(this,n[t]))return!0})},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=v.test(e)||"string"!=typeof e?f(e,t||this.context):0;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&f.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?f.unique(o):o)},index:function(e){return e?"string"==typeof e?f.inArray(this[0],f(e)):f.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(f.unique(f.merge(this.get(),f(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),f.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return f.dir(e,"parentNode")},parentsUntil:function(e,t,n){return f.dir(e,"parentNode",n)},next:function(e){return S(e,"nextSibling")},prev:function(e){return S(e,"previousSibling")},nextAll:function(e){return f.dir(e,"nextSibling")},prevAll:function(e){return f.dir(e,"previousSibling")},nextUntil:function(e,t,n){return f.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return f.dir(e,"previousSibling",n)},siblings:function(e){return f.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return f.sibling(e.firstChild)},contents:function(e){return f.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:f.merge([],e.childNodes)}},function(e,t){f.fn[e]=function(n,r){var i=f.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=f.filter(r,i)),this.length>1&&(k[e]||(i=f.unique(i)),E.test(e)&&(i=i.reverse())),this.pushStack(i)}});var A,D=/\S+/g,j={};function L(){C.addEventListener?(C.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(C.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))}function H(){(C.addEventListener||"load"===event.type||"complete"===C.readyState)&&(L(),f.ready())}f.Callbacks=function(e){var t,n,r,i,o,a,s=[],l=!(e="string"==typeof e?j[e]||function(e){var t=j[e]={};return f.each(e.match(D)||[],function(e,n){t[n]=!0}),t}(e):f.extend({},e)).once&&[],u=function(f){for(n=e.memory&&f,r=!0,o=a||0,a=0,i=s.length,t=!0;s&&o<i;o++)if(!1===s[o].apply(f[0],f[1])&&e.stopOnFalse){n=!1;break}t=!1,s&&(l?l.length&&u(l.shift()):n?s=[]:c.disable())},c={add:function(){if(s){var r=s.length;!function t(n){f.each(n,function(n,r){var i=f.type(r);"function"===i?e.unique&&c.has(r)||s.push(r):r&&r.length&&"string"!==i&&t(r)})}(arguments),t?i=s.length:n&&(a=r,u(n))}return this},remove:function(){return s&&f.each(arguments,function(e,n){for(var r;(r=f.inArray(n,s,r))>-1;)s.splice(r,1),t&&(r<=i&&i--,r<=o&&o--)}),this},has:function(e){return e?f.inArray(e,s)>-1:!(!s||!s.length)},empty:function(){return s=[],i=0,this},disable:function(){return s=l=n=void 0,this},disabled:function(){return!s},lock:function(){return l=void 0,n||c.disable(),this},locked:function(){return!l},fireWith:function(e,n){return!s||r&&!l||(n=[e,(n=n||[]).slice?n.slice():n],t?l.push(n):u(n)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},f.extend({Deferred:function(e){var t=[["resolve","done",f.Callbacks("once memory"),"resolved"],["reject","fail",f.Callbacks("once memory"),"rejected"],["notify","progress",f.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return f.Deferred(function(n){f.each(t,function(t,o){var a=f.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&f.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?f.extend(e,r):r}},i={};return r.pipe=r.then,f.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,i,o=0,a=r.call(arguments),s=a.length,l=1!==s||e&&f.isFunction(e.promise)?s:0,u=1===l?e:f.Deferred(),c=function(e,n,i){return function(o){n[e]=this,i[e]=arguments.length>1?r.call(arguments):o,i===t?u.notifyWith(n,i):--l||u.resolveWith(n,i)}};if(s>1)for(t=new Array(s),n=new Array(s),i=new Array(s);o<s;o++)a[o]&&f.isFunction(a[o].promise)?a[o].promise().done(c(o,i,a)).fail(u.reject).progress(c(o,n,t)):--l;return l||u.resolveWith(i,a),u.promise()}}),f.fn.ready=function(e){return f.ready.promise().done(e),this},f.extend({isReady:!1,readyWait:1,holdReady:function(e){e?f.readyWait++:f.ready(!0)},ready:function(e){if(!0===e?!--f.readyWait:!f.isReady){if(!C.body)return setTimeout(f.ready);f.isReady=!0,!0!==e&&--f.readyWait>0||(A.resolveWith(C,[f]),f.fn.triggerHandler&&(f(C).triggerHandler("ready"),f(C).off("ready")))}}}),f.ready.promise=function(t){if(!A)if(A=f.Deferred(),"complete"===C.readyState)setTimeout(f.ready);else if(C.addEventListener)C.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{C.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var n=!1;try{n=null==e.frameElement&&C.documentElement}catch(e){}n&&n.doScroll&&function e(){if(!f.isReady){try{n.doScroll("left")}catch(t){return setTimeout(e,50)}L(),f.ready()}}()}return A.promise(t)};var q,_="undefined";for(q in f(c))break;c.ownLast="0"!==q,c.inlineBlockNeedsLayout=!1,f(function(){var e,t,n,r;(n=C.getElementsByTagName("body")[0])&&n.style&&(t=C.createElement("div"),(r=C.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==_&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",c.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=C.createElement("div");if(null==c.deleteExpando){c.deleteExpando=!0;try{delete e.test}catch(e){c.deleteExpando=!1}}e=null}(),f.acceptData=function(e){var t=f.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||!0!==t&&e.getAttribute("classid")===t)};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,F=/([A-Z])/g;function O(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(F,"-$1").toLowerCase();if("string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:M.test(n)?f.parseJSON(n):n)}catch(e){}f.data(e,t,n)}else n=void 0}return n}function B(e){var t;for(t in e)if(("data"!==t||!f.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function P(e,t,r,i){if(f.acceptData(e)){var o,a,s=f.expando,l=e.nodeType,u=l?f.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||void 0!==r||"string"!=typeof t)return c||(c=l?e[s]=n.pop()||f.guid++:s),u[c]||(u[c]=l?{}:{toJSON:f.noop}),"object"!=typeof t&&"function"!=typeof t||(i?u[c]=f.extend(u[c],t):u[c].data=f.extend(u[c].data,t)),a=u[c],i||(a.data||(a.data={}),a=a.data),void 0!==r&&(a[f.camelCase(t)]=r),"string"==typeof t?null==(o=a[t])&&(o=a[f.camelCase(t)]):o=a,o}}function R(e,t,n){if(f.acceptData(e)){var r,i,o=e.nodeType,a=o?f.cache:e,s=o?e[f.expando]:f.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){i=(t=f.isArray(t)?t.concat(f.map(t,f.camelCase)):t in r?[t]:(t=f.camelCase(t))in r?[t]:t.split(" ")).length;for(;i--;)delete r[t[i]];if(n?!B(r):!f.isEmptyObject(r))return}(n||(delete a[s].data,B(a[s])))&&(o?f.cleanData([e],!0):c.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}f.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return!!(e=e.nodeType?f.cache[e[f.expando]]:e[f.expando])&&!B(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)}}),f.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=f.data(o),1===o.nodeType&&!f._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&O(o,r=f.camelCase(r.slice(5)),i[r]);f._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){f.data(this,e)}):arguments.length>1?this.each(function(){f.data(this,e,t)}):o?O(o,e,f.data(o,e)):void 0},removeData:function(e){return this.each(function(){f.removeData(this,e)})}}),f.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=f._data(e,t),n&&(!r||f.isArray(n)?r=f._data(e,t,f.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=f.queue(e,t),r=n.length,i=n.shift(),o=f._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){f.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return f._data(e,n)||f._data(e,n,{empty:f.Callbacks("once memory").add(function(){f._removeData(e,t+"queue"),f._removeData(e,n)})})}}),f.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?f.queue(this[0],e):void 0===t?this:this.each(function(){var n=f.queue(this,e,t);f._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&f.dequeue(this,e)})},dequeue:function(e){return this.each(function(){f.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=f.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=f._data(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var W=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,$=["Top","Right","Bottom","Left"],z=function(e,t){return e=t||e,"none"===f.css(e,"display")||!f.contains(e.ownerDocument,e)},I=f.access=function(e,t,n,r,i,o,a){var s=0,l=e.length,u=null==n;if("object"===f.type(n))for(s in i=!0,n)f.access(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,f.isFunction(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(f(e),n)})),t))for(;s<l;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:u?t.call(e):l?t(e[0],n):o},X=/^(?:checkbox|radio)$/i;!function(){var e=C.createElement("input"),t=C.createElement("div"),n=C.createDocumentFragment();if(t.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c.leadingWhitespace=3===t.firstChild.nodeType,c.tbody=!t.getElementsByTagName("tbody").length,c.htmlSerialize=!!t.getElementsByTagName("link").length,c.html5Clone="<:nav></:nav>"!==C.createElement("nav").cloneNode(!0).outerHTML,e.type="checkbox",e.checked=!0,n.appendChild(e),c.appendChecked=e.checked,t.innerHTML="<textarea>x</textarea>",c.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,n.appendChild(t),t.innerHTML="<input type='radio' checked='checked' name='t'/>",c.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,c.noCloneEvent=!0,t.attachEvent&&(t.attachEvent("onclick",function(){c.noCloneEvent=!1}),t.cloneNode(!0).click()),null==c.deleteExpando){c.deleteExpando=!0;try{delete t.test}catch(e){c.deleteExpando=!1}}}(),function(){var t,n,r=C.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})n="on"+t,(c[t+"Bubbles"]=n in e)||(r.setAttribute(n,"t"),c[t+"Bubbles"]=!1===r.attributes[n].expando);r=null}();var U=/^(?:input|select|textarea)$/i,V=/^key/,J=/^(?:mouse|pointer|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,G=/^([^.]*)(?:\.(.+)|)$/;function Q(){return!0}function K(){return!1}function Z(){try{return C.activeElement}catch(e){}}function ee(e){var t=te.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}f.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,d,p,h,m,g,y=f._data(e);if(y){for(n.handler&&(n=(l=n).handler,i=l.selector),n.guid||(n.guid=f.guid++),(a=y.events)||(a=y.events={}),(c=y.handle)||((c=y.handle=function(e){return typeof f===_||e&&f.event.triggered===e.type?void 0:f.event.dispatch.apply(c.elem,arguments)}).elem=e),s=(t=(t||"").match(D)||[""]).length;s--;)h=g=(o=G.exec(t[s])||[])[1],m=(o[2]||"").split(".").sort(),h&&(u=f.event.special[h]||{},h=(i?u.delegateType:u.bindType)||h,u=f.event.special[h]||{},d=f.extend({type:h,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&f.expr.match.needsContext.test(i),namespace:m.join(".")},l),(p=a[h])||((p=a[h]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(e,r,m,c)||(e.addEventListener?e.addEventListener(h,c,!1):e.attachEvent&&e.attachEvent("on"+h,c))),u.add&&(u.add.call(e,d),d.handler.guid||(d.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,d):p.push(d),f.event.global[h]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,d,p,h,m,g,y=f.hasData(e)&&f._data(e);if(y&&(c=y.events)){for(u=(t=(t||"").match(D)||[""]).length;u--;)if(h=g=(s=G.exec(t[u])||[])[1],m=(s[2]||"").split(".").sort(),h){for(d=f.event.special[h]||{},p=c[h=(r?d.delegateType:d.bindType)||h]||[],s=s[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=p.length;o--;)a=p[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(p.splice(o,1),a.selector&&p.delegateCount--,d.remove&&d.remove.call(e,a));l&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,m,y.handle)||f.removeEvent(e,h,y.handle),delete c[h])}else for(h in c)f.event.remove(e,h+t[u],n,r,!0);f.isEmptyObject(c)&&(delete y.handle,f._removeData(e,"events"))}},trigger:function(t,n,r,i){var o,a,s,l,c,d,p,h=[r||C],m=u.call(t,"type")?t.type:t,g=u.call(t,"namespace")?t.namespace.split("."):[];if(s=d=r=r||C,3!==r.nodeType&&8!==r.nodeType&&!Y.test(m+f.event.triggered)&&(m.indexOf(".")>=0&&(m=(g=m.split(".")).shift(),g.sort()),a=m.indexOf(":")<0&&"on"+m,(t=t[f.expando]?t:new f.Event(m,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=g.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:f.makeArray(n,[t]),c=f.event.special[m]||{},i||!c.trigger||!1!==c.trigger.apply(r,n))){if(!i&&!c.noBubble&&!f.isWindow(r)){for(l=c.delegateType||m,Y.test(l+m)||(s=s.parentNode);s;s=s.parentNode)h.push(s),d=s;d===(r.ownerDocument||C)&&h.push(d.defaultView||d.parentWindow||e)}for(p=0;(s=h[p++])&&!t.isPropagationStopped();)t.type=p>1?l:c.bindType||m,(o=(f._data(s,"events")||{})[t.type]&&f._data(s,"handle"))&&o.apply(s,n),(o=a&&s[a])&&o.apply&&f.acceptData(s)&&(t.result=o.apply(s,n),!1===t.result&&t.preventDefault());if(t.type=m,!i&&!t.isDefaultPrevented()&&(!c._default||!1===c._default.apply(h.pop(),n))&&f.acceptData(r)&&a&&r[m]&&!f.isWindow(r)){(d=r[a])&&(r[a]=null),f.event.triggered=m;try{r[m]()}catch(e){}f.event.triggered=void 0,d&&(r[a]=d)}return t.result}},dispatch:function(e){e=f.event.fix(e);var t,n,i,o,a,s,l=r.call(arguments),u=(f._data(this,"events")||{})[e.type]||[],c=f.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,e)){for(s=f.event.handlers.call(this,e,u),t=0;(o=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,a=0;(i=o.handlers[a++])&&!e.isImmediatePropagationStopped();)e.namespace_re&&!e.namespace_re.test(i.namespace)||(e.handleObj=i,e.data=i.data,void 0!==(n=((f.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l))&&!1===(e.result=n)&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(i=[],o=0;o<s;o++)void 0===i[n=(r=t[o]).selector+" "]&&(i[n]=r.needsContext?f(n,this).index(l)>=0:f.find(n,this,null,[l]).length),i[n]&&i.push(r);i.length&&a.push({elem:l,handlers:i})}return s<t.length&&a.push({elem:this,handlers:t.slice(s)}),a},fix:function(e){if(e[f.expando])return e;var t,n,r,i=e.type,o=e,a=this.fixHooks[i];for(a||(this.fixHooks[i]=a=J.test(i)?this.mouseHooks:V.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new f.Event(o),t=r.length;t--;)e[n=r[t]]=o[n];return e.target||(e.target=o.srcElement||C),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,a.filter?a.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,o=t.button,a=t.fromElement;return null==e.pageX&&null!=t.clientX&&(i=(r=e.target.ownerDocument||C).documentElement,n=r.body,e.pageX=t.clientX+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0),e.pageY=t.clientY+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?t.toElement:a),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Z()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){if(this===Z()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if(f.nodeName(this,"input")&&"checkbox"===this.type&&this.click)return this.click(),!1},_default:function(e){return f.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=f.extend(new f.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?f.event.trigger(i,null,t):f.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},f.removeEvent=C.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===_&&(e[r]=null),e.detachEvent(r,n))},f.Event=function(e,t){if(!(this instanceof f.Event))return new f.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Q:K):this.type=e,t&&f.extend(this,t),this.timeStamp=e&&e.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={isDefaultPrevented:K,isPropagationStopped:K,isImmediatePropagationStopped:K,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Q,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Q,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Q,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},f.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){f.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||f.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),c.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,n=f.nodeName(t,"input")||f.nodeName(t,"button")?t.form:void 0;n&&!f._data(n,"submitBubbles")&&(f.event.add(n,"submit._submit",function(e){e._submit_bubble=!0}),f._data(n,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&f.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),c.changeBubbles||(f.event.special.change={setup:function(){if(U.test(this.nodeName))return"checkbox"!==this.type&&"radio"!==this.type||(f.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),f.event.simulate("change",this,e,!0)})),!1;f.event.add(this,"beforeactivate._change",function(e){var t=e.target;U.test(t.nodeName)&&!f._data(t,"changeBubbles")&&(f.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||f.event.simulate("change",this.parentNode,e,!0)}),f._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type)return e.handleObj.handler.apply(this,arguments)},teardown:function(){return f.event.remove(this,"._change"),!U.test(this.nodeName)}}),c.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){f.event.simulate(t,e.target,f.event.fix(e),!0)};f.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=f._data(r,t);i||r.addEventListener(e,n,!0),f._data(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=f._data(r,t)-1;i?f._data(r,t,i):(r.removeEventListener(e,n,!0),f._removeData(r,t))}}}),f.fn.extend({on:function(e,t,n,r,i){var o,a;if("object"==typeof e){for(o in"string"!=typeof t&&(n=n||t,t=void 0),e)this.on(o,t,n,e[o],i);return this}if(null==n&&null==r?(r=t,n=t=void 0):null==r&&("string"==typeof t?(r=n,n=void 0):(r=n,n=t,t=void 0)),!1===r)r=K;else if(!r)return this;return 1===i&&(a=r,(r=function(e){return f().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=f.guid++)),this.each(function(){f.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,f(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=K),this.each(function(){f.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){f.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return f.event.trigger(e,t,n,!0)}});var te="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ne=/ jQuery\d+="(?:null|\d+)"/g,re=new RegExp("<(?:"+te+")[\\s/>]","i"),ie=/^\s+/,oe=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ae=/<([\w:]+)/,se=/<tbody/i,le=/<|&#?\w+;/,ue=/<(?:script|style|link)/i,ce=/checked\s*(?:[^=]|=\s*.checked.)/i,fe=/^$|\/(?:java|ecma)script/i,de=/^true\/(.*)/,pe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,he={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:c.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},me=ee(C).appendChild(C.createElement("div"));function ge(e,t){var n,r,i=0,o=typeof e.getElementsByTagName!==_?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==_?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||f.nodeName(r,t)?o.push(r):f.merge(o,ge(r,t));return void 0===t||t&&f.nodeName(e,t)?f.merge([e],o):o}function ye(e){X.test(e.type)&&(e.defaultChecked=e.checked)}function ve(e,t){return f.nodeName(e,"table")&&f.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function be(e){return e.type=(null!==f.find.attr(e,"type"))+"/"+e.type,e}function xe(e){var t=de.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function we(e,t){for(var n,r=0;null!=(n=e[r]);r++)f._data(n,"globalEval",!t||f._data(t[r],"globalEval"))}function Te(e,t){if(1===t.nodeType&&f.hasData(e)){var n,r,i,o=f._data(e),a=f._data(t,o),s=o.events;if(s)for(n in delete a.handle,a.events={},s)for(r=0,i=s[n].length;r<i;r++)f.event.add(t,n,s[n][r]);a.data&&(a.data=f.extend({},a.data))}}function Ce(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!c.noCloneEvent&&t[f.expando]){for(r in(i=f._data(t)).events)f.removeEvent(t,r,i.handle);t.removeAttribute(f.expando)}"script"===n&&t.text!==e.text?(be(t).text=e.text,xe(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),c.html5Clone&&e.innerHTML&&!f.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&X.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}}he.optgroup=he.option,he.tbody=he.tfoot=he.colgroup=he.caption=he.thead,he.th=he.td,f.extend({clone:function(e,t,n){var r,i,o,a,s,l=f.contains(e.ownerDocument,e);if(c.html5Clone||f.isXMLDoc(e)||!re.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(me.innerHTML=e.outerHTML,me.removeChild(o=me.firstChild)),!(c.noCloneEvent&&c.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||f.isXMLDoc(e)))for(r=ge(o),s=ge(e),a=0;null!=(i=s[a]);++a)r[a]&&Ce(i,r[a]);if(t)if(n)for(s=s||ge(e),r=r||ge(o),a=0;null!=(i=s[a]);a++)Te(i,r[a]);else Te(e,o);return(r=ge(o,"script")).length>0&&we(r,!l&&ge(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){for(var i,o,a,s,l,u,d,p=e.length,h=ee(t),m=[],g=0;g<p;g++)if((o=e[g])||0===o)if("object"===f.type(o))f.merge(m,o.nodeType?[o]:o);else if(le.test(o)){for(s=s||h.appendChild(t.createElement("div")),l=(ae.exec(o)||["",""])[1].toLowerCase(),d=he[l]||he._default,s.innerHTML=d[1]+o.replace(oe,"<$1></$2>")+d[2],i=d[0];i--;)s=s.lastChild;if(!c.leadingWhitespace&&ie.test(o)&&m.push(t.createTextNode(ie.exec(o)[0])),!c.tbody)for(i=(o="table"!==l||se.test(o)?"<table>"!==d[1]||se.test(o)?0:s:s.firstChild)&&o.childNodes.length;i--;)f.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u);for(f.merge(m,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=h.lastChild}else m.push(t.createTextNode(o));for(s&&h.removeChild(s),c.appendChecked||f.grep(ge(m,"input"),ye),g=0;o=m[g++];)if((!r||-1===f.inArray(o,r))&&(a=f.contains(o.ownerDocument,o),s=ge(h.appendChild(o),"script"),a&&we(s),n))for(i=0;o=s[i++];)fe.test(o.type||"")&&n.push(o);return s=null,h},cleanData:function(e,t){for(var r,i,o,a,s=0,l=f.expando,u=f.cache,d=c.deleteExpando,p=f.event.special;null!=(r=e[s]);s++)if((t||f.acceptData(r))&&(a=(o=r[l])&&u[o])){if(a.events)for(i in a.events)p[i]?f.event.remove(r,i):f.removeEvent(r,i,a.handle);u[o]&&(delete u[o],d?delete r[l]:typeof r.removeAttribute!==_?r.removeAttribute(l):r[l]=null,n.push(o))}}}),f.fn.extend({text:function(e){return I(this,function(e){return void 0===e?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||C).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||ve(this,e).appendChild(e)})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ve(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=e?f.filter(e,this):this,i=0;null!=(n=r[i]);i++)t||1!==n.nodeType||f.cleanData(ge(n)),n.parentNode&&(t&&f.contains(n.ownerDocument,n)&&we(ge(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&f.cleanData(ge(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&f.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return f.clone(this,e,t)})},html:function(e){return I(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(ne,""):void 0;if("string"==typeof e&&!ue.test(e)&&(c.htmlSerialize||!re.test(e))&&(c.leadingWhitespace||!ie.test(e))&&!he[(ae.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(oe,"<$1></$2>");try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(f.cleanData(ge(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,f.cleanData(ge(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=i.apply([],e);var n,r,o,a,s,l,u=0,d=this.length,p=this,h=d-1,m=e[0],g=f.isFunction(m);if(g||d>1&&"string"==typeof m&&!c.checkClone&&ce.test(m))return this.each(function(n){var r=p.eq(n);g&&(e[0]=m.call(this,n,r.html())),r.domManip(e,t)});if(d&&(n=(l=f.buildFragment(e,this[0].ownerDocument,!1,this)).firstChild,1===l.childNodes.length&&(l=n),n)){for(o=(a=f.map(ge(l,"script"),be)).length;u<d;u++)r=l,u!==h&&(r=f.clone(r,!0,!0),o&&f.merge(a,ge(r,"script"))),t.call(this[u],r,u);if(o)for(s=a[a.length-1].ownerDocument,f.map(a,xe),u=0;u<o;u++)r=a[u],fe.test(r.type||"")&&!f._data(r,"globalEval")&&f.contains(s,r)&&(r.src?f._evalUrl&&f._evalUrl(r.src):f.globalEval((r.text||r.textContent||r.innerHTML||"").replace(pe,"")));l=n=null}return this}}),f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){f.fn[e]=function(e){for(var n,r=0,i=[],a=f(e),s=a.length-1;r<=s;r++)n=r===s?this:this.clone(!0),f(a[r])[t](n),o.apply(i,n.get());return this.pushStack(i)}});var Ne,Ee,ke={};function Se(t,n){var r,i=f(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:f.css(i[0],"display");return i.detach(),o}function Ae(e){var t=C,n=ke[e];return n||("none"!==(n=Se(e,t))&&n||((t=((Ne=(Ne||f("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement))[0].contentWindow||Ne[0].contentDocument).document).write(),t.close(),n=Se(e,t),Ne.detach()),ke[e]=n),n}c.shrinkWrapBlocks=function(){return null!=Ee?Ee:(Ee=!1,(t=C.getElementsByTagName("body")[0])&&t.style?(e=C.createElement("div"),(n=C.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",t.appendChild(n).appendChild(e),typeof e.style.zoom!==_&&(e.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",e.appendChild(C.createElement("div")).style.width="5px",Ee=3!==e.offsetWidth),t.removeChild(n),Ee):void 0);var e,t,n};var De,je,Le=/^margin/,He=new RegExp("^("+W+")(?!px)[a-z%]+$","i"),qe=/^(top|right|bottom|left)$/;function _e(e,t){return{get:function(){var n=e();if(null!=n){if(!n)return(this.get=t).apply(this,arguments);delete this.get}}}}e.getComputedStyle?(De=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)},je=function(e,t,n){var r,i,o,a,s=e.style;return a=(n=n||De(e))?n.getPropertyValue(t)||n[t]:void 0,n&&(""!==a||f.contains(e.ownerDocument,e)||(a=f.style(e,t)),He.test(a)&&Le.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0===a?a:a+""}):C.documentElement.currentStyle&&(De=function(e){return e.currentStyle},je=function(e,t,n){var r,i,o,a,s=e.style;return null==(a=(n=n||De(e))?n[t]:void 0)&&s&&s[t]&&(a=s[t]),He.test(a)&&!qe.test(t)&&(r=s.left,(o=(i=e.runtimeStyle)&&i.left)&&(i.left=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"}),function(){var t,n,r,i,o,a,s;function l(){var t,n,r,l;(n=C.getElementsByTagName("body")[0])&&n.style&&(t=C.createElement("div"),(r=C.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),t.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",i=o=!1,s=!0,e.getComputedStyle&&(i="1%"!==(e.getComputedStyle(t,null)||{}).top,o="4px"===(e.getComputedStyle(t,null)||{width:"4px"}).width,(l=t.appendChild(C.createElement("div"))).style.cssText=t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",l.style.marginRight=l.style.width="0",t.style.width="1px",s=!parseFloat((e.getComputedStyle(l,null)||{}).marginRight),t.removeChild(l)),t.innerHTML="<table><tr><td></td><td>t</td></tr></table>",(l=t.getElementsByTagName("td"))[0].style.cssText="margin:0;border:0;padding:0;display:none",(a=0===l[0].offsetHeight)&&(l[0].style.display="",l[1].style.display="none",a=0===l[0].offsetHeight),n.removeChild(r))}(t=C.createElement("div")).innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",(n=(r=t.getElementsByTagName("a")[0])&&r.style)&&(n.cssText="float:left;opacity:.5",c.opacity="0.5"===n.opacity,c.cssFloat=!!n.cssFloat,t.style.backgroundClip="content-box",t.cloneNode(!0).style.backgroundClip="",c.clearCloneStyle="content-box"===t.style.backgroundClip,c.boxSizing=""===n.boxSizing||""===n.MozBoxSizing||""===n.WebkitBoxSizing,f.extend(c,{reliableHiddenOffsets:function(){return null==a&&l(),a},boxSizingReliable:function(){return null==o&&l(),o},pixelPosition:function(){return null==i&&l(),i},reliableMarginRight:function(){return null==s&&l(),s}}))}(),f.swap=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=a[o];return i};var Me=/alpha\([^)]*\)/i,Fe=/opacity\s*=\s*([^)]*)/,Oe=/^(none|table(?!-c[ea]).+)/,Be=new RegExp("^("+W+")(.*)$","i"),Pe=new RegExp("^([+-])=("+W+")","i"),Re={position:"absolute",visibility:"hidden",display:"block"},We={letterSpacing:"0",fontWeight:"400"},$e=["Webkit","O","Moz","ms"];function ze(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=$e.length;i--;)if((t=$e[i]+n)in e)return t;return r}function Ie(e,t){for(var n,r,i,o=[],a=0,s=e.length;a<s;a++)(r=e[a]).style&&(o[a]=f._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&z(r)&&(o[a]=f._data(r,"olddisplay",Ae(r.nodeName)))):(i=z(r),(n&&"none"!==n||!i)&&f._data(r,"olddisplay",i?n:f.css(r,"display"))));for(a=0;a<s;a++)(r=e[a]).style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}function Xe(e,t,n){var r=Be.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ue(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;o<4;o+=2)"margin"===n&&(a+=f.css(e,n+$[o],!0,i)),r?("content"===n&&(a-=f.css(e,"padding"+$[o],!0,i)),"margin"!==n&&(a-=f.css(e,"border"+$[o]+"Width",!0,i))):(a+=f.css(e,"padding"+$[o],!0,i),"padding"!==n&&(a+=f.css(e,"border"+$[o]+"Width",!0,i)));return a}function Ve(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=De(e),a=c.boxSizing&&"border-box"===f.css(e,"boxSizing",!1,o);if(i<=0||null==i){if(((i=je(e,t,o))<0||null==i)&&(i=e.style[t]),He.test(i))return i;r=a&&(c.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+Ue(e,t,n||(a?"border":"content"),r,o)+"px"}function Je(e,t,n,r,i){return new Je.prototype.init(e,t,n,r,i)}f.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=je(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:c.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=f.camelCase(t),l=e.style;if(t=f.cssProps[s]||(f.cssProps[s]=ze(l,s)),a=f.cssHooks[t]||f.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];if("string"===(o=typeof n)&&(i=Pe.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(f.css(e,t)),o="number"),null!=n&&n==n&&("number"!==o||f.cssNumber[s]||(n+="px"),c.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{l[t]=n}catch(e){}}},css:function(e,t,n,r){var i,o,a,s=f.camelCase(t);return t=f.cssProps[s]||(f.cssProps[s]=ze(e.style,s)),(a=f.cssHooks[t]||f.cssHooks[s])&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=je(e,t,r)),"normal"===o&&t in We&&(o=We[t]),""===n||n?(i=parseFloat(o),!0===n||f.isNumeric(i)?i||0:o):o}}),f.each(["height","width"],function(e,t){f.cssHooks[t]={get:function(e,n,r){if(n)return Oe.test(f.css(e,"display"))&&0===e.offsetWidth?f.swap(e,Re,function(){return Ve(e,t,r)}):Ve(e,t,r)},set:function(e,n,r){var i=r&&De(e);return Xe(0,n,r?Ue(e,t,r,c.boxSizing&&"border-box"===f.css(e,"boxSizing",!1,i),i):0)}}}),c.opacity||(f.cssHooks.opacity={get:function(e,t){return Fe.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=f.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===f.trim(o.replace(Me,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=Me.test(o)?o.replace(Me,i):o+" "+i)}}),f.cssHooks.marginRight=_e(c.reliableMarginRight,function(e,t){if(t)return f.swap(e,{display:"inline-block"},je,[e,"marginRight"])}),f.each({margin:"",padding:"",border:"Width"},function(e,t){f.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+$[r]+t]=o[r]||o[r-2]||o[0];return i}},Le.test(e)||(f.cssHooks[e+t].set=Xe)}),f.fn.extend({css:function(e,t){return I(this,function(e,t,n){var r,i,o={},a=0;if(f.isArray(t)){for(r=De(e),i=t.length;a<i;a++)o[t[a]]=f.css(e,t[a],!1,r);return o}return void 0!==n?f.style(e,t,n):f.css(e,t)},e,t,arguments.length>1)},show:function(){return Ie(this,!0)},hide:function(){return Ie(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){z(this)?f(this).show():f(this).hide()})}}),f.Tween=Je,Je.prototype={constructor:Je,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(f.cssNumber[n]?"":"px")},cur:function(){var e=Je.propHooks[this.prop];return e&&e.get?e.get(this):Je.propHooks._default.get(this)},run:function(e){var t,n=Je.propHooks[this.prop];return this.options.duration?this.pos=t=f.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Je.propHooks._default.set(this),this}},Je.prototype.init.prototype=Je.prototype,Je.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=f.css(e.elem,e.prop,""))&&"auto"!==t?t:0:e.elem[e.prop]},set:function(e){f.fx.step[e.prop]?f.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[f.cssProps[e.prop]]||f.cssHooks[e.prop])?f.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Je.propHooks.scrollTop=Je.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},f.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},f.fx=Je.prototype.init,f.fx.step={};var Ye,Ge,Qe,Ke,Ze,et,tt,nt=/^(?:toggle|show|hide)$/,rt=new RegExp("^(?:([+-])=|)("+W+")([a-z%]*)$","i"),it=/queueHooks$/,ot=[function(e,t,n){var r,i,o,a,s,l,u,d=this,p={},h=e.style,m=e.nodeType&&z(e),g=f._data(e,"fxshow");n.queue||(null==(s=f._queueHooks(e,"fx")).unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,d.always(function(){d.always(function(){s.unqueued--,f.queue(e,"fx").length||s.empty.fire()})}));1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],u=f.css(e,"display"),"inline"===("none"===u?f._data(e,"olddisplay")||Ae(e.nodeName):u)&&"none"===f.css(e,"float")&&(c.inlineBlockNeedsLayout&&"inline"!==Ae(e.nodeName)?h.zoom=1:h.display="inline-block"));n.overflow&&(h.overflow="hidden",c.shrinkWrapBlocks()||d.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],nt.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;m=!0}p[r]=g&&g[r]||f.style(e,r)}else u=void 0;if(f.isEmptyObject(p))"inline"===("none"===u?Ae(e.nodeName):u)&&(h.display=u);else for(r in g?"hidden"in g&&(m=g.hidden):g=f._data(e,"fxshow",{}),o&&(g.hidden=!m),m?f(e).show():d.done(function(){f(e).hide()}),d.done(function(){var t;for(t in f._removeData(e,"fxshow"),p)f.style(e,t,p[t])}),p)a=ut(m?g[r]:0,r,d),r in g||(g[r]=a.start,m&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}],at={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=rt.exec(t),o=i&&i[3]||(f.cssNumber[e]?"":"px"),a=(f.cssNumber[e]||"px"!==o&&+r)&&rt.exec(f.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do{a/=s=s||".5",f.style(n.elem,e,a+o)}while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function st(){return setTimeout(function(){Ye=void 0}),Ye=f.now()}function lt(e,t){var n,r={height:e},i=0;for(t=t?1:0;i<4;i+=2-t)r["margin"+(n=$[i])]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function ut(e,t,n){for(var r,i=(at[t]||[]).concat(at["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ct(e,t,n){var r,i,o=0,a=ot.length,s=f.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var t=Ye||st(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),o=0,a=u.tweens.length;o<a;o++)u.tweens[o].run(r);return s.notifyWith(e,[u,r,n]),r<1&&a?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:f.extend({},t),opts:f.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Ye||st(),duration:n.duration,tweens:[],createTween:function(t,n){var r=f.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=f.camelCase(n)],o=e[n],f.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=f.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,u.opts.specialEasing);o<a;o++)if(r=ot[o].call(u,e,c,u.opts))return r;return f.map(c,ut,u),f.isFunction(u.opts.start)&&u.opts.start.call(e,u),f.fx.timer(f.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}f.Animation=f.extend(ct,{tweener:function(e,t){f.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;r<i;r++)n=e[r],at[n]=at[n]||[],at[n].unshift(t)},prefilter:function(e,t){t?ot.unshift(e):ot.push(e)}}),f.speed=function(e,t,n){var r=e&&"object"==typeof e?f.extend({},e):{complete:n||!n&&t||f.isFunction(e)&&e,duration:e,easing:n&&t||t&&!f.isFunction(t)&&t};return r.duration=f.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in f.fx.speeds?f.fx.speeds[r.duration]:f.fx.speeds._default,null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){f.isFunction(r.old)&&r.old.call(this),r.queue&&f.dequeue(this,r.queue)},r},f.fn.extend({fadeTo:function(e,t,n,r){return this.filter(z).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=f.isEmptyObject(e),o=f.speed(t,n,r),a=function(){var t=ct(this,f.extend({},e),o);(i||f._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=f.timers,a=f._data(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&it.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||f.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=f._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=f.timers,a=r?r.length:0;for(n.finish=!0,f.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),f.each(["toggle","show","hide"],function(e,t){var n=f.fn[t];f.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(lt(t,!0),e,r,i)}}),f.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){f.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),f.timers=[],f.fx.tick=function(){var e,t=f.timers,n=0;for(Ye=f.now();n<t.length;n++)(e=t[n])()||t[n]!==e||t.splice(n--,1);t.length||f.fx.stop(),Ye=void 0},f.fx.timer=function(e){f.timers.push(e),e()?f.fx.start():f.timers.pop()},f.fx.interval=13,f.fx.start=function(){Ge||(Ge=setInterval(f.fx.tick,f.fx.interval))},f.fx.stop=function(){clearInterval(Ge),Ge=null},f.fx.speeds={slow:600,fast:200,_default:400},f.fn.delay=function(e,t){return e=f.fx&&f.fx.speeds[e]||e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},(Ke=C.createElement("div")).setAttribute("className","t"),Ke.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",et=Ke.getElementsByTagName("a")[0],tt=(Ze=C.createElement("select")).appendChild(C.createElement("option")),Qe=Ke.getElementsByTagName("input")[0],et.style.cssText="top:1px",c.getSetAttribute="t"!==Ke.className,c.style=/top/.test(et.getAttribute("style")),c.hrefNormalized="/a"===et.getAttribute("href"),c.checkOn=!!Qe.value,c.optSelected=tt.selected,c.enctype=!!C.createElement("form").enctype,Ze.disabled=!0,c.optDisabled=!tt.disabled,(Qe=C.createElement("input")).setAttribute("value",""),c.input=""===Qe.getAttribute("value"),Qe.value="t",Qe.setAttribute("type","radio"),c.radioValue="t"===Qe.value;var ft=/\r/g;f.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=f.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,f(this).val()):e)?i="":"number"==typeof i?i+="":f.isArray(i)&&(i=f.map(i,function(e){return null==e?"":e+""})),(t=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=f.valHooks[i.type]||f.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(ft,""):null==n?"":n:void 0}}),f.extend({valHooks:{option:{get:function(e){var t=f.find.attr(e,"value");return null!=t?t:f.trim(f.text(e))}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,a=o?null:[],s=o?i+1:r.length,l=i<0?s:o?i:0;l<s;l++)if(((n=r[l]).selected||l===i)&&(c.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!f.nodeName(n.parentNode,"optgroup"))){if(t=f(n).val(),o)return t;a.push(t)}return a},set:function(e,t){for(var n,r,i=e.options,o=f.makeArray(t),a=i.length;a--;)if(r=i[a],f.inArray(f.valHooks.option.get(r),o)>=0)try{r.selected=n=!0}catch(e){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]={set:function(e,t){if(f.isArray(t))return e.checked=f.inArray(f(e).val(),t)>=0}},c.checkOn||(f.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var dt,pt,ht=f.expr.attrHandle,mt=/^(?:checked|selected)$/i,gt=c.getSetAttribute,yt=c.input;f.fn.extend({attr:function(e,t){return I(this,f.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){f.removeAttr(this,e)})}}),f.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===_?f.prop(e,t,n):(1===o&&f.isXMLDoc(e)||(t=t.toLowerCase(),r=f.attrHooks[t]||(f.expr.match.bool.test(t)?pt:dt)),void 0===n?r&&"get"in r&&null!==(i=r.get(e,t))?i:null==(i=f.find.attr(e,t))?void 0:i:null!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):void f.removeAttr(e,t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(D);if(o&&1===e.nodeType)for(;n=o[i++];)r=f.propFix[n]||n,f.expr.match.bool.test(n)?yt&&gt||!mt.test(n)?e[r]=!1:e[f.camelCase("default-"+n)]=e[r]=!1:f.attr(e,n,""),e.removeAttribute(gt?n:r)},attrHooks:{type:{set:function(e,t){if(!c.radioValue&&"radio"===t&&f.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),pt={set:function(e,t,n){return!1===t?f.removeAttr(e,n):yt&&gt||!mt.test(n)?e.setAttribute(!gt&&f.propFix[n]||n,n):e[f.camelCase("default-"+n)]=e[n]=!0,n}},f.each(f.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||f.find.attr;ht[t]=yt&&gt||!mt.test(t)?function(e,t,r){var i,o;return r||(o=ht[t],ht[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,ht[t]=o),i}:function(e,t,n){if(!n)return e[f.camelCase("default-"+t)]?t.toLowerCase():null}}),yt&&gt||(f.attrHooks.value={set:function(e,t,n){if(!f.nodeName(e,"input"))return dt&&dt.set(e,t,n);e.defaultValue=t}}),gt||(dt={set:function(e,t,n){var r=e.getAttributeNode(n);if(r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n))return t}},ht.id=ht.name=ht.coords=function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},f.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:dt.set},f.attrHooks.contenteditable={set:function(e,t,n){dt.set(e,""!==t&&t,n)}},f.each(["width","height"],function(e,t){f.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}})),c.style||(f.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var vt=/^(?:input|select|textarea|button|object)$/i,bt=/^(?:a|area)$/i;f.fn.extend({prop:function(e,t){return I(this,f.prop,e,t,arguments.length>1)},removeProp:function(e){return e=f.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(e){}})}}),f.extend({propFix:{for:"htmlFor",class:"className"},prop:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return(1!==o||!f.isXMLDoc(e))&&(t=f.propFix[t]||t,i=f.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=f.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||bt.test(e.nodeName)&&e.href?0:-1}}}}),c.hrefNormalized||f.each(["href","src"],function(e,t){f.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),c.optSelected||(f.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),f.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){f.propFix[this.toLowerCase()]=this}),c.enctype||(f.propFix.enctype="encoding");var xt=/[\t\r\n\f]/g;f.fn.extend({addClass:function(e){var t,n,r,i,o,a,s=0,l=this.length,u="string"==typeof e&&e;if(f.isFunction(e))return this.each(function(t){f(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(D)||[];s<l;s++)if(r=1===(n=this[s]).nodeType&&(n.className?(" "+n.className+" ").replace(xt," "):" ")){for(o=0;i=t[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=f.trim(r),n.className!==a&&(n.className=a)}return this},removeClass:function(e){var t,n,r,i,o,a,s=0,l=this.length,u=0===arguments.length||"string"==typeof e&&e;if(f.isFunction(e))return this.each(function(t){f(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(D)||[];s<l;s++)if(r=1===(n=this[s]).nodeType&&(n.className?(" "+n.className+" ").replace(xt," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=e?f.trim(r):"",n.className!==a&&(n.className=a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):f.isFunction(e)?this.each(function(n){f(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var t,r=0,i=f(this),o=e.match(D)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else n!==_&&"boolean"!==n||(this.className&&f._data(this,"__className__",this.className),this.className=this.className||!1===e?"":f._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;n<r;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(xt," ").indexOf(t)>=0)return!0;return!1}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){f.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),f.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var wt=f.now(),Tt=/\?/,Ct=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;f.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=f.trim(t+"");return i&&!f.trim(i.replace(Ct,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():f.error("Invalid JSON: "+t)},f.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{e.DOMParser?n=(new DOMParser).parseFromString(t,"text/xml"):((n=new ActiveXObject("Microsoft.XMLDOM")).async="false",n.loadXML(t))}catch(e){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||f.error("Invalid XML: "+t),n};var Nt,Et,kt=/#.*$/,St=/([?&])_=[^&]*/,At=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dt=/^(?:GET|HEAD)$/,jt=/^\/\//,Lt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ht={},qt={},_t="*/".concat("*");try{Et=location.href}catch(e){(Et=C.createElement("a")).href="",Et=Et.href}function Mt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(D)||[];if(f.isFunction(n))for(;r=o[i++];)"+"===r.charAt(0)?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Ft(e,t,n,r){var i={},o=e===qt;function a(s){var l;return i[s]=!0,f.each(e[s]||[],function(e,s){var u=s(t,n,r);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),a(u),!1)}),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Ot(e,t){var n,r,i=f.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((i[r]?e:n||(n={}))[r]=t[r]);return n&&f.extend(!0,e,n),e}Nt=Lt.exec(Et.toLowerCase())||[],f.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Nt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":_t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ot(Ot(e,f.ajaxSettings),t):Ot(f.ajaxSettings,e)},ajaxPrefilter:Mt(Ht),ajaxTransport:Mt(qt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,r,i,o,a,s,l,u,c=f.ajaxSetup({},t),d=c.context||c,p=c.context&&(d.nodeType||d.jquery)?f(d):f.event,h=f.Deferred(),m=f.Callbacks("once memory"),g=c.statusCode||{},y={},v={},b=0,x="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!u)for(u={};t=At.exec(o);)u[t[1].toLowerCase()]=t[2];t=u[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)g[t]=[g[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||x;return l&&l.abort(t),T(0,t),this}};if(h.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,c.url=((e||c.url||Et)+"").replace(kt,"").replace(jt,Nt[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=f.trim(c.dataType||"*").toLowerCase().match(D)||[""],null==c.crossDomain&&(n=Lt.exec(c.url.toLowerCase()),c.crossDomain=!(!n||n[1]===Nt[1]&&n[2]===Nt[2]&&(n[3]||("http:"===n[1]?"80":"443"))===(Nt[3]||("http:"===Nt[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=f.param(c.data,c.traditional)),Ft(Ht,c,t,w),2===b)return w;for(r in(s=f.event&&c.global)&&0==f.active++&&f.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Dt.test(c.type),i=c.url,c.hasContent||(c.data&&(i=c.url+=(Tt.test(i)?"&":"?")+c.data,delete c.data),!1===c.cache&&(c.url=St.test(i)?i.replace(St,"$1_="+wt++):i+(Tt.test(i)?"&":"?")+"_="+wt++)),c.ifModified&&(f.lastModified[i]&&w.setRequestHeader("If-Modified-Since",f.lastModified[i]),f.etag[i]&&w.setRequestHeader("If-None-Match",f.etag[i])),(c.data&&c.hasContent&&!1!==c.contentType||t.contentType)&&w.setRequestHeader("Content-Type",c.contentType),w.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+_t+"; q=0.01":""):c.accepts["*"]),c.headers)w.setRequestHeader(r,c.headers[r]);if(c.beforeSend&&(!1===c.beforeSend.call(d,w,c)||2===b))return w.abort();for(r in x="abort",{success:1,error:1,complete:1})w[r](c[r]);if(l=Ft(qt,c,t,w)){w.readyState=1,s&&p.trigger("ajaxSend",[w,c]),c.async&&c.timeout>0&&(a=setTimeout(function(){w.abort("timeout")},c.timeout));try{b=1,l.send(y,T)}catch(e){if(!(b<2))throw e;T(-1,e)}}else T(-1,"No Transport");function T(e,t,n,r){var u,y,v,x,T,C=t;2!==b&&(b=2,a&&clearTimeout(a),l=void 0,o=r||"",w.readyState=e>0?4:0,u=e>=200&&e<300||304===e,n&&(x=function(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(a in s)if(s[a]&&s[a].test(i)){l.unshift(a);break}if(l[0]in n)o=l[0];else{for(a in n){if(!l[0]||e.converters[a+" "+l[0]]){o=a;break}r||(r=a)}o=o||r}if(o)return o!==l[0]&&l.unshift(o),n[o]}(c,w,n)),x=function(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(c,x,w,u),u?(c.ifModified&&((T=w.getResponseHeader("Last-Modified"))&&(f.lastModified[i]=T),(T=w.getResponseHeader("etag"))&&(f.etag[i]=T)),204===e||"HEAD"===c.type?C="nocontent":304===e?C="notmodified":(C=x.state,y=x.data,u=!(v=x.error))):(v=C,!e&&C||(C="error",e<0&&(e=0))),w.status=e,w.statusText=(t||C)+"",u?h.resolveWith(d,[y,C,w]):h.rejectWith(d,[w,C,v]),w.statusCode(g),g=void 0,s&&p.trigger(u?"ajaxSuccess":"ajaxError",[w,c,u?y:v]),m.fireWith(d,[w,C]),s&&(p.trigger("ajaxComplete",[w,c]),--f.active||f.event.trigger("ajaxStop")))}return w},getJSON:function(e,t,n){return f.get(e,t,n,"json")},getScript:function(e,t){return f.get(e,void 0,t,"script")}}),f.each(["get","post"],function(e,t){f[t]=function(e,n,r,i){return f.isFunction(n)&&(i=i||r,r=n,n=void 0),f.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),f._evalUrl=function(e){return f.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},f.fn.extend({wrapAll:function(e){if(f.isFunction(e))return this.each(function(t){f(this).wrapAll(e.call(this,t))});if(this[0]){var t=f(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return f.isFunction(e)?this.each(function(t){f(this).wrapInner(e.call(this,t))}):this.each(function(){var t=f(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=f.isFunction(e);return this.each(function(n){f(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()}}),f.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!c.reliableHiddenOffsets()&&"none"===(e.style&&e.style.display||f.css(e,"display"))},f.expr.filters.visible=function(e){return!f.expr.filters.hidden(e)};var Bt=/%20/g,Pt=/\[\]$/,Rt=/\r?\n/g,Wt=/^(?:submit|button|image|reset|file)$/i,$t=/^(?:input|select|textarea|keygen)/i;function zt(e,t,n,r){var i;if(f.isArray(t))f.each(t,function(t,i){n||Pt.test(e)?r(e,i):zt(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==f.type(t))r(e,t);else for(i in t)zt(e+"["+i+"]",t[i],n,r)}f.param=function(e,t){var n,r=[],i=function(e,t){t=f.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=f.ajaxSettings&&f.ajaxSettings.traditional),f.isArray(e)||e.jquery&&!f.isPlainObject(e))f.each(e,function(){i(this.name,this.value)});else for(n in e)zt(n,e[n],t,i);return r.join("&").replace(Bt,"+")},f.fn.extend({serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=f.prop(this,"elements");return e?f.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!f(this).is(":disabled")&&$t.test(this.nodeName)&&!Wt.test(e)&&(this.checked||!X.test(e))}).map(function(e,t){var n=f(this).val();return null==n?null:f.isArray(n)?f.map(n,function(e){return{name:t.name,value:e.replace(Rt,"\r\n")}}):{name:t.name,value:n.replace(Rt,"\r\n")}}).get()}}),f.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Vt()||function(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}()}:Vt;var It=0,Xt={},Ut=f.ajaxSettings.xhr();function Vt(){try{return new e.XMLHttpRequest}catch(e){}}e.attachEvent&&e.attachEvent("onunload",function(){for(var e in Xt)Xt[e](void 0,!0)}),c.cors=!!Ut&&"withCredentials"in Ut,(Ut=c.ajax=!!Ut)&&f.ajaxTransport(function(e){var t;if(!e.crossDomain||c.cors)return{send:function(n,r){var i,o=e.xhr(),a=++It;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];for(i in e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest"),n)void 0!==n[i]&&o.setRequestHeader(i,n[i]+"");o.send(e.hasContent&&e.data||null),t=function(n,i){var s,l,u;if(t&&(i||4===o.readyState))if(delete Xt[a],t=void 0,o.onreadystatechange=f.noop,i)4!==o.readyState&&o.abort();else{u={},s=o.status,"string"==typeof o.responseText&&(u.text=o.responseText);try{l=o.statusText}catch(e){l=""}s||!e.isLocal||e.crossDomain?1223===s&&(s=204):s=u.text?200:404}u&&r(s,l,u,o.getAllResponseHeaders())},e.async?4===o.readyState?setTimeout(t):o.onreadystatechange=Xt[a]=t:t()},abort:function(){t&&t(void 0,!0)}}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return f.globalEval(e),e}}}),f.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),f.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=C.head||f("head")[0]||C.documentElement;return{send:function(r,i){(t=C.createElement("script")).async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var Jt=[],Yt=/(=)\?(?=&|$)|\?\?/;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Jt.pop()||f.expando+"_"+wt++;return this[e]=!0,e}}),f.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(Yt.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=f.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Yt,"$1"+i):!1!==t.jsonp&&(t.url+=(Tt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||f.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Jt.push(i)),a&&f.isFunction(o)&&o(a[0]),a=o=void 0}),"script"}),f.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||C;var r=b.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=f.buildFragment([e],t,i),i&&i.length&&f(i).remove(),f.merge([],r.childNodes))};var Gt=f.fn.load;f.fn.load=function(e,t,n){if("string"!=typeof e&&Gt)return Gt.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>=0&&(r=f.trim(e.slice(s,e.length)),e=e.slice(0,s)),f.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(o="POST"),a.length>0&&f.ajax({url:e,type:o,dataType:"html",data:t}).done(function(e){i=arguments,a.html(r?f("<div>").append(f.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,i||[e.responseText,t,e])}),this},f.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){f.fn[t]=function(e){return this.on(t,e)}}),f.expr.filters.animated=function(e){return f.grep(f.timers,function(t){return e===t.elem}).length};var Qt=e.document.documentElement;function Kt(e){return f.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}f.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u=f.css(e,"position"),c=f(e),d={};"static"===u&&(e.style.position="relative"),s=c.offset(),o=f.css(e,"top"),l=f.css(e,"left"),("absolute"===u||"fixed"===u)&&f.inArray("auto",[o,l])>-1?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),f.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):c.css(d)}},f.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){f.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;return o?(t=o.documentElement,f.contains(t,i)?(typeof i.getBoundingClientRect!==_&&(r=i.getBoundingClientRect()),n=Kt(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r):void 0},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===f.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),f.nodeName(e[0],"html")||(n=e.offset()),n.top+=f.css(e[0],"borderTopWidth",!0),n.left+=f.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-f.css(r,"marginTop",!0),left:t.left-n.left-f.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||Qt;e&&!f.nodeName(e,"html")&&"static"===f.css(e,"position");)e=e.offsetParent;return e||Qt})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);f.fn[e]=function(r){return I(this,function(e,r,i){var o=Kt(e);if(void 0===i)return o?t in o?o[t]:o.document.documentElement[r]:e[r];o?o.scrollTo(n?f(o).scrollLeft():i,n?i:f(o).scrollTop()):e[r]=i},e,r,arguments.length,null)}}),f.each(["top","left"],function(e,t){f.cssHooks[t]=_e(c.pixelPosition,function(e,n){if(n)return n=je(e,t),He.test(n)?f(e).position()[t]+"px":n})}),f.each({Height:"height",Width:"width"},function(e,t){f.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){f.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===i?"margin":"border");return I(this,function(t,n,r){var i;return f.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?f.css(t,n,a):f.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),f.fn.size=function(){return this.length},f.fn.andSelf=f.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return f});var Zt=e.jQuery,en=e.$;return f.noConflict=function(t){return e.$===f&&(e.$=en),t&&e.jQuery===f&&(e.jQuery=Zt),f},typeof t===_&&(e.jQuery=e.$=f),f});;!function(t,e,n){"use strict";function r(t){return function(){var e,n,r,i=arguments[0],o=arguments;for(e=(e="["+(t?t+":":"")+i+"] "+arguments[1].replace(/\{\d+\}/g,function(t){var e,n=+t.slice(1,-1);return n+2<o.length?"function"==typeof(e=o[n+2])?e.toString().replace(/ ?\{[\s\S]*$/,""):void 0===e?"undefined":"string"!=typeof e?Z(e):e:t}))+"\nhttp://errors.angularjs.org/1.2.16/"+(t?t+"/":"")+i,n=2;n<arguments.length;n++)e=e+(2==n?"?":"&")+"p"+(n-2)+"="+encodeURIComponent("function"==typeof(r=arguments[n])?r.toString().replace(/ \{[\s\S]*$/,""):void 0===r?"undefined":"string"!=typeof r?JSON.stringify(r):r);return new Error(e)}}var i=function(t){return N(t)?t.toLowerCase():t},o=Object.prototype.hasOwnProperty,s=function(t){return N(t)?t.toUpperCase():t};"i"!=="I".toLowerCase()&&(i=function(t){return N(t)?t.replace(/[A-Z]/g,function(t){return String.fromCharCode(32|t.charCodeAt(0))}):t},s=function(t){return N(t)?t.replace(/[a-z]/g,function(t){return String.fromCharCode(-33&t.charCodeAt(0))}):t});var a,u,c,l,f,h=[].slice,p=[].push,$=Object.prototype.toString,d=r("ng"),v=(t.angular,t.angular||(t.angular={})),g=["0","0","0"];function m(t){if(null==t||U(t))return!1;var e=t.length;return!(1!==t.nodeType||!e)||(N(t)||q(t)||0===e||"number"==typeof e&&e>0&&e-1 in t)}function y(t,e,n){var r;if(t)if(V(t))for(r in t)"prototype"==r||"length"==r||"name"==r||t.hasOwnProperty&&!t.hasOwnProperty(r)||e.call(n,t[r],r);else if(t.forEach&&t.forEach!==y)t.forEach(e,n);else if(m(t))for(r=0;r<t.length;r++)e.call(n,t[r],r);else for(r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r);return t}function w(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e.sort()}function b(t){return function(e,n){t(n,e)}}function x(){for(var t,e=g.length;e;){if(57==(t=g[--e].charCodeAt(0)))return g[e]="A",g.join("");if(90!=t)return g[e]=String.fromCharCode(t+1),g.join("");g[e]="0"}return g.unshift("0"),g.join("")}function S(t,e){e?t.$$hashKey=e:delete t.$$hashKey}function C(t){var e=t.$$hashKey;return y(arguments,function(e){e!==t&&y(e,function(e,n){t[n]=e})}),S(t,e),t}function k(t){return parseInt(t,10)}function E(t,e){return C(new(C(function(){},{prototype:t})),e)}function A(){}function O(t){return t}function T(t){return function(){return t}}function M(t){return void 0===t}function P(t){return void 0!==t}function j(t){return null!=t&&"object"==typeof t}function N(t){return"string"==typeof t}function D(t){return"number"==typeof t}function R(t){return"[object Date]"===$.call(t)}function q(t){return"[object Array]"===$.call(t)}function V(t){return"function"==typeof t}function I(t){return"[object RegExp]"===$.call(t)}function U(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function F(t){return t&&t.$evalAsync&&t.$watch}a=k((/msie (\d+)/.exec(i(navigator.userAgent))||[])[1]),isNaN(a)&&(a=k((/trident\/.*; rv:(\d+)/.exec(i(navigator.userAgent))||[])[1])),A.$inject=[],O.$inject=[];var _=String.prototype.trim?function(t){return N(t)?t.trim():t}:function(t){return N(t)?t.replace(/^\s\s*/,"").replace(/\s\s*$/,""):t};function H(t){return!(!t||!(t.nodeName||t.prop&&t.attr&&t.find))}function L(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(e===t[n])return n;return-1}function B(t,e){var n=L(t,e);return n>=0&&t.splice(n,1),e}function z(t,e){if(U(t)||F(t))throw d("cpws","Can't copy! Making copies of Window or Scope instances is not supported.");if(e){if(t===e)throw d("cpi","Can't copy! Source and destination are identical.");if(q(t)){e.length=0;for(var n=0;n<t.length;n++)e.push(z(t[n]))}else{var r=e.$$hashKey;for(var i in y(e,function(t,n){delete e[n]}),t)e[i]=z(t[i]);S(e,r)}}else e=t,t&&(q(t)?e=z(t,[]):R(t)?e=new Date(t.getTime()):I(t)?e=new RegExp(t.source):j(t)&&(e=z(t,{})));return e}function W(t,e){for(var n in e=e||{},t)!t.hasOwnProperty(n)||"$"===n.charAt(0)&&"$"===n.charAt(1)||(e[n]=t[n]);return e}function Q(t,e){if(t===e)return!0;if(null===t||null===e)return!1;if(t!=t&&e!=e)return!0;var r,i,o,s=typeof t;if(s==typeof e&&"object"==s){if(!q(t)){if(R(t))return R(e)&&t.getTime()==e.getTime();if(I(t)&&I(e))return t.toString()==e.toString();if(F(t)||F(e)||U(t)||U(e)||q(e))return!1;for(i in o={},t)if("$"!==i.charAt(0)&&!V(t[i])){if(!Q(t[i],e[i]))return!1;o[i]=!0}for(i in e)if(!o.hasOwnProperty(i)&&"$"!==i.charAt(0)&&e[i]!==n&&!V(e[i]))return!1;return!0}if(!q(e))return!1;if((r=t.length)==e.length){for(i=0;i<r;i++)if(!Q(t[i],e[i]))return!1;return!0}}return!1}function J(){return e.securityPolicy&&e.securityPolicy.isActive||e.querySelector&&!(!e.querySelector("[ng-csp]")&&!e.querySelector("[data-ng-csp]"))}function X(t,e,n){return t.concat(h.call(e,n))}function G(t,e){return h.call(t,e||0)}function K(t,e){var n=arguments.length>2?G(arguments,2):[];return!V(e)||e instanceof RegExp?e:n.length?function(){return arguments.length?e.apply(t,n.concat(h.call(arguments,0))):e.apply(t,n)}:function(){return arguments.length?e.apply(t,arguments):e.call(t)}}function Y(t,r){var i=r;return"string"==typeof t&&"$"===t.charAt(0)?i=n:U(r)?i="$WINDOW":r&&e===r?i="$DOCUMENT":F(r)&&(i="$SCOPE"),i}function Z(t,e){return void 0===t?n:JSON.stringify(t,Y,e?"  ":null)}function tt(t){return N(t)?JSON.parse(t):t}function et(t){if("function"==typeof t)t=!0;else if(t&&0!==t.length){var e=i(""+t);t=!("f"==e||"0"==e||"false"==e||"no"==e||"n"==e||"[]"==e)}else t=!1;return t}function nt(t){t=u(t).clone();try{t.empty()}catch(t){}var e=u("<div>").append(t).html();try{return 3===t[0].nodeType?i(e):e.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(t,e){return"<"+i(e)})}catch(t){return i(e)}}function rt(t){try{return decodeURIComponent(t)}catch(t){}}function it(t){var e,n,r={};return y((t||"").split("&"),function(t){if(t&&(e=t.split("="),P(n=rt(e[0])))){var i=!P(e[1])||rt(e[1]);r[n]?q(r[n])?r[n].push(i):r[n]=[r[n],i]:r[n]=i}}),r}function ot(t){var e=[];return y(t,function(t,n){q(t)?y(t,function(t){e.push(at(n,!0)+(!0===t?"":"="+at(t,!0)))}):e.push(at(n,!0)+(!0===t?"":"="+at(t,!0)))}),e.length?e.join("&"):""}function st(t){return at(t,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function at(t,e){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,e?"%20":"+")}function ut(n,r){var i=function(){if((n=u(n)).injector()){var t=n[0]===e?"document":nt(n);throw d("btstrpd","App Already Bootstrapped with this Element '{0}'",t)}(r=r||[]).unshift(["$provide",function(t){t.value("$rootElement",n)}]),r.unshift("ng");var i=se(r);return i.invoke(["$rootScope","$rootElement","$compile","$injector","$animate",function(t,e,n,r,i){t.$apply(function(){e.data("$injector",r),n(e)(t)})}]),i},o=/^NG_DEFER_BOOTSTRAP!/;if(t&&!o.test(t.name))return i();t.name=t.name.replace(o,""),v.resumeBootstrap=function(t){y(t,function(t){r.push(t)}),i()}}f=a<9?function(t){return(t=t.nodeName?t:t[0]).scopeName&&"HTML"!=t.scopeName?s(t.scopeName+":"+t.nodeName):t.nodeName}:function(t){return t.nodeName?t.nodeName:t[0].nodeName};var ct=/[A-Z]/g;function lt(t,e){return e=e||"_",t.replace(ct,function(t,n){return(n?e:"")+t.toLowerCase()})}function ft(t,e,n){if(!t)throw d("areq","Argument '{0}' is {1}",e||"?",n||"required");return t}function ht(t,e,n){return n&&q(t)&&(t=t[t.length-1]),ft(V(t),e,"not a function, got "+(t&&"object"==typeof t?t.constructor.name||"Object":typeof t)),t}function pt(t,e){if("hasOwnProperty"===t)throw d("badname","hasOwnProperty is not a valid {0} name",e)}function $t(t,e,n){if(!e)return t;for(var r,i=e.split("."),o=t,s=i.length,a=0;a<s;a++)r=i[a],t&&(t=(o=t)[r]);return!n&&V(t)?K(o,t):t}function dt(t){var e=t[0],n=t[t.length-1];if(e===n)return u(e);var r=e,i=[r];do{if(!(r=r.nextSibling))break;i.push(r)}while(r!==n);return u(i)}var vt={full:"1.2.16",major:1,minor:2,dot:16,codeName:"badger-enumeration"};var gt=Dt.cache={},mt=Dt.expando="ng-"+(new Date).getTime(),yt=1,wt=t.document.addEventListener?function(t,e,n){t.addEventListener(e,n,!1)}:function(t,e,n){t.attachEvent("on"+e,n)},bt=t.document.removeEventListener?function(t,e,n){t.removeEventListener(e,n,!1)}:function(t,e,n){t.detachEvent("on"+e,n)};Dt._data=function(t){return this.cache[t[this.expando]]||{}};var xt=/([\:\-\_]+(.))/g,St=/^moz([A-Z])/,Ct=r("jqLite");function kt(t){return t.replace(xt,function(t,e,n,r){return r?n.toUpperCase():n}).replace(St,"Moz$1")}function Et(t,e,n,r){var i=c.fn[t];function o(t){var o,s,a,l,f,h,p,$=n&&t?[this.filter(t)]:[this],d=e;if(!r||null!=t)for(;$.length;)for(s=0,a=(o=$.shift()).length;s<a;s++)for(l=u(o[s]),d?l.triggerHandler("$destroy"):d=!d,f=0,h=(p=l.children()).length;f<h;f++)$.push(c(p[f]));return i.apply(this,arguments)}i=i.$original||i,o.$original=i,c.fn[t]=o}var At=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Ot=/<|&#?\w+;/,Tt=/<([\w:]+)/,Mt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Pt={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function jt(t){return!Ot.test(t)}function Nt(t,n){var r;return n=n||e,(r=At.exec(t))?[n.createElement(r[1])]:function(t,e){var n,r,i,o,s,a,u=e.createDocumentFragment(),c=[];if(jt(t))c.push(e.createTextNode(t));else{for(n=u.appendChild(e.createElement("div")),r=(Tt.exec(t)||["",""])[1].toLowerCase(),i=Pt[r]||Pt._default,n.innerHTML="<div>&#160;</div>"+i[1]+t.replace(Mt,"<$1></$2>")+i[2],n.removeChild(n.firstChild),o=i[0];o--;)n=n.lastChild;for(s=0,a=n.childNodes.length;s<a;++s)c.push(n.childNodes[s]);(n=u.firstChild).textContent=""}return u.textContent="",u.innerHTML="",c}(t,n)}function Dt(t){if(t instanceof Dt)return t;if(N(t)&&(t=_(t)),!(this instanceof Dt)){if(N(t)&&"<"!=t.charAt(0))throw Ct("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new Dt(t)}N(t)?(Bt(this,Nt(t)),u(e.createDocumentFragment()).append(this)):Bt(this,t)}function Rt(t){return t.cloneNode(!0)}function qt(t){It(t);for(var e=0,n=t.childNodes||[];e<n.length;e++)qt(n[e])}function Vt(t,e,n,r){if(P(r))throw Ct("offargs","jqLite#off() does not support the `selector` argument");var i=Ut(t,"events");Ut(t,"handle")&&(M(e)?y(i,function(e,n){bt(t,n,e),delete i[n]}):y(e.split(" "),function(e){M(n)?(bt(t,e,i[e]),delete i[e]):B(i[e]||[],n)}))}function It(t,e){var r=t[mt],i=gt[r];if(i){if(e)return void delete gt[r].data[e];i.handle&&(i.events.$destroy&&i.handle({},"$destroy"),Vt(t)),delete gt[r],t[mt]=n}}function Ut(t,e,n){var r=t[mt],i=gt[r||-1];if(!P(n))return i&&i[e];i||(t[mt]=r=++yt,i=gt[r]={}),i[e]=n}function Ft(t,e,n){var r=Ut(t,"data"),i=P(n),o=!i&&P(e),s=o&&!j(e);if(r||s||Ut(t,"data",r={}),i)r[e]=n;else{if(!o)return r;if(s)return r&&r[e];C(r,e)}}function _t(t,e){return!!t.getAttribute&&(" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+e+" ")>-1}function Ht(t,e){e&&t.setAttribute&&y(e.split(" "),function(e){t.setAttribute("class",_((" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+_(e)+" "," ")))})}function Lt(t,e){if(e&&t.setAttribute){var n=(" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");y(e.split(" "),function(t){t=_(t),-1===n.indexOf(" "+t+" ")&&(n+=t+" ")}),t.setAttribute("class",_(n))}}function Bt(t,e){if(e){e=e.nodeName||!P(e.length)||U(e)?[e]:e;for(var n=0;n<e.length;n++)t.push(e[n])}}function zt(t,e){return Wt(t,"$"+(e||"ngController")+"Controller")}function Wt(t,e,r){9==(t=u(t))[0].nodeType&&(t=t.find("html"));for(var i=q(e)?e:[e];t.length;){for(var o=t[0],s=0,a=i.length;s<a;s++)if((r=t.data(i[s]))!==n)return r;t=u(o.parentNode||11===o.nodeType&&o.host)}}function Qt(t){for(var e=0,n=t.childNodes;e<n.length;e++)qt(n[e]);for(;t.firstChild;)t.removeChild(t.firstChild)}Pt.optgroup=Pt.option,Pt.tbody=Pt.tfoot=Pt.colgroup=Pt.caption=Pt.thead,Pt.th=Pt.td;var Jt=Dt.prototype={ready:function(n){var r=!1;function i(){r||(r=!0,n())}"complete"===e.readyState?setTimeout(i):(this.on("DOMContentLoaded",i),Dt(t).on("load",i))},toString:function(){var t=[];return y(this,function(e){t.push(""+e)}),"["+t.join(", ")+"]"},eq:function(t){return u(t>=0?this[t]:this[this.length+t])},length:0,push:p,sort:[].sort,splice:[].splice},Xt={};y("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(t){Xt[i(t)]=t});var Gt={};function Kt(t,e){var n=Xt[e.toLowerCase()];return n&&Gt[t.nodeName]&&n}function Yt(t){var e,r=typeof t;return"object"==r&&null!==t?"function"==typeof(e=t.$$hashKey)?e=t.$$hashKey():e===n&&(e=t.$$hashKey=x()):e=t,r+":"+e}function Zt(t){y(t,this.put,this)}y("input,select,option,textarea,button,form,details".split(","),function(t){Gt[s(t)]=!0}),y({data:Ft,inheritedData:Wt,scope:function(t){return u(t).data("$scope")||Wt(t.parentNode||t,["$isolateScope","$scope"])},isolateScope:function(t){return u(t).data("$isolateScope")||u(t).data("$isolateScopeNoTemplate")},controller:zt,injector:function(t){return Wt(t,"$injector")},removeAttr:function(t,e){t.removeAttribute(e)},hasClass:_t,css:function(t,e,r){var i;if(e=kt(e),!P(r))return a<=8&&""===(i=t.currentStyle&&t.currentStyle[e])&&(i="auto"),i=i||t.style[e],a<=8&&(i=""===i?n:i),i;t.style[e]=r},attr:function(t,e,r){var o=i(e);if(Xt[o]){if(!P(r))return t[e]||(t.attributes.getNamedItem(e)||A).specified?o:n;r?(t[e]=!0,t.setAttribute(e,o)):(t[e]=!1,t.removeAttribute(o))}else if(P(r))t.setAttribute(e,r);else if(t.getAttribute){var s=t.getAttribute(e,2);return null===s?n:s}},prop:function(t,e,n){if(!P(n))return t[e];t[e]=n},text:function(){var t=[];return a<9?(t[1]="innerText",t[3]="nodeValue"):t[1]=t[3]="textContent",e.$dv="",e;function e(e,n){var r=t[e.nodeType];if(M(n))return r?e[r]:"";e[r]=n}}(),val:function(t,e){if(M(e)){if("SELECT"===f(t)&&t.multiple){var n=[];return y(t.options,function(t){t.selected&&n.push(t.value||t.text)}),0===n.length?null:n}return t.value}t.value=e},html:function(t,e){if(M(e))return t.innerHTML;for(var n=0,r=t.childNodes;n<r.length;n++)qt(r[n]);t.innerHTML=e},empty:Qt},function(t,e){Dt.prototype[e]=function(e,r){var i,o;if(t!==Qt&&(2==t.length&&t!==_t&&t!==zt?e:r)===n){if(j(e)){for(i=0;i<this.length;i++)if(t===Ft)t(this[i],e);else for(o in e)t(this[i],o,e[o]);return this}for(var s=t.$dv,a=s===n?Math.min(this.length,1):this.length,u=0;u<a;u++){var c=t(this[u],e,r);s=s?s+c:c}return s}for(i=0;i<this.length;i++)t(this[i],e,r);return this}}),y({removeData:It,dealoc:qt,on:function t(n,r,i,o){if(P(o))throw Ct("onargs","jqLite#on() does not support the `selector` or `eventData` parameters");var s=Ut(n,"events"),u=Ut(n,"handle");s||Ut(n,"events",s={}),u||Ut(n,"handle",u=function(t,n){var r=function(r,i){if(r.preventDefault||(r.preventDefault=function(){r.returnValue=!1}),r.stopPropagation||(r.stopPropagation=function(){r.cancelBubble=!0}),r.target||(r.target=r.srcElement||e),M(r.defaultPrevented)){var o=r.preventDefault;r.preventDefault=function(){r.defaultPrevented=!0,o.call(r)},r.defaultPrevented=!1}r.isDefaultPrevented=function(){return r.defaultPrevented||!1===r.returnValue},y(W(n[i||r.type]||[]),function(e){e.call(t,r)}),a<=8?(r.preventDefault=null,r.stopPropagation=null,r.isDefaultPrevented=null):(delete r.preventDefault,delete r.stopPropagation,delete r.isDefaultPrevented)};return r.elem=t,r}(n,s)),y(r.split(" "),function(r){var o=s[r];if(!o){if("mouseenter"==r||"mouseleave"==r){var a=e.body.contains||e.body.compareDocumentPosition?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1};s[r]=[];t(n,{mouseleave:"mouseout",mouseenter:"mouseover"}[r],function(t){var e=t.relatedTarget;e&&(e===this||a(this,e))||u(t,r)})}else wt(n,r,u),s[r]=[];o=s[r]}o.push(i)})},off:Vt,one:function(t,e,n){(t=u(t)).on(e,function r(){t.off(e,n),t.off(e,r)}),t.on(e,n)},replaceWith:function(t,e){var n,r=t.parentNode;qt(t),y(new Dt(e),function(e){n?r.insertBefore(e,n.nextSibling):r.replaceChild(e,t),n=e})},children:function(t){var e=[];return y(t.childNodes,function(t){1===t.nodeType&&e.push(t)}),e},contents:function(t){return t.contentDocument||t.childNodes||[]},append:function(t,e){y(new Dt(e),function(e){1!==t.nodeType&&11!==t.nodeType||t.appendChild(e)})},prepend:function(t,e){if(1===t.nodeType){var n=t.firstChild;y(new Dt(e),function(e){t.insertBefore(e,n)})}},wrap:function(t,e){e=u(e)[0];var n=t.parentNode;n&&n.replaceChild(e,t),e.appendChild(t)},remove:function(t){qt(t);var e=t.parentNode;e&&e.removeChild(t)},after:function(t,e){var n=t,r=t.parentNode;y(new Dt(e),function(t){r.insertBefore(t,n.nextSibling),n=t})},addClass:Lt,removeClass:Ht,toggleClass:function(t,e,n){e&&y(e.split(" "),function(e){var r=n;M(r)&&(r=!_t(t,e)),(r?Lt:Ht)(t,e)})},parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},next:function(t){if(t.nextElementSibling)return t.nextElementSibling;for(var e=t.nextSibling;null!=e&&1!==e.nodeType;)e=e.nextSibling;return e},find:function(t,e){return t.getElementsByTagName?t.getElementsByTagName(e):[]},clone:Rt,triggerHandler:function(t,e,n){var r=(Ut(t,"events")||{})[e];n=n||[];var i=[{preventDefault:A,stopPropagation:A}];y(r,function(e){e.apply(t,i.concat(n))})}},function(t,e){Dt.prototype[e]=function(e,n,r){for(var i,o=0;o<this.length;o++)M(i)?P(i=t(this[o],e,n,r))&&(i=u(i)):Bt(i,t(this[o],e,n,r));return P(i)?i:this},Dt.prototype.bind=Dt.prototype.on,Dt.prototype.unbind=Dt.prototype.off}),Zt.prototype={put:function(t,e){this[Yt(t)]=e},get:function(t){return this[Yt(t)]},remove:function(t){var e=this[t=Yt(t)];return delete this[t],e}};var te=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,ee=/,/,ne=/^\s*(_?)(\S+?)\1\s*$/,re=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,ie=r("$injector");function oe(t){var e,n;return"function"==typeof t?(e=t.$inject)||(e=[],t.length&&y(t.toString().replace(re,"").match(te)[1].split(ee),function(t){t.replace(ne,function(t,n,r){e.push(r)})}),t.$inject=e):q(t)?(ht(t[n=t.length-1],"fn"),e=t.slice(0,n)):ht(t,"fn",!0),e}function se(t){var e={},n="Provider",r=[],i=new Zt,o={$provide:{provider:c(f),factory:c(h),service:c(function(t,e){return h(t,["$injector",function(t){return t.instantiate(e)}])}),value:c(function(t,e){return h(t,T(e))}),constant:c(function(t,e){pt(t,"constant"),o[t]=e,a[t]=e}),decorator:function(t,e){var r=s.get(t+n),i=r.$get;r.$get=function(){var t=u.invoke(i,r);return u.invoke(e,null,{$delegate:t})}}}},s=o.$injector=p(o,function(){throw ie("unpr","Unknown provider: {0}",r.join(" <- "))}),a={},u=a.$injector=p(a,function(t){var e=s.get(t+n);return u.invoke(e.$get,e)});return y(function t(e){var n,r,o,a,u=[];y(e,function(e){if(!i.get(e)){i.put(e,!0);try{if(N(e))for(n=l(e),u=u.concat(t(n.requires)).concat(n._runBlocks),r=n._invokeQueue,o=0,a=r.length;o<a;o++){var c=r[o],f=s.get(c[0]);f[c[1]].apply(f,c[2])}else V(e)?u.push(s.invoke(e)):q(e)?u.push(s.invoke(e)):ht(e,"module")}catch(t){throw q(e)&&(e=e[e.length-1]),t.message&&t.stack&&-1==t.stack.indexOf(t.message)&&(t=t.message+"\n"+t.stack),ie("modulerr","Failed to instantiate module {0} due to:\n{1}",e,t.stack||t.message||t)}}});return u}(t),function(t){u.invoke(t||A)}),u;function c(t){return function(e,n){if(!j(e))return t(e,n);y(e,b(t))}}function f(t,e){if(pt(t,"service"),(V(e)||q(e))&&(e=s.instantiate(e)),!e.$get)throw ie("pget","Provider '{0}' must define $get factory method.",t);return o[t+n]=e}function h(t,e){return f(t,{$get:e})}function p(t,i){function s(n){if(t.hasOwnProperty(n)){if(t[n]===e)throw ie("cdep","Circular dependency found: {0}",r.join(" <- "));return t[n]}try{return r.unshift(n),t[n]=e,t[n]=i(n)}catch(r){throw t[n]===e&&delete t[n],r}finally{r.shift()}}function a(t,e,n){var r,i,o,a=[],u=oe(t);for(i=0,r=u.length;i<r;i++){if("string"!=typeof(o=u[i]))throw ie("itkn","Incorrect injection token! Expected service name as string, got {0}",o);a.push(n&&n.hasOwnProperty(o)?n[o]:s(o))}return t.$inject||(t=t[r]),t.apply(e,a)}return{invoke:a,instantiate:function(t,e){var n,r,i=function(){};return i.prototype=(q(t)?t[t.length-1]:t).prototype,j(r=a(t,n=new i,e))||V(r)?r:n},get:s,annotate:oe,has:function(e){return o.hasOwnProperty(e+n)||t.hasOwnProperty(e)}}}}function ae(){var t=!0;this.disableAutoScrolling=function(){t=!1},this.$get=["$window","$location","$rootScope",function(e,n,r){var o=e.document;function s(){var t,r,s,a=n.hash();a?(t=o.getElementById(a))?t.scrollIntoView():(r=o.getElementsByName(a),s=null,y(r,function(t){s||"a"!==i(t.nodeName)||(s=t)}),(t=s)?t.scrollIntoView():"top"===a&&e.scrollTo(0,0)):e.scrollTo(0,0)}return t&&r.$watch(function(){return n.hash()},function(){r.$evalAsync(s)}),s}]}var ue=r("$animate"),ce=["$provide",function(t){this.$$selectors={},this.register=function(e,n){var r=e+"-animation";if(e&&"."!=e.charAt(0))throw ue("notcsel","Expecting class selector starting with '.' got '{0}'.",e);this.$$selectors[e.substr(1)]=r,t.factory(r,n)},this.classNameFilter=function(t){return 1===arguments.length&&(this.$$classNameFilter=t instanceof RegExp?t:null),this.$$classNameFilter},this.$get=["$timeout","$$asyncCallback",function(t,e){function n(t){t&&e(t)}return{enter:function(t,e,r,i){r?r.after(t):(e&&e[0]||(e=r.parent()),e.append(t)),n(i)},leave:function(t,e){t.remove(),n(e)},move:function(t,e,n,r){this.enter(t,e,n,r)},addClass:function(t,e,r){e=N(e)?e:q(e)?e.join(" "):"",y(t,function(t){Lt(t,e)}),n(r)},removeClass:function(t,e,r){e=N(e)?e:q(e)?e.join(" "):"",y(t,function(t){Ht(t,e)}),n(r)},setClass:function(t,e,r,i){y(t,function(t){Lt(t,e),Ht(t,r)}),n(i)},enabled:A}}]}];function le(){this.$get=["$$rAF","$timeout",function(t,e){return t.supported?function(e){return t(e)}:function(t){return e(t,0,!1)}}]}function fe(t,e,r,i){var o=this,s=e[0],a=t.location,c=t.history,l=t.setTimeout,f=t.clearTimeout,h={};o.isMock=!1;var p=0,$=[];function d(t){try{t.apply(null,G(arguments,1))}finally{if(0===--p)for(;$.length;)try{$.pop()()}catch(t){r.error(t)}}}o.$$completeOutstandingRequest=d,o.$$incOutstandingRequestCount=function(){p++},o.notifyWhenNoOutstandingRequests=function(t){y(g,function(t){t()}),0===p?t():$.push(t)};var v,g=[];o.addPollFn=function(t){return M(v)&&function(t,e){!function n(){y(g,function(t){t()}),v=e(n,t)}()}(100,l),g.push(t),t};var m=a.href,w=e.find("base"),b=null;o.url=function(e,n){if(a!==t.location&&(a=t.location),c!==t.history&&(c=t.history),e){if(m==e)return;return m=e,i.history?n?c.replaceState(null,"",e):(c.pushState(null,"",e),w.attr("href",w.attr("href"))):(b=e,n?a.replace(e):a.href=e),o}return b||a.href.replace(/%27/g,"'")};var x=[],S=!1;function C(){b=null,m!=o.url()&&(m=o.url(),y(x,function(t){t(o.url())}))}o.onUrlChange=function(e){return S||(i.history&&u(t).on("popstate",C),i.hashchange?u(t).on("hashchange",C):o.addPollFn(C),S=!0),x.push(e),e},o.baseHref=function(){var t=w.attr("href");return t?t.replace(/^(https?\:)?\/\/[^\/]*/,""):""};var k={},E="",O=o.baseHref();o.cookies=function(t,e){var i,o,a,u,c;if(!t){if(s.cookie!==E)for(o=(E=s.cookie).split("; "),k={},u=0;u<o.length;u++)(c=(a=o[u]).indexOf("="))>0&&(t=unescape(a.substring(0,c)),k[t]===n&&(k[t]=unescape(a.substring(c+1))));return k}e===n?s.cookie=escape(t)+"=;path="+O+";expires=Thu, 01 Jan 1970 00:00:00 GMT":N(e)&&(i=(s.cookie=escape(t)+"="+escape(e)+";path="+O).length+1)>4096&&r.warn("Cookie '"+t+"' possibly not set or overflowed because it was too large ("+i+" > 4096 bytes)!")},o.defer=function(t,e){var n;return p++,n=l(function(){delete h[n],d(t)},e||0),h[n]=!0,n},o.defer.cancel=function(t){return!!h[t]&&(delete h[t],f(t),d(A),!0)}}function he(){this.$get=["$window","$log","$sniffer","$document",function(t,e,n,r){return new fe(t,r,e,n)}]}function pe(){this.$get=function(){var t={};function e(e,n){if(e in t)throw r("$cacheFactory")("iid","CacheId '{0}' is already taken!",e);var i=0,o=C({},n,{id:e}),s={},a=n&&n.capacity||Number.MAX_VALUE,u={},c=null,l=null;return t[e]={put:function(t,e){a<Number.MAX_VALUE&&f(u[t]||(u[t]={key:t}));if(!M(e))return t in s||i++,s[t]=e,i>a&&this.remove(l.key),e},get:function(t){if(a<Number.MAX_VALUE){var e=u[t];if(!e)return;f(e)}return s[t]},remove:function(t){if(a<Number.MAX_VALUE){var e=u[t];if(!e)return;e==c&&(c=e.p),e==l&&(l=e.n),h(e.n,e.p),delete u[t]}delete s[t],i--},removeAll:function(){s={},i=0,u={},c=l=null},destroy:function(){s=null,o=null,u=null,delete t[e]},info:function(){return C({},o,{size:i})}};function f(t){t!=c&&(l?l==t&&(l=t.n):l=t,h(t.n,t.p),h(t,c),(c=t).n=null)}function h(t,e){t!=e&&(t&&(t.p=e),e&&(e.n=t))}}return e.info=function(){var e={};return y(t,function(t,n){e[n]=t.info()}),e},e.get=function(e){return t[e]},e}}function $e(){this.$get=["$cacheFactory",function(t){return t("templates")}]}var de=r("$compile");function ve(t,r){var i={},o="Directive",s=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,c=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,l=/^(on[a-z]+|formaction)$/;this.directive=function e(n,r){return pt(n,"directive"),N(n)?(ft(r,"directiveFactory"),i.hasOwnProperty(n)||(i[n]=[],t.factory(n+o,["$injector","$exceptionHandler",function(t,e){var r=[];return y(i[n],function(i,o){try{var s=t.invoke(i);V(s)?s={compile:T(s)}:!s.compile&&s.link&&(s.compile=T(s.link)),s.priority=s.priority||0,s.index=o,s.name=s.name||n,s.require=s.require||s.controller&&s.name,s.restrict=s.restrict||"A",r.push(s)}catch(t){e(t)}}),r}])),i[n].push(r)):y(n,b(e)),this},this.aHrefSanitizationWhitelist=function(t){return P(t)?(r.aHrefSanitizationWhitelist(t),this):r.aHrefSanitizationWhitelist()},this.imgSrcSanitizationWhitelist=function(t){return P(t)?(r.imgSrcSanitizationWhitelist(t),this):r.imgSrcSanitizationWhitelist()},this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(t,r,h,p,$,d,v,g,m,w,b,x){var S=function(t,e){this.$$element=t,this.$attr=e||{}};S.prototype={$normalize:me,$addClass:function(t){t&&t.length>0&&b.addClass(this.$$element,t)},$removeClass:function(t){t&&t.length>0&&b.removeClass(this.$$element,t)},$updateClass:function(t,e){var n=ye(t,e),r=ye(e,t);0===n.length?b.removeClass(this.$$element,r):0===r.length?b.addClass(this.$$element,n):b.setClass(this.$$element,n,r)},$set:function(t,e,r,i){var o,s=Kt(this.$$element[0],t);s&&(this.$$element.prop(t,e),i=s),this[t]=e,i?this.$attr[t]=i:(i=this.$attr[t])||(this.$attr[t]=i=lt(t,"-")),("A"===(o=f(this.$$element))&&"href"===t||"IMG"===o&&"src"===t)&&(this[t]=e=x(e,"src"===t)),!1!==r&&(null===e||e===n?this.$$element.removeAttr(i):this.$$element.attr(i,e));var a=this.$$observers;a&&y(a[t],function(t){try{t(e)}catch(t){h(t)}})},$observe:function(t,e){var n=this,r=n.$$observers||(n.$$observers={}),i=r[t]||(r[t]=[]);return i.push(e),g.$evalAsync(function(){i.$$inter||e(n[t])}),e}};var k=r.startSymbol(),A=r.endSymbol(),M="{{"==k||"}}"==A?O:function(t){return t.replace(/\{\{/g,k).replace(/}}/g,A)},P=/^ngAttr[A-Z]/;return D;function D(t,e,n,r,i){t instanceof u||(t=u(t)),y(t,function(e,n){3==e.nodeType&&e.nodeValue.match(/\S+/)&&(t[n]=e=u(e).wrap("<span></span>").parent()[0])});var o=I(t,e,t,n,r,i);return R(t,"ng-scope"),function(e,n,r){ft(e,"scope");var i=n?Jt.clone.call(t):t;y(r,function(t,e){i.data("$"+e+"Controller",t)});for(var s=0,a=i.length;s<a;s++){var u=i[s].nodeType;1!==u&&9!==u||i.eq(s).data("$scope",e)}return n&&n(i,e),o&&o(e,i,i),i}}function R(t,e){try{t.addClass(e)}catch(t){}}function I(t,e,r,i,o,s){for(var a,c,l,f,h,p,$=[],d=0;d<t.length;d++)a=new S,(l=(c=F(t[d],[],a,0===d?i:n,o)).length?B(c,t[d],a,e,r,null,[],[],s):null)&&l.scope&&R(u(t[d]),"ng-scope"),h=l&&l.terminal||!(f=t[d].childNodes)||!f.length?null:I(f,l?l.transclude:e),$.push(l,h),p=p||l||h,s=null;return p?function(t,r,i,o){var s,a,c,l,f,h,p,d,v,g=r.length,m=new Array(g);for(p=0;p<g;p++)m[p]=r[p];for(p=0,v=0,d=$.length;p<d;v++)c=m[v],s=$[p++],a=$[p++],l=u(c),s?(s.scope?(f=t.$new(),l.data("$scope",f)):f=t,h=s.transclude,s(a,f,c,i,h||!o&&e?U(t,h||e):o)):a&&a(t,c.childNodes,n,o)}:null}function U(t,e){return function(n,r,i){var o=!1;n||((n=t.$new()).$$transcluded=!0,o=!0);var s=e(n,r,i);return o&&s.on("$destroy",K(n,n.$destroy)),s}}function F(t,e,n,i,o){var u,l,h=t.nodeType,p=n.$attr;switch(h){case 1:J(e,me(f(t).toLowerCase()),"E",i,o);for(var $,d,v,g,m,y=t.attributes,w=0,b=y&&y.length;w<b;w++){var x=!1,S=!1;if($=y[w],!a||a>=8||$.specified)g=me(d=$.name),P.test(g)&&(d=lt(g.substr(6),"-")),g===g.replace(/(Start|End)$/,"")+"Start"&&(x=d,S=d.substr(0,d.length-5)+"end",d=d.substr(0,d.length-6)),p[v=me(d.toLowerCase())]=d,n[v]=m=_($.value),Kt(t,v)&&(n[v]=!0),et(t,e,m,v),J(e,v,"A",i,o,x,S)}if(N(l=t.className)&&""!==l)for(;u=c.exec(l);)J(e,v=me(u[2]),"C",i,o)&&(n[v]=_(u[3])),l=l.substr(u.index+u[0].length);break;case 3:!function(t,e){var n=r(e,!0);n&&t.push({priority:0,compile:T(function(t,e){var r=e.parent(),i=r.data("$binding")||[];i.push(n),R(r.data("$binding",i),"ng-binding"),t.$watch(n,function(t){e[0].nodeValue=t})})})}(e,t.nodeValue);break;case 8:try{(u=s.exec(t.nodeValue))&&J(e,v=me(u[1]),"M",i,o)&&(n[v]=_(u[2]))}catch(t){}}return e.sort(Z),e}function H(t,e,n){var r=[],i=0;if(e&&t.hasAttribute&&t.hasAttribute(e)){do{if(!t)throw de("uterdir","Unterminated attribute, found '{0}' but no matching '{1}' found.",e,n);1==t.nodeType&&(t.hasAttribute(e)&&i++,t.hasAttribute(n)&&i--),r.push(t),t=t.nextSibling}while(i>0)}else r.push(t);return u(r)}function L(t,e,n){return function(r,i,o,s,a){return i=H(i[0],e,n),t(r,i,o,s,a)}}function B(t,i,o,s,a,c,l,f,p){p=p||{};for(var $,g,m,w,b,x,C=-Number.MAX_VALUE,k=p.controllerDirectives,E=p.newIsolateScopeDirective,A=p.templateDirective,O=p.nonTlbTranscludeDirective,T=!1,P=p.hasElementTranscludeDirective,I=o.$$element=u(i),U=c,_=s,B=0,J=t.length;B<J;B++){var K=(g=t[B]).$$start,Z=g.$$end;if(K&&(I=H(i,K,Z)),w=n,C>g.priority)break;if((x=g.scope)&&($=$||g,g.templateUrl||(tt("new/isolated scope",E,g,I),j(x)&&(E=g))),m=g.name,!g.templateUrl&&g.controller&&(x=g.controller,tt("'"+m+"' controller",(k=k||{})[m],g,I),k[m]=g),(x=g.transclude)&&(T=!0,g.$$tlb||(tt("transclusion",O,g,I),O=g),"element"==x?(P=!0,C=g.priority,w=H(i,K,Z),I=o.$$element=u(e.createComment(" "+m+": "+o[m]+" ")),i=I[0],rt(a,u(G(w)),i),_=D(w,s,C,U&&U.name,{nonTlbTranscludeDirective:O})):(w=u(Rt(i)).contents(),I.empty(),_=D(w,s))),g.template)if(tt("template",A,g,I),A=g,x=V(g.template)?g.template(I,o):g.template,x=M(x),g.replace){if(U=g,w=jt(x)?[]:u(x),i=w[0],1!=w.length||1!==i.nodeType)throw de("tplrt","Template for directive '{0}' must have exactly one root element. {1}",m,"");rt(a,I,i);var et={$attr:{}},ot=F(i,[],et),st=t.splice(B+1,t.length-(B+1));E&&z(ot),t=t.concat(ot).concat(st),X(o,et),J=t.length}else I.html(x);if(g.templateUrl)tt("template",A,g,I),A=g,g.replace&&(U=g),ct=Y(t.splice(B,t.length-B),I,o,a,_,l,f,{controllerDirectives:k,newIsolateScopeDirective:E,templateDirective:A,nonTlbTranscludeDirective:O}),J=t.length;else if(g.compile)try{V(b=g.compile(I,o,_))?at(null,b,K,Z):b&&at(b.pre,b.post,K,Z)}catch(t){h(t,nt(I))}g.terminal&&(ct.terminal=!0,C=Math.max(C,g.priority))}return ct.scope=$&&!0===$.scope,ct.transclude=T&&_,p.hasElementTranscludeDirective=P,ct;function at(t,e,n,r){t&&(n&&(t=L(t,n,r)),t.require=g.require,(E===g||g.$$isolateScope)&&(t=it(t,{isolateScope:!0})),l.push(t)),e&&(n&&(e=L(e,n,r)),e.require=g.require,(E===g||g.$$isolateScope)&&(e=it(e,{isolateScope:!0})),f.push(e))}function ut(t,e,n){var r,i="data",o=!1;if(N(t)){for(;"^"==(r=t.charAt(0))||"?"==r;)t=t.substr(1),"^"==r&&(i="inheritedData"),o=o||"?"==r;if(r=null,n&&"data"===i&&(r=n[t]),!(r=r||e[i]("$"+t+"Controller"))&&!o)throw de("ctreq","Controller '{0}', required by directive '{1}', can't be found!",t,m);return r}return q(t)&&(r=[],y(t,function(t){r.push(ut(t,e,n))})),r}function ct(t,e,s,a,c){var p,$,g,m,w,b,x,C,O={};if(p=i===s?o:W(o,new S(u(s),o.$attr)),$=p.$$element,E){var T=/^\s*([@=&])(\??)\s*(\w*)\s*$/,M=u(s);x=e.$new(!0),A&&A===E.$$originalDirective?M.data("$isolateScope",x):M.data("$isolateScopeNoTemplate",x),R(M,"ng-isolate-scope"),y(E.scope,function(t,n){var i,o,s,a,u=t.match(T)||[],c=u[3]||n,l="?"==u[2],f=u[1];switch(x.$$isolateBindings[n]=f+c,f){case"@":p.$observe(c,function(t){x[n]=t}),p.$$observers[c].$$scope=e,p[c]&&(x[n]=r(p[c])(e));break;case"=":if(l&&!p[c])return;o=d(p[c]),a=o.literal?Q:function(t,e){return t===e},s=o.assign||function(){throw i=x[n]=o(e),de("nonassign","Expression '{0}' used with directive '{1}' is non-assignable!",p[c],E.name)},i=x[n]=o(e),x.$watch(function(){var t=o(e);return a(t,x[n])||(a(t,i)?s(e,t=x[n]):x[n]=t),i=t},null,o.literal);break;case"&":o=d(p[c]),x[n]=function(t){return o(e,t)};break;default:throw de("iscp","Invalid isolate scope definition for directive '{0}'. Definition: {... {1}: '{2}' ...}",E.name,n,t)}})}for(C=c&&function(t,e){var r;arguments.length<2&&(e=t,t=n);P&&(r=O);return c(t,e,r)},k&&y(k,function(t){var n,r={$scope:t===E||t.$$isolateScope?x:e,$element:$,$attrs:p,$transclude:C};"@"==(b=t.controller)&&(b=p[t.name]),n=v(b,r),O[t.name]=n,P||$.data("$"+t.name+"Controller",n),t.controllerAs&&(r.$scope[t.controllerAs]=n)}),g=0,m=l.length;g<m;g++)try{(w=l[g])(w.isolateScope?x:e,$,p,w.require&&ut(w.require,$,O),C)}catch(t){h(t,nt($))}var j=e;for(E&&(E.template||null===E.templateUrl)&&(j=x),t&&t(j,s.childNodes,n,c),g=f.length-1;g>=0;g--)try{(w=f[g])(w.isolateScope?x:e,$,p,w.require&&ut(w.require,$,O),C)}catch(t){h(t,nt($))}}}function z(t){for(var e=0,n=t.length;e<n;e++)t[e]=E(t[e],{$$isolateScope:!0})}function J(e,r,s,a,u,c,l){if(r===u)return null;var f=null;if(i.hasOwnProperty(r))for(var p,$=t.get(r+o),d=0,v=$.length;d<v;d++)try{p=$[d],(a===n||a>p.priority)&&-1!=p.restrict.indexOf(s)&&(c&&(p=E(p,{$$start:c,$$end:l})),e.push(p),f=p)}catch(t){h(t)}return f}function X(t,e){var n=e.$attr,r=t.$attr,i=t.$$element;y(t,function(r,i){"$"!=i.charAt(0)&&(e[i]&&(r+=("style"===i?";":" ")+e[i]),t.$set(i,r,!0,n[i]))}),y(e,function(e,o){"class"==o?(R(i,e),t.class=(t.class?t.class+" ":"")+e):"style"==o?(i.attr("style",i.attr("style")+";"+e),t.style=(t.style?t.style+";":"")+e):"$"==o.charAt(0)||t.hasOwnProperty(o)||(t[o]=e,r[o]=n[o])})}function Y(t,e,n,r,i,o,s,a){var c,l,f=[],h=e[0],d=t.shift(),v=C({},d,{templateUrl:null,transclude:null,replace:null,$$originalDirective:d}),g=V(d.templateUrl)?d.templateUrl(e,n):d.templateUrl;return e.empty(),p.get(w.getTrustedResourceUrl(g),{cache:$}).success(function(p){var $,m,w,b;if(p=M(p),d.replace){if(w=jt(p)?[]:u(p),$=w[0],1!=w.length||1!==$.nodeType)throw de("tplrt","Template for directive '{0}' must have exactly one root element. {1}",d.name,g);m={$attr:{}},rt(r,e,$);var x=F($,[],m);j(d.scope)&&z(x),t=x.concat(t),X(n,m)}else $=h,e.html(p);for(t.unshift(v),c=B(t,$,n,i,e,d,o,s,a),y(r,function(t,n){t==$&&(r[n]=e[0])}),l=I(e[0].childNodes,i);f.length;){var S=f.shift(),C=f.shift(),k=f.shift(),E=f.shift(),A=e[0];if(C!==h){var O=C.className;a.hasElementTranscludeDirective&&d.replace||(A=Rt($)),rt(k,u(C),A),R(u(A),O)}b=c.transclude?U(S,c.transclude):E,c(l,S,A,r,b)}f=null}).error(function(t,e,n,r){throw de("tpload","Failed to load template: {0}",r.url)}),function(t,e,n,r,i){f?(f.push(e),f.push(n),f.push(r),f.push(i)):c(l,e,n,r,i)}}function Z(t,e){var n=e.priority-t.priority;return 0!==n?n:t.name!==e.name?t.name<e.name?-1:1:t.index-e.index}function tt(t,e,n,r){if(e)throw de("multidir","Multiple directives [{0}, {1}] asking for {2} on: {3}",e.name,n.name,t,nt(r))}function et(t,e,n,i){var o=r(n,!0);if(o){if("multiple"===i&&"SELECT"===f(t))throw de("selmulti","Binding to the 'multiple' attribute is not supported. Element: {0}",nt(t));e.push({priority:100,compile:function(){return{pre:function(e,n,s){var a=s.$$observers||(s.$$observers={});if(l.test(i))throw de("nodomevents","Interpolations for HTML DOM event attributes are disallowed.  Please use the ng- versions (such as ng-click instead of onclick) instead.");(o=r(s[i],!0,function(t,e){if("srcdoc"==e)return w.HTML;var n=f(t);return"xlinkHref"==e||"FORM"==n&&"action"==e||"IMG"!=n&&("src"==e||"ngSrc"==e)?w.RESOURCE_URL:void 0}(t,i)))&&(s[i]=o(e),(a[i]||(a[i]=[])).$$inter=!0,(s.$$observers&&s.$$observers[i].$$scope||e).$watch(o,function(t,e){"class"===i&&t!=e?s.$updateClass(t,e):s.$set(i,t)}))}}}})}}function rt(t,n,r){var i,o,s=n[0],a=n.length,c=s.parentNode;if(t)for(i=0,o=t.length;i<o;i++)if(t[i]==s){t[i++]=r;for(var l=i,f=l+a-1,h=t.length;l<h;l++,f++)f<h?t[l]=t[f]:delete t[l];t.length-=a-1;break}c&&c.replaceChild(r,s);var p=e.createDocumentFragment();p.appendChild(s),r[u.expando]=s[u.expando];for(var $=1,d=n.length;$<d;$++){var v=n[$];u(v).remove(),p.appendChild(v),delete n[$]}n[0]=r,n.length=1}function it(t,e){return C(function(){return t.apply(null,arguments)},t,e)}}]}ve.$inject=["$provide","$$sanitizeUriProvider"];var ge=/^(x[\:\-_]|data[\:\-_])/i;function me(t){return kt(t.replace(ge,""))}function ye(t,e){var n="",r=t.split(/\s+/),i=e.split(/\s+/);t:for(var o=0;o<r.length;o++){for(var s=r[o],a=0;a<i.length;a++)if(s==i[a])continue t;n+=(n.length>0?" ":"")+s}return n}function we(){var t={},e=/^(\S+)(\s+as\s+(\w+))?$/;this.register=function(e,n){pt(e,"controller"),j(e)?C(t,e):t[e]=n},this.$get=["$injector","$window",function(n,i){return function(o,s){var a,u,c,l;if(N(o)&&(c=(u=o.match(e))[1],l=u[3],ht(o=t.hasOwnProperty(c)?t[c]:$t(s.$scope,c,!0)||$t(i,c,!0),c,!0)),a=n.instantiate(o,s),l){if(!s||"object"!=typeof s.$scope)throw r("$controller")("noscp","Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",c||o.name,l);s.$scope[l]=a}return a}}]}function be(){this.$get=["$window",function(t){return u(t.document)}]}function xe(){this.$get=["$log",function(t){return function(e,n){t.error.apply(t,arguments)}}]}function Se(t){var e,n,r,o={};return t?(y(t.split("\n"),function(t){r=t.indexOf(":"),e=i(_(t.substr(0,r))),n=_(t.substr(r+1)),e&&(o[e]?o[e]+=", "+n:o[e]=n)}),o):o}function Ce(t){var e=j(t)?t:n;return function(n){return e||(e=Se(t)),n?e[i(n)]||null:e}}function ke(t,e,n){return V(n)?n(t,e):(y(n,function(n){t=n(t,e)}),t)}function Ee(t){return 200<=t&&t<300}function Ae(){var t=/^\s*(\[|\{[^\{])/,e=/[\}\]]\s*$/,r=/^\)\]\}',?\n/,o={"Content-Type":"application/json;charset=utf-8"},a=this.defaults={transformResponse:[function(n){return N(n)&&(n=n.replace(r,""),t.test(n)&&e.test(n)&&(n=tt(n))),n}],transformRequest:[function(t){return j(t)&&(e=t,"[object File]"!==$.call(e))&&!function(t){return"[object Blob]"===$.call(t)}(t)?Z(t):t;var e}],headers:{common:{Accept:"application/json, text/plain, */*"},post:z(o),put:z(o),patch:z(o)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"},u=this.interceptors=[],c=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(t,e,r,o,l,f){var h=r("$http"),p=[];function $(r){var u={method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse},c=function(t){var e,n,r,o=a.headers,s=C({},t.headers);u(o=C({},o.common,o[i(t.method)])),u(s);t:for(e in o){for(r in n=i(e),s)if(i(r)===n)continue t;s[e]=o[e]}return s;function u(t){var e;y(t,function(n,r){V(n)&&(null!=(e=n())?t[r]=e:delete t[r])})}}(r);C(u,r),u.headers=c,u.method=s(u.method);var f=kn(u.url)?e.cookies()[u.xsrfCookieName||a.xsrfCookieName]:n;f&&(c[u.xsrfHeaderName||a.xsrfHeaderName]=f);var d=[function(e){c=e.headers;var n=ke(e.data,Ce(c),e.transformRequest);return M(e.data)&&y(c,function(t,e){"content-type"===i(e)&&delete c[e]}),M(e.withCredentials)&&!M(a.withCredentials)&&(e.withCredentials=a.withCredentials),function(e,n,r){var i,s,u=l.defer(),c=u.promise,f=function(t,e){if(!e)return t;var n=[];return function(t,e,n){for(var r=w(t),i=0;i<r.length;i++)e.call(n,t[r[i]],r[i])}(e,function(t,e){null===t||M(t)||(q(t)||(t=[t]),y(t,function(t){j(t)&&(t=Z(t)),n.push(at(e)+"="+at(t))}))}),n.length>0&&(t+=(-1==t.indexOf("?")?"?":"&")+n.join("&")),t}(e.url,e.params);if($.pendingRequests.push(e),c.then(d,d),(e.cache||a.cache)&&!1!==e.cache&&"GET"==e.method&&(i=j(e.cache)?e.cache:j(a.cache)?a.cache:h),i)if(P(s=i.get(f))){if(s.then)return s.then(d,d),s;q(s)?p(s[1],s[0],z(s[2]),s[3]):p(s,200,{},"OK")}else i.put(f,c);return M(s)&&t(e.method,f,n,function(t,e,n,r){i&&(Ee(t)?i.put(f,[t,e,Se(n),r]):i.remove(f)),p(e,t,n,r),o.$$phase||o.$apply()},r,e.timeout,e.withCredentials,e.responseType),c;function p(t,n,r,i){(Ee(n=Math.max(n,0))?u.resolve:u.reject)({data:t,status:n,headers:Ce(r),config:e,statusText:i})}function d(){var t=L($.pendingRequests,e);-1!==t&&$.pendingRequests.splice(t,1)}}(e,n,c).then(b,b)},n],v=l.when(u);for(y(p,function(t){(t.request||t.requestError)&&d.unshift(t.request,t.requestError),(t.response||t.responseError)&&d.push(t.response,t.responseError)});d.length;){var g=d.shift(),m=d.shift();v=v.then(g,m)}return v.success=function(t){return v.then(function(e){t(e.data,e.status,e.headers,u)}),v},v.error=function(t){return v.then(null,function(e){t(e.data,e.status,e.headers,u)}),v},v;function b(t){var e=C({},t,{data:ke(t.data,t.headers,u.transformResponse)});return Ee(t.status)?e:l.reject(e)}}return y(u,function(t){p.unshift(N(t)?f.get(t):f.invoke(t))}),y(c,function(t,e){var n=N(t)?f.get(t):f.invoke(t);p.splice(e,0,{response:function(t){return n(l.when(t))},responseError:function(t){return n(l.reject(t))}})}),$.pendingRequests=[],function(t){y(arguments,function(t){$[t]=function(e,n){return $(C(n||{},{method:t,url:e}))}})}("get","delete","head","jsonp"),function(t){y(arguments,function(t){$[t]=function(e,n,r){return $(C(r||{},{method:t,url:e,data:n}))}})}("post","put"),$.defaults=a,$}]}function Oe(e){if(a<=8&&(!e.match(/^(get|post|head|put|delete|options)$/i)||!t.XMLHttpRequest))return new t.ActiveXObject("Microsoft.XMLHTTP");if(t.XMLHttpRequest)return new t.XMLHttpRequest;throw r("$httpBackend")("noxhr","This browser does not support XMLHttpRequest.")}function Te(){this.$get=["$browser","$window","$document",function(t,e,n){return function(t,e,n,r,o){var s=-1;return function(u,c,l,f,h,p,$,d){var g;if(t.$$incOutstandingRequestCount(),c=c||t.url(),"jsonp"==i(u)){var m="_"+(r.counter++).toString(36);r[m]=function(t){r[m].data=t};var w=function(t,e){var n=o.createElement("script"),r=function(){n.onreadystatechange=n.onload=n.onerror=null,o.body.removeChild(n),e&&e()};n.type="text/javascript",n.src=t,a&&a<=8?n.onreadystatechange=function(){/loaded|complete/.test(n.readyState)&&r()}:n.onload=n.onerror=function(){r()};return o.body.appendChild(n),r}(c.replace("JSON_CALLBACK","angular.callbacks."+m),function(){r[m].data?C(f,200,r[m].data):C(f,g||-2),r[m]=v.noop})}else{var b=e(u);if(b.open(u,c,!0),y(h,function(t,e){P(t)&&b.setRequestHeader(e,t)}),b.onreadystatechange=function(){if(b&&4==b.readyState){var t=null,e=null;g!==s&&(t=b.getAllResponseHeaders(),e="response"in b?b.response:b.responseText),C(f,g||b.status,e,t,b.statusText||"")}},$&&(b.withCredentials=!0),d)try{b.responseType=d}catch(t){if("json"!==d)throw t}b.send(l||null)}if(p>0)var x=n(S,p);else p&&p.then&&p.then(S);function S(){g=s,w&&w(),b&&b.abort()}function C(e,r,i,o,s){x&&n.cancel(x),w=b=null,0===r&&(r=i?200:"file"==Cn(c).protocol?404:0),e(r=1223===r?204:r,i,o,s=s||""),t.$$completeOutstandingRequest(A)}}}(t,Oe,t.defer,e.angular.callbacks,n[0])}]}var Me=r("$interpolate");function Pe(){var t="{{",e="}}";this.startSymbol=function(e){return e?(t=e,this):t},this.endSymbol=function(t){return t?(e=t,this):e},this.$get=["$parse","$exceptionHandler","$sce",function(n,r,i){var o=t.length,s=e.length;function a(a,u,c){for(var l,f,h,p,$=0,d=[],v=a.length,g=!1,m=[];$<v;)-1!=(l=a.indexOf(t,$))&&-1!=(f=a.indexOf(e,l+o))?($!=l&&d.push(a.substring($,l)),d.push(h=n(p=a.substring(l+o,f))),h.exp=p,$=f+s,g=!0):($!=v&&d.push(a.substring($)),$=v);if((v=d.length)||(d.push(""),v=1),c&&d.length>1)throw Me("noconcat","Error while interpolating: {0}\nStrict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required.  See http://docs.angularjs.org/api/ng.$sce",a);if(!u||g)return m.length=v,(h=function(t){try{for(var e,n=0,o=v;n<o;n++)"function"==typeof(e=d[n])&&(e=e(t),null===(e=c?i.getTrusted(c,e):i.valueOf(e))||M(e)?e="":"string"!=typeof e&&(e=Z(e))),m[n]=e;return m.join("")}catch(t){var s=Me("interr","Can't interpolate: {0}\n{1}",a,t.toString());r(s)}}).exp=a,h.parts=d,h}return a.startSymbol=function(){return t},a.endSymbol=function(){return e},a}]}function je(){this.$get=["$rootScope","$window","$q",function(t,e,n){var r={};function i(i,o,s,a){var u=e.setInterval,c=e.clearInterval,l=n.defer(),f=l.promise,h=0,p=P(a)&&!a;return s=P(s)?s:0,f.then(null,null,i),f.$$intervalId=u(function(){l.notify(h++),s>0&&h>=s&&(l.resolve(h),c(f.$$intervalId),delete r[f.$$intervalId]),p||t.$apply()},o),r[f.$$intervalId]=l,f}return i.cancel=function(t){return!!(t&&t.$$intervalId in r)&&(r[t.$$intervalId].reject("canceled"),clearInterval(t.$$intervalId),delete r[t.$$intervalId],!0)},i}]}function Ne(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"¤",posSuf:"",negPre:"(¤",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a",short:"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(t){return 1===t?"one":"other"}}}}var De=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,Re={http:80,https:443,ftp:21},qe=r("$location");function Ve(t){for(var e=t.split("/"),n=e.length;n--;)e[n]=st(e[n]);return e.join("/")}function Ie(t,e,n){var r=Cn(t,n);e.$$protocol=r.protocol,e.$$host=r.hostname,e.$$port=k(r.port)||Re[r.protocol]||null}function Ue(t,e,n){var r="/"!==t.charAt(0);r&&(t="/"+t);var i=Cn(t,n);e.$$path=decodeURIComponent(r&&"/"===i.pathname.charAt(0)?i.pathname.substring(1):i.pathname),e.$$search=it(i.search),e.$$hash=decodeURIComponent(i.hash),e.$$path&&"/"!=e.$$path.charAt(0)&&(e.$$path="/"+e.$$path)}function Fe(t,e){if(0===e.toLowerCase().indexOf(t.toLowerCase()))return e.substr(t.length)}function _e(t){var e=t.indexOf("#");return-1==e?t:t.substr(0,e)}function He(t){return t.substr(0,_e(t).lastIndexOf("/")+1)}function Le(t,e){this.$$html5=!0,e=e||"";var r=He(t);Ie(t,this,t),this.$$parse=function(e){var n=Fe(r,e);if(!N(n))throw qe("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',e,r);Ue(n,this,t),this.$$path||(this.$$path="/"),this.$$compose()},this.$$compose=function(){var t=ot(this.$$search),e=this.$$hash?"#"+st(this.$$hash):"";this.$$url=Ve(this.$$path)+(t?"?"+t:"")+e,this.$$absUrl=r+this.$$url.substr(1)},this.$$rewrite=function(i){var o,s;return(o=Fe(t,i))!==n?(s=o,(o=Fe(e,o))!==n?r+(Fe("/",o)||o):t+s):(o=Fe(r,i))!==n?r+o:r==i+"/"?r:void 0}}function Be(t,e){var n=He(t);Ie(t,this,t),this.$$parse=function(r){var i=Fe(t,r)||Fe(n,r),o="#"==i.charAt(0)?Fe(e,i):this.$$html5?i:"";if(!N(o))throw qe("ihshprfx",'Invalid url "{0}", missing hash prefix "{1}".',r,e);Ue(o,this,t),this.$$path=function(t,e,n){var r,i=/^\/?.*?:(\/.*)/;0===e.indexOf(n)&&(e=e.replace(n,""));if(i.exec(e))return t;return(r=i.exec(t))?r[1]:t}(this.$$path,o,t),this.$$compose()},this.$$compose=function(){var n=ot(this.$$search),r=this.$$hash?"#"+st(this.$$hash):"";this.$$url=Ve(this.$$path)+(n?"?"+n:"")+r,this.$$absUrl=t+(this.$$url?e+this.$$url:"")},this.$$rewrite=function(e){if(_e(t)==_e(e))return e}}function ze(t,e){this.$$html5=!0,Be.apply(this,arguments);var n=He(t);this.$$rewrite=function(r){var i;return t==_e(r)?r:(i=Fe(n,r))?t+e+i:n===r+"/"?n:void 0}}function We(t){return function(){return this[t]}}function Qe(t,e){return function(n){return M(n)?this[t]:(this[t]=e(n),this.$$compose(),this)}}function Je(){var e="",n=!1;this.hashPrefix=function(t){return P(t)?(e=t,this):e},this.html5Mode=function(t){return P(t)?(n=t,this):n},this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(r,o,s,a){var c,l,f,h,p=o.baseHref(),$=o.url();n?(f=(h=$).substring(0,h.indexOf("/",h.indexOf("//")+2))+(p||"/"),l=s.history?Le:ze):(f=_e($),l=Be),(c=new l(f,"#"+e)).$$parse(c.$$rewrite($)),a.on("click",function(e){if(!e.ctrlKey&&!e.metaKey&&2!=e.which){for(var n=u(e.target);"a"!==i(n[0].nodeName);)if(n[0]===a[0]||!(n=n.parent())[0])return;var s=n.prop("href");j(s)&&"[object SVGAnimatedString]"===s.toString()&&(s=Cn(s.animVal).href);var l=c.$$rewrite(s);s&&!n.attr("target")&&l&&!e.isDefaultPrevented()&&(e.preventDefault(),l!=o.url()&&(c.$$parse(l),r.$apply(),t.angular["ff-684208-preventDefault"]=!0))}}),c.absUrl()!=$&&o.url(c.absUrl(),!0),o.onUrlChange(function(t){c.absUrl()!=t&&(r.$evalAsync(function(){var e=c.absUrl();c.$$parse(t),r.$broadcast("$locationChangeStart",t,e).defaultPrevented?(c.$$parse(e),o.url(e)):v(e)}),r.$$phase||r.$digest())});var d=0;return r.$watch(function(){var t=o.url(),e=c.$$replace;return d&&t==c.absUrl()||(d++,r.$evalAsync(function(){r.$broadcast("$locationChangeStart",c.absUrl(),t).defaultPrevented?c.$$parse(t):(o.url(c.absUrl(),e),v(t))})),c.$$replace=!1,d}),c;function v(t){r.$broadcast("$locationChangeSuccess",c.absUrl(),t)}}]}function Xe(){var t=!0,e=this;this.debugEnabled=function(e){return P(e)?(t=e,this):t},this.$get=["$window",function(n){return{log:i("log"),info:i("info"),warn:i("warn"),error:i("error"),debug:(r=i("debug"),function(){t&&r.apply(e,arguments)})};var r;function i(t){var e=n.console||{},r=e[t]||e.log||A,i=!1;try{i=!!r.apply}catch(t){}return i?function(){var t=[];return y(arguments,function(e){t.push(function(t){return t instanceof Error&&(t.stack?t=t.message&&-1===t.stack.indexOf(t.message)?"Error: "+t.message+"\n"+t.stack:t.stack:t.sourceURL&&(t=t.message+"\n"+t.sourceURL+":"+t.line)),t}(e))}),r.apply(e,t)}:function(t,e){r(t,null==e?"":e)}}}]}ze.prototype=Be.prototype=Le.prototype={$$html5:!1,$$replace:!1,absUrl:We("$$absUrl"),url:function(t,e){if(M(t))return this.$$url;var n=De.exec(t);return n[1]&&this.path(decodeURIComponent(n[1])),(n[2]||n[1])&&this.search(n[3]||""),this.hash(n[5]||"",e),this},protocol:We("$$protocol"),host:We("$$host"),port:We("$$port"),path:Qe("$$path",function(t){return"/"==t.charAt(0)?t:"/"+t}),search:function(t,e){switch(arguments.length){case 0:return this.$$search;case 1:if(N(t))this.$$search=it(t);else{if(!j(t))throw qe("isrcharg","The first argument of the `$location#search()` call must be a string or an object.");this.$$search=t}break;default:M(e)||null===e?delete this.$$search[t]:this.$$search[t]=e}return this.$$compose(),this},hash:Qe("$$hash",O),replace:function(){return this.$$replace=!0,this}};var Ge,Ke=r("$parse"),Ye={};function Ze(t,e){if("constructor"===t)throw Ke("isecfld",'Referencing "constructor" field in Angular expressions is disallowed! Expression: {0}',e);return t}function tn(t,e){if(t){if(t.constructor===t)throw Ke("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",e);if(t.document&&t.location&&t.alert&&t.setInterval)throw Ke("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",e);if(t.children&&(t.nodeName||t.prop&&t.attr&&t.find))throw Ke("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",e)}return t}var en={null:function(){return null},true:function(){return!0},false:function(){return!1},undefined:A,"+":function(t,e,r,i){return r=r(t,e),i=i(t,e),P(r)?P(i)?r+i:r:P(i)?i:n},"-":function(t,e,n,r){return n=n(t,e),r=r(t,e),(P(n)?n:0)-(P(r)?r:0)},"*":function(t,e,n,r){return n(t,e)*r(t,e)},"/":function(t,e,n,r){return n(t,e)/r(t,e)},"%":function(t,e,n,r){return n(t,e)%r(t,e)},"^":function(t,e,n,r){return n(t,e)^r(t,e)},"=":A,"===":function(t,e,n,r){return n(t,e)===r(t,e)},"!==":function(t,e,n,r){return n(t,e)!==r(t,e)},"==":function(t,e,n,r){return n(t,e)==r(t,e)},"!=":function(t,e,n,r){return n(t,e)!=r(t,e)},"<":function(t,e,n,r){return n(t,e)<r(t,e)},">":function(t,e,n,r){return n(t,e)>r(t,e)},"<=":function(t,e,n,r){return n(t,e)<=r(t,e)},">=":function(t,e,n,r){return n(t,e)>=r(t,e)},"&&":function(t,e,n,r){return n(t,e)&&r(t,e)},"||":function(t,e,n,r){return n(t,e)||r(t,e)},"&":function(t,e,n,r){return n(t,e)&r(t,e)},"|":function(t,e,n,r){return r(t,e)(t,e,n(t,e))},"!":function(t,e,n){return!n(t,e)}},nn={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},rn=function(t){this.options=t};rn.prototype={constructor:rn,lex:function(t){var e;this.text=t,this.index=0,this.ch=n,this.lastCh=":",this.tokens=[];for(var r=[];this.index<this.text.length;){if(this.ch=this.text.charAt(this.index),this.is("\"'"))this.readString(this.ch);else if(this.isNumber(this.ch)||this.is(".")&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdent(this.ch))this.readIdent(),this.was("{,")&&"{"===r[0]&&(e=this.tokens[this.tokens.length-1])&&(e.json=-1===e.text.indexOf("."));else if(this.is("(){}[].,;:?"))this.tokens.push({index:this.index,text:this.ch,json:this.was(":[,")&&this.is("{[")||this.is("}]:,")}),this.is("{[")&&r.unshift(this.ch),this.is("}]")&&r.shift(),this.index++;else{if(this.isWhitespace(this.ch)){this.index++;continue}var i=this.ch+this.peek(),o=i+this.peek(2),s=en[this.ch],a=en[i],u=en[o];u?(this.tokens.push({index:this.index,text:o,fn:u}),this.index+=3):a?(this.tokens.push({index:this.index,text:i,fn:a}),this.index+=2):s?(this.tokens.push({index:this.index,text:this.ch,fn:s,json:this.was("[,:")&&this.is("+-")}),this.index+=1):this.throwError("Unexpected next character ",this.index,this.index+1)}this.lastCh=this.ch}return this.tokens},is:function(t){return-1!==t.indexOf(this.ch)},was:function(t){return-1!==t.indexOf(this.lastCh)},peek:function(t){var e=t||1;return this.index+e<this.text.length&&this.text.charAt(this.index+e)},isNumber:function(t){return"0"<=t&&t<="9"},isWhitespace:function(t){return" "===t||"\r"===t||"\t"===t||"\n"===t||"\v"===t||" "===t},isIdent:function(t){return"a"<=t&&t<="z"||"A"<=t&&t<="Z"||"_"===t||"$"===t},isExpOperator:function(t){return"-"===t||"+"===t||this.isNumber(t)},throwError:function(t,e,n){n=n||this.index;var r=P(e)?"s "+e+"-"+this.index+" ["+this.text.substring(e,n)+"]":" "+n;throw Ke("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",t,r,this.text)},readNumber:function(){for(var t="",e=this.index;this.index<this.text.length;){var n=i(this.text.charAt(this.index));if("."==n||this.isNumber(n))t+=n;else{var r=this.peek();if("e"==n&&this.isExpOperator(r))t+=n;else if(this.isExpOperator(n)&&r&&this.isNumber(r)&&"e"==t.charAt(t.length-1))t+=n;else{if(!this.isExpOperator(n)||r&&this.isNumber(r)||"e"!=t.charAt(t.length-1))break;this.throwError("Invalid exponent")}}this.index++}t*=1,this.tokens.push({index:e,text:t,json:!0,fn:function(){return t}})},readIdent:function(){for(var t,e,n,r,i=this,o="",s=this.index;this.index<this.text.length&&("."===(r=this.text.charAt(this.index))||this.isIdent(r)||this.isNumber(r));)"."===r&&(t=this.index),o+=r,this.index++;if(t)for(e=this.index;e<this.text.length;){if("("===(r=this.text.charAt(e))){n=o.substr(t-s+1),o=o.substr(0,t-s),this.index=e;break}if(!this.isWhitespace(r))break;e++}var a={index:s,text:o};if(en.hasOwnProperty(o))a.fn=en[o],a.json=en[o];else{var u=cn(o,this.options,this.text);a.fn=C(function(t,e){return u(t,e)},{assign:function(t,e){return sn(t,o,e,i.text,i.options)}})}this.tokens.push(a),n&&(this.tokens.push({index:t,text:".",json:!1}),this.tokens.push({index:t+1,text:n,json:!1}))},readString:function(t){var e=this.index;this.index++;for(var n="",r=t,i=!1;this.index<this.text.length;){var o=this.text.charAt(this.index);if(r+=o,i){if("u"===o){var s=this.text.substring(this.index+1,this.index+5);s.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+s+"]"),this.index+=4,n+=String.fromCharCode(parseInt(s,16))}else{var a=nn[o];n+=a||o}i=!1}else if("\\"===o)i=!0;else{if(o===t)return this.index++,void this.tokens.push({index:e,text:r,string:n,json:!0,fn:function(){return n}});n+=o}this.index++}this.throwError("Unterminated quote",e)}};var on=function(t,e,n){this.lexer=t,this.$filter=e,this.options=n};function sn(t,e,r,i,o){o=o||{};for(var s,a=e.split("."),u=0;a.length>1;u++){var c=t[s=Ze(a.shift(),i)];c||(c={},t[s]=c),(t=c).then&&o.unwrapPromises&&(Ge(i),"$$v"in t||function(t){t.then(function(e){t.$$v=e})}(t),t.$$v===n&&(t.$$v={}),t=t.$$v)}return t[s=Ze(a.shift(),i)]=r,r}on.ZERO=C(function(){return 0},{constant:!0}),on.prototype={constructor:on,parse:function(t,e){this.text=t,this.json=e,this.tokens=this.lexer.lex(t),e&&(this.assignment=this.logicalOR,this.functionCall=this.fieldAccess=this.objectIndex=this.filterChain=function(){this.throwError("is not valid json",{text:t,index:0})});var n=e?this.primary():this.statements();return 0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]),n.literal=!!n.literal,n.constant=!!n.constant,n},primary:function(){var t,e,n;if(this.expect("("))t=this.filterChain(),this.consume(")");else if(this.expect("["))t=this.arrayDeclaration();else if(this.expect("{"))t=this.object();else{var r=this.expect();(t=r.fn)||this.throwError("not a primary expression",r),r.json&&(t.constant=!0,t.literal=!0)}for(;e=this.expect("(","[",".");)"("===e.text?(t=this.functionCall(t,n),n=null):"["===e.text?(n=t,t=this.objectIndex(t)):"."===e.text?(n=t,t=this.fieldAccess(t)):this.throwError("IMPOSSIBLE");return t},throwError:function(t,e){throw Ke("syntax","Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].",e.text,t,e.index+1,this.text,this.text.substring(e.index))},peekToken:function(){if(0===this.tokens.length)throw Ke("ueoe","Unexpected end of expression: {0}",this.text);return this.tokens[0]},peek:function(t,e,n,r){if(this.tokens.length>0){var i=this.tokens[0],o=i.text;if(o===t||o===e||o===n||o===r||!t&&!e&&!n&&!r)return i}return!1},expect:function(t,e,n,r){var i=this.peek(t,e,n,r);return!!i&&(this.json&&!i.json&&this.throwError("is not valid json",i),this.tokens.shift(),i)},consume:function(t){this.expect(t)||this.throwError("is unexpected, expecting ["+t+"]",this.peek())},unaryFn:function(t,e){return C(function(n,r){return t(n,r,e)},{constant:e.constant})},ternaryFn:function(t,e,n){return C(function(r,i){return t(r,i)?e(r,i):n(r,i)},{constant:t.constant&&e.constant&&n.constant})},binaryFn:function(t,e,n){return C(function(r,i){return e(r,i,t,n)},{constant:t.constant&&n.constant})},statements:function(){for(var t=[];;)if(this.tokens.length>0&&!this.peek("}",")",";","]")&&t.push(this.filterChain()),!this.expect(";"))return 1===t.length?t[0]:function(e,n){for(var r,i=0;i<t.length;i++){var o=t[i];o&&(r=o(e,n))}return r}},filterChain:function(){for(var t,e=this.expression();;){if(!(t=this.expect("|")))return e;e=this.binaryFn(e,t.fn,this.filter())}},filter:function(){for(var t=this.expect(),e=this.$filter(t.text),n=[];;){if(!(t=this.expect(":"))){var r=function(t,r,i){for(var o=[i],s=0;s<n.length;s++)o.push(n[s](t,r));return e.apply(t,o)};return function(){return r}}n.push(this.expression())}},expression:function(){return this.assignment()},assignment:function(){var t,e,n=this.ternary();return(e=this.expect("="))?(n.assign||this.throwError("implies assignment but ["+this.text.substring(0,e.index)+"] can not be assigned to",e),t=this.ternary(),function(e,r){return n.assign(e,t(e,r),r)}):n},ternary:function(){var t,e,n=this.logicalOR();return(e=this.expect("?"))?(t=this.ternary(),(e=this.expect(":"))?this.ternaryFn(n,t,this.ternary()):void this.throwError("expected :",e)):n},logicalOR:function(){for(var t,e=this.logicalAND();;){if(!(t=this.expect("||")))return e;e=this.binaryFn(e,t.fn,this.logicalAND())}},logicalAND:function(){var t,e=this.equality();return(t=this.expect("&&"))&&(e=this.binaryFn(e,t.fn,this.logicalAND())),e},equality:function(){var t,e=this.relational();return(t=this.expect("==","!=","===","!=="))&&(e=this.binaryFn(e,t.fn,this.equality())),e},relational:function(){var t,e=this.additive();return(t=this.expect("<",">","<=",">="))&&(e=this.binaryFn(e,t.fn,this.relational())),e},additive:function(){for(var t,e=this.multiplicative();t=this.expect("+","-");)e=this.binaryFn(e,t.fn,this.multiplicative());return e},multiplicative:function(){for(var t,e=this.unary();t=this.expect("*","/","%");)e=this.binaryFn(e,t.fn,this.unary());return e},unary:function(){var t;return this.expect("+")?this.primary():(t=this.expect("-"))?this.binaryFn(on.ZERO,t.fn,this.unary()):(t=this.expect("!"))?this.unaryFn(t.fn,this.unary()):this.primary()},fieldAccess:function(t){var e=this,n=this.expect().text,r=cn(n,this.options,this.text);return C(function(e,n,i){return r(i||t(e,n))},{assign:function(r,i,o){return sn(t(r,o),n,i,e.text,e.options)}})},objectIndex:function(t){var e=this,r=this.expression();return this.consume("]"),C(function(i,o){var s,a,u=t(i,o),c=r(i,o);return u?((s=tn(u[c],e.text))&&s.then&&e.options.unwrapPromises&&(a=s,"$$v"in s||(a.$$v=n,a.then(function(t){a.$$v=t})),s=s.$$v),s):n},{assign:function(n,i,o){var s=r(n,o);return tn(t(n,o),e.text)[s]=i}})},functionCall:function(t,e){var n=[];if(")"!==this.peekToken().text)do{n.push(this.expression())}while(this.expect(","));this.consume(")");var r=this;return function(i,o){for(var s=[],a=e?e(i,o):i,u=0;u<n.length;u++)s.push(n[u](i,o));var c=t(i,o,a)||A;return tn(a,r.text),tn(c,r.text),tn(c.apply?c.apply(a,s):c(s[0],s[1],s[2],s[3],s[4]),r.text)}},arrayDeclaration:function(){var t=[],e=!0;if("]"!==this.peekToken().text)do{if(this.peek("]"))break;var n=this.expression();t.push(n),n.constant||(e=!1)}while(this.expect(","));return this.consume("]"),C(function(e,n){for(var r=[],i=0;i<t.length;i++)r.push(t[i](e,n));return r},{literal:!0,constant:e})},object:function(){var t=[],e=!0;if("}"!==this.peekToken().text)do{if(this.peek("}"))break;var n=this.expect(),r=n.string||n.text;this.consume(":");var i=this.expression();t.push({key:r,value:i}),i.constant||(e=!1)}while(this.expect(","));return this.consume("}"),C(function(e,n){for(var r={},i=0;i<t.length;i++){var o=t[i];r[o.key]=o.value(e,n)}return r},{literal:!0,constant:e})}};var an={};function un(t,e,r,i,o,s,a){return Ze(t,s),Ze(e,s),Ze(r,s),Ze(i,s),Ze(o,s),a.unwrapPromises?function(a,u){var c,l=u&&u.hasOwnProperty(t)?u:a;return null==l?l:((l=l[t])&&l.then&&(Ge(s),"$$v"in l||((c=l).$$v=n,c.then(function(t){c.$$v=t})),l=l.$$v),e?null==l?n:((l=l[e])&&l.then&&(Ge(s),"$$v"in l||((c=l).$$v=n,c.then(function(t){c.$$v=t})),l=l.$$v),r?null==l?n:((l=l[r])&&l.then&&(Ge(s),"$$v"in l||((c=l).$$v=n,c.then(function(t){c.$$v=t})),l=l.$$v),i?null==l?n:((l=l[i])&&l.then&&(Ge(s),"$$v"in l||((c=l).$$v=n,c.then(function(t){c.$$v=t})),l=l.$$v),o?null==l?n:((l=l[o])&&l.then&&(Ge(s),"$$v"in l||((c=l).$$v=n,c.then(function(t){c.$$v=t})),l=l.$$v),l):l):l):l):l)}:function(s,a){var u=a&&a.hasOwnProperty(t)?a:s;return null==u?u:(u=u[t],e?null==u?n:(u=u[e],r?null==u?n:(u=u[r],i?null==u?n:(u=u[i],o?null==u?n:u=u[o]:u):u):u):u)}}function cn(t,e,r){if(an.hasOwnProperty(t))return an[t];var i,o=t.split("."),s=o.length;if(e.unwrapPromises||1!==s)if(e.unwrapPromises||2!==s)if(e.csp)i=s<6?un(o[0],o[1],o[2],o[3],o[4],r,e):function(t,i){var a,u=0;do{a=un(o[u++],o[u++],o[u++],o[u++],o[u++],r,e)(t,i),i=n,t=a}while(u<s);return a};else{var a="var p;\n";y(o,function(t,n){Ze(t,r),a+="if(s == null) return undefined;\ns="+(n?"s":'((k&&k.hasOwnProperty("'+t+'"))?k:s)')+'["'+t+'"];\n'+(e.unwrapPromises?'if (s && s.then) {\n pw("'+r.replace(/(["\r\n])/g,"\\$1")+'");\n if (!("$$v" in s)) {\n p=s;\n p.$$v = undefined;\n p.then(function(v) {p.$$v=v;});\n}\n s=s.$$v\n}\n':"")}),a+="return s;";var u=new Function("s","k","pw",a);u.toString=T(a),i=e.unwrapPromises?function(t,e){return u(t,e,Ge)}:u}else i=function(t,e,r){return Ze(t,r),Ze(e,r),function(r,i){return null==r?n:null==(r=(i&&i.hasOwnProperty(t)?i:r)[t])?n:r[e]}}(o[0],o[1],r);else i=function(t,e){return Ze(t,e),function(e,r){return null==e?n:(r&&r.hasOwnProperty(t)?r:e)[t]}}(o[0],r);return"hasOwnProperty"!==t&&(an[t]=i),i}function ln(){var t={},e={csp:!1,unwrapPromises:!1,logPromiseWarnings:!0};this.unwrapPromises=function(t){return P(t)?(e.unwrapPromises=!!t,this):e.unwrapPromises},this.logPromiseWarnings=function(t){return P(t)?(e.logPromiseWarnings=t,this):e.logPromiseWarnings},this.$get=["$filter","$sniffer","$log",function(n,r,i){return e.csp=r.csp,Ge=function(t){e.logPromiseWarnings&&!Ye.hasOwnProperty(t)&&(Ye[t]=!0,i.warn("[$parse] Promise found in the expression `"+t+"`. Automatic unwrapping of promises in Angular expressions is deprecated."))},function(r){var i;switch(typeof r){case"string":if(t.hasOwnProperty(r))return t[r];var o=new rn(e);return i=new on(o,n,e).parse(r,!1),"hasOwnProperty"!==r&&(t[r]=i),i;case"function":return r;default:return A}}}]}function fn(){this.$get=["$rootScope","$exceptionHandler",function(t,e){return function(t,e){var r=function(){var o,c,l=[];return c={resolve:function(e){if(l){var r=l;l=n,o=i(e),r.length&&t(function(){for(var t,e=0,n=r.length;e<n;e++)t=r[e],o.then(t[0],t[1],t[2])})}},reject:function(t){c.resolve(s(t))},notify:function(e){if(l){var n=l;l.length&&t(function(){for(var t=0,r=n.length;t<r;t++)n[t][2](e)})}},promise:{then:function(t,n,i){var s=r(),c=function(n){try{s.resolve((V(t)?t:a)(n))}catch(t){s.reject(t),e(t)}},f=function(t){try{s.resolve((V(n)?n:u)(t))}catch(t){s.reject(t),e(t)}},h=function(t){try{s.notify((V(i)?i:a)(t))}catch(t){e(t)}};return l?l.push([c,f,h]):o.then(c,f,h),s.promise},catch:function(t){return this.then(null,t)},finally:function(t){function e(t,e){var n=r();return e?n.resolve(t):n.reject(t),n.promise}function n(n,r){var i=null;try{i=(t||a)()}catch(t){return e(t,!1)}return i&&V(i.then)?i.then(function(){return e(n,r)},function(t){return e(t,!1)}):e(n,r)}return this.then(function(t){return n(t,!0)},function(t){return n(t,!1)})}}}},i=function(e){return e&&V(e.then)?e:{then:function(n){var i=r();return t(function(){i.resolve(n(e))}),i.promise}}},o=function(t){var e=r();return e.reject(t),e.promise},s=function(n){return{then:function(i,o){var s=r();return t(function(){try{s.resolve((V(o)?o:u)(n))}catch(t){s.reject(t),e(t)}}),s.promise}}};function a(t){return t}function u(t){return o(t)}return{defer:r,reject:o,when:function(n,s,c,l){var f,h=r(),p=function(t){try{return(V(s)?s:a)(t)}catch(t){return e(t),o(t)}},$=function(t){try{return(V(c)?c:u)(t)}catch(t){return e(t),o(t)}},d=function(t){try{return(V(l)?l:a)(t)}catch(t){e(t)}};return t(function(){i(n).then(function(t){f||(f=!0,h.resolve(i(t).then(p,$,d)))},function(t){f||(f=!0,h.resolve($(t)))},function(t){f||h.notify(d(t))})}),h.promise},all:function(t){var e=r(),n=0,o=q(t)?[]:{};y(t,function(t,r){n++,i(t).then(function(t){o.hasOwnProperty(r)||(o[r]=t,--n||e.resolve(o))},function(t){o.hasOwnProperty(r)||e.reject(t)})}),0===n&&e.resolve(o);return e.promise}}}(function(e){t.$evalAsync(e)},e)}]}function hn(){this.$get=["$window","$timeout",function(t,e){var n=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame,r=t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.webkitCancelRequestAnimationFrame,i=!!n,o=i?function(t){var e=n(t);return function(){r(e)}}:function(t){var n=e(t,16.66,!1);return function(){e.cancel(n)}};return o.supported=i,o}]}function pn(){var t=10,e=r("$rootScope"),n=null;this.digestTtl=function(e){return arguments.length&&(t=e),t},this.$get=["$injector","$exceptionHandler","$parse","$browser",function(r,i,s,a){function u(){this.$id=x(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,this.this=this.$root=this,this.$$destroyed=!1,this.$$asyncQueue=[],this.$$postDigestQueue=[],this.$$listeners={},this.$$listenerCount={},this.$$isolateBindings={}}u.prototype={constructor:u,$new:function(t){var e,n;return t?((n=new u).$root=this.$root,n.$$asyncQueue=this.$$asyncQueue,n.$$postDigestQueue=this.$$postDigestQueue):((e=function(){}).prototype=this,(n=new e).$id=x()),n.this=n,n.$$listeners={},n.$$listenerCount={},n.$parent=this,n.$$watchers=n.$$nextSibling=n.$$childHead=n.$$childTail=null,n.$$prevSibling=this.$$childTail,this.$$childHead?(this.$$childTail.$$nextSibling=n,this.$$childTail=n):this.$$childHead=this.$$childTail=n,n},$watch:function(t,e,r){var i=h(t,"watch"),o=this.$$watchers,s={fn:e,last:$,get:i,exp:t,eq:!!r};if(n=null,!V(e)){var a=h(e||A,"listener");s.fn=function(t,e,n){a(n)}}if("string"==typeof t&&i.constant){var u=s.fn;s.fn=function(t,e,n){u.call(this,t,e,n),B(o,s)}}return o||(o=this.$$watchers=[]),o.unshift(s),function(){B(o,s),n=null}},$watchCollection:function(t,e){var n,r,i,a=this,u=e.length>1,c=0,l=s(t),f=[],h={},p=!0,$=0;return this.$watch(function(){var t,e;if(j(n=l(a)))if(m(n)){r!==f&&($=(r=f).length=0,c++),t=n.length,$!==t&&(c++,r.length=$=t);for(var i=0;i<t;i++)r[i]!=r[i]&&n[i]!=n[i]||r[i]===n[i]||(c++,r[i]=n[i])}else{for(e in r!==h&&(r=h={},$=0,c++),t=0,n)n.hasOwnProperty(e)&&(t++,r.hasOwnProperty(e)?r[e]!==n[e]&&(c++,r[e]=n[e]):($++,r[e]=n[e],c++));if($>t)for(e in c++,r)r.hasOwnProperty(e)&&!n.hasOwnProperty(e)&&($--,delete r[e])}else r!==n&&(r=n,c++);return c},function(){if(p?(p=!1,e(n,n,a)):e(n,i,a),u)if(j(n))if(m(n)){i=new Array(n.length);for(var t=0;t<n.length;t++)i[t]=n[t]}else for(var r in i={},n)o.call(n,r)&&(i[r]=n[r]);else i=n})},$digest:function(){var r,o,s,a,u,c,h,p,d,v,g,m=this.$$asyncQueue,y=this.$$postDigestQueue,w=t,b=[];l("$digest"),n=null;do{for(c=!1,p=this;m.length;){try{(g=m.shift()).scope.$eval(g.expression)}catch(t){f(),i(t)}n=null}t:do{if(a=p.$$watchers)for(u=a.length;u--;)try{if(r=a[u])if((o=r.get(p))===(s=r.last)||(r.eq?Q(o,s):"number"==typeof o&&"number"==typeof s&&isNaN(o)&&isNaN(s))){if(r===n){c=!1;break t}}else c=!0,n=r,r.last=r.eq?z(o):o,r.fn(o,s===$?o:s,p),w<5&&(b[d=4-w]||(b[d]=[]),v=V(r.exp)?"fn: "+(r.exp.name||r.exp.toString()):r.exp,v+="; newVal: "+Z(o)+"; oldVal: "+Z(s),b[d].push(v))}catch(t){f(),i(t)}if(!(h=p.$$childHead||p!==this&&p.$$nextSibling))for(;p!==this&&!(h=p.$$nextSibling);)p=p.$parent}while(p=h);if((c||m.length)&&!w--)throw f(),e("infdig","{0} $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: {1}",t,Z(b))}while(c||m.length);for(f();y.length;)try{y.shift()()}catch(t){i(t)}},$destroy:function(){if(!this.$$destroyed){var t=this.$parent;this.$broadcast("$destroy"),this.$$destroyed=!0,this!==c&&(y(this.$$listenerCount,K(null,p,this)),t.$$childHead==this&&(t.$$childHead=this.$$nextSibling),t.$$childTail==this&&(t.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=null,this.$$listeners={},this.$$watchers=this.$$asyncQueue=this.$$postDigestQueue=[],this.$destroy=this.$digest=this.$apply=A,this.$on=this.$watch=function(){return A})}},$eval:function(t,e){return s(t)(this,e)},$evalAsync:function(t){c.$$phase||c.$$asyncQueue.length||a.defer(function(){c.$$asyncQueue.length&&c.$digest()}),this.$$asyncQueue.push({scope:this,expression:t})},$$postDigest:function(t){this.$$postDigestQueue.push(t)},$apply:function(t){try{return l("$apply"),this.$eval(t)}catch(t){i(t)}finally{f();try{c.$digest()}catch(t){throw i(t),t}}},$on:function(t,e){var n=this.$$listeners[t];n||(this.$$listeners[t]=n=[]),n.push(e);var r=this;do{r.$$listenerCount[t]||(r.$$listenerCount[t]=0),r.$$listenerCount[t]++}while(r=r.$parent);var i=this;return function(){n[L(n,e)]=null,p(i,1,t)}},$emit:function(t,e){var n,r,o,s=[],a=this,u=!1,c={name:t,targetScope:a,stopPropagation:function(){u=!0},preventDefault:function(){c.defaultPrevented=!0},defaultPrevented:!1},l=X([c],arguments,1);do{for(n=a.$$listeners[t]||s,c.currentScope=a,r=0,o=n.length;r<o;r++)if(n[r])try{n[r].apply(null,l)}catch(t){i(t)}else n.splice(r,1),r--,o--;if(u)return c;a=a.$parent}while(a);return c},$broadcast:function(t,e){for(var n,r,o,s=this,a=this,u={name:t,targetScope:this,preventDefault:function(){u.defaultPrevented=!0},defaultPrevented:!1},c=X([u],arguments,1);s=a;){for(u.currentScope=s,r=0,o=(n=s.$$listeners[t]||[]).length;r<o;r++)if(n[r])try{n[r].apply(null,c)}catch(t){i(t)}else n.splice(r,1),r--,o--;if(!(a=s.$$listenerCount[t]&&s.$$childHead||s!==this&&s.$$nextSibling))for(;s!==this&&!(a=s.$$nextSibling);)s=s.$parent}return u}};var c=new u;return c;function l(t){if(c.$$phase)throw e("inprog","{0} already in progress",c.$$phase);c.$$phase=t}function f(){c.$$phase=null}function h(t,e){var n=s(t);return ht(n,e),n}function p(t,e,n){do{t.$$listenerCount[n]-=e,0===t.$$listenerCount[n]&&delete t.$$listenerCount[n]}while(t=t.$parent)}function $(){}}]}function $n(){var t=/^\s*(https?|ftp|mailto|tel|file):/,e=/^\s*(https?|ftp|file):|data:image\//;this.aHrefSanitizationWhitelist=function(e){return P(e)?(t=e,this):t},this.imgSrcSanitizationWhitelist=function(t){return P(t)?(e=t,this):e},this.$get=function(){return function(n,r){var i,o=r?e:t;return a&&!(a>=8)||""===(i=Cn(n).href)||i.match(o)?n:"unsafe:"+i}}}var dn=r("$sce"),vn={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"};function gn(t){var e=[];return P(t)&&y(t,function(t){e.push(function(t){if("self"===t)return t;if(N(t)){if(t.indexOf("***")>-1)throw dn("iwcard","Illegal sequence *** in string matcher.  String: {0}",t);return t=(e=t,e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*"),new RegExp("^"+t+"$")}if(I(t))return new RegExp("^"+t.source+"$");throw dn("imatcher",'Matchers may only be "self", string patterns or RegExp objects');var e}(t))}),e}function mn(){this.SCE_CONTEXTS=vn;var t=["self"],e=[];this.resourceUrlWhitelist=function(e){return arguments.length&&(t=gn(e)),t},this.resourceUrlBlacklist=function(t){return arguments.length&&(e=gn(t)),e},this.$get=["$injector",function(r){var i=function(t){throw dn("unsafe","Attempting to use an unsafe value in a safe context.")};function o(t,e){return"self"===t?kn(e):!!t.exec(e.href)}function s(t){var e=function(t){this.$$unwrapTrustedValue=function(){return t}};return t&&(e.prototype=new t),e.prototype.valueOf=function(){return this.$$unwrapTrustedValue()},e.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()},e}r.has("$sanitize")&&(i=r.get("$sanitize"));var a=s(),u={};return u[vn.HTML]=s(a),u[vn.CSS]=s(a),u[vn.URL]=s(a),u[vn.JS]=s(a),u[vn.RESOURCE_URL]=s(u[vn.URL]),{trustAs:function(t,e){var r=u.hasOwnProperty(t)?u[t]:null;if(!r)throw dn("icontext","Attempted to trust a value in invalid context. Context: {0}; Value: {1}",t,e);if(null===e||e===n||""===e)return e;if("string"!=typeof e)throw dn("itype","Attempted to trust a non-string value in a content requiring a string: Context: {0}",t);return new r(e)},getTrusted:function(r,s){if(null===s||s===n||""===s)return s;var a=u.hasOwnProperty(r)?u[r]:null;if(a&&s instanceof a)return s.$$unwrapTrustedValue();if(r===vn.RESOURCE_URL){if(function(n){var r,i,s=Cn(n.toString()),a=!1;for(r=0,i=t.length;r<i;r++)if(o(t[r],s)){a=!0;break}if(a)for(r=0,i=e.length;r<i;r++)if(o(e[r],s)){a=!1;break}return a}(s))return s;throw dn("insecurl","Blocked loading resource from url not allowed by $sceDelegate policy.  URL: {0}",s.toString())}if(r===vn.HTML)return i(s);throw dn("unsafe","Attempting to use an unsafe value in a safe context.")},valueOf:function(t){return t instanceof a?t.$$unwrapTrustedValue():t}}}]}function yn(){var t=!0;this.enabled=function(e){return arguments.length&&(t=!!e),t},this.$get=["$parse","$sniffer","$sceDelegate",function(e,n,r){if(t&&n.msie&&n.msieDocumentMode<8)throw dn("iequirks","Strict Contextual Escaping does not support Internet Explorer version < 9 in quirks mode.  You can fix this by adding the text <!doctype html> to the top of your HTML document.  See http://docs.angularjs.org/api/ng.$sce for more information.");var o=z(vn);o.isEnabled=function(){return t},o.trustAs=r.trustAs,o.getTrusted=r.getTrusted,o.valueOf=r.valueOf,t||(o.trustAs=o.getTrusted=function(t,e){return e},o.valueOf=O),o.parseAs=function(t,n){var r=e(n);return r.literal&&r.constant?r:function(e,n){return o.getTrusted(t,r(e,n))}};var s=o.parseAs,a=o.getTrusted,u=o.trustAs;return y(vn,function(t,e){var n=i(e);o[kt("parse_as_"+n)]=function(e){return s(t,e)},o[kt("get_trusted_"+n)]=function(e){return a(t,e)},o[kt("trust_as_"+n)]=function(e){return u(t,e)}}),o}]}function wn(){this.$get=["$window","$document",function(t,e){var n,r,o={},s=k((/android (\d+)/.exec(i((t.navigator||{}).userAgent))||[])[1]),u=/Boxee/i.test((t.navigator||{}).userAgent),c=e[0]||{},l=c.documentMode,f=/^(Moz|webkit|O|ms)(?=[A-Z])/,h=c.body&&c.body.style,p=!1,$=!1;if(h){for(var d in h)if(r=f.exec(d)){n=(n=r[0]).substr(0,1).toUpperCase()+n.substr(1);break}n||(n="WebkitOpacity"in h&&"webkit"),p=!!("transition"in h||n+"Transition"in h),$=!!("animation"in h||n+"Animation"in h),!s||p&&$||(p=N(c.body.style.webkitTransition),$=N(c.body.style.webkitAnimation))}return{history:!(!t.history||!t.history.pushState||s<4||u),hashchange:"onhashchange"in t&&(!l||l>7),hasEvent:function(t){if("input"==t&&9==a)return!1;if(M(o[t])){var e=c.createElement("div");o[t]="on"+t in e}return o[t]},csp:J(),vendorPrefix:n,transitions:p,animations:$,android:s,msie:a,msieDocumentMode:l}}]}function bn(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(t,e,n,r){var i={};function o(o,s,a){var u,c=n.defer(),l=c.promise,f=P(a)&&!a;return u=e.defer(function(){try{c.resolve(o())}catch(t){c.reject(t),r(t)}finally{delete i[l.$$timeoutId]}f||t.$apply()},s),l.$$timeoutId=u,i[u]=c,l}return o.cancel=function(t){return!!(t&&t.$$timeoutId in i)&&(i[t.$$timeoutId].reject("canceled"),delete i[t.$$timeoutId],e.defer.cancel(t.$$timeoutId))},o}]}var xn=e.createElement("a"),Sn=Cn(t.location.href,!0);function Cn(t,e){var n=t;return a&&(xn.setAttribute("href",n),n=xn.href),xn.setAttribute("href",n),{href:xn.href,protocol:xn.protocol?xn.protocol.replace(/:$/,""):"",host:xn.host,search:xn.search?xn.search.replace(/^\?/,""):"",hash:xn.hash?xn.hash.replace(/^#/,""):"",hostname:xn.hostname,port:xn.port,pathname:"/"===xn.pathname.charAt(0)?xn.pathname:"/"+xn.pathname}}function kn(t){var e=N(t)?Cn(t):t;return e.protocol===Sn.protocol&&e.host===Sn.host}function En(){this.$get=T(t)}function An(t){var e="Filter";function n(r,i){if(j(r)){var o={};return y(r,function(t,e){o[e]=n(e,t)}),o}return t.factory(r+e,i)}this.register=n,this.$get=["$injector",function(t){return function(n){return t.get(n+e)}}],n("currency",Tn),n("date",Un),n("filter",On),n("json",Fn),n("limitTo",Ln),n("lowercase",_n),n("number",Mn),n("orderBy",Bn),n("uppercase",Hn)}function On(){return function(t,e,n){if(!q(t))return t;var r=typeof n,i=[];i.check=function(t){for(var e=0;e<i.length;e++)if(!i[e](t))return!1;return!0},"function"!==r&&(n="boolean"===r&&n?function(t,e){return v.equals(t,e)}:function(t,e){if(t&&e&&"object"==typeof t&&"object"==typeof e){for(var r in t)if("$"!==r.charAt(0)&&o.call(t,r)&&n(t[r],e[r]))return!0;return!1}return e=(""+e).toLowerCase(),(""+t).toLowerCase().indexOf(e)>-1});var s=function(t,e){if("string"==typeof e&&"!"===e.charAt(0))return!s(t,e.substr(1));switch(typeof t){case"boolean":case"number":case"string":return n(t,e);case"object":switch(typeof e){case"object":return n(t,e);default:for(var r in t)if("$"!==r.charAt(0)&&s(t[r],e))return!0}return!1;case"array":for(var i=0;i<t.length;i++)if(s(t[i],e))return!0;return!1;default:return!1}};switch(typeof e){case"boolean":case"number":case"string":e={$:e};case"object":for(var a in e)!function(t){void 0!==e[t]&&i.push(function(n){return s("$"==t?n:n&&n[t],e[t])})}(a);break;case"function":i.push(e);break;default:return t}for(var u=[],c=0;c<t.length;c++){var l=t[c];i.check(l)&&u.push(l)}return u}}function Tn(t){var e=t.NUMBER_FORMATS;return function(t,n){return M(n)&&(n=e.CURRENCY_SYM),jn(t,e.PATTERNS[1],e.GROUP_SEP,e.DECIMAL_SEP,2).replace(/\u00A4/g,n)}}function Mn(t){var e=t.NUMBER_FORMATS;return function(t,n){return jn(t,e.PATTERNS[0],e.GROUP_SEP,e.DECIMAL_SEP,n)}}An.$inject=["$provide"],Tn.$inject=["$locale"],Mn.$inject=["$locale"];var Pn=".";function jn(t,e,n,r,i){if(null==t||!isFinite(t)||j(t))return"";var o=t<0,s=(t=Math.abs(t))+"",a="",u=[],c=!1;if(-1!==s.indexOf("e")){var l=s.match(/([\d\.]+)e(-?)(\d+)/);l&&"-"==l[2]&&l[3]>i+1?s="0":(a=s,c=!0)}if(c)i>0&&t>-1&&t<1&&(a=t.toFixed(i));else{var f=(s.split(Pn)[1]||"").length;M(i)&&(i=Math.min(Math.max(e.minFrac,f),e.maxFrac));var h=Math.pow(10,i),p=(""+(t=Math.round(t*h)/h)).split(Pn),$=p[0];p=p[1]||"";var d,v=0,g=e.lgSize,m=e.gSize;if($.length>=g+m)for(v=$.length-g,d=0;d<v;d++)(v-d)%m==0&&0!==d&&(a+=n),a+=$.charAt(d);for(d=v;d<$.length;d++)($.length-d)%g==0&&0!==d&&(a+=n),a+=$.charAt(d);for(;p.length<i;)p+="0";i&&"0"!==i&&(a+=r+p.substr(0,i))}return u.push(o?e.negPre:e.posPre),u.push(a),u.push(o?e.negSuf:e.posSuf),u.join("")}function Nn(t,e,n){var r="";for(t<0&&(r="-",t=-t),t=""+t;t.length<e;)t="0"+t;return n&&(t=t.substr(t.length-e)),r+t}function Dn(t,e,n,r){return n=n||0,function(i){var o=i["get"+t]();return(n>0||o>-n)&&(o+=n),0===o&&-12==n&&(o=12),Nn(o,e,r)}}function Rn(t,e){return function(n,r){var i=n["get"+t]();return r[s(e?"SHORT"+t:t)][i]}}var qn={yyyy:Dn("FullYear",4),yy:Dn("FullYear",2,0,!0),y:Dn("FullYear",1),MMMM:Rn("Month"),MMM:Rn("Month",!0),MM:Dn("Month",2,1),M:Dn("Month",1,1),dd:Dn("Date",2),d:Dn("Date",1),HH:Dn("Hours",2),H:Dn("Hours",1),hh:Dn("Hours",2,-12),h:Dn("Hours",1,-12),mm:Dn("Minutes",2),m:Dn("Minutes",1),ss:Dn("Seconds",2),s:Dn("Seconds",1),sss:Dn("Milliseconds",3),EEEE:Rn("Day"),EEE:Rn("Day",!0),a:function(t,e){return t.getHours()<12?e.AMPMS[0]:e.AMPMS[1]},Z:function(t){var e=-1*t.getTimezoneOffset(),n=e>=0?"+":"";return n+=Nn(Math[e>0?"floor":"ceil"](e/60),2)+Nn(Math.abs(e%60),2)}},Vn=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,In=/^\-?\d+$/;function Un(t){var e=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(n,r){var i,o,s="",a=[];if(r=r||"mediumDate",r=t.DATETIME_FORMATS[r]||r,N(n)&&(n=In.test(n)?k(n):function(t){var n;if(n=t.match(e)){var r=new Date(0),i=0,o=0,s=n[8]?r.setUTCFullYear:r.setFullYear,a=n[8]?r.setUTCHours:r.setHours;n[9]&&(i=k(n[9]+n[10]),o=k(n[9]+n[11])),s.call(r,k(n[1]),k(n[2])-1,k(n[3]));var u=k(n[4]||0)-i,c=k(n[5]||0)-o,l=k(n[6]||0),f=Math.round(1e3*parseFloat("0."+(n[7]||0)));return a.call(r,u,c,l,f),r}return t}(n)),D(n)&&(n=new Date(n)),!R(n))return n;for(;r;)(o=Vn.exec(r))?r=(a=X(a,o,1)).pop():(a.push(r),r=null);return y(a,function(e){i=qn[e],s+=i?i(n,t.DATETIME_FORMATS):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),s}}function Fn(){return function(t){return Z(t,!0)}}Un.$inject=["$locale"];var _n=T(i),Hn=T(s);function Ln(){return function(t,e){if(!q(t)&&!N(t))return t;if(e=k(e),N(t))return e?e>=0?t.slice(0,e):t.slice(e,t.length):"";var n,r,i=[];for(e>t.length?e=t.length:e<-t.length&&(e=-t.length),e>0?(n=0,r=e):(n=t.length+e,r=t.length);n<r;n++)i.push(t[n]);return i}}function Bn(t){return function(e,n,r){if(!q(e))return e;if(!n)return e;var i,o,s;n=q(n)?n:[n],i=function(e){var n=!1,r=e||O;if(N(e)&&("+"!=e.charAt(0)&&"-"!=e.charAt(0)||(n="-"==e.charAt(0),e=e.substring(1)),(r=t(e)).constant)){var i=r();return c(function(t,e){return l(t[i],e[i])},n)}return c(function(t,e){return l(r(t),r(e))},n)},s=[],y(n,function(t,e,n){s.push(i.call(o,t,e,n))}),n=s;for(var a=[],u=0;u<e.length;u++)a.push(e[u]);return a.sort(c(function(t,e){for(var r=0;r<n.length;r++){var i=n[r](t,e);if(0!==i)return i}return 0},r));function c(t,e){return et(e)?function(e,n){return t(n,e)}:t}function l(t,e){var n=typeof t,r=typeof e;return n==r?("string"==n&&(t=t.toLowerCase(),e=e.toLowerCase()),t===e?0:t<e?-1:1):n<r?-1:1}}}function zn(t){return V(t)&&(t={link:t}),t.restrict=t.restrict||"AC",T(t)}Bn.$inject=["$parse"];var Wn=T({restrict:"E",compile:function(t,n){if(a<=8&&(n.href||n.name||n.$set("href",""),t.append(e.createComment("IE fix"))),!n.href&&!n.xlinkHref&&!n.name)return function(t,e){var n="[object SVGAnimatedString]"===$.call(e.prop("href"))?"xlink:href":"href";e.on("click",function(t){e.attr(n)||t.preventDefault()})}}}),Qn={};y(Xt,function(t,e){if("multiple"!=t){var n=me("ng-"+e);Qn[n]=function(){return{priority:100,link:function(t,r,i){t.$watch(i[n],function(t){i.$set(e,!!t)})}}}}}),y(["src","srcset","href"],function(t){var e=me("ng-"+t);Qn[e]=function(){return{priority:99,link:function(n,r,i){var o=t,s=t;"href"===t&&"[object SVGAnimatedString]"===$.call(r.prop("href"))&&(s="xlinkHref",i.$attr[s]="xlink:href",o=null),i.$observe(e,function(t){t&&(i.$set(s,t),a&&o&&r.prop(o,i[s]))})}}}});var Jn={$addControl:A,$removeControl:A,$setValidity:A,$setDirty:A,$setPristine:A};function Xn(t,e,n,r){var i=this,o=t.parent().controller("form")||Jn,s=0,a=i.$error={},u=[];function c(e,n){n=n?"-"+lt(n,"-"):"",r.removeClass(t,(e?ar:sr)+n),r.addClass(t,(e?sr:ar)+n)}i.$name=e.name||e.ngForm,i.$dirty=!1,i.$pristine=!0,i.$valid=!0,i.$invalid=!1,o.$addControl(i),t.addClass(ur),c(!0),i.$addControl=function(t){pt(t.$name,"input"),u.push(t),t.$name&&(i[t.$name]=t)},i.$removeControl=function(t){t.$name&&i[t.$name]===t&&delete i[t.$name],y(a,function(e,n){i.$setValidity(n,!0,t)}),B(u,t)},i.$setValidity=function(t,e,n){var r=a[t];if(e)r&&(B(r,n),r.length||(--s||(c(e),i.$valid=!0,i.$invalid=!1),a[t]=!1,c(!0,t),o.$setValidity(t,!0,i)));else{if(s||c(e),r){if(-1!=L(r,n))return}else a[t]=r=[],s++,c(!1,t),o.$setValidity(t,!1,i);r.push(n),i.$valid=!1,i.$invalid=!0}},i.$setDirty=function(){r.removeClass(t,ur),r.addClass(t,cr),i.$dirty=!0,i.$pristine=!1,o.$setDirty()},i.$setPristine=function(){r.removeClass(t,cr),r.addClass(t,ur),i.$dirty=!1,i.$pristine=!0,y(u,function(t){t.$setPristine()})}}Xn.$inject=["$element","$attrs","$scope","$animate"];var Gn=function(t){return["$timeout",function(e){return{name:"form",restrict:t?"EAC":"E",controller:Xn,compile:function(){return{pre:function(t,r,i,o){if(!i.action){var s=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1};wt(r[0],"submit",s),r.on("$destroy",function(){e(function(){bt(r[0],"submit",s)},0,!1)})}var a=r.parent().controller("form"),u=i.name||i.ngForm;u&&sn(t,u,o,u),a&&r.on("$destroy",function(){a.$removeControl(o),u&&sn(t,u,n,u),C(o,Jn)})}}}}}]},Kn=Gn(),Yn=Gn(!0),Zn=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,tr=/^[a-z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*$/i,er=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,nr={text:ir,number:function(t,e,r,i,o,s){if(ir(t,e,r,i,o,s),i.$parsers.push(function(t){var e=i.$isEmpty(t);return e||er.test(t)?(i.$setValidity("number",!0),""===t?null:e?t:parseFloat(t)):(i.$setValidity("number",!1),n)}),function(t,e,n){var r=n.prop("validity");j(r)&&t.$parsers.push(function(n){if(t.$error[e]||!(r.badInput||r.customError||r.typeMismatch)||r.valueMissing)return n;t.$setValidity(e,!1)})}(i,"number",e),i.$formatters.push(function(t){return i.$isEmpty(t)?"":""+t}),r.min){var a=function(t){var e=parseFloat(r.min);return rr(i,"min",i.$isEmpty(t)||t>=e,t)};i.$parsers.push(a),i.$formatters.push(a)}if(r.max){var u=function(t){var e=parseFloat(r.max);return rr(i,"max",i.$isEmpty(t)||t<=e,t)};i.$parsers.push(u),i.$formatters.push(u)}i.$formatters.push(function(t){return rr(i,"number",i.$isEmpty(t)||D(t),t)})},url:function(t,e,n,r,i,o){ir(t,e,n,r,i,o);var s=function(t){return rr(r,"url",r.$isEmpty(t)||Zn.test(t),t)};r.$formatters.push(s),r.$parsers.push(s)},email:function(t,e,n,r,i,o){ir(t,e,n,r,i,o);var s=function(t){return rr(r,"email",r.$isEmpty(t)||tr.test(t),t)};r.$formatters.push(s),r.$parsers.push(s)},radio:function(t,e,n,r){M(n.name)&&e.attr("name",x());e.on("click",function(){e[0].checked&&t.$apply(function(){r.$setViewValue(n.value)})}),r.$render=function(){var t=n.value;e[0].checked=t==r.$viewValue},n.$observe("value",r.$render)},checkbox:function(t,e,n,r){var i=n.ngTrueValue,o=n.ngFalseValue;N(i)||(i=!0);N(o)||(o=!1);e.on("click",function(){t.$apply(function(){r.$setViewValue(e[0].checked)})}),r.$render=function(){e[0].checked=r.$viewValue},r.$isEmpty=function(t){return t!==i},r.$formatters.push(function(t){return t===i}),r.$parsers.push(function(t){return t?i:o})},hidden:A,button:A,submit:A,reset:A,file:A};function rr(t,e,r,i){return t.$setValidity(e,r),r?i:n}function ir(t,e,n,i,o,s){var a=e.prop("validity");if(!o.android){var u=!1;e.on("compositionstart",function(t){u=!0}),e.on("compositionend",function(){u=!1,c()})}var c=function(){if(!u){var r=e.val();et(n.ngTrim||"T")&&(r=_(r)),(i.$viewValue!==r||a&&""===r&&!a.valueMissing)&&(t.$$phase?i.$setViewValue(r):t.$apply(function(){i.$setViewValue(r)}))}};if(o.hasEvent("input"))e.on("input",c);else{var l,f=function(){l||(l=s.defer(function(){c(),l=null}))};e.on("keydown",function(t){var e=t.keyCode;91===e||15<e&&e<19||37<=e&&e<=40||f()}),o.hasEvent("paste")&&e.on("paste cut",f)}e.on("change",c),i.$render=function(){e.val(i.$isEmpty(i.$viewValue)?"":i.$viewValue)};var h,p,$=n.ngPattern;if($){var d=function(t,e){return rr(i,"pattern",i.$isEmpty(e)||t.test(e),e)};(p=$.match(/^\/(.*)\/([gim]*)$/))?($=new RegExp(p[1],p[2]),h=function(t){return d($,t)}):h=function(n){var i=t.$eval($);if(!i||!i.test)throw r("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",$,i,nt(e));return d(i,n)},i.$formatters.push(h),i.$parsers.push(h)}if(n.ngMinlength){var v=k(n.ngMinlength),g=function(t){return rr(i,"minlength",i.$isEmpty(t)||t.length>=v,t)};i.$parsers.push(g),i.$formatters.push(g)}if(n.ngMaxlength){var m=k(n.ngMaxlength),y=function(t){return rr(i,"maxlength",i.$isEmpty(t)||t.length<=m,t)};i.$parsers.push(y),i.$formatters.push(y)}}var or=["$browser","$sniffer",function(t,e){return{restrict:"E",require:"?ngModel",link:function(n,r,o,s){s&&(nr[i(o.type)]||nr.text)(n,r,o,s,e,t)}}}],sr="ng-valid",ar="ng-invalid",ur="ng-pristine",cr="ng-dirty",lr=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate",function(t,e,n,i,o,s){this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$name=n.name;var a=o(n.ngModel),u=a.assign;if(!u)throw r("ngModel")("nonassign","Expression '{0}' is non-assignable. Element: {1}",n.ngModel,nt(i));this.$render=A,this.$isEmpty=function(t){return M(t)||""===t||null===t||t!=t};var c=i.inheritedData("$formController")||Jn,l=0,f=this.$error={};function h(t,e){e=e?"-"+lt(e,"-"):"",s.removeClass(i,(t?ar:sr)+e),s.addClass(i,(t?sr:ar)+e)}i.addClass(ur),h(!0),this.$setValidity=function(t,e){f[t]!==!e&&(e?(f[t]&&l--,l||(h(!0),this.$valid=!0,this.$invalid=!1)):(h(!1),this.$invalid=!0,this.$valid=!1,l++),f[t]=!e,h(e,t),c.$setValidity(t,e,this))},this.$setPristine=function(){this.$dirty=!1,this.$pristine=!0,s.removeClass(i,cr),s.addClass(i,ur)},this.$setViewValue=function(n){this.$viewValue=n,this.$pristine&&(this.$dirty=!0,this.$pristine=!1,s.removeClass(i,ur),s.addClass(i,cr),c.$setDirty()),y(this.$parsers,function(t){n=t(n)}),this.$modelValue!==n&&(this.$modelValue=n,u(t,n),y(this.$viewChangeListeners,function(t){try{t()}catch(t){e(t)}}))};var p=this;t.$watch(function(){var e=a(t);if(p.$modelValue!==e){var n=p.$formatters,r=n.length;for(p.$modelValue=e;r--;)e=n[r](e);p.$viewValue!==e&&(p.$viewValue=e,p.$render())}return e})}],fr=function(){return{require:["ngModel","^?form"],controller:lr,link:function(t,e,n,r){var i=r[0],o=r[1]||Jn;o.$addControl(i),t.$on("$destroy",function(){o.$removeControl(i)})}}},hr=T({require:"ngModel",link:function(t,e,n,r){r.$viewChangeListeners.push(function(){t.$eval(n.ngChange)})}}),pr=function(){return{require:"?ngModel",link:function(t,e,n,r){if(r){n.required=!0;var i=function(t){return n.required&&r.$isEmpty(t)?void r.$setValidity("required",!1):(r.$setValidity("required",!0),t)};r.$formatters.push(i),r.$parsers.unshift(i),n.$observe("required",function(){i(r.$viewValue)})}}}},$r=function(){return{require:"ngModel",link:function(t,e,r,i){var o=/\/(.*)\//.exec(r.ngList),s=o&&new RegExp(o[1])||r.ngList||",";i.$parsers.push(function(t){if(!M(t)){var e=[];return t&&y(t.split(s),function(t){t&&e.push(_(t))}),e}}),i.$formatters.push(function(t){return q(t)?t.join(", "):n}),i.$isEmpty=function(t){return!t||!t.length}}}},dr=/^(true|false|\d+)$/,vr=function(){return{priority:100,compile:function(t,e){return dr.test(e.ngValue)?function(t,e,n){n.$set("value",t.$eval(n.ngValue))}:function(t,e,n){t.$watch(n.ngValue,function(t){n.$set("value",t)})}}}},gr=zn(function(t,e,r){e.addClass("ng-binding").data("$binding",r.ngBind),t.$watch(r.ngBind,function(t){e.text(t==n?"":t)})}),mr=["$interpolate",function(t){return function(e,n,r){var i=t(n.attr(r.$attr.ngBindTemplate));n.addClass("ng-binding").data("$binding",i),r.$observe("ngBindTemplate",function(t){n.text(t)})}}],yr=["$sce","$parse",function(t,e){return function(n,r,i){r.addClass("ng-binding").data("$binding",i.ngBindHtml);var o=e(i.ngBindHtml);n.$watch(function(){return(o(n)||"").toString()},function(e){r.html(t.getTrustedHtml(o(n))||"")})}}];function wr(t,e){return t="ngClass"+t,["$animate",function(n){return{restrict:"AC",link:function(o,s,a){var u;function c(t){var e=l(t,1);a.$addClass(e)}function l(t,e){var n=s.data("$classCounts")||{},r=[];return y(t,function(t){(e>0||n[t])&&(n[t]=(n[t]||0)+e,n[t]===+(e>0)&&r.push(t))}),s.data("$classCounts",n),r.join(" ")}function f(t){if(!0===e||o.$index%2===e){var a=i(t||[]);if(u){if(!Q(t,u)){!function(t,e){var i=r(e,t),o=r(t,e);o=l(o,-1),0===(i=l(i,1)).length?n.removeClass(s,o):0===o.length?n.addClass(s,i):n.setClass(s,i,o)}(i(u),a)}}else c(a)}u=z(t)}o.$watch(a[t],f,!0),a.$observe("class",function(e){f(o.$eval(a[t]))}),"ngClass"!==t&&o.$watch("$index",function(n,r){var s=1&n;if(s!==r&1){var u=i(o.$eval(a[t]));s===e?c(u):function(t){var e=l(t,-1);a.$removeClass(e)}(u)}})}};function r(t,e){var n=[];t:for(var r=0;r<t.length;r++){for(var i=t[r],o=0;o<e.length;o++)if(i==e[o])continue t;n.push(i)}return n}function i(t){if(q(t))return t;if(N(t))return t.split(" ");if(j(t)){var e=[];return y(t,function(t,n){t&&e.push(n)}),e}return t}}]}var br=wr("",!0),xr=wr("Odd",0),Sr=wr("Even",1),Cr=zn({compile:function(t,e){e.$set("ngCloak",n),t.removeClass("ng-cloak")}}),kr=[function(){return{scope:!0,controller:"@",priority:500}}],Er={};y("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(t){var e=me("ng-"+t);Er[e]=["$parse",function(n){return{compile:function(r,o){var s=n(o[e]);return function(e,n,r){n.on(i(t),function(t){e.$apply(function(){s(e,{$event:t})})})}}}}]});var Ar=["$animate",function(t){return{transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(n,r,i,o,s){var a,u,c;n.$watch(i.ngIf,function(o){et(o)?u||(u=n.$new(),s(u,function(n){n[n.length++]=e.createComment(" end ngIf: "+i.ngIf+" "),a={clone:n},t.enter(n,r.parent(),r)})):(c&&(c.remove(),c=null),u&&(u.$destroy(),u=null),a&&(c=dt(a.clone),t.leave(c,function(){c=null}),a=null))})}}}],Or=["$http","$templateCache","$anchorScroll","$animate","$sce",function(t,e,n,r,i){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:v.noop,compile:function(o,s){var a=s.ngInclude||s.src,u=s.onload||"",c=s.autoscroll;return function(o,s,l,f,h){var p,$,d,v=0,g=function(){$&&($.remove(),$=null),p&&(p.$destroy(),p=null),d&&(r.leave(d,function(){$=null}),$=d,d=null)};o.$watch(i.parseAsResourceUrl(a),function(i){var a=function(){!P(c)||c&&!o.$eval(c)||n()},l=++v;i?(t.get(i,{cache:e}).success(function(t){if(l===v){var e=o.$new();f.template=t;var n=h(e,function(t){g(),r.enter(t,null,s,a)});d=n,(p=e).$emit("$includeContentLoaded"),o.$eval(u)}}).error(function(){l===v&&g()}),o.$emit("$includeContentRequested")):(g(),f.template=null)})}}}}],Tr=["$compile",function(t){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(e,n,r,i){n.html(i.template),t(n.contents())(e)}}}],Mr=zn({priority:450,compile:function(){return{pre:function(t,e,n){t.$eval(n.ngInit)}}}}),Pr=zn({terminal:!0,priority:1e3}),jr=["$locale","$interpolate",function(t,e){var n=/{}/g;return{restrict:"EA",link:function(r,o,s){var a=s.count,u=s.$attr.when&&o.attr(s.$attr.when),c=s.offset||0,l=r.$eval(u)||{},f={},h=e.startSymbol(),p=e.endSymbol(),$=/^when(Minus)?(.+)$/;y(s,function(t,e){$.test(e)&&(l[i(e.replace("when","").replace("Minus","-"))]=o.attr(s.$attr[e]))}),y(l,function(t,r){f[r]=e(t.replace(n,h+a+"-"+c+p))}),r.$watch(function(){var e=parseFloat(r.$eval(a));return isNaN(e)?"":(e in l||(e=t.pluralCat(e-c)),f[e](r,o,!0))},function(t){o.text(t)})}}}],Nr=["$parse","$animate",function(t,n){var i=r("ngRepeat");return{transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,link:function(r,a,c,l,f){var h,p,$,d,v,g,w,b,x,S=c.ngRepeat,C=S.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),k={$id:Yt};if(!C)throw i("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",S);if(g=C[1],w=C[2],(h=C[3])?(p=t(h),$=function(t,e,n){return x&&(k[x]=t),k[b]=e,k.$index=n,p(r,k)}):(d=function(t,e){return Yt(e)},v=function(t){return t}),!(C=g.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/)))throw i("iidexp","'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",g);b=C[3]||C[1],x=C[2];var E={};r.$watchCollection(w,function(t){var c,l,h,p,g,w,C,k,A,O,T,M,P=a[0],j={},N=[];if(m(t))O=t,A=$||d;else{for(w in A=$||v,O=[],t)t.hasOwnProperty(w)&&"$"!=w.charAt(0)&&O.push(w);O.sort()}for(p=O.length,l=N.length=O.length,c=0;c<l;c++)if(pt(k=A(w=t===O?c:O[c],C=t[w],c),"`track by` id"),E.hasOwnProperty(k))T=E[k],delete E[k],j[k]=T,N[c]=T;else{if(j.hasOwnProperty(k))throw y(N,function(t){t&&t.scope&&(E[t.id]=t)}),i("dupes","Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}",S,k);N[c]={id:k},j[k]=!1}for(w in E)E.hasOwnProperty(w)&&(M=dt((T=E[w]).clone),n.leave(M),y(M,function(t){t.$$NG_REMOVED=!0}),T.scope.$destroy());for(c=0,l=O.length;c<l;c++){if(C=t[w=t===O?c:O[c]],T=N[c],N[c-1]&&(P=s(N[c-1])),T.scope){g=T.scope,h=P;do{h=h.nextSibling}while(h&&h.$$NG_REMOVED);o(T)!=h&&n.move(dt(T.clone),null,u(P)),P=s(T)}else g=r.$new();g[b]=C,x&&(g[x]=w),g.$index=c,g.$first=0===c,g.$last=c===p-1,g.$middle=!(g.$first||g.$last),g.$odd=!(g.$even=0==(1&c)),T.scope||f(g,function(t){t[t.length++]=e.createComment(" end ngRepeat: "+S+" "),n.enter(t,null,u(P)),P=t,T.scope=g,T.clone=t,j[T.id]=T})}E=j})}};function o(t){return t.clone[0]}function s(t){return t.clone[t.clone.length-1]}}],Dr=["$animate",function(t){return function(e,n,r){e.$watch(r.ngShow,function(e){t[et(e)?"removeClass":"addClass"](n,"ng-hide")})}}],Rr=["$animate",function(t){return function(e,n,r){e.$watch(r.ngHide,function(e){t[et(e)?"addClass":"removeClass"](n,"ng-hide")})}}],qr=zn(function(t,e,n){t.$watch(n.ngStyle,function(t,n){n&&t!==n&&y(n,function(t,n){e.css(n,"")}),t&&e.css(t)},!0)}),Vr=["$animate",function(t){return{restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(e,n,r,i){var o,s,a,u=r.ngSwitch||r.on,c=[];e.$watch(u,function(n){var u,l=c.length;if(l>0){if(a){for(u=0;u<l;u++)a[u].remove();a=null}for(a=[],u=0;u<l;u++){var f=s[u];c[u].$destroy(),a[u]=f,t.leave(f,function(){a.splice(u,1),0===a.length&&(a=null)})}}s=[],c=[],(o=i.cases["!"+n]||i.cases["?"])&&(e.$eval(r.change),y(o,function(n){var r=e.$new();c.push(r),n.transclude(r,function(e){var r=n.element;s.push(e),t.enter(e,r.parent(),r)})}))})}}}],Ir=zn({transclude:"element",priority:800,require:"^ngSwitch",link:function(t,e,n,r,i){r.cases["!"+n.ngSwitchWhen]=r.cases["!"+n.ngSwitchWhen]||[],r.cases["!"+n.ngSwitchWhen].push({transclude:i,element:e})}}),Ur=zn({transclude:"element",priority:800,require:"^ngSwitch",link:function(t,e,n,r,i){r.cases["?"]=r.cases["?"]||[],r.cases["?"].push({transclude:i,element:e})}}),Fr=zn({link:function(t,e,n,i,o){if(!o)throw r("ngTransclude")("orphan","Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}",nt(e));o(function(t){e.empty(),e.append(t)})}}),_r=["$templateCache",function(t){return{restrict:"E",terminal:!0,compile:function(e,n){if("text/ng-template"==n.type){var r=n.id,i=e[0].text;t.put(r,i)}}}}],Hr=r("ngOptions"),Lr=T({terminal:!0}),Br=["$compile","$parse",function(t,r){var i=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,o={$setViewValue:A};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(t,e,n){var r,i=this,s={},a=o;i.databound=n.ngModel,i.init=function(t,e,n){a=t,e,r=n},i.addOption=function(e){pt(e,'"option value"'),s[e]=!0,a.$viewValue==e&&(t.val(e),r.parent()&&r.remove())},i.removeOption=function(t){this.hasOption(t)&&(delete s[t],a.$viewValue==t&&this.renderUnknownOption(t))},i.renderUnknownOption=function(e){var n="? "+Yt(e)+" ?";r.val(n),t.prepend(r),t.val(n),r.prop("selected",!0)},i.hasOption=function(t){return s.hasOwnProperty(t)},e.$on("$destroy",function(){i.renderUnknownOption=A})}],link:function(o,s,a,c){if(c[1]){for(var l,f=c[0],h=c[1],p=a.multiple,$=a.ngOptions,d=!1,v=u(e.createElement("option")),g=u(e.createElement("optgroup")),m=v.clone(),b=0,x=s.children(),S=x.length;b<S;b++)if(""===x[b].value){l=d=x.eq(b);break}f.init(h,d,m),p&&(h.$isEmpty=function(t){return!t||0===t.length}),$?function(e,o,s){var a;if(!(a=$.match(i)))throw Hr("iexp","Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}",$,nt(o));var u=r(a[2]||a[1]),c=a[4]||a[6],l=a[5],f=r(a[3]||""),h=r(a[2]?a[1]:c),m=r(a[7]),y=a[8]?r(a[8]):null,b=[[{element:o,label:""}]];d&&(t(d)(e),d.removeClass("ng-scope"),d.remove());function x(){var t,n,r,i,a,$,x,S,C,k,E,A,O,T,M,j={"":[]},N=[""],D=s.$modelValue,R=m(e)||[],V=l?w(R):R,I={},U=!1;if(p)if(y&&q(D)){U=new Zt([]);for(var F=0;F<D.length;F++)I[c]=D[F],U.put(y(e,I),D[F])}else U=new Zt(D);for(E=0;C=V.length,E<C;E++){if(x=E,l){if("$"===(x=V[E]).charAt(0))continue;I[l]=x}if(I[c]=R[x],t=f(e,I)||"",(n=j[t])||(n=j[t]=[],N.push(t)),p)A=P(U.remove(y?y(e,I):h(e,I)));else{if(y){var _={};_[c]=D,A=y(e,_)===y(e,I)}else A=D===h(e,I);U=U||A}M=P(M=u(e,I))?M:"",n.push({id:y?y(e,I):l?V[E]:E,label:M,selected:A})}for(p||(d||null===D?j[""].unshift({id:"",label:"",selected:!U}):U||j[""].unshift({id:"?",label:"",selected:!0})),k=0,S=N.length;k<S;k++){for(t=N[k],n=j[t],b.length<=k?(i={element:g.clone().attr("label",t),label:n.label},a=[i],b.push(a),o.append(i.element)):(a=b[k],(i=a[0]).label!=t&&i.element.attr("label",i.label=t)),O=null,E=0,C=n.length;E<C;E++)r=n[E],($=a[E+1])?(O=$.element,$.label!==r.label&&O.text($.label=r.label),$.id!==r.id&&O.val($.id=r.id),$.selected!==r.selected&&O.prop("selected",$.selected=r.selected)):(""===r.id&&d?T=d:(T=v.clone()).val(r.id).attr("selected",r.selected).text(r.label),a.push($={element:T,label:r.label,id:r.id,selected:r.selected}),O?O.after(T):i.element.append(T),O=T);for(E++;a.length>E;)a.pop().element.remove()}for(;b.length>k;)b.pop()[0].element.remove()}o.empty(),o.on("change",function(){e.$apply(function(){var t,r,i,a,u,f,$,d,v,g=m(e)||[],w={};if(p){for(i=[],f=0,d=b.length;f<d;f++)for(t=b[f],u=1,$=t.length;u<$;u++)if((a=t[u].element)[0].selected){if(r=a.val(),l&&(w[l]=r),y)for(v=0;v<g.length&&(w[c]=g[v],y(e,w)!=r);v++);else w[c]=g[r];i.push(h(e,w))}}else{if("?"==(r=o.val()))i=n;else if(""===r)i=null;else if(y){for(v=0;v<g.length;v++)if(w[c]=g[v],y(e,w)==r){i=h(e,w);break}}else w[c]=g[r],l&&(w[l]=r),i=h(e,w);b[0].length>1&&b[0][1].id!==r&&(b[0][1].selected=!1)}s.$setViewValue(i)})}),s.$render=x,e.$watch(x)}(o,s,h):p?function(t,e,n){var r;n.$render=function(){var t=new Zt(n.$viewValue);y(e.find("option"),function(e){e.selected=P(t.get(e.value))})},t.$watch(function(){Q(r,n.$viewValue)||(r=z(n.$viewValue),n.$render())}),e.on("change",function(){t.$apply(function(){var t=[];y(e.find("option"),function(e){e.selected&&t.push(e.value)}),n.$setViewValue(t)})})}(o,s,h):function(t,e,n,r){n.$render=function(){var t=n.$viewValue;r.hasOption(t)?(m.parent()&&m.remove(),e.val(t),""===t&&l.prop("selected",!0)):M(t)&&l?e.val(""):r.renderUnknownOption(t)},e.on("change",function(){t.$apply(function(){m.parent()&&m.remove(),n.$setViewValue(e.val())})})}(o,s,h,f)}}}}],zr=["$interpolate",function(t){var e={addOption:A,removeOption:A};return{restrict:"E",priority:100,compile:function(n,r){if(M(r.value)){var i=t(n.text(),!0);i||r.$set("value",n.text())}return function(t,n,r){var o=n.parent(),s=o.data("$selectController")||o.parent().data("$selectController");s&&s.databound?n.prop("selected",!1):s=e,i?t.$watch(i,function(t,e){r.$set("value",t),t!==e&&s.removeOption(e),s.addOption(t)}):s.addOption(r.value),n.on("$destroy",function(){s.removeOption(r.value)})}}}}],Wr=T({restrict:"E",terminal:!0});t.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):((c=t.jQuery)?(u=c,C(c.fn,{scope:Jt.scope,isolateScope:Jt.isolateScope,controller:Jt.controller,injector:Jt.injector,inheritedData:Jt.inheritedData}),Et("remove",!0,!0,!1),Et("empty",!1,!1,!1),Et("html",!1,!1,!0)):u=Dt,v.element=u,function(e){C(e,{bootstrap:ut,copy:z,extend:C,equals:Q,element:u,forEach:y,injector:se,noop:A,bind:K,toJson:Z,fromJson:tt,identity:O,isUndefined:M,isDefined:P,isString:N,isFunction:V,isObject:j,isNumber:D,isElement:H,isArray:q,version:vt,isDate:R,lowercase:i,uppercase:s,callbacks:{counter:0},$$minErr:r,$$csp:J}),l=function(t){var e=r("$injector"),n=r("ng");function i(t,e,n){return t[e]||(t[e]=n())}var o=i(t,"angular",Object);return o.$$minErr=o.$$minErr||r,i(o,"module",function(){var t={};return function(r,o,s){return function(t,e){if("hasOwnProperty"===t)throw n("badname","hasOwnProperty is not a valid {0} name",e)}(r,"module"),o&&t.hasOwnProperty(r)&&(t[r]=null),i(t,r,function(){if(!o)throw e("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",r);var t=[],n=[],i=u("$injector","invoke"),a={_invokeQueue:t,_runBlocks:n,requires:o,name:r,provider:u("$provide","provider"),factory:u("$provide","factory"),service:u("$provide","service"),value:u("$provide","value"),constant:u("$provide","constant","unshift"),animation:u("$animateProvider","register"),filter:u("$filterProvider","register"),controller:u("$controllerProvider","register"),directive:u("$compileProvider","directive"),config:i,run:function(t){return n.push(t),this}};return s&&i(s),a;function u(e,n,r){return function(){return t[r||"push"]([e,n,arguments]),a}}})}})}(t);try{l("ngLocale")}catch(t){l("ngLocale",[]).provider("$locale",Ne)}l("ng",["ngLocale"],["$provide",function(t){t.provider({$$sanitizeUri:$n}),t.provider("$compile",ve).directive({a:Wn,input:or,textarea:or,form:Kn,script:_r,select:Br,style:Wr,option:zr,ngBind:gr,ngBindHtml:yr,ngBindTemplate:mr,ngClass:br,ngClassEven:Sr,ngClassOdd:xr,ngCloak:Cr,ngController:kr,ngForm:Yn,ngHide:Rr,ngIf:Ar,ngInclude:Or,ngInit:Mr,ngNonBindable:Pr,ngPluralize:jr,ngRepeat:Nr,ngShow:Dr,ngStyle:qr,ngSwitch:Vr,ngSwitchWhen:Ir,ngSwitchDefault:Ur,ngOptions:Lr,ngTransclude:Fr,ngModel:fr,ngList:$r,ngChange:hr,required:pr,ngRequired:pr,ngValue:vr}).directive({ngInclude:Tr}).directive(Qn).directive(Er),t.provider({$anchorScroll:ae,$animate:ce,$browser:he,$cacheFactory:pe,$controller:we,$document:be,$exceptionHandler:xe,$filter:An,$interpolate:Pe,$interval:je,$http:Ae,$httpBackend:Te,$location:Je,$log:Xe,$parse:ln,$rootScope:pn,$q:fn,$sce:yn,$sceDelegate:mn,$sniffer:wn,$templateCache:$e,$timeout:bn,$window:En,$$rAF:hn,$$asyncCallback:le})}])}(v),u(e).ready(function(){!function(t,n){var r,i,o=[t],s=["ng:app","ng-app","x-ng-app","data-ng-app"],a=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;function u(t){t&&o.push(t)}y(s,function(n){s[n]=!0,u(e.getElementById(n)),n=n.replace(":","\\:"),t.querySelectorAll&&(y(t.querySelectorAll("."+n),u),y(t.querySelectorAll("."+n+"\\:"),u),y(t.querySelectorAll("["+n+"]"),u))}),y(o,function(t){if(!r){var e=" "+t.className+" ",n=a.exec(e);n?(r=t,i=(n[2]||"").replace(/\s+/g,",")):y(t.attributes,function(e){!r&&s[e.name]&&(r=t,i=e.value)})}}),r&&n(r,i?[i]:[])}(e,ut)}))}(window,document),!angular.$$csp()&&angular.element(document).find("head").prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}.ng-animate-block-transitions{transition:0s all!important;-webkit-transition:0s all!important;}</style>');;!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.moment=e()}(this,function(){"use strict";function t(){return Ft.apply(null,arguments)}function e(t){return"[object Array]"===Object.prototype.toString.call(t)}function n(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function r(t,e){for(var n in e)i(e,n)&&(t[n]=e[n]);return i(e,"toString")&&(t.toString=e.toString),i(e,"valueOf")&&(t.valueOf=e.valueOf),t}function s(t,e,n,i){return tt(t,e,n,i,!0).utc()}function o(t){return null==t._pf&&(t._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}),t._pf}function a(t){if(null==t._isValid){var e=o(t);t._isValid=!(isNaN(t._d.getTime())||!(e.overflow<0)||e.empty||e.invalidMonth||e.invalidWeekday||e.nullInput||e.invalidFormat||e.userInvalidated),t._strict&&(t._isValid=t._isValid&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour)}return t._isValid}function u(t){var e=s(NaN);return null!=t?r(o(e),t):o(e).userInvalidated=!0,e}function d(t,e){var n,i,r;if(void 0!==e._isAMomentObject&&(t._isAMomentObject=e._isAMomentObject),void 0!==e._i&&(t._i=e._i),void 0!==e._f&&(t._f=e._f),void 0!==e._l&&(t._l=e._l),void 0!==e._strict&&(t._strict=e._strict),void 0!==e._tzm&&(t._tzm=e._tzm),void 0!==e._isUTC&&(t._isUTC=e._isUTC),void 0!==e._offset&&(t._offset=e._offset),void 0!==e._pf&&(t._pf=o(e)),void 0!==e._locale&&(t._locale=e._locale),xt.length>0)for(n in xt)void 0!==(r=e[i=xt[n]])&&(t[i]=r);return t}function l(e){d(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),!1===Ht&&(Ht=!0,t.updateOffset(this),Ht=!1)}function c(t){return t instanceof l||null!=t&&null!=t._isAMomentObject}function h(t){return 0>t?Math.ceil(t):Math.floor(t)}function f(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=h(e)),n}function m(t,e,n){var i,r=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),o=0;for(i=0;r>i;i++)(n&&t[i]!==e[i]||!n&&f(t[i])!==f(e[i]))&&o++;return o+s}function _(){}function y(t){return t?t.toLowerCase().replace("_","-"):t}function p(t){var e=null;if(!Lt[t]&&"undefined"!=typeof module&&module&&module.exports)try{e=Pt._abbr,require("./locale/"+t),g(e)}catch(t){}return Lt[t]}function g(t,e){var n;return t&&((n=void 0===e?D(t):v(t,e))&&(Pt=n)),Pt._abbr}function v(t,e){return null!==e?(e.abbr=t,Lt[t]=Lt[t]||new _,Lt[t].set(e),g(t),Lt[t]):(delete Lt[t],null)}function D(t){var n;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Pt;if(!e(t)){if(n=p(t))return n;t=[t]}return function(t){for(var e,n,i,r,s=0;s<t.length;){for(e=(r=y(t[s]).split("-")).length,n=(n=y(t[s+1]))?n.split("-"):null;e>0;){if(i=p(r.slice(0,e).join("-")))return i;if(n&&n.length>=e&&m(r,n,!0)>=e-1)break;e--}s++}return null}(t)}function M(t,e){var n=t.toLowerCase();It[n]=It[n+"s"]=It[e]=t}function Y(t){return"string"==typeof t?It[t]||It[t.toLowerCase()]:void 0}function w(t){var e,n,r={};for(n in t)i(t,n)&&((e=Y(n))&&(r[e]=t[n]));return r}function S(e,n){return function(i){return null!=i?(T(this,e,i),t.updateOffset(this,n),this):k(this,e)}}function k(t,e){return t._d["get"+(t._isUTC?"UTC":"")+e]()}function T(t,e,n){return t._d["set"+(t._isUTC?"UTC":"")+e](n)}function b(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if("function"==typeof this[t=Y(t)])return this[t](e);return this}function O(t,e,n){var i=""+Math.abs(t),r=e-i.length;return(t>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}function U(t,e,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),t&&(Zt[t]=r),e&&(Zt[e[0]]=function(){return O(r.apply(this,arguments),e[1],e[2])}),n&&(Zt[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function W(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function C(t,e){return t.isValid()?(e=G(e,t.localeData()),Nt[e]=Nt[e]||function(t){var e,n,i=t.match(At);for(e=0,n=i.length;n>e;e++)Zt[i[e]]?i[e]=Zt[i[e]]:i[e]=W(i[e]);return function(r){var s="";for(e=0;n>e;e++)s+=i[e]instanceof Function?i[e].call(r,t):i[e];return s}}(e),Nt[e](t)):t.localeData().invalidDate()}function G(t,e){function n(t){return e.longDateFormat(t)||t}var i=5;for(zt.lastIndex=0;i>=0&&zt.test(t);)t=t.replace(zt,n),zt.lastIndex=0,i-=1;return t}function F(t,e,n){ne[t]=function(t){return"function"==typeof t&&"[object Function]"===Object.prototype.toString.call(t)}(e)?e:function(t){return t&&n?n:e}}function P(t,e){return i(ne,t)?ne[t](e._strict,e._locale):new RegExp(function(t){return t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,r){return e||n||i||r}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(t))}function x(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(i=function(t,n){n[e]=f(t)}),n=0;n<t.length;n++)ie[t[n]]=i}function H(t,e){x(t,function(t,n,i,r){i._w=i._w||{},e(t,i._w,i,r)})}function L(t,e,n){null!=e&&i(ie,t)&&ie[t](e,n._a,n,t)}function I(t,e){return new Date(Date.UTC(t,e+1,0)).getUTCDate()}function A(t,e){var n;return"string"==typeof e&&"number"!=typeof(e=t.localeData().monthsParse(e))?t:(n=Math.min(t.date(),I(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t)}function z(e){return null!=e?(A(this,e),t.updateOffset(this,!0),this):k(this,"Month")}function N(t){var e,n=t._a;return n&&-2===o(t).overflow&&(e=n[se]<0||n[se]>11?se:n[oe]<1||n[oe]>I(n[re],n[se])?oe:n[ae]<0||n[ae]>24||24===n[ae]&&(0!==n[ue]||0!==n[de]||0!==n[le])?ae:n[ue]<0||n[ue]>59?ue:n[de]<0||n[de]>59?de:n[le]<0||n[le]>999?le:-1,o(t)._overflowDayOfYear&&(re>e||e>oe)&&(e=oe),o(t).overflow=e),t}function Z(e){!1===t.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function j(t,e){var n=!0;return r(function(){return n&&(Z(t+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}function E(t){var e,n,i=t._i,r=me.exec(i);if(r){for(o(t).iso=!0,e=0,n=_e.length;n>e;e++)if(_e[e][1].exec(i)){t._f=_e[e][0];break}for(e=0,n=ye.length;n>e;e++)if(ye[e][1].exec(i)){t._f+=(r[6]||" ")+ye[e][0];break}i.match(te)&&(t._f+="Z"),Q(t)}else t._isValid=!1}function V(t){var e=new Date(Date.UTC.apply(null,arguments));return 1970>t&&e.setUTCFullYear(t),e}function q(t){return J(t)?366:365}function J(t){return t%4==0&&t%100!=0||t%400==0}function $(t,e,n){var i,r=n-e,s=n-t.day();return s>r&&(s-=7),r-7>s&&(s+=7),i=et(t).add(s,"d"),{week:Math.ceil(i.dayOfYear()/7),year:i.year()}}function R(t,e,n){return null!=t?t:null!=e?e:n}function B(t){var e,n,i,r,s=[];if(!t._d){for(i=function(t){var e=new Date;return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[oe]&&null==t._a[se]&&function(t){var e,n,i,r,s,o,a;null!=(e=t._w).GG||null!=e.W||null!=e.E?(s=1,o=4,n=R(e.GG,t._a[re],$(et(),1,4).year),i=R(e.W,1),r=R(e.E,1)):(s=t._locale._week.dow,o=t._locale._week.doy,n=R(e.gg,t._a[re],$(et(),s,o).year),i=R(e.w,1),null!=e.d?(r=e.d,s>r&&++i):r=null!=e.e?e.e+s:s),a=function(t,e,n,i,r){var s,o=6+r-i,a=V(t,0,1+o).getUTCDay();return r>a&&(a+=7),{year:(s=1+o+7*(e-1)-a+(n=null!=n?1*n:r))>0?t:t-1,dayOfYear:s>0?s:q(t-1)+s}}(n,i,r,o,s),t._a[re]=a.year,t._dayOfYear=a.dayOfYear}(t),t._dayOfYear&&(r=R(t._a[re],i[re]),t._dayOfYear>q(r)&&(o(t)._overflowDayOfYear=!0),n=V(r,0,t._dayOfYear),t._a[se]=n.getUTCMonth(),t._a[oe]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=s[e]=i[e];for(;7>e;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[ae]&&0===t._a[ue]&&0===t._a[de]&&0===t._a[le]&&(t._nextDay=!0,t._a[ae]=0),t._d=(t._useUTC?V:function(t,e,n,i,r,s,o){var a=new Date(t,e,n,i,r,s,o);return 1970>t&&a.setFullYear(t),a}).apply(null,s),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[ae]=24)}}function Q(e){if(e._f!==t.ISO_8601){e._a=[],o(e).empty=!0;var n,i,r,s,a,u=""+e._i,d=u.length,l=0;for(r=G(e._f,e._locale).match(At)||[],n=0;n<r.length;n++)s=r[n],(i=(u.match(P(s,e))||[])[0])&&((a=u.substr(0,u.indexOf(i))).length>0&&o(e).unusedInput.push(a),u=u.slice(u.indexOf(i)+i.length),l+=i.length),Zt[s]?(i?o(e).empty=!1:o(e).unusedTokens.push(s),L(s,i,e)):e._strict&&!i&&o(e).unusedTokens.push(s);o(e).charsLeftOver=d-l,u.length>0&&o(e).unusedInput.push(u),!0===o(e).bigHour&&e._a[ae]<=12&&e._a[ae]>0&&(o(e).bigHour=void 0),e._a[ae]=function(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((i=t.isPM(n))&&12>e&&(e+=12),i||12!==e||(e=0),e):e}(e._locale,e._a[ae],e._meridiem),B(e),N(e)}else E(e)}function X(t){var i=t._i,s=t._f;return t._locale=t._locale||D(t._l),null===i||void 0===s&&""===i?u({nullInput:!0}):("string"==typeof i&&(t._i=i=t._locale.preparse(i)),c(i)?new l(N(i)):(e(s)?function(t){var e,n,i,s,u;if(0===t._f.length)return o(t).invalidFormat=!0,void(t._d=new Date(NaN));for(s=0;s<t._f.length;s++)u=0,e=d({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[s],Q(e),a(e)&&(u+=o(e).charsLeftOver,u+=10*o(e).unusedTokens.length,o(e).score=u,(null==i||i>u)&&(i=u,n=e));r(t,n||e)}(t):s?Q(t):n(i)?t._d=i:K(t),t))}function K(i){var r=i._i;void 0===r?i._d=new Date:n(r)?i._d=new Date(+r):"string"==typeof r?function(e){var n=pe.exec(e._i);null!==n?e._d=new Date(+n[1]):(E(e),!1===e._isValid&&(delete e._isValid,t.createFromInputFallback(e)))}(i):e(r)?(i._a=function(t,e){var n,i=[];for(n=0;n<t.length;++n)i.push(e(t[n],n));return i}(r.slice(0),function(t){return parseInt(t,10)}),B(i)):"object"==typeof r?function(t){if(!t._d){var e=w(t._i);t._a=[e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],B(t)}}(i):"number"==typeof r?i._d=new Date(r):t.createFromInputFallback(i)}function tt(t,e,n,i,r){var s={};return"boolean"==typeof n&&(i=n,n=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=r,s._l=n,s._i=t,s._f=e,s._strict=i,function(t){var e=new l(N(X(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}(s)}function et(t,e,n,i){return tt(t,e,n,i,!1)}function nt(t,n){var i,r;if(1===n.length&&e(n[0])&&(n=n[0]),!n.length)return et();for(i=n[0],r=1;r<n.length;++r)(!n[r].isValid()||n[r][t](i))&&(i=n[r]);return i}function it(t){var e=w(t),n=e.year||0,i=e.quarter||0,r=e.month||0,s=e.week||0,o=e.day||0,a=e.hour||0,u=e.minute||0,d=e.second||0,l=e.millisecond||0;this._milliseconds=+l+1e3*d+6e4*u+36e5*a,this._days=+o+7*s,this._months=+r+3*i+12*n,this._data={},this._locale=D(),this._bubble()}function rt(t){return t instanceof it}function st(t,e){U(t,0,0,function(){var t=this.utcOffset(),n="+";return 0>t&&(t=-t,n="-"),n+O(~~(t/60),2)+e+O(~~t%60,2)})}function ot(t){var e=(t||"").match(te)||[],n=((e[e.length-1]||[])+"").match(Me)||["-",0,0],i=60*n[1]+f(n[2]);return"+"===n[0]?i:-i}function at(e,i){var r,s;return i._isUTC?(r=i.clone(),s=(c(e)||n(e)?+e:+et(e))-+r,r._d.setTime(+r._d+s),t.updateOffset(r,!1),r):et(e).local()}function ut(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function dt(){return this._isUTC&&0===this._offset}function lt(t,e){var n,r,s,o=t,a=null;return rt(t)?o={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(o={},e?o[e]=t:o.milliseconds=t):(a=Ye.exec(t))?(n="-"===a[1]?-1:1,o={y:0,d:f(a[oe])*n,h:f(a[ae])*n,m:f(a[ue])*n,s:f(a[de])*n,ms:f(a[le])*n}):(a=we.exec(t))?(n="-"===a[1]?-1:1,o={y:ct(a[2],n),M:ct(a[3],n),d:ct(a[4],n),h:ct(a[5],n),m:ct(a[6],n),s:ct(a[7],n),w:ct(a[8],n)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(s=function(t,e){var n;return e=at(e,t),t.isBefore(e)?n=ht(t,e):((n=ht(e,t)).milliseconds=-n.milliseconds,n.months=-n.months),n}(et(o.from),et(o.to)),(o={}).ms=s.milliseconds,o.M=s.months),r=new it(o),rt(t)&&i(t,"_locale")&&(r._locale=t._locale),r}function ct(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function ht(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function ft(t,e){return function(n,i){var r;return null===i||isNaN(+i)||(function(t,e){fe[t]||(Z(e),fe[t]=!0)}(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),r=n,n=i,i=r),mt(this,lt(n="string"==typeof n?+n:n,i),t),this}}function mt(e,n,i,r){var s=n._milliseconds,o=n._days,a=n._months;r=null==r||r,s&&e._d.setTime(+e._d+s*i),o&&T(e,"Date",k(e,"Date")+o*i),a&&A(e,k(e,"Month")+a*i),r&&t.updateOffset(e,o||a)}function _t(){var t=this.clone().utc();return 0<t.year()&&t.year()<=9999?"function"==typeof Date.prototype.toISOString?this.toDate().toISOString():C(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):C(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function yt(t){var e;return void 0===t?this._locale._abbr:(null!=(e=D(t))&&(this._locale=e),this)}function pt(){return this._locale}function gt(t,e){U(0,[t,t.length],0,e)}function vt(t,e,n){return $(et([t,11,31+e-n]),e,n).week}function Dt(t,e){U(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Mt(t,e){return e._meridiemParse}function Yt(t,e){e[le]=f(1e3*("0."+t))}function wt(t){return t}function St(t,e,n,i){var r=D(),o=s().set(i,e);return r[n](o,t)}function kt(t,e,n,i,r){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return St(t,e,n,r);var s,o=[];for(s=0;i>s;s++)o[s]=St(t,s,n,r);return o}function Tt(t,e,n,i){var r=lt(e,n);return t._milliseconds+=i*r._milliseconds,t._days+=i*r._days,t._months+=i*r._months,t._bubble()}function bt(t){return 0>t?Math.floor(t):Math.ceil(t)}function Ot(t){return 4800*t/146097}function Ut(t){return 146097*t/4800}function Wt(t){return function(){return this.as(t)}}function Ct(t){return function(){return this._data[t]}}function Gt(){var t,e,n=rn(this._milliseconds)/1e3,i=rn(this._days),r=rn(this._months);e=h((t=h(n/60))/60),n%=60,t%=60;var s=h(r/12),o=r%=12,a=i,u=e,d=t,l=n,c=this.asSeconds();return c?(0>c?"-":"")+"P"+(s?s+"Y":"")+(o?o+"M":"")+(a?a+"D":"")+(u||d||l?"T":"")+(u?u+"H":"")+(d?d+"M":"")+(l?l+"S":""):"P0D"}var Ft,Pt,xt=t.momentProperties=[],Ht=!1,Lt={},It={},At=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,zt=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Nt={},Zt={},jt=/\d/,Et=/\d\d/,Vt=/\d{3}/,qt=/\d{4}/,Jt=/[+-]?\d{6}/,$t=/\d\d?/,Rt=/\d{1,3}/,Bt=/\d{1,4}/,Qt=/[+-]?\d{1,6}/,Xt=/\d+/,Kt=/[+-]?\d+/,te=/Z|[+-]\d\d:?\d\d/gi,ee=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ne={},ie={},re=0,se=1,oe=2,ae=3,ue=4,de=5,le=6;U("M",["MM",2],"Mo",function(){return this.month()+1}),U("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),U("MMMM",0,0,function(t){return this.localeData().months(this,t)}),M("month","M"),F("M",$t),F("MM",$t,Et),F("MMM",ee),F("MMMM",ee),x(["M","MM"],function(t,e){e[se]=f(t)-1}),x(["MMM","MMMM"],function(t,e,n,i){var r=n._locale.monthsParse(t,i,n._strict);null!=r?e[se]=r:o(n).invalidMonth=t});var ce="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),he="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),fe={};t.suppressDeprecationWarnings=!1;var me=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_e=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],ye=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],pe=/^\/?Date\((\-?\d+)/i;t.createFromInputFallback=j("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),U(0,["YY",2],0,function(){return this.year()%100}),U(0,["YYYY",4],0,"year"),U(0,["YYYYY",5],0,"year"),U(0,["YYYYYY",6,!0],0,"year"),M("year","y"),F("Y",Kt),F("YY",$t,Et),F("YYYY",Bt,qt),F("YYYYY",Qt,Jt),F("YYYYYY",Qt,Jt),x(["YYYYY","YYYYYY"],re),x("YYYY",function(e,n){n[re]=2===e.length?t.parseTwoDigitYear(e):f(e)}),x("YY",function(e,n){n[re]=t.parseTwoDigitYear(e)}),t.parseTwoDigitYear=function(t){return f(t)+(f(t)>68?1900:2e3)};var ge=S("FullYear",!1);U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),M("week","w"),M("isoWeek","W"),F("w",$t),F("ww",$t,Et),F("W",$t),F("WW",$t,Et),H(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=f(t)});U("DDD",["DDDD",3],"DDDo","dayOfYear"),M("dayOfYear","DDD"),F("DDD",Rt),F("DDDD",Vt),x(["DDD","DDDD"],function(t,e,n){n._dayOfYear=f(t)}),t.ISO_8601=function(){};var ve=j("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=et.apply(null,arguments);return this>t?this:t}),De=j("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=et.apply(null,arguments);return t>this?this:t});st("Z",":"),st("ZZ",""),F("Z",te),F("ZZ",te),x(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=ot(t)});var Me=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var Ye=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,we=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;lt.fn=it.prototype;var Se=ft(1,"add"),ke=ft(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Te=j("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});U(0,["gg",2],0,function(){return this.weekYear()%100}),U(0,["GG",2],0,function(){return this.isoWeekYear()%100}),gt("gggg","weekYear"),gt("ggggg","weekYear"),gt("GGGG","isoWeekYear"),gt("GGGGG","isoWeekYear"),M("weekYear","gg"),M("isoWeekYear","GG"),F("G",Kt),F("g",Kt),F("GG",$t,Et),F("gg",$t,Et),F("GGGG",Bt,qt),F("gggg",Bt,qt),F("GGGGG",Qt,Jt),F("ggggg",Qt,Jt),H(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=f(t)}),H(["gg","GG"],function(e,n,i,r){n[r]=t.parseTwoDigitYear(e)}),U("Q",0,0,"quarter"),M("quarter","Q"),F("Q",jt),x("Q",function(t,e){e[se]=3*(f(t)-1)}),U("D",["DD",2],"Do","date"),M("date","D"),F("D",$t),F("DD",$t,Et),F("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),x(["D","DD"],oe),x("Do",function(t,e){e[oe]=f(t.match($t)[0])});var be=S("Date",!0);U("d",0,"do","day"),U("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),U("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),U("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),M("day","d"),M("weekday","e"),M("isoWeekday","E"),F("d",$t),F("e",$t),F("E",$t),F("dd",ee),F("ddd",ee),F("dddd",ee),H(["dd","ddd","dddd"],function(t,e,n){var i=n._locale.weekdaysParse(t);null!=i?e.d=i:o(n).invalidWeekday=t}),H(["d","e","E"],function(t,e,n,i){e[i]=f(t)});var Oe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ue="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),We="Su_Mo_Tu_We_Th_Fr_Sa".split("_");U("H",["HH",2],0,"hour"),U("h",["hh",2],0,function(){return this.hours()%12||12}),Dt("a",!0),Dt("A",!1),M("hour","h"),F("a",Mt),F("A",Mt),F("H",$t),F("h",$t),F("HH",$t,Et),F("hh",$t,Et),x(["H","HH"],ae),x(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),x(["h","hh"],function(t,e,n){e[ae]=f(t),o(n).bigHour=!0});var Ce=S("Hours",!0);U("m",["mm",2],0,"minute"),M("minute","m"),F("m",$t),F("mm",$t,Et),x(["m","mm"],ue);var Ge=S("Minutes",!1);U("s",["ss",2],0,"second"),M("second","s"),F("s",$t),F("ss",$t,Et),x(["s","ss"],de);var Fe,Pe=S("Seconds",!1);for(U("S",0,0,function(){return~~(this.millisecond()/100)}),U(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,function(){return 10*this.millisecond()}),U(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),U(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),U(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),U(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),U(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),M("millisecond","ms"),F("S",Rt,jt),F("SS",Rt,Et),F("SSS",Rt,Vt),Fe="SSSS";Fe.length<=9;Fe+="S")F(Fe,Xt);for(Fe="S";Fe.length<=9;Fe+="S")x(Fe,Yt);var xe=S("Milliseconds",!1);U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var He=l.prototype;He.add=Se,He.calendar=function(t,e){var n=t||et(),i=at(n,this).startOf("day"),r=this.diff(i,"days",!0),s=-6>r?"sameElse":-1>r?"lastWeek":0>r?"lastDay":1>r?"sameDay":2>r?"nextDay":7>r?"nextWeek":"sameElse";return this.format(e&&e[s]||this.localeData().calendar(s,this,et(n)))},He.clone=function(){return new l(this)},He.diff=function(t,e,n){var i,r,s=at(t,this),o=6e4*(s.utcOffset()-this.utcOffset());return"year"===(e=Y(e))||"month"===e||"quarter"===e?(r=function(t,e){var n,i,r=12*(e.year()-t.year())+(e.month()-t.month()),s=t.clone().add(r,"months");return 0>e-s?(n=t.clone().add(r-1,"months"),i=(e-s)/(s-n)):(n=t.clone().add(r+1,"months"),i=(e-s)/(n-s)),-(r+i)}(this,s),"quarter"===e?r/=3:"year"===e&&(r/=12)):(i=this-s,r="second"===e?i/1e3:"minute"===e?i/6e4:"hour"===e?i/36e5:"day"===e?(i-o)/864e5:"week"===e?(i-o)/6048e5:i),n?r:h(r)},He.endOf=function(t){return void 0===(t=Y(t))||"millisecond"===t?this:this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms")},He.format=function(e){var n=C(this,e||t.defaultFormat);return this.localeData().postformat(n)},He.from=function(t,e){return this.isValid()?lt({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},He.fromNow=function(t){return this.from(et(),t)},He.to=function(t,e){return this.isValid()?lt({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},He.toNow=function(t){return this.to(et(),t)},He.get=b,He.invalidAt=function(){return o(this).overflow},He.isAfter=function(t,e){return"millisecond"===(e=Y(void 0!==e?e:"millisecond"))?+this>+(t=c(t)?t:et(t)):(c(t)?+t:+et(t))<+this.clone().startOf(e)},He.isBefore=function(t,e){var n;return"millisecond"===(e=Y(void 0!==e?e:"millisecond"))?+(t=c(t)?t:et(t))>+this:(n=c(t)?+t:+et(t),+this.clone().endOf(e)<n)},He.isBetween=function(t,e,n){return this.isAfter(t,n)&&this.isBefore(e,n)},He.isSame=function(t,e){var n;return"millisecond"===(e=Y(e||"millisecond"))?+this==+(t=c(t)?t:et(t)):(n=+et(t),+this.clone().startOf(e)<=n&&n<=+this.clone().endOf(e))},He.isValid=function(){return a(this)},He.lang=Te,He.locale=yt,He.localeData=pt,He.max=De,He.min=ve,He.parsingFlags=function(){return r({},o(this))},He.set=b,He.startOf=function(t){switch(t=Y(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this},He.subtract=ke,He.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},He.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},He.toDate=function(){return this._offset?new Date(+this):this._d},He.toISOString=_t,He.toJSON=_t,He.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},He.unix=function(){return Math.floor(+this/1e3)},He.valueOf=function(){return+this._d-6e4*(this._offset||0)},He.year=ge,He.isLeapYear=function(){return J(this.year())},He.weekYear=function(t){var e=$(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==t?e:this.add(t-e,"y")},He.isoWeekYear=function(t){var e=$(this,1,4).year;return null==t?e:this.add(t-e,"y")},He.quarter=He.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},He.month=z,He.daysInMonth=function(){return I(this.year(),this.month())},He.week=He.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},He.isoWeek=He.isoWeeks=function(t){var e=$(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},He.weeksInYear=function(){var t=this.localeData()._week;return vt(this.year(),t.dow,t.doy)},He.isoWeeksInYear=function(){return vt(this.year(),1,4)},He.date=be,He.day=He.days=function(t){var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},He.weekday=function(t){var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},He.isoWeekday=function(t){return null==t?this.day()||7:this.day(this.day()%7?t:t-7)},He.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},He.hour=He.hours=Ce,He.minute=He.minutes=Ge,He.second=He.seconds=Pe,He.millisecond=He.milliseconds=xe,He.utcOffset=function(e,n){var i,r=this._offset||0;return null!=e?("string"==typeof e&&(e=ot(e)),Math.abs(e)<16&&(e*=60),!this._isUTC&&n&&(i=ut(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),r!==e&&(!n||this._changeInProgress?mt(this,lt(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?r:ut(this)},He.utc=function(t){return this.utcOffset(0,t)},He.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(ut(this),"m")),this},He.parseZone=function(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(ot(this._i)),this},He.hasAlignedHourOffset=function(t){return t=t?et(t).utcOffset():0,(this.utcOffset()-t)%60==0},He.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},He.isDSTShifted=function(){if(void 0!==this._isDSTShifted)return this._isDSTShifted;var t={};if(d(t,this),(t=X(t))._a){var e=t._isUTC?s(t._a):et(t._a);this._isDSTShifted=this.isValid()&&m(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted},He.isLocal=function(){return!this._isUTC},He.isUtcOffset=function(){return this._isUTC},He.isUtc=dt,He.isUTC=dt,He.zoneAbbr=function(){return this._isUTC?"UTC":""},He.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},He.dates=j("dates accessor is deprecated. Use date instead.",be),He.months=j("months accessor is deprecated. Use month instead",z),He.years=j("years accessor is deprecated. Use year instead",ge),He.zone=j("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()});var Le=He,Ie=_.prototype;Ie._calendar={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Ie.calendar=function(t,e,n){var i=this._calendar[t];return"function"==typeof i?i.call(e,n):i},Ie._longDateFormat={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Ie.longDateFormat=function(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])},Ie._invalidDate="Invalid date",Ie.invalidDate=function(){return this._invalidDate},Ie._ordinal="%d",Ie.ordinal=function(t){return this._ordinal.replace("%d",t)},Ie._ordinalParse=/\d{1,2}/,Ie.preparse=wt,Ie.postformat=wt,Ie._relativeTime={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Ie.relativeTime=function(t,e,n,i){var r=this._relativeTime[n];return"function"==typeof r?r(t,e,n,i):r.replace(/%d/i,t)},Ie.pastFuture=function(t,e){var n=this._relativeTime[t>0?"future":"past"];return"function"==typeof n?n(e):n.replace(/%s/i,e)},Ie.set=function(t){var e,n;for(n in t)"function"==typeof(e=t[n])?this[n]=e:this["_"+n]=e;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},Ie.months=function(t){return this._months[t.month()]},Ie._months=ce,Ie.monthsShort=function(t){return this._monthsShort[t.month()]},Ie._monthsShort=he,Ie.monthsParse=function(t,e,n){var i,r,o;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;12>i;i++){if(r=s([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(o="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}},Ie.week=function(t){return $(t,this._week.dow,this._week.doy).week},Ie._week={dow:0,doy:6},Ie.firstDayOfYear=function(){return this._week.doy},Ie.firstDayOfWeek=function(){return this._week.dow},Ie.weekdays=function(t){return this._weekdays[t.day()]},Ie._weekdays=Oe,Ie.weekdaysMin=function(t){return this._weekdaysMin[t.day()]},Ie._weekdaysMin=We,Ie.weekdaysShort=function(t){return this._weekdaysShort[t.day()]},Ie._weekdaysShort=Ue,Ie.weekdaysParse=function(t){var e,n,i;for(this._weekdaysParse=this._weekdaysParse||[],e=0;7>e;e++)if(this._weekdaysParse[e]||(n=et([2e3,1]).day(e),i="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[e]=new RegExp(i.replace(".",""),"i")),this._weekdaysParse[e].test(t))return e},Ie.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},Ie._meridiemParse=/[ap]\.?m?\.?/i,Ie.meridiem=function(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"},g("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===f(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),t.lang=j("moment.lang is deprecated. Use moment.locale instead.",g),t.langData=j("moment.langData is deprecated. Use moment.localeData instead.",D);var Ae=Math.abs,ze=Wt("ms"),Ne=Wt("s"),Ze=Wt("m"),je=Wt("h"),Ee=Wt("d"),Ve=Wt("w"),qe=Wt("M"),Je=Wt("y"),$e=Ct("milliseconds"),Re=Ct("seconds"),Be=Ct("minutes"),Qe=Ct("hours"),Xe=Ct("days"),Ke=Ct("months"),tn=Ct("years"),en=Math.round,nn={s:45,m:45,h:22,d:26,M:11},rn=Math.abs,sn=it.prototype;return sn.abs=function(){var t=this._data;return this._milliseconds=Ae(this._milliseconds),this._days=Ae(this._days),this._months=Ae(this._months),t.milliseconds=Ae(t.milliseconds),t.seconds=Ae(t.seconds),t.minutes=Ae(t.minutes),t.hours=Ae(t.hours),t.months=Ae(t.months),t.years=Ae(t.years),this},sn.add=function(t,e){return Tt(this,t,e,1)},sn.subtract=function(t,e){return Tt(this,t,e,-1)},sn.as=function(t){var e,n,i=this._milliseconds;if("month"===(t=Y(t))||"year"===t)return e=this._days+i/864e5,n=this._months+Ot(e),"month"===t?n:n/12;switch(e=this._days+Math.round(Ut(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}},sn.asMilliseconds=ze,sn.asSeconds=Ne,sn.asMinutes=Ze,sn.asHours=je,sn.asDays=Ee,sn.asWeeks=Ve,sn.asMonths=qe,sn.asYears=Je,sn.valueOf=function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*f(this._months/12)},sn._bubble=function(){var t,e,n,i,r,s=this._milliseconds,o=this._days,a=this._months,u=this._data;return s>=0&&o>=0&&a>=0||0>=s&&0>=o&&0>=a||(s+=864e5*bt(Ut(a)+o),o=0,a=0),u.milliseconds=s%1e3,t=h(s/1e3),u.seconds=t%60,e=h(t/60),u.minutes=e%60,n=h(e/60),u.hours=n%24,a+=r=h(Ot(o+=h(n/24))),o-=bt(Ut(r)),i=h(a/12),a%=12,u.days=o,u.months=a,u.years=i,this},sn.get=function(t){return this[(t=Y(t))+"s"]()},sn.milliseconds=$e,sn.seconds=Re,sn.minutes=Be,sn.hours=Qe,sn.days=Xe,sn.weeks=function(){return h(this.days()/7)},sn.months=Ke,sn.years=tn,sn.humanize=function(t){var e=this.localeData(),n=function(t,e,n){var i=lt(t).abs(),r=en(i.as("s")),s=en(i.as("m")),o=en(i.as("h")),a=en(i.as("d")),u=en(i.as("M")),d=en(i.as("y")),l=r<nn.s&&["s",r]||1===s&&["m"]||s<nn.m&&["mm",s]||1===o&&["h"]||o<nn.h&&["hh",o]||1===a&&["d"]||a<nn.d&&["dd",a]||1===u&&["M"]||u<nn.M&&["MM",u]||1===d&&["y"]||["yy",d];return l[2]=e,l[3]=+t>0,l[4]=n,function(t,e,n,i,r){return r.relativeTime(e||1,!!n,t,i)}.apply(null,l)}(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)},sn.toISOString=Gt,sn.toString=Gt,sn.toJSON=Gt,sn.locale=yt,sn.localeData=pt,sn.toIsoString=j("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Gt),sn.lang=Te,U("X",0,0,"unix"),U("x",0,0,"valueOf"),F("x",Kt),F("X",/[+-]?\d+(\.\d{1,3})?/),x("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),x("x",function(t,e,n){n._d=new Date(f(t))}),t.version="2.10.6",function(t){Ft=t}(et),t.fn=Le,t.min=function(){return nt("isBefore",[].slice.call(arguments,0))},t.max=function(){return nt("isAfter",[].slice.call(arguments,0))},t.utc=s,t.unix=function(t){return et(1e3*t)},t.months=function(t,e){return kt(t,e,"months",12,"month")},t.isDate=n,t.locale=g,t.invalid=u,t.duration=lt,t.isMoment=c,t.weekdays=function(t,e){return kt(t,e,"weekdays",7,"day")},t.parseZone=function(){return et.apply(null,arguments).parseZone()},t.localeData=D,t.isDuration=rt,t.monthsShort=function(t,e){return kt(t,e,"monthsShort",12,"month")},t.weekdaysMin=function(t,e){return kt(t,e,"weekdaysMin",7,"day")},t.defineLocale=v,t.weekdaysShort=function(t,e){return kt(t,e,"weekdaysShort",7,"day")},t.normalizeUnits=Y,t.relativeTimeThreshold=function(t,e){return void 0!==nn[t]&&(void 0===e?nn[t]:(nn[t]=e,!0))},t});;!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){t.ui=t.ui||{};t.ui.version="1.12.0";var e,i=0,s=Array.prototype.slice;t.cleanData=(e=t.cleanData,function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{(s=t._data(n,"events"))&&s.remove&&t(n).triggerHandler("remove")}catch(t){}e(i)}),t.widget=function(e,i,s){var n,o,a,r={},h=e.split(".")[0],l=h+"-"+(e=e.split(".")[1]);return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][l.toLowerCase()]=function(e){return!!t.data(e,l)},t[h]=t[h]||{},n=t[h][e],o=t[h][e]=function(t,e){if(!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),(a=new i).options=t.widget.extend({},a.options),t.each(s,function(e,s){t.isFunction(s)?r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}():r[e]=s}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n&&a.widgetEventPrefix||e},r,{constructor:o,namespace:h,widgetName:e,widgetFullName:l}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,n,o=s.call(arguments,1),a=0,r=o.length;a<r;a++)for(i in o[a])n=o[a][i],o[a].hasOwnProperty(i)&&void 0!==n&&(t.isPlainObject(n)?e[i]=t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):e[i]=n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=s.call(arguments,1),h=this;return a?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(h=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r))!==s&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0:t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+o+"'")}):(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new i(o,this))})),h}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},e=(s=e.split(".")).shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;o<s.length-1;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){var i=[],s=this;function n(n,o){var a,r;for(r=0;r<n.length;r++)a=s.classesElementLookup[n[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),s.classesElementLookup[n[r]]=a,i.push(n[r]),o&&e.classes[n[r]]&&i.push(e.classes[n[r]])}return(e=t.extend({element:this.element,classes:this.options.classes||{}},e)).keys&&n(e.keys.match(/\S+/g)||[],!0),e.extra&&n(e.extra.match(/\S+/g)||[]),i.join(" ")},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){if(e||!0!==o.options.disabled&&!t(this).hasClass("ui-state-disabled"))return("string"==typeof a?o[a]:a).apply(o,arguments)}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},(i=t.Event(i)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&!1===a.apply(this.element[0],[i].concat(s))||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){var a;"string"==typeof n&&(n={effect:n});var r=n?!0===n||"number"==typeof n?i:n.effect||i:e;"number"==typeof(n=n||{})&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}});t.widget;!function(){var e,i,s=Math.max,n=Math.abs,o=Math.round,a=/left|center|right/,r=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,l=/^\w+/,c=/%$/,u=t.fn.position;function d(t,e,i){return[parseFloat(t[0])*(c.test(t[0])?e/100:1),parseFloat(t[1])*(c.test(t[1])?i/100:1)]}function p(e,i){return parseInt(t.css(e,i),10)||0}i=function(){var e=t("<div>").css("position","absolute").appendTo("body").offset({top:1.5,left:1.5}),s=1.5===e.offset().top;return e.remove(),i=function(){return s},s},t.position={scrollbarWidth:function(){if(void 0!==e)return e;var i,s,n=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),i===(s=o.offsetWidth)&&(s=n[0].clientWidth),n.remove(),e=i-s},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth;return{width:"scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:!s&&!n?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return u.apply(this,arguments);e=t.extend({},e);var c,f,g,m,_,v,b,y,w=t(e.of),k=t.position.getWithinInfo(e.within),x=t.position.getScrollInfo(k),C=(e.collision||"flip").split(" "),D={};return v=9===(y=(b=w)[0]).nodeType?{width:b.width(),height:b.height(),offset:{top:0,left:0}}:t.isWindow(y)?{width:b.width(),height:b.height(),offset:{top:b.scrollTop(),left:b.scrollLeft()}}:y.preventDefault?{width:0,height:0,offset:{top:y.pageY,left:y.pageX}}:{width:b.outerWidth(),height:b.outerHeight(),offset:b.offset()},w[0].preventDefault&&(e.at="left top"),f=v.width,g=v.height,m=v.offset,_=t.extend({},m),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=a.test(s[0])?s.concat(["center"]):r.test(s[0])?["center"].concat(s):["center","center"]),s[0]=a.test(s[0])?s[0]:"center",s[1]=r.test(s[1])?s[1]:"center",t=h.exec(s[0]),i=h.exec(s[1]),D[this]=[t?t[0]:0,i?i[0]:0],e[this]=[l.exec(s[0])[0],l.exec(s[1])[0]]}),1===C.length&&(C[1]=C[0]),"right"===e.at[0]?_.left+=f:"center"===e.at[0]&&(_.left+=f/2),"bottom"===e.at[1]?_.top+=g:"center"===e.at[1]&&(_.top+=g/2),c=d(D.at,f,g),_.left+=c[0],_.top+=c[1],this.each(function(){var a,r,h=t(this),l=h.outerWidth(),u=h.outerHeight(),v=p(this,"marginLeft"),b=p(this,"marginTop"),y=l+v+p(this,"marginRight")+x.width,I=u+b+p(this,"marginBottom")+x.height,T=t.extend({},_),P=d(D.my,h.outerWidth(),h.outerHeight());"right"===e.my[0]?T.left-=l:"center"===e.my[0]&&(T.left-=l/2),"bottom"===e.my[1]?T.top-=u:"center"===e.my[1]&&(T.top-=u/2),T.left+=P[0],T.top+=P[1],i()||(T.left=o(T.left),T.top=o(T.top)),a={marginLeft:v,marginTop:b},t.each(["left","top"],function(i,s){t.ui.position[C[i]]&&t.ui.position[C[i]][s](T,{targetWidth:f,targetHeight:g,elemWidth:l,elemHeight:u,collisionPosition:a,collisionWidth:y,collisionHeight:I,offset:[c[0]+P[0],c[1]+P[1]],my:e.my,at:e.at,within:k,elem:h})}),e.using&&(r=function(t){var i=m.left-T.left,o=i+f-l,a=m.top-T.top,r=a+g-u,c={target:{element:w,left:m.left,top:m.top,width:f,height:g},element:{element:h,left:T.left,top:T.top,width:l,height:u},horizontal:o<0?"left":i>0?"right":"center",vertical:r<0?"top":a>0?"bottom":"middle"};f<l&&n(i+o)<f&&(c.horizontal="center"),g<u&&n(a+r)<g&&(c.vertical="middle"),s(n(i),n(o))>s(n(a),n(r))?c.important="horizontal":c.important="vertical",e.using.call(this,t,c)}),h.offset(t.extend(T,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,n=e.within,o=n.isWindow?n.scrollLeft:n.offset.left,a=n.width,r=t.left-e.collisionPosition.marginLeft,h=o-r,l=r+e.collisionWidth-a-o;e.collisionWidth>a?h>0&&l<=0?(i=t.left+h+e.collisionWidth-a-o,t.left+=h-i):t.left=l>0&&h<=0?o:h>l?o+a-e.collisionWidth:o:h>0?t.left+=h:l>0?t.left-=l:t.left=s(t.left-r,t.left)},top:function(t,e){var i,n=e.within,o=n.isWindow?n.scrollTop:n.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=o-r,l=r+e.collisionHeight-a-o;e.collisionHeight>a?h>0&&l<=0?(i=t.top+h+e.collisionHeight-a-o,t.top+=h-i):t.top=l>0&&h<=0?o:h>l?o+a-e.collisionHeight:o:h>0?t.top+=h:l>0?t.top-=l:t.top=s(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,o=e.within,a=o.offset.left+o.scrollLeft,r=o.width,h=o.isWindow?o.scrollLeft:o.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];c<0?((i=t.left+d+p+f+e.collisionWidth-r-a)<0||i<n(c))&&(t.left+=d+p+f):u>0&&((s=t.left-e.collisionPosition.marginLeft+d+p+f-h)>0||n(s)<u)&&(t.left+=d+p+f)},top:function(t,e){var i,s,o=e.within,a=o.offset.top+o.scrollTop,r=o.height,h=o.isWindow?o.scrollTop:o.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,p="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,f=-2*e.offset[1];c<0?((s=t.top+d+p+f+e.collisionHeight-r-a)<0||s<n(c))&&(t.top+=d+p+f):u>0&&((i=t.top-e.collisionPosition.marginTop+d+p+f-h)>0||n(i)<u)&&(t.top+=d+p+f)}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}();var n;t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:(n="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(n+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}});t.ui.focusable=function(e,i){var s,n,o,a,r,h=e.nodeName.toLowerCase();return"area"===h?(n=(s=e.parentNode).name,!(!e.href||!n||"map"!==s.nodeName.toLowerCase())&&((o=t("img[usemap='#"+n+"']")).length>0&&o.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(h)?(a=!e.disabled)&&(r=t(e).closest("fieldset")[0])&&(a=!r.disabled):a="a"===h&&e.href||i,a&&t(e).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}(t(e)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}});t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}};"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){var s="Width"===i?["Left","Right"]:["Top","Bottom"],n=i.toLowerCase(),o={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};function a(e,i,n,o){return t.each(s,function(){i-=parseFloat(t.css(e,"padding"+this))||0,n&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}t.fn["inner"+i]=function(e){return void 0===e?o["inner"+i].call(this):this.each(function(){t(this).css(n,a(this,e)+"px")})},t.fn["outer"+i]=function(e,s){return"number"!=typeof e?o["outer"+i].call(this,e):this.each(function(){t(this).css(n,a(this,e,!0,s)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))});t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=(o=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g,function(t){return t.replace(o,"\\$1")}),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),(s=this.attr("id"))&&(o=(e=this.eq(0).parents().last()).add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return(!s||"static"!==e.css("position"))&&n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:(a=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var o,a,r=!1;t(document).on("mouseup",function(){r=!1});t.widget("ui.mouse",{version:"1.12.0",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){if(!0===t.data(i.target,e.widgetName+".preventClickEvent"))return t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!r){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,n=!("string"!=typeof this.options.cancel||!e.target.nodeName)&&t(e.target).closest(this.options.cancel).length;return!(s&&!n&&this._mouseCapture(e))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(e),!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),r=!0,!0))}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,r=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n<o.length;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")};t.widget("ui.draggable",t.ui.mouse,{version:"1.12.0",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(e){var i=this.options;return this._blurActiveElement(e),!(this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(e),!!this.handle&&(this._blockFrames(!0===i.iframeFix?"iframe":i.iframeFix),!0))},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0]),s=t(e.target);this._getHandle(e)&&s.closest(i).length||t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),!1===this._trigger("start",e)?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(!1===this._trigger("drag",e,s))return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||!0===this.options.revert||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==i._trigger("stop",e)&&i._clear()}):!1!==this._trigger("stop",e)&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return!this.options.handle||!!t(e.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper),n=s?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options,o=this.document[0];this.relativeContainer=null,n.containment?"window"!==n.containment?"document"!==n.containment?n.containment.constructor!==Array?("parent"===n.containment&&(n.containment=this.helper[0].parentNode),(s=(i=t(n.containment))[0])&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i)):this.containment=n.containment:this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,n,o,a=this.options,r=this._isRootNode(this.scrollParent[0]),h=t.pageX,l=t.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o),"y"===a.axis&&(h=this.originalPageX),"x"===a.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var n=t.extend({},i,{item:s.element});s.sortables=[],t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,n))})},stop:function(e,i,s){var n=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,t.each(s.sortables,function(){this.isOver?(this.isOver=0,s.cancelHelperRemoval=!0,this.cancelHelperRemoval=!1,this._storedCSS={position:this.placeholder.css("position"),top:this.placeholder.css("top"),left:this.placeholder.css("left")},this._mouseStop(e),this.options.helper=this.options._helper):(this.cancelHelperRemoval=!0,this._trigger("deactivate",e,n))})},drag:function(e,i,s){t.each(s.sortables,function(){var n=!1,o=this;o.positionAbs=s.positionAbs,o.helperProportions=s.helperProportions,o.offset.click=s.offset.click,o._intersectsWith(o.containerCache)&&(n=!0,t.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(n=!1),n})),n?(o.isOver||(o.isOver=1,s._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=s.offset.click.top,o.offset.click.left=s.offset.click.left,o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top,s._trigger("toSortable",e),s.dropped=o.element,t.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,o.fromOutside=s),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(e),i.position=s._generatePosition(e,!0),s._trigger("fromSortable",e),s.dropped=!1,t.each(s.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var n=t("body"),o=s.options;n.css("cursor")&&(o._cursor=n.css("cursor")),n.css("cursor",o.cursor)},stop:function(e,i,s){var n=s.options;n._cursor&&t("body").css("cursor",n._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("opacity")&&(o._opacity=n.css("opacity")),n.css("opacity",o.opacity)},stop:function(e,i,s){var n=s.options;n._opacity&&t(i.helper).css("opacity",n._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,s){var n=s.options,o=!1,a=s.scrollParentNotHidden[0],r=s.document[0];a!==r&&"HTML"!==a.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+a.offsetHeight-e.pageY<n.scrollSensitivity?a.scrollTop=o=a.scrollTop+n.scrollSpeed:e.pageY-s.overflowOffset.top<n.scrollSensitivity&&(a.scrollTop=o=a.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+a.offsetWidth-e.pageX<n.scrollSensitivity?a.scrollLeft=o=a.scrollLeft+n.scrollSpeed:e.pageX-s.overflowOffset.left<n.scrollSensitivity&&(a.scrollLeft=o=a.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(e.pageY-t(r).scrollTop()<n.scrollSensitivity?o=t(r).scrollTop(t(r).scrollTop()-n.scrollSpeed):t(window).height()-(e.pageY-t(r).scrollTop())<n.scrollSensitivity&&(o=t(r).scrollTop(t(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(e.pageX-t(r).scrollLeft()<n.scrollSensitivity?o=t(r).scrollLeft(t(r).scrollLeft()-n.scrollSpeed):t(window).width()-(e.pageX-t(r).scrollLeft())<n.scrollSensitivity&&(o=t(r).scrollLeft(t(r).scrollLeft()+n.scrollSpeed)))),!1!==o&&t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(s,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,i,s){var n=s.options;s.snapElements=[],t(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var e=t(this),i=e.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})})},drag:function(e,i,s){var n,o,a,r,h,l,c,u,d,p,f=s.options,g=f.snapTolerance,m=i.offset.left,_=m+s.helperProportions.width,v=i.offset.top,b=v+s.helperProportions.height;for(d=s.snapElements.length-1;d>=0;d--)l=(h=s.snapElements[d].left-s.margins.left)+s.snapElements[d].width,u=(c=s.snapElements[d].top-s.margins.top)+s.snapElements[d].height,_<h-g||m>l+g||b<c-g||v>u+g||!t.contains(s.snapElements[d].item.ownerDocument,s.snapElements[d].item)?(s.snapElements[d].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=Math.abs(c-b)<=g,o=Math.abs(u-v)<=g,a=Math.abs(h-_)<=g,r=Math.abs(l-m)<=g,n&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||o||a||r,"outer"!==f.snapMode&&(n=Math.abs(c-v)<=g,o=Math.abs(u-b)<=g,a=Math.abs(h-m)<=g,r=Math.abs(l-_)<=g,n&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[d].snapping&&(n||o||a||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=n||o||a||r||p)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var n,o=s.options,a=t.makeArray(t(o.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});a.length&&(n=parseInt(t(a[0]).css("zIndex"),10)||0,t(a).each(function(e){t(this).css("zIndex",n+e)}),this.css("zIndex",n+a.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("zIndex")&&(o._zIndex=n.css("zIndex")),n.css("zIndex",o.zIndex)},stop:function(e,i,s){var n=s.options;n._zIndex&&t(i.helper).css("zIndex",n._zIndex)}});t.ui.draggable;t.widget("ui.droppable",{version:"1.12.0",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){if(!arguments.length)return e||(e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight});e=arguments[0]},this._addToManager(i.scope),i.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){t.ui.ddmanager.droppables[e]=t.ui.ddmanager.droppables[e]||[],t.ui.ddmanager.droppables[e].push(this)},_splice:function(t){for(var e=0;e<t.length;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var e=t.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,i){if("accept"===e)this.accept=t.isFunction(i)?i:function(t){return t.is(i)};else if("scope"===e){var s=t.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(e,i)},_activate:function(e){var i=t.ui.ddmanager.current;this._addActiveClass(),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this._removeActiveClass(),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._addHoverClass(),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeHoverClass(),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return!(!s||(s.currentItem||s.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=t(this).droppable("instance");if(i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&h(s,t.extend(i,{offset:i.element.offset()}),i.options.tolerance,e))return n=!0,!1}),!n&&(!!this.accept.call(this.element[0],s.currentItem||s.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(s)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var h=t.ui.intersect=function(){function t(t,e,i){return t>=e&&t<e+i}return function(e,i,s,n){if(!i.offset)return!1;var o=(e.positionAbs||e.position.absolute).left+e.margins.left,a=(e.positionAbs||e.position.absolute).top+e.margins.top,r=o+e.helperProportions.width,h=a+e.helperProportions.height,l=i.offset.left,c=i.offset.top,u=l+i.proportions().width,d=c+i.proportions().height;switch(s){case"fit":return l<=o&&r<=u&&c<=a&&h<=d;case"intersect":return l<o+e.helperProportions.width/2&&r-e.helperProportions.width/2<u&&c<a+e.helperProportions.height/2&&h-e.helperProportions.height/2<d;case"pointer":return t(n.pageY,c,i.proportions().height)&&t(n.pageX,l,i.proportions().width);case"touch":return(a>=c&&a<=d||h>=c&&h<=d||a<c&&h>d)&&(o>=l&&o<=u||r>=l&&r<=u||o<l&&r>u);default:return!1}}}();t.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;s<o.length;s++)if(!(o[s].options.disabled||e&&!o[s].accept.call(o[s].element[0],e.currentItem||e.element))){for(n=0;n<r.length;n++)if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue t}o[s].visible="none"!==o[s].element.css("display"),o[s].visible&&("mousedown"===a&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&h(e,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").on("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,o,a=h(e,this,this.options.tolerance,i),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,(o=this.element.parents(":data(ui-droppable)").filter(function(){return t(this).droppable("instance").options.scope===n})).length&&((s=t(o[0]).droppable("instance")).greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").off("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}},!1!==t.uiBackCompat&&t.widget("ui.droppable",t.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}});t.ui.droppable;t.widget("ui.resizable",t.ui.mouse,{version:"1.12.0",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s,n=i&&"left"===i?"scrollLeft":"scrollTop";return e[n]>0||(e[n]=1,s=e[n]>0,e[n]=0,s)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())}).on("mouseleave",function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles()}},_setupHandles:function(){var e,i,s,n,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;i<s.length;i++)n="ui-resizable-"+(e=t.trim(s[i])),o=t("<div>"),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;for(i in e=e||this.element,this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)((s=t(this.handles[i])[0])===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,h=this._change[o];return this._updatePrevProperties(),!!h&&(i=h.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1)},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options;return this._helper&&(n=(s=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:this.sizeDiff.height,o=s?0:this.sizeDiff.width,a={width:this.helper.width()-o,height:this.helper.height()-n},r=parseFloat(this.element.css("left"))+(this.position.left-this.originalPosition.left)||null,h=parseFloat(this.element.css("top"))+(this.position.top-this.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),this.helper.height(this.size.height),this.helper.width(this.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),i<o.maxWidth&&(o.maxWidth=i),n<o.maxHeight&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&c&&(t.top=h-e.minHeight),n&&c&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,h=t(this).resizable("instance"),l=h.options,c=h.element,u=l.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(h.containerElement=t(d),/document/.test(u)||u===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=h._num(e.css("padding"+s))}),h.containerOffset=e.offset(),h.containerPosition=e.position(),h.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,o=h.containerSize.width,a=h._hasScroll(d,"left")?d.scrollWidth:o,r=h._hasScroll(d)?d.scrollHeight:n,h.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?h.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-h.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-h.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance").options;t(e.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),!1!==t.uiBackCompat&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,c=h[1]||1,u=Math.round((n.width-o.width)/l)*l,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,g=s.maxWidth&&s.maxWidth<p,m=s.maxHeight&&s.maxHeight<f,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=h,_&&(p+=l),v&&(f+=c),g&&(p-=l),m&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((f-c<=0||p-l<=0)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-l>0?(i.size.width=p,i.position.left=a.left-u):(p=l-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}});t.ui.resizable,t.widget("ui.selectable",t.ui.mouse,{version:"1.12.0",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e.elementPos=t(e.element[0]).offset(),e.selectees=t(e.options.filter,e.element[0]),e._addClass(e.selectees,"ui-selectee"),e.selectees.each(function(){var i=t(this),s=i.offset(),n={left:s.left-e.elementPos.left,top:s.top-e.elementPos.top};t.data(this,"selectable-item",{element:this,$element:i,left:n.left,top:n.top,right:n.left+i.outerWidth(),bottom:n.top+i.outerHeight(),startselected:!1,selected:i.hasClass("ui-selected"),selecting:i.hasClass("ui-selecting"),unselecting:i.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=t("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.elementPos=t(this.element[0]).offset(),this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(i._removeClass(s.$element,"ui-selected"),s.selected=!1,i._addClass(s.$element,"ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");if(n)return s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),i._removeClass(n.$element,s?"ui-unselecting":"ui-selected")._addClass(n.$element,s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,o=this.opos[0],a=this.opos[1],r=e.pageX,h=e.pageY;return o>r&&(i=r,r=o,o=i),a>h&&(i=h,h=a,a=i),this.helper.css({left:o,top:a,width:r-o,height:h-a}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),l=!1,c={};i&&i.element!==s.element[0]&&(c.left=i.left+s.elementPos.left,c.right=i.right+s.elementPos.left,c.top=i.top+s.elementPos.top,c.bottom=i.bottom+s.elementPos.top,"touch"===n.tolerance?l=!(c.left>r||c.right<o||c.top>h||c.bottom<a):"fit"===n.tolerance&&(l=c.left>o&&c.right<r&&c.top>a&&c.bottom<h),l?(i.selected&&(s._removeClass(i.$element,"ui-selected"),i.selected=!1),i.unselecting&&(s._removeClass(i.$element,"ui-unselecting"),i.unselecting=!1),i.selecting||(s._addClass(i.$element,"ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,s._addClass(i.$element,"ui-selected"),i.selected=!0):(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,i.startselected&&(s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(s._removeClass(i.$element,"ui-selected"),i.selected=!1,s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-selecting")._addClass(s.$element,"ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),t.widget("ui.sortable",t.ui.mouse,{version:"1.12.0",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&t<e+i},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(e),t(e.target).parents().each(function(){if(t.data(this,o.widgetName+"-item")===o)return s=t(this),!1}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),!!s&&(!(this.options.handle&&!i&&(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),!n))&&(this.currentItem=s,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-this.document.scrollTop()<a.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<a.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),e.pageX-this.document.scrollLeft()<a.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),!1!==r&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(n=(s=this.items[i]).item[0],(o=this._intersectsWithPointer(s))&&s.instance===this.currentContainer&&!(n===this.currentItem[0]||this.placeholder[1===o?"next":"prev"]()[0]===n||t.contains(this.placeholder[0],n)||"semi-dynamic"===this.options.type&&t.contains(this.element[0],n))){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&s+l<h,d="y"===this.options.axis||e+c>o&&e+c<a,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:o<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<a&&r<s+this.helperProportions.height/2&&n-this.helperProportions.height/2<h},_intersectsWithPointer:function(t){var e,i,s="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!s||!n)&&(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var i,s,n,o,a=[],r=[],h=this._connectWith();if(h&&e)for(i=h.length-1;i>=0;i--)for(s=(n=t(h[i],this.document[0])).length-1;s>=0;s--)(o=t.data(n[s],this.widgetFullName))&&o!==this&&!o.options.disabled&&r.push([t.isFunction(o.options.items)?o.options.items.call(o.element):t(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);function l(){a.push(this)}for(r.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=r.length-1;i>=0;i--)r[i][0].each(l);return t(a)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;i<e.length;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(s=(n=t(d[i],this.document[0])).length-1;s>=0;s--)(o=t.data(n[s],this.widgetFullName))&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],s=0,l=(r=u[i][0]).length;s<l;s++)(h=t(r[s])).data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){var i,s,n,o;for(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),i=this.items.length-1;i>=0;i--)(s=this.items[i]).instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){var i,s=(e=e||this).options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]);return e._addClass(n,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(n,"ui-sortable-helper"),"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){i&&!s.forcePlaceholderSize||(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t("<td>&#160;</td>",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,n,o,a,r,h,l,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,a=(c=d.floating||this._isFloating(this.currentItem))?"left":"top",r=c?"width":"height",u=c?"pageX":"pageY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[a],l=!1,e[u]-h>this.items[s][r]/2&&(l=!0),Math.abs(e[u]-h)<n&&(n=Math.abs(e[u]-h),o=this.items[s],this.direction=l?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return void(this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1));o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),s[0].style.width&&!i.forceHelperSize||s.width(this.currentItem.width()),s[0].style.height&&!i.forceHelperSize||s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),"document"!==n.containment&&"window"!==n.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function n(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)e||s.push(n("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(n("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i<s.length;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===t.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.widget("ui.accordion",{version:"1.12.0",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),e.collapsible||!1!==e.active&&null!=e.active||(e.active=0),this._processPanels(),e.active<0&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t()}},_createIcons:function(){var e,i,s=this.options.icons;s&&(e=t("<span>"),this._addClass(e,"ui-accordion-header-icon","ui-icon "+s.header),e.prependTo(this.headers),i=this.active.children(".ui-accordion-header-icon"),this._removeClass(i,s.header)._addClass(i,null,s.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){"active"!==t?("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons())):this._activate(e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),t(o).trigger("focus"),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().trigger("focus")},refresh:function(){var e=this.options;this._processPanels(),!1===e.active&&!0===e.collapsible||!this.headers.length?(e.active=!1,this.active=t()):!1===e.active?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var e,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var e=t(this),i=e.uniqueId().attr("id"),s=e.next(),n=s.uniqueId().attr("id");e.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(e=n.height(),this.element.siblings(":visible").each(function(){var i=t(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(e-=i.outerHeight(!0))}),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===s&&(e=0,this.headers.next().each(function(){var i=t(this).is(":visible");i||t(this).show(),e=Math.max(e,t(this).css("height","").height()),i||t(this).hide()}).height(e))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i,s,n=this.options,o=this.active,a=t(e.currentTarget),r=a[0]===o[0],h=r&&n.collapsible,l=h?t():a.next(),c={oldHeader:o,oldPanel:o.next(),newHeader:h?t():a,newPanel:l};e.preventDefault(),r&&!n.collapsible||!1===this._trigger("beforeActivate",e,c)||(n.active=!h&&this.headers.index(a),this.active=r?t():a,this._toggle(c),this._removeClass(o,"ui-accordion-header-active","ui-state-active"),n.icons&&(i=o.children(".ui-accordion-header-icon"),this._removeClass(i,null,n.icons.activeHeader)._addClass(i,null,n.icons.header)),r||(this._removeClass(a,"ui-accordion-header-collapsed")._addClass(a,"ui-accordion-header-active","ui-state-active"),n.icons&&(s=a.children(".ui-accordion-header-icon"),this._removeClass(s,null,n.icons.header)._addClass(s,null,n.icons.activeHeader)),this._addClass(a.next(),"ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(t(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,e,i){var s,n,o,a=this,r=0,h=t.css("box-sizing"),l=t.length&&(!e.length||t.index()<e.index()),c=this.options.animate||{},u=l&&c.down||c,d=function(){a._toggleComplete(i)};return"number"==typeof u&&(o=u),"string"==typeof u&&(n=u),n=n||u.easing||c.easing,o=o||u.duration||c.duration,e.length?t.length?(s=t.show().outerHeight(),e.animate(this.hideProps,{duration:o,easing:n,step:function(t,e){e.now=Math.round(t)}}),void t.hide().animate(this.showProps,{duration:o,easing:n,complete:d,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==a.options.heightStyle&&(i.now=Math.round(s-e.outerHeight()-r),r=0)}})):e.animate(this.hideProps,o,n,d):t.animate(this.showProps,o,n,d)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),t.widget("ui.menu",{version:"1.12.0",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var i=t(e.target),s=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&s.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var i=t(e.target).closest(".ui-menu-item"),s=t(e.currentTarget);i[0]===s[0]&&(this._removeClass(s.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,s))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]))&&this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),e.children().each(function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var i,s,n,o,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,s=this.previousFilter||"",n=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),n===s?o=!0:n=s+n,i=this._filterMenuItems(n),(i=o&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i).length||(n=String.fromCharCode(e.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(e,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i,s,n,o=this,a=this.options.icons.submenu,r=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),i=r.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),i=e.prev(),s=t("<span>").data("ui-menu-submenu-caret",!0);o._addClass(s,"ui-menu-icon","ui-icon "+a),i.attr("aria-haspopup","true").prepend(s),e.attr("aria-labelledby",i.attr("id"))}),this._addClass(i,"ui-menu","ui-widget ui-widget-content ui-front"),(e=r.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var e=t(this);o._isDivider(e)&&o._addClass(e,"ui-menu-divider","ui-widget-content")}),n=(s=e.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(s,"ui-menu-item")._addClass(n,"ui-menu-item-wrapper"),e.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i,s,n;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children(".ui-menu-item-wrapper"),this._addClass(s,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),n=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.outerHeight(),n<0?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this._removeClass(s.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;this.active?this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return(i=t(this)).offset().top-s-n<0}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())):this.next(e)},previousPage:function(e){var i,s,n;this.active?this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return(i=t(this)).offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items).first())):this.next(e)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)},_filterMenuItems:function(e){var i=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=new RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(t.trim(t(this).children(".ui-menu-item-wrapper").text()))})}});t.widget("ui.autocomplete",{version:"1.12.0",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n;this.isMultiLine=o||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,void(i=!0);e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||s.preventDefault());if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){if(s)return s=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),this._change(t))}}),this._initSource(),this.menu=t("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==t.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(e,i){var s,n;if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)});n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:n})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(n.value),(s=i.item.attr("aria-label")||n.value)&&t.trim(s).length&&(this.liveRegion.children().hide(),t("<div>").text(s).appendTo(this.liveRegion))},menuselect:function(e,i){var s=i.item.data("ui-autocomplete-item"),n=this.previous;this.element[0]!==t.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=n,this._delay(function(){this.previous=n,this.selectedItem=s})),!1!==this._trigger("select",e,{item:s})&&this._value(s.value),this.term=this._value(),this.close(e),this.selectedItem=s}}),this.liveRegion=t("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var i=this.menu.element[0];return e.target===this.element[0]||e.target===i||t.contains(i,e.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),i=this.menu.element.is(":visible"),s=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;e&&(!e||i||s)||(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<div>").text(i.label)).appendTo(e)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=new RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),t("<div>").text(i).appendTo(this.liveRegion))}});t.ui.autocomplete;var l=/ui-corner-([a-z]){2,6}/g;t.widget("ui.controlgroup",{version:"1.12.0",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,i=[];t.each(this.options.items,function(s,n){var o,a={};if(n)return"controlgroupLabel"===s?((o=e.element.find(n)).each(function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),e._addClass(o,null,"ui-widget ui-widget-content ui-state-default"),void(i=i.concat(o.get()))):void(t.fn[s]&&(e["_"+s+"Options"]&&(a=e["_"+s+"Options"]("middle")),e.element.find(n).each(function(){var n=t(this),o=n[s]("instance"),r=t.widget.extend({},a);if("button"!==s||!n.parent(".ui-spinner").length){o||(o=n[s]()[s]("instance")),o&&(r.classes=e._resolveClassesValues(r.classes,o)),n[s](r);var h=n[s]("widget");t.data(h[0],"ui-controlgroup-data",o||n[s]("instance")),i.push(h[0])}})))}),this.childWidgets=t(t.unique(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var i=t(this).data("ui-controlgroup-data");i&&i[e]&&i[e]()})},_updateCornerClass:function(t,e){var i=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,i)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:!!e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(e,i){var s={};return t.each(e,function(t){var n=i.options.classes[t]||"";n=n.replace(l,"").trim(),s[t]=(n+" "+e[t]).replace(/\s+/g," ")}),s},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var e,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],function(t,s){var n=e[s]().data("ui-controlgroup-data");if(n&&i["_"+n.widgetName+"Options"]){var o=i["_"+n.widgetName+"Options"](1===e.length?"only":s);o.classes=i._resolveClassesValues(o.classes,n),n.element[n.widgetName](o)}else i._updateCornerClass(e[s](),s)}),this._callChildMethod("refresh"))}});t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.0",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i,s=this,n=this._super()||{};return this._readType(),i=this.element.labels(),this.label=t(i[i.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element).each(function(){s.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML}),this.originalLabel&&(n.label=this.originalLabel),null!=(e=this.element[0].disabled)&&(n.disabled=e),n},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e=this.element[0].name,i="input[name='"+t.ui.escapeSelector(e)+"']";return e?(this.form.length?t(this.form[0].elements).filter(i):t(i).filter(function(){return 0===t(this).form().length})).not(this.element):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){this.label.contents().not(this.element.add(this.icon).add(this.iconSpace)).remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]);t.ui.checkboxradio;t.widget("ui.button",{version:"1.12.0",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),null!=(t=this.element[0].disabled)&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,i){var s="iconPosition"!==e,n=s?this.options.iconPosition:i,o="top"===n||"bottom"===n;this.icon?s&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),s&&this._addClass(this.icon,null,i),this._attachIcon(n),o?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(n))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,i=void 0===t.icon?this.options.icon:t.icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!1!==t.uiBackCompat&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){"text"!==t?("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",e)}}),t.fn.button=function(e){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?e.apply(this,arguments):(t.ui.checkboxradio||t.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(t.fn.button),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))});var c;t.ui.button;function u(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=d(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function d(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",i,function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,p)}function p(){t.datepicker._isDisabledDatepicker(c.inline?c.dpDiv.parent()[0]:c.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function f(e,i){for(var s in t.extend(e,i),i)null==i[s]&&(e[s]=i[s]);return e}t.extend(t.ui,{datepicker:{version:"1.12.0"}}),t.extend(u.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return f(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;n="div"===(s=e.nodeName.toLowerCase())||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),(o=this._newInst(t(e),n)).settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){return{id:e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?d(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),t.data(e,"datepicker",i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),"focus"!==(s=this._get(i,"showOn"))&&"both"!==s||e.on("focus",this._showDatepicker),"button"!==s&&"both"!==s||(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.on("click",function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;n<t.length;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,n,o){var a,r,h,l,c,u=this._dialogInst;return u||(this.uuid+=1,a="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+a+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),t("body").append(this._dialogInput),(u=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},t.data(this._dialogInput[0],"datepicker",u)),f(u.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(u,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(r=document.documentElement.clientWidth,h=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,c=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[r/2-100+l,h/2-150+c]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),u.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],"datepicker",u),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,"datepicker");s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==i&&"span"!==i||s.removeClass(this.markerClassName).empty(),c===n&&(c=null))},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&("input"===(i=e.nodeName.toLowerCase())?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==i&&"span"!==i||((s=n.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&("input"===(i=e.nodeName.toLowerCase())?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==i&&"span"!==i||((s=n.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;e<this._disabledInputs.length;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,"datepicker")}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,i,s){var n,o,a,r,h=this._getInst(e);if(2===arguments.length&&"string"==typeof i)return"defaults"===i?t.extend({},t.datepicker._defaults):h?"all"===i?t.extend({},h.settings):this._get(h,i):null;n=i||{},"string"==typeof i&&((n={})[i]=s),h&&(this._curInst===h&&this._hideDatepicker(),o=this._getDateDatepicker(e,!0),a=this._getMinMaxDate(h,"min"),r=this._getMinMaxDate(h,"max"),f(h.settings,n),null!==a&&void 0!==n.dateFormat&&void 0===n.minDate&&(h.settings.minDate=this._formatDate(h,a)),null!==r&&void 0!==n.dateFormat&&void 0===n.maxDate&&(h.settings.maxDate=this._formatDate(h,r)),"disabled"in n&&(n.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(t(e),h),this._autoSize(h),this._setDate(h,o),this._updateAlternate(h),this._updateDatepicker(h))},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return(n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv))[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),(i=t.datepicker._get(o,"onSelect"))?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var i,s,n=t.datepicker._getInst(e.target);if(t.datepicker._get(n,"constrainInput"))return i=t.datepicker._possibleChars(t.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||s<" "||!i||i.indexOf(s)>-1},_doKeyUp:function(e){var i=t.datepicker._getInst(e.target);if(i.input.val()!==i.lastVal)try{t.datepicker.parseDate(t.datepicker._get(i,"dateFormat"),i.input?i.input.val():null,t.datepicker._getFormatConfig(i))&&(t.datepicker._setDateFromField(i),t.datepicker._updateAlternate(i),t.datepicker._updateDatepicker(i))}catch(t){}return!0},_showDatepicker:function(e){var i,s,n,o,a,r,h;("input"!==(e=e.target||e).nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),t.datepicker._isDisabledDatepicker(e)||t.datepicker._lastInput===e)||(i=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==i&&(t.datepicker._curInst.dpDiv.stop(!0,!0),i&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),!1!==(n=(s=t.datepicker._get(i,"beforeShow"))?s.apply(e,[e,i]):{})&&(f(i.settings,n),i.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(i),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),o=!1,t(e).parents().each(function(){return!(o|="fixed"===t(this).css("position"))}),a={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(i),a=t.datepicker._checkOffset(i,a,o),i.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":o?"fixed":"absolute",display:"none",left:a.left+"px",top:a.top+"px"}),i.inline||(r=t.datepicker._get(i,"showAnim"),h=t.datepicker._get(i,"duration"),i.dpDiv.css("z-index",function(t){for(var e,i;t.length&&t[0]!==document;){if(("absolute"===(e=t.css("position"))||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}(t(e))+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[r]?i.dpDiv.show(r,t.datepicker._get(i,"showOptions"),h):i.dpDiv[r||"show"](r?h:null),t.datepicker._shouldFocusInput(i)&&i.input.trigger("focus"),t.datepicker._curInst=i)))},_updateDatepicker:function(e){this.maxRows=4,c=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var i,s=this._getNumberOfMonths(e),n=s[1],o=e.dpDiv.find("."+this._dayOverClass+" a");o.length>0&&p.apply(o.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",17*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-a:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+o>l&&l>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return[(i=t(e).offset()).left,i.top]},_hideDatepicker:function(e){var i,s,n,o,a=this._curInst;!a||e&&a!==t.data(e,"datepicker")||this._datepickerShowing&&(i=this._get(a,"showAnim"),s=this._get(a,"duration"),n=function(){t.datepicker._tidyDialog(a)},t.effects&&(t.effects.effect[i]||t.effects[i])?a.dpDiv.hide(i,t.datepicker._get(a,"showOptions"),s,n):a.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,(o=this._get(a,"onClose"))&&o.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id===t.datepicker._mainDivId||0!==i.parents("#"+t.datepicker._mainDivId).length||i.hasClass(t.datepicker.markerClassName)||i.closest("."+t.datepicker._triggerClass).length||!t.datepicker._datepickerShowing||t.datepicker._inDialog&&t.blockUI)&&(!i.hasClass(t.datepicker.markerClassName)||t.datepicker._curInst===s)||t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+("M"===s?this._get(o,"showCurrentAtPos"):0),s),this._updateDatepicker(o))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),o=this._getInst(n[0]);o["selected"+("M"===s?"Month":"Year")]=o["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(n)},_selectDay:function(e,i,s,n){var o,a=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||((o=this._getInst(a[0])).selectedDay=o.currentDay=t("a",n).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=s,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),o=this._getInst(n[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),(s=this._get(o,"onSelect"))?s.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(o).val(n))},noWeekends:function(t){var e=t.getDay();return[e>0&&e<6,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(e,i,s){if(null==e||null==i)throw"Invalid arguments";if(""===(i="object"==typeof i?i.toString():i+""))return null;var n,o,a,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,c="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),u=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,d=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,g=-1,m=-1,_=-1,v=-1,b=!1,y=function(t){var i=n+1<e.length&&e.charAt(n+1)===t;return i&&n++,i},w=function(t){var e=y(t),s="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n=new RegExp("^\\d{"+("y"===t?s:1)+","+s+"}"),o=i.substring(h).match(n);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},k=function(e,s,n){var o=-1,a=t.map(y(e)?n:s,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(a,function(t,e){var s=e[1];if(i.substr(h,s.length).toLowerCase()===s.toLowerCase())return o=e[0],h+=s.length,!1}),-1!==o)return o+1;throw"Unknown name at position "+h},x=function(){if(i.charAt(h)!==e.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;n<e.length;n++)if(b)"'"!==e.charAt(n)||y("'")?x():b=!1;else switch(e.charAt(n)){case"d":_=w("d");break;case"D":k("D",u,d);break;case"o":v=w("o");break;case"m":m=w("m");break;case"M":m=k("M",p,f);break;case"y":g=w("y");break;case"@":g=(r=new Date(w("@"))).getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"!":g=(r=new Date((w("!")-this._ticksTo1970)/1e4)).getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"'":y("'")?x():b=!0;break;default:x()}if(h<i.length&&(a=i.substr(h),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===g?g=(new Date).getFullYear():g<100&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(g<=c?0:-100)),v>-1)for(m=1,_=v;;){if(_<=(o=this._getDaysInMonth(g,m-1)))break;m++,_-=o}if((r=this._daylightSavingAdjust(new Date(g,m-1,_))).getFullYear()!==g||r.getMonth()+1!==m||r.getDate()!==_)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=s+1<t.length&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;s.length<i;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;s<t.length;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,o);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),a,r);break;case"y":u+=h("y")?e.getFullYear():(e.getFullYear()%100<10?"0":"")+e.getFullYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=e+1<t.length&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;e<t.length;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,e){return void 0!==t.settings[e]?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(t){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=null==i||""===i?s:"string"==typeof i?function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(t){}for(var s=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,n=s.getFullYear(),o=s.getMonth(),a=s.getDate(),r=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,h=r.exec(i);h;){switch(h[2]||"d"){case"d":case"D":a+=parseInt(h[1],10);break;case"w":case"W":a+=7*parseInt(h[1],10);break;case"m":case"M":o+=parseInt(h[1],10),a=Math.min(a,t.datepicker._getDaysInMonth(n,o));break;case"y":case"Y":n+=parseInt(h[1],10),a=Math.min(a,t.datepicker._getDaysInMonth(n,o))}h=r.exec(i)}return new Date(n,o,a)}(i):"number"==typeof i?isNaN(i)?s:function(t){var e=new Date;return e.setDate(e.getDate()+t),e}(i):new Date(i.getTime());return(n=n&&"Invalid Date"===n.toString()?s:n)&&(n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setMilliseconds(0)),this._daylightSavingAdjust(n)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){return!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay))},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,h,l,c,u,d,p,f,g,m,_,v,b,y,w,k,x,C,D,I,T,P,M,S,H,z,O,A,N,W,E,F,R,L=new Date,B=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(t,"isRTL"),j=this._get(t,"showButtonPanel"),q=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),U=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),X=this._get(t,"stepMonths"),$=1!==U[0]||1!==U[1],G=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),Q=this._getMinMaxDate(t,"min"),J=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,tt=t.drawYear;if(Z<0&&(Z+=12,tt--),J)for(e=this._daylightSavingAdjust(new Date(J.getFullYear(),J.getMonth()-U[0]*U[1]+1,J.getDate())),e=Q&&e<Q?Q:e;this._daylightSavingAdjust(new Date(tt,Z,1))>e;)--Z<0&&(Z=11,tt--);for(t.drawMonth=Z,t.drawYear=tt,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(tt,Z-X,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,tt,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":q?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(tt,Z+X,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,tt,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":q?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?G:B,a=K?this.formatDate(a,r,this._getFormatConfig(t)):a,h=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",l=j?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),_=this._get(t,"showOtherMonths"),v=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;k<U[0];k++){for(x="",this.maxRows=4,C=0;C<U[1];C++){if(D=this._daylightSavingAdjust(new Date(tt,Z,t.selectedDay)),I=" ui-corner-all",T="",$){if(T+="<div class='ui-datepicker-group",U[1]>1)switch(C){case 0:T+=" ui-datepicker-group-first",I=" ui-corner-"+(Y?"right":"left");break;case U[1]-1:T+=" ui-datepicker-group-last",I=" ui-corner-"+(Y?"left":"right");break;default:T+=" ui-datepicker-group-middle",I=""}T+="'>"}for(T+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+I+"'>"+(/all|left/.test(I)&&0===k?Y?o:s:"")+(/all|right/.test(I)&&0===k?Y?s:o:"")+this._generateMonthYearHeader(t,Z,tt,Q,J,k>0||C>0,f,g)+"</div><table class='ui-datepicker-calendar'><thead><tr>",P=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;w<7;w++)M=(w+c)%7,P+="<th scope='col'"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+d[M]+"'>"+p[M]+"</span></th>";for(T+=P+"</tr></thead><tbody>",S=this._getDaysInMonth(tt,Z),tt===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),H=(this._getFirstDayOfMonth(tt,Z)-c+7)%7,z=Math.ceil((H+S)/7),O=$&&this.maxRows>z?this.maxRows:z,this.maxRows=O,A=this._daylightSavingAdjust(new Date(tt,Z,1-H)),N=0;N<O;N++){for(T+="<tr>",W=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(A)+"</td>":"",w=0;w<7;w++)E=m?m.apply(t.input?t.input[0]:null,[A]):[!0,""],R=(F=A.getMonth()!==Z)&&!v||!E[0]||Q&&A<Q||J&&A>J,W+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(A.getTime()===D.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===A.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(R?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!_?"":" "+E[1]+(A.getTime()===G.getTime()?" "+this._currentClass:"")+(A.getTime()===B.getTime()?" ui-datepicker-today":""))+"'"+(F&&!_||!E[2]?"":" title='"+E[2].replace(/'/g,"&#39;")+"'")+(R?"":" data-handler='selectDay' data-event='click' data-month='"+A.getMonth()+"' data-year='"+A.getFullYear()+"'")+">"+(F&&!_?"&#xa0;":R?"<span class='ui-state-default'>"+A.getDate()+"</span>":"<a class='ui-state-default"+(A.getTime()===B.getTime()?" ui-state-highlight":"")+(A.getTime()===G.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+A.getDate()+"</a>")+"</td>",A.setDate(A.getDate()+1),A=this._daylightSavingAdjust(A);T+=W+"</tr>"}++Z>11&&(Z=0,tt++),x+=T+="</tbody></table>"+($?"</div>"+(U[0]>0&&C===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}y+=x}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var h,l,c,u,d,p,f,g,m=this._get(t,"changeMonth"),_=this._get(t,"changeYear"),v=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(o||!m)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;c<12;c++)(!h||c>=s.getMonth())&&(!l||c<=n.getMonth())&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(v||(b+=y+(!o&&m&&_?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",o||!_)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),f=(p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e})(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";f<=g;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),v&&(b+=(!o&&m&&_?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&e<i?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,s+(e<0?e:n[0]*n[1]),1));return e<0&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||e.getTime()>=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||e.getFullYear()<=r)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).on("mousedown",t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new u,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.12.0";t.datepicker;t.widget("ui.dialog",{version:"1.12.0",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;i<0&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&!1!==this._trigger("beforeClose",e)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||t.ui.safeBlur(t.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+t(this).css("z-index")}).get(),o=Math.max.apply(null,n);return o>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",o+1),s=!0),s&&!i&&this._trigger("focus",e),s},open:function(){var e=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=t(t.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;t||(t=this.element.find("[autofocus]")),t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).trigger("focus")},_keepFocus:function(e){function i(){var e=t.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===e||t.contains(this.uiDialog[0],e)||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),void this.close(e);if(e.keyCode===t.ui.keyCode.TAB&&!e.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(this._delay(function(){n.trigger("focus")}),e.preventDefault()):(this._delay(function(){s.trigger("focus")}),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:t("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(e,"ui-dialog-title"),this._title(e),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(t.each(i,function(i,s){var n,o;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,o={icon:s.icon,iconPosition:s.iconPosition,showLabel:s.showLabel},delete s.click,delete s.icon,delete s.iconPosition,delete s.showLabel,t("<button></button>",s).button(o).appendTo(e.uiButtonSet).on("click",function(){n.apply(e.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var e=this,i=this.options;function s(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(i,n){e._addClass(t(this),"ui-dialog-dragging"),e._blockFrames(),e._trigger("dragStart",i,s(n))},drag:function(t,i){e._trigger("drag",t,s(i))},stop:function(n,o){var a=o.offset.left-e.document.scrollLeft(),r=o.offset.top-e.document.scrollTop();i.position={my:"left top",at:"left"+(a>=0?"+":"")+a+" top"+(r>=0?"+":"")+r,of:e.window},e._removeClass(t(this),"ui-dialog-dragging"),e._unblockFrames(),e._trigger("dragStop",n,s(o))}})},_makeResizable:function(){var e=this,i=this.options,s=i.resizable,n=this.uiDialog.css("position"),o="string"==typeof s?s:"n,e,s,w,se,sw,ne,nw";function a(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:o,start:function(i,s){e._addClass(t(this),"ui-dialog-resizing"),e._blockFrames(),e._trigger("resizeStart",i,a(s))},resize:function(t,i){e._trigger("resize",t,a(i))},stop:function(s,n){var o=e.uiDialog.offset(),r=o.left-e.document.scrollLeft(),h=o.top-e.document.scrollTop();i.height=e.uiDialog.height(),i.width=e.uiDialog.width(),i.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" top"+(h>=0?"+":"")+h,of:e.window},e._removeClass(t(this),"ui-dialog-resizing"),e._unblockFrames(),e._trigger("resizeStop",s,a(n))}}).css("position",n)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget(),this._focusedElement=t(e.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),i=t.inArray(this,e);-1!==i&&e.splice(i,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(e){var i=this,s=!1,n={};t.each(e,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,i){var s,n,o=this.uiDialog;"disabled"!==e&&(this._super(e,i),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:t("<a>").text(""+this.options.closeText).html()}),"draggable"===e&&((s=o.is(":data(ui-draggable)"))&&!i&&o.draggable("destroy"),!s&&i&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&((n=o.is(":data(ui-resizable)"))&&!i&&o.resizable("destroy"),n&&"string"==typeof i&&o.resizable("option","handles",i),n||!1===i||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return!!t(e.target).closest(".ui-dialog").length||!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=!0;this._delay(function(){e=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(t){e||this._allowInteraction(t)||(t.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=t("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var t=this.document.data("ui-dialog-overlays")-1;t?this.document.data("ui-dialog-overlays",t):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),!1!==t.uiBackCompat&&t.widget("ui.dialog",t.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}});t.ui.dialog,t.widget("ui.progressbar",{version:"1.12.0",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=t("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){if(void 0===t)return this.options.value;this.options.value=this._constrainedValue(t),this._refreshValue()},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=!1===t,"number"!=typeof t&&(t=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).width(i.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,e===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}}),t.widget("ui.selectmenu",[t.ui.formResetMixin,{version:"1.12.0",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=t()},_drawButton:function(){var e,i=this,s=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.focus(),t.preventDefault()}}),this.element.hide(),this.button=t("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),e=t("<span>").appendTo(this.button),this._addClass(e,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(s).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){i._rendered||i._refreshMenu()})},_drawMenu:function(){var e=this;this.menu=t("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=t("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,i){t.preventDefault(),e._setSelection(),e._select(i.item.data("ui-selectmenu-item"),t)},focus:function(t,i){var s=i.item.data("ui-selectmenu-item");null!=e.focusIndex&&s.index!==e.focusIndex&&(e._trigger("focus",t,{item:s}),e.isOpen||e._select(s,t)),e.focusIndex=s.index,e.button.attr("aria-activedescendant",e.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t,e=this.element.find("option");this.menu.empty(),this._parseOptions(e),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,e.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(t.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(e){var i=t("<span>");return this._setText(i,e.label),this._addClass(i,"ui-selectmenu-text"),i},_renderMenu:function(e,i){var s=this,n="";t.each(i,function(i,o){var a;o.optgroup!==n&&(a=t("<li>",{text:o.optgroup}),s._addClass(a,"ui-selectmenu-optgroup","ui-menu-divider"+(o.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),a.appendTo(e),n=o.optgroup),s._renderItemData(e,o)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(e,i){var s=t("<li>"),n=t("<div>",{title:i.element.attr("title")});return i.disabled&&this._addClass(s,null,"ui-state-disabled"),this._setText(n,i.label),s.append(n).appendTo(e)},_setText:function(t,e){e?t.text(e):t.html("&#160;")},_move:function(t,e){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),n+=":not(.ui-state-disabled)"),(s="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](n).eq(-1):i[t+"All"](n).eq(0)).length&&this.menuInstance.focus(e,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?((t=window.getSelection()).removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(e){this.isOpen&&(t(e.target).closest(".ui-selectmenu-menu, #"+t.ui.escapeSelector(this.ids.button)).length||this.close(e))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection()).rangeCount&&(this.range=t.getRangeAt(0)):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(e){var i=!0;switch(e.keyCode){case t.ui.keyCode.TAB:case t.ui.keyCode.ESCAPE:this.close(e),i=!1;break;case t.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(e);break;case t.ui.keyCode.UP:e.altKey?this._toggle(e):this._move("prev",e);break;case t.ui.keyCode.DOWN:e.altKey?this._toggle(e):this._move("next",e);break;case t.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(e):this._toggle(e);break;case t.ui.keyCode.LEFT:this._move("prev",e);break;case t.ui.keyCode.RIGHT:this._move("next",e);break;case t.ui.keyCode.HOME:case t.ui.keyCode.PAGE_UP:this._move("first",e);break;case t.ui.keyCode.END:case t.ui.keyCode.PAGE_DOWN:this._move("last",e);break;default:this.menu.trigger(e),i=!1}i&&e.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){var e=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":e,"aria-activedescendant":e}),this.menu.attr("aria-activedescendant",e)},_setOption:function(t,e){if("icons"===t){var i=this.button.find("span.ui-icon");this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)}this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;!1!==t?(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t)):this.button.css("width","")},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(e){var i=this,s=[];e.each(function(e,n){s.push(i._parseOption(t(n),e))}),this.items=s},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),t.widget("ui.slider",t.ui.mouse,{version:"1.12.0",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle"),o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;e<i;e++)o.push("<span tabindex='0'></span>");this.handles=n.add(t(o.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options;e.range?(!0===e.range&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=t("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==e.range&&"max"!==e.range||this._addClass(this.range,"ui-slider-range-"+e.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,o,a,r,h,l=this,c=this.options;return!c.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-l.values(e));(n>i||n===i&&(e===l._lastChangedValue||l.values(e)===c.min))&&(n=i,o=t(this),a=e)}),!1!==this._start(e,a)&&(this._mouseSliding=!0,this._handleIndex=a,this._addClass(o,null,"ui-state-active"),o.trigger("focus"),r=o.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-r.left-o.width()/2,top:e.pageY-r.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),(s=i/e)>1&&(s=1),s<0&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n=this.value(),o=this.values();this._hasMultipleValues()&&(s=this.values(e?0:1),n=this.values(e),2===this.options.values.length&&!0===this.options.range&&(i=0===e?Math.min(s,i):Math.max(s,i)),o[e]=i),i!==n&&!1!==this._trigger("slide",t,this._uiHash(e,i,o))&&(this._hasMultipleValues()?this.values(e,i):this.value(i))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),void this._change(null,e);if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this._hasMultipleValues()?this._values(e):this.value();for(s=this.options.values,n=arguments[0],o=0;o<s.length;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&!0===this.options.range&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),this._super(e,i),e){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(i),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=n-1;s>=0;s--)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this._hasMultipleValues()){for(i=this.options.values.slice(),s=0;s<i.length;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step;(t=Math.round((t-e)/i)*i+e)>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,h=this,l=!this._animateOff&&r.animate,c={};this._hasMultipleValues()?this.handles.each(function(s){i=(h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())*100,c["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](c,r.animate),!0===h.options.range&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?(s-n)/(o-n)*100:0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:100-i+"%"},r.animate),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:100-i+"%"},r.animate))},_handleEvents:{keydown:function(e){var i,s,n,o=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(t(e.target),null,"ui-state-active"),!1===this._start(e,o)))return}switch(n=this.options.step,i=s=this._hasMultipleValues()?this.values(o):this.value(),e.keyCode){case t.ui.keyCode.HOME:s=this._valueMin();break;case t.ui.keyCode.END:s=this._valueMax();break;case t.ui.keyCode.PAGE_UP:s=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:s=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(i===this._valueMax())return;s=this._trimAlignValue(i+n);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i===this._valueMin())return;s=this._trimAlignValue(i-n)}this._slide(e,o,s)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),this._removeClass(t(e.target),null,"ui-state-active"))}}});function g(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.12.0",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e=this._super(),i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);null!=n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t))},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){var i;function s(){this.element[0]===t.ui.safeActiveElement(this.document[0])||(this.element.trigger("focus"),this.previous=i,this._delay(function(){this.previous=i}))}i=this.element[0]===t.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),e.preventDefault(),s.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,s.call(this)}),!1!==this._start(e)&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){if(t(e.currentTarget).hasClass("ui-state-active"))return!1!==this._start(e)&&void this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_start:function(t){return!(!this.spinning&&!1===this._trigger("start",t))&&(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",e,{value:i})||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return i=t-(e=null!==s.min?s.min:0),t=e+(i=Math.round(i/s.step)*s.step),t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&t<s.min?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i,s,n;if("culture"===t||"numberFormat"===t)return i=this._parse(this.element.val()),this.options[t]=e,void this.element.val(this._format(i));"max"!==t&&"min"!==t&&"step"!==t||"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(s=this.buttons.first().find(".ui-icon"),this._removeClass(s,null,this.options.icons.up),this._addClass(s,null,e.up),n=this.buttons.last().find(".ui-icon"),this._removeClass(n,null,this.options.icons.down),this._addClass(n,null,e.down)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:g(function(t){this._super(t)}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null!==t&&t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&null!==(i=this._parse(t))&&(e||(i=this._adjustValue(i)),t=this._format(i)),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:g(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:g(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:g(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:g(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){if(!arguments.length)return this._parse(this.element.val());g(this._value).call(this,t)},widget:function(){return this.uiSpinner}}),!1!==t.uiBackCompat&&t.widget("ui.spinner",t.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}});var m;t.ui.spinner;t.widget("ui.tabs",{version:"1.12.0",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(m=/#.*$/,function(t){var e,i;e=t.href.replace(m,""),i=location.href.replace(m,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return t.hash.length>1&&e===i}),_create:function(){var e=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(i.active):this.active=t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var e=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===e&&(s&&this.tabs.each(function(i,n){if(t(n).attr("aria-controls")===s)return e=i,!1}),null===e&&(e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==e&&-1!==e||(e=!!this.tabs.length&&0)),!1!==e&&-1===(e=this.tabs.index(this.tabs.eq(e)))&&(e=!i&&0),!i&&!1===e&&this.anchors.length&&(e=0),e},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var i=t(t.ui.safeActiveElement(this.document[0])).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:s++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:n=!1,s--;break;case t.ui.keyCode.END:s=this.anchors.length-1;break;case t.ui.keyCode.HOME:s=0;break;case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),void this._activate(s);case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),void this._activate(s!==this.options.active&&s);default:return}e.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),e.ctrlKey||e.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,i){var s=this.tabs.length-1;for(;-1!==t.inArray((e>s&&(e=0),e<0&&(e=s),e),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){"active"!==t?(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e)):this._activate(e)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),!1!==e.active&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=t(),this.anchors.each(function(i,s){var n,o,a,r=t(s).uniqueId().attr("id"),h=t(s).closest("li"),l=h.attr("aria-controls");e._isLocal(s)?(a=(n=s.hash).substring(1),o=e.element.find(e._sanitizeSelector(n))):(n="#"+(a=h.attr("aria-controls")||t({}).uniqueId()[0].id),(o=e.element.find(n)).length||(o=e._createPanel(a)).insertAfter(e.panels[i-1]||e.tablist),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":a,"aria-labelledby":r}),o.attr("aria-labelledby",r)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(e){var i,s,n;for(t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1),n=0;s=this.tabs[n];n++)i=t(s),!0===e||-1!==t.inArray(n,e)?(i.attr("aria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr("aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.disabled=e,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===e)},_setupEvents:function(e){var i={};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget).closest("li"),o=n[0]===s[0],a=o&&i.collapsible,r=a?t():this._getPanelForTab(n),h=s.length?this._getPanelForTab(s):t(),l={oldTab:s,oldPanel:h,newTab:a?t():n,newPanel:r};e.preventDefault(),n.hasClass("ui-state-disabled")||n.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||!1===this._trigger("beforeActivate",e,l)||(i.active=!a&&this.tabs.index(n),this.active=o?t():n,this.xhr&&this.xhr.abort(),h.length||r.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),r.length&&this.load(this.tabs.index(n),e),this._toggle(e,l))},_toggle:function(e,i){var s=this,n=i.newPanel,o=i.oldPanel;function a(){s.running=!1,s._trigger("activate",e,i)}function r(){s._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-state-active"),n.length&&s.options.show?s._show(n,s.options.show,a):(n.show(),a())}this.running=!0,o.length&&this.options.hide?this._hide(o,this.options.hide,function(){s._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),r()}):(this._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),o.hide(),r()),o.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),n.length&&o.length?i.oldTab.attr("tabIndex",-1):n.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),n.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return!1===e?t():this.tabs.eq(e)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+t.ui.escapeSelector(e)+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(e){var i=this.options.disabled;!1!==i&&(void 0===e?i=!1:(e=this._getIndex(e),i=t.isArray(i)?t.map(i,function(t){return t!==e?t:null}):t.map(this.tabs,function(t,i){return i!==e?i:null})),this._setOptionDisabled(i))},disable:function(e){var i=this.options.disabled;if(!0!==i){if(void 0===e)i=!0;else{if(e=this._getIndex(e),-1!==t.inArray(e,i))return;i=t.isArray(i)?t.merge([e],i).sort():[e]}this._setOptionDisabled(i)}},load:function(e,i){e=this._getIndex(e);var s=this,n=this.tabs.eq(e),o=n.find(".ui-tabs-anchor"),a=this._getPanelForTab(n),r={tab:n,panel:a},h=function(t,e){"abort"===e&&s.panels.stop(!1,!0),s._removeClass(n,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===s.xhr&&delete s.xhr};this._isLocal(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(n,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,n){setTimeout(function(){a.html(t),s._trigger("load",i,r),h(n,e)},1)}).fail(function(t,e){setTimeout(function(){h(t,e)},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),!1!==t.uiBackCompat&&t.widget("ui.tabs",t.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});t.ui.tabs;t.widget("ui.tooltip",{version:"1.12.0",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))},_removeDescribedBy:function(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),(s=t.trim(s.join(" ")))?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=t("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=t([])},_setOption:function(e,i){var s=this;this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s.element[0],e.close(n,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var e=t(this);if(e.is("[title]"))return e.data("ui-tooltip-title",e.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))}),this.disabledTitles=t([])},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&((e=t.Event("blur")).target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(e,s),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;if("string"==typeof s||s.nodeType||s.jquery)return this._open(e,t,s);(i=s.call(t[0],function(i){n._delay(function(){t.data("ui-tooltip-open")&&(e&&(e.type=o),this._open(e,t,i))})}))&&this._open(e,t,i)},_open:function(e,i,s){var n,o,a,r,h=t.extend({},this.options.position);function l(t){h.of=t,o.is(":hidden")||o.position(h)}s&&((n=this._find(i))?n.tooltip.find(".ui-tooltip-content").html(s):(i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),n=this._tooltip(i),o=n.tooltip,this._addDescribedBy(i,o.attr("id")),o.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),(r=t("<div>").html(o.find(".ui-tooltip-content").html())).removeAttr("name").find("[name]").removeAttr("name"),r.removeAttr("id").find("[id]").removeAttr("id"),r.appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:l}),l(e)):o.position(t.extend({of:i},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(a=this.delayedShow=setInterval(function(){o.is(":visible")&&(l(h.of),clearInterval(a))},t.fx.interval)),this._trigger("open",e,{tooltip:o})))},_registerCloseHandlers:function(e,i){var s={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),e&&"mouseover"!==e.type||(s.mouseleave="close"),e&&"focusin"!==e.type||(s.focusout="close"),this._on(!0,i,s)},close:function(e){var i,s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);o?(i=o.tooltip,o.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),o.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),o.closing=!0,this._trigger("close",e,{tooltip:i}),o.hiding||(o.closing=!1))):n.removeData("ui-tooltip-open")},_tooltip:function(e){var i=t("<div>").attr("role","tooltip"),s=t("<div>").appendTo(i),n=i.uniqueId().attr("id");return this._addClass(s,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[n]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur"),o=s.element;n.target=n.currentTarget=o[0],e.close(n,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!1!==t.uiBackCompat&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}});t.ui.tooltip;var _,v="ui-effects-animated",b=t;t.effects={effect:{}},function(t,e){var i,s=/^([\-+])=\s*(\d+\.?\d*)/,n=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],o=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},a={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},r={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},h=o.support={},l=t("<p>")[0],c=t.each;function u(t,e,i){var s=r[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:s.max<t?s.max:t)}function d(e){var s=o(),r=s._rgba=[];return e=e.toLowerCase(),c(n,function(t,i){var n,o=i.re.exec(e),h=o&&i.parse(o),l=i.space||"rgba";if(h)return n=s[l](h),s[a[l].cache]=n[a[l].cache],r=s._rgba=n._rgba,!1}),r.length?("0,0,0,0"===r.join()&&t.extend(r,i.transparent),s):i[e]}function p(t,e,i){return 6*(i=(i+1)%1)<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}l.style.cssText="background-color:rgba(1,1,1,.5)",h.rgba=l.style.backgroundColor.indexOf("rgba")>-1,c(a,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),o.fn=t.extend(o.prototype,{parse:function(e,s,n,r){if(void 0===e)return this._rgba=[null,null,null,null],this;(e.jquery||e.nodeType)&&(e=t(e).css(s),s=void 0);var h=this,l=t.type(e),p=this._rgba=[];return void 0!==s&&(e=[e,s,n,r],l="array"),"string"===l?this.parse(d(e)||i._default):"array"===l?(c(a.rgba.props,function(t,i){p[i.idx]=u(e[i.idx],i)}),this):"object"===l?(c(a,e instanceof o?function(t,i){e[i.cache]&&(h[i.cache]=e[i.cache].slice())}:function(i,s){var n=s.cache;c(s.props,function(t,i){if(!h[n]&&s.to){if("alpha"===t||null==e[t])return;h[n]=s.to(h._rgba)}h[n][i.idx]=u(e[t],i,!0)}),h[n]&&t.inArray(null,h[n].slice(0,3))<0&&(h[n][3]=1,s.from&&(h._rgba=s.from(h[n])))}),this):void 0},is:function(t){var e=o(t),i=!0,s=this;return c(a,function(t,n){var o,a=e[n.cache];return a&&(o=s[n.cache]||n.to&&n.to(s._rgba)||[],c(n.props,function(t,e){if(null!=a[e.idx])return i=a[e.idx]===o[e.idx]})),i}),i},_space:function(){var t=[],e=this;return c(a,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var i=o(t),s=i._space(),n=a[s],h=0===this.alpha()?o("transparent"):this,l=h[n.cache]||n.to(h._rgba),d=l.slice();return i=i[n.cache],c(n.props,function(t,s){var n=s.idx,o=l[n],a=i[n],h=r[s.type]||{};null!==a&&(null===o?d[n]=a:(h.mod&&(a-o>h.mod/2?o+=h.mod:o-a>h.mod/2&&(o-=h.mod)),d[n]=u((a-o)*e+o,s)))}),this[s](d)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=o(e)._rgba;return o(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&e<3&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return 1===(t=(t||0).toString(16)).length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),o.fn.parse.prototype=o.fn,a.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:u<=.5?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},a.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],n=t[3],o=s<=.5?s*(1+i):s+i-s*i,a=2*s-o;return[Math.round(255*p(a,o,e+1/3)),Math.round(255*p(a,o,e)),Math.round(255*p(a,o,e-1/3)),n]},c(a,function(e,i){var n=i.props,a=i.cache,r=i.to,h=i.from;o.fn[e]=function(e){if(r&&!this[a]&&(this[a]=r(this._rgba)),void 0===e)return this[a].slice();var i,s=t.type(e),l="array"===s||"object"===s?e:arguments,d=this[a].slice();return c(n,function(t,e){var i=l["object"===s?t:e.idx];null==i&&(i=d[e.idx]),d[e.idx]=u(i,e)}),h?((i=o(h(d)))[a]=d,i):o(d)},c(n,function(i,n){o.fn[i]||(o.fn[i]=function(o){var a,r=t.type(o),h="alpha"===i?this._hsla?"hsla":"rgba":e,l=this[h](),c=l[n.idx];return"undefined"===r?c:("function"===r&&(o=o.call(this,c),r=t.type(o)),null==o&&n.empty?this:("string"===r&&(a=s.exec(o))&&(o=c+parseFloat(a[2])*("+"===a[1]?1:-1)),l[n.idx]=o,this[h](l)))})})}),o.hook=function(e){var i=e.split(" ");c(i,function(e,i){t.cssHooks[i]={set:function(e,s){var n,a,r="";if("transparent"!==s&&("string"!==t.type(s)||(n=d(s)))){if(s=o(n||s),!h.rgba&&1!==s._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(t){}s=s.blend(r&&"transparent"!==r?r:"_default")}s=s.toRgbaString()}try{e.style[i]=s}catch(t){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=o(e.elem,i),e.end=o(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},o.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),t.cssHooks.borderColor={expand:function(t){var e={};return c(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},i=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(b),function(){var e,i=["add","remove","toggle"],s={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};function n(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)"string"==typeof n[i=n[s]]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(b.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){return{el:t(this),start:n(this)}}),(o=function(){t.each(i,function(t,i){e[i]&&a[i+"Class"](e[i])})})(),l=l.map(function(){return this.end=n(this.el[0]),this.diff=function(e,i){var n,o,a={};for(n in i)o=i[n],e[n]!==o&&(s[n]||!t.fx.step[n]&&isNaN(parseFloat(o))||(a[n]=o));return a}(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:(e=t.fn.addClass,function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){var e;function i(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function s(e){return!(e&&"number"!=typeof e&&!t.fx.speeds[e])||("string"==typeof e&&!t.effects.effect[e]||(!!t.isFunction(e)||"object"==typeof e&&!e.effect))}function n(t,e){var i=e.outerWidth(),s=e.outerHeight(),n=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(t)||["",0,i,s,0];return{top:parseFloat(n[1])||0,right:"auto"===n[2]?i:parseFloat(n[2]),bottom:"auto"===n[3]?s:parseFloat(n[3]),left:parseFloat(n[4])||0}}t.expr&&t.expr.filters&&t.expr.filters.animated&&(t.expr.filters.animated=(e=t.expr.filters.animated,function(i){return!!t(i).data(v)||e(i)})),!1!==t.uiBackCompat&&t.extend(t.effects,{save:function(t,e){for(var i=0,s=e.length;i<s;i++)null!==e[i]&&t.data("ui-effects-"+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;s<n;s++)null!==e[s]&&(i=t.data("ui-effects-"+e[s]),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),float:e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(t){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).trigger("focus"),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).trigger("focus")),e}}),t.extend(t.effects,{version:"1.12.0",define:function(e,i,s){return s||(s=i,i="effect"),t.effects.effect[e]=s,t.effects.effect[e].mode=i,s},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,n="vertical"!==i?(e||100)/100:1;return{height:t.height()*n,width:t.width()*s,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();e>1&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data("ui-effects-style",t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data("ui-effects-style")||"",t.removeData("ui-effects-style")},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(e){var i,s=e.css("position"),n=e.position();return e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()),/^(static|relative)/.test(s)&&(s="absolute",i=t("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),float:e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder"),e.data("ui-effects-placeholder",i)),e.css({position:s,left:n.left,top:n.top}),i},removePlaceholder:function(t){var e="ui-effects-placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(e){t.effects.restoreStyle(e),t.effects.removePlaceholder(e)},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){var e=i.apply(this,arguments),s=t.effects.effect[e.effect],n=s.mode,o=e.queue,a=o||"fx",r=e.complete,h=e.mode,l=[],c=function(e){var i=t(this),s=t.effects.mode(i,h)||n;i.data(v,!0),l.push(s),n&&("show"===s||s===n&&"hide"===s)&&i.show(),n&&"none"===s||t.effects.saveStyle(i),t.isFunction(e)&&e()};if(t.fx.off||!s)return h?this[h](e.duration,r):this.each(function(){r&&r.call(this)});function u(i){var o=t(this);function a(){t.isFunction(r)&&r.call(o[0]),t.isFunction(i)&&i()}e.mode=l.shift(),!1===t.uiBackCompat||n?"none"===e.mode?(o[h](),a()):s.call(o[0],e,function(){o.removeData(v),t.effects.cleanUp(o),"hide"===e.mode&&o.hide(),a()}):(o.is(":hidden")?"hide"===h:"show"===h)?(o[h](),a()):s.call(o[0],e,a)}return!1===o?this.each(c).each(u):this.queue(a,c).queue(a,u)},show:function(t){return function(e){if(s(e))return t.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(t.fn.show),hide:function(t){return function(e){if(s(e))return t.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(e){if(s(e)||"boolean"==typeof e)return t.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):n(this.css("clip"),this)},transfer:function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,h=o?a.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),t.isFunction(i)&&i()})}}),t.fx.step.clip=function(e){e.clipInit||(e.start=t(e.elem).cssClip(),"string"==typeof e.end&&(e.end=n(e.end,e.elem)),e.clipInit=!0),t(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}}(),_={},t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,e){_[e]=function(e){return Math.pow(e,t+2)}}),t.extend(_,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(_,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return t<.5?i(2*t)/2:1-i(-2*t+2)/2}});t.effects,t.effects.define("blind","hide",function(e,i){var s={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},n=t(this),o=e.direction||"up",a=n.cssClip(),r={clip:t.extend({},a)},h=t.effects.createPlaceholder(n);r.clip[s[o][0]]=r.clip[s[o][1]],"show"===e.mode&&(n.cssClip(r.clip),h&&h.css(t.effects.clipToBox(r)),r.clip=a),h&&h.animate(t.effects.clipToBox(r),e.duration,e.easing),n.animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("bounce",function(e,i){var s,n,o,a=t(this),r=e.mode,h="hide"===r,l="show"===r,c=e.direction||"up",u=e.distance,d=e.times||5,p=2*d+(l||h?1:0),f=e.duration/p,g=e.easing,m="up"===c||"down"===c?"top":"left",_="up"===c||"left"===c,v=0,b=a.queue().length;for(t.effects.createPlaceholder(a),o=a.css(m),u||(u=a["top"===m?"outerHeight":"outerWidth"]()/3),l&&((n={opacity:1})[m]=o,a.css("opacity",0).css(m,_?2*-u:2*u).animate(n,f,g)),h&&(u/=Math.pow(2,d-1)),(n={})[m]=o;v<d;v++)(s={})[m]=(_?"-=":"+=")+u,a.animate(s,f,g).animate(n,f,g),u=h?2*u:u/2;h&&((s={opacity:0})[m]=(_?"-=":"+=")+u,a.animate(s,f,g)),a.queue(i),t.effects.unshift(a,b,p+1)}),t.effects.define("clip","hide",function(e,i){var s,n={},o=t(this),a=e.direction||"vertical",r="both"===a,h=r||"horizontal"===a,l=r||"vertical"===a;s=o.cssClip(),n.clip={top:l?(s.bottom-s.top)/2:s.top,right:h?(s.right-s.left)/2:s.right,bottom:l?(s.bottom-s.top)/2:s.bottom,left:h?(s.right-s.left)/2:s.left},t.effects.createPlaceholder(o),"show"===e.mode&&(o.cssClip(n.clip),n.clip=s),o.animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("drop","hide",function(e,i){var s,n=t(this),o="show"===e.mode,a=e.direction||"left",r="up"===a||"down"===a?"top":"left",h="up"===a||"left"===a?"-=":"+=",l="+="===h?"-=":"+=",c={opacity:0};t.effects.createPlaceholder(n),s=e.distance||n["top"===r?"outerHeight":"outerWidth"](!0)/2,c[r]=h+s,o&&(n.css(c),c[r]=l+s,c.opacity=1),n.animate(c,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("explode","hide",function(e,i){var s,n,o,a,r,h,l=e.pieces?Math.round(Math.sqrt(e.pieces)):3,c=l,u=t(this),d="show"===e.mode,p=u.show().css("visibility","hidden").offset(),f=Math.ceil(u.outerWidth()/c),g=Math.ceil(u.outerHeight()/l),m=[];function _(){m.push(this),m.length===l*c&&(u.css({visibility:"visible"}),t(m).remove(),i())}for(s=0;s<l;s++)for(a=p.top+s*g,h=s-(l-1)/2,n=0;n<c;n++)o=p.left+n*f,r=n-(c-1)/2,u.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-n*f,top:-s*g}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:f,height:g,left:o+(d?r*f:0),top:a+(d?h*g:0),opacity:d?0:1}).animate({left:o+(d?0:r*f),top:a+(d?0:h*g),opacity:d?1:0},e.duration||500,e.easing,_)}),t.effects.define("fade","toggle",function(e,i){var s="show"===e.mode;t(this).css("opacity",s?0:1).animate({opacity:s?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("fold","hide",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=e.size||15,h=/([0-9]+)%/.exec(r),l=!!e.horizFirst?["right","bottom"]:["bottom","right"],c=e.duration/2,u=t.effects.createPlaceholder(s),d=s.cssClip(),p={clip:t.extend({},d)},f={clip:t.extend({},d)},g=[d[l[0]],d[l[1]]],m=s.queue().length;h&&(r=parseInt(h[1],10)/100*g[a?0:1]),p.clip[l[0]]=r,f.clip[l[0]]=r,f.clip[l[1]]=0,o&&(s.cssClip(f.clip),u&&u.css(t.effects.clipToBox(f)),f.clip=d),s.queue(function(i){u&&u.animate(t.effects.clipToBox(p),c,e.easing).animate(t.effects.clipToBox(f),c,e.easing),i()}).animate(p,c,e.easing).animate(f,c,e.easing).queue(i),t.effects.unshift(s,m,4)}),t.effects.define("highlight","show",function(e,i){var s=t(this),n={backgroundColor:s.css("backgroundColor")};"hide"===e.mode&&(n.opacity=0),t.effects.saveStyle(s),s.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("size",function(e,i){var s,n,o,a=t(this),r=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],l=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],c=e.mode,u="effect"!==c,d=e.scale||"both",p=e.origin||["middle","center"],f=a.css("position"),g=a.position(),m=t.effects.scaledDimensions(a),_=e.from||m,v=e.to||t.effects.scaledDimensions(a,0);t.effects.createPlaceholder(a),"show"===c&&(o=_,_=v,v=o),n={from:{y:_.height/m.height,x:_.width/m.width},to:{y:v.height/m.height,x:v.width/m.width}},"box"!==d&&"both"!==d||(n.from.y!==n.to.y&&(_=t.effects.setTransition(a,h,n.from.y,_),v=t.effects.setTransition(a,h,n.to.y,v)),n.from.x!==n.to.x&&(_=t.effects.setTransition(a,l,n.from.x,_),v=t.effects.setTransition(a,l,n.to.x,v))),"content"!==d&&"both"!==d||n.from.y!==n.to.y&&(_=t.effects.setTransition(a,r,n.from.y,_),v=t.effects.setTransition(a,r,n.to.y,v)),p&&(s=t.effects.getBaseline(p,m),_.top=(m.outerHeight-_.outerHeight)*s.y+g.top,_.left=(m.outerWidth-_.outerWidth)*s.x+g.left,v.top=(m.outerHeight-v.outerHeight)*s.y+g.top,v.left=(m.outerWidth-v.outerWidth)*s.x+g.left),a.css(_),"content"!==d&&"both"!==d||(h=h.concat(["marginTop","marginBottom"]).concat(r),l=l.concat(["marginLeft","marginRight"]),a.find("*[width]").each(function(){var i=t(this),s=t.effects.scaledDimensions(i),o={height:s.height*n.from.y,width:s.width*n.from.x,outerHeight:s.outerHeight*n.from.y,outerWidth:s.outerWidth*n.from.x},a={height:s.height*n.to.y,width:s.width*n.to.x,outerHeight:s.height*n.to.y,outerWidth:s.width*n.to.x};n.from.y!==n.to.y&&(o=t.effects.setTransition(i,h,n.from.y,o),a=t.effects.setTransition(i,h,n.to.y,a)),n.from.x!==n.to.x&&(o=t.effects.setTransition(i,l,n.from.x,o),a=t.effects.setTransition(i,l,n.to.x,a)),u&&t.effects.saveStyle(i),i.css(o),i.animate(a,e.duration,e.easing,function(){u&&t.effects.restoreStyle(i)})})),a.animate(v,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){var e=a.offset();0===v.opacity&&a.css("opacity",_.opacity),u||(a.css("position","static"===f?"relative":f).offset(e),t.effects.saveStyle(a)),i()}})}),t.effects.define("scale",function(e,i){var s=t(this),n=e.mode,o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"effect"!==n?0:100),a=t.extend(!0,{from:t.effects.scaledDimensions(s),to:t.effects.scaledDimensions(s,o,e.direction||"both"),origin:e.origin||["middle","center"]},e);e.fade&&(a.from.opacity=1,a.to.opacity=0),t.effects.effect.size.call(this,a,i)}),t.effects.define("puff","hide",function(e,i){var s=t.extend(!0,{},e,{fade:!0,percent:parseInt(e.percent,10)||150});t.effects.effect.scale.call(this,s,i)}),t.effects.define("pulsate","show",function(e,i){var s=t(this),n=e.mode,o="show"===n,a=o||"hide"===n,r=2*(e.times||5)+(a?1:0),h=e.duration/r,l=0,c=1,u=s.queue().length;for(!o&&s.is(":visible")||(s.css("opacity",0).show(),l=1);c<r;c++)s.animate({opacity:l},h,e.easing),l=1-l;s.animate({opacity:l},h,e.easing),s.queue(i),t.effects.unshift(s,u,r+1)}),t.effects.define("shake",function(e,i){var s=1,n=t(this),o=e.direction||"left",a=e.distance||20,r=e.times||3,h=2*r+1,l=Math.round(e.duration/h),c="up"===o||"down"===o?"top":"left",u="up"===o||"left"===o,d={},p={},f={},g=n.queue().length;for(t.effects.createPlaceholder(n),d[c]=(u?"-=":"+=")+a,p[c]=(u?"+=":"-=")+2*a,f[c]=(u?"-=":"+=")+2*a,n.animate(d,l,e.easing);s<r;s++)n.animate(p,l,e.easing).animate(f,l,e.easing);n.animate(p,l,e.easing).animate(d,l/2,e.easing).queue(i),t.effects.unshift(n,g,h+1)}),t.effects.define("slide","show",function(e,i){var s,n,o=t(this),a={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},r=e.mode,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u=e.distance||o["top"===l?"outerHeight":"outerWidth"](!0),d={};t.effects.createPlaceholder(o),s=o.cssClip(),n=o.position()[l],d[l]=(c?-1:1)*u+n,d.clip=o.cssClip(),d.clip[a[h][1]]=d.clip[a[h][0]],"show"===r&&(o.cssClip(d.clip),o.css(l,d[l]),d.clip=s,d[l]=n),o.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:i})});!1!==t.uiBackCompat&&t.effects.define("transfer",function(e,i){t(this).transfer(e,i)})});;!function(){function t(){}window.Chart&&(t.prototype.setup=function(t,e){this.chart=t,this.ctx=t.ctx,this.limits=e.data.datasets[0].gaugeLimits,this.data=e.data.datasets[0].gaugeData;var i=t.options;this.fontSize=i.defaultFontSize,this.fontStyle=i.defaultFontFamily,this.fontColor=i.defaultFontColor,this.ctx.textBaseline="alphabetic",this.arrowAngle=25*Math.PI/180,this.arrowColor=e.options.indicatorColor||i.arrowColor,this.showMarkers=void 0===e.options.showMarkers||e.options.showMarkers,e.options.markerFormatFn?this.markerFormatFn=e.options.markerFormatFn:this.markerFormatFn=function(t){return t}},t.prototype.applyGaugeConfig=function(t){this.calcLimits(),t.data.datasets[0].data=this.doughnutData;var e=this.ctx,i=this.limits.map(function(t){var i=this.markerFormatFn(t);return e.measureText(i).width}.bind(this)),r=Math.max.apply(this,i)+this.chart.width/35,a=this.chart.height/50;t.options.layout.padding={top:this.fontSize+a,left:r,right:r,bottom:2*a}},t.prototype.calcLimits=function(){for(var t=this.limits,e=[],i=0,r=1,a=t.length;r<a;r++){var o=Math.abs(t[r]-t[r-1]);i+=o,e.push(o)}this.doughnutData=e;var n=t[0],s=t[t.length-1];this.isRevers=n>s,this.minValue=this.isRevers?s:n,this.totalValue=i},t.prototype.updateGaugeDimensions=function(){var t=this.chart.chartArea;this.gaugeRadius=this.chart.innerRadius,this.gaugeCenterX=(t.left+t.right)/2,this.gaugeCenterY=(t.top+t.bottom+this.chart.outerRadius)/2,this.arrowLength=2*this.chart.radiusLength},t.prototype.getCoordOnCircle=function(t,e){return{x:t*Math.cos(e),y:t*Math.sin(e)}},t.prototype.getAngleOfValue=function(t){var e=0,i=t-this.minValue;return e=i<=0?0:i>=this.totalValue?Math.PI:Math.PI*i/this.totalValue,this.isRevers?Math.PI-e:e},t.prototype.renderLimitLabel=function(t){var e,i=this.ctx,r=this.getAngleOfValue(t),a=this.getCoordOnCircle(this.chart.outerRadius+this.chart.radiusLength/2,r),o=r-Math.PI/2;e=o>0?"left":o<0?"right":"center",i.textAlign=e,i.font=this.fontSize+"px "+this.fontStyle,i.fillStyle=this.fontColor;var n=this.markerFormatFn(t);i.fillText(n,this.gaugeCenterX-a.x,this.gaugeCenterY-a.y)},t.prototype.renderLimits=function(){for(var t=0,e=this.limits.length;t<e;t++)this.renderLimitLabel(this.limits[t])},t.prototype.renderValueLabel=function(){var t=this.data.value.toString(),e=this.ctx;e.font="30px "+this.fontStyle;var i=e.measureText(t).width,r=.75*this.gaugeRadius*2/i,a=Math.floor(30*r),o=Math.min(a,this.gaugeRadius);e.textAlign="center",e.font=o+"px "+this.fontStyle,e.fillStyle=this.data.valueColor||this.fontColor,e.fillText(t,this.gaugeCenterX,this.gaugeCenterY)},t.prototype.renderValueArrow=function(t){var e=this.getAngleOfValue("number"==typeof t?t:this.data.value);this.ctx.globalCompositeOperation="source-over",this.renderArrow(this.gaugeRadius,e,this.arrowLength,this.arrowAngle,this.arrowColor)},t.prototype.renderSmallValueArrow=function(t){var e=this.getAngleOfValue(t);this.ctx.globalCompositeOperation="source-over",this.renderArrow(this.gaugeRadius-1,e,this.arrowLength-1,this.arrowAngle,this.arrowColor)},t.prototype.clearValueArrow=function(t){var e=this.getAngleOfValue(t);this.ctx.lineWidth=2,this.ctx.globalCompositeOperation="destination-out",this.renderArrow(this.gaugeRadius-1,e,this.arrowLength+1,this.arrowAngle,"#FFFFFF"),this.ctx.stroke()},t.prototype.renderArrow=function(t,e,i,r,a){var o=this.getCoordOnCircle(t,e),n={x:this.gaugeCenterX-o.x,y:this.gaugeCenterY-o.y},s=this.ctx;s.fillStyle=a,s.beginPath(),s.moveTo(n.x,n.y),o=this.getCoordOnCircle(i,e+r),s.lineTo(n.x+o.x,n.y+o.y),o=this.getCoordOnCircle(i,e-r),s.lineTo(n.x+o.x,n.y+o.y),s.closePath(),s.fill()},t.prototype.animateArrow=function(){var t=(this.data.value-this.minValue)/30,e=0,i=this.minValue,r=setInterval(function(){e++,this.clearValueArrow(i),e>30?(clearInterval(r),this.renderValueArrow()):(i+=t,this.renderSmallValueArrow(i))}.bind(this),10)},Chart.defaults.tsgauge={animation:{animateRotate:!0,animateScale:!1},cutoutPercentage:95,rotation:Math.PI,circumference:Math.PI,legend:{display:!1},scales:{},arrowColor:"#444"},Chart.controllers.tsgauge=Chart.controllers.doughnut.extend({initialize:function(e){var i=this.gaugeHelper=new t;i.setup(e,e.config),i.applyGaugeConfig(e.config),e.config.options.animation.onComplete=function(t){i.updateGaugeDimensions(),i.animateArrow()},Chart.controllers.doughnut.prototype.initialize.apply(this,arguments)},draw:function(){Chart.controllers.doughnut.prototype.draw.apply(this,arguments);var t=this.gaugeHelper;t.updateGaugeDimensions(),t.renderValueLabel(),t.showMarkers&&t.renderLimits(),t.renderSmallValueArrow(t.minValue)}}))}();;(function(){"use strict";angular.module("LocalStorageModule",[]).provider("localStorageService",function(){this.prefix="ls",this.storageType="localStorage",this.cookie={expiry:30,path:"/"},this.notify={setItem:!0,removeItem:!1},this.setPrefix=function(t){this.prefix=t},this.setStorageType=function(t){this.storageType=t},this.setStorageCookie=function(t,e){this.cookie={expiry:t,path:e}},this.setStorageCookieDomain=function(t){this.cookie.domain=t},this.setNotify=function(t,e){this.notify={setItem:t,removeItem:e}},this.$get=["$rootScope","$window","$document",function(t,e,o){var r,i=this.prefix,n=this.cookie,a=this.notify,c=this.storageType;o||(o=document),"."!==i.substr(-1)&&(i=i?i+".":"");var s=function(t){return i+t},u=function(){try{var o=c in e&&null!==e[c],i=s("__"+Math.round(1e7*Math.random()));return o&&((r=e[c]).setItem(i,""),r.removeItem(i)),o}catch(e){return c="cookie",t.$broadcast("LocalStorageModule.notification.error",e.message),!1}}(),l=function(e,o){if(!u)return t.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),a.setItem&&t.$broadcast("LocalStorageModule.notification.setitem",{key:e,newvalue:o,storageType:"cookie"}),h(e,o);void 0===o&&(o=null);try{(angular.isObject(o)||angular.isArray(o))&&(o=angular.toJson(o)),r&&r.setItem(s(e),o),a.setItem&&t.$broadcast("LocalStorageModule.notification.setitem",{key:e,newvalue:o,storageType:this.storageType})}catch(r){return t.$broadcast("LocalStorageModule.notification.error",r.message),h(e,o)}return!0},g=function(e){if(!u)return t.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),m(e);var o=r?r.getItem(s(e)):null;return o&&"null"!==o?"{"===o.charAt(0)||"["===o.charAt(0)?angular.fromJson(o):o:null},f=function(e){if(!u)return t.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),a.removeItem&&t.$broadcast("LocalStorageModule.notification.removeitem",{key:e,storageType:"cookie"}),S(e);try{r.removeItem(s(e)),a.removeItem&&t.$broadcast("LocalStorageModule.notification.removeitem",{key:e,storageType:this.storageType})}catch(o){return t.$broadcast("LocalStorageModule.notification.error",o.message),S(e)}return!0},d=function(){try{return navigator.cookieEnabled||"cookie"in o&&(o.cookie.length>0||(o.cookie="test").indexOf.call(o.cookie,"test")>-1)}catch(e){return t.$broadcast("LocalStorageModule.notification.error",e.message),!1}},h=function(e,r){if(void 0===r)return!1;if(!d())return t.$broadcast("LocalStorageModule.notification.error","COOKIES_NOT_SUPPORTED"),!1;try{var i="",a=new Date,c="";if(null===r?(a.setTime(a.getTime()+-864e5),i="; expires="+a.toGMTString(),r=""):0!==n.expiry&&(a.setTime(a.getTime()+24*n.expiry*60*60*1e3),i="; expires="+a.toGMTString()),e){var u="; path="+n.path;n.domain&&(c="; domain="+n.domain),o.cookie=s(e)+"="+encodeURIComponent(r)+i+u+c}}catch(e){return t.$broadcast("LocalStorageModule.notification.error",e.message),!1}return!0},m=function(e){if(!d())return t.$broadcast("LocalStorageModule.notification.error","COOKIES_NOT_SUPPORTED"),!1;for(var r=o.cookie&&o.cookie.split(";")||[],n=0;n<r.length;n++){for(var a=r[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(s(e)+"="))return decodeURIComponent(a.substring(i.length+e.length+1,a.length))}return null},S=function(t){h(t,null)},T=function(){for(var t=null,e=i.length,r=o.cookie.split(";"),n=0;n<r.length;n++){for(t=r[n];" "===t.charAt(0);)t=t.substring(1,t.length);var a=t.substring(e,t.indexOf("="));S(a)}};return{isSupported:u,getStorageType:function(){return c},set:l,add:l,get:g,keys:function(){if(!u)return t.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),!1;var e=i.length,o=[];for(var n in r)if(n.substr(0,e)===i)try{o.push(n.substr(e))}catch(e){return t.$broadcast("LocalStorageModule.notification.error",e.Description),[]}return o},remove:f,clearAll:function(e){e=e||"";var o=i.slice(0,-1),n=new RegExp(o+"."+e);if(!u)return t.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),T();var a=i.length;for(var c in r)if(n.test(c))try{f(c.substr(a))}catch(e){return t.$broadcast("LocalStorageModule.notification.error",e.message),T()}return!0},bind:function(t,e,o){var r=g(e);null===r&&angular.isDefined(o)?r=o:angular.isObject(r)&&angular.isObject(o)&&(r=angular.extend(o,r)),t[e]=r,t.$watchCollection(e,function(t){l(e,t)})},deriveKey:s,cookie:{set:h,add:h,get:m,remove:S,clearAll:T}}}]})}).call(this);;!function(n,e,t){"use strict";function o(n,e,t){c.directive(n,["$parse","$swipe",function(o,c){var i=75,a=.3,u=30;return function(r,s,l){function h(n){if(!f)return!1;var t=Math.abs(n.y-f.y);return n=(n.x-f.x)*e,g&&t<i&&0<n&&n>u&&t/n<a}var f,g,d=o(l[n]);c.bind(s,{start:function(n,e){f=n,g=!0},cancel:function(n){g=!1},end:function(n,e){h(n)&&r.$apply(function(){s.triggerHandler(t),d(r,{$event:e})})}})}}])}var c=e.module("ngTouch",[]);c.factory("$swipe",[function(){function n(n){var e=n.touches&&n.touches.length?n.touches:[n];return{x:(n=n.changedTouches&&n.changedTouches[0]||n.originalEvent&&n.originalEvent.changedTouches&&n.originalEvent.changedTouches[0]||e[0].originalEvent||e[0]).clientX,y:n.clientY}}return{bind:function(e,t){var o,c,i,a,u=!1;e.on("touchstart mousedown",function(e){i=n(e),u=!0,c=o=0,a=i,t.start&&t.start(i,e)}),e.on("touchcancel",function(n){u=!1,t.cancel&&t.cancel(n)}),e.on("touchmove mousemove",function(e){if(u&&i){var r=n(e);o+=Math.abs(r.x-a.x),c+=Math.abs(r.y-a.y),a=r,10>o&&10>c||(c>o?(u=!1,t.cancel&&t.cancel(e)):(e.preventDefault(),t.move&&t.move(r,e)))}}),e.on("touchend mouseup",function(e){u&&(u=!1,t.end&&t.end(n(e),e))})}}}]),c.config(["$provide",function(n){n.decorator("ngClickDirective",["$delegate",function(n){return n.shift(),n}])}]),c.directive("ngClick",["$parse","$timeout","$rootElement",function(n,t,o){function c(n,e,t){for(var o=0;o<n.length;o+=2)if(Math.abs(n[o]-e)<h&&Math.abs(n[o+1]-t)<h)return n.splice(o,o+2),!0;return!1}function i(n){if(!(Date.now()-u>l)){var e=(t=n.touches&&n.touches.length?n.touches:[n])[0].clientX,t=t[0].clientY;1>e&&1>t||s&&s[0]===e&&s[1]===t||(s&&(s=null),"label"===n.target.tagName.toLowerCase()&&(s=[e,t]),c(r,e,t)||(n.stopPropagation(),n.preventDefault(),n.target&&n.target.blur()))}}function a(n){var e=(n=n.touches&&n.touches.length?n.touches:[n])[0].clientX,o=n[0].clientY;r.push(e,o),t(function(){for(var n=0;n<r.length;n+=2)if(r[n]==e&&r[n+1]==o){r.splice(n,n+2);break}},l,!1)}var u,r,s,l=2500,h=25,f="ng-click-active";return function(t,s,l){function h(){w=!1,s.removeClass(f)}var g,d,v,p,m=n(l.ngClick),w=!1;s.on("touchstart",function(n){w=!0,3==(g=n.target?n.target:n.srcElement).nodeType&&(g=g.parentNode),s.addClass(f),d=Date.now(),n=(n=n.touches&&n.touches.length?n.touches:[n])[0].originalEvent||n[0],v=n.clientX,p=n.clientY}),s.on("touchmove",function(n){h()}),s.on("touchcancel",function(n){h()}),s.on("touchend",function(n){var t=Date.now()-d,f=(m=(f=n.changedTouches&&n.changedTouches.length?n.changedTouches:n.touches&&n.touches.length?n.touches:[n])[0].originalEvent||f[0]).clientX,m=m.clientY,b=Math.sqrt(Math.pow(f-v,2)+Math.pow(m-p,2));w&&750>t&&12>b&&(r||(o[0].addEventListener("click",i,!0),o[0].addEventListener("touchstart",a,!0),r=[]),u=Date.now(),c(r,f,m),g&&g.blur(),e.isDefined(l.disabled)&&!1!==l.disabled||s.triggerHandler("click",[n])),h()}),s.onclick=function(n){},s.on("click",function(n,e){t.$apply(function(){m(t,{$event:e||n})})}),s.on("mousedown",function(n){s.addClass(f)}),s.on("mousemove mouseup",function(n){s.removeClass(f)})}}]),o("ngSwipeLeft",-1,"swipeleft"),o("ngSwipeRight",1,"swiperight")}(window,window.angular);;"use strict";angular.module("ngjsColorPicker",[]).directive("ngjsColorPicker",function(){var o=["#7bd148","#5484ed","#a4bdfc","#46d6db","#7ae7bf","#51b749","#fbd75b","#ffb878","#ff887c","#dc2127","#dbadff","#e1e1e1"];return{scope:{selected:"=?",customColors:"=?",options:"=?",gradient:"=?"},restrict:"E",template:'<ul ng-style="ulCss"><li ng-repeat="color in colors | limitTo: options.total"                        ng-class="{                        selected: (color===selected),                        hRDF: $first&&hzRound,                        hRDL: $last&&hzRound,                        vRDF: $first&&vertRound,                        vRDL: $last&&vertRound,                        tlRound: $first&&columnRound,                        trRound: $index==(options.columns-1)&&columnRound,                        brRound: $last&&columnRound,                        blRound: $index==(colors.length-options.columns)&&columnRound                        }"                        ng-click="pick(color)"                        ng-attr-style="background-color:{{color}};"                        ng-style="css">                        </li></ul>                       ',link:function(s,n,t){if(s.colors=s.customColors||o,s.options=s.options||{},s.options.size=s.options.size||30,s.options.columns=s.options.columns||4,s.options.randomColors=s.options.randomColors||0,s.options.total=s.options.total||s.colors.length,s.options.horizontal=!s.options.hasOwnProperty("horizontal")||s.options.horizontal,s.options.roundCorners=!!s.options.hasOwnProperty("roundCorners")&&s.options.roundCorners,s.gradient=s.gradient||null,s.css={},s.ulCss={},s.css.display=s.options.horizontal?"inline-block":"block",s.css.width=s.css.height=s.options.size+"px",s.options.columns>0){var r=s.css.width.indexOf("p");s.ulCss.width=s.options.columns*parseInt(s.css.width.substr(0,r))+"px",s.ulCss.height=s.options.size*(s.colors.length/s.options.columns)+"px",s.css.cssFloat="left"}if(s.hzRound=s.options.horizontal&&s.options.roundCorners&&0===s.options.columns,s.vertRound=!s.options.horizontal&&s.options.roundCorners&&0===s.options.columns,s.options.randomColors>0&&!s.customColors){s.colors=[];for(var l=s.options.randomColors;0!==l;)s.colors.push("#"+(Math.random().toString(16)+"000000").slice(2,8)),l--}if(s.gradient&&!s.customColors&&!s.options.randomColors){var i=(f=s.gradient.start,m=+("#"===f.charAt(0)),"#"+f.substr(m).toLowerCase());if(/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(i)){s.colors=[],l=s.gradient.hasOwnProperty("count")?s.gradient.count:10;for(var e=s.gradient.hasOwnProperty("step")?s.gradient.step:1;0!==l;)s.colors.push((c=0===s.colors.length?i:s.colors[s.colors.length-1],d=e,void 0,void 0,void 0,void 0,void 0,u=parseInt(c.slice(1),16),p=Math.round(2.55*d),h=(u>>8&255)+p,g=(255&u)+p,"#"+(16777216+65536*((a=(u>>16)+p)<255?a<1?0:a:255)+256*(h<255?h<1?0:h:255)+(g<255?g<1?0:g:255)).toString(16).slice(1))),e+=s.gradient.step,l--,"#ffffff"!==s.colors[s.colors.length-1].toLowerCase()&&"#000000"!==s.colors[s.colors.length-1]||(l=0)}}var c,d,u,p,a,h,g,f,m,C=s.colors.length%s.options.columns==0;s.columnRound=s.options.columns&&s.options.roundCorners&&C,s.pick=function(o){s.selected=o},s.selected=s.selected||s.colors[0]}}});;"use strict";!function(e){(t=e.module("datePicker",["angularMoment"])).constant("datePickerConfig",{template:"templates/datepicker.html",view:"month",views:["year","month","date","hours","minutes"],step:5}),t.filter("time",function(){return function(e){if(e instanceof Date||(e=new Date(e),!isNaN(e.getTime())))return function(e){return("0"+e.getHours()).slice(-2)+":"+("0"+e.getMinutes()).slice(-2)}(e)}}),t.directive("datePicker",["datePickerConfig","datePickerUtils",function(t,n){return{require:"?ngModel",template:'<div ng-include="template"></div>',scope:{model:"=datePicker",after:"=?",before:"=?"},link:function(a,i,r,s){var o=!1;a.date=new Date(a.model||new Date),a.views=t.views.concat(),a.view=r.view||t.view,a.now=new Date,a.template=r.template||t.template,a.watchDirectChanges=void 0!==r.watchDirectChanges,a.callbackOnSetDate=r.onSetDate?_.get(a.$parent,r.onSetDate):void 0;var d=parseInt(r.step||t.step,10),l=!!r.partial;if(s){var c,u;if(e.isDefined(r.minDate))s.$validators.min=function(t){return!n.isValidDate(t)||e.isUndefined(c)||t>=c},r.$observe("minDate",function(e){c=new Date(e),s.$validate()});if(e.isDefined(r.maxDate))s.$validators.max=function(t){return!n.isValidDate(t)||e.isUndefined(u)||t<=u},r.$observe("maxDate",function(e){u=new Date(e),s.$validate()})}function g(){var e=a.view;a.model&&!o&&(a.date=new Date(a.model),o=!1);var t=a.date;switch(e){case"year":a.years=n.getVisibleYears(t);break;case"month":a.months=n.getVisibleMonths(t);break;case"date":a.weekdays=a.weekdays||n.getDaysOfWeek(),a.weeks=n.getVisibleWeeks(t);break;case"hours":a.hours=n.getVisibleHours(t);break;case"minutes":a.minutes=n.getVisibleMinutes(t,d)}}a.views=a.views.slice(a.views.indexOf(r.maxView||"year"),a.views.indexOf(r.minView||"minutes")+1),1!==a.views.length&&-1!==a.views.indexOf(a.view)||(a.view=a.views[0]),a.setView=function(e){-1!==a.views.indexOf(e)&&(a.view=e)},a.setDate=function(e){if(!r.disabled){a.date=e;var t=a.views[a.views.indexOf(a.view)+1];if(!t||l||a.model){switch(a.model=new Date(a.model||e),s&&s.$setViewValue(a.date),l?"minutes":a.view){case"minutes":a.model.setMinutes(e.getMinutes());case"hours":a.model.setHours(e.getHours());case"date":a.model=new Date(e);break;case"month":a.model.setMonth(e.getMonth());case"year":a.model.setFullYear(e.getFullYear())}!t&&a.model&&(a.$emit("setMaxDate",r.datePicker,a.model,a.view),a.callbackOnSetDate&&a.callbackOnSetDate()),a.$emit("setDate",a.model,a.view)}t&&a.setView(t),t||"true"!==r.autoClose||(i.addClass("hidden"),a.$emit("hidePicker"))}},a.$watch(function(){return"date"!==a.view?a.view:a.date?a.date.getMonth():null},g),a.watchDirectChanges&&a.$watch("model",function(){o=!1,g()}),a.next=function(e){var t=a.date;switch(e=e||1,a.view){case"year":case"month":t.setFullYear(t.getFullYear()+e);break;case"date":var n=new Date(t);t.setMonth(t.getMonth()+e),t.getDate()<n.getDate()&&t.setDate(0);break;case"hours":case"minutes":t.setHours(t.getHours()+e)}o=!0,g()},a.prev=function(e){return a.next(-e||-1)},a.isAfter=function(e){return a.after&&n.isAfter(e,a.after)},a.isBefore=function(e){return a.before&&n.isBefore(e,a.before)},a.isSameMonth=function(e){return n.isSameMonth(a.model,e)},a.isSameYear=function(e){return n.isSameYear(a.model,e)},a.isSameDay=function(e){return n.isSameDay(a.model,e)},a.isSameHour=function(e){return n.isSameHour(a.model,e)},a.isSameMinutes=function(e){return n.isSameMinutes(a.model,e)},a.isNow=function(e){var t=!0,n=a.now;switch(a.view){case"minutes":t&=~~(e.getMinutes()/d)==~~(n.getMinutes()/d);case"hours":t&=e.getHours()===n.getHours();case"date":t&=e.getDate()===n.getDate();case"month":t&=e.getMonth()===n.getMonth();case"year":t&=e.getFullYear()===n.getFullYear()}return t}}}}]),e.module("datePicker").factory("datePickerUtils",function(){var e=function(e,t,n,a,i){return new Date(Date.UTC(0|e,0|t,0|n,0|a,0|i))};return{getVisibleMinutes:function(t,n){var a,i,r=(t=new Date(t||new Date)).getFullYear(),s=t.getMonth(),o=t.getDate(),d=t.getUTCHours(),l=[];for(a=0;a<60;a+=n)i=e(r,s,o,d,a),l.push(i);return l},getVisibleWeeks:function(e){var t=(e=new Date(e||new Date)).getMonth(),n=e.getYear();e.setDate(1),0===e.getDay()?e.setDate(-5):e.setDate(e.getDate()-(e.getDay()-1)),1===e.getDate()&&e.setDate(-6);for(var a,i=[];i.length<6&&!(e.getYear()===n&&e.getMonth()>t);)a=this.getDaysOfWeek(e),i.push(a),e.setDate(e.getDate()+7);return i},getVisibleYears:function(t){(t=new Date(t||new Date)).setFullYear(t.getFullYear()-t.getFullYear()%10);for(var n,a=t.getFullYear(),i=[],r=0;r<12;r++)n=e(a),i.push(n),a++;return i},getDaysOfWeek:function(t){(t=new Date(t||new Date)).setDate(t.getDate()-(t.getDay()-1));for(var n,a=t.getFullYear(),i=t.getMonth(),r=t.getDate(),s=[],o=0;o<7;o++)n=e(a,i,r),s.push(n),r++;return s},getVisibleMonths:function(t){for(var n,a=(t=new Date(t||new Date)).getFullYear(),i=[],r=0;r<12;r++)n=e(a,r,1),i.push(n);return i},getVisibleHours:function(t){var n,a,i=(t=new Date(t||new Date)).getFullYear(),r=t.getMonth(),s=t.getDate(),o=[];for(n=0;n<24;n++)a=e(i,r,s,n),o.push(a);return o},isAfter:function(e,t){return e=void 0!==e?new Date(e):e,t=new Date(t),e&&e.getTime()>=t.getTime()},isBefore:function(e,t){return e=void 0!==e?new Date(e):e,t=new Date(t),e.getTime()<=t.getTime()},isSameYear:function(e,t){return e=void 0!==e?new Date(e):e,t=new Date(t),e&&e.getFullYear()===t.getFullYear()},isSameMonth:function(e,t){return e=void 0!==e?new Date(e):e,t=new Date(t),this.isSameYear(e,t)&&e.getMonth()===t.getMonth()},isSameDay:function(e,t){return e=void 0!==e?new Date(e):e,t=new Date(t),this.isSameMonth(e,t)&&e.getDate()===t.getDate()},isSameHour:function(e,t){return e=void 0!==e?new Date(e):e,t=new Date(t),this.isSameDay(e,t)&&e.getHours()===t.getHours()},isSameMinutes:function(e,t){return e=void 0!==e?new Date(e):e,t=new Date(t),this.isSameHour(e,t)&&e.getMinutes()===t.getMinutes()},isValidDate:function(e){return e&&!(e.getTime&&e.getTime()!=e.getTime())},toMomentFormat:function(e){function t(e,t,n){return n.replace(new RegExp(e,"g"),t)}var n=e;return n=t("w","W",n=t("sss","SSS",n=t("E","d",n=t("d","D",n=t("y","Y",n)))))}}}),(t=e.module("datePicker")).directive("dateRange",function(){return{templateUrl:"templates/daterange.html",scope:{start:"=",end:"="},link:function(e,t,n){e.start=new Date(e.start||new Date),e.end=new Date(e.end||new Date),n.$observe("disabled",function(t){e.disableDatePickers=!!t}),e.$watch("start.getTime()",function(t){t&&e.end&&t>e.end.getTime()&&(e.end=new Date(t))}),e.$watch("end.getTime()",function(t){t&&e.start&&t<e.start.getTime()&&(e.start=new Date(t))})}}});var t,n="ng-pristine",a="ng-dirty";(t=e.module("datePicker")).constant("dateTimeConfig",{template:function(e){return'<div date-picker="'+e.ngModel+'" '+(e.view?'view="'+e.view+'" ':"")+(e.maxView?'max-view="'+e.maxView+'" ':"")+(e.autoClose?'auto-close="'+e.autoClose+'" ':"")+(e.template?'template="'+e.template+'" ':"")+(e.minView?'min-view="'+e.minView+'" ':"")+(e.partial?'partial="'+e.partial+'" ':"")+(e.step?'step="'+e.step+'" ':"")+'class="date-picker-date-time"></div>'},format:"yyyy-MM-dd HH:mm",views:["date","year","month","hours","minutes"],autoClose:!1,position:"relative"}),t.directive("dateTimeAppend",function(){return{link:function(e,t){t.bind("click",function(){t.find("input")[0].focus()})}}}),t.directive("dateTime",["$compile","$document","$filter","dateTimeConfig","$parse","datePickerUtils","moment",function(t,i,r,s,o,d,l){var c=i.find("body"),u=r("date");return{require:["ngModel","^?datepickerDiv"],scope:!0,link:function(i,r,g,m){var h,w,f=m[0],v=g.format||s.format,D=r.inheritedData("$formController"),p=o(g.views)(i)||s.views.concat(),b=g.view||p[0],y=p.indexOf(b),k=g.autoClose?o(g.autoClose)(i):s.autoClose,M=null,$=g.position||s.position,S=null;(-1===y&&p.splice(y,1),p.unshift(b),f.$formatters.push(function(e){return u(e,v)}),f.$parsers.unshift(function(e){var t=l(e,d.toMomentFormat(v));if(t.isValid()){Y();var n=t.toDate(),a=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0));return m[1]&&m[1].triggerEvent("createdDate"),a}}),e.isDefined(g.minDate))&&(f.$validators.min=function(t){return!d.isValidDate(t)||e.isUndefined(h)||t>=h},g.$observe("minDate",function(e){h=new Date(e),f.$validate()}));e.isDefined(g.maxDate)&&(f.$validators.max=function(t){return!d.isValidDate(t)||e.isUndefined(w)||t<=w},g.$observe("maxDate",function(e){w=new Date(e),f.$validate()}));var V=s.template(g);function Y(){M&&(M.remove(),M=null),S&&(S.remove(),S=null)}r.bind("focus",function(){if(!M){if(M=t(V)(i),i.$digest(),i.$on("setDate",function(e,t,i){!function(e){e.stopPropagation(),f.$pristine&&(f.$dirty=!0,f.$pristine=!1,r.removeClass(n).addClass(a),D&&D.$setDirty(),f.$render())}(e),m[1]&&m[1].triggerEvent("createdDate"),k&&p[p.length-1]===i&&Y()}),i.$on("hidePicker",function(){r.triggerHandler("blur")}),i.$on("$destroy",Y),"absolute"===$){var s=e.extend(r.offset(),{height:r[0].offsetHeight});M.css({top:s.top+s.height,left:s.left,display:"block",position:$}),c.append(M)}else S=e.element("<div date-picker-wrapper></div>"),r[0].parentElement.insertBefore(S[0],r[0]),S.append(M),M.css({top:r[0].offsetHeight+"px",display:"block"});M.bind("mousedown",function(e){e.preventDefault()})}}),r.bind("blur",Y)}}}]),e.module("datePicker").run(["$templateCache",function(e){e.put("templates/datepicker.html",'<div ng-switch="view">\r\n  <div ng-switch-when="date">\r\n    <table>\r\n      <thead>\r\n      <tr>\r\n        <th ng-click="prev()">&lsaquo;</th>\r\n        <th colspan="5" class="switch" ng-click="setView(\'month\')" ng-bind="date|date:\'yyyy MMMM\'"></th>\r\n        <th ng-click="next()">&rsaquo;</i></th>\r\n      </tr>\r\n      <tr>\r\n        <th ng-repeat="day in weekdays" style="overflow: hidden" ng-bind="day|date:\'EEE\'"></th>\r\n      </tr>\r\n      </thead>\r\n      <tbody>\r\n      <tr ng-repeat="week in weeks">\r\n        <td ng-repeat="day in week">\r\n          <span\r\n            ng-class="{\'now\':isNow(day),\'active\':isSameDay(day),\'disabled\':(day.getMonth()!=date.getMonth()),\'after\':isAfter(day),\'before\':isBefore(day)}"\r\n            ng-click="setDate(day)" ng-bind="day.getDate()"></span>\r\n        </td>\r\n      </tr>\r\n      </tbody>\r\n    </table>\r\n  </div>\r\n  <div ng-switch-when="year">\r\n    <table>\r\n      <thead>\r\n      <tr>\r\n        <th ng-click="prev(10)">&lsaquo;</th>\r\n        <th colspan="5" class="switch"ng-bind="years[0].getFullYear()+\' - \'+years[years.length-1].getFullYear()"></th>\r\n        <th ng-click="next(10)">&rsaquo;</i></th>\r\n      </tr>\r\n      </thead>\r\n      <tbody>\r\n      <tr>\r\n        <td colspan="7">\r\n          <span ng-class="{\'active\':isSameYear(year),\'now\':isNow(year)}"\r\n                ng-repeat="year in years"\r\n                ng-click="setDate(year)" ng-bind="year.getFullYear()"></span>\r\n        </td>\r\n      </tr>\r\n      </tbody>\r\n    </table>\r\n  </div>\r\n  <div ng-switch-when="month">\r\n    <table>\r\n      <thead>\r\n      <tr>\r\n        <th ng-click="prev()">&lsaquo;</th>\r\n        <th colspan="5" class="switch" ng-click="setView(\'year\')" ng-bind="date|date:\'yyyy\'"></th>\r\n        <th ng-click="next()">&rsaquo;</i></th>\r\n      </tr>\r\n      </thead>\r\n      <tbody>\r\n      <tr>\r\n        <td colspan="7">\r\n          <span ng-repeat="month in months"\r\n                ng-class="{\'active\':isSameMonth(month),\'after\':isAfter(month),\'before\':isBefore(month),\'now\':isNow(month)}"\r\n                ng-click="setDate(month)"\r\n                ng-bind="month|date:\'MMM\'"></span>\r\n        </td>\r\n      </tr>\r\n      </tbody>\r\n    </table>\r\n  </div>\r\n  <div ng-switch-when="hours">\r\n    <table>\r\n      <thead>\r\n      <tr>\r\n        <th ng-click="prev(24)">&lsaquo;</th>\r\n        <th colspan="5" class="switch" ng-click="setView(\'date\')" ng-bind="date|date:\'dd MMMM yyyy\'"></th>\r\n        <th ng-click="next(24)">&rsaquo;</i></th>\r\n      </tr>\r\n      </thead>\r\n      <tbody>\r\n      <tr>\r\n        <td colspan="7">\r\n          <span ng-repeat="hour in hours"\r\n                ng-class="{\'now\':isNow(hour),\'active\':isSameHour(hour)}"\r\n                ng-click="setDate(hour)" ng-bind="hour|time"></span>\r\n        </td>\r\n      </tr>\r\n      </tbody>\r\n    </table>\r\n  </div>\r\n  <div ng-switch-when="minutes">\r\n    <table>\r\n      <thead>\r\n      <tr>\r\n        <th ng-click="prev()">&lsaquo;</th>\r\n        <th colspan="5" class="switch" ng-click="setView(\'hours\')" ng-bind="date|date:\'dd MMMM yyyy\'"></th>\r\n        <th ng-click="next()">&rsaquo;</i></th>\r\n      </tr>\r\n      </thead>\r\n      <tbody>\r\n      <tr>\r\n        <td colspan="7">\r\n          <span ng-repeat="minute in minutes"\r\n                ng-class="{active:isSameMinutes(minute),\'now\':isNow(minute)}"\r\n                ng-click="setDate(minute)"\r\n                ng-bind="minute|time"></span>\r\n        </td>\r\n      </tr>\r\n      </tbody>\r\n    </table>\r\n  </div>\r\n</div>\r\n'),e.put("templates/daterange.html",'<div>\r\n    <table>\r\n        <tr>\r\n            <td valign="top">\r\n                <div date-picker="start" ng-disabled="disableDatePickers"  class="date-picker" date after="start" before="end" min-view="date" max-view="date"></div>\r\n            </td>\r\n            <td valign="top">\r\n                <div date-picker="end" ng-disabled="disableDatePickers"  class="date-picker" date after="start" before="end"  min-view="date" max-view="date"></div>\r\n            </td>\r\n        </tr>\r\n    </table>\r\n</div>\r\n')}])}(angular);;!function(){"use strict";angular.module("ngGeolocation",[]).factory("$geolocation",["$rootScope","$window","$q",function(o,t,i){function n(){return"geolocation"in t.navigator}var e={getCurrentPosition:function(r){var a=i.defer();return n()?t.navigator.geolocation.getCurrentPosition(function(t){o.$apply(function(){e.position.coords=t.coords,e.position.timestamp=t.timestamp,a.resolve(t)})},function(t){o.$apply(function(){a.reject({error:t})})},r):a.reject({error:{code:2,message:"This web browser does not support HTML5 Geolocation"}}),a.promise},watchPosition:function(i){n()?this.watchId||(this.watchId=t.navigator.geolocation.watchPosition(function(t){o.$apply(function(){e.position.coords=t.coords,e.position.timestamp=t.timestamp,delete e.position.error,o.$broadcast("$geolocation.position.changed",t)})},function(t){o.$apply(function(){e.position.error=t,delete e.position.coords,delete e.position.timestamp,o.$broadcast("$geolocation.position.error",t)})},i)):e.position={error:{code:2,message:"This web browser does not support HTML5 Geolocation"}}},clearWatch:function(){this.watchId&&(t.navigator.geolocation.clearWatch(this.watchId),delete this.watchId)},position:{}};return e}])}();;!function(angular){"use strict";angular.module("leaflet-directive",["nemLogging"]).directive("leaflet",["$q","leafletData","leafletMapDefaults","leafletHelpers","leafletEvents",function(e,r,a,t,n){return{restrict:"EA",replace:!0,scope:{center:"=",lfCenter:"=",defaults:"=",maxbounds:"=",bounds:"=",markers:"=",legend:"=",geojson:"=",paths:"=",tiles:"=",layers:"=",controls:"=",decorations:"=",eventBroadcast:"=",markersWatchOptions:"=",geojsonWatchOptions:"="},transclude:!0,template:'<div class="angular-leaflet-map"><div ng-transclude></div></div>',controller:["$scope",function(r){this._leafletMap=e.defer(),this.getMap=function(){return this._leafletMap.promise},this.getLeafletScope=function(){return r}}],link:function(e,o,i,l){function s(){isNaN(i.width)?o.css("width",i.width):o.css("width",i.width+"px")}function u(){isNaN(i.height)?o.css("height",i.height):o.css("height",i.height+"px")}var c=t.isDefined,d=a.setDefaults(e.defaults,i.id),f=n.getAvailableMapEvents(),p=n.addEvents;e.mapId=i.id,r.setDirectiveControls({},i.id),c(i.width)&&(s(),e.$watch(function(){return o[0].getAttribute("width")},function(){s(),g.invalidateSize()})),c(i.height)&&(u(),e.$watch(function(){return o[0].getAttribute("height")},function(){u(),g.invalidateSize()}));var g=new L.Map(o[0],a.getMapCreationDefaults(i.id));if(l._leafletMap.resolve(g),c(i.center)||c(i.lfCenter)||g.setView([d.center.lat,d.center.lng],d.center.zoom),!c(i.tiles)&&!c(i.layers)){var y=L.tileLayer(d.tileLayer,d.tileLayerOptions);y.addTo(g),r.setTiles(y,i.id)}if(c(g.zoomControl)&&c(d.zoomControlPosition)&&g.zoomControl.setPosition(d.zoomControlPosition),c(g.zoomControl)&&!1===d.zoomControl&&g.zoomControl.removeFrom(g),c(g.zoomsliderControl)&&c(d.zoomsliderControl)&&!1===d.zoomsliderControl&&g.zoomsliderControl.removeFrom(g),!c(i.eventBroadcast)){p(g,f,"eventName",e,"broadcast")}g.whenReady(function(){r.setMap(g,i.id)}),e.$on("$destroy",function(){a.reset(),g.remove(),r.unresolveMap(i.id)}),e.$on("invalidateSize",function(){g.invalidateSize()})}}}]),angular.module("leaflet-directive").factory("leafletBoundsHelpers",["leafletLogger","leafletHelpers",function(e,r){function a(e){return angular.isDefined(e)&&angular.isDefined(e.southWest)&&angular.isDefined(e.northEast)&&angular.isNumber(e.southWest.lat)&&angular.isNumber(e.southWest.lng)&&angular.isNumber(e.northEast.lat)&&angular.isNumber(e.northEast.lng)}var t=r.isArray,n=r.isNumber,o=r.isFunction,i=r.isDefined,l=e;return{createLeafletBounds:function(e){return a(e)?L.latLngBounds([e.southWest.lat,e.southWest.lng],[e.northEast.lat,e.northEast.lng]):void 0},isValidBounds:a,createBoundsFromArray:function(e){return t(e)&&2===e.length&&t(e[0])&&t(e[1])&&2===e[0].length&&2===e[1].length&&n(e[0][0])&&n(e[0][1])&&n(e[1][0])&&n(e[1][1])?{northEast:{lat:e[0][0],lng:e[0][1]},southWest:{lat:e[1][0],lng:e[1][1]}}:void l.error("[AngularJS - Leaflet] The bounds array is not valid.")},createBoundsFromLeaflet:function(e){if(i(e)&&o(e.getNorthEast)&&o(e.getSouthWest)){var r=e.getNorthEast(),a=e.getSouthWest();return{northEast:{lat:r.lat,lng:r.lng},southWest:{lat:a.lat,lng:a.lng}}}l.error("[AngularJS - Leaflet] The leaflet bounds is not valid object.")}}}]),angular.module("leaflet-directive").factory("leafletControlHelpers",["$rootScope","leafletLogger","leafletHelpers","leafletLayerHelpers","leafletMapDefaults",function(e,r,a,t,n){var o=a.isDefined,i=a.isObject,l=t.createLayer,s={},u=a.errorHeader+" [Controls] ",c=r,d=function(e,r,a){if(!n.getDefaults(a).controls.layers.visible)return!1;var t=!1;return i(e)&&Object.keys(e).forEach(function(r){var a=e[r];o(a.layerOptions)&&!1===a.layerOptions.showOnSelector||(t=!0)}),i(r)&&Object.keys(r).forEach(function(e){var a=r[e];o(a.layerParams)&&!1===a.layerParams.showOnSelector||(t=!0)}),t},f=function(e){var r=n.getDefaults(e),a={collapsed:r.controls.layers.collapsed,position:r.controls.layers.position,autoZIndex:!1};return angular.extend(a,r.controls.layers.options),r.controls.layers&&o(r.controls.layers.control)?r.controls.layers.control.apply(this,[[],[],a]):new L.control.layers([],[],a)},p={draw:{isPluginLoaded:function(){return!!angular.isDefined(L.Control.Draw)||(c.error(u+" Draw plugin is not loaded."),!1)},checkValidParams:function(){return!0},createControl:function(e){return new L.Control.Draw(e)}},scale:{isPluginLoaded:function(){return!0},checkValidParams:function(){return!0},createControl:function(e){return new L.control.scale(e)}},fullscreen:{isPluginLoaded:function(){return!!angular.isDefined(L.Control.Fullscreen)||(c.error(u+" Fullscreen plugin is not loaded."),!1)},checkValidParams:function(){return!0},createControl:function(e){return new L.Control.Fullscreen(e)}},search:{isPluginLoaded:function(){return!!angular.isDefined(L.Control.Search)||(c.error(u+" Search plugin is not loaded."),!1)},checkValidParams:function(){return!0},createControl:function(e){return new L.Control.Search(e)}},custom:{},minimap:{isPluginLoaded:function(){return!!angular.isDefined(L.Control.MiniMap)||(c.error(u+" Minimap plugin is not loaded."),!1)},checkValidParams:function(e){return!!o(e.layer)||(c.warn(u+' minimap "layer" option should be defined.'),!1)},createControl:function(e){var r=l(e.layer);return o(r)?new L.Control.MiniMap(r,e):void c.warn(u+' minimap control "layer" could not be created.')}}};return{layersControlMustBeVisible:d,isValidControlType:function(e){return-1!==Object.keys(p).indexOf(e)},createControl:function(e,r){return p[e].checkValidParams(r)?p[e].createControl(r):void 0},updateLayersControl:function(e,r,a,t,n,i){var l,u=s[r],c=d(t,n,r);if(o(u)&&a){for(l in i.baselayers)u.removeLayer(i.baselayers[l]);for(l in i.overlays)u.removeLayer(i.overlays[l]);e.removeControl(u),delete s[r]}if(c){for(l in u=f(r),s[r]=u,t){!(o(t[l].layerOptions)&&!1===t[l].layerOptions.showOnSelector)&&o(i.baselayers[l])&&u.addBaseLayer(i.baselayers[l],t[l].name)}for(l in n){!(o(n[l].layerParams)&&!1===n[l].layerParams.showOnSelector)&&o(i.overlays[l])&&u.addOverlay(i.overlays[l],n[l].name)}e.addControl(u)}return c}}}]),angular.module("leaflet-directive").service("leafletData",["leafletLogger","$q","leafletHelpers",function(e,r,a){var t=a.getDefer,n=a.getUnresolvedDefer,o=a.setResolvedDefer,i={},l=this,s=["map","tiles","layers","paths","markers","geoJSON","UTFGrid","decorations","directiveControls"];s.forEach(function(e){i[e]={}}),this.unresolveMap=function(e){var r=a.obtainEffectiveMapId(i.map,e);s.forEach(function(e){i[e][r]=void 0})},s.forEach(function(e){var r=function(e){return e.charAt(0).toUpperCase()+e.slice(1)}(e);l["set"+r]=function(r,a){n(i[e],a).resolve(r),o(i[e],a)},l["get"+r]=function(r){return t(i[e],r).promise}})}]),angular.module("leaflet-directive").service("leafletDirectiveControlsHelpers",["leafletLogger","leafletData","leafletHelpers",function(e,r,a){var t=a.isDefined,n=a.isString,o=a.isObject,i=e,l=a.errorHeader+"[leafletDirectiveControlsHelpers";return{extend:function(e,a,s,u){var c=l+".extend] ",d={};if(t(a)){if(n(a)&&t(s)&&t(u))d[a]={create:s,clean:u};else{if(!o(a)||t(s)||t(u))return void i.error(c+"incorrect arguments");d=a}r.getDirectiveControls().then(function(a){angular.extend(a,d),r.setDirectiveControls(a,e)})}else i.error(c+"thingToAddName cannot be undefined")}}}]),angular.module("leaflet-directive").factory("leafletEvents",["leafletMapEvents","leafletMarkerEvents","leafletPathEvents","leafletIterators",function(e,r,a,t){var n=angular.extend({},e,{bindMarkerEvents:r.bindEvents,getAvailableMarkerEvents:r.getAvailableEvents},a),o=n.genDispatchMapEvent;return n.addEvents=function(e,r,a,n,i){t.each(r,function(r){var t={};t[a]=r,e.on(r,o(n,r,i),t)})},n}]),angular.module("leaflet-directive").service("leafletGeoJsonHelpers",["leafletHelpers","leafletIterators",function(e,r){var a=e,t=r,n=function(e,r){return this.lat=e,this.lng=r,this},o=function(e){if(a.isUndefined(e))return!1;if(a.isArray(e)){if(2===e.length&&a.isNumber(e[0])&&a.isNumber(e[1]))return!0}else if(a.isDefined(e.type)&&"Point"===e.type&&a.isArray(e.coordinates)&&2===e.coordinates.length&&a.isNumber(e.coordinates[0])&&a.isNumber(e.coordinates[1]))return!0;return t.all(["lat","lng"],function(r){return a.isDefined(e[r])&&a.isNumber(e[r])})};return{getLat:function(e){return Array.isArray(e)&&2===e.length?e[1]:a.isDefined(e.type)&&"Point"===e.type?+e.coordinates[1]:+e.lat},getLng:function(e){return Array.isArray(e)&&2===e.length?e[0]:a.isDefined(e.type)&&"Point"===e.type?+e.coordinates[0]:+e.lng},validateCoords:o,getCoords:function(e){if(e&&o(e)){var r=null;if(Array.isArray(e)&&2===e.length)r=new n(e[1],e[0]);else{if(!a.isDefined(e.type)||"Point"!==e.type)return e;r=new n(e.coordinates[1],e.coordinates[0])}return angular.extend(e,r)}}}}]),angular.module("leaflet-directive").service("leafletHelpers",["$q","$log",function(e,r){function a(e,a){var t,o;if(angular.isDefined(a))t=a;else if(0===Object.keys(e).length)t="main";else if(Object.keys(e).length>=1)for(o in e)e.hasOwnProperty(o)&&(t=o);else r.error(n+"- You have more than 1 map on the DOM, you must provide the map ID to the leafletData.getXXX call");return t}function t(r,t){var n,o=a(r,t);return angular.isDefined(r[o])&&!0!==r[o].resolvedDefer?n=r[o].defer:(n=e.defer(),r[o]={defer:n,resolvedDefer:!1}),n}var n="[AngularJS - Leaflet] ",o=angular.copy,i=function(e){return angular.isDefined(e)&&null!==e},l=/([\:\-\_]+(.))/g,s=/^moz([A-Z])/,u=/^((?:x|data)[\:\-_])/i,c=function(e){return e.replace(l,function(e,r,a,t){return t?a.toUpperCase():a}).replace(s,"Moz$1")};return{camelCase:c,directiveNormalize:function(e){return c(e.replace(u,""))},copy:o,clone:o,errorHeader:n,getObjectValue:function(e,r){var a;if(e&&angular.isObject(e))return null!==r&&angular.isString(r)?(a=e,r.split(".").forEach(function(e){a&&(a=a[e])}),a):r},getObjectArrayPath:function(e){return e.split(".").reduce(function(e,r){return e+'["'+r+'"]'})},getObjectDotPath:function(e){return e.reduce(function(e,r){return e+"."+r})},defaultTo:function(e,r){return i(e)?e:r},isTruthy:function(e){return"true"===e||!0===e},isEmpty:function(e){return 0===Object.keys(e).length},isUndefinedOrEmpty:function(e){return angular.isUndefined(e)||null===e||0===Object.keys(e).length},isDefined:i,isUndefined:function(e){return!i(e)},isNumber:angular.isNumber,isString:angular.isString,isArray:angular.isArray,isObject:angular.isObject,isFunction:angular.isFunction,equals:angular.equals,isValidCenter:function(e){return angular.isDefined(e)&&angular.isNumber(e.lat)&&angular.isNumber(e.lng)&&angular.isNumber(e.zoom)},isValidPoint:function(e){return!!angular.isDefined(e)&&(angular.isArray(e)?2===e.length&&angular.isNumber(e[0])&&angular.isNumber(e[1]):angular.isNumber(e.lat)&&angular.isNumber(e.lng))},isSameCenterOnMap:function(e,r){var a=r.getCenter(),t=r.getZoom();return!(!e.lat||!e.lng||a.lat.toFixed(4)!==e.lat.toFixed(4)||a.lng.toFixed(4)!==e.lng.toFixed(4)||t!==e.zoom)},safeApply:function(e,r){var a=e.$root.$$phase;"$apply"===a||"$digest"===a?e.$eval(r):e.$evalAsync(r)},obtainEffectiveMapId:a,getDefer:function(e,r){var n=a(e,r);return angular.isDefined(e[n])&&!1!==e[n].resolvedDefer?e[n].defer:t(e,r)},getUnresolvedDefer:t,setResolvedDefer:function(e,r){e[a(e,r)].resolvedDefer=!0},rangeIsSupported:function(){var e=document.createElement("input");return e.setAttribute("type","range"),"range"===e.type},FullScreenControlPlugin:{isLoaded:function(){return angular.isDefined(L.Control.Fullscreen)}},MiniMapControlPlugin:{isLoaded:function(){return angular.isDefined(L.Control.MiniMap)}},AwesomeMarkersPlugin:{isLoaded:function(){return angular.isDefined(L.AwesomeMarkers)&&angular.isDefined(L.AwesomeMarkers.Icon)},is:function(e){return!!this.isLoaded()&&e instanceof L.AwesomeMarkers.Icon},equal:function(e,r){return!(!this.isLoaded()||!this.is(e))&&angular.equals(e,r)}},VectorMarkersPlugin:{isLoaded:function(){return angular.isDefined(L.VectorMarkers)&&angular.isDefined(L.VectorMarkers.Icon)},is:function(e){return!!this.isLoaded()&&e instanceof L.VectorMarkers.Icon},equal:function(e,r){return!(!this.isLoaded()||!this.is(e))&&angular.equals(e,r)}},DomMarkersPlugin:{isLoaded:function(){return!(!angular.isDefined(L.DomMarkers)||!angular.isDefined(L.DomMarkers.Icon))},is:function(e){return!!this.isLoaded()&&e instanceof L.DomMarkers.Icon},equal:function(e,r){return!(!this.isLoaded()||!this.is(e))&&angular.equals(e,r)}},PolylineDecoratorPlugin:{isLoaded:function(){return!!angular.isDefined(L.PolylineDecorator)},is:function(e){return!!this.isLoaded()&&e instanceof L.PolylineDecorator},equal:function(e,r){return!(!this.isLoaded()||!this.is(e))&&angular.equals(e,r)}},MakiMarkersPlugin:{isLoaded:function(){return!(!angular.isDefined(L.MakiMarkers)||!angular.isDefined(L.MakiMarkers.Icon))},is:function(e){return!!this.isLoaded()&&e instanceof L.MakiMarkers.Icon},equal:function(e,r){return!(!this.isLoaded()||!this.is(e))&&angular.equals(e,r)}},ExtraMarkersPlugin:{isLoaded:function(){return!(!angular.isDefined(L.ExtraMarkers)||!angular.isDefined(L.ExtraMarkers.Icon))},is:function(e){return!!this.isLoaded()&&e instanceof L.ExtraMarkers.Icon},equal:function(e,r){return!(!this.isLoaded()||!this.is(e))&&angular.equals(e,r)}},LabelPlugin:{isLoaded:function(){return angular.isDefined(L.Label)},is:function(e){return!!this.isLoaded()&&e instanceof L.MarkerClusterGroup}},MarkerClusterPlugin:{isLoaded:function(){return angular.isDefined(L.MarkerClusterGroup)},is:function(e){return!!this.isLoaded()&&e instanceof L.MarkerClusterGroup}},GoogleLayerPlugin:{isLoaded:function(){return angular.isDefined(L.Google)},is:function(e){return!!this.isLoaded()&&e instanceof L.Google}},ChinaLayerPlugin:{isLoaded:function(){return angular.isDefined(L.tileLayer.chinaProvider)}},HeatLayerPlugin:{isLoaded:function(){return angular.isDefined(L.heatLayer)}},WebGLHeatMapLayerPlugin:{isLoaded:function(){return angular.isDefined(L.TileLayer.WebGLHeatMap)}},BingLayerPlugin:{isLoaded:function(){return angular.isDefined(L.BingLayer)},is:function(e){return!!this.isLoaded()&&e instanceof L.BingLayer}},WFSLayerPlugin:{isLoaded:function(){return void 0!==L.GeoJSON.WFS},is:function(e){return!!this.isLoaded()&&e instanceof L.GeoJSON.WFS}},AGSBaseLayerPlugin:{isLoaded:function(){return void 0!==L.esri&&void 0!==L.esri.basemapLayer},is:function(e){return!!this.isLoaded()&&e instanceof L.esri.basemapLayer}},AGSLayerPlugin:{isLoaded:function(){return void 0!==lvector&&void 0!==lvector.AGS},is:function(e){return!!this.isLoaded()&&e instanceof lvector.AGS}},AGSFeatureLayerPlugin:{isLoaded:function(){return void 0!==L.esri&&void 0!==L.esri.featureLayer},is:function(e){return!!this.isLoaded()&&e instanceof L.esri.featureLayer}},AGSTiledMapLayerPlugin:{isLoaded:function(){return void 0!==L.esri&&void 0!==L.esri.tiledMapLayer},is:function(e){return!!this.isLoaded()&&e instanceof L.esri.tiledMapLayer}},AGSDynamicMapLayerPlugin:{isLoaded:function(){return void 0!==L.esri&&void 0!==L.esri.dynamicMapLayer},is:function(e){return!!this.isLoaded()&&e instanceof L.esri.dynamicMapLayer}},AGSImageMapLayerPlugin:{isLoaded:function(){return void 0!==L.esri&&void 0!==L.esri.imageMapLayer},is:function(e){return!!this.isLoaded()&&e instanceof L.esri.imageMapLayer}},AGSClusteredLayerPlugin:{isLoaded:function(){return void 0!==L.esri&&void 0!==L.esri.clusteredFeatureLayer},is:function(e){return!!this.isLoaded()&&e instanceof L.esri.clusteredFeatureLayer}},AGSHeatmapLayerPlugin:{isLoaded:function(){return void 0!==L.esri&&void 0!==L.esri.heatmapFeatureLayer},is:function(e){return!!this.isLoaded()&&e instanceof L.esri.heatmapFeatureLayer}},YandexLayerPlugin:{isLoaded:function(){return angular.isDefined(L.Yandex)},is:function(e){return!!this.isLoaded()&&e instanceof L.Yandex}},GeoJSONPlugin:{isLoaded:function(){return angular.isDefined(L.TileLayer.GeoJSON)},is:function(e){return!!this.isLoaded()&&e instanceof L.TileLayer.GeoJSON}},UTFGridPlugin:{isLoaded:function(){return angular.isDefined(L.UtfGrid)},is:function(e){return this.isLoaded()?e instanceof L.UtfGrid:(r.error("[AngularJS - Leaflet] No UtfGrid plugin found."),!1)}},CartoDB:{isLoaded:function(){return cartodb},is:function(){return!0}},Leaflet:{DivIcon:{is:function(e){return e instanceof L.DivIcon},equal:function(e,r){return!!this.is(e)&&angular.equals(e,r)}},Icon:{is:function(e){return e instanceof L.Icon},equal:function(e,r){return!!this.is(e)&&angular.equals(e,r)}}},watchOptions:{doWatch:!0,isDeep:!0,individual:{doWatch:!0,isDeep:!0}}}}]),angular.module("leaflet-directive").service("leafletIterators",["leafletLogger","leafletHelpers",function(e,r){var a,t=r,n=r.errorHeader+"leafletIterators: ",o=Object.keys,i=t.isFunction,l=t.isObject,s=e,u=Math.pow(2,53)-1,c=function(e){var r=null!==e&&e.length;return t.isNumber(r)&&r>=0&&u>=r},d=function(e){return e};a=function(e,r){return function(a){var t=arguments.length;if(2>t||null===a)return a;for(var n=1;t>n;n++)for(var o=arguments[n],i=e(o),l=i.length,s=0;l>s;s++){var u=i[s];r&&void 0!==a[u]||(a[u]=o[u])}return a}}(o);var f;f=function(e){return e=a({},e),function(r){return function(e,r){var a=o(r),t=a.length;if(null===e)return!t;for(var n=Object(e),i=0;t>i;i++){var l=a[i];if(r[l]!==n[l]||!(l in n))return!1}return!0}(r,e)}};var p,g=function(e,r,a){return null===e?d:i(e)?function(e,r,a){if(void 0===r)return e;switch(null===a?3:a){case 1:return function(a){return e.call(r,a)};case 2:return function(a,t){return e.call(r,a,t)};case 3:return function(a,t,n){return e.call(r,a,t,n)};case 4:return function(a,t,n,o){return e.call(r,a,t,n,o)}}return function(){return e.apply(r,arguments)}}(e,r,a):l(e)?f(e):function(e){return function(r){return null===r?void 0:r[e]}}(e)},y=function(e,r,a,o){return!(a||t.isDefined(e)&&t.isDefined(r))||!t.isFunction(r)&&(o=t.defaultTo(r,"cb"),s.error(n+o+" is not a function"),!0)},v=function(e,r){!function(e,r,a){if(!y(void 0,a,!0,"internalCb")&&!y(e,r))for(var t in e)e.hasOwnProperty(t)&&a(e[t],t)}(e,r,function(e,a){r(e,a)})};return{each:v,forEach:v,every:p=function(e,r,a){r=g(r,a);for(var t=!c(e)&&o(e),n=(t||e).length,i=0;n>i;i++){var l=t?t[i]:i;if(!r(e[l],l,e))return!1}return!0},all:p}}]),angular.module("leaflet-directive").factory("leafletLayerHelpers",["$rootScope","$q","leafletLogger","leafletHelpers","leafletIterators",function($rootScope,$q,leafletLogger,leafletHelpers,leafletIterators){function isValidLayerType(e){return isString(e.type)?-1===Object.keys(layerTypes).indexOf(e.type)?($log.error("[AngularJS - Leaflet] A layer must have a valid type: "+Object.keys(layerTypes)),!1):layerTypes[e.type].mustHaveUrl&&!isString(e.url)?($log.error("[AngularJS - Leaflet] A base layer must have an url"),!1):layerTypes[e.type].mustHaveData&&!isDefined(e.data)?($log.error('[AngularJS - Leaflet] The base layer must have a "data" array attribute'),!1):layerTypes[e.type].mustHaveLayer&&!isDefined(e.layer)?($log.error("[AngularJS - Leaflet] The type of layer "+e.type+" must have an layer defined"),!1):layerTypes[e.type].mustHaveBounds&&!isDefined(e.bounds)?($log.error("[AngularJS - Leaflet] The type of layer "+e.type+" must have bounds defined"),!1):!(layerTypes[e.type].mustHaveKey&&!isDefined(e.key))||($log.error("[AngularJS - Leaflet] The type of layer "+e.type+" must have key defined"),!1):($log.error("[AngularJS - Leaflet] A layer must have a valid type defined."),!1)}function createLayer(e){if(isValidLayerType(e)){if(!isString(e.name))return void $log.error("[AngularJS - Leaflet] A base layer must have a name");for(var r in isObject(e.layerParams)||(e.layerParams={}),isObject(e.layerOptions)||(e.layerOptions={}),e.layerParams)e.layerOptions[r]=e.layerParams[r];var a={url:e.url,data:e.data,options:e.layerOptions,layer:e.layer,icon:e.icon,type:e.layerType,bounds:e.bounds,key:e.key,apiKey:e.apiKey,pluginOptions:e.pluginOptions,user:e.user};return layerTypes[e.type].createLayer(a)}}function safeAddLayer(e,r){r&&"function"==typeof r.addTo?r.addTo(e):e.addLayer(r)}function safeRemoveLayer(e,r,a){if(isDefined(a)&&isDefined(a.loadedDefer))if(angular.isFunction(a.loadedDefer)){var t=a.loadedDefer();$log.debug("Loaded Deferred",t);var n=t.length;if(n>0)for(var o=function(){0===--n&&e.removeLayer(r)},i=0;i<t.length;i++)t[i].promise.then(o);else e.removeLayer(r)}else a.loadedDefer.promise.then(function(){e.removeLayer(r)});else e.removeLayer(r)}var Helpers=leafletHelpers,isString=leafletHelpers.isString,isObject=leafletHelpers.isObject,isArray=leafletHelpers.isArray,isDefined=leafletHelpers.isDefined,errorHeader=leafletHelpers.errorHeader,$it=leafletIterators,$log=leafletLogger,utfGridCreateLayer=function(e){if(Helpers.UTFGridPlugin.isLoaded()){var r=new L.UtfGrid(e.url,e.pluginOptions);return r.on("mouseover",function(e){$rootScope.$broadcast("leafletDirectiveMap.utfgridMouseover",e)}),r.on("mouseout",function(e){$rootScope.$broadcast("leafletDirectiveMap.utfgridMouseout",e)}),r.on("click",function(e){$rootScope.$broadcast("leafletDirectiveMap.utfgridClick",e)}),r.on("mousemove",function(e){$rootScope.$broadcast("leafletDirectiveMap.utfgridMousemove",e)}),r}$log.error("[AngularJS - Leaflet] The UTFGrid plugin is not loaded.")},layerTypes={xyz:{mustHaveUrl:!0,createLayer:function(e){return L.tileLayer(e.url,e.options)}},mapbox:{mustHaveKey:!0,createLayer:function(e){var r=3;isDefined(e.options.version)&&4===e.options.version&&(r=e.options.version);var a=3===r?"//{s}.tiles.mapbox.com/v3/"+e.key+"/{z}/{x}/{y}.png":"//api.tiles.mapbox.com/v4/"+e.key+"/{z}/{x}/{y}.png?access_token="+e.apiKey;return L.tileLayer(a,e.options)}},geoJSON:{mustHaveUrl:!0,createLayer:function(e){return Helpers.GeoJSONPlugin.isLoaded()?new L.TileLayer.GeoJSON(e.url,e.pluginOptions,e.options):void 0}},geoJSONShape:{mustHaveUrl:!1,createLayer:function(e){return new L.GeoJSON(e.data,e.options)}},geoJSONAwesomeMarker:{mustHaveUrl:!1,createLayer:function(e){return new L.geoJson(e.data,{pointToLayer:function(r,a){return L.marker(a,{icon:L.AwesomeMarkers.icon(e.icon)})}})}},geoJSONVectorMarker:{mustHaveUrl:!1,createLayer:function(e){return new L.geoJson(e.data,{pointToLayer:function(r,a){return L.marker(a,{icon:L.VectorMarkers.icon(e.icon)})}})}},utfGrid:{mustHaveUrl:!0,createLayer:utfGridCreateLayer},cartodbTiles:{mustHaveKey:!0,createLayer:function(e){var r="//"+e.user+".cartodb.com/api/v1/map/"+e.key+"/{z}/{x}/{y}.png";return L.tileLayer(r,e.options)}},cartodbUTFGrid:{mustHaveKey:!0,mustHaveLayer:!0,createLayer:function(e){return e.url="//"+e.user+".cartodb.com/api/v1/map/"+e.key+"/"+e.layer+"/{z}/{x}/{y}.grid.json",utfGridCreateLayer(e)}},cartodbInteractive:{mustHaveKey:!0,mustHaveLayer:!0,createLayer:function(e){var r="//"+e.user+".cartodb.com/api/v1/map/"+e.key+"/{z}/{x}/{y}.png",a=L.tileLayer(r,e.options);e.url="//"+e.user+".cartodb.com/api/v1/map/"+e.key+"/"+e.layer+"/{z}/{x}/{y}.grid.json";var t=utfGridCreateLayer(e);return L.layerGroup([a,t])}},wms:{mustHaveUrl:!0,createLayer:function(e){return L.tileLayer.wms(e.url,e.options)}},wmts:{mustHaveUrl:!0,createLayer:function(e){return L.tileLayer.wmts(e.url,e.options)}},wfs:{mustHaveUrl:!0,mustHaveLayer:!0,createLayer:function(params){if(Helpers.WFSLayerPlugin.isLoaded()){var options=angular.copy(params.options);return options.crs&&"string"==typeof options.crs&&(options.crs=eval(options.crs)),new L.GeoJSON.WFS(params.url,params.layer,options)}}},group:{mustHaveUrl:!1,createLayer:function(e){var r=[];return $it.each(e.options.layers,function(e){r.push(createLayer(e))}),e.options.loadedDefer=function(){var r=[];if(isDefined(e.options.layers))for(var a=0;a<e.options.layers.length;a++){var t=e.options.layers[a].layerOptions.loadedDefer;isDefined(t)&&r.push(t)}return r},L.layerGroup(r)}},featureGroup:{mustHaveUrl:!1,createLayer:function(){return L.featureGroup()}},google:{mustHaveUrl:!1,createLayer:function(e){var r=e.type||"SATELLITE";if(Helpers.GoogleLayerPlugin.isLoaded())return new L.Google(r,e.options)}},china:{mustHaveUrl:!1,createLayer:function(e){var r=e.type||"";if(Helpers.ChinaLayerPlugin.isLoaded())return L.tileLayer.chinaProvider(r,e.options)}},agsBase:{mustHaveLayer:!0,createLayer:function(e){return Helpers.AGSBaseLayerPlugin.isLoaded()?L.esri.basemapLayer(e.layer,e.options):void 0}},ags:{mustHaveUrl:!0,createLayer:function(e){if(Helpers.AGSLayerPlugin.isLoaded()){var r=angular.copy(e.options);angular.extend(r,{url:e.url});var a=new lvector.AGS(r);return a.onAdd=function(e){this.setMap(e)},a.onRemove=function(){this.setMap(null)},a}}},agsFeature:{mustHaveUrl:!0,createLayer:function(e){if(Helpers.AGSFeatureLayerPlugin.isLoaded()){e.options.url=e.url;var r=L.esri.featureLayer(e.options),a=function(){isDefined(e.options.loadedDefer)&&e.options.loadedDefer.resolve()};return r.on("loading",function(){e.options.loadedDefer=$q.defer(),r.off("load",a),r.on("load",a)}),r}$log.warn(errorHeader+" The esri plugin is not loaded.")}},agsTiled:{mustHaveUrl:!0,createLayer:function(e){return Helpers.AGSTiledMapLayerPlugin.isLoaded()?(e.options.url=e.url,L.esri.tiledMapLayer(e.options)):void $log.warn(errorHeader+" The esri plugin is not loaded.")}},agsDynamic:{mustHaveUrl:!0,createLayer:function(e){return Helpers.AGSDynamicMapLayerPlugin.isLoaded()?(e.options.url=e.url,L.esri.dynamicMapLayer(e.options)):void $log.warn(errorHeader+" The esri plugin is not loaded.")}},agsImage:{mustHaveUrl:!0,createLayer:function(e){return Helpers.AGSImageMapLayerPlugin.isLoaded()?(e.options.url=e.url,L.esri.imageMapLayer(e.options)):void $log.warn(errorHeader+" The esri plugin is not loaded.")}},agsClustered:{mustHaveUrl:!0,createLayer:function(e){return Helpers.AGSClusteredLayerPlugin.isLoaded()?Helpers.MarkerClusterPlugin.isLoaded()?L.esri.clusteredFeatureLayer(e.url,e.options):void $log.warn(errorHeader+" The markercluster plugin is not loaded."):void $log.warn(errorHeader+" The esri clustered layer plugin is not loaded.")}},agsHeatmap:{mustHaveUrl:!0,createLayer:function(e){return Helpers.AGSHeatmapLayerPlugin.isLoaded()?Helpers.HeatLayerPlugin.isLoaded()?L.esri.heatmapFeatureLayer(e.url,e.options):void $log.warn(errorHeader+" The heatlayer plugin is not loaded."):void $log.warn(errorHeader+" The esri heatmap layer plugin is not loaded.")}},markercluster:{mustHaveUrl:!1,createLayer:function(e){return Helpers.MarkerClusterPlugin.isLoaded()?new L.MarkerClusterGroup(e.options):void $log.warn(errorHeader+" The markercluster plugin is not loaded.")}},bing:{mustHaveUrl:!1,createLayer:function(e){return Helpers.BingLayerPlugin.isLoaded()?new L.BingLayer(e.key,e.options):void 0}},webGLHeatmap:{mustHaveUrl:!1,mustHaveData:!0,createLayer:function(e){if(Helpers.WebGLHeatMapLayerPlugin.isLoaded()){var r=new L.TileLayer.WebGLHeatMap(e.options);return isDefined(e.data)&&r.setData(e.data),r}}},heat:{mustHaveUrl:!1,mustHaveData:!0,createLayer:function(e){if(Helpers.HeatLayerPlugin.isLoaded()){var r=new L.heatLayer;return isArray(e.data)&&r.setLatLngs(e.data),isObject(e.options)&&r.setOptions(e.options),r}}},yandex:{mustHaveUrl:!1,createLayer:function(e){var r=e.type||"map";if(Helpers.YandexLayerPlugin.isLoaded())return new L.Yandex(r,e.options)}},imageOverlay:{mustHaveUrl:!0,mustHaveBounds:!0,createLayer:function(e){return L.imageOverlay(e.url,e.bounds,e.options)}},iip:{mustHaveUrl:!0,createLayer:function(e){return L.tileLayer.iip(e.url,e.options)}},custom:{createLayer:function(e){return e.layer instanceof L.Class?angular.copy(e.layer):void $log.error("[AngularJS - Leaflet] A custom layer must be a leaflet Class")}},cartodb:{mustHaveUrl:!0,createLayer:function(e){return cartodb.createLayer(e.map,e.url)}}};return{createLayer:createLayer,safeAddLayer:safeAddLayer,safeRemoveLayer:safeRemoveLayer}}]),angular.module("leaflet-directive").factory("leafletLegendHelpers",function(){var e=function(e,r,a,t){if(e.innerHTML="",r.error)e.innerHTML+='<div class="info-title alert alert-danger">'+r.error.message+"</div>";else if("arcgis"===a)for(var n=0;n<r.layers.length;n++){var o=r.layers[n];e.innerHTML+='<div class="info-title" data-layerid="'+o.layerId+'">'+o.layerName+"</div>";for(var i=0;i<o.legend.length;i++){var l=o.legend[i];e.innerHTML+='<div class="inline" data-layerid="'+o.layerId+'"><img src="data:'+l.contentType+";base64,"+l.imageData+'" /></div><div class="info-label" data-layerid="'+o.layerId+'">'+l.label+"</div>"}}else"image"===a&&(e.innerHTML='<img src="'+t+'"/>')};return{getOnAddLegend:function(r,a,t,n){return function(){var o=L.DomUtil.create("div",a);return L.Browser.touch?L.DomEvent.on(o,"click",L.DomEvent.stopPropagation):(L.DomEvent.disableClickPropagation(o),L.DomEvent.on(o,"mousewheel",L.DomEvent.stopPropagation)),e(o,r,t,n),o}},getOnAddArrayLegend:function(e,r){return function(){for(var a=L.DomUtil.create("div",r),t=0;t<e.colors.length;t++)a.innerHTML+='<div class="outline"><i style="background:'+e.colors[t]+'"></i></div><div class="info-label">'+e.labels[t]+"</div>";return L.Browser.touch?L.DomEvent.on(a,"click",L.DomEvent.stopPropagation):(L.DomEvent.disableClickPropagation(a),L.DomEvent.on(a,"mousewheel",L.DomEvent.stopPropagation)),a}},updateLegend:e}}),angular.module("leaflet-directive").factory("leafletMapDefaults",["$q","leafletHelpers",function(e,r){var a=r.isDefined,t=r.isObject,n=r.obtainEffectiveMapId,o={};return{reset:function(){o={}},getDefaults:function(e){var r=n(o,e);return o[r]},getMapCreationDefaults:function(e){var r=n(o,e),t=o[r],i={maxZoom:t.maxZoom,keyboard:t.keyboard,dragging:t.dragging,zoomControl:t.zoomControl,doubleClickZoom:t.doubleClickZoom,scrollWheelZoom:t.scrollWheelZoom,tap:t.tap,touchZoom:t.touchZoom,attributionControl:t.attributionControl,worldCopyJump:t.worldCopyJump,crs:t.crs};if(a(t.minZoom)&&(i.minZoom=t.minZoom),a(t.zoomAnimation)&&(i.zoomAnimation=t.zoomAnimation),a(t.fadeAnimation)&&(i.fadeAnimation=t.fadeAnimation),a(t.markerZoomAnimation)&&(i.markerZoomAnimation=t.markerZoomAnimation),t.map)for(var l in t.map)i[l]=t.map[l];return i},setDefaults:function(e,r){var i={keyboard:!0,dragging:!0,worldCopyJump:!1,doubleClickZoom:!0,scrollWheelZoom:!0,tap:!0,touchZoom:!0,zoomControl:!0,zoomsliderControl:!1,zoomControlPosition:"topleft",attributionControl:!0,controls:{layers:{visible:!0,position:"topright",collapsed:!0}},nominatim:{server:" http://nominatim.openstreetmap.org/search"},crs:L.CRS.EPSG3857,tileLayer:"//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",tileLayerOptions:{attribution:'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'},path:{weight:10,opacity:1,color:"#0000ff"},center:{lat:0,lng:0,zoom:1}};a(e)&&(i.doubleClickZoom=a(e.doubleClickZoom)?e.doubleClickZoom:i.doubleClickZoom,i.scrollWheelZoom=a(e.scrollWheelZoom)?e.scrollWheelZoom:i.doubleClickZoom,i.tap=a(e.tap)?e.tap:i.tap,i.touchZoom=a(e.touchZoom)?e.touchZoom:i.doubleClickZoom,i.zoomControl=a(e.zoomControl)?e.zoomControl:i.zoomControl,i.zoomsliderControl=a(e.zoomsliderControl)?e.zoomsliderControl:i.zoomsliderControl,i.attributionControl=a(e.attributionControl)?e.attributionControl:i.attributionControl,i.tileLayer=a(e.tileLayer)?e.tileLayer:i.tileLayer,i.zoomControlPosition=a(e.zoomControlPosition)?e.zoomControlPosition:i.zoomControlPosition,i.keyboard=a(e.keyboard)?e.keyboard:i.keyboard,i.dragging=a(e.dragging)?e.dragging:i.dragging,a(e.controls)&&angular.extend(i.controls,e.controls),t(e.crs)?i.crs=e.crs:a(L.CRS[e.crs])&&(i.crs=L.CRS[e.crs]),a(e.center)&&angular.copy(e.center,i.center),a(e.tileLayerOptions)&&angular.copy(e.tileLayerOptions,i.tileLayerOptions),a(e.maxZoom)&&(i.maxZoom=e.maxZoom),a(e.minZoom)&&(i.minZoom=e.minZoom),a(e.zoomAnimation)&&(i.zoomAnimation=e.zoomAnimation),a(e.fadeAnimation)&&(i.fadeAnimation=e.fadeAnimation),a(e.markerZoomAnimation)&&(i.markerZoomAnimation=e.markerZoomAnimation),a(e.worldCopyJump)&&(i.worldCopyJump=e.worldCopyJump),a(e.map)&&(i.map=e.map),a(e.path)&&(i.path=e.path));var l=n(o,r);return o[l]=i,i}}}]),angular.module("leaflet-directive").service("leafletMarkersHelpers",["$rootScope","$timeout","leafletHelpers","leafletLogger","$compile","leafletGeoJsonHelpers",function(e,r,a,t,n,o){var i=a.isDefined,l=a.defaultTo,s=a.MarkerClusterPlugin,u=a.AwesomeMarkersPlugin,c=a.VectorMarkersPlugin,d=a.MakiMarkersPlugin,f=a.ExtraMarkersPlugin,p=a.DomMarkersPlugin,g=a.safeApply,y=a,v=a.isString,m=a.isNumber,h=a.isObject,b={},k=o,A=a.errorHeader,D=t,w=function(e){var r="";return["_icon","_latlng","_leaflet_id","_map","_shadow"].forEach(function(a){r+=a+": "+l(e[a],"undefined")+" \n"}),"[leafletMarker] : \n"+r},P=function(r){if(i(r)&&i(r.type)&&"awesomeMarker"===r.type)return u.isLoaded()||D.error(A+" The AwesomeMarkers Plugin is not loaded."),new L.AwesomeMarkers.icon(r);if(i(r)&&i(r.type)&&"vectorMarker"===r.type)return c.isLoaded()||D.error(A+" The VectorMarkers Plugin is not loaded."),new L.VectorMarkers.icon(r);if(i(r)&&i(r.type)&&"makiMarker"===r.type)return d.isLoaded()||D.error(A+"The MakiMarkers Plugin is not loaded."),new L.MakiMarkers.icon(r);if(i(r)&&i(r.type)&&"extraMarker"===r.type)return f.isLoaded()||D.error(A+"The ExtraMarkers Plugin is not loaded."),new L.ExtraMarkers.icon(r);if(i(r)&&i(r.type)&&"div"===r.type)return new L.divIcon(r);if(i(r)&&i(r.type)&&"dom"===r.type){p.isLoaded()||D.error(A+"The DomMarkers Plugin is not loaded.");var a=angular.isFunction(r.getMarkerScope)?r.getMarkerScope():e,t=n(r.template)(a),o=angular.copy(r);return o.element=t[0],new L.DomMarkers.icon(o)}if(i(r)&&i(r.type)&&"icon"===r.type)return r.icon;return i(r)&&i(r.iconUrl)?new L.Icon(r):new L.Icon.Default({iconUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAGmklEQVRYw7VXeUyTZxjvNnfELFuyIzOabermMZEeQC/OclkO49CpOHXOLJl/CAURuYbQi3KLgEhbrhZ1aDwmaoGqKII6odATmH/scDFbdC7LvFqOCc+e95s2VG50X/LLm/f4/Z7neY/ne18aANCmAr5E/xZf1uDOkTcGcWR6hl9247tT5U7Y6SNvWsKT63P58qbfeLJG8M5qcgTknrvvrdDbsT7Ml+tv82X6vVxJE33aRmgSyYtcWVMqX97Yv2JvW39UhRE2HuyBL+t+gK1116ly06EeWFNlAmHxlQE0OMiV6mQCScusKRlhS3QLeVJdl1+23h5dY4FNB3thrbYboqptEFlphTC1hSpJnbRvxP4NWgsE5Jyz86QNNi/5qSUTGuFk1gu54tN9wuK2wc3o+Wc13RCmsoBwEqzGcZsxsvCSy/9wJKf7UWf1mEY8JWfewc67UUoDbDjQC+FqK4QqLVMGGR9d2wurKzqBk3nqIT/9zLxRRjgZ9bqQgub+DdoeCC03Q8j+0QhFhBHR/eP3U/zCln7Uu+hihJ1+bBNffLIvmkyP0gpBZWYXhKussK6mBz5HT6M1Nqpcp+mBCPXosYQfrekGvrjewd59/GvKCE7TbK/04/ZV5QZYVWmDwH1mF3xa2Q3ra3DBC5vBT1oP7PTj4C0+CcL8c7C2CtejqhuCnuIQHaKHzvcRfZpnylFfXsYJx3pNLwhKzRAwAhEqG0SpusBHfAKkxw3w4627MPhoCH798z7s0ZnBJ/MEJbZSbXPhER2ih7p2ok/zSj2cEJDd4CAe+5WYnBCgR2uruyEw6zRoW6/DWJ/OeAP8pd/BGtzOZKpG8oke0SX6GMmRk6GFlyAc59K32OTEinILRJRchah8HQwND8N435Z9Z0FY1EqtxUg+0SO6RJ/mmXz4VuS+DpxXC3gXmZwIL7dBSH4zKE50wESf8qwVgrP1EIlTO5JP9Igu0aexdh28F1lmAEGJGfh7jE6ElyM5Rw/FDcYJjWhbeiBYoYNIpc2FT/SILivp0F1ipDWk4BIEo2VuodEJUifhbiltnNBIXPUFCMpthtAyqws/BPlEF/VbaIxErdxPphsU7rcCp8DohC+GvBIPJS/tW2jtvTmmAeuNO8BNOYQeG8G/2OzCJ3q+soYB5i6NhMaKr17FSal7GIHheuV3uSCY8qYVuEm1cOzqdWr7ku/R0BDoTT+DT+ohCM6/CCvKLKO4RI+dXPeAuaMqksaKrZ7L3FE5FIFbkIceeOZ2OcHO6wIhTkNo0ffgjRGxEqogXHYUPHfWAC/lADpwGcLRY3aeK4/oRGCKYcZXPVoeX/kelVYY8dUGf8V5EBRbgJXT5QIPhP9ePJi428JKOiEYhYXFBqou2Guh+p/mEB1/RfMw6rY7cxcjTrneI1FrDyuzUSRm9miwEJx8E/gUmqlyvHGkneiwErR21F3tNOK5Tf0yXaT+O7DgCvALTUBXdM4YhC/IawPU+2PduqMvuaR6eoxSwUk75ggqsYJ7VicsnwGIkZBSXKOUww73WGXyqP+J2/b9c+gi1YAg/xpwck3gJuucNrh5JvDPvQr0WFXf0piyt8f8/WI0hV4pRxxkQZdJDfDJNOAmM0Ag8jyT6hz0WGXWuP94Yh2jcfjmXAGvHCMslRimDHYuHuDsy2QtHuIavznhbYURq5R57KpzBBRZKPJi8eQg48h4j8SDdowifdIrEVdU+gbO6QNvRRt4ZBthUaZhUnjlYObNagV3keoeru3rU7rcuceqU1mJBxy+BWZYlNEBH+0eH4vRiB+OYybU2hnblYlTvkHinM4m54YnxSyaZYSF6R3jwgP7udKLGIX6r/lbNa9N6y5MFynjWDtrHd75ZvTYAPO/6RgF0k76mQla3FGq7dO+cH8sKn0Vo7nDllwAhqwLPkxrHwWmHJOo+AKJ4rab5OgrM7rVu8eWb2Pu0Dh4eDgXoOfvp7Y7QeqknRmvcTBEyq9m/HQQSCSz6LHq3z0yzsNySRfMS253wl2KyRDbcZPcfJKjZmSEOjcxyi+Y8dUOtsIEH6R2wNykdqrkYJ0RV92H0W58pkfQk7cKevsLK10Py8SdMGfXNXATY+pPbyJR/ET6n9nIfztNtZYRV9XniQu9IA2vOVgy4ir7GCLVmmd+zjkH0eAF9Po6K61pmCXHxU5rHMYd1ftc3owjwRSVRzLjKvqZEty6cRUD7jGqiOdu5HG6MdHjNcNYGqfDm5YRzLBBCCDl/2bk8a8gdbqcfwECu62Fg/HrggAAAABJRU5ErkJggg==",shadowUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAYAAACoYAD2AAAC5ElEQVRYw+2YW4/TMBCF45S0S1luXZCABy5CgLQgwf//S4BYBLTdJLax0fFqmB07nnQfEGqkIydpVH85M+NLjPe++dcPc4Q8Qh4hj5D/AaQJx6H/4TMwB0PeBNwU7EGQAmAtsNfAzoZkgIa0ZgLMa4Aj6CxIAsjhjOCoL5z7Glg1JAOkaicgvQBXuncwJAWjksLtBTWZe04CnYRktUGdilALppZBOgHGZcBzL6OClABvMSVIzyBjazOgrvACf1ydC5mguqAVg6RhdkSWQFj2uxfaq/BrIZOLEWgZdALIDvcMcZLD8ZbLC9de4yR1sYMi4G20S4Q/PWeJYxTOZn5zJXANZHIxAd4JWhPIloTJZhzMQduM89WQ3MUVAE/RnhAXpTycqys3NZALOBbB7kFrgLesQl2h45Fcj8L1tTSohUwuxhy8H/Qg6K7gIs+3kkaigQCOcyEXCHN07wyQazhrmIulvKMQAwMcmLNqyCVyMAI+BuxSMeTk3OPikLY2J1uE+VHQk6ANrhds+tNARqBeaGc72cK550FP4WhXmFmcMGhTwAR1ifOe3EvPqIegFmF+C8gVy0OfAaWQPMR7gF1OQKqGoBjq90HPMP01BUjPOqGFksC4emE48tWQAH0YmvOgF3DST6xieJgHAWxPAHMuNhrImIdvoNOKNWIOcE+UXE0pYAnkX6uhWsgVXDxHdTfCmrEEmMB2zMFimLVOtiiajxiGWrbU52EeCdyOwPEQD8LqyPH9Ti2kgYMf4OhSKB7qYILbBv3CuVTJ11Y80oaseiMWOONc/Y7kJYe0xL2f0BaiFTxknHO5HaMGMublKwxFGzYdWsBF174H/QDknhTHmHHN39iWFnkZx8lPyM8WHfYELmlLKtgWNmFNzQcC1b47gJ4hL19i7o65dhH0Negbca8vONZoP7doIeOC9zXm8RjuL0Gf4d4OYaU5ljo3GYiqzrWQHfJxA6ALhDpVKv9qYeZA8eM3EhfPSCmpuD0AAAAASUVORK5CYII=",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]})},C=function(e,r,a){if(e.closePopup(),i(a)&&i(a.overlays))for(var t in a.overlays)if((a.overlays[t]instanceof L.LayerGroup||a.overlays[t]instanceof L.FeatureGroup)&&a.overlays[t].hasLayer(e))return void a.overlays[t].removeLayer(e);if(i(b))for(var n in b)b[n].hasLayer(e)&&b[n].removeLayer(e);r.hasLayer(e)&&r.removeLayer(e)},M=function(e,r){n(e._popup._contentNode)(r)},H=function(e,a,t){(e._popup._contentNode.innerText||e._popup._contentNode.textContent).length<1&&r(function(){H(e,a,t)});var n=e._popup._contentNode.offsetWidth;return e._popup._updateLayout(),e._popup._updatePosition(),e._popup.options.autoPan&&function(e,r){var a=e._popup._container.offsetHeight,t=new L.Point(e._popup._containerLeft,-a-e._popup._containerBottom);null!==r.layerPointToContainerPoint(t)&&e._popup._adjustPan()}(e,t),n},O=function(r,a,t){var n=angular.isFunction(a.getMessageScope)?a.getMessageScope():e;if(!i(a.compileMessage)||a.compileMessage){if(!i(r._popup)||!i(r._popup._contentNode))return D.error(A+"Popup is invalid or does not have any content."),!1;M(r,n),H(r,a,t)}},S=function(r,a){var t=angular.isFunction(a.getMessageScope)?a.getMessageScope():e,o=angular.isFunction(a.getLabelScope)?a.getLabelScope():t,l=!i(a.compileMessage)||a.compileMessage;y.LabelPlugin.isLoaded()&&i(a.label)&&(i(a.label.options)&&!0===a.label.options.noHide&&r.showLabel(),l&&i(r.label)&&n(r.label._container)(o))},E=function(e,r,a,t,n,o,l){if(i(r)){if(!k.validateCoords(e))return D.warn("There are problems with lat-lng data, please verify your marker model"),void C(a,l,o);var s=e===r;if(i(e.iconAngle)&&r.iconAngle!==e.iconAngle&&a.setIconAngle(e.iconAngle),v(e.layer)||v(r.layer)&&(i(o.overlays[r.layer])&&o.overlays[r.layer].hasLayer(a)&&(o.overlays[r.layer].removeLayer(a),a.closePopup()),l.hasLayer(a)||l.addLayer(a)),(m(e.opacity)||m(parseFloat(e.opacity)))&&e.opacity!==r.opacity&&a.setOpacity(e.opacity),v(e.layer)&&r.layer!==e.layer){if(v(r.layer)&&i(o.overlays[r.layer])&&o.overlays[r.layer].hasLayer(a)&&o.overlays[r.layer].removeLayer(a),a.closePopup(),l.hasLayer(a)&&l.removeLayer(a),!i(o.overlays[e.layer]))return void D.error(A+"You must use a name of an existing layer");var u=o.overlays[e.layer];if(!(u instanceof L.LayerGroup||u instanceof L.FeatureGroup))return void D.error(A+'A marker can only be added to a layer of type "group" or "featureGroup"');u.addLayer(a),l.hasLayer(a)&&!0===e.focus&&a.openPopup()}if(!0!==e.draggable&&!0===r.draggable&&i(a.dragging)&&a.dragging.disable(),!0===e.draggable&&!0!==r.draggable&&(a.dragging?a.dragging.enable():L.Handler.MarkerDrag&&(a.dragging=new L.Handler.MarkerDrag(a),a.options.draggable=!0,a.dragging.enable())),h(e.icon)||h(r.icon)&&(a.setIcon(P()),a.closePopup(),a.unbindPopup(),v(e.message)&&a.bindPopup(e.message,e.popupOptions)),h(e.icon)&&h(r.icon)&&!angular.equals(e.icon,r.icon)){var c=!1;a.dragging&&(c=a.dragging.enabled()),a.setIcon(P(e.icon)),c&&a.dragging.enable(),a.closePopup(),a.unbindPopup(),v(e.message)&&a.bindPopup(e.message,e.popupOptions)}!v(e.message)&&v(r.message)&&(a.closePopup(),a.unbindPopup()),y.LabelPlugin.isLoaded()&&(i(e.label)&&i(e.label.message)?"label"in r&&"message"in r.label&&!angular.equals(e.label.message,r.label.message)?a.updateLabelContent(e.label.message):!angular.isFunction(a.getLabel)||angular.isFunction(a.getLabel)&&!i(a.getLabel())?(a.bindLabel(e.label.message,e.label.options),S(a,e)):S(a,e):(!("label"in e)||"message"in e.label)&&angular.isFunction(a.unbindLabel)&&a.unbindLabel()),v(e.message)&&!v(r.message)&&a.bindPopup(e.message,e.popupOptions),v(e.message)&&v(r.message)&&e.message!==r.message&&a.setPopupContent(e.message);var d=!1;!0!==e.focus&&!0===r.focus&&(a.closePopup(),d=!0),(!0===e.focus&&(!i(r.focus)||!1===r.focus)||s&&!0===e.focus)&&(a.openPopup(),d=!0),r.zIndexOffset!==e.zIndexOffset&&a.setZIndexOffset(e.zIndexOffset);var f=a.getLatLng();v(e.layer)&&y.MarkerClusterPlugin.is(o.overlays[e.layer])?d?(e.lat!==r.lat||e.lng!==r.lng)&&(o.overlays[e.layer].removeLayer(a),a.setLatLng([e.lat,e.lng]),o.overlays[e.layer].addLayer(a)):f.lat!==e.lat||f.lng!==e.lng?(o.overlays[e.layer].removeLayer(a),a.setLatLng([e.lat,e.lng]),o.overlays[e.layer].addLayer(a)):e.lat!==r.lat||e.lng!==r.lng?(o.overlays[e.layer].removeLayer(a),a.setLatLng([e.lat,e.lng]),o.overlays[e.layer].addLayer(a)):h(e.icon)&&h(r.icon)&&!angular.equals(e.icon,r.icon)&&(o.overlays[e.layer].removeLayer(a),o.overlays[e.layer].addLayer(a)):(f.lat!==e.lat||f.lng!==e.lng)&&a.setLatLng([e.lat,e.lng])}};return{resetMarkerGroup:function(e){i(b[e])&&b.splice(e,1)},resetMarkerGroups:function(){b={}},deleteMarker:C,manageOpenPopup:O,manageOpenLabel:S,createMarker:function(e){if(i(e)&&k.validateCoords(e)){var r=k.getCoords(e);if(i(r)){var a={icon:P(e.icon),title:i(e.title)?e.title:"",draggable:!!i(e.draggable)&&e.draggable,clickable:!i(e.clickable)||e.clickable,riseOnHover:!!i(e.riseOnHover)&&e.riseOnHover,zIndexOffset:i(e.zIndexOffset)?e.zIndexOffset:0,iconAngle:i(e.iconAngle)?e.iconAngle:0};for(var t in e)e.hasOwnProperty(t)&&!a.hasOwnProperty(t)&&(a[t]=e[t]);var n=new L.marker(r,a);return v(e.message)||n.unbindPopup(),n}D.error(A+"Unable to get coordinates from markerData.")}else D.error(A+"The marker definition is not valid.")},addMarkerToGroup:function(e,r,a,t){return v(r)?s.isLoaded()?(i(b[r])||(b[r]=new L.MarkerClusterGroup(a),t.addLayer(b[r])),void b[r].addLayer(e)):void D.error(A+"The MarkerCluster plugin is not loaded."):void D.error(A+"The marker group you have specified is invalid.")},listenMarkerEvents:function(e,r,a,t,n){e.on("popupopen",function(){g(a,function(){(i(e._popup)||i(e._popup._contentNode))&&(r.focus=!0,O(e,r,n))})}),e.on("popupclose",function(){g(a,function(){r.focus=!1})}),e.on("add",function(){g(a,function(){"label"in r&&S(e,r)})})},updateMarker:E,addMarkerWatcher:function(e,r,a,t,n,o){var s=y.getObjectArrayPath("markers."+r);o=l(o,!0);var u=a.$watch(s,function(r,a){return i(r)?void E(r,a,e,0,0,t,n):(C(e,n,t),void u())},o)},string:w,log:function(e,r){(r?console:D).debug(w(e))}}}]),angular.module("leaflet-directive").factory("leafletPathsHelpers",["$rootScope","leafletLogger","leafletHelpers",function(e,r,a){function t(e){return e.filter(function(e){return u(e)}).map(function(e){return n(e)})}function n(e){return l(e)?new L.LatLng(e[0],e[1]):new L.LatLng(e.lat,e.lng)}function o(e){return e.map(function(e){return t(e)})}var i=a.isDefined,l=a.isArray,s=a.isNumber,u=a.isValidPoint,c=r,d=["stroke","weight","color","opacity","fill","fillColor","fillOpacity","dashArray","lineCap","lineJoin","clickable","pointerEvents","className","smoothFactor","noClip"],f=function(e,r){for(var a={},t=0;t<d.length;t++){var n=d[t];i(r[n])&&(a[n]=r[n])}e.setStyle(r)},p=function(e){if(!l(e))return!1;for(var r=0;r<e.length;r++){var a=e[r];if(!u(a))return!1}return!0},g={polyline:{isValid:function(e){var r=e.latlngs;return p(r)},createPath:function(e){return new L.Polyline([],e)},setPath:function(e,r){e.setLatLngs(t(r.latlngs)),f(e,r)}},multiPolyline:{isValid:function(e){var r=e.latlngs;if(!l(r))return!1;for(var a in r){var t=r[a];if(!p(t))return!1}return!0},createPath:function(e){return new L.multiPolyline([[[0,0],[1,1]]],e)},setPath:function(e,r){e.setLatLngs(o(r.latlngs)),f(e,r)}},polygon:{isValid:function(e){var r=e.latlngs;return p(r)},createPath:function(e){return new L.Polygon([],e)},setPath:function(e,r){e.setLatLngs(t(r.latlngs)),f(e,r)}},multiPolygon:{isValid:function(e){var r=e.latlngs;if(!l(r))return!1;for(var a in r){var t=r[a];if(!p(t))return!1}return!0},createPath:function(e){return new L.MultiPolygon([[[0,0],[1,1],[0,1]]],e)},setPath:function(e,r){e.setLatLngs(o(r.latlngs)),f(e,r)}},rectangle:{isValid:function(e){var r=e.latlngs;if(!l(r)||2!==r.length)return!1;for(var a in r){var t=r[a];if(!u(t))return!1}return!0},createPath:function(e){return new L.Rectangle([[0,0],[1,1]],e)},setPath:function(e,r){e.setBounds(new L.LatLngBounds(t(r.latlngs))),f(e,r)}},circle:{isValid:function(e){var r=e.latlngs;return u(r)&&s(e.radius)},createPath:function(e){return new L.Circle([0,0],1,e)},setPath:function(e,r){e.setLatLng(n(r.latlngs)),i(r.radius)&&e.setRadius(r.radius),f(e,r)}},circleMarker:{isValid:function(e){var r=e.latlngs;return u(r)&&s(e.radius)},createPath:function(e){return new L.CircleMarker([0,0],e)},setPath:function(e,r){e.setLatLng(n(r.latlngs)),i(r.radius)&&e.setRadius(r.radius),f(e,r)}}};return{setPathOptions:function(e,r,a){i(r)||(r="polyline"),g[r].setPath(e,a)},createPath:function(e,r,a){i(r.type)||(r.type="polyline");var t=function(e,r){for(var a={},t=0;t<d.length;t++){var n=d[t];i(e[n])?a[n]=e[n]:i(r.path[n])&&(a[n]=r.path[n])}return a}(r,a),n=function(e){var r={};return e.latlngs&&(r.latlngs=e.latlngs),e.radius&&(r.radius=e.radius),r}(r);return g[r.type].isValid(n)?g[r.type].createPath(t):void c.error("[AngularJS - Leaflet] Invalid data passed to the "+r.type+" path")}}}]),angular.module("leaflet-directive").service("leafletWatchHelpers",function(){var e=function(e,r,a,t,n){var o=e[r](a,function(e,r){n(e,r),t.doWatch||o()},t.isDeep);return o};return{maybeWatch:function(r,a,t,n){return e(r,"$watch",a,t,n)},maybeWatchCollection:function(r,a,t,n){return e(r,"$watchCollection",a,t,n)}}}),angular.module("leaflet-directive").service("leafletLogger",["nemSimpleLogger",function(e){return e.spawn()}]),angular.module("leaflet-directive").factory("nominatimService",["$q","$http","leafletHelpers","leafletMapDefaults",function(e,r,a,t){var n=a.isDefined;return{query:function(a,o){var i=t.getDefaults(o).nominatim.server,l=e.defer();return r.get(i,{params:{format:"json",limit:1,q:a}}).success(function(e){e.length>0&&n(e[0].boundingbox)?l.resolve(e[0]):l.reject("[Nominatim] Invalid address")}),l.promise}}}]),angular.module("leaflet-directive").directive("bounds",["leafletLogger","$timeout","$http","leafletHelpers","nominatimService","leafletBoundsHelpers",function(e,r,a,t,n,o){var i=e;return{restrict:"A",scope:!1,replace:!1,require:["leaflet"],link:function(e,a,l,s){var u=t.isDefined,c=o.createLeafletBounds,d=s[0].getLeafletScope(),f=s[0],p=t.errorHeader+" [Bounds] ";f.getMap().then(function(a){var t;d.$on("boundsChanged",function(e){var t=e.currentScope,n=a.getBounds();if(!function(e){return 0===e._southWest.lat&&0===e._southWest.lng&&0===e._northEast.lat&&0===e._northEast.lng}(n)&&!t.settingBoundsFromScope){t.settingBoundsFromLeaflet=!0;var o={northEast:{lat:n._northEast.lat,lng:n._northEast.lng},southWest:{lat:n._southWest.lat,lng:n._southWest.lng},options:n.options};angular.equals(t.bounds,o)||(t.bounds=o),r(function(){t.settingBoundsFromLeaflet=!1})}}),d.$watch("bounds",function(o){if(!e.settingBoundsFromLeaflet){if(u(o.address)&&o.address!==t)return e.settingBoundsFromScope=!0,n.query(o.address,l.id).then(function(e){var r=e.boundingbox,t=[[r[0],r[2]],[r[1],r[3]]];a.fitBounds(t)},function(e){i.error(p+" "+e+".")}),t=o.address,void r(function(){e.settingBoundsFromScope=!1});var s=c(o);s&&!a.getBounds().equals(s)&&(e.settingBoundsFromScope=!0,a.fitBounds(s,o.options),r(function(){e.settingBoundsFromScope=!1}))}},!0)})}}}]);var centerDirectiveTypes=["center","lfCenter"],centerDirectives={};centerDirectiveTypes.forEach(function(e){centerDirectives[e]=["leafletLogger","$q","$location","$timeout","leafletMapDefaults","leafletHelpers","leafletBoundsHelpers","leafletEvents",function(r,a,t,n,o,i,l,s){var u,c=i.isDefined,d=i.isNumber,f=i.isSameCenterOnMap,p=i.safeApply,g=i.isValidCenter,y=l.isValidBounds,v=i.isUndefinedOrEmpty,m=i.errorHeader,L=r,h=function(e,r){return c(e)&&y(e)&&v(r)};return{restrict:"A",scope:!1,replace:!1,require:"leaflet",controller:function(){u=a.defer(),this.getCenter=function(){return u.promise}},link:function(r,a,i,y){var v=y.getLeafletScope(),b=v[e];y.getMap().then(function(r){var a,y,k=o.getDefaults(i.id);if(-1!==i[e].search("-"))return L.error(m+' The "center" variable can\'t use a "-" on its key name: "'+i[e]+'".'),void r.setView([k.center.lat,k.center.lng],k.center.zoom);if(h(v.bounds,b))r.fitBounds(l.createLeafletBounds(v.bounds),v.bounds.options),b=r.getCenter(),p(v,function(a){angular.extend(a[e],{lat:r.getCenter().lat,lng:r.getCenter().lng,zoom:r.getZoom(),autoDiscover:!1})}),p(v,function(e){var a=r.getBounds();e.bounds={northEast:{lat:a._northEast.lat,lng:a._northEast.lng},southWest:{lat:a._southWest.lat,lng:a._southWest.lng}}});else{if(!c(b))return L.error(m+' The "center" property is not defined in the main scope'),void r.setView([k.center.lat,k.center.lng],k.center.zoom);c(b.lat)&&c(b.lng)||c(b.autoDiscover)||angular.copy(k.center,b)}if("yes"===i.urlHashCenter){var A=function(){var e,r=t.search();if(c(r.c)){var a=r.c.split(":");3===a.length&&(e={lat:parseFloat(a[0]),lng:parseFloat(a[1]),zoom:parseInt(a[2],10)})}return e};a=A(),v.$on("$locationChangeSuccess",function(a){var t=a.currentScope,n=A();c(n)&&!f(n,r)&&angular.extend(t[e],{lat:n.lat,lng:n.lng,zoom:n.zoom})})}v.$watch(e,function(e){return v.settingCenterFromLeaflet?void 0:(c(a)&&(angular.copy(a,e),a=void 0),g(e)||!0===e.autoDiscover?!0===e.autoDiscover?(d(e.zoom)||r.setView([k.center.lat,k.center.lng],k.center.zoom),void(d(e.zoom)&&e.zoom>k.center.zoom?r.locate({setView:!0,maxZoom:e.zoom}):c(k.maxZoom)?r.locate({setView:!0,maxZoom:k.maxZoom}):r.locate({setView:!0}))):void(y&&f(e,r)||(v.settingCenterFromScope=!0,r.setView([e.lat,e.lng],e.zoom),s.notifyCenterChangedToBounds(v,r),n(function(){v.settingCenterFromScope=!1}))):void L.warn(m+" invalid 'center'"))},!0),r.whenReady(function(){y=!0}),r.on("moveend",function(){u.resolve(),s.notifyCenterUrlHashChanged(v,r,i,t.search()),f(b,r)||v.settingCenterFromScope||(v.settingCenterFromLeaflet=!0,p(v,function(a){v.settingCenterFromScope||angular.extend(a[e],{lat:r.getCenter().lat,lng:r.getCenter().lng,zoom:r.getZoom(),autoDiscover:!1}),s.notifyCenterChangedToBounds(v,r),n(function(){v.settingCenterFromLeaflet=!1})}))}),!0===b.autoDiscover&&r.on("locationerror",function(){L.warn(m+" The Geolocation API is unauthorized on this page."),g(b)?(r.setView([b.lat,b.lng],b.zoom),s.notifyCenterChangedToBounds(v,r)):(r.setView([k.center.lat,k.center.lng],k.center.zoom),s.notifyCenterChangedToBounds(v,r))})})}}}]}),centerDirectiveTypes.forEach(function(e){angular.module("leaflet-directive").directive(e,centerDirectives[e])}),angular.module("leaflet-directive").directive("controls",["leafletLogger","leafletHelpers","leafletControlHelpers",function(e,r,a){var t=e;return{restrict:"A",scope:!1,replace:!1,require:"?^leaflet",link:function(e,n,o,i){if(i){var l=a.createControl,s=a.isValidControlType,u=i.getLeafletScope(),c=r.isDefined,d=r.isArray,f={},p=r.errorHeader+" [Controls] ";i.getMap().then(function(e){u.$watchCollection("controls",function(r){for(var a in f)c(r[a])||(e.hasControl(f[a])&&e.removeControl(f[a]),delete f[a]);for(var n in r){var o,i=c(r[n].type)?r[n].type:n;if(!s(i))return void t.error(p+" Invalid control type: "+i+".");if("custom"!==i)o=l(i,r[n]),e.addControl(o),f[n]=o;else{var u=r[n];if(d(u))for(var g in u){var y=u[g];e.addControl(y),f[n]=c(f[n])?f[n].concat([y]):[y]}else e.addControl(u),f[n]=u}}})})}}}}]),angular.module("leaflet-directive").directive("decorations",["leafletLogger","leafletHelpers",function(e,r){var a=e;return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(e,t,n,o){function i(e){return c(e)&&c(e.coordinates)&&(u.isLoaded()||a.error("[AngularJS - Leaflet] The PolylineDecorator Plugin is not loaded.")),L.polylineDecorator(e.coordinates)}function l(e,r){return c(e)&&c(r)&&c(r.coordinates)&&c(r.patterns)?(e.setPaths(r.coordinates),e.setPatterns(r.patterns),e):void 0}var s=o.getLeafletScope(),u=r.PolylineDecoratorPlugin,c=r.isDefined,d={};o.getMap().then(function(e){s.$watch("decorations",function(r){for(var a in d)c(r[a])&&angular.equals(r[a],d)||(e.removeLayer(d[a]),delete d[a]);for(var t in r){var n=r[t],o=i(n);c(o)&&(d[t]=o,e.addLayer(o),l(o,n))}},!0)})}}}]),angular.module("leaflet-directive").directive("eventBroadcast",["leafletLogger","$rootScope","leafletHelpers","leafletEvents","leafletIterators",function(e,r,a,t,n){var o=e;return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(e,r,i,l){var s=a.isObject,u=a.isDefined,c=l.getLeafletScope(),d=c.eventBroadcast,f=t.getAvailableMapEvents(),p=t.addEvents;l.getMap().then(function(e){var r=[],a="broadcast";u(d.map)?s(d.map)?("emit"!==d.map.logic&&"broadcast"!==d.map.logic?o.warn("[AngularJS - Leaflet] Available event propagation logic are: 'emit' or 'broadcast'."):a=d.map.logic,s(d.map.enable)&&d.map.enable.length>=0?n.each(d.map.enable,function(e){-1===r.indexOf(e)&&-1!==f.indexOf(e)&&r.push(e)}):o.warn("[AngularJS - Leaflet] event-broadcast.map.enable must be an object check your model.")):o.warn("[AngularJS - Leaflet] event-broadcast.map must be an object check your model."):r=f,p(e,r,"eventName",c,a)})}}}]),angular.module("leaflet-directive").directive("geojson",["leafletLogger","$rootScope","leafletData","leafletHelpers","leafletWatchHelpers","leafletDirectiveControlsHelpers","leafletIterators","leafletGeoJsonEvents",function(e,r,a,t,n,o,i,l){var s=n.maybeWatch,u=t.watchOptions,c=o.extend,d=t,f=i;return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(e,r,n,o){var i=t.isDefined,p=o.getLeafletScope(),g={},y=!1;o.getMap().then(function(e){var r=p.geojsonWatchOptions||u,o=function(e,r){return angular.isFunction(e.onEachFeature)?e.onEachFeature:function(a,o){t.LabelPlugin.isLoaded()&&i(a.properties.description)&&o.bindLabel(a.properties.description),l.bindEvents(o,null,a,p,r,{resetStyleOnMouseout:e.resetStyleOnMouseout,mapId:n.id})}},v=d.isDefined(n.geojsonNested)&&d.isTruthy(n.geojsonNested),m=function(){if(g){var r=function(r){i(r)&&e.hasLayer(r)&&e.removeLayer(r)};return v?void f.each(g,function(e){r(e)}):void r(g)}},h=function(r,t){var l=angular.copy(r);if(i(l)&&i(l.data)){var s=o(l,t);i(l.options)||(l.options={style:l.style,filter:l.filter,onEachFeature:s,pointToLayer:l.pointToLayer});var u=L.geoJson(l.data,l.options);t&&d.isString(t)?g[t]=u:g=u,u.addTo(e),y||(y=!0,a.setGeoJSON(g,n.id))}},b=function(e){if(m(),v){if(!e||!Object.keys(e).length)return;f.each(e,function(e,r){h(e,r)})}else h(e)};c(n.id,"geojson",b,m),s(p,"geojson",r,function(e){b(e)})})}}}]),angular.module("leaflet-directive").directive("layercontrol",["$filter","leafletLogger","leafletData","leafletHelpers",function(e,r,a,t){var n=r;return{restrict:"E",scope:{icons:"=?",autoHideOpacity:"=?",showGroups:"=?",title:"@",baseTitle:"@",overlaysTitle:"@"},replace:!0,transclude:!1,require:"^leaflet",controller:["$scope","$element","$sce",function(e,r,o){n.debug("[Angular Directive - Layers] layers",e,r);var i=t.safeApply,l=t.isDefined;angular.extend(e,{baselayer:"",oldGroup:"",layerProperties:{},groupProperties:{},rangeIsSupported:t.rangeIsSupported(),changeBaseLayer:function(r,n){t.safeApply(e,function(t){t.baselayer=r,a.getMap().then(function(n){a.getLayers().then(function(a){if(!n.hasLayer(a.baselayers[r])){for(var o in t.layers.baselayers)t.layers.baselayers[o].icon=t.icons.unradio,n.hasLayer(a.baselayers[o])&&n.removeLayer(a.baselayers[o]);n.addLayer(a.baselayers[r]),t.layers.baselayers[r].icon=e.icons.radio}})})}),n.preventDefault()},moveLayer:function(r,a,t){var n=Object.keys(e.layers.baselayers).length;if(a>=1+n&&a<=e.overlaysArray.length+n){var o;for(var l in e.layers.overlays)if(e.layers.overlays[l].index===a){o=e.layers.overlays[l];break}o&&i(e,function(){o.index=r.index,r.index=a})}t.stopPropagation(),t.preventDefault()},initIndex:function(r,a){var t=Object.keys(e.layers.baselayers).length;r.index=l(r.index)?r.index:a+t+1},initGroup:function(r){e.groupProperties[r]=e.groupProperties[r]?e.groupProperties[r]:{}},toggleOpacity:function(r,a){if(a.visible){if(e.autoHideOpacity&&!e.layerProperties[a.name].opacityControl)for(var t in e.layerProperties)e.layerProperties[t].opacityControl=!1;e.layerProperties[a.name].opacityControl=!e.layerProperties[a.name].opacityControl}r.stopPropagation(),r.preventDefault()},toggleLegend:function(r){e.layerProperties[r.name].showLegend=!e.layerProperties[r.name].showLegend},showLegend:function(r){return r.legend&&e.layerProperties[r.name].showLegend},unsafeHTML:function(e){return o.trustAsHtml(e)},getOpacityIcon:function(r){return r.visible&&e.layerProperties[r.name].opacityControl?e.icons.close:e.icons.open},getGroupIcon:function(r){return r.visible?e.icons.check:e.icons.uncheck},changeOpacity:function(r){var t=e.layerProperties[r.name].opacity;a.getMap().then(function(n){a.getLayers().then(function(a){var o;for(var i in e.layers.overlays)if(e.layers.overlays[i]===r){o=a.overlays[i];break}n.hasLayer(o)&&(o.setOpacity&&o.setOpacity(t/100),o.getLayers&&o.eachLayer&&o.eachLayer(function(e){e.setOpacity&&e.setOpacity(t/100)}))})})},changeGroupVisibility:function(r){if(l(e.groupProperties[r])){var a=e.groupProperties[r].visible;for(var t in e.layers.overlays){var n=e.layers.overlays[t];n.group===r&&(n.visible=a)}}}});var s=r.get(0);L.Browser.touch?L.DomEvent.on(s,"click",L.DomEvent.stopPropagation):(L.DomEvent.disableClickPropagation(s),L.DomEvent.on(s,"mousewheel",L.DomEvent.stopPropagation))}],template:'<div class="angular-leaflet-control-layers" ng-show="overlaysArray.length"><h4 ng-if="title">{{ title }}</h4><div class="lf-baselayers"><h5 class="lf-title" ng-if="baseTitle">{{ baseTitle }}</h5><div class="lf-row" ng-repeat="(key, layer) in baselayersArray"><label class="lf-icon-bl" ng-click="changeBaseLayer(key, $event)"><input class="leaflet-control-layers-selector" type="radio" name="lf-radio" ng-show="false" ng-checked="baselayer === key" ng-value="key" /> <i class="lf-icon lf-icon-radio" ng-class="layer.icon"></i><div class="lf-text">{{layer.name}}</div></label></div></div><div class="lf-overlays"><h5 class="lf-title" ng-if="overlaysTitle">{{ overlaysTitle }}</h5><div class="lf-container"><div class="lf-row" ng-repeat="layer in (o = (overlaysArray | orderBy:\'index\':order))" ng-init="initIndex(layer, $index)"><label class="lf-icon-ol-group" ng-if="showGroups &amp;&amp; layer.group &amp;&amp; layer.group != o[$index-1].group"><input class="lf-control-layers-selector" type="checkbox" ng-show="false" ng-change="changeGroupVisibility(layer.group)" ng-model="groupProperties[layer.group].visible"/> <i class="lf-icon lf-icon-check" ng-class="getGroupIcon(groupProperties[layer.group])"></i><div class="lf-text">{{ layer.group }}</div></label><label class="lf-icon-ol"><input class="lf-control-layers-selector" type="checkbox" ng-show="false" ng-model="layer.visible"/> <i class="lf-icon lf-icon-check" ng-class="layer.icon"></i><div class="lf-text">{{layer.name}}</div></label><div class="lf-icons"><i class="lf-icon lf-up" ng-class="icons.up" ng-click="moveLayer(layer, layer.index - orderNumber, $event)"></i> <i class="lf-icon lf-down" ng-class="icons.down" ng-click="moveLayer(layer, layer.index + orderNumber, $event)"></i> <i class="lf-icon lf-toggle-legend" ng-class="icons.toggleLegend" ng-if="layer.legend" ng-click="toggleLegend(layer)"></i> <i class="lf-icon lf-open" ng-class="getOpacityIcon(layer)" ng-click="toggleOpacity($event, layer)"></i></div><div class="lf-legend" ng-if="showLegend(layer)" ng-bind-html="unsafeHTML(layer.legend)"></div><div class="lf-opacity clearfix" ng-if="layer.visible &amp;&amp; layerProperties[layer.name].opacityControl"><label ng-if="rangeIsSupported" class="pull-left" style="width: 50%">0</label><label ng-if="rangeIsSupported" class="pull-left text-right" style="width: 50%">100</label><input ng-if="rangeIsSupported" class="clearfix" type="range" min="0" max="100" class="lf-opacity-control" ng-model="layerProperties[layer.name].opacity" ng-change="changeOpacity(layer)"/><h6 ng-if="!rangeIsSupported">Range is not supported in this browser</h6></div></div></div></div></div>',link:function(e,r,n,o){var i=t.isDefined,l=o.getLeafletScope(),s=l.layers;e.$watch("icons",function(){var r={uncheck:"fa fa-square-o",check:"fa fa-check-square-o",radio:"fa fa-dot-circle-o",unradio:"fa fa-circle-o",up:"fa fa-angle-up",down:"fa fa-angle-down",open:"fa fa-angle-double-down",close:"fa fa-angle-double-up",toggleLegend:"fa fa-pencil-square-o"};i(e.icons)?(angular.extend(r,e.icons),angular.extend(e.icons,r)):e.icons=r}),n.order=!i(n.order)||"normal"!==n.order&&"reverse"!==n.order?"normal":n.order,e.order="normal"===n.order,e.orderNumber="normal"===n.order?-1:1,e.layers=s,o.getMap().then(function(r){l.$watch("layers.baselayers",function(t){var n={};a.getLayers().then(function(a){var o;for(o in t){var i=t[o];i.icon=e.icons[r.hasLayer(a.baselayers[o])?"radio":"unradio"],n[o]=i}e.baselayersArray=n})}),l.$watch("layers.overlays",function(r){var t=[],n={};a.getLayers().then(function(a){var o;for(o in r){var l=r[o];l.icon=e.icons[l.visible?"check":"uncheck"],t.push(l),i(e.layerProperties[l.name])||(e.layerProperties[l.name]={opacity:i(l.layerOptions.opacity)?100*l.layerOptions.opacity:100,opacityControl:!1,showLegend:!0}),i(l.group)&&(i(e.groupProperties[l.group])||(e.groupProperties[l.group]={visible:!1}),n[l.group]=i(n[l.group])?n[l.group]:{count:0,visibles:0},n[l.group].count++,l.visible&&n[l.group].visibles++),i(l.index)&&a.overlays[o].setZIndex&&a.overlays[o].setZIndex(r[o].index)}for(o in n)e.groupProperties[o].visible=n[o].visibles===n[o].count;e.overlaysArray=t})},!0)})}}}]),angular.module("leaflet-directive").directive("layers",["leafletLogger","$q","leafletData","leafletHelpers","leafletLayerHelpers","leafletControlHelpers",function(e,r,a,t,n,o){return{restrict:"A",scope:!1,replace:!1,require:"leaflet",controller:["$scope",function(e){e._leafletLayers=r.defer(),this.getLayers=function(){return e._leafletLayers.promise}}],link:function(e,r,i,l){var s=t.isDefined,u={},c=l.getLeafletScope(),d=c.layers,f=n.createLayer,p=n.safeAddLayer,g=n.safeRemoveLayer,y=o.updateLayersControl,v=!1;l.getMap().then(function(r){e._leafletLayers.resolve(u),a.setLayers(u,i.id),u.baselayers={},u.overlays={};var t=i.id,n=!1;for(var o in d.baselayers){var l=f(d.baselayers[o]);s(l)?(u.baselayers[o]=l,!0===d.baselayers[o].top&&(p(r,u.baselayers[o]),n=!0)):delete d.baselayers[o]}for(o in!n&&Object.keys(u.baselayers).length>0&&p(r,u.baselayers[Object.keys(d.baselayers)[0]]),d.overlays){d.overlays[o].type;var m=f(d.overlays[o]);s(m)?(u.overlays[o]=m,!0===d.overlays[o].visible&&p(r,u.overlays[o])):delete d.overlays[o]}c.$watch("layers.baselayers",function(e,a){if(angular.equals(e,a))return v=y(r,t,v,e,d.overlays,u),!0;for(var n in u.baselayers)(!s(e[n])||e[n].doRefresh)&&(r.hasLayer(u.baselayers[n])&&r.removeLayer(u.baselayers[n]),delete u.baselayers[n],e[n]&&e[n].doRefresh&&(e[n].doRefresh=!1));for(var o in e)if(s(u.baselayers[o]))!0!==e[o].top||r.hasLayer(u.baselayers[o])?!1===e[o].top&&r.hasLayer(u.baselayers[o])&&r.removeLayer(u.baselayers[o]):p(r,u.baselayers[o]);else{var i=f(e[o]);s(i)&&(u.baselayers[o]=i,!0===e[o].top&&p(r,u.baselayers[o]))}var l=!1;for(var c in u.baselayers)if(r.hasLayer(u.baselayers[c])){l=!0;break}!l&&Object.keys(u.baselayers).length>0&&p(r,u.baselayers[Object.keys(u.baselayers)[0]]),v=y(r,t,v,e,d.overlays,u)},!0),c.$watch("layers.overlays",function(e,a){if(angular.equals(e,a))return v=y(r,t,v,d.baselayers,e,u),!0;for(var n in u.overlays)if(!s(e[n])||e[n].doRefresh){if(r.hasLayer(u.overlays[n])){var o=s(e[n])?e[n].layerOptions:null;g(r,u.overlays[n],o)}delete u.overlays[n],e[n]&&e[n].doRefresh&&(e[n].doRefresh=!1)}for(var i in e){if(s(u.overlays[i]))e[i].visible&&!r.hasLayer(u.overlays[i])?p(r,u.overlays[i]):!1===e[i].visible&&r.hasLayer(u.overlays[i])&&g(r,u.overlays[i],e[i].layerOptions);else{var l=f(e[i]);if(!s(l))continue;u.overlays[i]=l,!0===e[i].visible&&p(r,u.overlays[i])}e[i].visible&&r._loaded&&e[i].data&&"heatmap"===e[i].type&&(u.overlays[i].setData(e[i].data),u.overlays[i].update())}v=y(r,t,v,d.baselayers,e,u)},!0)})}}}]),angular.module("leaflet-directive").directive("legend",["leafletLogger","$http","leafletHelpers","leafletLegendHelpers",function(e,r,a,t){var n=e;return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(e,o,i,l){var s,u,c,d,f=a.isArray,p=a.isDefined,g=a.isFunction,y=l.getLeafletScope(),v=y.legend;y.$watch("legend",function(e){p(e)&&(s=e.legendClass?e.legendClass:"legend",u=e.position||"bottomright",d=e.type||"arcgis")},!0),l.getMap().then(function(e){y.$watch("legend",function(r){return p(r)?p(r.url)||"arcgis"!==d||f(r.colors)&&f(r.labels)&&r.colors.length===r.labels.length?p(r.url)?void n.info("[AngularJS - Leaflet] loading legend service."):(p(c)&&(c.removeFrom(e),c=null),c=L.control({position:u}),"arcgis"===d&&(c.onAdd=t.getOnAddArrayLegend(r,s)),void c.addTo(e)):void n.warn("[AngularJS - Leaflet] legend.colors and legend.labels must be set."):void(p(c)&&(c.removeFrom(e),c=null))}),y.$watch("legend.url",function(a){p(a)&&r.get(a).success(function(r){p(c)?t.updateLegend(c.getContainer(),r,d,a):((c=L.control({position:u})).onAdd=t.getOnAddLegend(r,s,d,a),c.addTo(e)),p(v.loadedData)&&g(v.loadedData)&&v.loadedData()}).error(function(){n.warn("[AngularJS - Leaflet] legend.url not loaded.")})})})}}}]),angular.module("leaflet-directive").directive("markers",["leafletLogger","$rootScope","$q","leafletData","leafletHelpers","leafletMapDefaults","leafletMarkersHelpers","leafletMarkerEvents","leafletIterators","leafletWatchHelpers","leafletDirectiveControlsHelpers",function(e,r,a,t,n,o,i,l,s,u,c){var d=n.isDefined,f=n.errorHeader,p=n,g=n.isString,y=i.addMarkerWatcher,v=i.updateMarker,m=i.listenMarkerEvents,h=i.addMarkerToGroup,b=i.createMarker,k=i.deleteMarker,A=s,D=n.watchOptions,w=u.maybeWatch,P=c.extend,C=e,M=function(e,r,a){if(Object.keys(e).length){if(a&&g(a)){if(!e[a]||!Object.keys(e[a]).length)return;return e[a][r]}return e[r]}},H=function(e,r,a,t){return t&&g(t)?(d(r[t])||(r[t]={}),r[t][a]=e):r[a]=e,e},O=function(e,r,a,t,n,o){if(!g(e))return C.error(f+" A layername must be a string"),!1;if(!d(r))return C.error(f+" You must add layers to the directive if the markers are going to use this functionality."),!1;if(!d(r.overlays)||!d(r.overlays[e]))return C.error(f+' A marker can only be added to a layer of type "group"'),!1;var i=r.overlays[e];return i instanceof L.LayerGroup||i instanceof L.FeatureGroup?(i.addLayer(t),!n&&o.hasLayer(t)&&!0===a.focus&&t.openPopup(),!0):(C.error(f+' Adding a marker to an overlay needs a overlay of the type "group" or "featureGroup"'),!1)},S=function(e,r,a,t,n,o,i,s,u){for(var c in e)if(!u[c])if(-1===c.search("-")){var g=p.copy(e[c]),L=p.getObjectDotPath(s?[s,c]:[c]),k=M(n,c,s);if(d(k)){var A=d(A)?r[c]:void 0;v(g,A,k,L,o,t,a)}else{var D=b(g),w=(g?g.layer:void 0)||s;if(!d(D)){C.error(f+" Received invalid data on the marker "+c+".");continue}if(H(D,n,c,s),d(g.message)&&D.bindPopup(g.message,g.popupOptions),d(g.group)){var P=d(g.groupOption)?g.groupOption:null;h(D,g.group,P,a)}if(p.LabelPlugin.isLoaded()&&d(g.label)&&d(g.label.message)&&D.bindLabel(g.label.message,g.label.options),d(g)&&(d(g.layer)||d(s))){if(!O(w,t,g,D,i.individual.doWatch,a))continue}else d(g.group)||(a.addLayer(D),i.individual.doWatch||!0!==g.focus||D.openPopup());i.individual.doWatch&&y(D,L,o,t,a,i.individual.isDeep),m(D,g,o,i.individual.doWatch,a),l.bindEvents(D,L,g,o,w)}}else C.error('The marker can\'t use a "-" on his key name: "'+c+'".')},E=function(e,r,a,t,n){var o,i,l=!1,s=!1,u=d(r);for(var c in a)l||(C.debug(f+"[markers] destroy: "),l=!0),u&&(i=e[c],o=r[c],s=angular.equals(i,o)&&t),d(e)&&Object.keys(e).length&&d(e[c])&&Object.keys(e[c]).length&&!s||n&&p.isFunction(n)&&n(i,o,c)},T=function(e,r,a,t,n){E(e,r,a,!1,function(e,r,o){C.debug(f+"[marker] is deleting marker: "+o),k(a[o],t,n),delete a[o]})},x=function(e,r,a){var t={};return E(e,r,a,!0,function(e,r,a){C.debug(f+"[marker] is already rendered, marker: "+a),t[a]=e}),t};return{restrict:"A",scope:!1,replace:!1,require:["leaflet","?layers"],link:function(e,r,n,o){var i=o[0],l=i.getLeafletScope();i.getMap().then(function(e){var r,i={};r=d(o[1])?o[1].getLayers:function(){var e=a.defer();return e.resolve(),e.promise};var s=l.markersWatchOptions||D;d(n.watchMarkers)&&(s.doWatch=s.individual.doWatch=!d(n.watchMarkers)||p.isTruthy(n.watchMarkers));var u=d(n.markersNested)&&p.isTruthy(n.markersNested);r().then(function(r){var a=function(a,t){return u?void A.each(a,function(a,n){var o=d(o)?t[n]:void 0;T(a,o,i[n],e,r)}):void T(a,t,i,e,r)},o=function(t,n){a(t,n);var o=null;return u?void A.each(t,function(a,u){var c=d(c)?n[u]:void 0;o=x(t[u],c,i[u]),S(a,n,e,r,i,l,s,u,o)}):(o=x(t,n,i),void S(t,n,e,r,i,l,s,void 0,o))};P(n.id,"markers",o,a),t.setMarkers(i,n.id),w(l,"markers",s,function(e,r){o(e,r)})})})}}}]),angular.module("leaflet-directive").directive("maxbounds",["leafletLogger","leafletMapDefaults","leafletBoundsHelpers","leafletHelpers",function(e,r,a,t){return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(e,r,n,o){var i=o.getLeafletScope(),l=a.isValidBounds,s=t.isNumber;o.getMap().then(function(e){i.$watch("maxbounds",function(r){if(l(r)){var t=a.createLeafletBounds(r);s(r.pad)&&(t=t.pad(r.pad)),e.setMaxBounds(t),n.center||n.lfCenter||e.fitBounds(t)}else e.setMaxBounds()})})}}}]),angular.module("leaflet-directive").directive("paths",["leafletLogger","$q","leafletData","leafletMapDefaults","leafletHelpers","leafletPathsHelpers","leafletEvents",function(e,r,a,t,n,o,i){var l=e;return{restrict:"A",scope:!1,replace:!1,require:["leaflet","?layers"],link:function(e,s,u,c){var d=c[0],f=n.isDefined,p=n.isString,g=d.getLeafletScope(),y=g.paths,v=o.createPath,m=i.bindPathEvents,h=o.setPathOptions;d.getMap().then(function(e){var o,i=t.getDefaults(u.id);o=f(c[1])?c[1].getLayers:function(){var e=r.defer();return e.resolve(),e.promise},f(y)&&o().then(function(r){var t={};a.setPaths(t,u.id);var o=!f(u.watchPaths)||"true"===u.watchPaths,s=function(a,t){var n=g.$watch('paths["'+t+'"]',function(t,o){if(!f(t)){if(f(o.layer))for(var i in r.overlays){r.overlays[i].removeLayer(a)}return e.removeLayer(a),void n()}h(a,t.type,t)},!0)};g.$watchCollection("paths",function(a){for(var u in t)f(a[u])||(e.removeLayer(t[u]),delete t[u]);for(var c in a)if(0!==c.search("\\$"))if(-1===c.search("-")){if(!f(t[c])){var d=a[c],y=v(c,a[c],i);if(f(y)&&f(d.message)&&y.bindPopup(d.message,d.popupOptions),n.LabelPlugin.isLoaded()&&f(d.label)&&f(d.label.message)&&y.bindLabel(d.label.message,d.label.options),f(d)&&f(d.layer)){if(!p(d.layer)){l.error("[AngularJS - Leaflet] A layername must be a string");continue}if(!f(r)){l.error("[AngularJS - Leaflet] You must add layers to the directive if the markers are going to use this functionality.");continue}if(!f(r.overlays)||!f(r.overlays[d.layer])){l.error('[AngularJS - Leaflet] A path can only be added to a layer of type "group"');continue}var b=r.overlays[d.layer];if(!(b instanceof L.LayerGroup||b instanceof L.FeatureGroup)){l.error('[AngularJS - Leaflet] Adding a path to an overlay needs a overlay of the type "group" or "featureGroup"');continue}t[c]=y,b.addLayer(y),o?s(y,c):h(y,d.type,d)}else f(y)&&(t[c]=y,e.addLayer(y),o?s(y,c):h(y,d.type,d));m(y,c,d,g)}}else l.error('[AngularJS - Leaflet] The path name "'+c+'" is not valid. It must not include "-" and a number.')})})})}}}]),angular.module("leaflet-directive").directive("tiles",["leafletLogger","leafletData","leafletMapDefaults","leafletHelpers",function(e,r,a,t){var n=e;return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(e,o,i,l){var s=t.isDefined,u=l.getLeafletScope(),c=u.tiles;return s(c)&&s(c.url)?void l.getMap().then(function(e){var t,n=a.getDefaults(i.id);u.$watch("tiles",function(a){var o=n.tileLayerOptions,l=n.tileLayer;return!s(a.url)&&s(t)?void e.removeLayer(t):s(t)?s(a.url)&&s(a.options)&&!angular.equals(a.options,o)?(e.removeLayer(t),o=n.tileLayerOptions,angular.copy(a.options,o),l=a.url,(t=L.tileLayer(l,o)).addTo(e),void r.setTiles(t,i.id)):void(s(a.url)&&t.setUrl(a.url)):(s(a.options)&&angular.copy(a.options,o),s(a.url)&&(l=a.url),(t=L.tileLayer(l,o)).addTo(e),void r.setTiles(t,i.id))},!0)}):void n.warn("[AngularJS - Leaflet] The 'tiles' definition doesn't have the 'url' property.")}}}]),["markers","geojson"].forEach(function(e){angular.module("leaflet-directive").directive(e+"WatchOptions",["$log","$rootScope","$q","leafletData","leafletHelpers",function(r,a,t,n,o){var i=o.isDefined,l=o.errorHeader,s=o.isObject,u=o.watchOptions,c=r;return{restrict:"A",scope:!1,replace:!1,require:["leaflet"],link:function(r,a,t,n){var o=n[0],d=o.getLeafletScope();o.getMap().then(function(){i(r[e+"WatchOptions"])&&(s(r[e+"WatchOptions"])?angular.extend(u,r[e+"WatchOptions"]):c.error(l+"["+e+"WatchOptions] is not an object"),d[e+"WatchOptions"]=u)})}}}])}),angular.module("leaflet-directive").factory("leafletEventsHelpersFactory",["$rootScope","$q","leafletLogger","leafletHelpers",function(e,r,a,t){var n=t.safeApply,o=t.isDefined,i=t.isObject,l=t.isArray,s=t.errorHeader,u=a,c=function(e,r){this.rootBroadcastName=e,this.lObjectType=r};return c.prototype.getAvailableEvents=function(){return[]},c.prototype.genDispatchEvent=function(e,r,a,t,n,o,i,l){var s=this;return function(u){var c=s.rootBroadcastName+"."+e;s.fire(a,c,r,u,u.target||t,o,n,i,l)}},c.prototype.fire=function(r,a,t,i,l,s,u,c,d){n(r,function(){var n={leafletEvent:i,leafletObject:l,modelName:u,model:s};o(c)&&angular.extend(n,{layerName:c}),"emit"===t?r.$emit(a,n):e.$broadcast(a,n)})},c.prototype.bindEvents=function(e,r,a,t,n,c){var d=[],f="emit",p=this;if(o(t.eventBroadcast))if(i(t.eventBroadcast))if(o(t.eventBroadcast[p.lObjectType]))if(i(t.eventBroadcast[p.lObjectType])){o(t.eventBroadcast[this.lObjectType].logic)&&"emit"!==t.eventBroadcast[p.lObjectType].logic&&"broadcast"!==t.eventBroadcast[p.lObjectType].logic&&u.warn(s+"Available event propagation logic are: 'emit' or 'broadcast'.");var g=!1,y=!1;o(t.eventBroadcast[p.lObjectType].enable)&&l(t.eventBroadcast[p.lObjectType].enable)&&(g=!0),o(t.eventBroadcast[p.lObjectType].disable)&&l(t.eventBroadcast[p.lObjectType].disable)&&(y=!0),g&&y?u.warn(s+"can not enable and disable events at the same time"):g||y?g?t.eventBroadcast[this.lObjectType].enable.forEach(function(e){-1!==d.indexOf(e)?u.warn(s+"This event "+e+" is already enabled"):-1===p.getAvailableEvents().indexOf(e)?u.warn(s+"This event "+e+" does not exist"):d.push(e)}):(d=this.getAvailableEvents(),t.eventBroadcast[p.lObjectType].disable.forEach(function(e){var r=d.indexOf(e);-1===r?u.warn(s+"This event "+e+" does not exist or has been already disabled"):d.splice(r,1)})):u.warn(s+"must enable or disable events")}else u.warn(s+"event-broadcast."+[p.lObjectType]+" must be an object check your model.");else d=this.getAvailableEvents();else u.error(s+"event-broadcast must be an object check your model.");else d=this.getAvailableEvents();return d.forEach(function(o){e.on(o,p.genDispatchEvent(o,f,t,e,r,a,n,c))}),f},c}]).service("leafletEventsHelpers",["leafletEventsHelpersFactory",function(e){return new e}]),angular.module("leaflet-directive").factory("leafletGeoJsonEvents",["$rootScope","$q","leafletLogger","leafletHelpers","leafletEventsHelpersFactory","leafletLabelEvents","leafletData",function(e,r,a,t,n,o,i){var l=t.safeApply,s=n,u=function(){s.call(this,"leafletDirectiveGeoJson","geojson")};return(u.prototype=new s).genDispatchEvent=function(r,a,t,n,o,u,c,d){var f=s.prototype.genDispatchEvent.call(this,r,a,t,n,o,u,c),p=this;return function(a){"mouseout"===r&&(d.resetStyleOnMouseout&&i.getGeoJSON(d.mapId).then(function(e){(c?e[c]:e).resetStyle(a.target)}),l(t,function(){e.$broadcast(p.rootBroadcastName+".mouseout",a)})),f(a)}},u.prototype.getAvailableEvents=function(){return["click","dblclick","mouseover","mouseout"]},new u}]),angular.module("leaflet-directive").factory("leafletLabelEvents",["$rootScope","$q","leafletLogger","leafletHelpers","leafletEventsHelpersFactory",function(e,r,a,t,n){var o=t,i=n,l=function(){i.call(this,"leafletDirectiveLabel","markers")};return(l.prototype=new i).genDispatchEvent=function(e,r,a,t,n,o,l){var s=n.replace("markers.","");return i.prototype.genDispatchEvent.call(this,e,r,a,t,s,o,l)},l.prototype.getAvailableEvents=function(){return["click","dblclick","mousedown","mouseover","mouseout","contextmenu"]},l.prototype.genEvents=function(e,r,a,t,n,i,l){var s=this,u=this.getAvailableEvents(),c=o.getObjectArrayPath("markers."+n);u.forEach(function(e){t.label.on(e,s.genDispatchEvent(e,r,a,t.label,c,i,l))})},l.prototype.bindEvents=function(e,r,a,t,n){},new l}]),angular.module("leaflet-directive").factory("leafletMapEvents",["$rootScope","$q","leafletLogger","leafletHelpers","leafletEventsHelpers",function(e,r,a,t,n){var o=t.isDefined,i=n.fire;return{getAvailableMapEvents:function(){return["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","contextmenu","focus","blur","preclick","load","unload","viewreset","movestart","move","moveend","dragstart","drag","dragend","zoomstart","zoomanim","zoomend","zoomlevelschange","resize","autopanstart","layeradd","layerremove","baselayerchange","overlayadd","overlayremove","locationfound","locationerror","popupopen","popupclose","draw:created","draw:edited","draw:deleted","draw:drawstart","draw:drawstop","draw:editstart","draw:editstop","draw:deletestart","draw:deletestop"]},genDispatchMapEvent:function(e,r,a){return function(t){i(e,"leafletDirectiveMap."+r,a,t,t.target,e)}},notifyCenterChangedToBounds:function(e){e.$broadcast("boundsChanged")},notifyCenterUrlHashChanged:function(e,r,a,t){if(o(a.urlHashCenter)){var n=r.getCenter(),i=n.lat.toFixed(4)+":"+n.lng.toFixed(4)+":"+r.getZoom();o(t.c)&&t.c===i||e.$emit("centerUrlHash",i)}}}}]),angular.module("leaflet-directive").factory("leafletMarkerEvents",["$rootScope","$q","leafletLogger","leafletHelpers","leafletEventsHelpersFactory","leafletLabelEvents",function(e,r,a,t,n,o){var i=t.safeApply,l=t.isDefined,s=t,u=o,c=n,d=function(){c.call(this,"leafletDirectiveMarker","markers")};return(d.prototype=new c).genDispatchEvent=function(r,a,t,n,o,l,s){var u=c.prototype.genDispatchEvent.call(this,r,a,t,n,o,l,s);return function(a){"click"===r?i(t,function(){e.$broadcast("leafletDirectiveMarkersClick",o)}):"dragend"===r&&(i(t,function(){l.lat=n.getLatLng().lat,l.lng=n.getLatLng().lng}),l.message&&!0===l.focus&&n.openPopup()),u(a)}},d.prototype.getAvailableEvents=function(){return["click","dblclick","mousedown","mouseover","mouseout","contextmenu","dragstart","drag","dragend","move","remove","popupopen","popupclose","touchend","touchstart","touchmove","touchcancel","touchleave"]},d.prototype.bindEvents=function(e,r,a,t,n){var o=c.prototype.bindEvents.call(this,e,r,a,t,n);s.LabelPlugin.isLoaded()&&l(e.label)&&u.genEvents(r,o,t,e,a,n)},new d}]),angular.module("leaflet-directive").factory("leafletPathEvents",["$rootScope","$q","leafletLogger","leafletHelpers","leafletLabelEvents","leafletEventsHelpers",function(e,r,a,t,n,o){var i=t.isDefined,l=t.isObject,s=t,u=t.errorHeader,c=n,d=o.fire,f=a,p=function(e,r,a,t,n,o,i){return function(l){d(a,"leafletDirectivePath."+e,r,l,l.target||t,o,n,i)}},g=function(){return["click","dblclick","mousedown","mouseover","mouseout","contextmenu","add","remove","popupopen","popupclose"]};return{getAvailablePathEvents:g,bindPathEvents:function(e,r,a,t){var n,o,d=[],y="broadcast";if(i(t.eventBroadcast))if(l(t.eventBroadcast))if(i(t.eventBroadcast.path))if(l(t.eventBroadcast.paths))f.warn(u+"event-broadcast.path must be an object check your model.");else{void 0!==t.eventBroadcast.path.logic&&null!==t.eventBroadcast.path.logic&&("emit"!==t.eventBroadcast.path.logic&&"broadcast"!==t.eventBroadcast.path.logic?f.warn(u+"Available event propagation logic are: 'emit' or 'broadcast'."):"emit"===t.eventBroadcast.path.logic&&(y="emit"));var v=!1,m=!1;if(void 0!==t.eventBroadcast.path.enable&&null!==t.eventBroadcast.path.enable&&"object"==typeof t.eventBroadcast.path.enable&&(v=!0),void 0!==t.eventBroadcast.path.disable&&null!==t.eventBroadcast.path.disable&&"object"==typeof t.eventBroadcast.path.disable&&(m=!0),v&&m)f.warn(u+"can not enable and disable events at the same time");else if(v||m)if(v)for(n=0;n<t.eventBroadcast.path.enable.length;n++)o=t.eventBroadcast.path.enable[n],-1!==d.indexOf(o)?f.warn(u+"This event "+o+" is already enabled"):-1===g().indexOf(o)?f.warn(u+"This event "+o+" does not exist"):d.push(o);else for(d=g(),n=0;n<t.eventBroadcast.path.disable.length;n++){o=t.eventBroadcast.path.disable[n];var L=d.indexOf(o);-1===L?f.warn(u+"This event "+o+" does not exist or has been already disabled"):d.splice(L,1)}else f.warn(u+"must enable or disable events")}else d=g();else f.error(u+"event-broadcast must be an object check your model.");else d=g();for(n=0;n<d.length;n++)o=d[n],e.on(o,p(o,y,t,d,r));s.LabelPlugin.isLoaded()&&i(e.label)&&c.genEvents(r,y,t,e,a)}}}])}(angular);;!function(){"use strict";angular.module("angular-linq",[]),angular.module("angular-linq").factory("$linq",function(){return{Enumerable:function(){var n=function(n){this.GetEnumerator=n};n.Choice=function(){var e=arguments[0]instanceof Array?arguments[0]:arguments;return new n(function(){return new u(t.Blank,function(){return this.Yield(e[Math.floor(Math.random()*e.length)])},t.Blank)})},n.Cycle=function(){var e=arguments[0]instanceof Array?arguments[0]:arguments;return new n(function(){var n=0;return new u(t.Blank,function(){return n>=e.length&&(n=0),this.Yield(e[n++])},t.Blank)})},n.Empty=function(){return new n(function(){return new u(t.Blank,function(){return!1},t.Blank)})},n.From=function(i){if(null==i)return n.Empty();if(i instanceof n)return i;if(typeof i==e.Number||typeof i==e.Boolean)return n.Repeat(i,1);if(typeof i==e.String)return new n(function(){var n=0;return new u(t.Blank,function(){return n<i.length&&this.Yield(i.charAt(n++))},t.Blank)});if(typeof i!=e.Function){if(typeof i.length==e.Number)return new f(i);if(!(i instanceof Object)&&r.IsIEnumerable(i))return new n(function(){var n,e=!0;return new u(function(){n=new Enumerator(i)},function(){return e?e=!1:n.moveNext(),!n.atEnd()&&this.Yield(n.item())},t.Blank)})}return new n(function(){var n=[],e=0;return new u(function(){for(var t in i)i[t]instanceof Function||n.push({Key:t,Value:i[t]})},function(){return e<n.length&&this.Yield(n[e++])},t.Blank)})},n.Return=function(t){return n.Repeat(t,1)},n.Matches=function(e,r,i){return null==i&&(i=""),r instanceof RegExp&&(i+=r.ignoreCase?"i":"",i+=r.multiline?"m":"",r=r.source),-1===i.indexOf("g")&&(i+="g"),new n(function(){var n;return new u(function(){n=new RegExp(r,i)},function(){var t=n.exec(e);return!!t&&this.Yield(t)},t.Blank)})},n.Range=function(t,e,r){return null==r&&(r=1),n.ToInfinity(t,r).Take(e)},n.RangeDown=function(t,e,r){return null==r&&(r=1),n.ToNegativeInfinity(t,r).Take(e)},n.RangeTo=function(t,e,r){return null==r&&(r=1),t<e?n.ToInfinity(t,r).TakeWhile(function(n){return n<=e}):n.ToNegativeInfinity(t,r).TakeWhile(function(n){return n>=e})},n.Repeat=function(e,r){return null!=r?n.Repeat(e).Take(r):new n(function(){return new u(t.Blank,function(){return this.Yield(e)},t.Blank)})},n.RepeatWithFinalize=function(t,e){return t=r.CreateLambda(t),e=r.CreateLambda(e),new n(function(){var n;return new u(function(){n=t()},function(){return this.Yield(n)},function(){null!=n&&(e(n),n=null)})})},n.Generate=function(e,i){return null!=i?n.Generate(e).Take(i):(e=r.CreateLambda(e),new n(function(){return new u(t.Blank,function(){return this.Yield(e())},t.Blank)}))},n.ToInfinity=function(e,r){return null==e&&(e=0),null==r&&(r=1),new n(function(){var n;return new u(function(){n=e-r},function(){return this.Yield(n+=r)},t.Blank)})},n.ToNegativeInfinity=function(e,r){return null==e&&(e=0),null==r&&(r=1),new n(function(){var n;return new u(function(){n=e+r},function(){return this.Yield(n-=r)},t.Blank)})},n.Unfold=function(e,i){return i=r.CreateLambda(i),new n(function(){var n,r=!0;return new u(t.Blank,function(){return r?(r=!1,n=e,this.Yield(n)):(n=i(n),this.Yield(n))},t.Blank)})},n.prototype={CascadeBreadthFirst:function(t,e){var i=this;return t=r.CreateLambda(t),e=r.CreateLambda(e),new n(function(){var o,a=0,c=[];return new u(function(){o=i.GetEnumerator()},function(){for(;;){if(o.MoveNext())return c.push(o.Current()),this.Yield(e(o.Current(),a));var i=n.From(c).SelectMany(function(n){return t(n)});if(!i.Any())return!1;a++,c=[],r.Dispose(o),o=i.GetEnumerator()}},function(){r.Dispose(o)})})},CascadeDepthFirst:function(t,e){var i=this;return t=r.CreateLambda(t),e=r.CreateLambda(e),new n(function(){var o,a=[];return new u(function(){o=i.GetEnumerator()},function(){for(;;){if(o.MoveNext()){var i=e(o.Current(),a.length);return a.push(o),o=n.From(t(o.Current())).GetEnumerator(),this.Yield(i)}if(a.length<=0)return!1;r.Dispose(o),o=a.pop()}},function(){try{r.Dispose(o)}finally{n.From(a).ForEach(function(n){n.Dispose()})}})})},Flatten:function(){var e=this;return new n(function(){var i,o=null;return new u(function(){i=e.GetEnumerator()},function(){for(;;){if(null!=o){if(o.MoveNext())return this.Yield(o.Current());o=null}if(i.MoveNext()){if(i.Current()instanceof Array){r.Dispose(o),o=n.From(i.Current()).SelectMany(t.Identity).Flatten().GetEnumerator();continue}return this.Yield(i.Current())}return!1}},function(){try{r.Dispose(i)}finally{r.Dispose(o)}})})},Pairwise:function(t){var e=this;return t=r.CreateLambda(t),new n(function(){var n;return new u(function(){(n=e.GetEnumerator()).MoveNext()},function(){var e=n.Current();return!!n.MoveNext()&&this.Yield(t(e,n.Current()))},function(){r.Dispose(n)})})},Scan:function(t,e,i){if(null!=i)return this.Scan(t,e).Select(i);var o;null==e?(e=r.CreateLambda(t),o=!1):(e=r.CreateLambda(e),o=!0);var a=this;return new n(function(){var n,i,c=!0;return new u(function(){n=a.GetEnumerator()},function(){if(c){if(c=!1,o)return this.Yield(i=t);if(n.MoveNext())return this.Yield(i=n.Current())}return!!n.MoveNext()&&this.Yield(i=e(i,n.Current()))},function(){r.Dispose(n)})})},Select:function(t){var e=this;return t=r.CreateLambda(t),new n(function(){var n,i=0;return new u(function(){n=e.GetEnumerator()},function(){return!!n.MoveNext()&&this.Yield(t(n.Current(),i++))},function(){r.Dispose(n)})})},SelectMany:function(t,e){var i=this;return t=r.CreateLambda(t),null==e&&(e=function(n,t){return t}),e=r.CreateLambda(e),new n(function(){var o,a=void 0,c=0;return new u(function(){o=i.GetEnumerator()},function(){if(void 0===a&&!o.MoveNext())return!1;do{if(null==a){var i=t(o.Current(),c++);a=n.From(i).GetEnumerator()}if(a.MoveNext())return this.Yield(e(o.Current(),a.Current()));r.Dispose(a),a=null}while(o.MoveNext());return!1},function(){try{r.Dispose(o)}finally{r.Dispose(a)}})})},Where:function(t){t=r.CreateLambda(t);var e=this;return new n(function(){var n,i=0;return new u(function(){n=e.GetEnumerator()},function(){for(;n.MoveNext();)if(t(n.Current(),i++))return this.Yield(n.Current());return!1},function(){r.Dispose(n)})})},OfType:function(n){var t;switch(n){case Number:t=e.Number;break;case String:t=e.String;break;case Boolean:t=e.Boolean;break;case Function:t=e.Function;break;default:t=null}return null===t?this.Where(function(t){return t instanceof n}):this.Where(function(n){return typeof n===t})},Zip:function(t,e){e=r.CreateLambda(e);var i=this;return new n(function(){var o,a,c=0;return new u(function(){o=i.GetEnumerator(),a=n.From(t).GetEnumerator()},function(){return!(!o.MoveNext()||!a.MoveNext())&&this.Yield(e(o.Current(),a.Current(),c++))},function(){try{r.Dispose(o)}finally{r.Dispose(a)}})})},Join:function(e,i,o,a,c){i=r.CreateLambda(i),o=r.CreateLambda(o),a=r.CreateLambda(a),c=r.CreateLambda(c);var f=this;return new n(function(){var s,l,h=null,v=0;return new u(function(){s=f.GetEnumerator(),l=n.From(e).ToLookup(o,t.Identity,c)},function(){for(;;){if(null!=h){var n=h[v++];if(void 0!==n)return this.Yield(a(s.Current(),n));n=null,v=0}if(!s.MoveNext())return!1;var t=i(s.Current());h=l.Get(t).ToArray()}},function(){r.Dispose(s)})})},GroupJoin:function(e,i,o,a,c){i=r.CreateLambda(i),o=r.CreateLambda(o),a=r.CreateLambda(a),c=r.CreateLambda(c);var f=this;return new n(function(){var s=f.GetEnumerator(),l=null;return new u(function(){s=f.GetEnumerator(),l=n.From(e).ToLookup(o,t.Identity,c)},function(){if(s.MoveNext()){var n=l.Get(i(s.Current()));return this.Yield(a(s.Current(),n))}return!1},function(){r.Dispose(s)})})},All:function(n){n=r.CreateLambda(n);var t=!0;return this.ForEach(function(e){if(!n(e))return t=!1,!1}),t},Any:function(n){n=r.CreateLambda(n);var t=this.GetEnumerator();try{if(0==arguments.length)return t.MoveNext();for(;t.MoveNext();)if(n(t.Current()))return!0;return!1}finally{r.Dispose(t)}},Concat:function(t){var e=this;return new n(function(){var i,o;return new u(function(){i=e.GetEnumerator()},function(){if(null==o){if(i.MoveNext())return this.Yield(i.Current());o=n.From(t).GetEnumerator()}return!!o.MoveNext()&&this.Yield(o.Current())},function(){try{r.Dispose(i)}finally{r.Dispose(o)}})})},Insert:function(t,e){var i=this;return new n(function(){var o,a,c=0,f=!1;return new u(function(){o=i.GetEnumerator(),a=n.From(e).GetEnumerator()},function(){return c==t&&a.MoveNext()?(f=!0,this.Yield(a.Current())):o.MoveNext()?(c++,this.Yield(o.Current())):!(f||!a.MoveNext())&&this.Yield(a.Current())},function(){try{r.Dispose(o)}finally{r.Dispose(a)}})})},Alternate:function(t){return t=n.Return(t),this.SelectMany(function(e){return n.Return(e).Concat(t)}).TakeExceptLast()},Contains:function(n,t){t=r.CreateLambda(t);var e=this.GetEnumerator();try{for(;e.MoveNext();)if(t(e.Current())===n)return!0;return!1}finally{r.Dispose(e)}},DefaultIfEmpty:function(t){var e=this;return new n(function(){var n,i=!0;return new u(function(){n=e.GetEnumerator()},function(){return n.MoveNext()?(i=!1,this.Yield(n.Current())):!!i&&(i=!1,this.Yield(t))},function(){r.Dispose(n)})})},Distinct:function(t){return this.Except(n.Empty(),t)},Except:function(t,e){e=r.CreateLambda(e);var i=this;return new n(function(){var o,a;return new u(function(){o=i.GetEnumerator(),a=new s(e),n.From(t).ForEach(function(n){a.Add(n)})},function(){for(;o.MoveNext();){var n=o.Current();if(!a.Contains(n))return a.Add(n),this.Yield(n)}return!1},function(){r.Dispose(o)})})},Intersect:function(t,e){e=r.CreateLambda(e);var i=this;return new n(function(){var o,a,c;return new u(function(){o=i.GetEnumerator(),a=new s(e),n.From(t).ForEach(function(n){a.Add(n)}),c=new s(e)},function(){for(;o.MoveNext();){var n=o.Current();if(!c.Contains(n)&&a.Contains(n))return c.Add(n),this.Yield(n)}return!1},function(){r.Dispose(o)})})},SequenceEqual:function(t,e){e=r.CreateLambda(e);var i=this.GetEnumerator();try{var u=n.From(t).GetEnumerator();try{for(;i.MoveNext();)if(!u.MoveNext()||e(i.Current())!==e(u.Current()))return!1;return!u.MoveNext()}finally{r.Dispose(u)}}finally{r.Dispose(i)}},Union:function(t,e){e=r.CreateLambda(e);var i=this;return new n(function(){var o,a,c;return new u(function(){o=i.GetEnumerator(),c=new s(e)},function(){var e;if(void 0===a){for(;o.MoveNext();)if(e=o.Current(),!c.Contains(e))return c.Add(e),this.Yield(e);a=n.From(t).GetEnumerator()}for(;a.MoveNext();)if(e=a.Current(),!c.Contains(e))return c.Add(e),this.Yield(e);return!1},function(){try{r.Dispose(o)}finally{r.Dispose(a)}})})},OrderBy:function(n){return new a(this,n,!1)},OrderByDescending:function(n){return new a(this,n,!0)},Reverse:function(){var e=this;return new n(function(){var n,r;return new u(function(){n=e.ToArray(),r=n.length},function(){return r>0&&this.Yield(n[--r])},t.Blank)})},Shuffle:function(){var e=this;return new n(function(){var n;return new u(function(){n=e.ToArray()},function(){if(n.length>0){var t=Math.floor(Math.random()*n.length);return this.Yield(n.splice(t,1)[0])}return!1},t.Blank)})},GroupBy:function(t,e,i,o){var a=this;return t=r.CreateLambda(t),e=r.CreateLambda(e),null!=i&&(i=r.CreateLambda(i)),o=r.CreateLambda(o),new n(function(){var n;return new u(function(){n=a.ToLookup(t,e,o).ToEnumerable().GetEnumerator()},function(){for(;n.MoveNext();)return null==i?this.Yield(n.Current()):this.Yield(i(n.Current().Key(),n.Current()));return!1},function(){r.Dispose(n)})})},PartitionBy:function(t,e,i,o){var a,c=this;return t=r.CreateLambda(t),e=r.CreateLambda(e),o=r.CreateLambda(o),null==i?(a=!1,i=function(n,t){return new h(n,t)}):(a=!0,i=r.CreateLambda(i)),new n(function(){var f,s,l,h=[];return new u(function(){(f=c.GetEnumerator()).MoveNext()&&(s=t(f.Current()),l=o(s),h.push(e(f.Current())))},function(){for(var r;1==(r=f.MoveNext())&&l===o(t(f.Current()));)h.push(e(f.Current()));if(h.length>0){var u=i(s,a?n.From(h):h);return r?(s=t(f.Current()),l=o(s),h=[e(f.Current())]):h=[],this.Yield(u)}return!1},function(){r.Dispose(f)})})},BufferWithCount:function(t){var e=this;return new n(function(){var n;return new u(function(){n=e.GetEnumerator()},function(){for(var e=[],r=0;n.MoveNext();)if(e.push(n.Current()),++r>=t)return this.Yield(e);return e.length>0&&this.Yield(e)},function(){r.Dispose(n)})})},Aggregate:function(n,t,e){return this.Scan(n,t,e).Last()},Average:function(n){n=r.CreateLambda(n);var t=0,e=0;return this.ForEach(function(r){t+=n(r),++e}),t/e},Count:function(n){n=null==n?t.True:r.CreateLambda(n);var e=0;return this.ForEach(function(t,r){n(t,r)&&++e}),e},Max:function(n){return null==n&&(n=t.Identity),this.Select(n).Aggregate(function(n,t){return n>t?n:t})},Min:function(n){return null==n&&(n=t.Identity),this.Select(n).Aggregate(function(n,t){return n<t?n:t})},MaxBy:function(n){return n=r.CreateLambda(n),this.Aggregate(function(t,e){return n(t)>n(e)?t:e})},MinBy:function(n){return n=r.CreateLambda(n),this.Aggregate(function(t,e){return n(t)<n(e)?t:e})},Sum:function(n){return null==n&&(n=t.Identity),this.Select(n).Aggregate(0,function(n,t){return n+t})},ElementAt:function(n){var t,e=!1;if(this.ForEach(function(r,i){if(i==n)return t=r,e=!0,!1}),!e)throw new Error("index is less than 0 or greater than or equal to the number of elements in source.");return t},ElementAtOrDefault:function(n,t){var e,r=!1;return this.ForEach(function(t,i){if(i==n)return e=t,r=!0,!1}),r?e:t},First:function(n){if(null!=n)return this.Where(n).First();var t,e=!1;if(this.ForEach(function(n){return t=n,e=!0,!1}),!e)throw new Error("First:No element satisfies the condition.");return t},FirstOrDefault:function(n,t){if(null!=t)return this.Where(t).FirstOrDefault(n);var e,r=!1;return this.ForEach(function(n){return e=n,r=!0,!1}),r?e:n},Last:function(n){if(null!=n)return this.Where(n).Last();var t,e=!1;if(this.ForEach(function(n){e=!0,t=n}),!e)throw new Error("Last:No element satisfies the condition.");return t},LastOrDefault:function(n,t){if(null!=t)return this.Where(t).LastOrDefault(n);var e,r=!1;return this.ForEach(function(n){r=!0,e=n}),r?e:n},Single:function(n){if(null!=n)return this.Where(n).Single();var t,e=!1;if(this.ForEach(function(n){if(e)throw new Error("Single:sequence contains more than one element.");e=!0,t=n}),!e)throw new Error("Single:No element satisfies the condition.");return t},SingleOrDefault:function(n,t){if(null!=t)return this.Where(t).SingleOrDefault(n);var e,r=!1;return this.ForEach(function(n){if(r)throw new Error("Single:sequence contains more than one element.");r=!0,e=n}),r?e:n},Skip:function(t){var e=this;return new n(function(){var n,i=0;return new u(function(){for(n=e.GetEnumerator();i++<t&&n.MoveNext(););},function(){return!!n.MoveNext()&&this.Yield(n.Current())},function(){r.Dispose(n)})})},SkipWhile:function(t){t=r.CreateLambda(t);var e=this;return new n(function(){var n,i=0,o=!1;return new u(function(){n=e.GetEnumerator()},function(){for(;!o;){if(!n.MoveNext())return!1;if(!t(n.Current(),i++))return o=!0,this.Yield(n.Current())}return!!n.MoveNext()&&this.Yield(n.Current())},function(){r.Dispose(n)})})},Take:function(t){var e=this;return new n(function(){var n,i=0;return new u(function(){n=e.GetEnumerator()},function(){return!!(i++<t&&n.MoveNext())&&this.Yield(n.Current())},function(){r.Dispose(n)})})},TakeWhile:function(t){t=r.CreateLambda(t);var e=this;return new n(function(){var n,i=0;return new u(function(){n=e.GetEnumerator()},function(){return!(!n.MoveNext()||!t(n.Current(),i++))&&this.Yield(n.Current())},function(){r.Dispose(n)})})},TakeExceptLast:function(t){null==t&&(t=1);var e=this;return new n(function(){if(t<=0)return e.GetEnumerator();var n,i=[];return new u(function(){n=e.GetEnumerator()},function(){for(;n.MoveNext();){if(i.length==t)return i.push(n.Current()),this.Yield(i.shift());i.push(n.Current())}return!1},function(){r.Dispose(n)})})},TakeFromLast:function(t){if(t<=0||null==t)return n.Empty();var e=this;return new n(function(){var i,o,a=[];return new u(function(){i=e.GetEnumerator()},function(){for(;i.MoveNext();)a.length==t&&a.shift(),a.push(i.Current());return null==o&&(o=n.From(a).GetEnumerator()),!!o.MoveNext()&&this.Yield(o.Current())},function(){r.Dispose(o)})})},IndexOf:function(n){var t=null;return this.ForEach(function(e,r){if(e===n)return t=r,!0}),null!==t?t:-1},LastIndexOf:function(n){var t=-1;return this.ForEach(function(e,r){e===n&&(t=r)}),t},ToArray:function(){var n=[];return this.ForEach(function(t){n.push(t)}),n},ToLookup:function(n,t,e){n=r.CreateLambda(n),t=r.CreateLambda(t),e=r.CreateLambda(e);var i=new s(e);return this.ForEach(function(e){var r=n(e),u=t(e),o=i.Get(r);void 0!==o?o.push(u):i.Add(r,[u])}),new l(i)},ToObject:function(n,t){n=r.CreateLambda(n),t=r.CreateLambda(t);var e={};return this.ForEach(function(r){e[n(r)]=t(r)}),e},ToDictionary:function(n,t,e){n=r.CreateLambda(n),t=r.CreateLambda(t),e=r.CreateLambda(e);var i=new s(e);return this.ForEach(function(e){i.Add(n(e),t(e))}),i},ToJSON:function(n,t){return JSON.stringify(this.ToArray(),n,t)},ToString:function(n,e){return null==n&&(n=""),null==e&&(e=t.Identity),this.Select(e).ToArray().join(n)},Do:function(t){var e=this;return t=r.CreateLambda(t),new n(function(){var n,i=0;return new u(function(){n=e.GetEnumerator()},function(){return!!n.MoveNext()&&(t(n.Current(),i++),this.Yield(n.Current()))},function(){r.Dispose(n)})})},ForEach:function(n){n=r.CreateLambda(n);var t=0,e=this.GetEnumerator();try{for(;e.MoveNext()&&!1!==n(e.Current(),t++););}finally{r.Dispose(e)}},Write:function(n,t){null==n&&(n=""),t=r.CreateLambda(t);var e=!0;this.ForEach(function(r){e?e=!1:document.write(n),document.write(t(r))})},WriteLine:function(n){n=r.CreateLambda(n),this.ForEach(function(t){document.write(n(t)),document.write("<br />")})},Force:function(){var n=this.GetEnumerator();try{for(;n.MoveNext(););}finally{r.Dispose(n)}},Let:function(t){t=r.CreateLambda(t);var e=this;return new n(function(){var i;return new u(function(){i=n.From(t(e)).GetEnumerator()},function(){return!!i.MoveNext()&&this.Yield(i.Current())},function(){r.Dispose(i)})})},Share:function(){var e,r=this;return new n(function(){return new u(function(){null==e&&(e=r.GetEnumerator())},function(){return!!e.MoveNext()&&this.Yield(e.Current())},t.Blank)})},MemoizeAll:function(){var e,r,i=this;return new n(function(){var n=-1;return new u(function(){null==r&&(r=i.GetEnumerator(),e=[])},function(){return n++,e.length<=n?!!r.MoveNext()&&this.Yield(e[n]=r.Current()):this.Yield(e[n])},t.Blank)})},Catch:function(t){t=r.CreateLambda(t);var e=this;return new n(function(){var n;return new u(function(){n=e.GetEnumerator()},function(){try{return!!n.MoveNext()&&this.Yield(n.Current())}catch(n){return t(n),!1}},function(){r.Dispose(n)})})},Finally:function(t){t=r.CreateLambda(t);var e=this;return new n(function(){var n;return new u(function(){n=e.GetEnumerator()},function(){return!!n.MoveNext()&&this.Yield(n.Current())},function(){try{r.Dispose(n)}finally{t()}})})},Trace:function(n,t){return null==n&&(n="Trace"),t=r.CreateLambda(t),this.Do(function(e){console.log(n,":",t(e))})}};var t={Identity:function(n){return n},True:function(){return!0},Blank:function(){}},e={Boolean:typeof!0,Number:"number",String:"string",Object:typeof{},Undefined:"undefined",Function:"function"},r={CreateLambda:function(n){if(null==n)return t.Identity;if(typeof n==e.String){if(""==n)return t.Identity;if(-1==n.indexOf("=>"))return new Function("$,$$,$$$,$$$$","return "+n);var r=n.match(/^[(\s]*([^()]*?)[)\s]*=>(.*)/);return new Function(r[1],"return "+r[2])}return n},IsIEnumerable:function(n){if(typeof Enumerator!=e.Undefined)try{return new Enumerator(n),!0}catch(n){}return!1},Compare:function(n,t){return n===t?0:n>t?1:-1},Dispose:function(n){null!=n&&n.Dispose()}},i={Before:0,Running:1,After:2},u=function(n,t,e){var r=new o,u=i.Before;this.Current=r.Current,this.MoveNext=function(){try{switch(u){case i.Before:u=i.Running,n();case i.Running:return!!t.apply(r)||(this.Dispose(),!1);case i.After:return!1}}catch(n){throw this.Dispose(),n}},this.Dispose=function(){if(u==i.Running)try{e()}finally{u=i.After}}},o=function(){var n=null;this.Current=function(){return n},this.Yield=function(t){return n=t,!0}},a=function(n,t,e,i){this.source=n,this.keySelector=r.CreateLambda(t),this.descending=e,this.parent=i};a.prototype=new n,a.prototype.CreateOrderedEnumerable=function(n,t){return new a(this.source,n,t,this)},a.prototype.ThenBy=function(n){return this.CreateOrderedEnumerable(n,!1)},a.prototype.ThenByDescending=function(n){return this.CreateOrderedEnumerable(n,!0)},a.prototype.GetEnumerator=function(){var n,e,r=this,i=0;return new u(function(){n=[],e=[],r.source.ForEach(function(t,r){n.push(t),e.push(r)});var t=c.Create(r,null);t.GenerateKeys(n),e.sort(function(n,e){return t.Compare(n,e)})},function(){return i<e.length&&this.Yield(n[e[i++]])},t.Blank)};var c=function(n,t,e){this.keySelector=n,this.descending=t,this.child=e,this.keys=null};c.Create=function(n,t){var e=new c(n.keySelector,n.descending,t);return null!=n.parent?c.Create(n.parent,e):e},c.prototype.GenerateKeys=function(n){for(var t=n.length,e=this.keySelector,r=new Array(t),i=0;i<t;i++)r[i]=e(n[i]);this.keys=r,null!=this.child&&this.child.GenerateKeys(n)},c.prototype.Compare=function(n,t){var e=r.Compare(this.keys[n],this.keys[t]);if(0==e){if(null!=this.child)return this.child.Compare(n,t);e=r.Compare(n,t)}return this.descending?-e:e};var f=function(n){this.source=n};f.prototype=new n,f.prototype.Any=function(t){return null==t?this.source.length>0:n.prototype.Any.apply(this,arguments)},f.prototype.Count=function(t){return null==t?this.source.length:n.prototype.Count.apply(this,arguments)},f.prototype.ElementAt=function(t){return 0<=t&&t<this.source.length?this.source[t]:n.prototype.ElementAt.apply(this,arguments)},f.prototype.ElementAtOrDefault=function(n,t){return 0<=n&&n<this.source.length?this.source[n]:t},f.prototype.First=function(t){return null==t&&this.source.length>0?this.source[0]:n.prototype.First.apply(this,arguments)},f.prototype.FirstOrDefault=function(t,e){return null!=e?n.prototype.FirstOrDefault.apply(this,arguments):this.source.length>0?this.source[0]:t},f.prototype.Last=function(t){return null==t&&this.source.length>0?this.source[this.source.length-1]:n.prototype.Last.apply(this,arguments)},f.prototype.LastOrDefault=function(t,e){return null!=e?n.prototype.LastOrDefault.apply(this,arguments):this.source.length>0?this.source[this.source.length-1]:t},f.prototype.Skip=function(e){var r=this.source;return new n(function(){var n;return new u(function(){n=e<0?0:e},function(){return n<r.length&&this.Yield(r[n++])},t.Blank)})},f.prototype.TakeExceptLast=function(n){return null==n&&(n=1),this.Take(this.source.length-n)},f.prototype.TakeFromLast=function(n){return this.Skip(this.source.length-n)},f.prototype.Reverse=function(){var e=this.source;return new n(function(){var n;return new u(function(){n=e.length},function(){return n>0&&this.Yield(e[--n])},t.Blank)})},f.prototype.SequenceEqual=function(t,e){return(!(t instanceof f||t instanceof Array)||null!=e||n.From(t).Count()==this.Count())&&n.prototype.SequenceEqual.apply(this,arguments)},f.prototype.ToString=function(t,e){return null==e&&this.source instanceof Array?(null==t&&(t=""),this.source.join(t)):n.prototype.ToString.apply(this,arguments)},f.prototype.GetEnumerator=function(){var n=this.source,e=0;return new u(t.Blank,function(){return e<n.length&&this.Yield(n[e++])},t.Blank)};var s=function(){var r=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},i=function(n){return null===n?"null":void 0===n?"undefined":typeof n.toString===e.Function?n.toString():Object.prototype.toString.call(n)},o=function(n,t){this.Key=n,this.Value=t,this.Prev=null,this.Next=null},a=function(){this.First=null,this.Last=null};a.prototype={AddLast:function(n){null!=this.Last?(this.Last.Next=n,n.Prev=this.Last,this.Last=n):this.First=this.Last=n},Replace:function(n,t){null!=n.Prev?(n.Prev.Next=t,t.Prev=n.Prev):this.First=t,null!=n.Next?(n.Next.Prev=t,t.Next=n.Next):this.Last=t},Remove:function(n){null!=n.Prev?n.Prev.Next=n.Next:this.First=n.Next,null!=n.Next?n.Next.Prev=n.Prev:this.Last=n.Prev}};var c=function(n){this.count=0,this.entryList=new a,this.buckets={},this.compareSelector=null==n?t.Identity:n};return c.prototype={Add:function(n,t){var e=this.compareSelector(n),u=i(e),a=new o(n,t);if(r(this.buckets,u)){for(var c=this.buckets[u],f=0;f<c.length;f++)if(this.compareSelector(c[f].Key)===e)return this.entryList.Replace(c[f],a),void(c[f]=a);c.push(a)}else this.buckets[u]=[a];this.count++,this.entryList.AddLast(a)},Get:function(n){var t=this.compareSelector(n),e=i(t);if(r(this.buckets,e))for(var u=this.buckets[e],o=0;o<u.length;o++){var a=u[o];if(this.compareSelector(a.Key)===t)return a.Value}},Set:function(n,t){var e=this.compareSelector(n),u=i(e);if(r(this.buckets,u))for(var a=this.buckets[u],c=0;c<a.length;c++)if(this.compareSelector(a[c].Key)===e){var f=new o(n,t);return this.entryList.Replace(a[c],f),a[c]=f,!0}return!1},Contains:function(n){var t=this.compareSelector(n),e=i(t);if(!r(this.buckets,e))return!1;for(var u=this.buckets[e],o=0;o<u.length;o++)if(this.compareSelector(u[o].Key)===t)return!0;return!1},Clear:function(){this.count=0,this.buckets={},this.entryList=new a},Remove:function(n){var t=this.compareSelector(n),e=i(t);if(r(this.buckets,e))for(var u=this.buckets[e],o=0;o<u.length;o++)if(this.compareSelector(u[o].Key)===t)return this.entryList.Remove(u[o]),u.splice(o,1),0==u.length&&delete this.buckets[e],void this.count--},Count:function(){return this.count},ToEnumerable:function(){var e=this;return new n(function(){var n;return new u(function(){n=e.entryList.First},function(){if(null!=n){var t={Key:n.Key,Value:n.Value};return n=n.Next,this.Yield(t)}return!1},t.Blank)})}},c}(),l=function(t){this.Count=function(){return t.Count()},this.Get=function(e){return n.From(t.Get(e))},this.Contains=function(n){return t.Contains(n)},this.ToEnumerable=function(){return t.ToEnumerable().Select(function(n){return new h(n.Key,n.Value)})}},h=function(n,t){this.Key=function(){return n},f.call(this,t)};return h.prototype=new f,n}}})}();;!function(){"use strict";angular.module("angularModalService",[]).factory("ModalService",["$document","$compile","$controller","$http","$rootScope","$q","$templateCache",function(e,n,l,o,t,r,c){var a=e.find("body");return new function(){this.showModal=function(e){var i=r.defer(),u=e.controller;return u?(e.controllerAs&&(u=u+" as "+e.controllerAs),function(e,n){var l=r.defer();if(e)l.resolve(e);else if(n){var t=c.get(n);void 0!==t?l.resolve(t):o({method:"GET",url:n,cache:!0}).then(function(e){c.put(n,e.data),l.resolve(e.data)},function(e){l.reject(e)})}else l.reject("No template or templateUrl has been specified.");return l.promise}(e.template,e.templateUrl).then(function(o){var c=t.$new(),s=r.defer(),p={$scope:c,close:function(e,n){void 0!==n&&null!==n||(n=0),window.setTimeout(function(){s.resolve(e),c.$destroy(),m.remove(),p.close=null,i=null,s=null,h=null,p=null,m=null,c=null},n)}};if(c.close=p.close,e.inputs)for(var d in e.inputs)c[d]=e.inputs[d];var f=angular.element(o),m=n(f)(c);p.$element=m;var v=l(u,p);e.appendElement?e.appendElement.append(m):a.append(m);var h={controller:v,scope:c,element:m,close:s.promise};i.resolve(h)}).then(null,function(e){i.reject(e)}),i.promise):(i.reject("No controller has been specified."),i.promise)}}}])}();;"format amd";!function(){"use strict";function e(e,t){return e.module("angularMoment",[]).constant("angularMomentConfig",{preprocess:null,timezone:"",format:null,statefulFilters:!0}).constant("moment",t).constant("amTimeAgoConfig",{withoutSuffix:!1,serverTime:null,titleFormat:null,fullDateThreshold:null,fullDateFormat:null}).directive("amTimeAgo",["$window","moment","amMoment","amTimeAgoConfig","angularMomentConfig",function(t,n,o,i,r){return function(a,u,l){function m(){var e;if(p)e=p;else if(i.serverTime){var t=(new Date).getTime()-F+i.serverTime;e=n(t)}else e=n();return e}function f(){g&&(t.clearTimeout(g),g=null)}function s(e){w&&u.attr("datetime",e)}function c(){if(f(),d){var e=o.preprocessDate(d,$,v);(function e(n){var o=m().diff(n,"day"),i=D&&o>=D;if(u.text(i?n.format(M):n.from(m(),h)),T&&!u.attr("title")&&u.attr("title",n.local().format(T)),!i){var r=Math.abs(m().diff(n,"minute")),a=3600;1>r?a=1:60>r?a=30:180>r&&(a=300),g=t.setTimeout(function(){e(n)},1e3*a)}})(e),s(e.toISOString())}}var d,p,g=null,v=r.format,h=i.withoutSuffix,T=i.titleFormat,D=i.fullDateThreshold,M=i.fullDateFormat,F=(new Date).getTime(),$=r.preprocess,z=l.amTimeAgo,w="TIME"===u[0].nodeName.toUpperCase();a.$watch(z,function(e){return void 0===e||null===e||""===e?(f(),void(d&&(u.text(""),s(""),d=null))):(d=e,void c())}),e.isDefined(l.amFrom)&&a.$watch(l.amFrom,function(e){p=void 0===e||null===e||""===e?null:n(e),c()}),e.isDefined(l.amWithoutSuffix)&&a.$watch(l.amWithoutSuffix,function(e){"boolean"==typeof e?(h=e,c()):h=i.withoutSuffix}),l.$observe("amFormat",function(e){void 0!==e&&(v=e,c())}),l.$observe("amPreprocess",function(e){$=e,c()}),l.$observe("amFullDateThreshold",function(e){D=e,c()}),l.$observe("amFullDateFormat",function(e){M=e,c()}),a.$on("$destroy",function(){f()}),a.$on("amMoment:localeChanged",function(){c()})}}]).service("amMoment",["moment","$rootScope","$log","angularMomentConfig",function(t,n,o,i){this.preprocessors={utc:t.utc,unix:t.unix},this.changeLocale=function(o,i){var r=t.locale(o,i);return e.isDefined(o)&&n.$broadcast("amMoment:localeChanged"),r},this.changeTimezone=function(e){i.timezone=e,n.$broadcast("amMoment:timezoneChanged")},this.preprocessDate=function(n,r,a){return e.isUndefined(r)&&(r=i.preprocess),this.preprocessors[r]?this.preprocessors[r](n,a):(r&&o.warn("angular-moment: Ignoring unsupported value for preprocess: "+r),!isNaN(parseFloat(n))&&isFinite(n)?t(parseInt(n,10)):t(n,a))},this.applyTimezone=function(e,t){return(t=t||i.timezone)?(t.match(/Z|[+-]\d\d:?\d\d/gi)?e=e.utcOffset(t):e.tz?e=e.tz(t):o.warn("angular-moment: named timezone specified but moment.tz() is undefined. Did you forget to include moment-timezone.js?"),e):e}}]).filter("amCalendar",["moment","amMoment","angularMomentConfig",function(e,t,n){function o(n,o,i){if(void 0===n||null===n)return"";n=t.preprocessDate(n,o);var r=e(n);return r.isValid()?t.applyTimezone(r,i).calendar():""}return o.$stateful=n.statefulFilters,o}]).filter("amDifference",["moment","amMoment","angularMomentConfig",function(e,t,n){function o(n,o,i,r,a,u){if(void 0===n||null===n)return"";n=t.preprocessDate(n,a);var l,m=e(n);if(!m.isValid())return"";if(void 0===o||null===o)l=e();else if(o=t.preprocessDate(o,u),!(l=e(o)).isValid())return"";return t.applyTimezone(m).diff(t.applyTimezone(l),i,r)}return o.$stateful=n.statefulFilters,o}]).filter("amDateFormat",["moment","amMoment","angularMomentConfig",function(e,t,n){function o(o,i,r,a,u){var l=u||n.format;if(void 0===o||null===o)return"";o=t.preprocessDate(o,r,l);var m=e(o);return m.isValid()?t.applyTimezone(m,a).format(i):""}return o.$stateful=n.statefulFilters,o}]).filter("amDurationFormat",["moment","angularMomentConfig",function(e,t){function n(t,n,o){return void 0===t||null===t?"":e.duration(t,n).humanize(o)}return n.$stateful=t.statefulFilters,n}]).filter("amTimeAgo",["moment","amMoment","angularMomentConfig",function(e,t,n){function o(n,o,i,r){var a,u;return void 0===n||null===n?"":(n=t.preprocessDate(n,o),(a=e(n)).isValid()?(u=e(r),void 0!==r&&u.isValid()?t.applyTimezone(a).from(u,i):t.applyTimezone(a).fromNow(i)):"")}return o.$stateful=n.statefulFilters,o}])}"function"==typeof define&&define.amd?define(["angular","moment"],e):"undefined"!=typeof module&&module&&module.exports?(e(angular,require("moment")),module.exports="angularMoment"):e(angular,("undefined"!=typeof global?global:window).moment)}();;!function(e,n){n.module("nemLogging",[]),n.module("nemLogging").provider("nemDebug",function(){var n=null;return function(n){var r=e.debug;!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{(void 0!==e?e:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).debug=n()}}(function(){return function e(n,r,o){function t(i,u){if(!r[i]){if(!n[i]){var c="function"==typeof require&&require;if(!u&&c)return c(i,!0);if(s)return s(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var l=r[i]={exports:{}};n[i][0].call(l.exports,function(e){var r=n[i][1][e];return t(r||e)},l,l.exports,e,n,r,o)}return r[i].exports}for(var s="function"==typeof require&&require,i=0;i<o.length;i++)t(o[i]);return t}({1:[function(e,n,r){(r=n.exports=function(e){function n(){}function s(){var e=s,n=+new Date,i=n-(o||n);e.diff=i,e.prev=o,e.curr=n,o=n,null==e.useColors&&(e.useColors=r.useColors()),null==e.color&&e.useColors&&(e.color=r.colors[t++%r.colors.length]);var u=Array.prototype.slice.call(arguments);u[0]=r.coerce(u[0]),"string"!=typeof u[0]&&(u=["%o"].concat(u));var c=0;u[0]=u[0].replace(/%([a-z%])/g,function(n,o){if("%%"===n)return n;c++;var t=r.formatters[o];if("function"==typeof t){var s=u[c];n=t.call(e,s),u.splice(c,1),c--}return n}),"function"==typeof r.formatArgs&&(u=r.formatArgs.apply(e,u));var a=s.log||r.log||console.log.bind(console);a.apply(e,u)}n.enabled=!1,s.enabled=!0;var i=r.enabled(e)?s:n;return i.namespace=e,i}).coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){r.enable("")},r.enable=function(e){r.save(e);for(var n=(e||"").split(/[\s,]+/),o=n.length,t=0;t<o;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")))},r.enabled=function(e){var n,o;for(n=0,o=r.skips.length;n<o;n++)if(r.skips[n].test(e))return!1;for(n=0,o=r.names.length;n<o;n++)if(r.names[n].test(e))return!0;return!1},r.humanize=e("ms"),r.names=[],r.skips=[],r.formatters={};var o,t=0},{ms:2}],2:[function(e,n,r){var o=1e3,t=60*o,s=60*t,i=24*s,u=365.25*i;function c(e,n,r){if(!(e<n))return e<1.5*n?Math.floor(e/n)+" "+r:Math.ceil(e/n)+" "+r+"s"}n.exports=function(e,n){return n=n||{},"string"==typeof e?function(e){var n=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!n)return;var r=parseFloat(n[1]);switch((n[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*u;case"days":case"day":case"d":return r*i;case"hours":case"hour":case"hrs":case"hr":case"h":return r*s;case"minutes":case"minute":case"mins":case"min":case"m":return r*t;case"seconds":case"second":case"secs":case"sec":case"s":return r*o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}(e):n.long?c(r=e,i,"day")||c(r,s,"hour")||c(r,t,"minute")||c(r,o,"second")||r+" ms":function(e){return e>=i?Math.round(e/i)+"d":e>=s?Math.round(e/s)+"h":e>=t?Math.round(e/t)+"m":e>=o?Math.round(e/o)+"s":e+"ms"}(e);var r}},{}],3:[function(n,r,o){var t;function s(){var e;try{e=t.debug}catch(e){}return e}(o=r.exports=n("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},o.formatArgs=function(){var e=arguments,n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+o.humanize(this.diff),!n)return e;var r="color: "+this.color,t=0,s=0;return(e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1)))[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&"%c"===e&&(s=++t)}),e.splice(s,0,r),e},o.save=function(e){try{null==e?t.removeItem("debug"):t.debug=e}catch(e){}},o.load=s,o.useColors=function(){return"WebkitAppearance"in document.documentElement.style||e.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31},t="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return e.localStorage}catch(e){}}(),o.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],o.formatters.j=function(e){return JSON.stringify(e)},o.enable(s())},{"./debug":1}]},{},[3])(3)});var o=e.debug;e.debug=r,n(o)}(function(e){n=e}),this.$get=function(){return n},this.debug=n,this});var r=function(e,n){return function(){return e.apply(n,arguments)}};n.module("nemLogging").provider("nemSimpleLogger",["nemDebugProvider",function(e){var n,o,t,s,i,u,c,a,l;for(c in a=e.debug,n={},t=["debug","info","warn","error","log"])l=t[c],n[l]=c;return i=function(e,n,r){if(e>=n)return r()},s=function(e){var n;if(n=!1,!e)return n;for(c in t)if(!(n=null!=e[l=t[c]]&&"function"==typeof e[l]))break;return n},u=function(e,n){var r,o;for(c in r=a(e),o={},t)o[l=t[c]]="debug"===l?r:n[l];return o},o=function(){function e(e){var o,u;if(this.$log=e,this.spawn=r(this.spawn,this),!this.$log)throw"internalLogger undefined";if(!s(this.$log))throw"@$log is invalid";this.doLog=!0,o={},t.forEach((u=this,function(e){return o[e]=function(r){if(u.doLog)return i(n[e],u.currentLevel,function(){return u.$log[e](r)})}})),this.LEVELS=n,this.currentLevel=n.error,t.forEach(function(e){return function(n){return e[n]=o[n]}}(this))}return e.prototype.spawn=function(n){if("string"==typeof n){if(!s(this.$log))throw"@$log is invalid";if(!a)throw"nemDebug is undefined this is probably the light version of this library sep debug logggers is not supported!";return u(n,this.$log)}return new e(n||this.$log)},e}(),this.decorator=["$log",function(e){var r;return(r=new o(e)).currentLevel=n.debug,r}],this.$get=["$log",function(e){return new o(e)}],this}])}(window,angular);;!function(e,n){n.module("nemLogging",[]),n.module("nemLogging").provider("nemDebug",function(){var n=null;return function(n){var r=e.debug;!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{(void 0!==e?e:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).debug=n()}}(function(){return function e(n,r,o){function t(i,u){if(!r[i]){if(!n[i]){var c="function"==typeof require&&require;if(!u&&c)return c(i,!0);if(s)return s(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var l=r[i]={exports:{}};n[i][0].call(l.exports,function(e){var r=n[i][1][e];return t(r||e)},l,l.exports,e,n,r,o)}return r[i].exports}for(var s="function"==typeof require&&require,i=0;i<o.length;i++)t(o[i]);return t}({1:[function(e,n,r){(r=n.exports=function(e){function n(){}function s(){var e=s,n=+new Date,i=n-(o||n);e.diff=i,e.prev=o,e.curr=n,o=n,null==e.useColors&&(e.useColors=r.useColors()),null==e.color&&e.useColors&&(e.color=r.colors[t++%r.colors.length]);var u=Array.prototype.slice.call(arguments);u[0]=r.coerce(u[0]),"string"!=typeof u[0]&&(u=["%o"].concat(u));var c=0;u[0]=u[0].replace(/%([a-z%])/g,function(n,o){if("%%"===n)return n;c++;var t=r.formatters[o];if("function"==typeof t){var s=u[c];n=t.call(e,s),u.splice(c,1),c--}return n}),"function"==typeof r.formatArgs&&(u=r.formatArgs.apply(e,u));var a=s.log||r.log||console.log.bind(console);a.apply(e,u)}n.enabled=!1,s.enabled=!0;var i=r.enabled(e)?s:n;return i.namespace=e,i}).coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){r.enable("")},r.enable=function(e){r.save(e);for(var n=(e||"").split(/[\s,]+/),o=n.length,t=0;t<o;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")))},r.enabled=function(e){var n,o;for(n=0,o=r.skips.length;n<o;n++)if(r.skips[n].test(e))return!1;for(n=0,o=r.names.length;n<o;n++)if(r.names[n].test(e))return!0;return!1},r.humanize=e("ms"),r.names=[],r.skips=[],r.formatters={};var o,t=0},{ms:2}],2:[function(e,n,r){var o=1e3,t=60*o,s=60*t,i=24*s,u=365.25*i;function c(e,n,r){if(!(e<n))return e<1.5*n?Math.floor(e/n)+" "+r:Math.ceil(e/n)+" "+r+"s"}n.exports=function(e,n){return n=n||{},"string"==typeof e?function(e){var n=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!n)return;var r=parseFloat(n[1]);switch((n[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*u;case"days":case"day":case"d":return r*i;case"hours":case"hour":case"hrs":case"hr":case"h":return r*s;case"minutes":case"minute":case"mins":case"min":case"m":return r*t;case"seconds":case"second":case"secs":case"sec":case"s":return r*o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}(e):n.long?c(r=e,i,"day")||c(r,s,"hour")||c(r,t,"minute")||c(r,o,"second")||r+" ms":function(e){return e>=i?Math.round(e/i)+"d":e>=s?Math.round(e/s)+"h":e>=t?Math.round(e/t)+"m":e>=o?Math.round(e/o)+"s":e+"ms"}(e);var r}},{}],3:[function(n,r,o){var t;function s(){var e;try{e=t.debug}catch(e){}return e}(o=r.exports=n("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},o.formatArgs=function(){var e=arguments,n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+o.humanize(this.diff),!n)return e;var r="color: "+this.color,t=0,s=0;return(e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1)))[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&"%c"===e&&(s=++t)}),e.splice(s,0,r),e},o.save=function(e){try{null==e?t.removeItem("debug"):t.debug=e}catch(e){}},o.load=s,o.useColors=function(){return"WebkitAppearance"in document.documentElement.style||e.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31},t="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return e.localStorage}catch(e){}}(),o.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],o.formatters.j=function(e){return JSON.stringify(e)},o.enable(s())},{"./debug":1}]},{},[3])(3)});var o=e.debug;e.debug=r,n(o)}(function(e){n=e}),this.$get=function(){return n},this.debug=n,this});var r=function(e,n){return function(){return e.apply(n,arguments)}};n.module("nemLogging").provider("nemSimpleLogger",["nemDebugProvider",function(e){var n,o,t,s,i,u,c,a,l;for(c in a=e.debug,n={},t=["debug","info","warn","error","log"])l=t[c],n[l]=c;return i=function(e,n,r){if(e>=n)return r()},s=function(e){var n;if(n=!1,!e)return n;for(c in t)if(!(n=null!=e[l=t[c]]&&"function"==typeof e[l]))break;return n},u=function(e,n){var r,o;for(c in r=a(e),o={},t)o[l=t[c]]="debug"===l?r:n[l];return o},o=function(){function e(e){var o,u;if(this.$log=e,this.spawn=r(this.spawn,this),!this.$log)throw"internalLogger undefined";if(!s(this.$log))throw"@$log is invalid";this.doLog=!0,o={},t.forEach((u=this,function(e){return o[e]=function(r){if(u.doLog)return i(n[e],u.currentLevel,function(){return u.$log[e](r)})}})),this.LEVELS=n,this.currentLevel=n.error,t.forEach(function(e){return function(n){return e[n]=o[n]}}(this))}return e.prototype.spawn=function(n){if("string"==typeof n){if(!s(this.$log))throw"@$log is invalid";if(!a)throw"nemDebug is undefined this is probably the light version of this library sep debug logggers is not supported!";return u(n,this.$log)}return new e(n||this.$log)},e}(),this.decorator=["$log",function(e){var r;return(r=new o(e)).currentLevel=n.debug,r}],this.$get=["$log",function(e){return new o(e)}],this}])}(window,angular);;angular.module("ui-notification",[]),angular.module("ui-notification").provider("Notification",function(){this.options={delay:5e3,startTop:10,startRight:10,verticalSpacing:10,horizontalSpacing:10,positionX:"right",positionY:"top",replaceMessage:!1,templateUrl:"angular-ui-notification.html"},this.setOptions=function(t){if(!angular.isObject(t))throw new Error("Options should be an object!");this.options=angular.extend({},this.options,t)},this.$get=["$timeout","$http","$compile","$templateCache","$rootScope","$injector","$sce","$q","$window",function(t,e,i,n,o,s,a,r,l){var p=this.options,c=p.startTop,u=p.startRight,d=p.verticalSpacing,m=p.horizontalSpacing,g=p.delay,f=[],h=!1,v=function(s,v){var y=r.defer();return"object"!=typeof s&&(s={message:s}),s.scope=s.scope?s.scope:o,s.template=s.templateUrl?s.templateUrl:p.templateUrl,s.delay=angular.isUndefined(s.delay)?g:s.delay,s.type=v||"",s.positionY=s.positionY?s.positionY:p.positionY,s.positionX=s.positionX?s.positionX:p.positionX,s.replaceMessage=s.replaceMessage?s.replaceMessage:p.replaceMessage,e.get(s.template,{cache:n}).success(function(e){var n=s.scope.$new();n.message=a.trustAsHtml(s.message),n.title=a.trustAsHtml(s.title),n.t=s.type.substr(0,1),n.delay=s.delay;var o=function(){for(var t=0,e=0,i=u,n=[],o=f.length-1;o>=0;o--){var a=f[o];if(s.replaceMessage&&o<f.length-1)a.addClass("killed");else{var r=parseInt(a[0].offsetHeight),l=parseInt(a[0].offsetWidth),p=n[a._positionY+a._positionX];g+r>window.innerHeight&&(p=c,e++,t=0);var g=p?0===t?p:p+d:c,h=i+e*(m+l);a.css(a._positionY,g+"px"),"center"==a._positionX?a.css("left",parseInt(window.innerWidth/2-l/2)+"px"):a.css(a._positionX,h+"px"),n[a._positionY+a._positionX]=g+r,t++}}},r=i(e)(n);r._positionY=s.positionY,r._positionX=s.positionX,r.addClass(s.type),r.bind("webkitTransitionEnd oTransitionEnd otransitionend transitionend msTransitionEnd click",function(t){("click"===(t=t.originalEvent||t).type||"opacity"===t.propertyName&&t.elapsedTime>=1)&&(r.remove(),f.splice(f.indexOf(r),1),o())}),angular.isNumber(s.delay)&&t(function(){r.addClass("killed")},s.delay),angular.element(document.getElementsByTagName("body")).append(r);var p=-(parseInt(r[0].offsetHeight)+50);r.css(r._positionY,p+"px"),f.push(r),n._templateElement=r,n.kill=function(e){e?(f.splice(f.indexOf(n._templateElement),1),n._templateElement.remove(),t(o)):n._templateElement.addClass("killed")},t(o),h||(angular.element(l).bind("resize",function(){t(o)}),h=!0),y.resolve(n)}).error(function(t){throw new Error("Template ("+s.template+") could not be loaded. "+t)}),y.promise};return v.primary=function(t){return this(t,"primary")},v.error=function(t){return this(t,"error")},v.success=function(t){return this(t,"success")},v.info=function(t){return this(t,"info")},v.warning=function(t){return this(t,"warning")},v.clearAll=function(){angular.forEach(f,function(t){t.addClass("killed")})},v}]}),angular.module("ui-notification").run(["$templateCache",function(t){t.put("angular-ui-notification.html",'<div class="ui-notification"><h3 ng-show="title" ng-bind-html="title"></h3><div class="message" ng-bind-html="message"></div></div>')}]);;"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(e,t,r){"use strict";var n,i=t.isDefined,a=t.isFunction,o=t.isString,u=t.isObject,s=t.isArray,l=t.forEach,c=t.extend,f=t.copy;function p(e,t){return c(new(c(function(){},{prototype:e})),t)}function h(e){return l(arguments,function(t){t!==e&&l(t,function(t,r){e.hasOwnProperty(r)||(e[r]=t)})}),e}function v(e){if(Object.keys)return Object.keys(e);var r=[];return t.forEach(e,function(e,t){r.push(t)}),r}function $(e,t){if(Array.prototype.indexOf)return e.indexOf(t,Number(arguments[2])||0);var r=e.length>>>0,n=Number(arguments[2])||0;for((n=n<0?Math.ceil(n):Math.floor(n))<0&&(n+=r);n<r;n++)if(n in e&&e[n]===t)return n;return-1}function d(e,t,r,n){var i,a=function(e,t){var r=[];for(var n in e.path){if(e.path[n]!==t.path[n])break;r.push(e.path[n])}return r}(r,n),o={},u=[];for(var s in a)if(a[s].params&&(i=v(a[s].params)).length)for(var l in i)$(u,i[l])>=0||(u.push(i[l]),o[i[l]]=e[i[l]]);return c({},o,t)}function m(e,t,r){if(!r)for(var n in r=[],e)r.push(n);for(var i=0;i<r.length;i++){var a=r[i];if(e[a]!=t[a])return!1}return!0}function g(e,t){var r={};return l(e,function(e){r[e]=t[e]}),r}function w(e){var t={},r=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));for(var n in e)-1==$(r,n)&&(t[n]=e[n]);return t}function y(e,t){var r=s(e),n=r?[]:{};return l(e,function(e,i){t(e,i)&&(n[r?n.length:i]=e)}),n}function b(e,t){var r=s(e)?[]:{};return l(e,function(e,n){r[n]=t(e,n)}),r}function E(e,t){var n=1,a=2,s={},f=[],p=s,d=c(e.when(s),{$$promises:s,$$values:s});this.study=function(s){if(!u(s))throw new Error("'invocables' must be an object");var m=v(s||{}),g=[],y=[],b={};function E(e){return u(e)&&e.then&&e.$$promises}return l(s,function e(r,i){if(b[i]!==a){if(y.push(i),b[i]===n)throw y.splice(0,$(y,i)),new Error("Cyclic dependency: "+y.join(" -> "));if(b[i]=n,o(r))g.push(i,[function(){return t.get(r)}],f);else{var u=t.annotate(r);l(u,function(t){t!==i&&s.hasOwnProperty(t)&&e(s[t],t)}),g.push(i,r,u)}y.pop(),b[i]=a}}),s=y=b=null,function(n,a,o){if(E(n)&&o===r&&(o=a,a=n,n=null),n){if(!u(n))throw new Error("'locals' must be an object")}else n=p;if(a){if(!E(a))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else a=d;var s=e.defer(),f=s.promise,v=f.$$promises={},$=c({},n),y=1+g.length/3,b=!1;function S(){--y||(b||h($,a.$$values),f.$$values=$,f.$$promises=f.$$promises||!0,delete f.$$inheritedValues,s.resolve($))}function x(e){f.$$failure=e,s.reject(e)}if(i(a.$$failure))return x(a.$$failure),f;a.$$inheritedValues&&h($,w(a.$$inheritedValues,m)),c(v,a.$$promises),a.$$values?(b=h($,w(a.$$values,m)),f.$$inheritedValues=w(a.$$values,m),S()):(a.$$inheritedValues&&(f.$$inheritedValues=w(a.$$inheritedValues,m)),a.then(S,x));for(var P=0,j=g.length;P<j;P+=3)n.hasOwnProperty(g[P])?S():O(g[P],g[P+1],g[P+2]);function O(r,a,u){var s=e.defer(),c=0;function p(e){s.reject(e),x(e)}function h(){if(!i(f.$$failure))try{s.resolve(t.invoke(a,o,$)),s.promise.then(function(e){$[r]=e,S()},p)}catch(e){p(e)}}l(u,function(e){v.hasOwnProperty(e)&&!n.hasOwnProperty(e)&&(c++,v[e].then(function(t){$[e]=t,--c||h()},p))}),c||h(),v[r]=s.promise}return f}},this.resolve=function(e,t,r,n){return this.study(e)(t,r,n)}}function S(e,t,r){this.fromConfig=function(e,t,r){return i(e.template)?this.fromString(e.template,t):i(e.templateUrl)?this.fromUrl(e.templateUrl,t):i(e.templateProvider)?this.fromProvider(e.templateProvider,t,r):null},this.fromString=function(e,t){return a(e)?e(t):e},this.fromUrl=function(r,n){return a(r)&&(r=r(n)),null==r?null:e.get(r,{cache:t,headers:{Accept:"text/html"}}).then(function(e){return e.data})},this.fromProvider=function(e,t,n){return r.invoke(e,null,n||{params:t})}}function x(e,t,i){t=c({params:{}},u(t)?t:{});var a,o,s,l,f=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,h=/([:]?)([\w\[\]-]+)|\{([\w\[\]-]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,v="^",$=0,d=this.segments=[],m=i?i.params:{},g=this.params=i?i.params.$$new():new n.ParamSet,w=[];function y(t,r,i,a){if(w.push(t),m[t])return m[t];if(!/^\w+(-+\w+)*(?:\[\])?$/.test(t))throw new Error("Invalid parameter name '"+t+"' in pattern '"+e+"'");if(g[t])throw new Error("Duplicate parameter name '"+t+"' in pattern '"+e+"'");return g[t]=new n.Param(t,r,i,a),g[t]}function b(e,t,r){var n=["",""],i=e.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!t)return i;switch(r){case!1:n=["(",")"];break;case!0:n=["?(",")?"];break;default:n=["("+r+"|",")?"]}return i+n[0]+t+n[1]}function E(r,i){var a,o,u,s;return a=r[2]||r[3],s=t.params[a],u=e.substring($,r.index),{id:a,regexp:o=i?r[4]:r[4]||("*"==r[1]?".*":null),segment:u,type:n.type(o||"string")||p(n.type("string"),{pattern:new RegExp(o)}),cfg:s}}for(this.source=e;(a=f.exec(e))&&!((o=E(a,!1)).segment.indexOf("?")>=0);)s=y(o.id,o.type,o.cfg,"path"),v+=b(o.segment,s.type.pattern.source,s.squash),d.push(o.segment),$=f.lastIndex;var S=(l=e.substring($)).indexOf("?");if(S>=0){var x=this.sourceSearch=l.substring(S);if(l=l.substring(0,S),this.sourcePath=e.substring(0,$+S),x.length>0)for($=0;a=h.exec(x);)s=y((o=E(a,!0)).id,o.type,o.cfg,"search"),$=f.lastIndex}else this.sourcePath=e,this.sourceSearch="";v+=b(l)+(!1===t.strict?"/?":"")+"$",d.push(l),this.regexp=new RegExp(v,t.caseInsensitive?"i":r),this.prefix=d[0],this.$$paramNames=w}function P(e){c(this,e)}function j(e,n){var u,l=[],f=null,p=!1;function h(e,t,r){if(!r)return!1;var n=e.invoke(t,t,{$match:r});return!i(n)||n}function v(n,i,a,s){var c,h=s.baseHref(),v=n.url();function $(e){if(!e||!e.defaultPrevented){var t=c&&n.url()===c;if(c=r,t)return!0;var i,u=l.length;for(i=0;i<u;i++)if(s(l[i]))return;f&&s(f)}function s(e){var t=e(a,n);return!!t&&(o(t)&&n.replace().url(t),!0)}}function d(){return u=u||i.$on("$locationChangeSuccess",$)}return p||d(),{sync:function(){$()},listen:function(){return d()},update:function(e){e?v=n.url():n.url()!==v&&(n.url(v),n.replace())},push:function(e,t,i){n.url(e.format(t||{})),c=i&&i.$$avoidResync?n.url():r,i&&i.replace&&n.replace()},href:function(r,i,a){if(!r.validates(i))return null;var o=e.html5Mode();t.isObject(o)&&(o=o.enabled);var u=r.format(i);if(a=a||{},o||null===u||(u="#"+e.hashPrefix()+u),u=function(e,t,r){return"/"===h?e:t?h.slice(0,-1)+e:r?h.slice(1)+e:e}(u,o,a.absolute),!a.absolute||!u)return u;var s=!o&&u?"/":"",l=n.port();return l=80===l||443===l?"":":"+l,[n.protocol(),"://",n.host(),l,s,u].join("")}}}this.rule=function(e){if(!a(e))throw new Error("'rule' must be a function");return l.push(e),this},this.otherwise=function(e){if(o(e)){var t=e;e=function(){return t}}else if(!a(e))throw new Error("'rule' must be a function");return f=e,this},this.when=function(e,t){var r,i=o(t);if(o(e)&&(e=n.compile(e)),!i&&!a(t)&&!s(t))throw new Error("invalid 'handler' in when()");var u={matcher:function(e,t){return i&&(r=n.compile(t),t=["$match",function(e){return r.format(e)}]),c(function(r,n){return h(r,t,e.exec(n.path(),n.search()))},{prefix:o(e.prefix)?e.prefix:""})},regex:function(e,t){if(e.global||e.sticky)throw new Error("when() RegExp must not be global or sticky");return i&&(r=t,t=["$match",function(e){return t=e,r.replace(/\$(\$|\d{1,2})/,function(e,r){return t["$"===r?0:Number(r)]});var t}]),c(function(r,n){return h(r,t,e.exec(n.path()))},{prefix:(n=e,a=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(n.source),null!=a?a[1].replace(/\\(.)/g,"$1"):"")});var n,a}},l={matcher:n.isMatcher(e),regex:e instanceof RegExp};for(var f in l)if(l[f])return this.rule(u[f](e,t));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(e){e===r&&(e=!0),p=e},this.$get=v,v.$inject=["$location","$rootScope","$injector","$browser"]}function O(e,h){var w,y,E={},S={},x="abstract",P={parent:function(e){if(i(e.parent)&&e.parent)return j(e.parent);var t=/^(.+)\.[^.]+$/.exec(e.name);return t?j(t[1]):w},data:function(e){return e.parent&&e.parent.data&&(e.data=e.self.data=c({},e.parent.data,e.data)),e.data},url:function(e){var t=e.url,r={params:e.params||{}};if(o(t))return"^"==t.charAt(0)?h.compile(t.substring(1),r):(e.parent.navigable||w).url.concat(t,r);if(!t||h.isMatcher(t))return t;throw new Error("Invalid url '"+t+"' in state '"+e+"'")},navigable:function(e){return e.url?e:e.parent?e.parent.navigable:null},ownParams:function(e){var t=e.url&&e.url.params||new n.ParamSet;return l(e.params||{},function(e,r){t[r]||(t[r]=new n.Param(r,null,e,"config"))}),t},params:function(e){return e.parent&&e.parent.params?c(e.parent.params.$$new(),e.ownParams):new n.ParamSet},views:function(e){var t={};return l(i(e.views)?e.views:{"":e},function(r,n){n.indexOf("@")<0&&(n+="@"+e.parent.name),t[n]=r}),t},path:function(e){return e.parent?e.parent.path.concat(e):[]},includes:function(e){var t=e.parent?c({},e.parent.includes):{};return t[e.name]=!0,t},$delegates:{}};function j(e,t){if(!e)return r;var n,i=o(e),a=i?e:e.name;if(0===(n=a).indexOf(".")||0===n.indexOf("^")){if(!t)throw new Error("No reference point given for path '"+a+"'");t=j(t);for(var u=a.split("."),s=0,l=u.length,c=t;s<l;s++)if(""!==u[s]||0!==s){if("^"!==u[s])break;if(!c.parent)throw new Error("Path '"+a+"' not valid for state '"+t.name+"'");c=c.parent}else c=t;u=u.slice(s).join("."),a=c.name+(c.name&&u?".":"")+u}var f=E[a];return!f||!i&&(i||f!==e&&f.self!==e)?r:f}function O(t){var r=(t=p(t,{self:t,resolve:t.resolve||{},toString:function(){return this.name}})).name;if(!o(r)||r.indexOf("@")>=0)throw new Error("State must have a valid name");if(E.hasOwnProperty(r))throw new Error("State '"+r+"'' is already defined");var n=-1!==r.indexOf(".")?r.substring(0,r.lastIndexOf(".")):o(t.parent)?t.parent:u(t.parent)&&o(t.parent.name)?t.parent.name:"";if(n&&!E[n])return function(e,t){S[e]||(S[e]=[]),S[e].push(t)}(n,t.self);for(var i in P)a(P[i])&&(t[i]=P[i](t,P.$delegates[i]));return E[r]=t,!t[x]&&t.url&&e.when(t.url,["$match","$stateParams",function(e,r){y.$current.navigable==t&&m(e,r)||y.transitionTo(t,e,{inherit:!0,location:!1})}]),function(e){for(var t=S[e]||[];t.length;)O(t.shift())}(r),t}function A(e,n,u,h,S,P,O,A,q){var C=n.reject(new Error("transition superseded")),k=n.reject(new Error("transition prevented")),I=n.reject(new Error("transition aborted")),V=n.reject(new Error("transition failed"));function M(e,r,i,o,c,f){var p=i?r:g(e.params.$$keys(),r),v={$stateParams:p};c.resolve=S.resolve(e.resolve,v,c.resolve,e);var $=[c.resolve.then(function(e){c.globals=e})];return o&&$.push(o),l(e.views,function(r,n){var i=r.resolve&&r.resolve!==e.resolve?r.resolve:{};i.$template=[function(){return u.load(n,{view:r,locals:v,params:p,notify:f.notify})||""}],$.push(S.resolve(i,v,c.resolve,e).then(function(o){if(a(r.controllerProvider)||s(r.controllerProvider)){var u=t.extend({},i,v);o.$$controller=h.invoke(r.controllerProvider,null,u)}else o.$$controller=r.controller;o.$$state=e,o.$$controllerAs=r.controllerAs,c[n]=o}))}),n.all($).then(function(e){return c})}return w.locals={resolve:null,globals:{$stateParams:{}}},(y={params:{},current:w.self,$current:w,transition:null}).reload=function(){return y.transitionTo(y.current,P,{reload:!0,inherit:!1,notify:!0})},y.go=function(e,t,r){return y.transitionTo(e,t,c({inherit:!0,relative:y.$current},r))},y.transitionTo=function(t,r,a){r=r||{},a=c({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},a||{});var o=y.$current,u=y.params,s=o.path,l=j(t,a.relative);if(!i(l)){var v={to:t,toParams:r,options:a},$=function(t,r,i,a){var o=e.$broadcast("$stateNotFound",t,r,i);if(o.defaultPrevented)return O.update(),I;if(!o.retry)return null;if(a.$retry)return O.update(),V;var u=y.transition=n.when(o.retry);return u.then(function(){return u!==y.transition?C:(t.options.$retry=!0,y.transitionTo(t.to,t.toParams,t.options))},function(){return I}),O.update(),u}(v,o.self,u,a);if($)return $;if(r=v.toParams,l=j(t=v.to,(a=v.options).relative),!i(l)){if(!a.relative)throw new Error("No such state '"+t+"'");throw new Error("Could not resolve '"+t+"' from state '"+a.relative+"'")}}if(l[x])throw new Error("Cannot transition to abstract state '"+t+"'");if(a.inherit&&(r=d(P,r||{},y.$current,l)),!l.params.$$validates(r))return V;r=l.params.$$values(r);var m=(t=l).path,b=0,E=m[b],S=w.locals,A=[];if(!a.reload)for(;E&&E===s[b]&&E.ownParams.$$equals(r,u);)S=A[b]=E.locals,E=m[++b];if(function(e,t,r,n){if(e===t&&(r===t.locals&&!n.reload||!1===e.self.reloadOnSearch))return!0}(t,o,S,a))return!1!==t.self.reloadOnSearch&&O.update(),y.transition=null,n.when(y.current);if(r=g(t.params.$$keys(),r||{}),a.notify&&e.$broadcast("$stateChangeStart",t.self,r,o.self,u).defaultPrevented)return O.update(),k;for(var q=n.when(S),F=b;F<m.length;E=m[++F])S=A[F]=p(S),q=M(E,r,E===t,q,S,a);var N=y.transition=q.then(function(){var n,i,l;if(y.transition!==N)return C;for(n=s.length-1;n>=b;n--)(l=s[n]).self.onExit&&h.invoke(l.self.onExit,l.self,l.locals.globals),l.locals=null;for(n=b;n<m.length;n++)(i=m[n]).locals=A[n],i.self.onEnter&&h.invoke(i.self.onEnter,i.self,i.locals.globals);return y.transition!==N?C:(y.$current=t,y.current=t.self,y.params=r,f(y.params,P),y.transition=null,a.location&&t.navigable&&O.push(t.navigable.url,t.navigable.locals.globals.$stateParams,{$$avoidResync:!0,replace:"replace"===a.location}),a.notify&&e.$broadcast("$stateChangeSuccess",t.self,r,o.self,u),O.update(!0),y.current)},function(i){return y.transition!==N?C:(y.transition=null,e.$broadcast("$stateChangeError",t.self,r,o.self,u,i).defaultPrevented||O.update(),n.reject(i))});return N},y.is=function(e,t,n){var a=j(e,(n=c({relative:y.$current},n||{})).relative);return i(a)?y.$current===a&&(!t||m(a.params.$$values(t),P)):r},y.includes=function(e,t,n){if(n=c({relative:y.$current},n||{}),o(e)&&e.indexOf("*")>-1){if(!function(e){var t=e.split("."),r=y.$current.name.split(".");if("**"===t[0]&&(r=r.slice($(r,t[1]))).unshift("**"),"**"===t[t.length-1]&&(r.splice($(r,t[t.length-2])+1,Number.MAX_VALUE),r.push("**")),t.length!=r.length)return!1;for(var n=0,i=t.length;n<i;n++)"*"===t[n]&&(r[n]="*");return r.join("")===t.join("")}(e))return!1;e=y.$current.name}var a=j(e,n.relative);return i(a)?!!i(y.$current.includes[a.name])&&(!t||m(a.params.$$values(t),P,v(t))):r},y.href=function(e,t,n){var a=j(e,(n=c({lossy:!0,inherit:!0,absolute:!1,relative:y.$current},n||{})).relative);if(!i(a))return null;n.inherit&&(t=d(P,t||{},y.$current,a));var o=a&&n.lossy?a.navigable:a;return o&&o.url!==r&&null!==o.url?O.href(o.url,g(a.params.$$keys(),t||{}),{absolute:n.absolute}):null},y.get=function(e,t){if(0===arguments.length)return b(v(E),function(e){return E[e].self});var r=j(e,t||y.$current);return r&&r.self?r.self:null},y}(w=O({name:"",url:"^",views:null,abstract:!0})).navigable=null,this.decorator=function(e,t){if(o(e)&&!i(t))return P[e];if(!a(t)||!o(e))return this;P[e]&&!P.$delegates[e]&&(P.$delegates[e]=P[e]);return P[e]=t,this},this.state=function(e,t){u(e)?t=e:t.name=e;return O(t),this},this.$get=A,A.$inject=["$rootScope","$q","$view","$injector","$resolve","$stateParams","$urlRouter","$location","$urlMatcherFactory"]}function A(){function e(e,t){return{load:function(r,n){var i;return(n=c({template:null,controller:null,view:null,locals:null,notify:!0,async:!0,params:{}},n)).view&&(i=t.fromConfig(n.view,n.params,n.locals)),i&&n.notify&&e.$broadcast("$viewContentLoading",n),i}}}this.$get=e,e.$inject=["$rootScope","$templateFactory"]}function q(e,r,n,i){var a=r.has?function(e){return r.has(e)?r.get(e):null}:function(e){try{return r.get(e)}catch(e){return null}},o=a("$animator"),u=a("$animate");return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(r,a,s){return function(r,a,l){var c,f,p,h,v=l.onload||"",$=l.autoscroll,d=function(e,t){if(u)return{enter:function(e,t,r){var n=u.enter(e,null,t,r);n&&n.then&&n.then(r)},leave:function(e,t){var r=u.leave(e,t);r&&r.then&&r.then(t)}};if(o){var r=o&&o(t,e);return{enter:function(e,t,n){r.enter(e,null,t),n()},leave:function(e,t){r.leave(e),t()}}}return{enter:function(e,t,r){t.after(e),r()},leave:function(e,t){e.remove(),t()}}}(l,r);function m(o){var u,m=k(r,l,a,i),g=m&&e.$current&&e.$current.locals[m];if(o||g!==h){u=r.$new(),h=e.$current.locals[m];var w=s(u,function(e){d.enter(e,a,function(){p&&p.$emit("$viewContentAnimationEnded"),(t.isDefined($)&&!$||r.$eval($))&&n(e)}),c&&(c.remove(),c=null),p&&(p.$destroy(),p=null),f&&(d.leave(f,function(){c=null}),c=f,f=null)});f=w,(p=u).$emit("$viewContentLoaded"),p.$eval(v)}}r.$on("$stateChangeSuccess",function(){m(!1)}),r.$on("$viewContentLoading",function(){m(!1)}),m(!0)}}}}function C(e,t,r,n){return{restrict:"ECA",priority:-400,compile:function(i){var a=i.html();return function(i,o,u){var s=r.$current,l=k(i,u,o,n),c=s&&s.locals[l];if(c){o.data("$uiView",{name:l,state:c.$$state}),o.html(c.$template?c.$template:a);var f=e(o.contents());if(c.$$controller){c.$scope=i;var p=t(c.$$controller,c);c.$$controllerAs&&(i[c.$$controllerAs]=p),o.data("$ngControllerController",p),o.children().data("$ngControllerController",p)}f(i)}}}}}function k(e,t,r,n){var i=n(t.uiView||t.name||"")(e),a=r.inheritedData("$uiView");return i.indexOf("@")>=0?i:i+"@"+(a?a.state.name:"")}function I(e){var t=e.parent().inheritedData("$uiView");if(t&&t.state&&t.state.name)return t.state}function V(e,r){var n=["location","inherit","reload"];return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(i,a,o,u){var s=function(e,t){var r,n=e.match(/^\s*({[^}]*})\s*$/);if(n&&(e=t+"("+n[1]+")"),!(r=e.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/))||4!==r.length)throw new Error("Invalid state ref '"+e+"'");return{state:r[1],paramExpr:r[3]||null}}(o.uiSref,e.current.name),l=null,c=I(a)||e.$current,f=null,p="A"===a.prop("tagName"),h="FORM"===a[0].nodeName,v=h?"action":"href",$=!0,d={relative:c,inherit:!0},m=i.$eval(o.uiSrefOpts)||{};t.forEach(n,function(e){e in m&&(d[e]=m[e])});var g=function(r){if(r&&(l=t.copy(r)),$){f=e.href(s.state,l,d);var n=u[1]||u[0];if(n&&n.$$setStateInfo(s.state,l),null===f)return $=!1,!1;o.$set(v,f)}};s.paramExpr&&(i.$watch(s.paramExpr,function(e,t){e!==l&&g(e)},!0),l=t.copy(i.$eval(s.paramExpr))),g(),h||a.bind("click",function(t){if(!((t.which||t.button)>1||t.ctrlKey||t.metaKey||t.shiftKey||a.attr("target"))){var n=r(function(){e.go(s.state,l,d)});t.preventDefault();var i=p&&!f?1:0;t.preventDefault=function(){i--<=0&&r.cancel(n)}}})}}}function M(e,t,r){return{restrict:"A",controller:["$scope","$element","$attrs",function(t,n,i){var a,o,u;function s(){(void 0!==i.uiSrefActiveEq?a&&e.is(a.name,o):a&&e.includes(a.name,o))?n.addClass(u):n.removeClass(u)}u=r(i.uiSrefActiveEq||i.uiSrefActive||"",!1)(t),this.$$setStateInfo=function(t,r){a=e.get(t,I(n)),o=r,s()},t.$on("$stateChangeSuccess",s)}]}}function F(e){var t=function(t){return e.is(t)};return t.$stateful=!0,t}function N(e){var t=function(t){return e.includes(t)};return t.$stateful=!0,t}t.module("ui.router.util",["ng"]),t.module("ui.router.router",["ui.router.util"]),t.module("ui.router.state",["ui.router.router","ui.router.util"]),t.module("ui.router",["ui.router.state"]),t.module("ui.router.compat",["ui.router"]),E.$inject=["$q","$injector"],t.module("ui.router.util").service("$resolve",E),S.$inject=["$http","$templateCache","$injector"],t.module("ui.router.util").service("$templateFactory",S),x.prototype.concat=function(e,t){var r={caseInsensitive:n.caseInsensitive(),strict:n.strictMode(),squash:n.defaultSquashPolicy()};return new x(this.sourcePath+e+this.sourceSearch,c(r,t),this)},x.prototype.toString=function(){return this.source},x.prototype.exec=function(e,t){var r=this.regexp.exec(e);if(!r)return null;t=t||{};var n,i,a,o=this.parameters(),u=o.length,s=this.segments.length-1,l={};if(s!==r.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");function c(e){function t(e){return e.split("").reverse().join("")}return b(b(t(e).split(/-(?!\\)/),t),function(e){return e.replace(/\\-/,"-")}).reverse()}for(n=0;n<s;n++){a=o[n];var f=this.params[a],p=r[n+1];for(i=0;i<f.replace;i++)f.replace[i].from===p&&(p=f.replace[i].to);p&&!0===f.array&&(p=c(p)),l[a]=f.value(p)}for(;n<u;n++)l[a=o[n]]=this.params[a].value(t[a]);return l},x.prototype.parameters=function(e){return i(e)?this.params[e]||null:this.$$paramNames},x.prototype.validates=function(e){return this.params.$$validates(e)},x.prototype.format=function(e){e=e||{};var t=this.segments,r=this.parameters(),n=this.params;if(!this.validates(e))return null;var i,a=!1,u=t.length-1,l=r.length,c=t[0];function f(e){return encodeURIComponent(e).replace(/-/g,function(e){return"%5C%"+e.charCodeAt(0).toString(16).toUpperCase()})}for(i=0;i<l;i++){var p=i<u,h=r[i],v=n[h],$=v.value(e[h]),d=v.isOptional&&v.type.equals(v.value(),$),m=!!d&&v.squash,g=v.type.encode($);if(p){var w=t[i+1];if(!1===m)null!=g&&(s(g)?c+=b(g,f).join("-"):c+=encodeURIComponent(g)),c+=w;else if(!0===m){var y=c.match(/\/$/)?/\/?(.*)/:/(.*)/;c+=w.match(y)[1]}else o(m)&&(c+=m+w)}else{if(null==g||d&&!1!==m)continue;s(g)||(g=[g]),g=b(g,encodeURIComponent).join("&"+h+"="),c+=(a?"&":"?")+h+"="+g,a=!0}}return c},P.prototype.is=function(e,t){return!0},P.prototype.encode=function(e,t){return e},P.prototype.decode=function(e,t){return e},P.prototype.equals=function(e,t){return e==t},P.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},P.prototype.pattern=/.*/,P.prototype.toString=function(){return"{Type:"+this.name+"}"},P.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new function(e,t){function n(e,t){return function(){return e[t].apply(e,arguments)}}function a(e){return s(e)?e:i(e)?[e]:[]}function o(e){return!e}function u(e,n){return function(i){var u=b(i=a(i),e);return!0===n?0===y(u,o).length:function(e){switch(e.length){case 0:return r;case 1:return"auto"===t?e[0]:e;default:return e}}(u)}}this.encode=u(n(e,"encode")),this.decode=u(n(e,"decode")),this.is=u(n(e,"is"),!0),this.equals=(l=n(e,"equals"),function(e,t){var r=a(e),n=a(t);if(r.length!==n.length)return!1;for(var i=0;i<r.length;i++)if(!l(r[i],n[i]))return!1;return!0}),this.pattern=e.pattern,this.$arrayMode=t;var l}(this,e)},t.module("ui.router.util").provider("$urlMatcherFactory",function e(){n=this;var f=!1,h=!0,d=!1;function m(e){return null!=e?e.toString().replace(/\//g,"%2F"):e}var g,w={},E=!0,S=[],j={string:{encode:m,decode:function(e){return null!=e?e.toString().replace(/%2F/g,"/"):e},is:function(e){return this.pattern.test(e)},pattern:/[^/]*/},int:{encode:m,decode:function(e){return parseInt(e,10)},is:function(e){return i(e)&&this.decode(e.toString())===e},pattern:/\d+/},bool:{encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:function(e){return!0===e||!1===e},pattern:/0|1/},date:{encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):r},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):r},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return this.is(e)&&this.is(t)&&e.toISOString()===t.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:t.toJson,decode:t.fromJson,is:t.isObject,equals:t.equals,pattern:/[^/]*/},any:{encode:t.identity,decode:t.identity,is:t.identity,equals:t.equals,pattern:/.*/}};function O(e){return a(e)||s(e)&&a(e[e.length-1])}function A(){for(;S.length;){var e=S.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");t.extend(w[e.name],g.invoke(e.def))}}function q(e){c(this,e||{})}e.$$getDefaultValue=function(e){if(!O(e.value))return e.value;if(!g)throw new Error("Injectable functions cannot be called at configuration time");return g.invoke(e.value)},this.caseInsensitive=function(e){return i(e)&&(f=e),f},this.strictMode=function(e){return i(e)&&(h=e),h},this.defaultSquashPolicy=function(e){if(!i(e))return d;if(!0!==e&&!1!==e&&!o(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return d=e,e},this.compile=function(e,t){return new x(e,c({strict:h,caseInsensitive:f},t))},this.isMatcher=function(e){if(!u(e))return!1;var t=!0;return l(x.prototype,function(r,n){a(r)&&(t=t&&i(e[n])&&a(e[n]))}),t},this.type=function(e,t,r){if(!i(t))return w[e];if(w.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return w[e]=new P(c({name:e},t)),r&&(S.push({name:e,def:r}),E||A()),this},l(j,function(e,t){w[t]=new P(c({name:t},e))}),w=p(w,{}),this.$get=["$injector",function(e){return g=e,E=!1,A(),l(j,function(e,t){w[t]||(w[t]=new P(e))}),this}],this.Param=function(e,t,n,a){var l=this;n=function(e){var t=u(e)?v(e):[];return-1===$(t,"value")&&-1===$(t,"type")&&-1===$(t,"squash")&&-1===$(t,"array")&&(e={value:e}),e.$$fn=O(e.value)?e.value:function(){return e.value},e}(n),t=function(t,r,n){if(t.type&&r)throw new Error("Param '"+e+"' has two type configurations.");return r||(t.type?t.type instanceof P?t.type:new P(t.type):"config"===n?w.any:w.string)}(n,t,a);var f,p,h=(f={array:"search"===a&&"auto"},p=e.match(/\[\]$/)?{array:!0}:{},c(f,p,n).array);"string"!==(t=h?t.$asArray(h,"search"===a):t).name||h||"path"!==a||n.value!==r||(n.value="");var m=n.value!==r,E=function(e,t){var r=e.squash;if(!t||!1===r)return!1;if(!i(r)||null==r)return d;if(!0===r||o(r))return r;throw new Error("Invalid squash policy: '"+r+"'. Valid policies: false, true, or arbitrary string")}(n,m),S=function(e,t,n,i){var a,u,l=[{from:"",to:n||t?r:""},{from:null,to:n||t?r:""}];return a=s(e.replace)?e.replace:[],o(i)&&a.push({from:i,to:r}),u=b(a,function(e){return e.from}),y(l,function(e){return-1===$(u,e.from)}).concat(a)}(n,h,m,E);c(this,{id:e,type:t,location:a,array:h,squash:E,replace:S,isOptional:m,value:function(e){return e=function(e){var t,r=b(y(l.replace,(t=e,function(e){return e.from===t})),function(e){return e.to});return r.length?r[0]:e}(e),i(e)?l.type.decode(e):function(){if(!g)throw new Error("Injectable functions cannot be called at configuration time");return g.invoke(n.$$fn)}()},dynamic:r,config:n,toString:function(){return"{Param:"+e+" "+t+" squash: '"+E+"' optional: "+m+"}"}})},q.prototype={$$new:function(){return p(this,c(new q,{$$parent:this}))},$$keys:function(){for(var e=[],t=[],r=this,n=v(q.prototype);r;)t.push(r),r=r.$$parent;return t.reverse(),l(t,function(t){l(v(t),function(t){-1===$(e,t)&&-1===$(n,t)&&e.push(t)})}),e},$$values:function(e){var t={},r=this;return l(r.$$keys(),function(n){t[n]=r[n].value(e&&e[n])}),t},$$equals:function(e,t){var r=!0,n=this;return l(n.$$keys(),function(i){var a=e&&e[i],o=t&&t[i];n[i].type.equals(a,o)||(r=!1)}),r},$$validates:function(e){var t,r,n,i=!0,a=this;return l(this.$$keys(),function(o){n=a[o],r=e[o],t=!r&&n.isOptional,i=i&&(t||!!n.type.is(r))}),i},$$parent:r},this.ParamSet=q}),t.module("ui.router.util").run(["$urlMatcherFactory",function(e){}]),j.$inject=["$locationProvider","$urlMatcherFactoryProvider"],t.module("ui.router.router").provider("$urlRouter",j),O.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider"],t.module("ui.router.state").value("$stateParams",{}).provider("$state",O),A.$inject=[],t.module("ui.router.state").provider("$view",A),t.module("ui.router.state").provider("$uiViewScroll",function(){var e=!1;this.useAnchorScroll=function(){e=!0},this.$get=["$anchorScroll","$timeout",function(t,r){return e?t:function(e){r(function(){e[0].scrollIntoView()},0,!1)}}]}),q.$inject=["$state","$injector","$uiViewScroll","$interpolate"],C.$inject=["$compile","$controller","$state","$interpolate"],t.module("ui.router.state").directive("uiView",q),t.module("ui.router.state").directive("uiView",C),V.$inject=["$state","$timeout"],M.$inject=["$state","$stateParams","$interpolate"],t.module("ui.router.state").directive("uiSref",V).directive("uiSrefActive",M).directive("uiSrefActiveEq",M),F.$inject=["$state"],N.$inject=["$state"],t.module("ui.router.state").filter("isState",F).filter("includedByState",N)}(window,window.angular);;"use strict";var directiveModule=angular.module("angularjs-dropdown-multiselect",[]);directiveModule.directive("ngDropdownMultiselect",["$filter","$document","$compile","$parse",function(e,t,n,l){return{restrict:"AE",scope:{apiMethod:"@",value:"=",options:"=",extraSettings:"=",events:"=",searchFilter:"=?",translationTexts:"=",groupBy:"@",filter:"=?"},template:function(e,t){var n=!!t.checkboxes,l='<div id="multiselectDD" class="multiselect-parent btn-group dropdown-multiselect" style="width:100% !important;vertical-align:middle;">';l+='<button id="multiselectDDbutton" type="button" class="dropdown-toggle" ng-class="settings.buttonClasses" ng-click="toggleDropdown()">{{getButtonText()}}&nbsp;<span class="caret" style="align:right;"></span></button>',l+='<ul id="multiselectDDul" class="dropdown-menu dropdown-menu-form" ng-style="{display: open ? \'block\' : \'none\', height : settings.scrollable ? settings.scrollableHeight : \'auto\' }" style="overflow: scroll;width:auto;" >',l+='<li ng-hide="!settings.showCheckAll || settings.selectionLimit > 0"><a data-ng-click="selectAll()"><span class="glyphicon glyphicon-ok"></span>  {{texts.checkAll}}</a>',l+='<li ng-show="settings.showUncheckAll"><a data-ng-click="deselectAll();"><span class="glyphicon glyphicon-remove"></span>   {{texts.uncheckAll}}</a></li>',l+='<li ng-hide="(!settings.showCheckAll || settings.selectionLimit > 0) && !settings.showUncheckAll" class="divider"></li>',l+='<li ng-show="settings.enableSearch"><div class="dropdown-header"><input type="text" class="form-control" style="width: 100%;min-width:100%;" ng-model="searchFilter" placeholder="{{texts.searchPlaceholder}}" /></li>',l+='<li ng-show="settings.enableSearch" class="divider"></li>',!!t.groupBy?(l+='<li ng-repeat-start="option in orderedItems | filter: searchFilter" ng-show="getPropertyForObject(option, settings.groupBy) !== getPropertyForObject(orderedItems[$index - 1], settings.groupBy)" role="presentation" class="dropdown-header">{{ getGroupTitle(getPropertyForObject(option, settings.groupBy)) }}</li>',l+='<li ng-repeat-end role="presentation">'):l+='<li role="presentation" ng-repeat="option in options | filter: searchFilter">',l+='<a role="menuitem" tabindex="-1" ng-click="setSelectedItem(getPropertyForObject(option,settings.idProp))">',l+=n?'<div class="checkbox"><label><input class="checkboxInput" type="checkbox" ng-click="checkboxClick($event, getPropertyForObject(option,settings.idProp))" ng-checked="isChecked(getPropertyForObject(option,settings.idProp))" /> {{getPropertyForObject(option, settings.displayProp)}}</label></div></a>':"<span data-ng-class=\"{'glyphicon glyphicon-ok': isChecked(getPropertyForObject(option,settings.idProp))}\"></span> {{getPropertyForObject(option, settings.displayProp)}}</a>",l+="</li>",l+='<li class="divider" ng-show="settings.selectionLimit > 1"></li>',l+='<li role="presentation" ng-show="settings.selectionLimit > 1"><a role="menuitem">{{value.length}} {{texts.selectionOf}} {{settings.selectionLimit}} {{texts.selectionCount}}</a></li>',l+="</ul>",l+="</div>",e.html(l)},link:function(e,t,n){},controller:o,controllerAs:"vm"};function o(n,l,o,s,i){var r;console.log(o),l.filter&&((r=$.extend({},l.filter)).searchText=""),l.apiMethod&&n.getItems(l.apiMethod,r).then(function(e){l.options=e.data.Data,console.log(l.options),l.options.length>0&&(l.noSort||l.options.sort(i.sortArray(l.textProp)))});var a=s.children()[0];function c(e){var t={};return""===l.settings.externalIdProp?t[l.settings.idProp]=e:t[l.settings.externalIdProp]=e,t}function g(e){for(var t in e)delete e[t]}l.toggleDropdown=function(){l.open=!l.open},l.checkboxClick=function(e,t){l.setSelectedItem(t),e.stopImmediatePropagation()},l.externalEvents={onItemSelect:angular.noop,onItemDeselect:angular.noop,onSelectAll:angular.noop,onDeselectAll:angular.noop,onInitDone:angular.noop,onMaxSelectionReached:angular.noop},l.settings={dynamicTitle:!0,scrollable:!1,scrollableHeight:"",width:"100%",closeOnBlur:!0,displayProp:"FullName",idProp:"Id",externalIdProp:"Id",enableSearch:!0,selectionLimit:0,showCheckAll:!0,showUncheckAll:!0,closeOnSelect:!1,buttonClasses:"btn btn-default",closeOnDeselect:!1,groupBy:o.groupBy||void 0,groupByTextProvider:null,smartButtonMaxItems:0,smartButtonTextConverter:angular.noop},l.texts={checkAll:"Select All",uncheckAll:"Unselect All",selectionCount:"selected",selectionOf:"/",searchPlaceholder:"Search...",buttonDefaultText:"",dynamicButtonTextSuffix:"selected"},l.searchFilter=l.searchFilter||"",angular.isDefined(l.settings.groupBy)&&l.$watch("options",function(t){angular.isDefined(t)&&(l.orderedItems=e("orderBy")(t,l.settings.groupBy))}),angular.extend(l.settings,l.extraSettings||[]),angular.extend(l.externalEvents,l.events||[]),angular.extend(l.texts,l.translationTexts),l.singleSelection=1===l.settings.selectionLimit,l.singleSelection&&angular.isArray(l.value)&&0===l.value.length&&g(l.value),l.settings.closeOnBlur&&t.on("click",function(e){for(var t=e.target.parentElement,n=!1;angular.isDefined(t)&&null!==t&&!n;)_.contains(t.className.split(" "),"multiselect-parent")&&!n&&t===a&&(n=!0),t=t.parentElement;n||l.$apply(function(){l.open=!1})}),l.getGroupTitle=function(e){return null!==l.settings.groupByTextProvider?l.settings.groupByTextProvider(e):e},l.getButtonText=function(){if(l.settings.dynamicTitle&&(l.value.length>0||angular.isObject(l.value)&&_.keys(l.value).length>0)){if(l.settings.smartButtonMaxItems>0){var e=[];return angular.forEach(l.options,function(t){if(l.isChecked(l.getPropertyForObject(t,l.settings.idProp))){var n=l.getPropertyForObject(t,l.settings.displayProp),o=l.settings.smartButtonTextConverter(n,t);e.push(o||n)}}),l.value.length>l.settings.smartButtonMaxItems&&(e=e.slice(0,l.settings.smartButtonMaxItems)).push("..."),e.join(", ")}var t;return 0===(t=l.singleSelection?null!==l.value&&angular.isDefined(l.value[l.settings.idProp])?1:0:angular.isDefined(l.value)?l.value.length:0)?l.texts.buttonDefaultText:t+" "+l.texts.dynamicButtonTextSuffix}return l.texts.buttonDefaultText},l.getPropertyForObject=function(e,t){return angular.isDefined(e)&&e.hasOwnProperty(t)?e[t]:""},l.selectAll=function(){l.deselectAll(!1),l.externalEvents.onSelectAll(),angular.forEach(l.options,function(e){l.setSelectedItem(e[l.settings.idProp],!0)})},l.deselectAll=function(e){(e=e||!0)&&l.externalEvents.onDeselectAll(),l.singleSelection?g(l.value):l.value.splice(0,l.value.length)},l.setSelectedItem=function(e,t){var n=c(e),o=null;if(o=""===l.settings.externalIdProp?_.find(l.options,n):n,l.singleSelection)return g(l.value),angular.extend(l.value,o),l.externalEvents.onItemSelect(o),void(l.settings.closeOnSelect&&(l.open=!1));t=t||!1;var s=-1!==_.findIndex(l.value,n);!t&&s?(l.value.splice(_.findIndex(l.value,n),1),l.externalEvents.onItemDeselect(n)):!s&&(0===l.settings.selectionLimit||l.value.length<l.settings.selectionLimit)&&(l.value.push(o),l.externalEvents.onItemSelect(o)),l.settings.closeOnSelect&&(l.open=!1)},l.isChecked=function(e){return l.singleSelection?null!==l.value&&angular.isDefined(l.value[l.settings.idProp])&&l.value[l.settings.idProp]===c(e)[l.settings.idProp]:-1!==_.findIndex(l.value,c(e))},l.externalEvents.onInitDone()}}]);;!function(t,o){"use strict";"function"==typeof define&&define.amd?define(["jquery"],o):"object"==typeof exports?module.exports=o(require("jquery")):t.bootbox=o(t.jQuery)}(this,function t(o,e){"use strict";function a(t){var o=d[p.locale];return o?o[t]:d.en[t]}function n(t,e,a){t.stopPropagation(),t.preventDefault(),o.isFunction(a)&&!1===a.call(e,t)||e.modal("hide")}function r(t,e){var a=0;o.each(t,function(t,o){e(t,o,a++)})}function l(t,e,a){return o.extend(!0,{},t,function(t,o){var e=t.length,a={};if(1>e||e>2)throw new Error("Invalid argument length");return 2===e||"string"==typeof t[0]?(a[o[0]]=t[0],a[o[1]]=t[1]):a=t[0],a}(e,a))}function i(t,o,e,a){return s(l({className:"bootbox-"+t,buttons:c.apply(null,o)},a,e),o)}function c(){for(var t={},o=0,e=arguments.length;e>o;o++){var n=arguments[o],r=n.toLowerCase(),l=n.toUpperCase();t[r]={label:a(l)}}return t}function s(t,o){var a={};return r(o,function(t,o){a[o]=!0}),r(t.buttons,function(t){if(a[t]===e)throw new Error("button key "+t+" is not allowed (options are "+o.join("\n")+")")}),t}var u={dialog:"<div class='bootbox modal' tabindex='-1' role='dialog'><div class='modal-dialog'><div class='modal-content'><div class='modal-body'><div class='bootbox-body'></div></div></div></div></div>",header:"<div class='modal-header'><h4 class='modal-title'></h4></div>",footer:"<div class='modal-footer'></div>",closeButton:"<button type='button' class='bootbox-close-button close' data-dismiss='modal' aria-hidden='true'>&times;</button>",form:"<form class='bootbox-form'></form>",inputs:{text:"<input class='bootbox-input bootbox-input-text form-control' autocomplete=off type=text />",textarea:"<textarea class='bootbox-input bootbox-input-textarea form-control'></textarea>",email:"<input class='bootbox-input bootbox-input-email form-control' autocomplete='off' type='email' />",select:"<select class='bootbox-input bootbox-input-select form-control'></select>",checkbox:"<div class='checkbox'><label><input class='bootbox-input bootbox-input-checkbox' type='checkbox' /></label></div>",date:"<input class='bootbox-input bootbox-input-date form-control' autocomplete=off type='date' />",time:"<input class='bootbox-input bootbox-input-time form-control' autocomplete=off type='time' />",number:"<input class='bootbox-input bootbox-input-number form-control' autocomplete=off type='number' />",password:"<input class='bootbox-input bootbox-input-password form-control' autocomplete='off' type='password' />"}},p={locale:"en",backdrop:"static",animate:!0,className:null,closeButton:!0,show:!0,container:"body"},b={alert:function(){var t;if((t=i("alert",["ok"],["message","callback"],arguments)).callback&&!o.isFunction(t.callback))throw new Error("alert requires callback property to be a function when provided");return t.buttons.ok.callback=t.onEscape=function(){return!o.isFunction(t.callback)||t.callback.call(this)},b.dialog(t)},confirm:function(){var t;if((t=i("confirm",["cancel","confirm"],["message","callback"],arguments)).buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,!1)},t.buttons.confirm.callback=function(){return t.callback.call(this,!0)},!o.isFunction(t.callback))throw new Error("confirm requires a callback");return b.dialog(t)},prompt:function(){var t,a,n,i,p,d,f;if(i=o(u.form),a={className:"bootbox-prompt",buttons:c("cancel","confirm"),value:"",inputType:"text"},d=(t=s(l(a,arguments,["title","callback"]),["cancel","confirm"])).show===e||t.show,t.message=i,t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,null)},t.buttons.confirm.callback=function(){var e;switch(t.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":e=p.val();break;case"checkbox":var a=p.find("input:checked");e=[],r(a,function(t,a){e.push(o(a).val())})}return t.callback.call(this,e)},t.show=!1,!t.title)throw new Error("prompt requires a title");if(!o.isFunction(t.callback))throw new Error("prompt requires a callback");if(!u.inputs[t.inputType])throw new Error("invalid prompt type");switch(p=o(u.inputs[t.inputType]),t.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":p.val(t.value);break;case"select":var m={};if(f=t.inputOptions||[],!o.isArray(f))throw new Error("Please pass an array of input options");if(!f.length)throw new Error("prompt with select requires options");r(f,function(t,a){var n=p;if(a.value===e||a.text===e)throw new Error("given options in wrong format");a.group&&(m[a.group]||(m[a.group]=o("<optgroup/>").attr("label",a.group)),n=m[a.group]),n.append("<option value='"+a.value+"'>"+a.text+"</option>")}),r(m,function(t,o){p.append(o)}),p.val(t.value);break;case"checkbox":var C=o.isArray(t.value)?t.value:[t.value];if(!(f=t.inputOptions||[]).length)throw new Error("prompt with checkbox requires options");if(!f[0].value||!f[0].text)throw new Error("given options in wrong format");p=o("<div/>"),r(f,function(e,a){var n=o(u.inputs[t.inputType]);n.find("input").attr("value",a.value),n.find("label").append(a.text),r(C,function(t,o){o===a.value&&n.find("input").prop("checked",!0)}),p.append(n)})}return t.placeholder&&p.attr("placeholder",t.placeholder),t.pattern&&p.attr("pattern",t.pattern),t.maxlength&&p.attr("maxlength",t.maxlength),i.append(p),i.on("submit",function(t){t.preventDefault(),t.stopPropagation(),n.find(".btn-primary").click()}),(n=b.dialog(t)).off("shown.bs.modal"),n.on("shown.bs.modal",function(){p.focus()}),!0===d&&n.modal("show"),n}};b.dialog=function(t){t=function(t){var e,a;if("object"!=typeof t)throw new Error("Please supply an object of options");if(!t.message)throw new Error("Please specify a message");return(t=o.extend({},p,t)).buttons||(t.buttons={}),e=t.buttons,a=function(t){var o,e=0;for(o in t)e++;return e}(e),r(e,function(t,n,r){if(o.isFunction(n)&&(n=e[t]={callback:n}),"object"!==o.type(n))throw new Error("button with key "+t+" must be an object");n.label||(n.label=t),n.className||(n.className=2>=a&&r===a-1?"btn-primary":"btn-default")}),t}(t);var a=o(u.dialog),l=a.find(".modal-dialog"),i=a.find(".modal-body"),c=t.buttons,s="",b={onEscape:t.onEscape};if(o.fn.modal===e)throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details.");if(r(c,function(t,o){s+="<button data-bb-handler='"+t+"' type='button' class='btn "+o.className+"'>"+o.label+"</button>",b[t]=o.callback}),i.find(".bootbox-body").html(t.message),!0===t.animate&&a.addClass("fade"),t.className&&a.addClass(t.className),"large"===t.size?l.addClass("modal-lg"):"small"===t.size&&l.addClass("modal-sm"),t.title&&i.before(u.header),t.closeButton){var d=o(u.closeButton);t.title?a.find(".modal-header").prepend(d):d.css("margin-top","-10px").prependTo(i)}return t.title&&a.find(".modal-title").html(t.title),s.length&&(i.after(u.footer),a.find(".modal-footer").html(s)),a.on("hidden.bs.modal",function(t){t.target===this&&a.remove()}),a.on("shown.bs.modal",function(){a.find(".btn-primary:first").focus()}),"static"!==t.backdrop&&a.on("click.dismiss.bs.modal",function(t){a.children(".modal-backdrop").length&&(t.currentTarget=a.children(".modal-backdrop").get(0)),t.target===t.currentTarget&&a.trigger("escape.close.bb")}),a.on("escape.close.bb",function(t){b.onEscape&&n(t,a,b.onEscape)}),a.on("click",".modal-footer button",function(t){var e=o(this).data("bb-handler");n(t,a,b[e])}),a.on("click",".bootbox-close-button",function(t){n(t,a,b.onEscape)}),a.on("keyup",function(t){27===t.which&&a.trigger("escape.close.bb")}),o(t.container).append(a),a.modal({backdrop:!!t.backdrop&&"static",keyboard:!1,show:!1}),t.show&&a.modal("show"),a},b.setDefaults=function(){var t={};2===arguments.length?t[arguments[0]]=arguments[1]:t=arguments[0],o.extend(p,t)},b.hideAll=function(){return o(".bootbox").modal("hide"),b};var d={bg_BG:{OK:"Ок",CANCEL:"Отказ",CONFIRM:"Потвърждавам"},br:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Sim"},cs:{OK:"OK",CANCEL:"Zrušit",CONFIRM:"Potvrdit"},da:{OK:"OK",CANCEL:"Annuller",CONFIRM:"Accepter"},de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"},el:{OK:"Εντάξει",CANCEL:"Ακύρωση",CONFIRM:"Επιβεβαίωση"},en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},es:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Aceptar"},et:{OK:"OK",CANCEL:"Katkesta",CONFIRM:"OK"},fa:{OK:"قبول",CANCEL:"لغو",CONFIRM:"تایید"},fi:{OK:"OK",CANCEL:"Peruuta",CONFIRM:"OK"},fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"D'accord"},he:{OK:"אישור",CANCEL:"ביטול",CONFIRM:"אישור"},hu:{OK:"OK",CANCEL:"Mégsem",CONFIRM:"Megerősít"},hr:{OK:"OK",CANCEL:"Odustani",CONFIRM:"Potvrdi"},id:{OK:"OK",CANCEL:"Batal",CONFIRM:"OK"},it:{OK:"OK",CANCEL:"Annulla",CONFIRM:"Conferma"},ja:{OK:"OK",CANCEL:"キャンセル",CONFIRM:"確認"},lt:{OK:"Gerai",CANCEL:"Atšaukti",CONFIRM:"Patvirtinti"},lv:{OK:"Labi",CANCEL:"Atcelt",CONFIRM:"Apstiprināt"},nl:{OK:"OK",CANCEL:"Annuleren",CONFIRM:"Accepteren"},no:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},pl:{OK:"OK",CANCEL:"Anuluj",CONFIRM:"Potwierdź"},pt:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Confirmar"},ru:{OK:"OK",CANCEL:"Отмена",CONFIRM:"Применить"},sq:{OK:"OK",CANCEL:"Anulo",CONFIRM:"Prano"},sv:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},th:{OK:"ตกลง",CANCEL:"ยกเลิก",CONFIRM:"ยืนยัน"},tr:{OK:"Tamam",CANCEL:"İptal",CONFIRM:"Onayla"},zh_CN:{OK:"OK",CANCEL:"取消",CONFIRM:"确认"},zh_TW:{OK:"OK",CANCEL:"取消",CONFIRM:"確認"}};return b.addLocale=function(t,e){return o.each(["OK","CANCEL","CONFIRM"],function(t,o){if(!e[o])throw new Error("Please supply a translation for '"+o+"'")}),d[t]={OK:e.OK,CANCEL:e.CANCEL,CONFIRM:e.CONFIRM},b},b.removeLocale=function(t){return delete d[t],b},b.setLocale=function(t){return b.setDefaults("locale",t)},b.init=function(e){return t(e||o)},b});;if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(t){"use strict";var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),function(t){"use strict";t.fn.emulateTransitionEnd=function(e){var i=!1,o=this;t(this).one("bsTransitionEnd",function(){i=!0});return setTimeout(function(){i||t(o).trigger(t.support.transition.end)},e),this},t(function(){t.support.transition=function(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),function(t){"use strict";var e='[data-dismiss="alert"]',i=function(i){t(i).on("click",e,this.close)};i.VERSION="3.3.4",i.TRANSITION_DURATION=150,i.prototype.close=function(e){function o(){a.detach().trigger("closed.bs.alert").remove()}var n=t(this),s=n.attr("data-target");s||(s=(s=n.attr("href"))&&s.replace(/.*(?=#[^\s]*$)/,""));var a=t(s);e&&e.preventDefault(),a.length||(a=n.closest(".alert")),a.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(a.removeClass("in"),t.support.transition&&a.hasClass("fade")?a.one("bsTransitionEnd",o).emulateTransitionEnd(i.TRANSITION_DURATION):o())};var o=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var o=t(this),n=o.data("bs.alert");n||o.data("bs.alert",n=new i(this)),"string"==typeof e&&n[e].call(o)})},t.fn.alert.Constructor=i,t.fn.alert.noConflict=function(){return t.fn.alert=o,this},t(document).on("click.bs.alert.data-api",e,i.prototype.close)}(jQuery),function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.button"),s="object"==typeof e&&e;n||o.data("bs.button",n=new i(this,s)),"toggle"==e?n.toggle():e&&n.setState(e)})}var i=function(e,o){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,o),this.isLoading=!1};i.VERSION="3.3.4",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(e){var i="disabled",o=this.$element,n=o.is("input")?"val":"html",s=o.data();e+="Text",null==s.resetText&&o.data("resetText",o[n]()),setTimeout(t.proxy(function(){o[n](null==s[e]?this.options[e]:s[e]),"loadingText"==e?(this.isLoading=!0,o.addClass(i).attr(i,i)):this.isLoading&&(this.isLoading=!1,o.removeClass(i).removeAttr(i))},this),0)},i.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")&&(i.prop("checked")&&this.$element.hasClass("active")?t=!1:e.find(".active").removeClass("active")),t&&i.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));t&&this.$element.toggleClass("active")};var o=t.fn.button;t.fn.button=e,t.fn.button.Constructor=i,t.fn.button.noConflict=function(){return t.fn.button=o,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(i){var o=t(i.target);o.hasClass("btn")||(o=o.closest(".btn")),e.call(o,"toggle"),i.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(jQuery),function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.carousel"),s=t.extend({},i.DEFAULTS,o.data(),"object"==typeof e&&e),a="string"==typeof e?e:s.slide;n||o.data("bs.carousel",n=new i(this,s)),"number"==typeof e?n.to(e):a?n[a]():s.interval&&n.pause().cycle()})}var i=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",t.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};i.VERSION="3.3.4",i.TRANSITION_DURATION=600,i.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},i.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},i.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},i.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},i.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e);if(("prev"==t&&0===i||"next"==t&&i==this.$items.length-1)&&!this.options.wrap)return e;var o=(i+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(o)},i.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));return t>this.$items.length-1||0>t?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",this.$items.eq(t))},i.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){return this.sliding?void 0:this.slide("next")},i.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},i.prototype.slide=function(e,o){var n=this.$element.find(".item.active"),s=o||this.getItemForDirection(e,n),a=this.interval,r="next"==e?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var h=s[0],d=t.Event("slide.bs.carousel",{relatedTarget:h,direction:r});if(this.$element.trigger(d),!d.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var p=t(this.$indicators.children()[this.getItemIndex(s)]);p&&p.addClass("active")}var c=t.Event("slid.bs.carousel",{relatedTarget:h,direction:r});return t.support.transition&&this.$element.hasClass("slide")?(s.addClass(e),s[0].offsetWidth,n.addClass(r),s.addClass(r),n.one("bsTransitionEnd",function(){s.removeClass([e,r].join(" ")).addClass("active"),n.removeClass(["active",r].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(c)},0)}).emulateTransitionEnd(i.TRANSITION_DURATION)):(n.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(c)),a&&this.cycle(),this}};var o=t.fn.carousel;t.fn.carousel=e,t.fn.carousel.Constructor=i,t.fn.carousel.noConflict=function(){return t.fn.carousel=o,this};var n=function(i){var o,n=t(this),s=t(n.attr("data-target")||(o=n.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var a=t.extend({},s.data(),n.data()),r=n.attr("data-slide-to");r&&(a.interval=!1),e.call(s,a),r&&s.data("bs.carousel").to(r),i.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",n).on("click.bs.carousel.data-api","[data-slide-to]",n),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var i=t(this);e.call(i,i.data())})})}(jQuery),function(t){"use strict";function e(e){var i,o=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(o)}function i(e){return this.each(function(){var i=t(this),n=i.data("bs.collapse"),s=t.extend({},o.DEFAULTS,i.data(),"object"==typeof e&&e);!n&&s.toggle&&/show|hide/.test(e)&&(s.toggle=!1),n||i.data("bs.collapse",n=new o(this,s)),"string"==typeof e&&n[e]()})}var o=function(e,i){this.$element=t(e),this.options=t.extend({},o.DEFAULTS,i),this.$trigger=t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};o.VERSION="3.3.4",o.TRANSITION_DURATION=350,o.DEFAULTS={toggle:!0},o.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},o.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,n=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(n&&n.length&&(e=n.data("bs.collapse"),e&&e.transitioning))){var s=t.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){n&&n.length&&(i.call(n,"hide"),e||n.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var r=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return r.call(this);var l=t.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(o.TRANSITION_DURATION)[a](this.$element[0][l])}}}},o.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var n=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return t.support.transition?void this.$element[i](0).one("bsTransitionEnd",t.proxy(n,this)).emulateTransitionEnd(o.TRANSITION_DURATION):n.call(this)}}},o.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},o.prototype.getParent=function(){return t(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy(function(i,o){var n=t(o);this.addAriaAndCollapsedClass(e(n),n)},this)).end()},o.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var n=t.fn.collapse;t.fn.collapse=i,t.fn.collapse.Constructor=o,t.fn.collapse.noConflict=function(){return t.fn.collapse=n,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(o){var n=t(this);n.attr("data-target")||o.preventDefault();var s=e(n),a=s.data("bs.collapse")?"toggle":n.data();i.call(s,a)})}(jQuery),function(t){"use strict";function e(e){e&&3===e.which||(t(o).remove(),t(n).each(function(){var o=t(this),n=i(o),s={relatedTarget:this};n.hasClass("open")&&(n.trigger(e=t.Event("hide.bs.dropdown",s)),e.isDefaultPrevented()||(o.attr("aria-expanded","false"),n.removeClass("open").trigger("hidden.bs.dropdown",s)))}))}function i(e){var i=e.attr("data-target");i||(i=(i=e.attr("href"))&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var o=i&&t(i);return o&&o.length?o:e.parent()}var o=".dropdown-backdrop",n='[data-toggle="dropdown"]',s=function(e){t(e).on("click.bs.dropdown",this.toggle)};s.VERSION="3.3.4",s.prototype.toggle=function(o){var n=t(this);if(!n.is(".disabled, :disabled")){var s=i(n),a=s.hasClass("open");if(e(),!a){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t('<div class="dropdown-backdrop"/>').insertAfter(t(this)).on("click",e);var r={relatedTarget:this};if(s.trigger(o=t.Event("show.bs.dropdown",r)),o.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger("shown.bs.dropdown",r)}return!1}},s.prototype.keydown=function(e){if(/(38|40|27|32)/.test(e.which)&&!/input|textarea/i.test(e.target.tagName)){var o=t(this);if(e.preventDefault(),e.stopPropagation(),!o.is(".disabled, :disabled")){var s=i(o),a=s.hasClass("open");if(!a&&27!=e.which||a&&27==e.which)return 27==e.which&&s.find(n).trigger("focus"),o.trigger("click");var r=" li:not(.disabled):visible a",l=s.find('[role="menu"]'+r+', [role="listbox"]'+r);if(l.length){var h=l.index(e.target);38==e.which&&h>0&&h--,40==e.which&&h<l.length-1&&h++,~h||(h=0),l.eq(h).trigger("focus")}}}};var a=t.fn.dropdown;t.fn.dropdown=function(e){return this.each(function(){var i=t(this),o=i.data("bs.dropdown");o||i.data("bs.dropdown",o=new s(this)),"string"==typeof e&&o[e].call(i)})},t.fn.dropdown.Constructor=s,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=a,this},t(document).on("click.bs.dropdown.data-api",e).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",n,s.prototype.toggle).on("keydown.bs.dropdown.data-api",n,s.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="menu"]',s.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="listbox"]',s.prototype.keydown)}(jQuery),function(t){"use strict";function e(e,o){return this.each(function(){var n=t(this),s=n.data("bs.modal"),a=t.extend({},i.DEFAULTS,n.data(),"object"==typeof e&&e);s||n.data("bs.modal",s=new i(this,a)),"string"==typeof e?s[e](o):a.show&&s.show(o)})}var i=function(e,i){this.options=i,this.$body=t(document.body),this.$element=t(e),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,t.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};i.VERSION="3.3.4",i.TRANSITION_DURATION=300,i.BACKDROP_TRANSITION_DURATION=150,i.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},i.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},i.prototype.show=function(e){var o=this,n=t.Event("show.bs.modal",{relatedTarget:e});this.$element.trigger(n),this.isShown||n.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',t.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){o.$element.one("mouseup.dismiss.bs.modal",function(e){t(e.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var n=t.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),o.adjustDialog(),n&&o.$element[0].offsetWidth,o.$element.addClass("in").attr("aria-hidden",!1),o.enforceFocus();var s=t.Event("shown.bs.modal",{relatedTarget:e});n?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(s)}).emulateTransitionEnd(i.TRANSITION_DURATION):o.$element.trigger("focus").trigger(s)}))},i.prototype.hide=function(e){e&&e.preventDefault(),e=t.Event("hide.bs.modal"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),t(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),t.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",t.proxy(this.hideModal,this)).emulateTransitionEnd(i.TRANSITION_DURATION):this.hideModal())},i.prototype.enforceFocus=function(){t(document).off("focusin.bs.modal").on("focusin.bs.modal",t.proxy(function(t){this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},i.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",t.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},i.prototype.resize=function(){this.isShown?t(window).on("resize.bs.modal",t.proxy(this.handleUpdate,this)):t(window).off("resize.bs.modal")},i.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},i.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},i.prototype.backdrop=function(e){var o=this,n=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var s=t.support.transition&&n;if(this.$backdrop=t('<div class="modal-backdrop '+n+'" />').appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",t.proxy(function(t){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;s?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var a=function(){o.removeBackdrop(),e&&e()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",a).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):a()}else e&&e()},i.prototype.handleUpdate=function(){this.adjustDialog()},i.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},i.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},i.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},i.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",t+this.scrollbarWidth)},i.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},i.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var o=t.fn.modal;t.fn.modal=e,t.fn.modal.Constructor=i,t.fn.modal.noConflict=function(){return t.fn.modal=o,this},t(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(i){var o=t(this),n=o.attr("href"),s=t(o.attr("data-target")||n&&n.replace(/.*(?=#[^\s]+$)/,"")),a=s.data("bs.modal")?"toggle":t.extend({remote:!/#/.test(n)&&n},s.data(),o.data());o.is("a")&&i.preventDefault(),s.one("show.bs.modal",function(t){t.isDefaultPrevented()||s.one("hidden.bs.modal",function(){o.is(":visible")&&o.trigger("focus")})}),e.call(s,a,this)})}(jQuery),function(t){"use strict";var e=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("tooltip",t,e)};e.VERSION="3.3.4",e.TRANSITION_DURATION=150,e.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},e.prototype.init=function(e,i,o){if(this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o),this.$viewport=this.options.viewport&&t(this.options.viewport.selector||this.options.viewport),this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var n=this.options.trigger.split(" "),s=n.length;s--;){var a=n[s];if("click"==a)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=a){var r="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return(e=t.extend({},this.getDefaults(),this.$element.data(),e)).delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i&&i.$tip&&i.$tip.is(":visible")?void(i.hoverState="in"):(i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show())},e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},e.prototype.show=function(){var i=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(i);var o=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(i.isDefaultPrevented()||!o)return;var n=this,s=this.tip(),a=this.getUID(this.type);this.setContent(),s.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&s.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,h=l.test(r);h&&(r=r.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element);var d=this.getPosition(),p=s[0].offsetWidth,c=s[0].offsetHeight;if(h){var f=r,u=this.options.container?t(this.options.container):this.$element.parent(),g=this.getPosition(u);r="bottom"==r&&d.bottom+c>g.bottom?"top":"top"==r&&d.top-c<g.top?"bottom":"right"==r&&d.right+p>g.width?"left":"left"==r&&d.left-p<g.left?"right":r,s.removeClass(f).addClass(r)}var m=this.getCalculatedOffset(r,d,p,c);this.applyPlacement(m,r);var v=function(){var t=n.hoverState;n.$element.trigger("shown.bs."+n.type),n.hoverState=null,"out"==t&&n.leave(n)};t.support.transition&&this.$tip.hasClass("fade")?s.one("bsTransitionEnd",v).emulateTransitionEnd(e.TRANSITION_DURATION):v()}},e.prototype.applyPlacement=function(e,i){var o=this.tip(),n=o[0].offsetWidth,s=o[0].offsetHeight,a=parseInt(o.css("margin-top"),10),r=parseInt(o.css("margin-left"),10);isNaN(a)&&(a=0),isNaN(r)&&(r=0),e.top=e.top+a,e.left=e.left+r,t.offset.setOffset(o[0],t.extend({using:function(t){o.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0),o.addClass("in");var l=o[0].offsetWidth,h=o[0].offsetHeight;"top"==i&&h!=s&&(e.top=e.top+s-h);var d=this.getViewportAdjustedDelta(i,e,l,h);d.left?e.left+=d.left:e.top+=d.top;var p=/top|bottom/.test(i),c=p?2*d.left-n+l:2*d.top-s+h,f=p?"offsetWidth":"offsetHeight";o.offset(e),this.replaceArrow(c,o[0][f],p)},e.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},e.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},e.prototype.hide=function(i){function o(){"in"!=n.hoverState&&s.detach(),n.$element.removeAttr("aria-describedby").trigger("hidden.bs."+n.type),i&&i()}var n=this,s=t(this.$tip),a=t.Event("hide.bs."+this.type);return this.$element.trigger(a),a.isDefaultPrevented()?void 0:(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",o).emulateTransitionEnd(e.TRANSITION_DURATION):o(),this.hoverState=null,this)},e.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},e.prototype.hasContent=function(){return this.getTitle()},e.prototype.getPosition=function(e){var i=(e=e||this.$element)[0],o="BODY"==i.tagName,n=i.getBoundingClientRect();null==n.width&&(n=t.extend({},n,{width:n.right-n.left,height:n.bottom-n.top}));var s=o?{top:0,left:0}:e.offset(),a={scroll:o?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()},r=o?{width:t(window).width(),height:t(window).height()}:null;return t.extend({},n,a,r,s)},e.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},e.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;h<a.left?n.left=a.left-h:d>a.width&&(n.left=a.left+a.width-d)}return n},e.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},e.prototype.getUID=function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},e.prototype.tip=function(){return this.$tip=this.$tip||t(this.options.template)},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},e.prototype.enable=function(){this.enabled=!0},e.prototype.disable=function(){this.enabled=!1},e.prototype.toggleEnabled=function(){this.enabled=!this.enabled},e.prototype.toggle=function(e){var i=this;e&&((i=t(e.currentTarget).data("bs."+this.type))||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i))),i.tip().hasClass("in")?i.leave(i):i.enter(i)},e.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type)})};var i=t.fn.tooltip;t.fn.tooltip=function(i){return this.each(function(){var o=t(this),n=o.data("bs.tooltip"),s="object"==typeof i&&i;(n||!/destroy|hide/.test(i))&&(n||o.data("bs.tooltip",n=new e(this,s)),"string"==typeof i&&n[i]())})},t.fn.tooltip.Constructor=e,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=i,this}}(jQuery),function(t){"use strict";var e=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");e.VERSION="3.3.4",e.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),e.prototype.constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e),t.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof i?"html":"append":"text"](i),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var i=t.fn.popover;t.fn.popover=function(i){return this.each(function(){var o=t(this),n=o.data("bs.popover"),s="object"==typeof i&&i;(n||!/destroy|hide/.test(i))&&(n||o.data("bs.popover",n=new e(this,s)),"string"==typeof i&&n[i]())})},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(jQuery),function(t){"use strict";function e(i,o){this.$body=t(document.body),this.$scrollElement=t(t(i).is(document.body)?window:i),this.options=t.extend({},e.DEFAULTS,o),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",t.proxy(this.process,this)),this.refresh(),this.process()}function i(i){return this.each(function(){var o=t(this),n=o.data("bs.scrollspy"),s="object"==typeof i&&i;n||o.data("bs.scrollspy",n=new e(this,s)),"string"==typeof i&&n[i]()})}e.VERSION="3.3.4",e.DEFAULTS={offset:10},e.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},e.prototype.refresh=function(){var e=this,i="offset",o=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),t.isWindow(this.$scrollElement[0])||(i="position",o=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var e=t(this),n=e.data("target")||e.attr("href"),s=/^#./.test(n)&&t(n);return s&&s.length&&s.is(":visible")&&[[s[i]().top+o,n]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){e.offsets.push(this[0]),e.targets.push(this[1])})},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),e>=o)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e<n[0])return this.activeTarget=null,this.clear();for(t=n.length;t--;)a!=s[t]&&e>=n[t]&&(void 0===n[t+1]||e<n[t+1])&&this.activate(s[t])},e.prototype.activate=function(e){this.activeTarget=e,this.clear();var i=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]',o=t(i).parents("li").addClass("active");o.parent(".dropdown-menu").length&&(o=o.closest("li.dropdown").addClass("active")),o.trigger("activate.bs.scrollspy")},e.prototype.clear=function(){t(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var o=t.fn.scrollspy;t.fn.scrollspy=i,t.fn.scrollspy.Constructor=e,t.fn.scrollspy.noConflict=function(){return t.fn.scrollspy=o,this},t(window).on("load.bs.scrollspy.data-api",function(){t('[data-spy="scroll"]').each(function(){var e=t(this);i.call(e,e.data())})})}(jQuery),function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tab");n||o.data("bs.tab",n=new i(this)),"string"==typeof e&&n[e]()})}var i=function(e){this.element=t(e)};i.VERSION="3.3.4",i.TRANSITION_DURATION=150,i.prototype.show=function(){var e=this.element,i=e.closest("ul:not(.dropdown-menu)"),o=e.data("target");if(o||(o=(o=e.attr("href"))&&o.replace(/.*(?=#[^\s]*$)/,"")),!e.parent("li").hasClass("active")){var n=i.find(".active:last a"),s=t.Event("hide.bs.tab",{relatedTarget:e[0]}),a=t.Event("show.bs.tab",{relatedTarget:n[0]});if(n.trigger(s),e.trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){var r=t(o);this.activate(e.closest("li"),i),this.activate(r,r.parent(),function(){n.trigger({type:"hidden.bs.tab",relatedTarget:e[0]}),e.trigger({type:"shown.bs.tab",relatedTarget:n[0]})})}}},i.prototype.activate=function(e,o,n){function s(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),r?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu").length&&e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),n&&n()}var a=o.find("> .active"),r=n&&t.support.transition&&(a.length&&a.hasClass("fade")||!!o.find("> .fade").length);a.length&&r?a.one("bsTransitionEnd",s).emulateTransitionEnd(i.TRANSITION_DURATION):s(),a.removeClass("in")};var o=t.fn.tab;t.fn.tab=e,t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=o,this};var n=function(i){i.preventDefault(),e.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',n).on("click.bs.tab.data-api",'[data-toggle="pill"]',n)}(jQuery),function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.affix"),s="object"==typeof e&&e;n||o.data("bs.affix",n=new i(this,s)),"string"==typeof e&&n[e]()})}var i=function(e,o){this.options=t.extend({},i.DEFAULTS,o),this.$target=t(this.options.target).on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(e),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};i.VERSION="3.3.4",i.RESET="affix affix-top affix-bottom",i.DEFAULTS={offset:0,target:window},i.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return i>n&&"top";if("bottom"==this.affixed)return null!=i?!(n+this.unpin<=s.top)&&"bottom":!(t-o>=n+a)&&"bottom";var r=null==this.affixed,l=r?n:s.top;return null!=i&&i>=n?"top":null!=o&&l+(r?a:e)>=t-o&&"bottom"},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},i.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var e=this.$element.height(),o=this.options.offset,n=o.top,s=o.bottom,a=t(document.body).height();"object"!=typeof o&&(s=n=o),"function"==typeof n&&(n=o.top(this.$element)),"function"==typeof s&&(s=o.bottom(this.$element));var r=this.getState(a,e,n,s);if(this.affixed!=r){null!=this.unpin&&this.$element.css("top","");var l="affix"+(r?"-"+r:""),h=t.Event(l+".bs.affix");if(this.$element.trigger(h),h.isDefaultPrevented())return;this.affixed=r,this.unpin="bottom"==r?this.getPinnedOffset():null,this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==r&&this.$element.offset({top:a-e-s})}};var o=t.fn.affix;t.fn.affix=e,t.fn.affix.Constructor=i,t.fn.affix.noConflict=function(){return t.fn.affix=o,this},t(window).on("load",function(){t('[data-spy="affix"]').each(function(){var i=t(this),o=i.data();o.offset=o.offset||{},null!=o.offsetBottom&&(o.offset.bottom=o.offsetBottom),null!=o.offsetTop&&(o.offset.top=o.offsetTop),e.call(i,o)})})}(jQuery);;angular.module("checklist-model",[]).directive("checklistModel",["$parse","$compile",function(e,t){function r(e,t,r){if(angular.isArray(e))for(var c=e.length;c--;)if(r(e[c],t))return!0;return!1}function c(c,a,n){var l=n.checklistModel;n.$set("checklistModel",null),t(a)(c),n.$set("checklistModel",l);var i=e(l),o=i.assign,u=e(n.checklistChange),s=n.checklistValue?e(n.checklistValue)(c.$parent):n.value,h=angular.equals;if(n.hasOwnProperty("checklistComparator"))if("."==n.checklistComparator[0]){var p=n.checklistComparator.substring(1);h=function(e,t){return e[p]===t[p]}}else h=e(n.checklistComparator)(c.$parent);function k(e,t){c[n.ngModel]=r(e,s,h)}c.$watch(n.ngModel,function(e,t){if(e!==t){var a=i(c.$parent);angular.isFunction(o)&&o(c.$parent,!0===e?function(e,t,c){return r(e=angular.isArray(e)?e:[],t,c)||e.push(t),e}(a,s,h):function(e,t,r){if(angular.isArray(e))for(var c=e.length;c--;)if(r(e[c],t)){e.splice(c,1);break}return e}(a,s,h)),u&&u(c)}}),angular.isFunction(c.$parent.$watchCollection)?c.$parent.$watchCollection(l,k):c.$parent.$watch(l,k,!0)}return{restrict:"A",priority:1e3,terminal:!0,scope:!0,compile:function(e,t){if(("INPUT"!==e[0].tagName||"checkbox"!==t.type)&&"MD-CHECKBOX"!==e[0].tagName&&!t.btnCheckbox)throw'checklist-model should be applied to `input[type="checkbox"]` or `md-checkbox`.';if(!t.checklistValue&&!t.value)throw"You should provide `value` or `checklist-value`.";return t.ngModel||t.$set("ngModel","checked"),c}}}]);;var CryptoJS=CryptoJS||function(t,e){var r={},i=r.lib={},n=function(){},o=i.Base={extend:function(t){n.prototype=this;var e=new n;return t&&e.mixIn(t),e.hasOwnProperty("init")||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=i.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=void 0!=e?e:4*t.length},toString:function(t){return(t||a).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes;if(t=t.sigBytes,this.clamp(),i%4)for(var n=0;n<t;n++)e[i+n>>>2]|=(r[n>>>2]>>>24-n%4*8&255)<<24-(i+n)%4*8;else if(65535<r.length)for(n=0;n<t;n+=4)e[i+n>>>2]=r[n>>>2];else e.push.apply(e,r);return this.sigBytes+=t,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r=[],i=0;i<e;i+=4)r.push(4294967296*t.random()|0);return new s.init(r,e)}}),c=r.enc={},a=c.Hex={stringify:function(t){var e=t.words;t=t.sigBytes;for(var r=[],i=0;i<t;i++){var n=e[i>>>2]>>>24-i%4*8&255;r.push((n>>>4).toString(16)),r.push((15&n).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i+=2)r[i>>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new s.init(r,e/2)}},f=c.Latin1={stringify:function(t){var e=t.words;t=t.sigBytes;for(var r=[],i=0;i<t;i++)r.push(String.fromCharCode(e[i>>>2]>>>24-i%4*8&255));return r.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i++)r[i>>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new s.init(r,e)}},h=c.Utf8={stringify:function(t){try{return decodeURIComponent(escape(f.stringify(t)))}catch(t){throw Error("Malformed UTF-8 data")}},parse:function(t){return f.parse(unescape(encodeURIComponent(t)))}},u=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=h.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,i=r.words,n=r.sigBytes,o=this.blockSize,c=n/(4*o);if(e=(c=e?t.ceil(c):t.max((0|c)-this._minBufferSize,0))*o,n=t.min(4*e,n),e){for(var a=0;a<e;a+=o)this._doProcessBlock(i,a);a=i.splice(0,e),r.sigBytes-=n}return new s.init(a,n)},clone:function(){var t=o.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});i.Hasher=u.extend({cfg:o.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){u.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new p.HMAC.init(t,r).finalize(e)}}});var p=r.algo={};return r}(Math);!function(){var t=CryptoJS,e=t.lib.WordArray;t.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,i=this._map;t.clamp(),t=[];for(var n=0;n<r;n+=3)for(var o=(e[n>>>2]>>>24-n%4*8&255)<<16|(e[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|e[n+2>>>2]>>>24-(n+2)%4*8&255,s=0;4>s&&n+.75*s<r;s++)t.push(i.charAt(o>>>6*(3-s)&63));if(e=i.charAt(64))for(;t.length%4;)t.push(e);return t.join("")},parse:function(t){var r=t.length,i=this._map;(n=i.charAt(64))&&(-1!=(n=t.indexOf(n))&&(r=n));for(var n=[],o=0,s=0;s<r;s++)if(s%4){var c=i.indexOf(t.charAt(s-1))<<s%4*2,a=i.indexOf(t.charAt(s))>>>6-s%4*2;n[o>>>2]|=(c|a)<<24-o%4*8,o++}return e.create(n,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(t){function e(t,e,r,i,n,o,s){return((t=t+(e&r|~e&i)+n+s)<<o|t>>>32-o)+e}function r(t,e,r,i,n,o,s){return((t=t+(e&i|r&~i)+n+s)<<o|t>>>32-o)+e}function i(t,e,r,i,n,o,s){return((t=t+(e^r^i)+n+s)<<o|t>>>32-o)+e}function n(t,e,r,i,n,o,s){return((t=t+(r^(e|~i))+n+s)<<o|t>>>32-o)+e}for(var o=CryptoJS,s=(a=o.lib).WordArray,c=a.Hasher,a=o.algo,f=[],h=0;64>h;h++)f[h]=4294967296*t.abs(t.sin(h+1))|0;a=a.MD5=c.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,o){for(var s=0;16>s;s++){var c=t[u=o+s];t[u]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}s=this._hash.words;var a,h,u=t[o+0],p=(c=t[o+1],t[o+2]),d=t[o+3],l=t[o+4],y=t[o+5],_=t[o+6],v=t[o+7],g=t[o+8],B=t[o+9],x=t[o+10],S=t[o+11],k=t[o+12],m=t[o+13],z=t[o+14],C=t[o+15],w=s[0],D=n(D=n(D=n(D=n(D=i(D=i(D=i(D=i(D=r(D=r(D=r(D=r(D=e(D=e(D=e(D=e(D=s[1],h=e(h=s[2],a=e(a=s[3],w=e(w,D,h,a,u,7,f[0]),D,h,c,12,f[1]),w,D,p,17,f[2]),a,w,d,22,f[3]),h=e(h,a=e(a,w=e(w,D,h,a,l,7,f[4]),D,h,y,12,f[5]),w,D,_,17,f[6]),a,w,v,22,f[7]),h=e(h,a=e(a,w=e(w,D,h,a,g,7,f[8]),D,h,B,12,f[9]),w,D,x,17,f[10]),a,w,S,22,f[11]),h=e(h,a=e(a,w=e(w,D,h,a,k,7,f[12]),D,h,m,12,f[13]),w,D,z,17,f[14]),a,w,C,22,f[15]),h=r(h,a=r(a,w=r(w,D,h,a,c,5,f[16]),D,h,_,9,f[17]),w,D,S,14,f[18]),a,w,u,20,f[19]),h=r(h,a=r(a,w=r(w,D,h,a,y,5,f[20]),D,h,x,9,f[21]),w,D,C,14,f[22]),a,w,l,20,f[23]),h=r(h,a=r(a,w=r(w,D,h,a,B,5,f[24]),D,h,z,9,f[25]),w,D,d,14,f[26]),a,w,g,20,f[27]),h=r(h,a=r(a,w=r(w,D,h,a,m,5,f[28]),D,h,p,9,f[29]),w,D,v,14,f[30]),a,w,k,20,f[31]),h=i(h,a=i(a,w=i(w,D,h,a,y,4,f[32]),D,h,g,11,f[33]),w,D,S,16,f[34]),a,w,z,23,f[35]),h=i(h,a=i(a,w=i(w,D,h,a,c,4,f[36]),D,h,l,11,f[37]),w,D,v,16,f[38]),a,w,x,23,f[39]),h=i(h,a=i(a,w=i(w,D,h,a,m,4,f[40]),D,h,u,11,f[41]),w,D,d,16,f[42]),a,w,_,23,f[43]),h=i(h,a=i(a,w=i(w,D,h,a,B,4,f[44]),D,h,k,11,f[45]),w,D,C,16,f[46]),a,w,p,23,f[47]),h=n(h,a=n(a,w=n(w,D,h,a,u,6,f[48]),D,h,v,10,f[49]),w,D,z,15,f[50]),a,w,y,21,f[51]),h=n(h,a=n(a,w=n(w,D,h,a,k,6,f[52]),D,h,d,10,f[53]),w,D,x,15,f[54]),a,w,c,21,f[55]),h=n(h,a=n(a,w=n(w,D,h,a,g,6,f[56]),D,h,C,10,f[57]),w,D,_,15,f[58]),a,w,m,21,f[59]),h=n(h,a=n(a,w=n(w,D,h,a,l,6,f[60]),D,h,S,10,f[61]),w,D,p,15,f[62]),a,w,B,21,f[63]);s[0]=s[0]+w|0,s[1]=s[1]+D|0,s[2]=s[2]+h|0,s[3]=s[3]+a|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;r[n>>>5]|=128<<24-n%32;var o=t.floor(i/4294967296);for(r[15+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(n+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e.sigBytes=4*(r.length+1),this._process(),r=(e=this._hash).words,i=0;4>i;i++)n=r[i],r[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8);return e},clone:function(){var t=c.clone.call(this);return t._hash=this._hash.clone(),t}}),o.MD5=c._createHelper(a),o.HmacMD5=c._createHmacHelper(a)}(Math),function(){var t,e=CryptoJS,r=(t=e.lib).Base,i=t.WordArray,n=(t=e.algo).EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:t.MD5,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=(c=this.cfg).hasher.create(),n=i.create(),o=n.words,s=c.keySize,c=c.iterations;o.length<s;){a&&r.update(a);var a=r.update(t).finalize(e);r.reset();for(var f=1;f<c;f++)a=r.finalize(a),r.reset();n.concat(a)}return n.sigBytes=4*s,n}});e.EvpKDF=function(t,e,r){return n.create(r).compute(t,e)}}(),CryptoJS.lib.Cipher||function(t){var e=(d=CryptoJS).lib,r=e.Base,i=e.WordArray,n=e.BufferedBlockAlgorithm,o=d.enc.Base64,s=d.algo.EvpKDF,c=e.Cipher=n.extend({cfg:r.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(t){return{encrypt:function(e,r,i){return("string"==typeof r?l:p).encrypt(t,e,r,i)},decrypt:function(e,r,i){return("string"==typeof r?l:p).decrypt(t,e,r,i)}}}});e.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var a=d.mode={},f=function(t,e,r){var i=this._iv;i?this._iv=void 0:i=this._prevBlock;for(var n=0;n<r;n++)t[e+n]^=i[n]},h=(e.BlockCipherMode=r.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}})).extend();h.Encryptor=h.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize;f.call(this,t,e,i),r.encryptBlock(t,e),this._prevBlock=t.slice(e,e+i)}}),h.Decryptor=h.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=t.slice(e,e+i);r.decryptBlock(t,e),f.call(this,t,e,i),this._prevBlock=n}}),a=a.CBC=h,h=(d.pad={}).Pkcs7={pad:function(t,e){for(var r,n=(r=(r=4*e)-t.sigBytes%r)<<24|r<<16|r<<8|r,o=[],s=0;s<r;s+=4)o.push(n);r=i.create(o,r),t.concat(r)},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2]}},e.BlockCipher=c.extend({cfg:c.cfg.extend({mode:a,padding:h}),reset:function(){c.reset.call(this);var t=(e=this.cfg).iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=e.createEncryptor;else r=e.createDecryptor,this._minBufferSize=1;this._mode=r.call(e,this,t&&t.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4});var u=e.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),p=(a=(d.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext;return((t=t.salt)?i.create([1398893684,1701076831]).concat(t).concat(e):e).toString(o)},parse:function(t){var e=(t=o.parse(t)).words;if(1398893684==e[0]&&1701076831==e[1]){var r=i.create(e.slice(2,4));e.splice(0,4),t.sigBytes-=16}return u.create({ciphertext:t,salt:r})}},e.SerializableCipher=r.extend({cfg:r.extend({format:a}),encrypt:function(t,e,r,i){i=this.cfg.extend(i);var n=t.createEncryptor(r,i);return e=n.finalize(e),n=n.cfg,u.create({ciphertext:e,key:r,iv:n.iv,algorithm:t,mode:n.mode,padding:n.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,r,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),t.createDecryptor(r,i).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}})),d=(d.kdf={}).OpenSSL={execute:function(t,e,r,n){return n||(n=i.random(8)),t=s.create({keySize:e+r}).compute(t,n),r=i.create(t.words.slice(e),4*r),t.sigBytes=4*e,u.create({key:t,iv:r,salt:n})}},l=e.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:d}),encrypt:function(t,e,r,i){return r=(i=this.cfg.extend(i)).kdf.execute(r,t.keySize,t.ivSize),i.iv=r.iv,(t=p.encrypt.call(this,t,e,r.key,i)).mixIn(r),t},decrypt:function(t,e,r,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),r=i.kdf.execute(r,t.keySize,t.ivSize,e.salt),i.iv=r.iv,p.decrypt.call(this,t,e,r.key,i)}})}(),function(){for(var t=CryptoJS,e=t.lib.BlockCipher,r=t.algo,i=[],n=[],o=[],s=[],c=[],a=[],f=[],h=[],u=[],p=[],d=[],l=0;256>l;l++)d[l]=128>l?l<<1:l<<1^283;var y=0,_=0;for(l=0;256>l;l++){var v=(v=_^_<<1^_<<2^_<<3^_<<4)>>>8^255&v^99;i[y]=v,n[v]=y;var g=d[y],B=d[g],x=d[B],S=257*d[v]^16843008*v;o[y]=S<<24|S>>>8,s[y]=S<<16|S>>>16,c[y]=S<<8|S>>>24,a[y]=S,S=16843009*x^65537*B^257*g^16843008*y,f[v]=S<<24|S>>>8,h[v]=S<<16|S>>>16,u[v]=S<<8|S>>>24,p[v]=S,y?(y=g^d[d[d[x^g]]],_^=d[d[_]]):y=_=1}var k=[0,1,2,4,8,16,32,64,128,27,54];r=r.AES=e.extend({_doReset:function(){for(var t=(r=this._key).words,e=r.sigBytes/4,r=4*((this._nRounds=e+6)+1),n=this._keySchedule=[],o=0;o<r;o++)if(o<e)n[o]=t[o];else{var s=n[o-1];o%e?6<e&&4==o%e&&(s=i[s>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s]):(s=i[(s=s<<8|s>>>24)>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s],s^=k[o/e|0]<<24),n[o]=n[o-e]^s}for(t=this._invKeySchedule=[],e=0;e<r;e++)o=r-e,s=e%4?n[o]:n[o-4],t[e]=4>e||4>=o?s:f[i[s>>>24]]^h[i[s>>>16&255]]^u[i[s>>>8&255]]^p[i[255&s]]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,o,s,c,a,i)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,f,h,u,p,n),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,i,n,o,s,c){for(var a=this._nRounds,f=t[e]^r[0],h=t[e+1]^r[1],u=t[e+2]^r[2],p=t[e+3]^r[3],d=4,l=1;l<a;l++){var y=i[f>>>24]^n[h>>>16&255]^o[u>>>8&255]^s[255&p]^r[d++],_=i[h>>>24]^n[u>>>16&255]^o[p>>>8&255]^s[255&f]^r[d++],v=i[u>>>24]^n[p>>>16&255]^o[f>>>8&255]^s[255&h]^r[d++];p=i[p>>>24]^n[f>>>16&255]^o[h>>>8&255]^s[255&u]^r[d++],f=y,h=_,u=v}y=(c[f>>>24]<<24|c[h>>>16&255]<<16|c[u>>>8&255]<<8|c[255&p])^r[d++],_=(c[h>>>24]<<24|c[u>>>16&255]<<16|c[p>>>8&255]<<8|c[255&f])^r[d++],v=(c[u>>>24]<<24|c[p>>>16&255]<<16|c[f>>>8&255]<<8|c[255&h])^r[d++],p=(c[p>>>24]<<24|c[f>>>16&255]<<16|c[h>>>8&255]<<8|c[255&u])^r[d++],t[e]=y,t[e+1]=_,t[e+2]=v,t[e+3]=p},keySize:8});t.AES=e._createHelper(r)}();;angular.module("mdo-angular-cryptography",[]).provider("$crypto",function(){var t;this.setCryptographyKey=function(r){t=r},this.$get=[function(){return{getCryptoKey:function(){return t},encrypt:function(r,n){return void 0===n&&(n=t),CryptoJS.AES.encrypt(r,n).toString()},decrypt:function(r,n){return void 0===n&&(n=t),CryptoJS.AES.decrypt(r,n).toString(CryptoJS.enc.Utf8)}}}]});;if(void 0===DayPilot)var DayPilot={};if(void 0===DayPilot.Global&&(DayPilot.Global={}),function(){if(void 0===DayPilot.$){var $b;DayPilot.$=function(e){return document.getElementById(e)},DayPilot.mo=function(e,t){if((t=t||window.event).layerX){var i={x:t.layerX,y:t.layerY};return i}return t.offsetX?{x:t.offsetX,y:t.offsetY}:null},DayPilot.isKhtml=navigator&&navigator.userAgent&&-1!==navigator.userAgent.indexOf("KHTML"),DayPilot.isIE=navigator&&navigator.userAgent&&(-1!==navigator.userAgent.indexOf("MSIE")||-1!==navigator.userAgent.indexOf("Trident")),DayPilot.isIEQuirks=DayPilot.isIE&&document.compatMode&&"BackCompat"===document.compatMode,DayPilot.browser={},DayPilot.browser.ie8=($b=document.createElement("div"),$b.innerHTML="\x3c!--[if IE 8]><i></i><![endif]--\x3e",1===$b.getElementsByTagName("i").length),DayPilot.browser.ie9=function(){var e=document.createElement("div");return e.innerHTML="\x3c!--[if IE 9]><i></i><![endif]--\x3e",1===e.getElementsByTagName("i").length}(),DayPilot.browser.ielt9=function(){var e=document.createElement("div");return e.innerHTML="\x3c!--[if lt IE 9]><i></i><![endif]--\x3e",1===e.getElementsByTagName("i").length}(),DayPilot.touch={},DayPilot.touch.start=window.navigator.msPointerEnabled?"MSPointerDown":"touchstart",DayPilot.touch.move=window.navigator.msPointerEnabled?"MSPointerMove":"touchmove",DayPilot.touch.end=window.navigator.msPointerEnabled?"MSPointerUp":"touchend",DayPilot.mo2=function(e,t){if(void 0!==(t=t||window.event).offsetX){var i={x:t.offsetX+1,y:t.offsetY+1};if(!e)return i;for(var n=t.srcElement;n&&n!==e;)"SPAN"!==n.tagName&&(i.x+=n.offsetLeft,n.offsetTop>0&&(i.y+=n.offsetTop-n.scrollTop)),n=n.offsetParent;return n?i:null}if(void 0!==t.layerX){i={x:t.layerX,y:t.layerY,$f:t.target};if(!e)return i;for(n=t.target;n&&"absolute"!==n.style.position&&"relative"!==n.style.position;)n=n.parentNode,DayPilot.isKhtml&&(i.y+=n.scrollTop);for(;n&&n!==e;)i.x+=n.offsetLeft,i.y+=n.offsetTop-n.scrollTop,n=n.offsetParent;return n?i:null}return null},DayPilot.mo3=function(e,t){t=t||window.event;var i=DayPilot.page(t);if(i){var n=DayPilot.abs(e);return{x:i.x-n.x,y:i.y-n.y}}return DayPilot.mo2(e,t)},DayPilot.mc=function(e){return e.pageX||e.pageY?{x:e.pageX,y:e.pageY}:{x:e.clientX+document.documentElement.scrollLeft,y:e.clientY+document.documentElement.scrollTop}},DayPilot.Queue=function(){var e=this;this.items=[],this.index=0,this.add=function(t){e.items.push(t),e.testNext()},this.testNext=function(){"function"==typeof e.items[e.index]?setTimeout(e.doNext):(e.clear(),setTimeout(e.testNext,100))},this.doNext=function(){var t=e.items[e.index];"function"==typeof t&&(t(),e.index+=1),e.testNext()},this.clear=function(){0!==e.items.length&&(e.items=[],e.index=0)}},DayPilot.dynlist=function(e){var t={each:function(t){if(t)for(var i=0;i<e.length;i++){setTimeout(function(e){return function(){t(e)}}(e[i]))}},seqEach:function(t){t&&function i(n){if(n>=e.length)return;t(e[n]);setTimeout(i(n+1))}(0)}};return t},DayPilot.list=function(e){var t=[];if(t.each=function(e){if(e)if(t.forEach)t.forEach(e);else for(var i=0;i<this.length;i++)e(t[i],i)},t.addProps=function(e){var t=DayPilot.list(this);if(e)for(var i in e)t[i]=e[i];return t},t.last=function(){return 0===t.length?null:t[t.length-1]},t.add=function(e){var i=DayPilot.list(t);return i.push(e),i},t.map=function(e){if("function"!=typeof e)throw"DayPilot.list().map(f): Function expected";var i=DayPilot.list();return t.each(function(t){i.push(e(t))}),i},t.filter=function(e){var i=DayPilot.list();if("function"!=typeof e)throw"DayPilot.list().filter(f): Function expected";return t.each(function(t){e(t)&&i.push(t)}),i},t.concat=function(e){var t=DayPilot.list(this);return DayPilot.list(e).each(function(e){t.push(e)}),t},t.some||(t.some=function(e){if("function"!=typeof e)throw"DayPilot.list().some(f): Function expected";for(var i=0;i<this.length;i++)if(e(t[i]))return!0;return!1}),t.reduce||(t.reduce=function(e,i){if("function"!=typeof e)throw"DayPilot.list().reduce(f): Function expected";var n,a=0;if(void 0!==i)n=i;else{if(a=1,0===t.length)throw"DayPilot.list().reduce(f): No initial value and empty list";n=t[0]}for(var s=a;s<this.length;s++)n=e(n,t[s],s,this);return n}),t.isEmpty=function(){return 0===t.length},DayPilot.isArray(e))for(var i=0;i<e.length;i++)t.push(e[i]);else"object"==typeof e&&null!==e&&t.push(e);return t},DayPilot.line=function(e,t,i,n,a){var s=t,o=i,l=n;DayPilot.deg(e,t,i,n);if(t<n){var r=t;t=n,n=r,r=e,e=i,i=r}var d=DayPilot.deg(e,t,i,n),h=function(){var a=Math.abs(e-i),s=Math.abs(t-n);return Math.sqrt(a*a+s*s)}(),c=function(){var a=Math.abs(e-i),s=Math.abs(t-n);return(e+i)/2-Math.sqrt(a*a+s*s)/2}(),u=(t+n)/2,f=document.createElement("div");f.setAttribute("style","border:1px solid black;width:"+h+"px;height:0px;-moz-transform:rotate("+d+"deg);-webkit-transform:rotate("+d+"deg);-ms-transform:rotate("+d+"deg);transform:rotate("+d+"deg);position:absolute;top:"+u+"px;left:"+c+"px;");var v=document.createElement("div");if(v.appendChild(f),a){var p=l-(h=6),y=o-h;d=d;l>s&&(d-=180);var g=document.createElement("div");g.style.borderColor="transparent black transparent transparent",g.style.borderWidth=h+"px",g.style.borderStyle="solid",g.style.position="absolute",g.style.left=y+"px",g.style.top=p+"px",g.style.transform="rotate("+d+"deg)",v.appendChild(g)}return v},DayPilot.deg=function(e,t,i,n){var a,s=Math.abs(e-i),o=Math.abs(t-n),l=(e+i)/2,r=(t+n)/2,d=Math.sqrt(s*s+o*o),h=l-d/2,c=r;s=d/2,a=Math.abs(l-h);var u=((o=Math.sqrt(Math.abs(e-h)*Math.abs(e-h)+Math.abs(t-c)*Math.abs(t-c)))*o-s*s-a*a)/(2*s*a);return 180*Math.acos(u)/Math.PI},DayPilot.complete=function(e){"complete"!==document.readyState?(DayPilot.complete.list||(DayPilot.complete.list=[],DayPilot.re(document,"readystatechange",function(){if("complete"===document.readyState){for(var e=0;e<DayPilot.complete.list.length;e++){(0,DayPilot.complete.list[e])()}DayPilot.complete.list=[]}})),DayPilot.complete.list.push(e)):e()},DayPilot.page=function(e){return void 0!==(e=e||window.event).pageX?{x:e.pageX,y:e.pageY}:void 0!==e.clientX?{x:e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,y:e.clientY+document.body.scrollTop+document.documentElement.scrollTop}:null},DayPilot.abs=function(e,t){if(!e)return null;var i={x:e.offsetLeft,y:e.offsetTop,w:e.clientWidth,h:e.clientHeight,toString:function(){return"x:"+this.x+" y:"+this.y+" w:"+this.w+" h:"+this.h}};if(e.getBoundingClientRect){var n=null;try{n=e.getBoundingClientRect()}catch(t){n={top:e.offsetTop,$w:e.offsetLeft}}i.x=n.left,i.y=n.top;var a=DayPilot.doc();i.x-=a.clientLeft||0,i.y-=a.clientTop||0;var s=DayPilot.pageOffset();if(i.x+=s.x,i.y+=s.y,t){var o=DayPilot.absOffsetBased(e,!1);t=DayPilot.absOffsetBased(e,!0);i.x+=t.x-o.x,i.y+=t.y-o.y,i.w=t.w,i.h=t.h}return i}return DayPilot.absOffsetBased(e,t)},DayPilot.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},DayPilot.absOffsetBased=function(e,t){for(var i={x:e.offsetLeft,y:e.offsetTop,w:e.clientWidth,h:e.clientHeight,toString:function(){return"x:"+this.x+" y:"+this.y+" w:"+this.w+" h:"+this.h}};DayPilot.op(e);)e=DayPilot.op(e),i.x-=e.scrollLeft,i.y-=e.scrollTop,t&&(i.x<0&&(i.w+=i.x,i.x=0),i.y<0&&(i.h+=i.y,i.y=0),e.scrollLeft>0&&i.x+i.w>e.clientWidth&&(i.w-=i.x+i.w-e.clientWidth),e.scrollTop&&i.y+i.h>e.clientHeight&&(i.h-=i.y+i.h-e.clientHeight)),i.x+=e.offsetLeft,i.y+=e.offsetTop;var n=DayPilot.pageOffset();return i.x+=n.x,i.y+=n.y,i},DayPilot.wd=function(){var e=DayPilot.isIEQuirks,t=document.documentElement.clientHeight;e&&(t=document.body.clientHeight);var i=document.documentElement.clientWidth;e&&(i=document.body.clientWidth);var n=document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop,a=document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft,s={};return s.width=i,s.height=t,s.scrollTop=n,s.scrollLeft=a,s},DayPilot.op=function(e){try{return e.offsetParent}catch(e){return document.body}},DayPilot.distance=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},DayPilot.doc=function(){var e=document.documentElement;return e&&e.clientHeight?e:document.body},DayPilot.pageOffset=function(){if("undefined"!=typeof pageXOffset)return{x:pageXOffset,y:pageYOffset};var e=DayPilot.doc();return{x:e.scrollLeft,y:e.scrollTop}},DayPilot.ac=function(e,t){if(!t)t=[];for(var i=0;e.children&&i<e.children.length;i++)t.push(e.children[i]),DayPilot.ac(e.children[i],t);return t},DayPilot.indexOf=function(e,t){if(!e||!e.length)return-1;for(var i=0;i<e.length;i++)if(e[i]===t)return i;return-1},DayPilot.contains=function(e,t){return!!e&&(e===t&&!DayPilot.isArray(e)||-1!==DayPilot.indexOf(e,t))},DayPilot.rfa=function(e,t){var i=DayPilot.indexOf(e,t);-1!==i&&e.splice(i,1)},DayPilot.sheet=function(){var e=document.createElement("style");e.setAttribute("type","text/css"),e.styleSheet||e.appendChild(document.createTextNode("")),(document.head||document.getElementsByTagName("head")[0]).appendChild(e);var t=!!e.styleSheet,i={rules:[],commit:function(){try{t&&(e.styleSheet.cssText=this.rules.join("\n"))}catch(e){}},add:function(i,n,a){if(t)this.rules.push(i+"{"+n+"}");else if(e.sheet.insertRule)e.sheet.insertRule(i+"{"+n+"}",a);else{if(!e.sheet.addRule)throw"No CSS registration method found";e.sheet.addRule(i,n,a)}}};return i},DayPilot.Debug=function(e){var t=this;this.printToBrowserConsole=!1,this.messages=[],this.$2O=null,this.clear=function(){this.messages=[],t.$2O&&(t.$2O.innerHTML="")},this.hide=function(){DayPilot.de(t.$2O),t.$2O=null},this.show=function(){t.$2O&&t.hide();var i=e.nav.top,n=document.createElement("div");n.style.position="absolute",n.style.top="0px",n.style.bottom="0px",n.style.left="0px",n.style.right="0px",n.style.backgroundColor="black",n.style.color="#ccc",n.style.overflow="auto",n.style.webkitUserSelect="auto",n.style.MozUserSelect="all",n.onclick=function(){t.hide()};for(var a=0;a<this.messages.length;a++){var s=t.messages[a].$2P();n.appendChild(s)}this.$2O=n,i.appendChild(n)},this.message=function(e,t){var i={};i.time=new DayPilot.Date,i.level=t||"debug",i.text=e,i.$2P=function(){var e=document.createElement("div");switch(e.innerHTML=i.time+" ("+i.level+"): "+i.text,i.level){case"error":e.style.color="red";break;case"warning":e.style.color="orange";break;case"info":e.style.color="white"}return e},this.messages.push(i),this.printToBrowserConsole&&"undefined"!=typeof console&&console.log(i)}},DayPilot.re=function(e,t,i){if(i)if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent){e.attachEvent("on"+t,function(t){i.call(e,t)})}},DayPilot.ue=function(e,t,i){e.removeEventListener?e.removeEventListener(t,i,!1):e.detachEvent&&e.detachEvent("on"+t,i)},DayPilot.tr=function(e){return e?e.replace(/^\s+|\s+$/g,""):""},DayPilot.ds=function(e){return DayPilot.Date.toStringSortable(e)},DayPilot.gs=function(e,t){var i=e;if(i.currentStyle)var n=i.currentStyle[t];else if(window.getComputedStyle)n=document.defaultView.getComputedStyle(i,null).getPropertyValue(t);return void 0===n&&(n=""),n},DayPilot.ea=function(e){for(var t="",i=0;i<e.length;i++)(e[i]||"number"==typeof e[i])&&(e[i].isDayPilotDate?e[i]=e[i].toStringSortable():e[i].getFullYear&&(e[i]=DayPilot.ds(e[i])),t+=encodeURIComponent(e[i])),i+1<e.length&&(t+="&");return t},DayPilot.he=function(e){var t=e.replace(/&/g,"&amp;");return t=(t=(t=t.replace(/</g,"&lt;")).replace(/>/g,"&gt;")).replace(/"/g,"&quot;")},DayPilot.ci=function(e){var t=e.cellIndex;if(t&&t>0)return t;var i=e.parentNode,n=i.cells.length;for(t=0;t<n;t++)if(i.cells[t]===e)return t;return null},DayPilot.us=function(e){if(e){e.setAttribute("unselectable","on"),e.style.userSelect="none",e.style.MozUserSelect="none",e.style.KhtmlUserSelect="none",e.style.webkitUserSelect="none";for(var t=0;t<e.childNodes.length;t++)1===e.childNodes[t].nodeType&&DayPilot.us(e.childNodes[t])}},DayPilot.pu=function(e){var t,i,n,a=e.attributes;if(a)for(i=a.length,t=0;t<i;t+=1)a[t]&&"function"==typeof e[n=a[t].name]&&(e[n]=null);if(a=e.childNodes)for(i=a.length,t=0;t<i;t+=1)DayPilot.pu(e.childNodes[t])},DayPilot.puc=function(e){var t,i=e.childNodes;if(i){var n=i.length;for(t=0;t<n;t+=1)DayPilot.pu(e.childNodes[t])}},DayPilot.de=function(e){if(e)if(DayPilot.isArray(e))for(var t=0;t<e.length;t++)DayPilot.de(e[t]);else e.parentNode&&e.parentNode.removeChild(e)},DayPilot.gr=function(e){for(var t=0,i=e.parentNode;i.previousSibling;)"TR"===(i=i.previousSibling).tagName&&t++;return t},DayPilot.fade=function(e,t,i){if(e){clearTimeout(e.messageTimeout);var n="none"!==e.style.display,a=t>0,s=t<0;if(0!==t){if(a?e.status="in":s&&(e.status="out"),a&&!n)e.target=parseFloat(e.style.opacity),e.opacity=0,e.style.opacity=0,e.style.filter="alpha(opacity=0)",e.style.display="";else if(s&&!e.target)e.target=e.style.opacity;else{var o=e.opacity,l=Math.floor(10*(o+t))/10;a&&l>e.target&&(l=e.target),s&&l<0&&(l=0);var r=100*l;e.opacity=l,e.style.opacity=l,e.style.filter="alpha(opacity="+r+")"}if(a&&(e.opacity>=e.target||e.opacity>=1)||s&&e.opacity<=0){if(e.target=null,s){e.style.opacity=e.target,e.opacity=e.target;var d=e.target?"alpha(opacity="+100*e.target+")":null;e.style.filter=d,e.style.display="none"}i&&"function"==typeof i&&(e.status=null,i())}else e.messageTimeout=setTimeout(function(){DayPilot.fade(e,t,i)},50)}}},DayPilot.sw=function(e){return e?e.offsetWidth-e.clientWidth:0},DayPilot.swa=function(){var e=document.createElement("div");e.style.position="absolute",e.style.top="-2000px",e.style.left="-2000px",e.style.width="200px",e.style.height="100px",e.style.overflow="auto";var t=document.createElement("div");t.style.width="300px",t.style.height="300px",e.appendChild(t),document.body.appendChild(e);var i=DayPilot.sw(e);return document.body.removeChild(e),i},DayPilot.sh=function(e){return e?e.offsetHeight-e.clientHeight:0},DayPilot.guid=function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return""+e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},DayPilot.ua=function(e){if("string"==typeof e||"number"==typeof e)return[e];for(var t={},i=[],n=0,a=e.length;n<a;++n)e[n]in t||(i.push(e[n]),t[e[n]]=1);return i},DayPilot.am=function(){return"undefined"==typeof angular?null:(DayPilot.am.cached||(DayPilot.am.cached=angular.module("daypilot",[])),DayPilot.am.cached)},function(){DayPilot.pop=function(e,t){var i={w:e.offsetWidth,h:e.offsetHeight,x:parseInt(e.style.left),y:parseInt(e.style.top)};i.height=e.style.height,i.width=e.style.width,i.top=e.style.top,i.left=e.style.left,i.toString=function(){return"w: "+this.w+" h:"+this.h};var n={finished:null,vertical:"center",horizontal:"center"};if(t)for(var a in t)n[a]=t[a];e.style.visibility="hidden",e.style.display="";var s=function(e){var t={fast:function(){var e=[];e.time=9;for(var t=.1;t<=1;t+=.04)e.push(t),t;return e},slow:function(){var e=[];e.time=15;for(var t=.1;t<=1;t+=.04)e.push(t),t;return e},jump:function(){var e,t=[];t.time=10;for(var i=.08,n=e=.1;n<1.2;n+=i)t.push(n),e=n;i=.03;for(var n=e;n>.8;n-=i)t.push(n),e=n;for(var n=e;n<=1;n+=i)t.push(n),e=n;return t}};t[e]||(e="fast");return t[e]()}(t.animation||"fast");s.div=e,s.i=0,s.target=i,s.config=n,function e(t){var i=t.div;var n=t[t.i];var a=n*t.target.h;var s;switch(t.config.vertical){case"center":s=t.target.y-(a-t.target.h)/2;break;case"top":s=t.target.y;break;case"bottom":s=t.target.y-(a-t.target.h);break;default:throw"Unexpected 'vertical' value."}var o=n*t.target.w;var l;switch(t.config.horizontal){case"left":l=t.target.x;break;case"center":l=t.target.x-(o-t.target.w)/2;break;case"right":l=t.target.x-(o-t.target.w);break;default:throw"Unexpected 'horizontal' value."}var r=DayPilot.wd();var d=r.height+r.scrollTop-(s+a);d<0&&(s+=d);var h=r.width-(l+o);h<0&&(l+=h);i.style.height=a+"px";i.style.top=s+"px";i.style.width=o+"px";i.style.left=l+"px";i.style.visibility="visible";t.i++;t.i<t.length-1?setTimeout(function(t){return function(){e(t)}}(t),t.time):(i.style.width=t.target.width,i.style.height=t.target.height,i.style.top=t.target.top,i.style.left=t.target.left,"function"==typeof t.config.finished&&t.config.finished())}(s)}}(),DayPilot.Util={},DayPilot.Util.addClass=function(e,t){if(t&&e)if(DayPilot.isArray(e))for(var i=0;i<e.length;i++)DayPilot.Util.addClass(e[i],t);else e.className?new RegExp("(^|\\s)"+t+"($|\\s)").test(e.className)||(e.className=e.className+" "+t):e.className=t},DayPilot.Util.addClassToString=function(e,t){return e?new RegExp("(^|\\s)"+t+"($|\\s)").test(e)?e:e+" "+t:t},DayPilot.Util.removeClassFromString=function(e,t){if(!e)return"";var i=new RegExp("(^|\\s)"+t+"($|\\s)");return e.replace(i," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")},DayPilot.Util.removeClass=function(e,t){if(e)if(DayPilot.isArray(e))for(var i=0;i<e.length;i++)DayPilot.Util.removeClass(e[i],t);else{var n=new RegExp("(^|\\s)"+t+"($|\\s)");e.className=e.className.replace(n," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}},DayPilot.Util.props=function(e){var t=[];for(var i in e)t.push(i),t.push(e[i]);return t.join("-")},DayPilot.Util.propArray=function(e,t){var i=[];if(!e||!e.length)return i;for(var n=0;n<e.length;n++)i.push(e[n][t]);return i},DayPilot.Util.updatePropsFromArray=function(e,t,i){for(var n=0;n<i.length;n++)e[n][t]=i[n]},DayPilot.Util.copyProps=function(e,t,i){if(e)if(void 0===i)for(var n in e)void 0!==e[n]&&(t[n]=e[n]);else for(var a=0;a<i.length;a++){void 0!==e[n=i[a]]&&(t[n]=e[n])}},DayPilot.Util.createArrayCopy=function(e,t){if(!DayPilot.isArray(e))return[];for(var i=[],n=0;n<e.length;n++){var a={};DayPilot.Util.copyProps(e[n],a,t),i.push(a)}return i},DayPilot.Util.avg=function(e,t){return(e+t)/2},DayPilot.Util.div=function(e,t,i,n,a){var s=document.createElement("div");return(t||i||n||a)&&(n<0&&(t+=n,n*=-1),a<0&&(i+=a,a*=-1),s.style.position="absolute","number"==typeof t&&(s.style.left=t+"px"),"number"==typeof i&&(s.style.top=i+"px"),"number"==typeof n&&(s.style.width=n+"px"),"number"==typeof a&&(s.style.height=a+"px")),e&&e.appendChild(s),s},DayPilot.Util.overlaps=function(e,t,i,n){return e=e.isDayPilotDate?e.getTime():e,i=i.isDayPilotDate?i.getTime():i,t=t.isDayPilotDate?t.getTime():t,n=n.isDayPilotDate?n.getTime():n,!(t<=i||e>=n)},DayPilot.Util.isMouseEvent=function(e){return!!navigator.msPointerEnabled&&(!!e.pointerType&&("mouse"===e.pointerType||4===e.pointerType))},DayPilot.Util.mouseButton=function(e){var t={};if(void 0===(e=e||window.event).which)switch(e.button){case 1:t.left=!0;break;case 4:t.middle=!0;break;case 2:t.right=!0;break;case 0:t.unknown=!0}else switch(e.which){case 1:t.left=!0;break;case 2:t.middle=!0;break;case 3:t.right=!0}return t},DayPilot.Util.membersPlain=function(e){var t=DayPilot.Util.members(e,2),i=function(e){for(var t=0;t<e.length;t++){var i=e[t],n=i.name;i.obsolete&&(n+=" (obsolete)"),i.noCssOnly&&(n+=" (!cssOnly)"),i.aspnet&&(n+=" (ASP.NET)"),i.mvc&&(n+="(MVC)"),e[t]=n}};return i(t.events),i(t.methods),i(t.properties),t},DayPilot.Util.members=function(e,t){var i=[],n=[],a=[],s=e&&e.members?e.members.obsolete:[],o=e&&e.members?e.members.noCssOnly:[],l=e&&e.members?e.members.ignore:[],r=e&&e.members&&e.members.ignoreFilter?e.members.ignoreFilter:function(){return!1};for(var d in e)if(0!==d.indexOf("$")&&0!==d.indexOf("_")&&0!==d.indexOf("number")&&0!==d.indexOf("is")&&"v"!==d&&!DayPilot.contains(l,d)&&!r(d))if(0!==d.indexOf("on"))if("function"!=typeof e[d])if("object"!=typeof e[d])a.push(d);else{var h=e[d];if(0===t){a.push(d);continue}if(h&&h.nodeType>0){a.push(d);continue}if(h instanceof DayPilot.Bubble){a.push(d);continue}if(h instanceof DayPilot.Date){a.push(d);continue}if(h instanceof DayPilot.Menu){a.push(d);continue}if(h instanceof DayPilot.Scheduler){a.push(d);continue}if(DayPilot.isArray(h)){a.push(d);continue}null===h&&a.push(d);var c=null;"number"==typeof t&&(c=t-1);for(var u=DayPilot.Util.members(h,c),f=0;f<u.events.length;f++)i.push(d+"."+u.events[f].name);for(f=0;f<u.methods.length;f++)n.push(d+"."+u.methods[f].name);for(f=0;f<u.properties.length;f++)a.push(d+"."+u.properties[f].name)}else n.push(d);else i.push(d);i.sort(),n.sort(),a.sort();var v=function(e){for(var t=0;t<e.length;t++){var i=e[t],n={};n.name=i,e[t]=n,DayPilot.contains(s,i)&&(n.obsolete=!0),DayPilot.contains(o,i)&&(n.noCssOnly=!0),-1!==i.indexOf("CallBack")&&(n.aspnet=!0,n.mvc=!0),-1!==i.indexOf("PostBack")&&(n.aspnet=!0),-1!==i.indexOf("Notify")&&(n.aspnet=!0,n.mvc=!0)}};return v(i),v(n),v(a),{events:i,methods:n,properties:a}},DayPilot.Util.replaceCharAt=function(e,t,i){return e.substr(0,t)+i+e.substr(t+i.length)},DayPilot.Util.evalVariable=function(str,$0G){if($0G=$0G||["object"],null===str||void 0===str)return null;if(-1!==DayPilot.indexOf($0G,typeof str))return str;if("string"!=typeof str)throw"Unable to resolve a variable name (not a string).";if(!/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(str))throw"Invalid variable name: "+str;return eval(str)},DayPilot.Util.evalFunction=function(str){if(null===str)return null;if("function"==typeof str)return str;if("string"!=typeof str)throw"Unable to resolve a function (not a string).";if(!/^\(?function/.test(str))throw"Invalid function string";return eval("("+str+")")},DayPilot.Util.parseJSON=function(e){return JSON&&JSON.parse?JSON.parse(e):DayPilot.JSON.parse(e)},DayPilot.Util.isNullOrUndefined=function(e){return null===e||void 0===e},DayPilot.Util.log=function(e){window.console&&window.console.log&&window.console.log(e)},DayPilot.Areas={},DayPilot.Areas.attach=function(e,t,i){var n=i.areas,a=i.allowed||function(){return!0};DayPilot.re(e,"mousemove",function(i){!e.active&&a()&&DayPilot.Areas.showAreas(e,t,i,n)}),DayPilot.re(e,"mouseout",function(t){DayPilot.Areas.hideAreas(e,t)}),n=$0K(t,n);for(var s=0;s<n.length;s++){var o=n[s];if("Visible"===(o.v||"Visible")){var l=DayPilot.Areas.createArea(e,t,o);e.appendChild(l)}}};var $0K=function(e,t){return DayPilot.isArray(t)||(t=e.areas)||(e.cache?t=e.cache.areas:e.data&&(t=e.data.areas)),t};DayPilot.Areas.showAreas=function(e,t,i,n){if(!DayPilot.Global.resizing&&!DayPilot.Global.moving){if(DayPilot.Areas.all&&DayPilot.Areas.all.length>0)for(var a=0;a<DayPilot.Areas.all.length;a++){var s=DayPilot.Areas.all[a];s!==e&&DayPilot.Areas.hideAreas(s,i)}if(!e.active&&(e.active={},DayPilot.isArray(n)||(n=t.areas)||(t.cache?n=t.cache.areas:t.data&&(n=t.data.areas)),n&&0!==n.length&&!(e.areas&&e.areas.length>0))){e.areas=[];for(a=0;a<n.length;a++){var o=n[a];if("Hover"===(o.v||"Visible")){var l=DayPilot.Areas.createArea(e,t,o);e.areas.push(l),e.appendChild(l),DayPilot.Areas.all.push(e)}}e.active.children=DayPilot.ac(e)}}},DayPilot.Areas.createArea=function(e,t,i){var n=document.createElement("div");n.isActiveArea=!0,n.setAttribute("unselectable","on");var a=i.w||i.width,s=i.h||i.height,o=i.css||i.className;if(void 0!==i.style&&n.setAttribute("style",i.style),n.style.position="absolute",void 0!==a&&(n.style.width=a+"px"),void 0!==s&&(n.style.height=s+"px"),void 0!==i.right&&(n.style.right=i.right+"px"),void 0!==i.top&&(n.style.top=i.top+"px"),void 0!==i.left&&(n.style.left=i.left+"px"),void 0!==i.bottom&&(n.style.bottom=i.bottom+"px"),void 0!==i.html&&i.html&&(n.innerHTML=i.html),o&&(n.className=o),i.backColor&&(n.style.background=i.backColor),"ResizeEnd"===i.action||"ResizeStart"===i.action||"Move"===i.action){if(t.calendar.isCalendar)switch(i.action){case"ResizeEnd":i.cursor="s-resize",i.dpBorder="bottom";break;case"ResizeStart":i.cursor="n-resize",i.dpBorder="top";break;case"Move":i.cursor="move"}if(t.calendar.isScheduler||t.calendar.isMonth)switch(i.action){case"ResizeEnd":i.cursor="e-resize",i.dpBorder="right";break;case"ResizeStart":i.cursor="w-resize",i.dpBorder="left";break;case"Move":i.cursor="move"}n.onmousemove=function(e,t,i){return function(t){t=t||window.event;e.style.cursor=i.cursor,i.dpBorder&&(e.dpBorder=i.dpBorder),t.cancelBubble=!0}}(e,0,i),n.onmouseout=function(e,t,i){return function(t){e.style.cursor=""}}(e)}if("Move"===i.action&&t.isEvent&&t.calendar.internal.touch){var l=function(e,t,i){return function(i){i.cancelBubble=!0;var n=t.calendar.internal.touch,a=i.touches?i.touches[0]:i,s={x:a.pageX,y:a.pageY};t.calendar.coords=n.relativeCoords(i),n.preventEventTap=!0,n.startMoving(e,s)}}(e,t);DayPilot.re(n,DayPilot.touch.start,l)}return"Move"===i.action&&t.isRow&&t.calendar.internal.touch,"Bubble"===i.action&&t.isEvent&&(n.onmousemove=function(e,t,i){return function(e){t.calendar.bubble&&t.calendar.bubble.showEvent(t)}}(0,t),n.onmouseout=function(e,t,i){return function(e){void 0!==DayPilot.Bubble&&t.calendar.bubble&&t.calendar.bubble.hideOnMouseOut()}}(0,t)),"HoverMenu"===i.action&&(n.onmousemove=function(e,t,i){return function(e){var n=i.menu;"string"==typeof n&&(n=DayPilot.Util.evalVariable(n)),n&&n.show&&(n.visible?n.source&&void 0!==n.source.id&&n.source.id!==t.id&&n.show(t):n.show(t),n.cancelHideTimeout())}}(0,t,i),n.onmouseout=function(e,t,i){return function(e){var t=i.menu;"string"==typeof t&&(t=DayPilot.Util.evalVariable(t)),t&&t.hideOnMouseOver&&t.delayedHide()}}(0,0,i)),n.onmousedown=function(e,t,i){return function(e){if("function"==typeof i.onmousedown&&i.onmousedown(e),"Move"===i.action&&t.isRow){var n=t.$.row;t.calendar.internal.rowtools.startMoving(n)}"Move"!==i.action&&"ResizeEnd"!==i.action&&"ResizeStart"!==i.action&&((e=e||window.event).cancelBubble=!0)}}(0,t,i),n.onclick=function(e,t,i){return function(e){e=e||window.event;switch(i.action){case"JavaScript":var n=i.js;"string"==typeof n&&(n=DayPilot.Util.evalFunction(i.js)),"function"==typeof n&&n.call(this,t);break;case"ContextMenu":var a=i.menu;"string"==typeof a&&(a=DayPilot.Util.evalVariable(a)),a&&a.show&&a.show(t);break;case"CallBack":alert("callback not implemented yet, id: "+i.id)}e.cancelBubble=!0}}(0,t,i),n},DayPilot.Areas.all=[],DayPilot.Areas.hideAreas=function(e,t){if(e&&e&&e.active){var i=e.active,n=e.areas;if(i&&i.children)if(t=t||window.event){var a=t.toElement||t.relatedTarget;if(~DayPilot.indexOf(i.children,a))return}n&&0!==n.length?(DayPilot.de(n),e.active=null,e.areas=[],DayPilot.rfa(DayPilot.Areas.all,e),i.children=null):e.active=null}},DayPilot.Areas.hideAll=function(e){if(DayPilot.Areas.all&&0!==DayPilot.Areas.all.length)for(var t=0;t<DayPilot.Areas.all.length;t++)DayPilot.Areas.hideAreas(DayPilot.Areas.all[t],e)},DayPilot.Action=function(e,t,i,n){this.calendar=e,this.isAction=!0,this.action=t,this.params=i,this.data=n,this.notify=function(){e.internal.invokeEvent("Immediate",this.action,this.params,this.data)},this.auto=function(){e.internal.invokeEvent("Notify",this.action,this.params,this.data)},this.queue=function(){e.queue.add(this)},this.toJSON=function(){var e={};return e.name=this.action,e.params=this.params,e.data=this.data,e}},DayPilot.Selection=function(e,t,i,n){this.menuType="selection",this.start=e.isDayPilotDate?e:new DayPilot.Date(e),this.end=t.isDayPilotDate?t:new DayPilot.Date(t),this.resource=i,this.root=n,this.calendar=n,this.toJSON=function(e){var t={};return t.start=this.start,t.end=this.end,t.resource=this.resource,t}},DayPilot.Link=function(e,t){this.isLink=!0,this.data=e,this.calendar=t,this.to=function(){return this.data.to},this.from=function(){return this.data.from},this.type=function(){return this.data.type},this.id=function(){return this.data.id},this.toJSON=function(){var e={};return e.from=this.data.from,e.to=this.data.to,e.id=this.data.id,e.type=this.data.type,e}},DayPilot.Args=function(){this.isArgs=!0,this.preventDefault=function(){this.preventDefault.value=!0}},DayPilot.Event=function(e,t,i){var n=this;this.calendar=t,this.data=e||{},this.part=i||{},void 0===this.data.id&&(this.data.id=this.data.value);var a={},s=["id","text","start","end","resource"];this.isEvent=!0,this.temp=function(){if(a.dirty)return a;for(var e=0;e<s.length;e++)a[s[e]]=n.data[s[e]];return a.dirty=!0,a},this.copy=function(){var e={};return DayPilot.Util.copyProps(n.data,e),e},this.commit=function(){if(a.dirty){for(var e=0;e<s.length;e++)n.data[s[e]]=a[s[e]];a.dirty=!1}},this.dirty=function(){return a.dirty},this.id=function(e){if(void 0===e)return n.data.id;this.temp().id=e},this.value=function(e){if(void 0===e)return n.id();n.id(e)},this.text=function(e){if(void 0===e)return n.data.text;this.temp().text=e,this.client.innerHTML(e)},this.start=function(e){if(void 0===e)return new DayPilot.Date(n.data.start);this.temp().start=new DayPilot.Date(e)},this.end=function(e){if(void 0===e)return t&&t.internal.adjustEndNormalize?t.internal.adjustEndNormalize(new DayPilot.Date(n.data.end)):new DayPilot.Date(n.data.end);this.temp().end=new DayPilot.Date(e)},this.rawend=function(){if("undefined"==typeof $0H)return t&&t.internal.adjustEndIn?t.internal.adjustEndIn(new DayPilot.Date(n.data.end)):new DayPilot.Date(n.data.end);this.temp().end=new DayPilot.Date($0H)},this.partStart=function(){return new DayPilot.Date(this.part.start)},this.partEnd=function(){return new DayPilot.Date(this.part.end)},this.row=function(){return this.resource()},this.allday=function(){if("undefined"==typeof $0H)return n.data.allday;this.temp().allday=$0H},this.isAllDay=this.allday,this.resource=function(e){if(void 0===e)return n.data.resource;this.temp().resource=e},this.recurrent=function(){return n.data.recurrent},this.recurrentMasterId=function(){return n.data.recurrentMasterId},this.useBox=function(){return this.part.box},this.staticBubbleHTML=function(){return this.bubbleHtml()},this.bubbleHtml=function(){return n.cache&&n.cache.bubbleHtml||n.data.bubbleHtml},this.tag=function(e){if(n.data.tags)return n.data.tags[e];var t=n.data.tag;if(!t)return null;if(void 0===e)return n.data.tag;for(var i=n.calendar.tagFields,a=-1,s=0;s<i.length;s++)e===i[s]&&(a=s);if(-1===a)throw"Field name not found.";return t[a]},this.client={},this.client.innerHTML=function(e){if(void 0===e)return n.cache&&void 0!==n.cache.html?n.cache.html:void 0!==n.data.html?n.data.html:n.data.text;n.data.html=e},this.client.html=this.client.innerHTML,this.client.header=function(e){if(void 0===e)return n.data.header;n.data.header=e},this.client.cssClass=function(e){if(void 0===e)return n.data.cssClass;n.data.cssClass=e},this.client.toolTip=function(e){if(void 0===e)return n.cache&&void 0!==n.cache.toolTip?n.cache.toolTip:void 0!==n.data.toolTip?n.data.toolTip:n.data.text;n.data.toolTip=e},this.client.backColor=function(e){if(void 0===e)return n.cache&&void 0!==n.cache.backColor?n.cache.backColor:void 0!==n.data.backColor?n.data.backColor:n.calendar.eventBackColor;n.data.backColor=e},this.client.borderColor=function(e){if(void 0===e)return n.cache&&void 0!==n.cache.borderColor?n.cache.borderColor:void 0!==n.data.borderColor?n.data.borderColor:n.calendar.eventBorderColor;n.data.borderColor=e},this.client.barColor=function(e){if(void 0===e)return n.cache&&void 0!==n.cache.barColor?n.cache.barColor:void 0!==n.data.barColor?n.data.barColor:n.calendar.durationBarColor;n.data.barColor=e},this.client.barVisible=function(e){if(void 0===e)return n.cache&&void 0!==n.cache.barHidden?!n.cache.barHidden:n.calendar.durationBarVisible&&!n.data.barHidden;n.data.barHidden=!e},this.client.contextMenu=function(e){if(void 0===e){if(n.oContextMenu)return n.oContextMenu;var t=n.cache?n.cache.contextMenu:n.data.contextMenu;return t?DayPilot.Util.evalVariable(t):null}n.oContextMenu=e},this.client.moveEnabled=function(e){if(void 0===e)return n.cache&&void 0!==n.cache.moveDisabled?!n.cache.moveDisabled:"Disabled"!==n.calendar.eventMoveHandling&&!n.data.moveDisabled;n.data.moveDisabled=!e},this.client.resizeEnabled=function(e){if(void 0===e)return n.cache&&void 0!==n.cache.resizeDisabled?!n.cache.resizeDisabled:"Disabled"!==n.calendar.eventResizeHandling&&!n.data.resizeDisabled;n.data.resizeDisabled=!e},this.client.rightClickEnabled=function(e){if(void 0===e)return n.cache&&void 0!==n.cache.rightClickDisabled?!n.cache.rightClickDisabled:"Disabled"!==n.calendar.rightClickHandling&&!n.data.rightClickDisabled;n.data.rightClickDisabled=!e},this.client.clickEnabled=function(e){if(void 0===e)return n.cache&&void 0!==n.cache.clickDisabled?!n.cache.clickDisabled:"Disabled"!==n.calendar.clickHandling&&!n.data.clickDisabled;n.data.clickDisabled=!e},this.client.deleteEnabled=function(e){if(void 0===e)return n.cache&&void 0!==n.cache.deleteDisabled?!n.cache.deleteDisabled:"Disabled"!==n.calendar.eventDeleteHandling&&!n.data.deleteDisabled;n.data.deleteDisabled=!e},this.client.doubleClickEnabled=function(e){if(void 0===e)return n.cache&&void 0!==n.cache.doubleClickDisabled?!n.cache.doubleClickDisabled:"Disabled"!==n.calendar.eventDoubleClickHandling&&!n.data.doubleClickDisabled;n.data.doubleClickDisabled=!e},this.client.deleteClickEnabled=function(e){if(void 0===e)return n.cache&&void 0!==n.cache.deleteDisabled?!n.cache.deleteDisabled:"Disabled"!==n.calendar.eventDeleteHandling&&!n.data.deleteDisabled;n.data.deleteDisabled=!e},this.toJSON=function(e){var t={};if(t.value=this.id(),t.id=this.id(),t.text=this.text(),t.start=this.start().toJSON(),t.end=this.end().toJSON(),t.resource=this.resource(),t.isAllDay=!1,t.recurrentMasterId=this.recurrentMasterId(),t.join=this.data.join,t.tag={},n.data.tags)for(var i in n.data.tags)n.data.tags.hasOwnProperty(i)&&(t.tag[i]=""+n.data.tags[i]);else if(n.calendar.tagFields)for(var a=n.calendar.tagFields,s=0;s<a.length;s++)t.tag[a[s]]=this.tag(a[s]);return t}},DayPilot.Task=function(e,t){if(!e)throw"Trying to initialize DayPilot.Task with null data parameter";var i=this,n=null;if(e instanceof DayPilot.Event)n=e,this.data=e.data.task;else{if(e instanceof DayPilot.Task)return e;e.isTaskWrapper?this.data=e.data:this.data=e}var a={},s=["id","text","start","end","complete","type"];this.isTask=!0,this.calendar=t,this.temp=function(){if(a.dirty)return a;for(var e=0;e<s.length;e++)a[s[e]]=i.data[s[e]];return a.dirty=!0,a},this.copy=function(){var e={};return DayPilot.Util.copyProps(i.data,e),e},this.commit=function(){if(a.dirty){for(var e=0;e<s.length;e++)i.data[s[e]]=a[s[e]];a.dirty=!1}},this.dirty=function(){return a.dirty},this.id=function(e){if(void 0===e)return i.data.id;this.temp().id=e},this.text=function(e){if(void 0===e)return i.data.text;this.temp().text=e,this.client.innerHTML(e)},this.start=function(e){if(void 0===e)return new DayPilot.Date(i.data.start);this.temp().start=new DayPilot.Date(e)},this.duration=function(){return new DayPilot.Duration(this.start(),this.end())},this.end=function(e){if(void 0===e)return t&&"Date"===t.eventEndSpec?new DayPilot.Date(i.data.end).getDatePart().addDays(1):new DayPilot.Date(i.data.end);this.temp().end=new DayPilot.Date(e)},this.type=function(e){if(void 0===e)return n?n.data.type:i.data.type;this.temp().type=e},this.complete=function(e){if(void 0===e)return i.data.complete?i.data.complete:0;this.temp().complete=e},this.children=function(){var e=[];e.add=function(e){var t=new DayPilot.Task(e);this.data.children||(this.data.children=[]),this.children.push(t.data)};for(var i=0;this.data.children&&i<this.data.children.length;i++)e.push(new DayPilot.Task(this.data.children[i],t));return e},this.toJSON=function(e){var t={};return t.id=this.id(),t.text=this.text(),t.start=this.start().toJSON(),t.end=this.end().toJSON(),t.type=this.type(),t.tags={},DayPilot.Util.copyProps(this.data.tags,t.tags),t},this.row={};var o=this.row;o.expanded=function(e){if(void 0===e)return!i.data.row||!i.data.row.collapsed;i.data.row||(i.data.row={}),!!i.data.row.collapsed!=!e&&t.internal.rowObjectForTaskData(i.data).toggle(),i.data.row.collapsed=!e},o.expand=function(){o.expanded(!0)},o.collapse=function(){o.expanded(!1)},o.toggle=function(){o.expanded(!o.expanded())}},DayPilot.request=function(e,t,i,n){var a=DayPilot.createXmlHttp();a&&(a.open("POST",e,!0),a.setRequestHeader("Content-type","text/plain"),a.onreadystatechange=function(){4===a.readyState&&(200===a.status||304===a.status?t(a):n?n(a):window.console&&console.log("HTTP error "+a.status))},4!==a.readyState&&("object"==typeof i&&(i=DayPilot.JSON.stringify(i)),a.send(i)))},DayPilot.ajax=function(e){var t=DayPilot.createXmlHttp();if(t){var i=e.method||"GET",n=e.success||function(){},a=e.error||function(){},s=e.data,o=e.url;t.open(i,o,!0),t.setRequestHeader("Content-type","text/plain"),t.onreadystatechange=function(){var e;4===t.readyState&&(200===t.status||304===t.status?((e={}).request=t,n(e)):a?((e={}).request=t,a(e)):window.console&&console.log("HTTP error "+t.status))},4!==t.readyState&&("object"==typeof s&&(s=DayPilot.JSON.stringify($18)),t.send(s))}},DayPilot.createXmlHttp=function(){var e;try{e=new XMLHttpRequest}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}return e},DayPilot.Duration=function(e){var t=this;if(2===arguments.length){var i=arguments[0],n=arguments[1];if(!i||!i.isDayPilotDate)throw"DayPilot.Duration(): Invalid start argument, DayPilot.Date expected";if(!n||!n.isDayPilotDate)throw"DayPilot.Duration(): Invalid end argument, DayPilot.Date expected";this.ticks=n.getTime()-i.getTime()}else this.ticks=e;this.toString=function(e){if(!e)return t.days()+"."+t.hours()+":"+t.minutes()+":"+t.seconds()+"."+t.milliseconds();var i=t.minutes();i=(i<10?"0":"")+i;var n=e;return n=(n=(n=(n=(n=(n=n.replace("mm",i)).replace("m",t.minutes())).replace("H",t.hours())).replace("h",t.hours())).replace("d",t.days())).replace("s",t.seconds())},this.totalHours=function(){return t.ticks/36e5},this.totalDays=function(){return t.ticks/864e5},this.totalHours=function(){return t.ticks/36e5},this.totalMinutes=function(){return t.ticks/6e4},this.totalSeconds=function(){return t.ticks/1e3},this.days=function(){return Math.floor(t.totalDays())},this.hours=function(){var e=t.ticks-864e5*t.days();return Math.floor(e/36e5)},this.minutes=function(){var e=t.ticks-36e5*Math.floor(t.totalHours());return Math.floor(e/6e4)},this.seconds=function(){var e=t.ticks-6e4*Math.floor(t.totalMinutes());return Math.floor(e/1e3)},this.milliseconds=function(){return t.ticks%1e3}},DayPilot.TimeSpan=function(){DayPilot.Duration.apply(this,arguments)};try{DayPilot.TimeSpan.prototype=Object.create(DayPilot.Duration.prototype)}catch(e){}DayPilot.Date=function(e,t){if(DayPilot.Util.isNullOrUndefined(e))return this.isDayPilotDate=!0,this.d=DayPilot.Date.fromLocal(),this.ticks=this.d.getTime(),void(this.value=this.toStringSortable());if(e.isDayPilotDate)return e;var i=DayPilot.Date.Cache.Ctor;if(i[e])return i[e];if("string"==typeof e){var n=DayPilot.Date.fromStringSortable(e);return i[e]=n,n}if("number"==typeof e)return new DayPilot.Date(new Date(e));if(!e.getFullYear)throw"date parameter is not a Date object: "+e;t?(this.isDayPilotDate=!0,this.d=DayPilot.Date.fromLocal(e),this.ticks=this.d.getTime()):(this.isDayPilotDate=!0,this.d=e,this.ticks=this.d.getTime()),this.value=this.toStringSortable()},DayPilot.Date.Cache={},DayPilot.Date.Cache.Parsing={},DayPilot.Date.Cache.Ctor={},DayPilot.Date.prototype.addDays=function(e){return new DayPilot.Date(DayPilot.Date.addDays(this.d,e))},DayPilot.Date.prototype.addHours=function(e){return this.addTime(60*e*60*1e3)},DayPilot.Date.prototype.addMilliseconds=function(e){return this.addTime(e)},DayPilot.Date.prototype.addMinutes=function(e){return this.addTime(60*e*1e3)},DayPilot.Date.prototype.addMonths=function(e){return new DayPilot.Date(DayPilot.Date.addMonths(this.d,e))},DayPilot.Date.prototype.addSeconds=function(e){return this.addTime(1e3*e)},DayPilot.Date.prototype.addTime=function(e){return new DayPilot.Date(DayPilot.Date.addTime(this.d,e))},DayPilot.Date.prototype.addYears=function(e){var t=this.clone();return t.d.setUTCFullYear(this.getYear()+e),t},DayPilot.Date.prototype.clone=function(){return new DayPilot.Date(DayPilot.Date.clone(this.d))},DayPilot.Date.prototype.dayOfWeek=function(){return this.d.getUTCDay()},DayPilot.Date.prototype.getDayOfWeek=function(){return this.d.getUTCDay()},DayPilot.Date.prototype.daysInMonth=function(){return DayPilot.Date.daysInMonth(this.d)},DayPilot.Date.prototype.daysInYear=function(){var e=this.getYear();return e%4!=0?365:e%100==0&&e%400!=0?365:366},DayPilot.Date.prototype.dayOfYear=function(){return Math.ceil((this.getDatePart().getTime()-this.firstDayOfYear().getTime())/864e5)+1},DayPilot.Date.prototype.equals=function(e){if(null===e)return!1;if(e.isDayPilotDate)return DayPilot.Date.equals(this.d,e.d);throw"The parameter must be a DayPilot.Date object (DayPilot.Date.equals())"},DayPilot.Date.prototype.firstDayOfMonth=function(){var e=DayPilot.Date.firstDayOfMonth(this.getYear(),this.getMonth()+1);return new DayPilot.Date(e)},DayPilot.Date.prototype.firstDayOfYear=function(){var e=this.getYear(),t=new Date;return t.setUTCFullYear(e,0,1),t.setUTCHours(0),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0),new DayPilot.Date(t)},DayPilot.Date.prototype.firstDayOfWeek=function(e){var t=DayPilot.Date.firstDayOfWeek(this.d,e);return new DayPilot.Date(t)},DayPilot.Date.prototype.getDay=function(){return this.d.getUTCDate()},DayPilot.Date.prototype.getDatePart=function(){return new DayPilot.Date(DayPilot.Date.getDate(this.d))},DayPilot.Date.prototype.getYear=function(){return this.d.getUTCFullYear()},DayPilot.Date.prototype.getHours=function(){return this.d.getUTCHours()},DayPilot.Date.prototype.getMilliseconds=function(){return this.d.getUTCMilliseconds()},DayPilot.Date.prototype.getMinutes=function(){return this.d.getUTCMinutes()},DayPilot.Date.prototype.getMonth=function(){return this.d.getUTCMonth()},DayPilot.Date.prototype.getSeconds=function(){return this.d.getUTCSeconds()},DayPilot.Date.prototype.getTotalTicks=function(){return this.getTime()},DayPilot.Date.prototype.getTime=function(){return this.ticks},DayPilot.Date.prototype.getTimePart=function(){return DayPilot.Date.getTime(this.d)},DayPilot.Date.prototype.lastDayOfMonth=function(){var e=DayPilot.Date.lastDayOfMonth(this.getYear(),this.getMonth()+1);return new DayPilot.Date(e)},DayPilot.Date.prototype.weekNumber=function(){var e=this.firstDayOfYear(),t=(this.getTime()-e.getTime())/864e5;return Math.ceil((t+e.dayOfWeek()+1)/7)},DayPilot.Date.prototype.local=function(){return void 0===this.offset?new DayPilot.Date(this.d):this.addMinutes(this.offset)},DayPilot.Date.prototype.weekNumberISO=function(){var e=!1,t=this.dayOfYear(),i=this.firstDayOfYear().dayOfWeek(),n=this.firstDayOfYear().addYears(1).addDays(-1).dayOfWeek();0===i&&(i=7),0===n&&(n=7);var a=8-i;4!==i&&4!==n||(e=!0);var s=Math.ceil((t-a)/7);return a>=4&&(s+=1),s>52&&!e&&(s=1),0===s&&(s=this.firstDayOfYear().addDays(-1).weekNumberISO()),s},DayPilot.Date.prototype.toDateLocal=function(){return DayPilot.Date.toLocal(this.d)},DayPilot.Date.prototype.toJSON=function(){return this.value},DayPilot.Date.prototype.toString=function(e,t){return void 0===e?this.toStringSortable():new $1L(e,t).print(this)},DayPilot.Date.prototype.toStringSortable=function(){return DayPilot.Date.toStringSortable(this.d)},DayPilot.Date.parse=function(e,t){return new $1L(t).parse(e)},DayPilot.Date.fromStringSortable=function(e){if(!e)throw"Can't create DayPilot.Date from empty string";var t=e.length,i=10===t,n=t=19;if(!i&&!n&&!(25===t))throw"Invalid string format (use '2010-01-01', '2010-01-01T00:00:00', or '2010-01-01T00:00:00+00:00'.";if(DayPilot.Date.Cache.Parsing[e])return DayPilot.Date.Cache.Parsing[e];var a=e.substring(0,4),s=e.substring(5,7),o=e.substring(8,10),l=new Date;if(l.setUTCFullYear(a,s-1,o),i)return l.setUTCHours(0),l.setUTCMinutes(0),l.setUTCSeconds(0),l.setUTCMilliseconds(0),c=new DayPilot.Date(l),DayPilot.Date.Cache.Parsing[e]=c,c;var r=e.substring(11,13),d=e.substring(14,16),h=e.substring(17,19);l.setUTCHours(r),l.setUTCMinutes(d),l.setUTCSeconds(h),l.setUTCMilliseconds(0);var c=new DayPilot.Date(l);if(n)return DayPilot.Date.Cache.Parsing[e]=c,c;var u=e[20],f=60*e.substring(21,23)+e.substring(24);return"-"===u&&(f=-f),(c=c.addMinutes(-f)).offset=$1U,DayPilot.Date.Cache.Parsing[e]=c,c},DayPilot.Date.addDays=function(e,t){var i=new Date;return i.setTime(e.getTime()+24*t*60*60*1e3),i},DayPilot.Date.addMinutes=function(e,t){var i=new Date;return i.setTime(e.getTime()+60*t*1e3),i},DayPilot.Date.addMonths=function(e,t){if(0===t)return e;var i=e.getUTCFullYear(),n=e.getUTCMonth()+1;if(t>0){for(;t>=12;)t-=12,i++;t>12-n?(i++,n=t-(12-n)):n+=t}else{for(;t<=-12;)t+=12,i--;n+t<=0?(i--,n=12+n+t):n+=t}var a=DayPilot.Date.clone(e);a.setUTCDate(1),a.setUTCFullYear(i),a.setUTCMonth(n-1);var s=DayPilot.Date.daysInMonth(i,n);return a.setUTCDate(Math.min(s,e.getUTCDate())),a},DayPilot.Date.addTime=function(e,t){var i=new Date;return i.setTime(e.getTime()+t),i},DayPilot.Date.clone=function(e){new Date;return DayPilot.Date.dateFromTicks(e.getTime())},DayPilot.Date.daysDiff=function(e,t){if(e.getTime()>t.getTime())return null;for(var i=0,n=DayPilot.Date.getDate(e),a=DayPilot.Date.getDate(t);n<a;)n=DayPilot.Date.addDays(n,1),i++;return i},DayPilot.Date.daysInMonth=function(e,t){e.getUTCFullYear&&(t=e.getUTCMonth()+1,e=e.getUTCFullYear());var i=[31,28,31,30,31,30,31,31,30,31,30,31];return 2!==t?i[t-1]:e%4!=0?i[1]:e%100==0&&e%400!=0?i[1]:i[1]+1},DayPilot.Date.daysSpan=function(e,t){if(e.getTime()===t.getTime())return 0;var i=DayPilot.Date.daysDiff(e,t);return DayPilot.Date.equals(t,DayPilot.Date.getDate(t))&&i--,i},DayPilot.Date.diff=function(e,t){if(!(e&&t&&e.getTime&&t.getTime))throw"Both compared objects must be Date objects (DayPilot.Date.diff).";return e.getTime()-t.getTime()},DayPilot.Date.equals=function(e,t){return e.getTime()===t.getTime()},DayPilot.Date.fromLocal=function(e){e||(e=new Date);var t=new Date;return t.setUTCFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t.setUTCHours(e.getHours()),t.setUTCMinutes(e.getMinutes()),t.setUTCSeconds(e.getSeconds()),t.setUTCMilliseconds(e.getMilliseconds()),t},DayPilot.Date.firstDayOfMonth=function(e,t){var i=new Date;return i.setUTCFullYear(e,t-1,1),i.setUTCHours(0),i.setUTCMinutes(0),i.setUTCSeconds(0),i.setUTCMilliseconds(0),i},DayPilot.Date.firstDayOfWeek=function(e,t){t=t||0;for(var i=e.getUTCDay();i!==t;)i=(e=DayPilot.Date.addDays(e,-1)).getUTCDay();return e},DayPilot.Date.dateFromTicks=function(e){var t=new Date;return t.setTime(e),t},DayPilot.Date.getDate=function(e){var t=DayPilot.Date.clone(e);return t.setUTCHours(0),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0),t},DayPilot.Date.getStart=function(e,t,i){var n=DayPilot.Date.firstDayOfMonth(e,t);return DayPilot.Date.firstDayOfWeek(n,i)},DayPilot.Date.getTime=function(e){var t=DayPilot.Date.getDate(e);return DayPilot.Date.diff(e,t)},DayPilot.Date.hours=function(e,t){var i=e.getUTCMinutes();i<10&&(i="0"+i);var n=e.getUTCHours();if(t){var a=n<12;return 0===(n=n%12)&&(n=12),n+":"+i+" "+(a?"AM":"PM")}return n+":"+i},DayPilot.Date.lastDayOfMonth=function(e,t){var i=DayPilot.Date.firstDayOfMonth(e,t),n=DayPilot.Date.daysInMonth(e,t);return i.setUTCDate(n),i},DayPilot.Date.max=function(e,t){return e.getTime()>t.getTime()?e:t},DayPilot.Date.min=function(e,t){return e.getTime()<t.getTime()?e:t},DayPilot.Date.today=function(){var e=new Date,t=new Date;return t.setUTCFullYear(e.getFullYear()),t.setUTCMonth(e.getMonth()),t.setUTCDate(e.getDate()),t},DayPilot.Date.toLocal=function(e){e||(e=new Date);var t=new Date;return t.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t.setHours(e.getUTCHours()),t.setMinutes(e.getUTCMinutes()),t.setSeconds(e.getUTCSeconds()),t.setMilliseconds(e.getUTCMilliseconds()),t},DayPilot.Date.toStringSortable=function(e){if(e.isDayPilotDate)return e.toStringSortable();var t=e,i=t.getUTCSeconds();i<10&&(i="0"+i);var n=t.getUTCMinutes();n<10&&(n="0"+n);var a=t.getUTCHours();a<10&&(a="0"+a);var s=t.getUTCDate();s<10&&(s="0"+s);var o=t.getUTCMonth()+1;o<10&&(o="0"+o);var l=t.getUTCFullYear();if(l<=0)throw"The minimum year supported is 1.";return l<10?l="000"+l:l<100?l="00"+l:l<1e3&&(l="0"+l),l+"-"+o+"-"+s+"T"+a+":"+n+":"+i};var $1L=function(e,t){"string"==typeof t&&(t=DayPilot.Locale.find(t));t=t||DayPilot.Locale.US;var i=[{seq:"yyyy",expr:"[0-9]{4,4}",str:function(e){return e.getYear()}},{seq:"yy",expr:"[0-9]{2,2}",str:function(e){return e.getYear()%100}},{seq:"MMMM",expr:"[a-z]*",str:function(e){return t.monthNames[e.getMonth()]}},{seq:"MMM",expr:"[a-z]*",str:function(e){return t.monthNamesShort[e.getMonth()]}},{seq:"MM",expr:"[0-9]{2,2}",str:function(e){var t=e.getMonth()+1;return t<10?"0"+t:t}},{seq:"M",expr:"[0-9]{1,2}",str:function(e){return e.getMonth()+1}},{seq:"dddd",expr:"[a-z]*",str:function(e){return t.dayNames[e.getDayOfWeek()]}},{seq:"ddd",expr:"[a-z]*",str:function(e){return t.dayNamesShort[e.getDayOfWeek()]}},{seq:"dd",expr:"[0-9]{2,2}",str:function(e){var t=e.getDay();return t<10?"0"+t:t}},{seq:"%d",expr:"[0-9]{1,2}",str:function(e){return e.getDay()}},{seq:"d",expr:"[0-9]{1,2}",str:function(e){return e.getDay()}},{seq:"m",expr:"[0-9]{1,2}",str:function(e){return e.getMinutes()}},{seq:"mm",expr:"[0-9]{2,2}",str:function(e){var t=e.getMinutes();return t<10?"0"+t:t}},{seq:"H",expr:"[0-9]{1,2}",str:function(e){return e.getHours()}},{seq:"HH",expr:"[0-9]{2,2}",str:function(e){var t=e.getHours();return t<10?"0"+t:t}},{seq:"h",expr:"[0-9]{1,2}",str:function(e){var t;return 0===(t=(t=e.getHours())%12)&&(t=12),t}},{seq:"hh",expr:"[0-9]{2,2}",str:function(e){var t;0===(t=(t=e.getHours())%12)&&(t=12);return t<10?"0"+t:t}},{seq:"tt",expr:"(AM|PM)",str:function(e){return e.getHours()<12?"AM":"PM"}},{seq:"s",expr:"[0-9]{1,2}",str:function(e){return e.getSeconds()}},{seq:"ss",expr:"[0-9]{2,2}",str:function(e){var t=e.getSeconds();return t<10?"0"+t:t}}];this.init=function(){this.year=this.findSequence("yyyy"),this.month=this.findSequence("MM")||this.findSequence("M"),this.day=this.findSequence("dd")||this.findSequence("d"),this.hours=this.findSequence("HH")||this.findSequence("H"),this.minutes=this.findSequence("mm")||this.findSequence("m"),this.seconds=this.findSequence("ss")||this.findSequence("s")},this.findSequence=function(t){return-1===e.indexOf(t)?null:{findValue:function(n){for(var a=e.replace(/[-[\]{};()*+?.,\\^$|#\s]/g,"\\$&"),s=0;s<i.length;s++){i[s].length;var o=t===i[s].seq,l=i[s].expr;o&&(l="("+l+")"),a=a.replace(i[s].seq,l)}try{var r=new RegExp(a).exec(n);return r?parseInt(r[1]):null}catch(e){throw"unable to create regex from: "+a}}}},this.print=function(t){for(var n=function(e){for(var t=0;t<i.length;t++)if(i[t].seq===e)return i[t];return null},a=e.length<=0,s=0,o=[];!a;){var l=e.substring(s),r=/%?(.)\1*/.exec(l);if(r&&r.length>0){var d=r[0],h=n(d);h?o.push(h):o.push(d),s+=d.length,a=e.length<=s}else a=!0}for(var c=0;c<o.length;c++){var u=o[c];"string"!=typeof u&&(o[c]=u.str(t))}return o.join("")},this.parse=function(e){var t=this.year.findValue(e);if(!t)return null;var i=this.month.findValue(e),n=this.day.findValue(e),a=this.hours?this.hours.findValue(e):0,s=this.minutes?this.minutes.findValue(e):0,o=this.seconds?this.seconds.findValue(e):0,l=new Date;return l.setUTCFullYear(t,i-1,n),l.setUTCHours(a),l.setUTCMinutes(s),l.setUTCSeconds(o),l.setUTCMilliseconds(0),new DayPilot.Date(l)},this.init()};DayPilot.Action=function(e,t,i,n){this.calendar=e,this.isAction=!0,this.action=t,this.params=i,this.data=n,this.notify=function(){e.invokeEvent("Immediate",this.action,this.params,this.data)},this.auto=function(){e.invokeEvent("Notify",this.action,this.params,this.data)},this.queue=function(){e.queue.add(this)},this.toJSON=function(){var e={};return e.name=this.action,e.params=this.params,e.data=this.data,e}},DayPilot.Locale=function(e,t){if(this.id=e,this.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],this.dayNamesShort=["Su","Mo","Tu","We","Th","Fr","Sa"],this.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"],this.monthNamesShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.datePattern="M/d/yyyy",this.timePattern="H:mm",this.dateTimePattern="M/d/yyyy H:mm",this.timeFormat="Clock12Hours",this.weekStarts=0,t)for(var i in t)this[i]=t[i]},DayPilot.Locale.all={},DayPilot.Locale.find=function(e){if(!e)return null;var t=e.toLowerCase();return t.length>2&&(t=DayPilot.Util.replaceCharAt(t,2,"-")),DayPilot.Locale.all[t]},DayPilot.Locale.register=function(e){DayPilot.Locale.all[e.id]=e},DayPilot.Locale.register(new DayPilot.Locale("ca-es",{dayNames:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],dayNamesShort:["dg","dl","dt","dc","dj","dv","ds"],monthNames:["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre",""],monthNamesShort:["gen.","febr.","març","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des.",""],timePattern:"H:mm",datePattern:"dd/MM/yyyy",dateTimePattern:"dd/MM/yyyy H:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("cs-cz",{dayNames:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],dayNamesShort:["ne","po","út","st","čt","pá","so"],monthNames:["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec",""],monthNamesShort:["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII",""],timePattern:"H:mm",datePattern:"d. M. yyyy",dateTimePattern:"d. M. yyyy H:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("da-dk",{dayNames:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],dayNamesShort:["sø","ma","ti","on","to","fr","lø"],monthNames:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december",""],monthNamesShort:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec",""],timePattern:"HH:mm",datePattern:"dd-MM-yyyy",dateTimePattern:"dd-MM-yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("de-at",{dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],monthNames:["Jänner","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],monthNamesShort:["Jän","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],timePattern:"HH:mm",datePattern:"dd.MM.yyyy",dateTimePattern:"dd.MM.yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("de-ch",{dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],monthNamesShort:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],timePattern:"HH:mm",datePattern:"dd.MM.yyyy",dateTimePattern:"dd.MM.yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("de-de",{dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],monthNamesShort:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],timePattern:"HH:mm",datePattern:"dd.MM.yyyy",dateTimePattern:"dd.MM.yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("de-lu",{dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],monthNamesShort:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],timePattern:"HH:mm",datePattern:"dd.MM.yyyy",dateTimePattern:"dd.MM.yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("en-au",{dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Su","Mo","Tu","We","Th","Fr","Sa"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],timePattern:"h:mm tt",datePattern:"d/MM/yyyy",dateTimePattern:"d/MM/yyyy h:mm tt",timeFormat:"Clock12Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("en-ca",{dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Su","Mo","Tu","We","Th","Fr","Sa"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],timePattern:"h:mm tt",datePattern:"yyyy-MM-dd",dateTimePattern:"yyyy-MM-dd h:mm tt",timeFormat:"Clock12Hours",weekStarts:0})),DayPilot.Locale.register(new DayPilot.Locale("en-gb",{dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Su","Mo","Tu","We","Th","Fr","Sa"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],timePattern:"HH:mm",datePattern:"dd/MM/yyyy",dateTimePattern:"dd/MM/yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("en-us",{dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Su","Mo","Tu","We","Th","Fr","Sa"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],timePattern:"h:mm tt",datePattern:"M/d/yyyy",dateTimePattern:"M/d/yyyy h:mm tt",timeFormat:"Clock12Hours",weekStarts:0})),DayPilot.Locale.register(new DayPilot.Locale("es-es",{dayNames:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],dayNamesShort:["D","L","M","X","J","V","S"],monthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],monthNamesShort:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],timePattern:"H:mm",datePattern:"dd/MM/yyyy",dateTimePattern:"dd/MM/yyyy H:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("es-mx",{dayNames:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],dayNamesShort:["do.","lu.","ma.","mi.","ju.","vi.","sá."],monthNames:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],monthNamesShort:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],timePattern:"hh:mm tt",datePattern:"dd/MM/yyyy",dateTimePattern:"dd/MM/yyyy hh:mm tt",timeFormat:"Clock12Hours",weekStarts:0})),DayPilot.Locale.register(new DayPilot.Locale("eu-es",{dayNames:["igandea","astelehena","asteartea","asteazkena","osteguna","ostirala","larunbata"],dayNamesShort:["ig","al","as","az","og","or","lr"],monthNames:["urtarrila","otsaila","martxoa","apirila","maiatza","ekaina","uztaila","abuztua","iraila","urria","azaroa","abendua",""],monthNamesShort:["urt.","ots.","mar.","api.","mai.","eka.","uzt.","abu.","ira.","urr.","aza.","abe.",""],timePattern:"H:mm",datePattern:"yyyy/MM/dd",dateTimePattern:"yyyy/MM/dd H:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("fi-fi",{dayNames:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"],dayNamesShort:["su","ma","ti","ke","to","pe","la"],monthNames:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu",""],monthNamesShort:["tammi","helmi","maalis","huhti","touko","kesä","heinä","elo","syys","loka","marras","joulu",""],timePattern:"H:mm",datePattern:"d.M.yyyy",dateTimePattern:"d.M.yyyy H:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("fr-be",{dayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],dayNamesShort:["di","lu","ma","me","je","ve","sa"],monthNames:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],monthNamesShort:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""],timePattern:"HH:mm",datePattern:"dd-MM-yy",dateTimePattern:"dd-MM-yy HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("fr-ch",{dayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],dayNamesShort:["di","lu","ma","me","je","ve","sa"],monthNames:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],monthNamesShort:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""],timePattern:"HH:mm",datePattern:"dd.MM.yyyy",dateTimePattern:"dd.MM.yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("fr-fr",{dayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],dayNamesShort:["di","lu","ma","me","je","ve","sa"],monthNames:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],monthNamesShort:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""],timePattern:"HH:mm",datePattern:"dd/MM/yyyy",dateTimePattern:"dd/MM/yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("fr-lu",{dayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],dayNamesShort:["di","lu","ma","me","je","ve","sa"],monthNames:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],monthNamesShort:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""],timePattern:"HH:mm",datePattern:"dd/MM/yyyy",dateTimePattern:"dd/MM/yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("gl-es",{dayNames:["domingo","luns","martes","mércores","xoves","venres","sábado"],dayNamesShort:["do","lu","ma","mé","xo","ve","sá"],monthNames:["xaneiro","febreiro","marzo","abril","maio","xuño","xullo","agosto","setembro","outubro","novembro","decembro",""],monthNamesShort:["xan","feb","mar","abr","maio","xuño","xul","ago","set","out","nov","dec",""],timePattern:"H:mm",datePattern:"dd/MM/yyyy",dateTimePattern:"dd/MM/yyyy H:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("it-it",{dayNames:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],dayNamesShort:["do","lu","ma","me","gi","ve","sa"],monthNames:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre",""],monthNamesShort:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic",""],timePattern:"HH:mm",datePattern:"dd/MM/yyyy",dateTimePattern:"dd/MM/yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("it-ch",{dayNames:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],dayNamesShort:["do","lu","ma","me","gi","ve","sa"],monthNames:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre",""],monthNamesShort:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic",""],timePattern:"HH:mm",datePattern:"dd.MM.yyyy",dateTimePattern:"dd.MM.yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("ja-jp",{dayNames:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],dayNamesShort:["日","月","火","水","木","金","土"],monthNames:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月",""],monthNamesShort:["1","2","3","4","5","6","7","8","9","10","11","12",""],timePattern:"H:mm",datePattern:"yyyy/MM/dd",dateTimePattern:"yyyy/MM/dd H:mm",timeFormat:"Clock24Hours",weekStarts:0})),DayPilot.Locale.register(new DayPilot.Locale("nb-no",{dayNames:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],dayNamesShort:["sø","ma","ti","on","to","fr","lø"],monthNames:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember",""],monthNamesShort:["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des",""],timePattern:"HH:mm",datePattern:"dd.MM.yyyy",dateTimePattern:"dd.MM.yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("nl-nl",{dayNames:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],dayNamesShort:["zo","ma","di","wo","do","vr","za"],monthNames:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december",""],monthNamesShort:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec",""],timePattern:"HH:mm",datePattern:"d-M-yyyy",dateTimePattern:"d-M-yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("nl-be",{dayNames:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],dayNamesShort:["zo","ma","di","wo","do","vr","za"],monthNames:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december",""],monthNamesShort:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec",""],timePattern:"H:mm",datePattern:"d/MM/yyyy",dateTimePattern:"d/MM/yyyy H:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("nn-no",{dayNames:["søndag","måndag","tysdag","onsdag","torsdag","fredag","laurdag"],dayNamesShort:["sø","må","ty","on","to","fr","la"],monthNames:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember",""],monthNamesShort:["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des",""],timePattern:"HH:mm",datePattern:"dd.MM.yyyy",dateTimePattern:"dd.MM.yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("pt-br",{dayNames:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],dayNamesShort:["D","S","T","Q","Q","S","S"],monthNames:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro",""],monthNamesShort:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez",""],timePattern:"HH:mm",datePattern:"dd/MM/yyyy",dateTimePattern:"dd/MM/yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:0})),DayPilot.Locale.register(new DayPilot.Locale("pl-pl",{dayNames:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"],dayNamesShort:["N","Pn","Wt","Śr","Cz","Pt","So"],monthNames:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień",""],monthNamesShort:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru",""],timePattern:"HH:mm",datePattern:"yyyy-MM-dd",dateTimePattern:"yyyy-MM-dd HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("pt-pt",{dayNames:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],dayNamesShort:["D","S","T","Q","Q","S","S"],monthNames:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro",""],monthNamesShort:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez",""],timePattern:"HH:mm",datePattern:"dd/MM/yyyy",dateTimePattern:"dd/MM/yyyy HH:mm",timeFormat:"Clock24Hours",weekStarts:0})),DayPilot.Locale.register(new DayPilot.Locale("ru-ru",{dayNames:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],dayNamesShort:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],monthNames:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь",""],monthNamesShort:["янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек",""],timePattern:"H:mm",datePattern:"dd.MM.yyyy",dateTimePattern:"dd.MM.yyyy H:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("sk-sk",{dayNames:["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],dayNamesShort:["ne","po","ut","st","št","pi","so"],monthNames:["január","február","marec","apríl","máj","jún","júl","august","september","október","november","december",""],monthNamesShort:["1","2","3","4","5","6","7","8","9","10","11","12",""],timePattern:"H:mm",datePattern:"d.M.yyyy",dateTimePattern:"d.M.yyyy H:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("sv-se",{dayNames:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],dayNamesShort:["sö","må","ti","on","to","fr","lö"],monthNames:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december",""],monthNamesShort:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec",""],timePattern:"HH:mm",datePattern:"yyyy-MM-dd",dateTimePattern:"yyyy-MM-dd HH:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.register(new DayPilot.Locale("zh-cn",{dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesShort:["日","一","二","三","四","五","六"],monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月",""],monthNamesShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月",""],timePattern:"H:mm",datePattern:"yyyy/M/d",dateTimePattern:"yyyy/M/d H:mm",timeFormat:"Clock24Hours",weekStarts:1})),DayPilot.Locale.US=DayPilot.Locale.find("en-us"),DayPilot.Switcher=function(){var e=this;this.views=[],this.switchers=[],this.navigator={},this.selectedClass=null,this.active=null,this.day=new DayPilot.Date,this.navigator.updateMode=function(t){var i=e.navigator.control;i&&(i.selectMode=t,i.select(e.day))},this.addView=function(t,i){var n;if("string"==typeof t){if(!(n=document.getElementById(t)))throw"Element not found: "+t}else n=t;var a=n,s={isView:!0};return s.id=a.id,s.control=a,s.options=i||{},s.hide=function(){a.hide?a.hide():a.nav&&a.nav.top?a.nav.top.style.display="none":a.style.display="none"},s.sendNavigate=function(e){(!!a.backendUrl||!("function"!=typeof WebForm_DoCallback||!a.uniqueID))&&a.commandCallBack&&a.commandCallBack("navigate",{day:e})},s.show=function(){e.$2Q(),a.show?a.show():a.nav&&a.nav.top?a.nav.top.style.display="":a.style.display=""},s.selectMode=function(){if(s.options.navigatorSelectMode)return s.options.navigatorSelectMode;if(a.isCalendar)switch(a.viewType){case"Day":return"day";case"Week":case"WorkWeek":return"week";default:return"day"}else if(a.isMonth)switch(a.viewType){case"Month":return"month";case"Weeks":return"week";default:return"day"}return"day"},this.views.push(s),s},this.addButton=function(t,i){var n;if("string"==typeof t){if(!(n=document.getElementById(t)))throw"Element not found: "+t}else n=t;var a=this.$2R(i);a||(a=this.addView(i));var s={isSwitcher:!0};return s.element=n,s.id=n.id,s.view=a,s.onClick=function(t){e.show(s),e.$2S(s),(t=t||window.event)&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},DayPilot.re(n,"click",s.onClick),this.switchers.push(s),s},this.select=function(e){var t=this.$2T(e);t?t.onClick():this.switchers.length>0&&this.switchers[0].onClick()},this.$2T=function(e){for(var t=0;t<this.switchers.length;t++){var i=this.switchers[t];if(i.id===e)return i}return null},this.$2S=function(e){if(this.selectedClass){for(var t=0;t<this.switchers.length;t++){var i=this.switchers[t];DayPilot.Util.removeClass(i.element,this.selectedClass)}DayPilot.Util.addClass(e.element,this.selectedClass)}},this.addNavigator=function(t){e.navigator.control=t,t.timeRangeSelectedHandling="JavaScript",t.onTimeRangeSelected=function(){var i,n,a,s;1===t.api?(i=arguments[0],n=arguments[1],a=arguments[2]):(i=(s=arguments[0]).start,n=s.end,a=s.day);(e.day=a,e.active.sendNavigate(e.day),e.onTimeRangeSelected)&&((s={}).start=i,s.end=n,s.day=a,s.target=e.active.control,e.onTimeRangeSelected(s))}},this.show=function(t){var i,n;if(t.isSwitcher)i=(n=t).view;else if(i=t.isView?t:this.$2R(t),this.active===i)return;if(e.onSelect){var a={};a.source=n?n.element:null,a.target=i.control,e.onSelect(a)}this.active=i,i.show();var s=i.selectMode();e.navigator.updateMode(s),e.active.sendNavigate(this.day)},this.$2R=function(e){for(var t=0;t<this.views.length;t++)if(this.views[t].control===e)return this.views[t];return null},this.$2Q=function(){for(var e=0;e<this.views.length;e++)this.views[e].hide()}},function(){if(!DayPilot.Global.defaultCss){var e=DayPilot.sheet();e.add(".bubble_default_main","cursor: default;"),e.add(".bubble_default_main_inner",'border-radius: 5px;font-size: 12px;padding: 4px;color: #666;background: #eeeeee; background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#eeeeee));background: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee);background: -moz-linear-gradient(top, #ffffff 0%, #eeeeee);background: -ms-linear-gradient(top, #ffffff 0%, #eeeeee);background: -o-linear-gradient(top, #ffffff 0%, #eeeeee);background: linear-gradient(top, #ffffff 0%, #eeeeee);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#eeeeee");border: 1px solid #ccc;-moz-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;-moz-box-shadow:0px 2px 3px rgba(000,000,000,0.3),inset 0px 0px 2px rgba(255,255,255,0.8);-webkit-box-shadow:0px 2px 3px rgba(000,000,000,0.3),inset 0px 0px 2px rgba(255,255,255,0.8);box-shadow:0px 2px 3px rgba(000,000,000,0.3),inset 0px 0px 2px rgba(255,255,255,0.8);'),e.add(".calendar_default_main","border: 1px solid #999; font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 12px;"),e.add(".calendar_default_rowheader_inner,.calendar_default_cornerright_inner,.calendar_default_corner_inner,.calendar_default_colheader_inner,.calendar_default_alldayheader_inner","color: #666;background: #eee;"),e.add(".calendar_default_cornerright_inner","position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;\tborder-bottom: 1px solid #999;"),e.add(".calendar_default_rowheader_inner","font-size: 16pt;text-align: right; position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;border-right: 1px solid #999;border-bottom: 1px solid #999;"),e.add(".calendar_default_corner_inner","position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;border-right: 1px solid #999;border-bottom: 1px solid #999;"),e.add(".calendar_default_rowheader_minutes","font-size:10px;vertical-align: super;padding-left: 2px;padding-right: 2px;"),e.add(".calendar_default_colheader_inner","text-align: center; position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;border-right: 1px solid #999;border-bottom: 1px solid #999;"),e.add(".calendar_default_cell_inner","position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;border-right: 1px solid #ddd;border-bottom: 1px solid #ddd; background: #f9f9f9;"),e.add(".calendar_default_cell_business .calendar_default_cell_inner","background: #fff"),e.add(".calendar_default_alldayheader_inner","text-align: center;position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;border-right: 1px solid #999;border-bottom: 1px solid #999;"),e.add(".calendar_default_message","opacity: 0.9;filter: alpha(opacity=90);\tpadding: 10px; color: #ffffff;background: #ffa216;"),e.add(".calendar_default_alldayevent_inner,.calendar_default_event_inner","color: #666; border: 1px solid #999;"),e.add(".calendar_default_event_bar","top: 0px;bottom: 0px;left: 0px;width: 4px;background-color: #9dc8e8;"),e.add(".calendar_default_event_bar_inner","position: absolute;width: 4px;background-color: #1066a8;"),e.add(".calendar_default_alldayevent_inner,.calendar_default_event_inner",'background: #fff;background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#eeeeee));background: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee);background: -moz-linear-gradient(top, #ffffff 0%, #eeeeee);background: -ms-linear-gradient(top, #ffffff 0%, #eeeeee);background: -o-linear-gradient(top, #ffffff 0%, #eeeeee);background: linear-gradient(top, #ffffff 0%, #eeeeee);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#eeeeee");'),e.add(".calendar_default_selected .calendar_default_event_inner","background: #ddd;"),e.add(".calendar_default_alldayevent_inner","position: absolute;top: 2px;bottom: 2px;left: 2px;right: 2px;padding: 2px;margin-right: 1px;font-size: 12px;"),e.add(".calendar_default_event_withheader .calendar_default_event_inner","padding-top: 15px;"),e.add(".calendar_default_event","cursor: default;"),e.add(".calendar_default_event_inner","position: absolute;overflow: hidden;top: 0px;bottom: 0px;left: 0px;right: 0px;padding: 2px 2px 2px 6px;font-size: 12px;"),e.add(".calendar_default_shadow_inner","background-color: #666666;\topacity: 0.5;filter: alpha(opacity=50);height: 100%;"),e.add(".calendar_default_event_delete","background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAAI5JREFUKFNtkLERgCAMRbmzdK8s4gAUlhYOYEHJEJYOYOEwDmGBPxC4kOPfvePy84MGR0RJ2N1A8H3N6DATwSQ57m2ql8NBG+AEM7D+UW+wjdfUPgerYNgB5gOLRHqhcasg84C2QxPMtrUhSqQIhg7ypy9VM2EUZPI/4rQ7rGxqo9sadTegw+UdjeDLAKUfhbaQUVPIfJYAAAAASUVORK5CYII=) center center no-repeat; opacity: 0.6; -ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=60)'; cursor: pointer;"),e.add(".calendar_default_event_delete:hover","opacity: 1;-ms-filter: none;"),e.add(".calendar_default_scroll_up","background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAB3RJTUUH2wESDiYcrhwCiQAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAARnQU1BAACxjwv8YQUAAACcSURBVHjaY2AgF9wWsTW6yGMlhi7OhC7AyMDQzMnBXIpFHAFuCtuaMTP+P8nA8P/b1x//FfW/HHuF1UQmxv+NUP1c3OxMVVhNvCVi683E8H8LXOY/w9+fTH81tF8fv4NiIpBRj+YoZtZ/LDUoJmKYhsVUpv0MDiyMDP96sIYV0FS2/8z9ICaLlOhvS4b/jC//MzC8xBG0vJeF7GQBlK0xdiUzCtsAAAAASUVORK5CYII=);"),e.add(".calendar_default_scroll_down","background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAALiMAAC4jAXilP3YAAACqSURBVChTY7wpam3L9J+xmQEP+PGPKZZxP4MDi4zI78uMDIwa2NT+Z2DYovrmiC+TI8OBP/8ZmEqwGvif4e8vxr+FIDkmEKH25vBWBgbG0+iK/zEwLtF+ffwOXCGI8Y+BoRFFIdC030x/WmBiYBNhpgLdswNJ8RSYaSgmgk39z1gPUfj/29ef/9rwhQTDHRHbrbdEbLvRFcGthkkAra/9/uMvhkK8piNLAgCRpTnNn4AEmAAAAABJRU5ErkJggg==);"),e.add(".calendar_default_now","background-color: red;"),e.add(".calendar_default_now:before","content: ''; top: -5px; border-width: 5px; border-color: transparent transparent transparent red; border-style: solid; width: 0px; height:0px; position: absolute; -moz-transform: scale(.9999);"),e.add(".menu_default_main","font-family: Tahoma, Arial, Helvetica, Sans-Serif;font-size: 12px;border: 1px solid #dddddd;background-color: white;padding: 0px;cursor: default;background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAABCAIAAABG0om7AAAAKXRFWHRDcmVhdGlvbiBUaW1lAHBvIDEwIDUgMjAxMCAyMjozMzo1OSArMDEwMGzy7+IAAAAHdElNRQfaBQoUJAesj4VUAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAABGdBTUEAALGPC/xhBQAAABVJREFUeNpj/P//PwO1weMnT2RlZAAYuwX/4oA3BgAAAABJRU5ErkJggg==);background-repeat: repeat-y;xborder-radius: 5px;-moz-box-shadow:0px 2px 3px rgba(000,000,000,0.3),inset 0px 0px 2px rgba(255,255,255,0.8);-webkit-box-shadow:0px 2px 3px rgba(000,000,000,0.3),inset 0px 0px 2px rgba(255,255,255,0.8);box-shadow:0px 2px 3px rgba(000,000,000,0.3),inset 0px 0px 2px rgba(255,255,255,0.8);"),e.add(".menu_default_title","background-color: #f2f2f2;border-bottom: 1px solid gray;padding: 4px 4px 4px 37px;"),e.add(".menu_default_main a","padding: 2px 2px 2px 35px;color: black;text-decoration: none;cursor: default;"),e.add(".menu_default_main a img","margin-left: 6px;margin-top: 2px;"),e.add(".menu_default_main a span","display: block;height: 20px;line-height: 20px; overflow:hidden;padding-left: 2px;padding-right: 20px;"),e.add(".menu_default_main a:hover",'background: #eeeeee;background: -webkit-gradient(linear, left top, left bottom, from(#efefef), to(#e6e6e6));background: -webkit-linear-gradient(top, #efefef 0%, #e6e6e6);background: -moz-linear-gradient(top, #efefef 0%, #e6e6e6);background: -ms-linear-gradient(top, #efefef 0%, #e6e6e6);background: -o-linear-gradient(top, #efefef 0%, #e6e6e6);background: linear-gradient(top, #efefef 0%, #e6e6e6);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#efefef", endColorStr="#e6e6e6");'),e.add(".menu_default_main div div","border-top: 1px solid #dddddd;margin-top: 2px;margin-bottom: 2px;margin-left: 28px;"),e.add(".menu_default_main a.menu_default_item_disabled","color: #ccc"),e.add(".month_default_main","border: 1px solid #aaa;font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 12px;color: #666;"),e.add(".month_default_cell_inner","border-right: 1px solid #ddd;border-bottom: 1px solid #ddd;position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;background-color: #f9f9f9;"),e.add(".month_default_cell_business .month_default_cell_inner","background-color: #fff;"),e.add(".month_default_cell_header","text-align: right;padding-right: 2px;"),e.add(".month_default_header_inner","text-align: center; vertical-align: middle;position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;border-right: 1px solid #999;border-bottom: 1px solid #999;cursor: default;color: #666;background: #eee;"),e.add(".month_default_message",'padding: 10px;opacity: 0.9;filter: alpha(opacity=90);color: #ffffff;background: #ffa216;background: -webkit-gradient(linear, left top, left bottom, from(#ffa216), to(#ff8400));background: -webkit-linear-gradient(top, #ffa216 0%, #ff8400);background: -moz-linear-gradient(top, #ffa216 0%, #ff8400);background: -ms-linear-gradient(top, #ffa216 0%, #ff8400);background: -o-linear-gradient(top, #ffa216 0%, #ff8400);background: linear-gradient(top, #ffa216 0%, #ff8400);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffa216", endColorStr="#ff8400");'),e.add(".month_default_event_inner",'position: absolute;top: 0px;bottom: 0px;left: 1px;right: 1px;overflow:hidden;padding: 2px;padding-left: 5px;font-size: 12px;color: #666;background: #fff;background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#eeeeee));background: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee);background: -moz-linear-gradient(top, #ffffff 0%, #eeeeee);background: -ms-linear-gradient(top, #ffffff 0%, #eeeeee);background: -o-linear-gradient(top, #ffffff 0%, #eeeeee);background: linear-gradient(top, #ffffff 0%, #eeeeee);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#eeeeee");border: 1px solid #999;border-radius: 0px;'),e.add(".month_default_event_continueright .month_default_event_inner","border-top-right-radius: 0px;border-bottom-right-radius: 0px;border-right-style: dotted;"),e.add(".month_default_event_continueleft .month_default_event_inner","border-top-left-radius: 0px;border-bottom-left-radius: 0px;border-left-style: dotted;"),e.add(".month_default_event_hover .month_default_event_inner",'background: #fff;background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e8e8e8));background: -webkit-linear-gradient(top, #ffffff 0%, #e8e8e8);background: -moz-linear-gradient(top, #ffffff 0%, #e8e8e8);background: -ms-linear-gradient(top, #ffffff 0%, #e8e8e8);background: -o-linear-gradient(top, #ffffff 0%, #e8e8e8);background: linear-gradient(top, #ffffff 0%, #e8e8e8);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#e8e8e8");'),e.add(".month_default_selected .month_default_event_inner, .month_default_event_hover.month_default_selected .month_default_event_inner","background: #ddd;"),e.add(".month_default_shadow_inner","background-color: #666666;opacity: 0.5;filter: alpha(opacity=50);height: 100%;"),e.add(".month_default_event_delete","background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAAI5JREFUKFNtkLERgCAMRbmzdK8s4gAUlhYOYEHJEJYOYOEwDmGBPxC4kOPfvePy84MGR0RJ2N1A8H3N6DATwSQ57m2ql8NBG+AEM7D+UW+wjdfUPgerYNgB5gOLRHqhcasg84C2QxPMtrUhSqQIhg7ypy9VM2EUZPI/4rQ7rGxqo9sadTegw+UdjeDLAKUfhbaQUVPIfJYAAAAASUVORK5CYII=) center center no-repeat; opacity: 0.6; -ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=60)';cursor: pointer;"),e.add(".month_default_event_delete:hover","opacity: 1;-ms-filter: none;"),e.add(".month_default_event_timeleft","color: #ccc; font-size: 8pt"),e.add(".month_default_event_timeright","color: #ccc; font-size: 8pt; text-align: right;"),e.add(".navigator_default_main","border-left: 1px solid #A0A0A0;border-right: 1px solid #A0A0A0;border-bottom: 1px solid #A0A0A0;background-color: white;color: #000000;"),e.add(".navigator_default_month","font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 11px;"),e.add(".navigator_default_day","color: black;"),e.add(".navigator_default_weekend","background-color: #f0f0f0;"),e.add(".navigator_default_dayheader","color: black;"),e.add(".navigator_default_line","border-bottom: 1px solid #A0A0A0;"),e.add(".navigator_default_dayother","color: gray;"),e.add(".navigator_default_todaybox","border: 1px solid red;"),e.add(".navigator_default_title, .navigator_default_titleleft, .navigator_default_titleright",'border-top: 1px solid #A0A0A0;color: #666;background: #eee;background: -webkit-gradient(linear, left top, left bottom, from(#eeeeee), to(#dddddd));background: -webkit-linear-gradient(top, #eeeeee 0%, #dddddd);background: -moz-linear-gradient(top, #eeeeee 0%, #dddddd);background: -ms-linear-gradient(top, #eeeeee 0%, #dddddd);background: -o-linear-gradient(top, #eeeeee 0%, #dddddd);background: linear-gradient(top, #eeeeee 0%, #dddddd);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#eeeeee", endColorStr="#dddddd");'),e.add(".navigator_default_busy","font-weight: bold;"),e.add(".navigator_default_cell","text-align: center;"),e.add(".navigator_default_select .navigator_default_cell_box","background-color: #FFE794; opacity: 0.5;"),e.add(".scheduler_default_selected .scheduler_default_event_inner","background: #ddd;"),e.add(".scheduler_default_main","border: 1px solid #aaa;font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 12px;"),e.add(".scheduler_default_timeheader","cursor: default;color: #666;"),e.add(".scheduler_default_message","opacity: 0.9;filter: alpha(opacity=90);padding: 10px; color: #ffffff;background: #ffa216;"),e.add(".scheduler_default_timeheadergroup,.scheduler_default_timeheadercol","color: #666;background: #eee;"),e.add(".scheduler_default_rowheader,.scheduler_default_corner","color: #666;background: #eee;"),e.add(".scheduler_default_rowheader.scheduler_default_rowheader_selected","background-color: #aaa;background-image: -webkit-gradient(linear, 0 100%, 100% 0,color-stop(.25, rgba(255, 255, 255, .2)), color-stop(.25, transparent),\tcolor-stop(.5, transparent), color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.75, rgba(255, 255, 255, .2)), color-stop(.75, transparent), to(transparent));background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: -ms-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);-webkit-background-size: 20px 20px;-moz-background-size: 20px 20px;background-size: 20px 20px;"),e.add(".scheduler_default_rowheader_inner","position: absolute;left: 0px;right: 0px;top: 0px;bottom: 0px;border-right: 1px solid #eee;padding: 2px;"),e.add(".scheduler_default_timeheadergroup, .scheduler_default_timeheadercol","text-align: center;"),e.add(".scheduler_default_timeheadergroup_inner","position: absolute;left: 0px;right: 0px;top: 0px;bottom: 0px;border-right: 1px solid #aaa;border-bottom: 1px solid #aaa;"),e.add(".scheduler_default_timeheadercol_inner","position: absolute;left: 0px;right: 0px;top: 0px;bottom: 0px;border-right: 1px solid #aaa;"),e.add(".scheduler_default_divider, .scheduler_default_splitter","background-color: #aaa;"),e.add(".scheduler_default_divider_horizontal","background-color: #aaa;"),e.add(".scheduler_default_matrix_vertical_line","background-color: #eee;"),e.add(".scheduler_default_matrix_vertical_break","background-color: #000;"),e.add(".scheduler_default_matrix_horizontal_line","background-color: #eee;"),e.add(".scheduler_default_resourcedivider","background-color: #aaa;"),e.add(".scheduler_default_shadow_inner","background-color: #666666;opacity: 0.5;filter: alpha(opacity=50);height: 100%;"),e.add(".scheduler_default_event","font-size:12px;color:#666;"),e.add(".scheduler_default_event_inner","position:absolute;top:0px;left:0px;right:0px;bottom:0px;padding:5px 2px 2px 2px;overflow:hidden;border:1px solid #ccc;"),e.add(".scheduler_default_event_bar","top:0px;left:0px;right:0px;height:4px;background-color:#9dc8e8;"),e.add(".scheduler_default_event_bar_inner","position:absolute;height:4px;background-color:#1066a8;"),e.add(".scheduler_default_event_inner",'background:#fff;background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#eeeeee));background: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee);background: -moz-linear-gradient(top, #ffffff 0%, #eeeeee);background: -ms-linear-gradient(top, #ffffff 0%, #eeeeee);background: -o-linear-gradient(top, #ffffff 0%, #eeeeee);background: linear-gradient(top, #ffffff 0%, #eeeeee);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#eeeeee");'),e.add(".scheduler_default_event_float_inner","padding:6px 2px 2px 8px;"),e.add(".scheduler_default_event_float_inner:after",'content:"";border-color: transparent #666 transparent transparent;border-style:solid;border-width:5px;width:0;height:0;position:absolute;top:8px;left:-4px;'),e.add(".scheduler_default_columnheader_inner","font-weight: bold;"),e.add(".scheduler_default_columnheader_splitter","background-color: #666;opacity: 0.5;filter: alpha(opacity=50);"),e.add(".scheduler_default_columnheader_cell_inner","padding: 2px;"),e.add(".scheduler_default_cell","background-color: #f9f9f9;"),e.add(".scheduler_default_cell.scheduler_default_cell_business","background-color: #fff;"),e.add(".scheduler_default_cell.scheduler_default_cell_business.scheduler_default_cell_selected,.scheduler_default_cell.scheduler_default_cell_selected","background-color: #ccc;background-image: -webkit-gradient(linear, 0 100%, 100% 0,\tcolor-stop(.25, rgba(255, 255, 255, .2)), color-stop(.25, transparent),\tcolor-stop(.5, transparent), color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.75, rgba(255, 255, 255, .2)), color-stop(.75, transparent), to(transparent));background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: -ms-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);-webkit-background-size: 20px 20px;-moz-background-size: 20px 20px;background-size: 20px 20px;"),e.add(".scheduler_default_tree_image_no_children","background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAIAAABv85FHAAAAKXRFWHRDcmVhdGlvbiBUaW1lAHDhIDMwIEkgMjAwOSAwODo0NjozMSArMDEwMClDkt4AAAAHdElNRQfZAR4HLzEyzsCJAAAACXBIWXMAAA7CAAAOwgEVKEqAAAAABGdBTUEAALGPC/xhBQAAADBJREFUeNpjrK6s5uTl/P75OybJ0NLW8h8bAIozgeSxAaA4E1A7VjmgOL31MeLxHwCeXUT0WkFMKAAAAABJRU5ErkJggg==);"),e.add(".scheduler_default_tree_image_expand","background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAIAAABv85FHAAAAKXRFWHRDcmVhdGlvbiBUaW1lAHDhIDMwIEkgMjAwOSAwODo0NjozMSArMDEwMClDkt4AAAAHdElNRQfZAR4HLyUoFBT0AAAACXBIWXMAAA7CAAAOwgEVKEqAAAAABGdBTUEAALGPC/xhBQAAAFJJREFUeNpjrK6s5uTl/P75OybJ0NLW8h8bAIozgeRhgJGREc4GijMBtTNgA0BxFog+uA4IA2gmUJwFog/IgUhAGBB9KPYhA3T74Jog+hjx+A8A1KRQ+AN5vcwAAAAASUVORK5CYII=);"),e.add(".scheduler_default_tree_image_collapse","background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAIAAABv85FHAAAAKXRFWHRDcmVhdGlvbiBUaW1lAHDhIDMwIEkgMjAwOSAwODo0NjozMSArMDEwMClDkt4AAAAHdElNRQfZAR4HLxB+p9DXAAAACXBIWXMAAA7CAAAOwgEVKEqAAAAABGdBTUEAALGPC/xhBQAAAENJREFUeNpjrK6s5uTl/P75OybJ0NLW8h8bAIozgeSxAaA4E1A7VjmgOAtEHyMjI7IE0EygOAtEH5CDqY9c+xjx+A8ANndK9WaZlP4AAAAASUVORK5CYII=);"),e.add(".scheduler_default_event_move_left",'box-sizing: border-box; padding:2px;border:1px solid #ccc;background:#fff;background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#eeeeee));background: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee);background: -moz-linear-gradient(top, #ffffff 0%, #eeeeee);background: -ms-linear-gradient(top, #ffffff 0%, #eeeeee);background: -o-linear-gradient(top, #ffffff 0%, #eeeeee);background: linear-gradient(top, #ffffff 0%, #eeeeee);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#eeeeee");'),e.add(".scheduler_default_event_move_right",'box-sizing: border-box; padding:2px;border:1px solid #ccc;background:#fff;background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#eeeeee));background: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee);background: -moz-linear-gradient(top, #ffffff 0%, #eeeeee);background: -ms-linear-gradient(top, #ffffff 0%, #eeeeee);background: -o-linear-gradient(top, #ffffff 0%, #eeeeee);background: linear-gradient(top, #ffffff 0%, #eeeeee);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#eeeeee");'),e.add(".scheduler_default_event_delete","background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAAI5JREFUKFNtkLERgCAMRbmzdK8s4gAUlhYOYEHJEJYOYOEwDmGBPxC4kOPfvePy84MGR0RJ2N1A8H3N6DATwSQ57m2ql8NBG+AEM7D+UW+wjdfUPgerYNgB5gOLRHqhcasg84C2QxPMtrUhSqQIhg7ypy9VM2EUZPI/4rQ7rGxqo9sadTegw+UdjeDLAKUfhbaQUVPIfJYAAAAASUVORK5CYII=) center center no-repeat; opacity: 0.6; -ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=60)';cursor: pointer;"),e.add(".scheduler_default_event_delete:hover","opacity: 1;-ms-filter: none;"),e.add(".scheduler_default_rowmove_handle","background-repeat: no-repeat; background-position: center center; background-color: #ccc; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAKCAYAAACT+/8OAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAAClJREFUGFdj+P//P4O9vX2Bg4NDP4gNFgBytgPxebgAMsYuQGMz/jMAAFsTZDPYJlDHAAAAAElFTkSuQmCC); cursor: move;"),e.add(".scheduler_default_rowmove_source","background-color: black; opacity: 0.2;"),e.add(".scheduler_default_rowmove_position_before, .scheduler_default_rowmove_position_after","background-color: #999; height: 2px;"),e.add(".scheduler_default_rowmove_position_child","margin-left: 10px; background-color: #999; height: 2px;"),e.add(".scheduler_default_rowmove_position_child:before","content: '+'; color: #999; position: absolute; top: -8px; left: -10px;"),e.add(".scheduler_default_rowmove_position_forbidden","background-color: red; height: 2px; margin-left: 10px;"),e.add(".scheduler_default_rowmove_position_forbidden:before","content: 'x'; color: red; position: absolute; top: -8px; left: -10px;"),e.add(".scheduler_default_link_horizontal","border-bottom-style: solid; border-bottom-color: red"),e.add(".scheduler_default_link_vertical","border-right-style: solid; border-right-color: red"),e.add(".scheduler_default_link_arrow_right:before","content: ''; border-width: 6px; border-color: transparent transparent transparent red; border-style: solid; width: 0px; height:0px; position: absolute;"),e.add(".scheduler_default_link_arrow_left:before","content: ''; border-width: 6px; border-color: transparent red transparent transparent; border-style: solid; width: 0px; height:0px; position: absolute;"),e.add(".scheduler_default_link_arrow_down:before","content: ''; border-width: 6px; border-color: red transparent transparent transparent; border-style: solid; width: 0px; height:0px; position: absolute;"),e.add(".scheduler_default_shadow_overlap .scheduler_default_shadow_inner","background-color: red;"),e.add(".scheduler_default_block","background-color: gray; opacity: 0.5; filter: alpha(opacity=50);"),e.add(".scheduler_default_event_group","box-sizing: border-box; font-size:12px; color:#666; padding:4px 2px 2px 2px; overflow:hidden; border:1px solid #ccc; background-color: #fff;"),e.add(".scheduler_default_header_icon","box-sizing: border-box; border: 1px solid #aaa; background-color: #f5f5f5; color: #000;"),e.add(".scheduler_default_header_icon:hover","background-color: #ccc;"),e.add(".scheduler_default_header_icon_hide:before","content: '\\00AB';"),e.add(".scheduler_default_header_icon_show:before","content: '\\00BB';"),e.add(".scheduler_default_row_new .scheduler_default_rowheader_inner","cursor: text; background-position: 0px 5px; background-repeat: no-repeat; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABUSURBVChTY0ACslAaK2CC0iCQDMSlECYmQFYIAl1AjFUxukIQwKoYm0IQwFCMSyEIaEJpMMClcD4Qp0CYEIBNIUzRPzAPCtAVYlWEDgyAGIdTGBgAbqEJYyjqa3oAAAAASUVORK5CYII=);"),e.add(".scheduler_default_row_new .scheduler_default_rowheader_inner:hover","background: white;"),e.add(".scheduler_default_rowheader textarea","padding: 3px;"),e.add(".scheduler_default_rowheader_scroll","cursor: default;"),e.add(".scheduler_default_shadow_forbidden .scheduler_default_shadow_inner","background-color: red;"),e.add(".scheduler_default_event_moving_source","opacity: 0.5; filter: alpha(opacity=50);"),e.add(".gantt_default_selected .gantt_default_event_inner","background: #ddd;"),e.add(".gantt_default_main","border: 1px solid #aaa;font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 12px;"),e.add(".gantt_default_timeheader","cursor: default;color: #666;"),e.add(".gantt_default_message","opacity: 0.9;filter: alpha(opacity=90);padding: 10px; color: #ffffff;background: #ffa216;"),e.add(".gantt_default_timeheadergroup,.gantt_default_timeheadercol","color: #666;background: #eee;"),e.add(".gantt_default_rowheader,.gantt_default_corner","color: #666;background: #eee;"),e.add(".gantt_default_rowheader.gantt_default_rowheader_selected","background-color: #aaa;background-image: -webkit-gradient(linear, 0 100%, 100% 0,color-stop(.25, rgba(255, 255, 255, .2)), color-stop(.25, transparent),\tcolor-stop(.5, transparent), color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.75, rgba(255, 255, 255, .2)), color-stop(.75, transparent), to(transparent));background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: -ms-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);-webkit-background-size: 20px 20px;-moz-background-size: 20px 20px;background-size: 20px 20px;"),e.add(".gantt_default_rowheader_inner","position: absolute;left: 0px;right: 0px;top: 0px;bottom: 0px;border-right: 1px solid #eee;padding: 2px;"),e.add(".gantt_default_timeheadergroup, .gantt_default_timeheadercol","text-align: center;"),e.add(".gantt_default_timeheadergroup_inner","position: absolute;left: 0px;right: 0px;top: 0px;bottom: 0px;border-right: 1px solid #aaa;border-bottom: 1px solid #aaa;"),e.add(".gantt_default_timeheadercol_inner","position: absolute;left: 0px;right: 0px;top: 0px;bottom: 0px;border-right: 1px solid #aaa;"),e.add(".gantt_default_divider, .gantt_default_splitter","background-color: #aaa;"),e.add(".gantt_default_divider_horizontal","background-color: #aaa;"),e.add(".gantt_default_matrix_vertical_line","background-color: #eee;"),e.add(".gantt_default_matrix_vertical_break","background-color: #000;"),e.add(".gantt_default_matrix_horizontal_line","background-color: #eee;"),e.add(".gantt_default_resourcedivider","background-color: #aaa;"),e.add(".gantt_default_shadow_inner","background-color: #666666;opacity: 0.5;filter: alpha(opacity=50);height: 100%;"),e.add(".gantt_default_event","font-size:12px;color:#666;"),e.add(".gantt_default_event_inner","position:absolute;top:0px;left:0px;right:0px;bottom:0px;padding:5px 2px 2px 2px;overflow:hidden;border:1px solid #ccc;"),e.add(".gantt_default_event_bar","top:0px;left:0px;right:0px;height:4px;background-color:#9dc8e8;"),e.add(".gantt_default_event_bar_inner","position:absolute;height:4px;background-color:#1066a8;"),e.add(".gantt_default_event_inner",'background:#fff;background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#eeeeee));background: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee);background: -moz-linear-gradient(top, #ffffff 0%, #eeeeee);background: -ms-linear-gradient(top, #ffffff 0%, #eeeeee);background: -o-linear-gradient(top, #ffffff 0%, #eeeeee);background: linear-gradient(top, #ffffff 0%, #eeeeee);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#eeeeee");'),e.add(".gantt_default_event_float_inner","padding:6px 2px 2px 8px;"),e.add(".gantt_default_event_float_inner:after",'content:"";border-color: transparent #666 transparent transparent;border-style:solid;border-width:5px;width:0;height:0;position:absolute;top:8px;left:-4px;'),e.add(".gantt_default_columnheader_inner","font-weight: bold;"),e.add(".gantt_default_columnheader_splitter","background-color: #666;opacity: 0.5;filter: alpha(opacity=50);"),e.add(".gantt_default_columnheader_cell_inner","padding: 2px;"),e.add(".gantt_default_cell","background-color: #f9f9f9;"),e.add(".gantt_default_cell.gantt_default_cell_business","background-color: #fff;"),e.add(".gantt_default_cell.gantt_default_cell_business.gantt_default_cell_selected,.gantt_default_cell.gantt_default_cell_selected","background-color: #ccc;background-image: -webkit-gradient(linear, 0 100%, 100% 0,\tcolor-stop(.25, rgba(255, 255, 255, .2)), color-stop(.25, transparent),\tcolor-stop(.5, transparent), color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.75, rgba(255, 255, 255, .2)), color-stop(.75, transparent), to(transparent));background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: -ms-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);background-image: linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);-webkit-background-size: 20px 20px;-moz-background-size: 20px 20px;background-size: 20px 20px;"),e.add(".gantt_default_tree_image_no_children","background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAIAAABv85FHAAAAKXRFWHRDcmVhdGlvbiBUaW1lAHDhIDMwIEkgMjAwOSAwODo0NjozMSArMDEwMClDkt4AAAAHdElNRQfZAR4HLzEyzsCJAAAACXBIWXMAAA7CAAAOwgEVKEqAAAAABGdBTUEAALGPC/xhBQAAADBJREFUeNpjrK6s5uTl/P75OybJ0NLW8h8bAIozgeSxAaA4E1A7VjmgOL31MeLxHwCeXUT0WkFMKAAAAABJRU5ErkJggg==);"),e.add(".gantt_default_tree_image_expand","background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAIAAABv85FHAAAAKXRFWHRDcmVhdGlvbiBUaW1lAHDhIDMwIEkgMjAwOSAwODo0NjozMSArMDEwMClDkt4AAAAHdElNRQfZAR4HLyUoFBT0AAAACXBIWXMAAA7CAAAOwgEVKEqAAAAABGdBTUEAALGPC/xhBQAAAFJJREFUeNpjrK6s5uTl/P75OybJ0NLW8h8bAIozgeRhgJGREc4GijMBtTNgA0BxFog+uA4IA2gmUJwFog/IgUhAGBB9KPYhA3T74Jog+hjx+A8A1KRQ+AN5vcwAAAAASUVORK5CYII=);"),e.add(".gantt_default_tree_image_collapse","background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAIAAABv85FHAAAAKXRFWHRDcmVhdGlvbiBUaW1lAHDhIDMwIEkgMjAwOSAwODo0NjozMSArMDEwMClDkt4AAAAHdElNRQfZAR4HLxB+p9DXAAAACXBIWXMAAA7CAAAOwgEVKEqAAAAABGdBTUEAALGPC/xhBQAAAENJREFUeNpjrK6s5uTl/P75OybJ0NLW8h8bAIozgeSxAaA4E1A7VjmgOAtEHyMjI7IE0EygOAtEH5CDqY9c+xjx+A8ANndK9WaZlP4AAAAASUVORK5CYII=);"),e.add(".gantt_default_event_move_left",'box-sizing: border-box; padding:2px;border:1px solid #ccc;background:#fff;background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#eeeeee));background: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee);background: -moz-linear-gradient(top, #ffffff 0%, #eeeeee);background: -ms-linear-gradient(top, #ffffff 0%, #eeeeee);background: -o-linear-gradient(top, #ffffff 0%, #eeeeee);background: linear-gradient(top, #ffffff 0%, #eeeeee);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#eeeeee");'),e.add(".gantt_default_event_move_right",'box-sizing: border-box; padding:2px;border:1px solid #ccc;background:#fff;background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#eeeeee));background: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee);background: -moz-linear-gradient(top, #ffffff 0%, #eeeeee);background: -ms-linear-gradient(top, #ffffff 0%, #eeeeee);background: -o-linear-gradient(top, #ffffff 0%, #eeeeee);background: linear-gradient(top, #ffffff 0%, #eeeeee);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#eeeeee");'),e.add(".gantt_default_event_delete","background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAAI5JREFUKFNtkLERgCAMRbmzdK8s4gAUlhYOYEHJEJYOYOEwDmGBPxC4kOPfvePy84MGR0RJ2N1A8H3N6DATwSQ57m2ql8NBG+AEM7D+UW+wjdfUPgerYNgB5gOLRHqhcasg84C2QxPMtrUhSqQIhg7ypy9VM2EUZPI/4rQ7rGxqo9sadTegw+UdjeDLAKUfhbaQUVPIfJYAAAAASUVORK5CYII=) center center no-repeat; opacity: 0.6; -ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=60)';cursor: pointer;"),e.add(".gantt_default_event_delete:hover","opacity: 1;-ms-filter: none;"),e.add(".gantt_default_rowmove_handle","background-repeat: no-repeat; background-position: center center; background-color: #ccc; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAKCAYAAACT+/8OAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAAClJREFUGFdj+P//P4O9vX2Bg4NDP4gNFgBytgPxebgAMsYuQGMz/jMAAFsTZDPYJlDHAAAAAElFTkSuQmCC); cursor: move;"),e.add(".gantt_default_rowmove_source","background-color: black; opacity: 0.2;"),e.add(".gantt_default_rowmove_position_before, .gantt_default_rowmove_position_after","background-color: #999; height: 2px;"),e.add(".gantt_default_rowmove_position_child","margin-left: 10px; background-color: #999; height: 2px;"),e.add(".gantt_default_rowmove_position_child:before","content: '+'; color: #999; position: absolute; top: -8px; left: -10px;"),e.add(".gantt_default_rowmove_position_forbidden","background-color: red; height: 2px; margin-left: 10px;"),e.add(".gantt_default_rowmove_position_forbidden:before","content: 'x'; color: red; position: absolute; top: -8px; left: -10px;"),e.add(".gantt_default_task_group .gantt_default_event_inner","position:absolute;top:5px;left:0px;right:0px;bottom:6px;overflow:hidden; background: blue; filter: none; border: 0px none;"),e.add(".gantt_default_task_group.gantt_default_event:before","content:''; border-color: transparent transparent transparent blue; border-style: solid; border-width: 6px; position: absolute; bottom: 0px;"),e.add(".gantt_default_task_group.gantt_default_event:after","content:''; border-color: transparent blue transparent transparent; border-style: solid; border-width: 6px; position: absolute; bottom: 0px; right: 0px;"),e.add(".gantt_default_task_milestone .gantt_default_event_inner","position:absolute;top:16%;left:16%;right:16%;bottom:16%; background: green; border: 0px none; -webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);-ms-transform: rotate(45deg);-o-transform: rotate(45deg); transform: rotate(45deg); filter: none;"),e.add(".gantt_default_browser_ie8 .gantt_default_task_milestone .gantt_default_event_inner","-ms-filter: \"progid:$2r.Microsoft.Matrix($2s='auto expand',$2t=0.7071067811865476,$2u=-0.7071067811865475,$2v=0.7071067811865475,$2w=0.7071067811865476);\""),e.add(".gantt_default_event_left","white-space: nowrap; padding-top: 5px; color: #666; cursor: default;"),e.add(".gantt_default_event_right","white-space: nowrap; padding-top: 5px; color: #666; cursor: default;"),e.add(".gantt_default_link_horizontal","border-bottom-style: solid; border-bottom-color: red;"),e.add(".gantt_default_link_vertical","border-right-style: solid; border-right-color: red;"),e.add(".gantt_default_link_arrow_right:before","content: ''; border-width: 6px; border-color: transparent transparent transparent red; border-style: solid; width: 0px; height:0px; position: absolute;"),e.add(".gantt_default_link_arrow_left:before","content: ''; border-width: 6px; border-color: transparent red transparent transparent; border-style: solid; width: 0px; height:0px; position: absolute;"),e.add(".gantt_default_link_arrow_down:before","content: ''; border-width: 6px; border-color: red transparent transparent transparent; border-style: solid; width: 0px; height:0px; position: absolute;"),e.add(".gantt_default_shadow_overlap .gantt_default_shadow_inner","background-color: red;"),e.add(".gantt_default_block","background-color: gray; opacity: 0.5; filter: alpha(opacity=50);"),e.add(".gantt_default_link_hover","box-shadow: 0px 0px 2px 2px rgba(255, 0, 0, 0.3)"),e.add(".gantt_default_header_icon","box-sizing: border-box; border: 1px solid #aaa; background-color: #f5f5f5; color: #000;"),e.add(".gantt_default_header_icon:hover","background-color: #ccc;"),e.add(".gantt_default_header_icon_hide:before","content: '\\00AB';"),e.add(".gantt_default_header_icon_show:before","content: '\\00BB';"),e.add(".gantt_default_row_new .gantt_default_rowheader_inner","cursor: text; background-position: 0 50%; background-repeat: no-repeat; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABUSURBVChTY0ACslAaK2CC0iCQDMSlECYmQFYIAl1AjFUxukIQwKoYm0IQwFCMSyEIaEJpMMClcD4Qp0CYEIBNIUzRPzAPCtAVYlWEDgyAGIdTGBgAbqEJYyjqa3oAAAAASUVORK5CYII=);"),e.add(".gantt_default_row_new .gantt_default_rowheader_inner:hover","background: white;"),e.add(".gantt_default_rowheader textarea","padding: 5px;"),e.add(".gantt_default_rowheader_scroll","cursor: default;"),e.add(".gantt_default_shadow_forbidden .gantt_default_shadow_inner","background-color: red;"),e.add(".gantt_default_event_moving_source","opacity: 0.5; filter: alpha(opacity=50);"),e.commit(),DayPilot.Global.defaultCss=!0}}();var $2x=function(e){var t=this;this.id=e,this.widths=[],this.titles=[],this.height=null,this.splitterWidth=3,this.css={},this.css.title=null,this.css.titleInner=null,this.css.splitter=null,this.blocks=[],this.drag={},this.updated=function(){},this.updating=function(){},this.init=function(){var i;if(!e)throw"error: id not provided";if("string"==typeof e)i=document.getElementById(e);else{if(!e.appendChild)throw"error: invalid object provided";i=e}this.div=i,this.blocks=[];for(var n=0;n<this.widths.length;n++){var a=document.createElement("div");a.style.display="inline-block",null!==t.height?a.style.height=t.height+"px":a.style.height="100%",a.style.width=this.widths[n]-this.splitterWidth+"px",a.style.overflow="hidden",a.style.verticalAlign="top",a.style.position="relative",a.setAttribute("unselectable","on"),a.className=this.css.title,i.appendChild(a);var s=document.createElement("div");s.innerHTML=this.titles[n],s.setAttribute("unselectable","on"),s.className=this.css.titleInner,a.appendChild(s);var o=document.createElement("div");o.style.display="inline-block",null!==t.height?o.style.height=t.height+"px":o.style.height="100%",o.style.width=this.splitterWidth+"px",o.style.position="relative",o.appendChild(document.createElement("div")),o.style.cursor="col-resize",o.setAttribute("unselectable","on"),o.className=this.css.splitter;var l={};l.index=n,l.width=this.widths[n],o.data=l,o.onmousedown=function(e){t.drag.start=DayPilot.page(e),t.drag.data=this.data,t.div.style.cursor="col-resize",(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1},i.appendChild(o);var r={};r.section=a,r.handle=o,this.blocks.push(r)}this.registerGlobalHandlers()},this.updateWidths=function(){for(var e=0;e<this.blocks.length;e++){var t=this.blocks[e],i=this.widths[e];t.handle.data.width=i,this.$2U(e)}},this.$2U=function(e){var t=this.blocks[e],i=this.widths[e];t.section.style.width=i-this.splitterWidth+"px"},this.totalWidth=function(){for(var e=0,t=0;t<this.widths.length;t++)e+=this.widths[t];return e},this.gMouseMove=function(e){if(t.drag.start){var i=t.drag.data,n=DayPilot.page(e).x-t.drag.start.x,a=i.index;t.widths[a]=Math.max(5,i.width+n),t.$2U(a);var s={};s.widths=this.widths,s.index=i.index,t.updating(s)}},this.gMouseUp=function(e){if(t.drag.start){t.drag.start=null,document.body.style.cursor="",t.div.style.cursor="";var i=t.drag.data;i.width=t.widths[i.index];var n={};n.widths=this.widths,n.index=i.index,t.updated(n)}},this.registerGlobalHandlers=function(){DayPilot.re(document,"mousemove",this.gMouseMove),DayPilot.re(document,"mouseup",this.gMouseUp)}};DayPilot.Splitter=$2x}}(),DayPilot.JSON={},function(){function f(e){return e<10?"0"+e:e}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null}),"function"!=typeof String.prototype.toJSON&&(String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(e){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,$2C=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,$2D,$2E,$2F={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$2G;function quote(e){return $2C.lastIndex=0,$2C.test(e)?'"'+e.replace($2C,function(e){var t=$2F[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var i,n,a,s,o,l=$2D,r=t[e];switch(r&&"object"==typeof r&&"function"==typeof r.toJSON&&!r.ignoreToJSON&&(r=r.toJSON(e)),"function"==typeof $2G&&(r=$2G.call(t,e,r)),typeof r){case"string":return quote(r);case"number":return isFinite(r)?String(r):"null";case"boolean":case"null":return String(r);case"object":if(!r)return"null";if($2D+=$2E,o=[],"number"==typeof r.length&&!r.propertyIsEnumerable("length")){for(s=r.length,i=0;i<s;i+=1)o[i]=str(i,r)||"null";return a=0===o.length?"[]":$2D?"[\n"+$2D+o.join(",\n"+$2D)+"\n"+l+"]":"["+o.join(",")+"]",$2D=l,a}if($2G&&"object"==typeof $2G)for(s=$2G.length,i=0;i<s;i+=1)"string"==typeof(n=$2G[i])&&(a=str(n,r))&&o.push(quote(n)+($2D?": ":":")+a);else for(n in r)Object.hasOwnProperty.call(r,n)&&(a=str(n,r))&&o.push(quote(n)+($2D?": ":":")+a);return a=0===o.length?"{}":$2D?"{\n"+$2D+o.join(",\n"+$2D)+"\n"+l+"}":"{"+o.join(",")+"}",$2D=l,a}}DayPilot.JSON.stringify=function(e,t,i){var n;if($2D="",$2E="","number"==typeof i)for(n=0;n<i;n+=1)$2E+=" ";else"string"==typeof i&&($2E=i);if($2G=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})},DayPilot.JSON.parse=function($U,$2N){var j;function walk(e,t){var i,n,a=e[t];if(a&&"object"==typeof a)for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(void 0!==(n=walk(a,i))?a[i]=n:delete a[i]);return $2N.call(e,t,a)}if($U=String($U),cx.lastIndex=0,cx.test($U)&&($U=$U.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{};\s]*$/.test($U.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+$U+")"),"function"==typeof $2N?walk({"":j},""):j;throw new SyntaxError("JSON.parse")},"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}(),void 0===DayPilot)var DayPilot={};if(void 0===DayPilot.Global&&(DayPilot.Global={}),void 0===DayPilotBubble)var DayPilotBubble=DayPilot.BubbleVisible={};if(function(){if(void 0===DayPilot.Bubble){var e={mouseMove:function(t){if(void 0!==e){e.mouse=e.mousePosition(t);var i=e.active;if(i&&i.$R.showPosition){var n=i.$R.showPosition,a=e.mouse;n.clientX!==a.clientX||(n.clientY,a.clientY)}}},mousePosition:function(e){var t=DayPilot.page(e);return e&&(t.clientY=e.clientY,t.clientX=e.clientX),t}};DayPilot.Bubble=function(t){this.v="1659";var i=this,n={};if(this.cssOnly=!0,this.hideAfter=500,this.loadingText="Loading...",this.animated=!0,this.animation="fast",this.position="EventTop",this.hideOnClick=!0,this.showAfter=500,this.showLoadingLabel=!0,this.zIndex=10,this.theme="bubble_default",this.$R=function(){},this.callBack=function(e){this.aspnet()?WebForm_DoCallback(this.uniqueID,DayPilot.JSON.stringify(e),this.updateView,this,this.callbackError,!0):e.calendar.internal.bubbleCallBack?e.calendar.internal.bubbleCallBack(e,this):e.calendar.bubbleCallBack(e,this)},this.callbackError=function(e,t){alert(e)},this.updateView=function(t,a){if(i!==a)throw"Callback object mismatch (internal error)";if(!t)return i.removeDiv(),void i.removeShadow();e.active=i,i&&(n.div&&(n.div.firstChild.innerHTML=t),i.adjustPosition(),i.animated||i.addShadow())},this.init=function(){},this.aspnet=function(){return"undefined"!=typeof WebForm_DoCallback},this.rounded=function(){return"Rounded"===this.corners},this.showEvent=function(t,i){var n=new e.CallBackArgs(t.calendar||t.root,"Event",t,t.bubbleHtml?t.bubbleHtml():null);i?this.show(n):this.showOnMouseOver(n)},this.showCell=function(t){var i=new e.CallBackArgs(t.calendar||t.root,"Cell",t,t.staticBubbleHTML?t.staticBubbleHTML():null);this.showOnMouseOver(i)},this.showTime=function(t){var i=new e.CallBackArgs(t.calendar||t.root,"Time",t,t.staticBubbleHTML?t.staticBubbleHTML():null);this.showOnMouseOver(i)},this.showResource=function(t){var i=new e.CallBackArgs(t.calendar||t.root,"Resource",t,t.staticBubbleHTML?t.staticBubbleHTML():null);this.showOnMouseOver(i)},this.showHtml=function(t,i){var n=new e.CallBackArgs(null,"Html",null,t);n.div=i,this.show(n)},this.show=function(t){var a=this.animated;if(this.$R.showPosition=e.mouse,e.mouse){var s;try{s=DayPilot.JSON.stringify(t.object)}catch(e){return}if(!(e.active===this&&this.$R.sourceId===s||void 0!==DayPilot.Menu&&DayPilot.Menu.active)){i.cssOnly||(i.cssOnly=!0,DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0.")),e.hideActive(),e.active=this,this.$R.sourceId=s,(l=document.createElement("div")).setAttribute("unselectable","on"),l.style.position="absolute",this.showLoadingLabel||(l.style.display="none"),this.cssOnly?l.className=this.$S("_main"):(this.width&&(l.style.width=this.width),l.style.cursor="default"),l.style.top="0px",l.style.left="0px",l.style.zIndex=this.zIndex+1,a&&(l.style.visibility="hidden"),this.hideOnClick&&(l.onclick=function(){e.hideActive()}),l.onmousemove=function(t){e.cancelTimeout(),(t=t||window.event).cancelBubble=!0},l.oncontextmenu=function(){return!1},l.onmouseout=this.delayedHide;var o=document.createElement("div");l.appendChild(o),this.cssOnly?o.className=this.$S("_main_inner"):(o.style.padding="4px",this.border&&(o.style.border=this.border),this.rounded()&&(o.style.MozBorderRadius="5px",o.style.webkitBorderRadius="5px",o.style.borderRadius="5px"),o.style.backgroundColor=this.backgroundColor),o.innerHTML=this.loadingText,document.body.appendChild(l),n.div=l;var l=this.getDiv(t);if("EventTop"===this.position&&l){var r=DayPilot.abs(l,!0);this.$R.mouse=e.mouse,this.$R.mouse.x=r.x,this.$R.mouse.y=r.y,this.$R.mouse.h=r.h+2,this.$R.mouse.w=r.w}else this.$R.mouse=e.mouse;if(this.showLoadingLabel&&!a&&(this.adjustPosition(),this.addShadow()),t.staticHTML)this.updateView(t.staticHTML,this);else if("function"==typeof this.onLoad){var d={};d.source=t.object,d.async=!1,d.loaded=function(){this.async&&i.updateView(d.html,i)},this.onLoad(d),d.async||i.updateView(d.html,i)}else this.$T(t)&&this.callBack(t)}}else setTimeout(function(){i.show(t)},100)},this.getDiv=function(e){return e.div?e.div:"Event"===e.type&&e.calendar&&e.calendar.internal.findEventDiv?e.calendar.internal.findEventDiv(e.object):void 0},this.$S=function(e){var t=this.theme||this.cssClassPrefix;return t?t+e:""},this.loadingElement=null,this.loadingStart=function(e){},this.loadingStop=function(){},this.adjustPosition=function(){var t=this.animated,a=this.position;if(n.div&&this.$R.mouse)if(this.$R.mouse.x&&this.$R.mouse.y){var s=n.div;s.style.display="";var o=s.offsetHeight,l=s.offsetWidth;s.style.display="none";var r=DayPilot.wd(),d=r.width,h=r.height;if("Mouse"===a){var c=0;if(this.$R.mouse.clientY>h-o+10){this.$R.mouse.clientY;c=this.$R.mouse.y-o-10}else c=this.$R.mouse.y+22;if("number"==typeof c&&(s.style.top=Math.max(c,0)+"px"),this.$R.mouse.clientX>d-l+10){var u=this.$R.mouse.clientX-(d-l)+10;s.style.left=this.$R.mouse.x-u+"px"}else s.style.left=this.$R.mouse.x+"px"}else if("EventTop"===a){(c=this.$R.mouse.y-o-2)<r.scrollTop&&(c=this.$R.mouse.y+this.$R.mouse.h+2),"number"==typeof c&&(s.style.top=Math.max(c,0)+"px");var f=this.$R.mouse.x;this.$R.mouse.x+l+10>d&&(f=d-l-10),s.style.left=f+"px"}if(s.style.display="",t){s.style.display="";var v={};v.color=s.firstChild.style.color,v.overflow=s.style.overflow,s.firstChild.style.color="transparent",s.style.overflow="hidden",this.removeShadow(),DayPilot.pop(s,{finished:function(){s.firstChild.style.color=v.color,s.style.overflow=v.overflow,i.addShadow()},vertical:"bottom",horizontal:"left",animation:i.animation})}}else e.hideActive()},this.delayedHide=function(){e.cancelTimeout(),i.hideAfter>0&&(e.timeout=window.setTimeout(e.hideActive,i.hideAfter))},this.showOnMouseOver=function(t){e.cancelTimeout();var n;e.timeout=window.setTimeout((n=t,function(){i.show(n)}),this.showAfter)},this.hideOnMouseOut=function(){this.delayedHide()},this.$T=function(e){return!!e.calendar.backendUrl||!("function"!=typeof WebForm_DoCallback||!this.uniqueID)},this.addShadow=function(){if(this.useShadow&&!this.cssOnly&&n.div){var e=n.div;this.shadows&&this.shadows.length>0&&this.removeShadow(),this.shadows=[];for(var t=0;t<5;t++){var i=document.createElement("div");i.setAttribute("unselectable","on"),i.style.position="absolute",i.style.width=e.offsetWidth+"px",i.style.height=e.offsetHeight+"px",i.style.top=e.offsetTop+t+"px",i.style.left=e.offsetLeft+t+"px",i.style.zIndex=this.zIndex,i.style.filter="alpha(opacity:10)",i.style.opacity=.1,i.style.backgroundColor="#000000",this.rounded()&&(i.style.MozBorderRadius="5px",i.style.webkitBorderRadius="5px",i.style.borderRadius="5px"),document.body.appendChild(i),this.shadows.push(i)}}},this.removeShadow=function(){if(this.shadows){for(var e=0;e<this.shadows.length;e++)document.body.removeChild(this.shadows[e]);this.shadows=[]}},this.removeDiv=function(){n.div&&(document.body.removeChild(n.div),n.div=null)},t)for(var a in t)this[a]=t[a];this.init()},e.cancelTimeout=function(){e.timeout&&window.clearTimeout(e.timeout)},e.hideActive=function(){e.cancelTimeout();var t=e.active;t&&(t.removeDiv(),t.removeShadow()),e.active=null},e.CallBackArgs=function(e,t,i,n){this.calendar=e,this.type=t,this.object=i,this.staticHTML=n,this.toJSON=function(){var e={};return e.uid=this.calendar.uniqueID,e.type=this.type,e.object=i,e}},DayPilot.re(document,"mousemove",e.mouseMove),DayPilot.BubbleVisible.Bubble=e.Bubble,DayPilot.BubbleVisible.hideActive=e.hideActive,DayPilot.BubbleVisible.cancelTimeout=e.cancelTimeout,DayPilot.Bubble.hideActive=e.hideActive,"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),void 0===DayPilot)var DayPilot={};if(void 0===DayPilot.Global&&(DayPilot.Global={}),void 0===DayPilotCalendar)var DayPilotCalendar=DayPilot.CalendarVisible={};if(function(){if(void 0===DayPilot.Calendar){DayPilot.Calendar=function(e,i){this.v="1659";var n=!1;if(this instanceof DayPilot.Calendar&&!this.$44&&(n=!0,this.$44=!0),!n)throw"DayPilot.Calendar() is a constructor and must be called as 'var c = new DayPilot.Calendar(id);'";var a,s=this;this.uniqueID=null,this.id=e,this.isCalendar=!0,this.api=2,this.clientName=e,this.clientState={},this.$45={},this.$45.pixels={},this.$45.events=[],this.elements={},this.elements.events=[],this.elements.separators=[],this.nav={},this.events={},this.hideUntilInit=!0,this.$46=!0,this.allDayEventBorderColor="#000000",this.allDayEventFontFamily="Tahoma",this.allDayEventFontSize="8pt",this.allDayEventFontColor="#000000",this.allDayEventHeight=25,this.allowEventOverlap=!0,this.allowMultiSelect=!0,this.autoRefreshCommand="refresh",this.autoRefreshEnabled=!1,this.autoRefreshInterval=60,this.autoRefreshMaxCount=20,this.borderColor="#000000",this.businessBeginsHour=9,this.businessEndsHour=18,this.cellBackColor="#FFFFD5",this.cellBackColorNonBusiness="#FFF4BC",this.cellBorderColor="#999999",this.cellHeight=20,this.cellDuration=30,this.columnMarginRight=5,this.columnWidth=200,this.columnWidthSpec="Auto",this.cornerBackColor="#ECE9D8",this.cornerHtml="",this.crosshairColor="Gray",this.crosshairOpacity=20,this.crosshairType="Header",this.cssOnly=!0,this.dayBeginsHour=0,this.dayEndsHour=24,this.days=1,this.deleteImageUrl=null,this.durationBarColor="blue",this.durationBarVisible=!0,this.durationBarWidth=5,this.durationBarImageUrl=null,this.eventArrangement="SideBySide",this.eventBackColor="#ffffff",this.eventBorderColor="#000000",this.eventFontFamily="Tahoma",this.eventFontSize="8pt",this.eventFontColor="#000000",this.eventSelectColor="blue",this.headerFontSize="10pt",this.headerFontFamily="Tahoma",this.headerFontColor="#000000",this.headerHeight=20,this.headerLevels=1,this.height=300,this.heightSpec="BusinessHours",this.hideFreeCells=!1,this.headerDateFormat=null,this.hourHalfBorderColor="#F3E4B1",this.hourBorderColor="#EAD098",this.hourFontColor="#000000",this.hourFontFamily="Tahoma",this.hourFontSize="16pt",this.hourNameBackColor="#ECE9D8",this.hourNameBorderColor="#ACA899",this.hourWidth=45,this.initScrollPos=null,this.loadingLabelText="Loading...",this.loadingLabelVisible=!0,this.loadingLabelBackColor="orange",this.loadingLabelFontColor="#ffffff",this.loadingLabelFontFamily="Tahoma",this.loadingLabelFontSize="10pt",this.locale="en-us",this.messageHideAfter=5e3,this.moveBy="Full",this.notifyCommit="Immediate",this.numberFormat=null,this.roundedCorners=!1,this.rtl=!1,this.scrollLabelsVisible=!1,this.selectedColor="#316AC5",this.shadow="Fill",this.showToolTip=!0,this.showAllDayEvents=!1,this.showAllDayEventStartEnd=!0,this.showEventStartEnd=!1,this.showHeader=!0,this.showHours=!0,this.showCurrentTime=!0,this.startDate=(new DayPilot.Date).getDatePart(),this.cssClassPrefix="calendar_default",this.tapAndHoldTimeout=500,this.timeFormat="Auto",this.timeHeaderCellDuration=60,this.useEventBoxes="Always",this.useEventSelectionBars=!1,this.viewType="Days",this.visible=!0,this.eventClickHandling="Enabled",this.eventDoubleClickHandling="Enabled",this.eventRightClickHandling="ContextMenu",this.eventDeleteHandling="Disabled",this.eventEditHandling="Update",this.eventHoverHandling="Bubble",this.eventResizeHandling="Update",this.eventMoveHandling="Update",this.eventSelectHandling="Update",this.eventTapAndHoldHandling="Move",this.headerClickHandling="Enabled",this.timeRangeTapAndHoldHandling="Select",this.timeRangeSelectedHandling="Enabled",this.timeRangeDoubleClickHandling="Enabled",this.$47=!0,this.$48=!1,this.autoRefreshCount=0,this.doubleClickTimeout=300,this.members={},this.members.obsolete=["Init","cleanSelection","cssClassPrefix"],this.members.ignore=["internal","nav","debug","temp","elements","members"],this.members.noCssOnly=["allDayEventBorderColor","allDayEventFontColor","allDayEventFontFamily","allDayEventFontSize","borderColor","cellBackColor","cellBackColorNonBusiness","cellBorderColor","cornerBackColor","durationBarColor","eventBackColor","eventBorderColor","eventFontColor","eventFontFamily","eventFontSize","eventSelectColor","headerFontColor","headerFontFamily","headerFontSize","hourBorderColor","hourFontColor","hourFontFamily","hourFontSize","hourHalfBorderColor","hourNameBackColor","hourNameBorderColor","loadingLabelBackColor","loadingLabelFontColor","loadingLabelFontFamily","loadingLabelFontSize","selectedColor","useEventSelectionBars"],this.$49={},this.$49.ie=navigator&&navigator.userAgent&&-1!==navigator.userAgent.indexOf("MSIE"),this.$49.ie9=navigator&&navigator.userAgent&&-1!==navigator.userAgent.indexOf("MSIE 9"),this.$49.ielt9=((a=document.createElement("div")).innerHTML="\x3c!--[if lt IE 9]><i></i><![endif]--\x3e",1===a.getElementsByTagName("i").length),this.$49.ff=navigator&&navigator.userAgent&&-1!==navigator.userAgent.indexOf("Firefox"),this.$49.opera105=!!/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent)&&new Number(RegExp.$1)>=10.5,this.$49.webkit522=!!/AppleWebKit[\/\s](\d+\.\d+)/.test(navigator.userAgent)&&new Number(RegExp.$1)>=522,this.clearSelection=function(){this.selectedCells?(this.$4a(),this.selectedCells=[]):this.selectedCells=[]},this.$4a=function(){if(this.selectedCells)for(var e=0;e<this.selectedCells.length;e++){var t=this.selectedCells[e];t&&t.selected&&(t.removeChild(t.selected),t.firstChild.style.display="",t.selected=null)}},this.cleanSelection=this.clearSelection,this.$4b=function(e,t,i){var n={};n.action=e,n.parameters=i,n.data=t,n.header=this.$4c();var a="JSON"+DayPilot.JSON.stringify(n);__doPostBack(s.uniqueID,a)},this.$4d=function(e,t,i,n){if(this.$4e()){this.callbackTimeout&&window.clearTimeout(this.callbackTimeout),void 0===n&&(n="CallBack"),this.callbackTimeout=window.setTimeout(function(){s.$4f()},100);var a={};a.action=e,a.type=n,a.parameters=t,a.data=i,a.header=this.$4c();var o="JSON"+DayPilot.JSON.stringify(a);this.backendUrl?DayPilot.request(this.backendUrl,this.$4g,o,this.$4h):"function"==typeof WebForm_DoCallback&&WebForm_DoCallback(this.uniqueID,o,this.$4i,this.clientName,this.onCallbackError,!0)}else s.debug.message("Callback invoked without the server-side backend specified. Callback canceled.","warning")},this.$4e=function(){return!!this.backendUrl||!("function"!=typeof WebForm_DoCallback||!this.uniqueID)},this.$4h=function(e){if("function"==typeof s.onAjaxError){var t={};t.request=e,s.onAjaxError(t)}else"function"==typeof s.ajaxError&&s.ajaxError(e)},this.dispose=function(){var e=s;e.nav.top&&(e.$4j(),e.$4k(),e.nav.messageClose&&(e.nav.messageClose.onclick=null),e.nav.hourTable&&(e.nav.hourTable.oncontextmenu=null),e.nav.hourTable&&(e.nav.hourTable.onmousemove=null),e.nav.header&&(e.nav.header.oncontextmenu=null),e.nav.corner&&(e.nav.corner.oncontextmenu=null),e.nav.zoom.onmousemove=null,e.nav.scroll.onscroll=null,e.nav.scroll.root=null,DayPilot.pu(e.nav.loading),e.$4l(),e.$4m(),e.nav.select=null,e.nav.cornerRight=null,e.nav.scrollable=null,e.nav.bottomLeft=null,e.nav.bottomRight=null,e.nav.allday=null,e.nav.zoom=null,e.nav.loading=null,e.nav.events=null,e.nav.header=null,e.nav.hourTable=null,e.nav.scrolltop=null,e.nav.scroll=null,e.nav.vsph=null,e.nav.main=null,e.nav.message=null,e.nav.messageClose=null,e.nav.top.removeAttribute("style"),e.nav.top.removeAttribute("class"),e.nav.top.innerHTML="",e.nav.top.dp=null,e.nav.top=null,DayPilot.ue(window,"resize",e.$4n),t.unregister(e))},this.$4o=function(){this.nav.top.dispose=this.dispose},this.$4g=function(e){s.$4i(e.responseText)},this.$4c=function(){var e={};return e.v=this.v,e.control="dpc",e.id=this.id,e.clientState=s.clientState,e.columns=this.$4p(),e.days=s.days,e.startDate=s.startDate,e.cellDuration=s.cellDuration,e.cssOnly=s.cssOnly,e.cssClassPrefix=s.cssClassPrefix,e.heightSpec=s.heightSpec,e.businessBeginsHour=s.businessBeginsHour,e.businessEndsHour=s.businessEndsHour,e.viewType=s.viewType,e.dayBeginsHour=s.dayBeginsHour,e.dayEndsHour=s.dayEndsHour,e.headerLevels=s.headerLevels,e.backColor=s.cellBackColor,e.nonBusinessBackColor=s.cellBackColorNonBusiness,e.eventHeaderVisible=s.eventHeaderVisible,e.timeFormat=s.timeFormat,e.timeHeaderCellDuration=s.timeHeaderCellDuration,e.locale=s.locale,e.scrollY=s.scrollPos,e.showAllDayEvents=s.showAllDayEvents,e.tagFields=s.tagFields,e.weekStarts=s.weekStarts,e.hourNameBackColor=s.hourNameBackColor,e.hourFontFamily=s.hourFontFamily,e.hourFontSize=s.hourFontSize,e.hourFontColor=s.hourFontColor,e.selected=s.multiselect.events(),e.hashes=s.hashes,e},this.$4q=function(){this.$4r(),DayPilot.Areas.hideAll()},this.$4p=function(){var e=[];if(e.ignoreToJSON=!0,!this.columns)return e;for(var t=0;t<this.columns.length;t++){var i=this.columns[t],n=this.$4s(i);e.push(n)}return e},this.$4s=function(e){var t={};return t.Value=e.id,t.Name=e.name,t.ToolTip=e.toolTip,t.Date=e.start,t.Children=this.$4t(e.children),t},this.$4t=function(e){var t=[];if(t.ignoreToJSON=!0,!e)return t;for(var i=0;i<e.length;i++)t.push(this.$4s(e[i]));return t},this.$4i=function(e,t){if((e=DayPilot.Util.parseJSON(e)).BubbleGuid){var i=e.BubbleGuid,n=this.bubbles[i];return delete this.bubbles[i],s.$4u(),void(void 0!==e.Result.BubbleHTML&&n.updateView(e.Result.BubbleHTML,n))}if(e.CallBackRedirect)document.location.href=e.CallBackRedirect;else{if(void 0!==e.ClientState&&(s.clientState=e.ClientState),"None"===e.UpdateType)return s.$4u(),s.$4v(e.CallBackData,!0),void(e.Message&&s.message(e.Message));if(e.VsUpdate){var a=document.createElement("input");a.type="hidden",a.name=s.id+"_vsupdate",a.id=a.name,a.value=e.VsUpdate,s.nav.vsph.innerHTML="",s.nav.vsph.appendChild(a)}if(s.$4k(),s.multiselect.clear(!0),s.multiselect.$4w=e.SelectedEvents,void 0!==e.TagFields&&(s.tagFields=e.TagFields),void 0!==e.SortDirections&&(s.sortDirections=e.SortDirections),"Full"===e.UpdateType&&(s.colors=e.Colors,s.palette=e.Palette,s.dirtyColors=e.DirtyColors,s.cellProperties=e.CellProperties,s.cellConfig=e.CellConfig,s.columns=e.Columns,s.days=e.Days,s.startDate=new DayPilot.Date(e.StartDate).getDatePart(),s.cellDuration=e.CellDuration,s.heightSpec=e.HeightSpec?e.HeightSpec:s.heightSpec,s.businessBeginsHour=e.BusinessBeginsHour?e.BusinessBeginsHour:s.businessBeginsHour,s.businessEndsHour=e.BusinessEndsHour?e.BusinessEndsHour:s.businessEndsHour,s.viewType=e.ViewType,s.headerLevels=e.HeaderLevels,s.backColor=e.BackColor?e.BackColor:s.backColor,s.nonBusinessBackColor=e.NonBusinessBackColor?e.NonBusinessBackColor:s.nonBusinessBackColor,s.eventHeaderVisible=e.EventHeaderVisible?e.EventHeaderVisible:s.eventHeaderVisible,s.timeFormat=e.TimeFormat?e.TimeFormat:s.timeFormat,s.timeHeaderCellDuration=void 0!==e.TimeHeaderCellDuration?e.TimeHeaderCellDuration:s.timeHeaderCellDuration,s.locale=e.Locale?e.Locale:s.locale,s.dayBeginsHour=void 0!==e.DayBeginsHour?e.DayBeginsHour:s.dayBeginsHour,s.dayEndsHour=void 0!==e.DayEndsHour?e.DayEndsHour:s.dayEndsHour,s.cornerBackColor=e.CornerBackColor,s.cornerHtml=e.CornerHTML,s.hours=e.Hours,s.$4x(),s.$4y()),e.Hashes)for(var o in e.Hashes)s.hashes[o]=e.Hashes[o];if(s.$4z(e.Events),s.$4A(),("Full"===e.UpdateType||s.hideFreeCells)&&(s.$4B(),s.$4C(),s.$4D(),s.$4E(),s.$4F(),s.$4G(),s.$4H(),s.$4I(),s.clearSelection(),void 0!==e.ScrollY?s.scrollToY(e.ScrollY):s.scrollToY(s.initScrollPos)),s.$4J(),s.$4K(),s.$4L(),s.$4M(),"Parent100Pct"===s.heightSpec&&s.$4n(),"HoldForever"!==s.timeRangeSelectedHandling&&s.clearSelection(),s.$4N(),s.todo&&s.todo.del){var l=s.todo.del;l.parentNode.removeChild(l),s.todo.del=null}s.$4v(e.CallBackData,!0),s.$4u(),s.$4O(),e.Message&&s.message(e.Message)}},this.$4v=function(e,t){window.setTimeout(function(e,t){return function(){if(s.$4P()){if("function"==typeof s.onAfterRender){var i={};i.isCallBack=t,i.data=e,s.onAfterRender(i)}}else s.afterRender&&s.afterRender(e,t)}}(e,t),0)},this.$4Q=function(e,t,i){var n=s.nav.events,a=n.clientWidth/n.rows[0].cells.length,o=Math.floor(s.coords.x/a);o<0&&(o=0),s.rtl&&(o=s.$4R.length-o-1);var l=n.rows[0].cells[o],r=0,d=0;if(void 0!==e.duration){var h=e.duration;d=Math.floor((s.coords.y-0+s.cellHeight/2)/s.cellHeight)*s.cellHeight+0,r=h*s.cellHeight/(60*s.cellDuration),r=Math.max(r,s.cellHeight)}else{var c=e.event;r=c.part.height,d=c.part.top}var u=document.createElement("div");u.setAttribute("unselectable","on"),u.style.position="absolute",u.style.width="100%",u.style.height=r+"px",u.style.left="0px",u.style.top=d+"px",u.style.zIndex=101,u.exclude=!0;var f=document.createElement("div");return u.appendChild(f),this.cssOnly&&(u.className=s.$4S("_shadow"),f.className=this.$4S("_shadow_inner")),this.cssOnly||(f.style.position="absolute",f.style.top="0px",f.style.bottom="0px",f.style.left="0px",f.style.right="0px","Fill"===i?(f.style.backgroundColor="#aaaaaa",f.style.opacity=.5,f.style.filter="alpha(opacity=50)",f.style.border="2px solid #aaaaaa"):f.style.border="2px dotted #666666",this.roundedCorners&&(f.style.MozBorderRadius="5px",f.style.webkitBorderRadius="5px",f.style.borderRadius="5px")),l.events.appendChild(u),u},this.$4T=function(){return this.$4U()/36e5},this.$4V=function(){return this.businessBeginsHour>this.businessEndsHour?24-this.businessBeginsHour+this.businessEndsHour:this.businessEndsHour-this.businessBeginsHour},this.$4W=function(){return this.dayBeginsHour>=this.dayEndsHour?24-this.dayBeginsHour+this.dayEndsHour:this.dayEndsHour-this.dayBeginsHour},this.$4U=function(e){var t=0;if("BusinessHoursNoScroll"===this.heightSpec)t=this.$4V();else if(this.hideFreeCells&&!e){var i=(this.$4X-1)*this.cellDuration/this.cellHeight,n=Math.ceil(i/60),a=this.businessBeginsHour>this.businessEndsHour?this.businessEndsHour+24:this.businessEndsHour;t=Math.max(this.dayBeginsHour+n,a)-this.$4Y()}else t=this.$4W();return 60*t*60*1e3},this.message=function(e,t,i,n){if(e){t=t||this.messageHideAfter||2e3,i=i||"#ffffff",n=n||"#000000";var a,o=this.$4Z(),l=this.showHours?this.hourWidth:0,r=DayPilot.sw(s.$50());if(this.cssOnly||(o+=1,l+=2,r-=2),s.rtl){var d=l;l=r,r=d}if(this.nav.message)a=s.nav.message,this.nav.message.style.top=o+"px";else{(a=document.createElement("div")).style.position="absolute",a.style.left=l+"px",a.style.top=o+"px",a.style.right="0px",a.style.display="none",a.onmousemove=function(){a.messageTimeout&&!a.status&&clearTimeout(a.messageTimeout)},a.onmouseout=function(){"none"!==s.nav.message.style.display&&(a.messageTimeout=setTimeout(s.$51,500))};var h=document.createElement("div");h.onclick=function(){s.nav.message.style.display="none"},this.cssOnly?h.className=this.$4S("_message"):(h.style.padding="5px",h.style.opacity=.8,h.style.filter="alpha(opacity=80)"),a.appendChild(h);var c=document.createElement("div");c.style.position="absolute",this.cssOnly?c.className=this.$4S("_message_close"):(c.style.top="5px",c.style.right=DayPilot.sw(s.$50())+5+"px",c.style.color=i,c.style.lineHeight="100%",c.style.cursor="pointer",c.style.fontWeight="bold",c.innerHTML="X"),c.onclick=function(){s.nav.message.style.display="none"},a.appendChild(c),this.nav.top.insertBefore(a,this.nav.loading),this.nav.message=a,this.nav.messageClose=c}this.nav.cornerRight?this.nav.message.style.right=r+"px":this.nav.message.style.right="0px";var u=function(){if(s.nav.message){var o=s.nav.message.firstChild;s.cssOnly||(o.style.padding="5px",o.style.opacity=.8,o.style.backgroundColor=n,o.style.color=i),o.innerHTML=e;DayPilot.fade(s.nav.message,.2,function(){a.messageTimeout=setTimeout(s.$51,t)})}};clearTimeout(a.messageTimeout),"none"!==this.nav.message.style.display?DayPilot.fade(s.nav.message,-.2,u):u()}},this.message.show=function(e){s.message(e)},this.message.hide=function(){s.$51()},this.$51=function(){DayPilot.fade(s.nav.message,-.2,function(){s.nav.message.style.display="none"})},this.$4E=function(){this.nav.message&&(this.nav.message.style.top=this.$4Z()+"px")},this.$52=function(){return this.$4U()/(6e4*this.cellDuration)},this.eventClickPostBack=function(e,t){this.$4b("EventClick",t,e)},this.eventClickCallBack=function(e,t){this.$4d("EventClick",e,t)},this.$53=function(e){var t=(e=e||window.event).ctrlKey,i=e.metaKey;if(void 0!==DayPilot.Bubble&&DayPilot.Bubble.hideActive(),"Disabled"!==s.eventDoubleClickHandling){if(s.timeouts){for(var n in s.timeouts)window.clearTimeout(s.timeouts[n]);s.timeouts=[]}else s.timeouts=[];s.timeouts.push(window.setTimeout(function(e,t,i){return function(){s.$54(e,t,i)}}(this,t,i),s.doubleClickTimeout))}else s.$54(this,t,i)},this.$54=function(e,t,i){var n=e.event;if(n.client.clickEnabled())if(s.$4P()){var a={};if(a.e=n,a.ctrl=t,a.meta=i,a.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof s.onEventClick&&(s.onEventClick(a),a.preventDefault.value))return;switch(s.eventClickHandling){case"PostBack":s.eventClickPostBack(n);break;case"CallBack":s.eventClickCallBack(n);break;case"Edit":s.$55(e);break;case"Select":s.$56(e,n,t,i);break;case"Bubble":s.bubble&&s.bubble.showEvent(n);break;case"ContextMenu":(o=n.client.contextMenu())?o.show(n):s.contextMenu&&s.contextMenu.show(n)}"function"==typeof s.onEventClicked&&s.onEventClicked(a)}else switch(s.eventClickHandling){case"PostBack":s.eventClickPostBack(n);break;case"CallBack":s.eventClickCallBack(n);break;case"JavaScript":s.onEventClick(n);break;case"Edit":s.$55(e);break;case"Select":s.$56(e,n,t,i);break;case"Bubble":s.bubble&&s.bubble.showEvent(n);break;case"ContextMenu":var o;(o=n.client.contextMenu())?o.show(n):s.contextMenu&&s.contextMenu.show(n)}},this.eventDoubleClickPostBack=function(e,t){this.$4b("EventDoubleClick",t,e)},this.eventDoubleClickCallBack=function(e,t){this.$4d("EventDoubleClick",e,t)},this.$57=function(e){if(void 0!==DayPilotBubble&&DayPilotBubble.hideActive(),s.timeouts){for(var t in s.timeouts)window.clearTimeout(s.timeouts[t]);s.timeouts=null}var i=this.event;e=e||window.event;if(s.$4P()){var n={};if(n.e=i,n.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof s.onEventDoubleClick&&(s.onEventDoubleClick(n),n.preventDefault.value))return;switch(s.eventDoubleClickHandling){case"PostBack":s.eventDoubleClickPostBack(i);break;case"CallBack":s.eventDoubleClickCallBack(i);break;case"Edit":i.allday()||s.$55(this);break;case"Select":i.allday()||s.$56(this,i,e.ctrlKey);break;case"Bubble":s.bubble&&s.bubble.showEvent(i)}"function"==typeof s.onEventDoubleClicked&&s.onEventDoubleClicked(n)}else switch(s.eventDoubleClickHandling){case"PostBack":s.eventDoubleClickPostBack(i);break;case"CallBack":s.eventDoubleClickCallBack(i);break;case"JavaScript":s.onEventDoubleClick(i);break;case"Edit":i.allday()||s.$55(this);break;case"Select":i.allday()||s.$56(this,i,e.ctrlKey);break;case"Bubble":s.bubble&&s.bubble.showEvent(i)}},this.eventRightClickPostBack=function(e,t){this.$4b("EventRightClick",t,e)},this.eventRightClickCallBack=function(e,t){this.$4d("EventRightClick",e,t)},this.$58=function(e){var t=this.event;if(!t.client.rightClickEnabled())return!1;if(s.$4P()){var i={};if(i.e=t,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof s.onEventRightClick&&(s.onEventRightClick(i),i.preventDefault.value))return;switch(s.eventRightClickHandling){case"PostBack":s.eventRightClickPostBack(t);break;case"CallBack":s.eventRightClickCallBack(t);break;case"ContextMenu":(n=t.client.contextMenu())?n.show(t):s.contextMenu&&s.contextMenu.show(this.event);break;case"Bubble":s.bubble&&s.bubble.showEvent(t)}"function"==typeof s.onEventRightClicked&&s.onEventRightClicked(i)}else switch(s.eventRightClickHandling){case"PostBack":s.eventRightClickPostBack(t);break;case"CallBack":s.eventRightClickCallBack(t);break;case"JavaScript":s.onEventRightClick(t);break;case"ContextMenu":var n;(n=t.client.contextMenu())?n.show(t):s.contextMenu&&s.contextMenu.show(this.event);break;case"Bubble":s.bubble&&s.bubble.showEvent(t)}return e.preventDefault&&e.preventDefault(),!1},this.headerClickPostBack=function(e,t){this.$4b("HeaderClick",t,e)},this.headerClickCallBack=function(e,t){this.$4d("HeaderClick",e,t)},this.$59=function(e){var i=this.data,n=new t.Column(i.id,i.name,i.start);if(s.$4P()){var a={header:{}};if(a.header.id=i.id,a.header.name=i.name,a.header.start=i.start,a.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof s.onHeaderClick&&(s.onHeaderClick(a),a.preventDefault.value))return;switch(s.headerClickHandling){case"PostBack":s.headerClickPostBack(n);break;case"CallBack":s.headerClickCallBack(n)}"function"==typeof s.onHeaderClicked&&s.onHeaderClicked(a)}else switch(s.headerClickHandling){case"PostBack":s.headerClickPostBack(n);break;case"CallBack":s.headerClickCallBack(n);break;case"JavaScript":s.onHeaderClick(n)}},this.$5a=function(){if(void 0!==DayPilotBubble&&s.columnBubble)if("Resources"===s.viewType){var e={};e.calendar=s,e.id=this.data.id,e.toJSON=function(){var e={};return e.id=this.id,e},s.columnBubble.showResource(e)}else{var i=new DayPilot.Date(this.data.start),n=i.addDays(1),a={};a.calendar=s,a.start=i,a.end=n,a.toJSON=function(){var e={};return e.start=this.start,e.end=this.end,e},s.columnBubble.showTime(a)}var o=this.firstChild;if(!o.active){var l=this.data,r=new t.Column(l.id,l.name,l.start);r.areas=this.data.areas,DayPilot.Areas.showAreas(o,r)}},this.$5b=function(e){void 0!==DayPilotBubble&&s.columnBubble&&s.columnBubble.hideOnMouseOut(),DayPilot.Areas.hideAreas(this.firstChild,e)},this.eventDeletePostBack=function(e,t){this.$4b("EventDelete",t,e)},this.eventDeleteCallBack=function(e,t){this.$4d("EventDelete",e,t)},this.$5c=function(e){var t;if(t=e&&e.isEvent?e:e.parentNode.parentNode.event,s.$4P()){var i={};if(i.e=t,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof s.onEventDelete&&(s.onEventDelete(i),i.preventDefault.value))return;switch(s.eventDeleteHandling){case"PostBack":s.eventDeletePostBack(t);break;case"CallBack":s.eventDeleteCallBack(t);break;case"Update":s.events.remove(t)}"function"==typeof s.onEventDeleted&&s.onEventDeleted(i)}else switch(s.eventDeleteHandling){case"PostBack":s.eventDeletePostBack(t);break;case"CallBack":s.eventDeleteCallBack(t);break;case"JavaScript":s.onEventDelete(t)}},this.eventResizePostBack=function(e,t,i,n){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var a={};a.e=e,a.newStart=t,a.newEnd=i,this.$4b("EventResize",n,a)},this.eventResizeCallBack=function(e,t,i,n){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var a={};a.e=e,a.newStart=t,a.newEnd=i,this.$4d("EventResize",a,n)},this.$5d=function(e,t,i,n){if("PostBack"===e)s.postBack2(t,i,n);else if("CallBack"===e)s.$4d(t,i,n,"CallBack");else if("Immediate"===e)s.$4d(t,i,n,"Notify");else if("Queue"===e)s.queue.add(new DayPilot.Action(this,t,i,n));else{if("Notify"!==e)throw"Invalid event invocation type";"Notify"===l.notifyType()?s.$4d(t,i,n,"Notify"):s.queue.add(new DayPilot.Action(s,t,i,n))}},this.$4Y=function(e){if("BusinessHoursNoScroll"===this.heightSpec)return this.businessBeginsHour;if(this.hideFreeCells&&!e){var t=this.$5e*this.cellDuration/this.cellHeight,i=Math.floor(t/60);return i=Math.max(0,i),Math.min(this.dayBeginsHour+i,this.businessBeginsHour)}return this.dayBeginsHour},this.visibleStart=function(){return this.$4R[0].start},this.visibleEnd=function(){var e=this.$4R;return e[e.length-1].start.addDays(1)},this.$4P=function(){return 2===s.api},this.$5f=function(e,t,i,n){if("Disabled"!==this.eventResizeHandling){var a=new Date,o=new Date,l=e.start(),r=(e.end(),s.cellDuration),d=s.$4R[e.part.dayIndex].start;if("top"===n){d=l.getDatePart();var h=60*(Math.floor((i-0)/s.cellHeight)*r)*1e3,c=60*s.$4Y()*60*1e3;a=d.addTime(h+c),o=e.end()}else if("bottom"===n){h=60*(Math.floor((i+t-0)/s.cellHeight)*r)*1e3,c=60*s.$4Y()*60*1e3;a=l,o=d.addTime(h+c)}if(s.$4P()){var u={};if(u.e=e,u.newStart=a,u.newEnd=o,u.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof s.onEventResize&&(s.onEventResize(u),u.preventDefault.value))return;switch(s.eventResizeHandling){case"PostBack":s.eventResizePostBack(e,a,o);break;case"CallBack":s.eventResizeCallBack(e,a,o);break;case"Notify":s.eventResizeNotify(e,a,o);break;case"Update":e.start(a),e.end(o),s.events.update(e)}"function"==typeof s.onEventResized&&s.onEventResized(u)}else switch(s.eventResizeHandling){case"PostBack":s.eventResizePostBack(e,a,o);break;case"CallBack":s.eventResizeCallBack(e,a,o);break;case"JavaScript":s.onEventResize(e,a,o);break;case"Notify":s.eventResizeNotify(e,a,o)}}},this.eventResizeNotify=function(e,t,i,n){var a=new DayPilot.Event(e.copy(),this);e.start(t),e.end(i),e.commit(),s.update(),this.$5g("Notify",a,t,i,n)},this.$5g=function(e,t,i,n,a){var s={};s.e=t,s.newStart=i,s.newEnd=n,this.$5d(e,"EventResize",s,a)},this.eventMovePostBack=function(e,t,i,n,a){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var s={};s.e=e,s.newStart=t,s.newEnd=i,s.newResource=n,this.$4b("EventMove",a,s)},this.eventMoveCallBack=function(e,t,i,n,a){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var s={};s.e=e,s.newStart=t,s.newEnd=i,s.newResource=n,this.$4d("EventMove",s,a)},this.$5h=function(e,t,i,n,a){if("Disabled"!==s.eventMoveHandling){var o=Math.floor((i-0)/s.cellHeight),l=s.cellDuration,r=o*l*60*1e3,d=e.start(),h=e.end(),c=new Date;d.isDayPilotDate&&(d=d.d),c.setTime(Date.UTC(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()));var u="Never"!==s.useEventBoxes?d.getTime()-(c.getTime()+3600*d.getUTCHours()*1e3+Math.floor(d.getUTCMinutes()/l)*l*60*1e3):0,f=h.getTime()-d.getTime(),v=3600*s.$4Y()*1e3,p=this.$4R[t],y=p.start.getTime(),g=new Date;g.setTime(y+r+u+v);var m=new DayPilot.Date(g),b=m.addTime(f),w=!!a,$=p.id;if(s.$4P()){var D={};if(D.e=e,D.newStart=m,D.newEnd=b,D.newResource=$,D.external=w,D.ctrl=!1,n&&(D.ctrl=n.ctrlKey),D.shift=!1,n&&(D.shift=n.shiftKey),D.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof s.onEventMove&&(s.onEventMove(D),D.preventDefault.value))return;switch(s.eventMoveHandling){case"PostBack":s.eventMovePostBack(e,m,b,$);break;case"CallBack":s.eventMoveCallBack(e,m,b,$);break;case"Notify":s.eventMoveNotify(e,m,b,$);break;case"Update":e.start(m),e.end(b),e.resource($),w?(e.commit(),s.events.add(e)):s.events.update(e),s.$5i()}"function"==typeof s.onEventMoved&&s.onEventMoved(D)}else switch(s.eventMoveHandling){case"PostBack":s.eventMovePostBack(e,m,b,$);break;case"CallBack":s.eventMoveCallBack(e,m,b,$);break;case"JavaScript":s.onEventMove(e,m,b,$,w,!!n&&n.ctrlKey,!!n&&n.shiftKey);break;case"Notify":s.eventMoveNotify(e,m,b,$,null)}}},this.eventMoveNotify=function(e,t,i,n,a){var o=new DayPilot.Event(e.copy(),this);e.start(t),e.end(i),e.resource(n),e.commit(),s.update(),this.$5j("Notify",o,t,i,n,a)},this.$5j=function(e,t,i,n,a,s){var o={};o.e=t,o.newStart=i,o.newEnd=n,o.newResource=a,this.$5d(e,"EventMove",o,s)},this.$5i=function(){if(s.todo&&s.todo.del){var e=s.todo.del;e.parentNode.removeChild(e),s.todo.del=null}},this.$5k=function(e,t){var i=s.$5l(t),n={};n.args=e,n.guid=i,s.$4d("Bubble",n)},this.$5l=function(e){var t=DayPilot.guid();return this.bubbles||(this.bubbles=[]),this.bubbles[t]=e,t},this.eventMenuClickPostBack=function(e,t,i){var n={};n.e=e,n.command=t,this.$4b("EventMenuClick",i,n)},this.eventMenuClickCallBack=function(e,t,i){var n={};n.e=e,n.command=t,this.$4d("EventMenuClick",n,i)},this.$5m=function(e,t,i){switch(i){case"PostBack":s.eventMenuClickPostBack(t,e);break;case"CallBack":s.eventMenuClickCallBack(t,e)}},this.timeRangeMenuClickPostBack=function(e,t,i){var n={};n.selection=e,n.command=t,this.$4b("TimeRangeMenuClick",i,n)},this.timeRangeMenuClickCallBack=function(e,t,i){var n={};n.selection=e,n.command=t,this.$4d("TimeRangeMenuClick",n,i)},this.$5n=function(e,t,i){switch(i){case"PostBack":s.timeRangeMenuClickPostBack(t,e);break;case"CallBack":s.timeRangeMenuClickCallBack(t,e)}},this.timeRangeSelectedPostBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.$4b("TimeRangeSelected",n,a)},this.timeRangeSelectedCallBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.$4d("TimeRangeSelected",a,n)},this.$5o=function(e,t,i){e.isDayPilotDate||(e=new DayPilot.Date(e)),t.isDayPilotDate||(t=new DayPilot.Date(t));var n=i;if(s.$4P()){var a={};if(a.start=e,a.end=t,a.resource=n,a.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof s.onTimeRangeSelect&&(s.onTimeRangeSelect(a),a.preventDefault.value))return;switch(s.timeRangeSelectedHandling){case"PostBack":s.timeRangeSelectedPostBack(e,t,n);break;case"CallBack":s.timeRangeSelectedCallBack(e,t,n)}"function"==typeof s.onTimeRangeSelected&&s.onTimeRangeSelected(a)}else switch(s.timeRangeSelectedHandling){case"PostBack":s.timeRangeSelectedPostBack(e,t,i);break;case"CallBack":s.timeRangeSelectedCallBack(e,t,i);break;case"JavaScript":s.onTimeRangeSelected(e,t,i)}},this.timeRangeDoubleClickPostBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.$4b("TimeRangeDoubleClick",n,a)},this.timeRangeDoubleClickCallBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.$4d("TimeRangeDoubleClick",a,n)},this.$5p=function(e,t,i){if(s.$4P()){var n=i,a={};if(a.start=e,a.end=t,a.resource=n,a.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof s.onTimeRangeDoubleClick&&(s.onTimeRangeDoubleClick(a),a.preventDefault.value))return;switch(s.timeRangeDoubleClickHandling){case"PostBack":s.timeRangeDoubleClickPostBack(e,t,n);break;case"CallBack":s.timeRangeDoubleClickCallBack(e,t,n)}"function"==typeof s.onTimeRangeDoubleClicked&&s.onTimeRangeDoubleClicked(a)}else switch(s.timeRangeDoubleClickHandling){case"PostBack":s.timeRangeDoubleClickPostBack(e,t,i);break;case"CallBack":s.timeRangeDoubleClickCallBack(e,t,i);break;case"JavaScript":s.onTimeRangeDoubleClick(e,t,i)}},this.eventEditPostBack=function(e,t,i){var n={};n.e=e,n.newText=t,this.$4b("EventEdit",i,n)},this.eventEditCallBack=function(e,t,i){var n={};n.e=e,n.newText=t,this.$4d("EventEdit",n,i)},this.$5q=function(e,t){if(s.$4P()){var i={};if(i.e=e,i.newText=t,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof s.onEventEdit&&(s.onEventEdit(i),i.preventDefault.value))return;switch(s.eventEditHandling){case"PostBack":s.eventEditPostBack(e,t);break;case"CallBack":s.eventEditCallBack(e,t);break;case"Update":e.text(t),s.events.update(e)}if("function"==typeof s.onEventEdited&&(s.onEventEdited(i),i.preventDefault.value))return}else switch(s.eventEditHandling){case"PostBack":s.eventEditPostBack(e,t);break;case"CallBack":s.eventEditCallBack(e,t);break;case"JavaScript":s.onEventEdit(e,t)}},this.eventSelectPostBack=function(e,t,i){var n={};n.e=e,n.change=t,this.$4b("EventSelect",i,n)},this.eventSelectCallBack=function(e,t,i){var n={};n.e=e,n.change=t,this.$4d("EventSelect",n,i)},this.$5r=function(e,t,i,n){var a=s.multiselect,o=a.isSelected(t);if(i||n||!o||1!==a.list.length)if(s.$4P()){a.previous=a.events();var l={};if(l.e=t,l.selected=a.isSelected(t),l.ctrl=i,l.meta=n,l.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof s.onEventSelect&&(s.onEventSelect(l),l.preventDefault.value))return;switch(s.eventSelectHandling){case"PostBack":s.eventSelectPostBack(t,r);break;case"CallBack":"undefined"!=typeof WebForm_InitCallback&&(window.__theFormPostData="",window.__theFormPostCollection=[],WebForm_InitCallback()),s.eventSelectCallBack(t,r);break;case"Update":a.$5s(e,i)}"function"==typeof s.onEventSelected&&(l.change=a.isSelected(t)?"selected":"deselected",l.selected=a.isSelected(t),s.onEventSelected(l))}else{a.previous=a.events(),a.$5s(e,i);var r=a.isSelected(t)?"selected":"deselected";switch(s.eventSelectHandling){case"PostBack":s.eventSelectPostBack(t,r);break;case"CallBack":"undefined"!=typeof WebForm_InitCallback&&(window.__theFormPostData="",window.__theFormPostCollection=[],WebForm_InitCallback()),s.eventSelectCallBack(t,r);break;case"JavaScript":s.onEventSelect(t,r)}}},this.commandCallBack=function(e,t){this.$4j();var i={};i.command=e,this.$4d("Command",i,t)},this.$5t=function(e){if(!o.active&&!o.using&&(clearTimeout(t.selectedTimeout),!t.selecting))if(t.editing)t.editing.blur();else{if(s.selectedCells&&"Disabled"!==s.timeRangeDoubleClickHandling)for(var i=0;i<s.selectedCells.length;i++)if(this===s.selectedCells[i])return;if("Disabled"!==s.timeRangeSelectedHandling)DayPilot.Util.mouseButton(e).left&&(t.firstMousePos=DayPilot.mc(e||window.event),s.clearSelection(),t.topSelectedCell=this,t.bottomSelectedCell=this,t.column=t.getColumn(this),s.selectedCells.push(this),t.firstSelected=this)}},this.$5u=function(){if(this.getSelection()&&s.selectedCells)for(var e=0;e<s.selectedCells.length;e++){var t=s.selectedCells[e];if(t&&!t.selected){var i=document.createElement("div");i.style.height=s.cellHeight-1+"px",i.style.backgroundColor=s.selectedColor,t.firstChild.style.display="none",t.insertBefore(i,t.firstChild),t.selected=i}}},this.$5v=function(e){void 0!==DayPilotBubble&&s.cellBubble&&s.cellBubble.hideOnMouseOut()},this.$5w=function(e){if(void 0!==t&&!o.active&&!o.using){if(void 0!==DayPilotBubble&&s.cellBubble){var i=t.getColumn(this),n=s.$4R[i].id,a={};a.calendar=s,a.start=this.start,a.end=this.end,a.resource=n,a.toJSON=function(){var e={};return e.start=this.start,e.end=this.end,e.resource=this.resource,e},s.cellBubble.showCell(a)}if(t.firstMousePos){var l=t.firstMousePos,r=DayPilot.mc(e||window.event);l.x===r.x&&l.y===r.y||(t.selecting=!0,s.clearSelection(),s.$5u())}if(t.selecting){var d=DayPilot.mc(e||window.event);t.getColumn(this)===t.column&&(s.clearSelection(),d.y<t.firstMousePos.y?(s.selectedCells=t.getCellsBelow(this),t.topSelectedCell=s.selectedCells[0],t.bottomSelectedCell=t.firstSelected):(s.selectedCells=t.getCellsAbove(this),t.topSelectedCell=t.firstSelected,t.bottomSelectedCell=s.selectedCells[0]),s.$5u())}}},this.getSelection=function(){if(!t.topSelectedCell)return null;if(!t.bottomSelectedCell)return null;var e=t.topSelectedCell.start,i=t.bottomSelectedCell.end,n=t.topSelectedCell.resource;return new DayPilot.Selection(e,i,n,s)},this.$5x=function(e){if(t.firstMousePos){var i=function(){t.selecting=!0,s.$5u(),t.firstMousePos=null,t.selecting=!1;var e=s.getSelection();s.$5o(e.start,e.end,e.resource)};t.selecting&&null!==t.topSelectedCell?i():t.selectedTimeout=setTimeout(i,100)}else t.selecting=!1},this.$5y=function(e){if("Fixed"===s.columnWidthSpec||s.$5z){if(!s.nav.bottomLeft)return;s.nav.bottomLeft.scrollTop=s.nav.bottomRight.scrollTop,s.nav.upperRight.scrollLeft=s.nav.bottomRight.scrollLeft}var t=s.$5A();s.scrollPos=t.scrollTop,s.scrollHeight=t.clientHeight,s.nav.scrollpos.value=s.scrollPos,s.$4N()},this.$4N=function(){if(this.scrollLabelsVisible&&(this.$5B&&this.nav&&this.nav.main&&this.nav.main.rows&&this.nav.main.rows.length>0&&this.nav.main.rows[0].cells.length>0)){this.$4R;for(var e=this.showHours?this.hourWidth:0,t=this.nav.main.rows[0].cells[0].clientWidth,i=0;i<this.nav.scrollUp.length;i++){var n=this.nav.scrollUp[i],a=this.nav.scrollDown[i],o=Math.floor(e+i*t+t/2-5+1);o<0&&(o=0),n&&n.style&&(n.style.left=o+"px"),a&&a.style&&(a.style.left=o+"px")}var l=this.$5C();for(i=0;i<this.nav.scrollUp.length;i++){var r=this.nav.scrollUp[i],d=this.nav.scrollDown[i],h=this.$5B[i].minEnd-l,c=this.$5B[i].maxStart-l;r&&d&&(h<=s.scrollPos?(r.style.top=this.$4Z()+"px",r.style.display=""):r.style.display="none",c>=s.scrollPos+s.scrollHeight?(d.style.top=this.$4Z()+this.scrollHeight-10+"px",d.style.display=""):d.style.display="none")}}},this.$5D=function(e){for(var t=e.parentNode;t&&"TD"!==t.tagName;)t=t.parentNode;var i=0,n=e.offsetTop,a=e.parentNode.offsetWidth,s=e.offsetHeight;e.event.allday()&&(i=e.offsetLeft,a=e.offsetWidth);var o=document.createElement("textarea");o.style.boxSizing="border-box",o.style.position="absolute",o.style.width=a+"px",o.style.height=s+"px";var l=DayPilot.gs(e,"fontFamily");l||(l=DayPilot.gs(e,"font-family")),o.style.fontFamily=l;var r=DayPilot.gs(e,"fontSize");return r||(r=DayPilot.gs(e,"font-size")),o.style.fontSize=r,o.style.left=i+"px",o.style.top=n+"px",o.style.border="1px solid black",o.style.padding="0px",o.style.marginTop="0px",o.style.backgroundColor="white",o.value=DayPilot.tr(e.event.text()),o.event=e.event,t.firstChild.appendChild(o),o},this.$56=function(e,t,i,n){s.$5r(e,t,i,n)},this.multiselect={},this.multiselect.$4w=[],this.multiselect.$5E=[],this.multiselect.$5F=[],this.multiselect.$5G=[],this.multiselect.$5H=function(){var e=s.multiselect;return DayPilot.JSON.stringify(e.events())},this.multiselect.events=function(){var e=s.multiselect,t=[];t.ignoreToJSON=!0;for(var i=0;i<e.$5E.length;i++)t.push(e.$5E[i]);return t},this.multiselect.$5I=function(){s.nav.select.value=s.multiselect.$5H()},this.multiselect.$5s=function(e,t){var i=s.multiselect;if(i.isSelected(e.event))if(s.allowMultiSelect)if(t)i.remove(e.event,!0);else{var n=i.$5E.length;i.clear(!0),n>1&&i.add(e.event,!0)}else i.clear(!0);else s.allowMultiSelect&&t?i.add(e.event,!0):(i.clear(!0),i.add(e.event,!0));i.redraw(),i.$5I()},this.multiselect.$5J=function(e){var t=s.multiselect;return t.$5K(e,t.$4w)},this.multiselect.$5L=function(){for(var e=s.multiselect,t=[],i=0;i<e.$5E.length;i++){var n=e.$5E[i];t.push(n.value())}alert(t.join("\n"))},this.multiselect.add=function(e,t){var i=s.multiselect;-1===i.$5M(e)&&i.$5E.push(e),i.$5I(),t||i.redraw()},this.multiselect.remove=function(e,t){var i=s.multiselect,n=i.$5M(e);-1!==n&&i.$5E.splice(n,1),i.$5I(),t||i.redraw()},this.multiselect.clear=function(e){var t=s.multiselect;t.$5E=[],t.$5I(),e||t.redraw()},this.multiselect.redraw=function(){for(var e=s.multiselect,t=0;t<s.elements.events.length;t++){var i=s.elements.events[t];e.isSelected(i.event)?e.$5N(i):e.$5O(i)}},this.multiselect.$5N=function(e){var t=s.multiselect,i=s.cssOnly?s.$4S("_selected"):s.$4S("selected"),n=t.$5P(e);DayPilot.Util.addClass(n,i),s.useEventSelectionBars&&t.$5Q(e),t.$5F.push(e)},this.multiselect.$5P=function(e){if(s.cssOnly)return e;for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if("1"===i.getAttribute("c"))return i}return null},this.multiselect.$5R=function(){for(var e=s.multiselect,t=0;t<e.$5F.length;t++){var i=e.$5F[t];e.$5O(i,!0)}e.$5F=[]},this.multiselect.$5O=function(e,t){var i=s.multiselect,n=s.cssOnly?s.$4S("_selected"):s.$4S("selected"),a=i.$5P(e);if(DayPilot.Util.removeClass(a,n),s.useEventSelectionBars&&i.$5S(e),!t){var o=DayPilot.indexOf(i.$5F,e);-1!==o&&i.$5F.splice(o,1)}},this.multiselect.isSelected=function(e){return s.multiselect.$5K(e,s.multiselect.$5E)},this.multiselect.$5M=function(e){return DayPilot.indexOf(s.multiselect.$5E,e)},this.multiselect.$5K=function(e,t){if(!t)return!1;for(var i=0;i<t.length;i++){var n=t[i];if(e===n)return!0;if("function"==typeof n.value){if(null!==n.value()&&null!==e.value()&&n.value()===e.value())return!0;if(null===n.value()&&null===e.value()&&n.recurrentMasterId()===e.recurrentMasterId()&&e.start().toStringSortable()===n.start())return!0}else{if(null!==n.value&&null!==e.value()&&n.value===e.value())return!0;if(null===n.value&&null===e.value()&&n.recurrentMasterId===e.recurrentMasterId()&&e.start().toStringSortable()===n.start)return!0}}return!1},this.multiselect.$5Q=function(e){if(!e.top){var t=document.createElement("div");t.setAttribute("unselectable","on"),t.style.position="absolute",t.style.left=e.offsetLeft+"px",t.style.width=e.offsetWidth+"px",t.style.top=e.offsetTop-5+"px",t.style.height="5px",t.style.backgroundColor=s.eventSelectColor,t.style.zIndex=100,e.parentNode.appendChild(t),e.top=t}if(!e.bottom){var i=document.createElement("div");i.setAttribute("unselectable","on"),i.style.position="absolute",i.style.left=e.offsetLeft+"px",i.style.width=e.offsetWidth+"px",i.style.top=e.offsetTop+e.offsetHeight+"px",i.style.height="5px",i.style.backgroundColor=s.eventSelectColor,i.style.zIndex=100,e.parentNode.appendChild(i),e.bottom=i}},this.multiselect.$5S=function(e){e.top&&(e.parentNode.removeChild(e.top),e.top=null),e.bottom&&(e.parentNode.removeChild(e.bottom),e.bottom=null)},this.$55=function(e){if(t.editing)t.editing.blur();else{var i=this.$5D(e);t.editing=i,i.onblur=function(){e.event.value(),e.event.tag();var n=e.event.text(),a=i.value;t.editing=null,i.parentNode.removeChild(i),n!==a&&(e.style.display="none",s.$5q(e.event,a))},i.onkeypress=function(e){var n=window.event?event.keyCode:e.keyCode;return 13===n?(this.onblur(),!1):(27===n&&(i.parentNode.removeChild(i),t.editing=!1),!0)},i.select(),i.focus()}},this.$5T=function(){return"Resources"!==s.viewType&&(!s.columns||!s.$4e())},this.$4x=function(){s.$5T()?(this.$4R=this.$5U(),this.$5V(this.$4R)):(this.columns||(this.columns=[]),this.$5V(this.columns),this.$4R=this.$5W(this.headerLevels,!0))},this.$5X=function(){var e=this.startDate.getDatePart(),t=this.days;switch(this.viewType){case"Day":t=1;break;case"Week":t=7,e=e.firstDayOfWeek(l.weekStarts());break;case"WorkWeek":t=5,e=e.firstDayOfWeek(1)}var i=e.addDays(t),n={};return n.start=e,n.end=i,n.days=t,n},this.$5U=function(){for(var e=[],t=this.$5X(),i=t.start,n=t.days,a=0;a<n;a++){var o={};o.start=i.addDays(a);var r=l.locale().datePattern;s.headerDateFormat&&(r=s.headerDateFormat),o.name=o.start.toString(r),o.html=o.name,e.push(o)}return e},this.$5Y=function(e){e.Start&&(e.id=e.Value,e.start=e.Start,e.name=e.Name,e.html=e.InnerHTML,e.toolTip=e.ToolTip,e.backColor=e.BackColor,e.areas=e.Areas,e.children=e.Children,delete e.Value,delete e.Start,delete e.Name,delete e.InnerHTML,delete e.ToolTip,delete e.BackColor,delete e.Areas,delete e.Children),e.start=e.start||s.startDate,e.start=new DayPilot.Date(e.start),e.html=e.html||e.name,e.getChildren=function(e,t){var i=[];if(e<=1)return i.push(this),i;if(!this.children||0===this.children.length)return t?i.push(this):i.push("empty"),i;for(var n=0;n<this.children.length;n++)for(var a=this.children[n].getChildren(e-1,t),s=0;s<a.length;s++)i.push(a[s]);return i},e.getChildrenCount=function(e){var t=0;if(!this.children||this.children.length<=0||e<=1)return 1;for(var i=0;i<this.children.length;i++)t+=this.children[i].getChildrenCount(e-1);return t},e.putIntoBlock=function(e){for(var t=0;t<this.blocks.length;t++){if((i=this.blocks[t]).overlapsWith(e.part.top,e.part.height))return i.events.push(e),i.min=Math.min(i.min,e.part.top),i.max=Math.max(i.max,e.part.top+e.part.height),t}var i;return(i=[]).lines=[],i.events=[],i.overlapsWith=function(e,t){return!(e+t-1<this.min||e>this.max-1)},i.putIntoLine=function(e){for(var t=0;t<this.lines.length;t++){if((i=this.lines[t]).isFree(e.part.top,e.part.height))return i.push(e),t}var i;return(i=[]).isFree=function(e,t){for(var i=e+t-1,n=this.length,a=0;a<n;a++){var s=this[a];if(!(i<s.part.top||e>s.part.top+s.part.height-1))return!1}return!0},i.push(e),this.lines.push(i),this.lines.length-1},i.events.push(e),i.min=e.part.top,i.max=e.part.top+e.part.height,this.blocks.push(i),this.blocks.length-1},e.putIntoLine=function(e){for(var t=0;t<this.lines.length;t++){if((i=this.lines[t]).isFree(e.part.top,e.part.height))return i.push(e),t}var i;return(i=[]).isFree=function(e,t){for(var i=e+t-1,n=this.length,a=0;a<n;a++){var s=this[a];if(!(i<s.part.top||e>s.part.top+s.part.height-1))return!1}return!0},i.push(e),this.lines.push(i),this.lines.length-1},e.children&&this.$5V(e.children)},this.$5V=function(e){DayPilot.list(e).each(function(e){s.$5Y(e)})},this.$5W=function(e,t){for(var i=this.$5T()?this.$4R:this.columns,n=[],a=0;a<i.length;a++)for(var s=i[a].getChildren(e,t),o=0;o<s.length;o++)n.push(s[o]);return n},this.$4M=function(){if(this.showAllDayEvents){var e=this.nav.header;if(e){e.style.display="none";for(var t=this.$4R.length,i=0;i<this.$5Z.lines.length;i++)for(var n=this.$5Z.lines[i],a=0;a<n.length;a++){var o=n[a],r=document.createElement("div");r.event=o,r.setAttribute("unselectable","on"),r.style.position="absolute",s.rtl?r.style.right=100*o.part.colStart/t+"%":r.style.left=100*o.part.colStart/t+"%",r.style.width=100*o.part.colWidth/t+"%",r.style.height=l.allDayEventHeight()+"px",this.cssOnly?(r.className=this.$4S("_alldayevent"),r.style.top=this.headerLevels*l.headerHeight()+i*l.allDayEventHeight()+"px"):r.style.top=3+this.headerLevels*l.headerHeight()+i*(l.allDayEventHeight()+2)+"px",r.style.textAlign="left",r.style.lineHeight="1.2",o.client.clickEnabled()&&(r.onclick=this.$53),o.client.doubleClickEnabled()&&(r.ondblclick=this.$57),o.client.clickEnabled()||o.client.doubleClickEnabled()?r.style.cursor="pointer":r.style.cursor="default",DayPilot.re(r,"contextmenu",this.$58),r.onmousemove=function(e){var t=this;if(!t.active){var i=[];o.client.deleteEnabled()&&i.push({action:"JavaScript",v:"Hover",w:17,h:17,top:3,right:3,css:s.$4S("_event_delete"),js:function(e){s.$5c(e)}});var n=t.event.cache?t.event.cache.areas:t.event.data.areas;n&&n.length>0&&(i=i.concat(n)),DayPilot.Areas.showAreas(t,t.event,null,i),s.cssOnly&&DayPilot.Util.addClass(t,s.$4S("_alldayevent_hover"))}void 0!==DayPilotBubble&&s.bubble&&"Disabled"!==s.eventHoverHandling&&s.bubble.showEvent(this.event)},r.onmouseout=function(e){s.cssOnly&&DayPilot.Util.removeClass(this,s.$4S("_alldayevent_hover")),DayPilot.Areas.hideAreas(this,e),s.bubble&&s.bubble.hideOnMouseOut()},this.showToolTip&&!this.bubble&&r.setAttribute("title",o.client.toolTip());var d=o.start().getTime()===o.part.start.getTime(),h=o.end().getTime()===o.part.end.getTime(),c=o.data.backColor;if(this.cssOnly){(u=document.createElement("div")).setAttribute("unselectable","on"),u.className=this.$4S("_alldayevent_inner"),c&&(u.style.background=c),s.rtl?(d||DayPilot.Util.addClass(r,this.$4S("_alldayevent_continueright")),h||DayPilot.Util.addClass(r,this.$4S("_alldayevent_continueleft"))):(d||DayPilot.Util.addClass(r,this.$4S("_alldayevent_continueleft")),h||DayPilot.Util.addClass(r,this.$4S("_alldayevent_continueright"))),o.client.innerHTML()?u.innerHTML=o.client.innerHTML():u.innerHTML=o.text(),r.appendChild(u)}else{var u;(u=document.createElement("div")).setAttribute("unselectable","on"),u.style.marginLeft="2px",u.style.marginRight="3px",u.style.paddingLeft="2px",u.style.height=l.allDayEventHeight()-2+"px",u.style.border="1px solid "+this.allDayEventBorderColor,u.style.overflow="hidden",u.style.position="relative",u.style.backgroundColor=c,u.className=this.$4S("alldayevent"),this.roundedCorners&&(u.style.MozBorderRadius="5px",u.style.webkitBorderRadius="5px",u.style.borderRadius="5px");var f=[],v=this.showAllDayEventStartEnd,p=this.showAllDayEventStartEnd;v&&(f.push("<div unselectable='on' style='position:absolute;text-align:left;height:1px;font-size:1px;width:100%'><div unselectable='on' style='font-size:8pt;color:gray'><span style='background-color:"),f.push("transparent"),f.push("' unselectable='on'>"),d?o.start().getDatePart().getTime()!==o.start().getTime()&&f.push(DayPilot.Date.hours(o.start().d,"Clock12Hours"===this.$60.timeFormat())):f.push("~"),f.push("</span></div></div>")),p&&(f.push("<div unselectable='on' style='position:absolute;text-align:right;height:1px;font-size:1px;width:100%'><div unselectable='on' style='margin-right:4px;font-size:8pt;color:gray'><span style='background-color:"),f.push("transparent"),f.push("' unselectable='on'>"),h?o.end().getDatePart().getTime()!==o.end().getTime()&&f.push(DayPilot.Date.hours(o.end().d,"Clock12Hours"===this.$60.timeFormat())):f.push("~"),f.push("</span></div></div>")),f.push("<div style='position:absolute; text-align:center; width: 98%; height:1px;'>"),f.push("<span style='background-color:"),f.push("transparent"),f.push(";font-size:"),f.push(this.allDayEventFontSize),f.push(";color:"),f.push(this.allDayEventFontColor),f.push(";font-family:"),f.push(this.allDayEventFontFamily),f.push("' unselectable='on'>"),o.client.innerHTML()?f.push(o.client.innerHTML()):f.push(o.text()),f.push("</span>"),f.push("</div>"),u.innerHTML=f.join(""),r.appendChild(u)}if(s.$4P()){if("function"==typeof s.onAfterEventRender){var y={};y.e=r.event,y.div=r,s.onAfterEventRender(y)}}else s.afterEventRender&&s.afterEventRender(r.event,r);this.nav.allday.appendChild(r),this.elements.events.push(r)}e.style.display=""}}},this.$4k=function(e){if(s.multiselect.$5R(),this.elements.events)for(var t=0;t<this.elements.events.length;t++){var i=this.elements.events[t],n=i.event;if(!n||!e||n.allday()){if(n&&(n.div=null,n.root=null),i.onclick=null,i.onclickSave=null,i.ondblclick=null,i.oncontextmenu=null,i.onmouseover=null,i.onmouseout=null,i.onmousemove=null,i.onmousedown=null,i.firstChild&&i.firstChild.firstChild&&i.firstChild.firstChild.tagName&&"IMG"===i.firstChild.firstChild.tagName.toUpperCase()){var a=i.firstChild.firstChild;a.onmousedown=null,a.onmousemove=null,a.onclick=null}i.helper=null,i.event=null,DayPilot.de(i)}}this.elements.events=[]},this.$61=function(e){var t=this.nav.events,i=this.roundedCorners,n=this.roundedCorners&&(this.$49.ff||this.$49.opera105||this.$49.webkit522||!this.$49.ielt9),a=this.roundedCorners&&!n,o=e.cache||e.data,l=o.borderColor||this.eventBorderColor,r=document.createElement("div");r.setAttribute("unselectable","on"),r.style.MozUserSelect="none",r.style.KhtmlUserSelect="none",r.style.WebkitUserSelect="none",r.style.position="absolute",this.cssOnly?r.className=this.$4S("_event"):(r.style.fontFamily=this.eventFontFamily,r.style.fontSize=this.eventFontSize,r.style.color=o.fontColor||this.eventFontColor,i||(r.style.backgroundColor=l)),r.style.left=e.part.left+"%",r.style.top=e.part.top-this.$5C()+"px",r.style.width=e.part.width+"%",r.style.height=Math.max(e.part.height,2)+"px",r.style.overflow="hidden",r.isFirst=e.part.start.getTime()===e.start().getTime(),r.isLast=e.part.end.getTime()===e.end().getTime(),e.client.clickEnabled()&&(r.onclick=this.$53),e.client.doubleClickEnabled()&&(r.ondblclick=this.$57),DayPilot.re(r,"contextmenu",this.$58),r.onmousemove=this.$62,r.onmouseout=this.$63,r.onmousedown=this.$64,DayPilot.re(r,DayPilot.touch.start,this.$65.onEventTouchStart),DayPilot.re(r,DayPilot.touch.move,this.$65.onEventTouchMove),DayPilot.re(r,DayPilot.touch.end,this.$65.onEventTouchEnd);var d=[];if(this.cssOnly){o.cssClass&&DayPilot.Util.addClass(r,o.cssClass),this.showToolTip&&!this.bubble&&r.setAttribute("title",e.client.toolTip());var h=document.createElement("div");if(h.setAttribute("unselectable","on"),h.className=s.$4S("_event_inner"),h.innerHTML=e.client.innerHTML(),o.fontColor&&(h.style.color=o.fontColor),o.backColor&&(h.style.background=o.backColor,(DayPilot.browser.ie9||DayPilot.browser.ielt9)&&(h.style.filter="")),o.borderColor&&(h.style.borderColor=o.borderColor),o.backgroundImage&&(h.style.backgroundImage="url("+o.backgroundImage+")",o.backgroundRepeat&&(h.style.backgroundRepeat=o.backgroundRepeat)),r.appendChild(h),e.client.barVisible()){p=e.part.height-2;var c=100*e.part.barTop/p,u=Math.ceil(100*e.part.barHeight/p);"PercentComplete"===this.durationBarMode&&(c=0,u=o.complete);var f=document.createElement("div");f.setAttribute("unselectable","on"),f.className=this.$4S("_event_bar"),f.style.position="absolute",o.barBackColor&&(f.style.backgroundColor=o.barBackColor);var v=document.createElement("div");v.setAttribute("unselectable","on"),v.className=this.$4S("_event_bar_inner"),v.style.top=c+"%",v.style.height=0<u&&u<=1?"1px":u+"%",o.barColor&&(v.style.backgroundColor=o.barColor),f.appendChild(v),r.appendChild(f)}}else{"Disabled"!==this.eventDeleteHandling&&e.client.deleteEnabled()&&(d.push("<div unselectable='on' style='position:absolute; width:100%;text-align:right;'><div style='position:absolute; width:10px; height:10px; right:2px; top: 2px; cursor:pointer;"),this.deleteImageUrl&&d.push('background-image:url("'+this.deleteImageUrl+'");'),d.push("' class='"),d.push(this.$4S("event_delete")),d.push("' onmousemove=\"if(typeof(DayPilotBubble)!=='undefined'&&"),d.push(this.clientName),d.push(".bubble && "),d.push(this.clientName),d.push(".bubble.hideAfter > 0"),d.push(") { DayPilotBubble.hideActive(); event.cancelBubble = true; };\" onmousedown=\"this.parentNode.parentNode.style.cursor='default';\" onclick='"),d.push(this.clientName),d.push(".internal.eventDeleteDispatch(this); event.cancelBubble = true; if (event.stopPropagation) event.stopPropagation();' ></div></div>")),a?(d.push("<div style='margin-right:2px;'>"),d.push("<div style='height:1px;line-height:1px;font-size:0px; margin-left:2px; background-color:"),d.push(l),d.push(";'>&nbsp;</div>"),d.push("</div>"),d.push("<div unselectable='on' style='position:absolute;width:100%;margin-top:-1px;'>"),d.push("<div style='height:1px;line-height:1px;font-size:0px;margin-left:1px;margin-top:1px; margin-right:1px;border-right:1px solid "),d.push(l),d.push(";border-left:1px solid "),d.push(l),d.push(";background-color:"),d.push(e.client.header()?l:e.BackgroundColor),d.push("'>"),d.push("&nbsp;</div>"),d.push("</div>")):n||d.push("<div style='height:1px;line-height:1px;font-size:0px; width:1px;'>&nbsp;</div>"),d.push("<div"),this.showToolTip&&!this.bubble&&(d.push(" title='"),d.push(e.client.toolTip().replace(/'/g,"&apos;")),d.push("'"));var p=Math.max(e.part.height-2,0);if(d.push(" c='1'"),d.push(" class='"),d.push(o.cssClass||this.$4S("event")),d.push("'"),a?(d.push(" style='margin-top:1px;height:"),d.push(p-2)):(d.push(" style='margin-top:0px;height:"),d.push(p)),d.push("px;background-color:"),d.push(e.client.backColor()),n?(d.push(";border:1px solid "),d.push(l),d.push(";-moz-border-radius:5px;"),d.push(";-webkit-border-radius:5px;"),d.push(";border-radius:5px;")):(d.push(";border-left:1px solid "),d.push(l),d.push(";border-right:1px solid "),d.push(l)),d.push(";"),e.data.backgroundImage&&(d.push("background-image:url("),d.push(e.data.backgroundImage),d.push(");"),e.data.backgroundRepeat&&(d.push("background-repeat:"),d.push(e.data.backgroundRepeat),d.push(";"))),s.rtl&&d.push("direction:rtl;"),d.push("' unselectable='on'>"),this.durationBarVisible){var y=e.client.barColor()||s.durationBarColor;d.push("<div style='position:absolute;left:1px;top:1px;width:"),d.push(s.durationBarWidth-1),d.push("px;height:"),d.push(e.part.barTop),d.push("px;background-color:white;font-size:1px' unselectable='on'></div>"),d.push("<div style='position:absolute;left:1px;top:"),d.push(e.part.barTop+e.part.barHeight),d.push("px;width:"),d.push(s.durationBarWidth-1),d.push("px;height:"),d.push(p-(e.part.barTop+e.part.barHeight)),d.push("px;background-color:white;font-size:1px' unselectable='on'></div>"),d.push("<div style='position:absolute;left:1px;width:"),d.push(s.durationBarWidth),d.push("px;height:"),d.push(e.part.barHeight),d.push("px;"),e.data.durationBarImageUrl?(d.push("background-image:url("),d.push(e.data.durationBarImageUrl),d.push(");")):s.durationBarImageUrl&&(d.push("background-image:url("),d.push(s.durationBarImageUrl),d.push(");")),d.push("top:"),d.push(e.part.barTop+1),d.push("px;background-color:"),d.push(y),d.push(";font-size:1px' unselectable='on'></div><div style='position:absolute;left:"),d.push(s.durationBarWidth),d.push("px;top:1px;width:1px;background-color:"),d.push(l),d.push(";height:100%' unselectable='on'></div>")}var g=e.client.header()?this.eventHeaderHeight:0;e.client.header()&&(d.push("<div unselectable='on' style='overflow:hidden;height:"),d.push(this.eventHeaderHeight),d.push("px; background-color:"),d.push(l),d.push(";font-size:"),d.push(this.eventHeaderFontSize),d.push(";color:"),d.push(this.eventHeaderFontColor),d.push("'>"),d.push(e.client.header()),d.push("</div>")),this.durationBarVisible?(d.push("<div unselectable='on' style='padding-left:"),d.push(s.durationBarWidth+3),d.push("px;")):(d.push("<div unselectable='on' style='overflow:hidden;padding-left:2px;height:"),d.push(p-g-1),d.push("px;")),d.push("'>"),d.push(e.client.innerHTML()),d.push("</div></div>"),a&&(d.push("<div unselectable='on' style='margin-right:2px;'>"),d.push("<div unselectable='on' style='height:1px;line-height:1px;font-size:0px;margin-left:2px;margin-top:1px;background-color:"),d.push(l),d.push(";'>\x3c!-- --\x3e</div>"),d.push("</div>"),d.push("<div unselectable='on' style='margin-right:0px;margin-top:-3px;position:relative;'>"),d.push("<div unselectable='on' style='margin-right:0px;position:relative;'>"),d.push("<div unselectable='on' style='height:1px;line-height:1px;font-size:0px;margin-top:1px;margin-left:1px;margin-right:1px;border-right:1px solid "),d.push(l),d.push(";border-left:1px solid "),d.push(l),d.push(";background-color:"),d.push(e.client.backColor()),d.push("'>"),d.push("\x3c!-- --\x3e</div>"),d.push("</div>"),d.push("</div>")),r.innerHTML=d.join("")}if(o.areas)for(var m=0;m<o.areas.length;m++){var b=o.areas[m];if("Visible"===b.v){var w=DayPilot.Areas.createArea(r,e,b);r.appendChild(w)}}if(t.rows[0].cells[e.part.dayIndex])if(t.rows[0].cells[e.part.dayIndex].events.appendChild(r),s.$66(r),r.event=e,s.multiselect.$5J(e)&&s.multiselect.add(r.event,!0),s.$4P()){if("function"==typeof s.onAfterEventRender){var $={};$.e=r.event,$.div=r,s.onAfterEventRender($)}}else s.afterEventRender&&s.afterEventRender(r.event,r);s.elements.events.push(r)},this.$66=function(e){for(var t=e&&e.childNodes?e.childNodes.length:0,i=0;i<t;i++)try{var n=e.childNodes[i];1===n.nodeType&&(n.setAttribute("unselectable","on"),this.$66(n))}catch(e){}},this.$4L=function(){this.multiselect.$5E=[];for(var e=new Date,t=0;t<this.$4R.length;t++){var i=this.$4R[t];if(i.blocks)for(var n=0;n<i.blocks.length;n++)for(var a=i.blocks[n],s=0;s<a.lines.length;s++)for(var o=a.lines[s],l=0;l<o.length;l++){var r=o[l];if(r.part.width=100/a.lines.length,r.part.left=r.part.width*s,"Cascade"===this.eventArrangement)s===a.lines.length-1||(r.part.width=1.5*r.part.width);"Full"===this.eventArrangement&&(r.part.left=r.part.left/2,r.part.width=100-r.part.left),r.allday()||this.$61(r)}}this.multiselect.redraw();(new Date).getTime(),e.getTime()},this.$67=function(){this.multiselect.$5E=[];for(var e=0;e<this.$4R.length;e++)for(var t=this.$4R[e],i=0;i<t.lines.length;i++)for(var n=t.lines[i],a=0;a<n.length;a++){var s=n[a];s.part.width=100/t.lines.length,s.part.left=s.Width*i,s.allday()||this.$61(s)}},this.$4S=function(e){var t=this.theme||this.cssClassPrefix;return t?t+e:""},this.$4K=function(){"hidden"===this.nav.top.style.visibility&&(this.nav.top.style.visibility="visible")},this.$68=function(){var e=this.$4Z()+this.$69();return s.debug.message("Getting totalHeight, headerHeight: "+this.$4Z()+" scrollable: "+this.$69()),e<0?0:e},this.$6a=function(){if(this.nav.top.dp=this,this.nav.top.innerHTML="",this.nav.top.style.MozUserSelect="none",this.nav.top.style.KhtmlUserSelect="none",this.nav.top.style.WebkitUserSelect="none",this.nav.top.style.WebkitTapHighlightColor="rgba(0,0,0,0)",this.nav.top.style.WebkitTouchCallout="none",this.nav.top.style.position="relative",this.width&&(this.nav.top.style.width=this.width),this.rtl&&(this.nav.top.style.direction="rtl"),this.cssOnly||(this.nav.top.style.lineHeight="1.2",this.nav.top.style.textAlign="left"),"Parent100Pct"===this.heightSpec?this.nav.top.style.height="100%":this.nav.top.style.height=this.$68()+"px",this.hideUntilInit&&(this.nav.top.style.visibility="hidden"),this.visible||(this.nav.top.style.display="none"),this.nav.scroll=document.createElement("div"),this.nav.scroll.style.height=this.$69()+"px",this.cssOnly&&DayPilot.Util.addClass(this.nav.top,this.$4S("_main")),this.nav.scroll.style.position="relative",this.cssOnly||(this.nav.scroll.style.border="1px solid "+this.borderColor,this.nav.scroll.style.backgroundColor=this.hourNameBackColor),this.showHeader){var e=this.$6b();this.nav.top.appendChild(e)}this.nav.scroll.style.zoom=1,this.nav.scroll.setAttribute("data-id","nav.scroll"),this.nav.scroll.style.position="absolute",this.nav.scroll.style.left="0px",this.nav.scroll.style.right="0px",this.nav.scroll.style.top=this.$4Z()+"px";var t=this.$6c();this.nav.scrollable=t.firstChild,this.nav.scroll.appendChild(t),this.nav.top.appendChild(this.nav.scroll),this.nav.vsph=document.createElement("div"),this.nav.vsph.style.display="none",this.nav.top.appendChild(this.nav.vsph),this.nav.scrollpos=document.createElement("input"),this.nav.scrollpos.type="hidden",this.nav.scrollpos.id=s.id+"_scrollpos",this.nav.scrollpos.name=this.nav.scrollpos.id,this.nav.top.appendChild(this.nav.scrollpos),this.nav.select=document.createElement("input"),this.nav.select.type="hidden",this.nav.select.id=s.id+"_select",this.nav.select.name=this.nav.select.id,this.nav.select.value=null,this.nav.top.appendChild(this.nav.select),this.nav.scrollLayer=document.createElement("div"),this.nav.scrollLayer.style.position="absolute",this.nav.scrollLayer.style.top="0px",this.nav.scrollLayer.style.left="0px",this.nav.top.appendChild(this.nav.scrollLayer),this.nav.scrollUp=[],this.nav.scrollDown=[],this.nav.loading=document.createElement("div"),this.nav.loading.style.position="absolute",this.nav.loading.style.top="0px",this.nav.loading.style.left=this.hourWidth+5+"px",this.nav.loading.style.backgroundColor=this.loadingLabelBackColor,this.nav.loading.style.fontSize=this.loadingLabelFontSize,this.nav.loading.style.fontFamily=this.loadingLabelFontFamily,this.nav.loading.style.color=this.loadingLabelFontColor,this.nav.loading.style.padding="2px",this.nav.loading.innerHTML=this.loadingLabelText,this.nav.loading.style.display="none",this.nav.top.appendChild(this.nav.loading)},this.$6d=function(){for(var e="Fixed"===this.columnWidthSpec,t=this.nav.header.rows[this.nav.header.rows.length-1],i=this.nav.events.rows[0],n=0;n<s.$4R.length;n++){var a=t.cells[n],o=i.cells[n],l=a.firstChild,r=s.$4R[n];if(e){var d=r.width?r.width:s.columnWidth;l.style.width=d+"px",o&&(o.style.width=d+"px")}else l.style.width=null,o&&(o.style.width=null)}},this.$50=function(){return this.$5z?s.nav.bottomRight:s.nav.scroll},this.$6e=function(){var e="Fixed"===this.columnWidthSpec;if(!e){var t=s.$50();"Fixed"===this.heightSpec?t.style.overflowY="scroll":"BusinessHours"===this.heightSpec&&this.$4T()<=this.businessEndsHour-this.businessBeginsHour?t.style.overflow="hidden":"Full"!==this.heightSpec&&"BusinessHoursNoScroll"!==this.heightSpec?t.style.overflow="auto":t.style.overflow="hidden"}if(e){var i=0,n=this.$4R.length*this.columnWidth;n>s.$5A().clientWidth&&(i=DayPilot.sw(s.nav.bottomRight)),s.nav.headerParent.style.width=n+i+"px",s.nav.main.style.width=n+"px",s.nav.events.style.width=n+"px",s.nav.crosshair.style.width=n+"px"}else s.nav.headerParent.style.width="100%",s.nav.main.style.width="100%",s.nav.events.style.width="100%",s.nav.crosshair.style.width="100%";this.$6d()},this.$4G=function(){this.$46?this.$6f():DayPilot.pu(this.nav.hourTable),this.nav.hoursPlaceholder&&(this.nav.hoursPlaceholder.innerHTML="",this.nav.hourTable=this.$6g(),this.nav.hoursPlaceholder.appendChild(this.nav.hourTable))},this.$6f=function(){if(this.nav.hourTable)for(var e=0;e<this.nav.hourTable.rows.length;e++){var t=this.nav.hourTable.rows[e].cells[0].firstChild;t.data=null,t.onmousemove=null,t.onmouseout=null}},this.$6c=function(){var e=document.createElement("div");e.style.zoom=1,e.style.position="relative",e.onmousemove=this.$6h,DayPilot.re(e,DayPilot.touch.start,this.$65.onMainTouchStart),DayPilot.re(e,DayPilot.touch.move,this.$65.onMainTouchMove),DayPilot.re(e,DayPilot.touch.end,this.$65.onMainTouchEnd),DayPilot.re(e,"contextmenu",function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1}),navigator.msPointerEnabled&&(e.style.msTouchAction="none",e.style.touchAction="none"),e.daypilotMainD=!0,e.calendar=this;var t=null,i=null,n=null;if("Fixed"===this.columnWidthSpec||this.$5z){if(this.showHours){var a=document.createElement("div");a.style.cssFloat="left",a.style.styleFloat="left",a.style.width=this.hourWidth+"px",a.style.height=this.$69()+"px",a.style.overflow="hidden",e.appendChild(a),t=a;var s=this.$4U()*this.cellHeight/(6e4*this.cellDuration)+30;(n=document.createElement("div")).style.height=s+"px",a.appendChild(n)}var o=document.createElement("div");o.style.height=this.$69()+"px",this.showHours&&(o.style.marginLeft=this.hourWidth+"px"),o.style.position="relative",o.style.overflow="auto",e.appendChild(o),i=o}else{var l=document.createElement("table");l.cellSpacing="0",l.cellPadding="0",l.border="0",l.style.border="0px none",l.style.width="100%",l.style.position="relative";var r,d=l.insertRow(-1);this.showHours&&((r=d.insertCell(-1)).style.verticalAlign="top",r.style.padding="0px",r.style.border="0px none",n=r),(r=d.insertCell(-1)).width="100%",r.style.padding="0px",r.style.border="0px none",r.style.verticalAlign="top",this.cssOnly||(r.style.borderLeft="1px solid "+this.borderColor),i=r,e.appendChild(l)}if(n&&(this.nav.hourTable=this.$6g(),n.appendChild(this.nav.hourTable)),this.cssOnly||this.$47){var h=document.createElement("div");h.style.height="0px",h.style.position="relative",h.appendChild(this.$6i());var c=document.createElement("div");c.style.position="absolute",c.style.top="0px",c.style.left="0px",c.style.width="100%",c.style.height="0px",h.appendChild(c),this.nav.crosshair=c,h.appendChild(this.$6j()),i.appendChild(h)}else i.appendChild(this.$6i());return this.nav.zoom=e,this.nav.bottomLeft=t,this.nav.bottomRight=i,this.nav.hoursPlaceholder=n,e},this.$6i=function(){var e=document.createElement("table");return e.cellPadding="0",e.cellSpacing="0",e.border="0","Fixed"===this.columnWidthSpec||(e.style.width="100%"),e.style.border="0px none",this.cssOnly,e.style.tableLayout="fixed",this.nav.main=e,this.nav.events=e,e},this.$6k=function(){if("Fixed"===this.columnWidthSpec){for(var e=0,t=0;t<s.$4R.length;t++){var i=s.$4R[t];i.width?e+=i.width:e+=s.columnWidth}return e+"px"}return"100%"},this.$6j=function(){var e=document.createElement("table");e.style.position="absolute",e.style.top="0px",e.cellPadding="0",e.cellSpacing="0",e.border="0",e.style.width=s.$6k(),e.style.border="0px none",e.style.tableLayout="fixed",this.nav.events=e;for(var t=this.$4R.length,i=e.insertRow(-1),n=0;n<t;n++){var a=i.insertCell(-1);a.style.padding="0px",a.style.border="0px none",a.style.height="0px",a.style.overflow="visible",s.rtl||(a.style.textAlign="left"),s.$6l(a)}return e},this.$6g=function(){var e=document.createElement("table");e.cellSpacing="0",e.cellPadding="0",e.border="0",e.style.border="0px none",e.style.width=this.hourWidth+"px",e.oncontextmenu=function(){return!1},e.onmousemove=function(){s.$4r()};for(var t=this.$4U()/(60*this.timeHeaderCellDuration*1e3),i=0;i<t;i++)this.$6m(e,i);return e},this.$6n=function(){return(this.$4Y()-this.$4Y(!0))*(60/this.cellDuration)},this.$6o=function(){return this.$4Y()-this.$4Y(!0)},this.$5C=function(){return this.$6n()*this.cellHeight},this.$6m=function(e,t){var i=60*this.cellHeight/this.cellDuration/(60/this.timeHeaderCellDuration),n=e.insertRow(-1);n.style.height=i+"px";var a=n.insertCell(-1);a.valign="bottom",a.setAttribute("unselectable","on"),this.cssOnly||(a.className=this.$4S("rowheader"),a.style.backgroundColor=this.hourNameBackColor,a.style.cursor="default"),a.style.padding="0px",a.style.border="0px none";var o=document.createElement("div");this.cssOnly&&(o.className=this.$4S("_rowheader")),o.style.position="relative",o.style.width=this.hourWidth+"px",o.style.height=i+"px",o.style.overflow="hidden",o.setAttribute("unselectable","on");var l=document.createElement("div");this.cssOnly&&(l.className=this.$4S("_rowheader_inner")),l.setAttribute("unselectable","on"),this.cssOnly||(l.style.borderBottom="1px solid "+this.hourNameBorderColor,l.style.textAlign="right",l.style.height=i-1+"px");var r=null,d=null;if(this.hours){var h=t+this.$6o();r=(d=this.hours[h]).html}var c=this.timeHeaderCellDuration,u=this.startDate.addMinutes(c*t+60*this.$4Y()),f=u.getHours();if(!r){var v=document.createElement("div");v.setAttribute("unselectable","on"),this.cssOnly||(v.style.padding="2px",v.style.fontFamily=this.hourFontFamily,v.style.fontSize=this.hourFontSize,v.style.color=this.hourFontColor);var p=f<12;"Clock12Hours"===this.$60.timeFormat()&&0===(f%=12)&&(f=12),60!==this.timeHeaderCellDuration&&(f+=":"+u.toString("mm")),v.innerHTML=f;var y,g=document.createElement("span");g.setAttribute("unselectable","on"),this.cssOnly?g.className=this.$4S("_rowheader_minutes"):(g.style.fontSize="10px",g.style.verticalAlign="super"),y="Clock12Hours"===this.$60.timeFormat()?p?"AM":"PM":"00",this.cssOnly?g.innerHTML=y:g.innerHTML="&nbsp;"+y,v.appendChild(g),r=v.outerHTML}if("function"==typeof s.onBeforeTimeHeaderRender){var m={header:{}};m.header.hours=f,m.header.minutes=u.getMinutes(),m.header.start=u.toString("HH:mm"),m.header.html=r,m.header.areas=d?d.areas:null,s.onBeforeTimeHeaderRender(m),null!==m.header.html&&(r=m.header.html),d=m.header}d&&(o.data=d,o.onmousemove=s.$6p,o.onmouseout=s.$6q),l.innerHTML=r,o.appendChild(l),a.appendChild(o)},this.$6p=function(e){s.$4r();this.active||DayPilot.Areas.showAreas(this,this.data)},this.$6q=function(e){DayPilot.Areas.hideAreas(this,e)},this.$69=function(){switch(this.heightSpec){case"Fixed":case"Parent100Pct":return this.height;case"Full":return this.$4U()*this.cellHeight/(6e4*this.cellDuration);case"BusinessHours":case"BusinessHoursNoScroll":return this.$4V()*this.cellHeight*60/this.cellDuration;default:throw"DayPilot.Calendar: Unexpected 'heightSpec' value."}},this.$4Z=function(){if(!this.showHeader)return 0;var e=this.headerLevels*l.headerHeight()+this.headerLevels-1;return this.showAllDayEvents&&l.allDayHeaderHeight()?(this.cssOnly,e+l.allDayHeaderHeight()):e},this.$4C=function(){if(this.headerHeightAutoFit){if(this.headerLevels>1)throw"Header height can't be adjusted for HeaderLevels > 1 (not implemented yet).";for(var e=0,t=0;t<this.$4R.length;t++){var i=this.nav.header.rows[this.headerLevels-1].cells[t].firstChild,n=i.firstChild,a=i.style.height;i.style.height="auto",n.style.position="static";var s=i.offsetHeight;i.style.height=a,n.style.position="",e=Math.max(e,s)}e>this.headerHeight&&(this.$45.headerHeight=e,this.$4A(),this.$4B())}},this.$5z=!0,this.$6r=function(){var e=this.$5z?s.nav.bottomRight:s.nav.scroll;return this.cssOnly?DayPilot.sw(e)>0:DayPilot.sw(e)>2},this.$6b=function(){var e=document.createElement("div");this.cssOnly||(e.style.borderLeft="1px solid "+this.borderColor,e.style.borderRight="1px solid "+this.borderColor),(h="Fixed"===this.columnWidthSpec)||(e.style.overflow="auto"),e.style.position="absolute",e.style.left="0px",e.style.right="0px";var t=document.createElement("div");t.style.position="relative",t.style.zoom="1";var i=null;if((h="Fixed"===this.columnWidthSpec)||this.$5z){var n=document.createElement("div");if(n.style.cssFloat="left",n.style.styleFloat="left",n.style.width=this.hourWidth+"px",this.showHours){var a=this.$6s();this.nav.corner=a,n.appendChild(a),t.appendChild(n),this.nav.upperLeft=n}var s=document.createElement("div");this.showHours&&(s.style.marginLeft=this.hourWidth+"px"),s.style.position="relative",s.style.overflow="hidden",s.style.height=this.$4Z()+"px",t.appendChild(s),this.nav.upperRight=s,(i=document.createElement("div")).style.position="relative",s.appendChild(i)}else{var o=document.createElement("table");o.cellPadding="0",o.cellSpacing="0",o.border="0",o.style.width="100%",o.style.borderCollapse="separate",o.style.border="0px none";var l=o.insertRow(-1);if(this.nav.fullHeader=o,this.showHours){var r=l.insertCell(-1);r.style.padding="0px",r.style.border="0px none";a=this.$6s();r.appendChild(a),this.nav.corner=a}(r=l.insertCell(-1)).style.width="100%",this.cssOnly||(r.style.backgroundColor=this.hourNameBackColor),r.valign="top",r.style.position="relative",r.style.padding="0px",r.style.border="0px none",(i=document.createElement("div")).style.position="relative",i.style.height=this.$4Z()+"px",i.style.overflow="hidden",r.appendChild(i),this.nav.mid=i,t.appendChild(o)}this.nav.headerParent=i,this.$6t();var d=this.$6r(),h="Fixed"===this.columnWidthSpec;return d&&!h&&this.$6u(),e.appendChild(t),e},this.$6t=function(){this.nav.unifiedCornerRight=null,this.nav.header=document.createElement("table"),this.nav.header.cellPadding="0",this.nav.header.cellSpacing="0","Fixed"===this.columnWidthSpec||(this.nav.header.width="100%"),this.nav.header.style.tableLayout="fixed",this.cssOnly||(this.nav.header.style.borderBottom="0px none #000000",this.nav.header.style.borderLeft="1px solid "+this.borderColor,this.nav.header.style.borderTop="1px solid "+this.borderColor),this.nav.header.oncontextmenu=function(){return!1};var e=this.$6r();if(this.cssOnly||e&&(this.nav.header.style.borderRight="1px solid "+this.borderColor),this.nav.headerParent.appendChild(this.nav.header),this.nav.allday&&DayPilot.de(this.nav.allday),this.showAllDayEvents){var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.height="0px","Fixed"===this.columnWidthSpec?t.style.width=this.$4R.length*this.columnWidth+"px":(t.style.left="0px",t.style.right="0px"),this.nav.allday=t,this.nav.headerParent.appendChild(t)}},this.$6u=function(){if(this.nav.fullHeader){var e=this.nav.fullHeader.rows[0].insertCell(-1);this.cssOnly||(e.className=this.$4S("cornerright"),e.style.backgroundColor=this.hourNameBackColor,e.style.borderBottom="0px none",e.style.borderLeft="1px solid "+this.borderColor,e.style.borderRight="0px none"),e.style.padding="0px",e.style.verticalAlign="top",e.setAttribute("unselectable","on");var t=document.createElement("div");t.setAttribute("unselectable","on"),this.cssOnly&&(t.className=this.$4S("_cornerright")),t.style.overflow="hidden",t.style.position="relative",t.style.width="16px",t.style.height=this.$4Z()+"px";var i=document.createElement("div");this.cssOnly?i.className=this.$4S("_cornerright_inner"):i.style.borderTop="1px solid "+this.borderColor,t.appendChild(i),e.appendChild(t),this.nav.cornerRight=t}},this.$6s=function(){var e=document.createElement("div");e.style.position="relative",this.cssOnly?e.className=this.$4S("_corner"):(e.style.backgroundColor=this.cornerBackColor,e.style.fontFamily=this.headerFontFamily,e.style.fontSize=this.headerFontSize,e.style.color=this.headerFontColor,e.className=this.$4S("corner")),e.style.width=this.hourWidth+"px",e.style.height=this.$4Z()+"px",e.style.overflow="hidden",e.oncontextmenu=function(){return!1};var t=document.createElement("div");this.cssOnly?t.className=this.$4S("_corner_inner"):t.style.borderTop="1px solid "+this.borderColor,t.setAttribute("unselectable","on");var i=this.cornerHTML||this.cornerHtml;if(t.innerHTML=i||"",e.appendChild(t),!this.numberFormat)return e;var n=document.createElement("div");return n.style.position="absolute",n.style.padding="2px",n.style.top="0px",n.style.left="1px",n.style.backgroundColor="#FF6600",n.style.color="white",n.innerHTML="DEMO",n.setAttribute("unselectable","on"),e.appendChild(n),e},this.$4l=function(){var e=this.nav.main;e.root=null,e.onmouseup=null;for(var t=0;t<e.rows.length;t++)for(var i=e.rows[t],n=0;n<i.cells.length;n++){var a=i.cells[n];a.root=null,a.onmousedown=null,a.onmousemove=null,a.onmouseout=null,a.onmouseup=null,a.onclick=null,a.ondblclick=null,a.oncontextmenu=null}this.$46||DayPilot.pu(e)},this.$4D=function(){for(var e=0;this.nav.scrollUp&&e<this.nav.scrollUp.length;e++)this.nav.scrollLayer.removeChild(this.nav.scrollUp[e]);for(e=0;this.nav.scrollDown&&e<this.nav.scrollDown.length;e++)this.nav.scrollLayer.removeChild(this.nav.scrollDown[e]);this.nav.scrollUp=[],this.nav.scrollDown=[]},this.$6l=function(e){var t=document.createElement("div");t.style.marginRight=s.columnMarginRight+"px",t.style.position="relative",t.style.height="1px",this.cssOnly||(t.style.fontSize="1px",t.style.lineHeight="1.2"),t.style.marginTop="-1px",e.events=t;var i=document.createElement("div");i.style.position="relative",t.style.height="1px",t.style.marginTop="-1px",e.separators=i,e.appendChild(i),e.appendChild(t)},this.$4F=function(){var e=this.nav.main,i=60*this.cellDuration*1e3,n=this.$52(),a=this.$6o()*(60/this.cellDuration),o=s.$4R,l=!this.$6v||0===e.rows.length||o.length!==e.rows[0].cells.length||n!==e.rows.length;if(e&&(this.$4l(),s.$49.ielt9&&l)){DayPilot.de(this.nav.scrollable.parentNode);var r=this.$6c();this.nav.scrollable=r.firstChild,this.nav.scroll.appendChild(r),e=this.nav.main}for(this.nav.scrollable.daypilotMainD=!0,this.nav.scrollable.calendar=this;e&&e.rows&&e.rows.length>0&&l;)this.$46||DayPilot.pu(e.rows[0]),e.deleteRow(0);if(this.$6v=!0,this.scrollLabelsVisible){o=this.$4R;for(var d=this.showHours?this.hourWidth:0,h=(this.nav.scroll.clientWidth-d)/o.length,c=0;c<o.length;c++){var u=document.createElement("div");u.style.position="absolute",u.style.top="0px",u.style.left=d+2+c*h+h/2+"px",u.style.display="none",(f=document.createElement("div")).style.height="10px",f.style.width="10px",this.cssOnly?f.className=this.$4S("_scroll_up"):(f.style.backgroundRepeat="no-repeat",this.scrollUpUrl&&(f.style.backgroundImage="url('"+this.scrollUpUrl+"')"),f.className=this.$4S("scroll_up")),u.appendChild(f),this.nav.scrollLayer.appendChild(u),this.nav.scrollUp.push(u);var f,v=document.createElement("div");v.style.position="absolute",v.style.top="0px",v.style.left=d+2+c*h+h/2+"px",v.style.display="none",(f=document.createElement("div")).style.height="10px",f.style.width="10px",this.cssOnly?f.className=this.$4S("_scroll_down"):(f.style.backgroundRepeat="no-repeat",this.scrollDownUrl&&(f.style.backgroundImage="url('"+this.scrollDownUrl+"')"),f.className=this.$4S("scroll_down")),v.appendChild(f),this.nav.scrollLayer.appendChild(v),this.nav.scrollDown.push(v)}}var p=o.length;if(this.cssOnly||this.$47){for(var y=this.nav.events;y&&y.rows&&y.rows.length>0&&l;)this.$46||DayPilot.pu(y.rows[0]),y.deleteRow(0);for(var g=l?y.insertRow(-1):y.rows[0],m=0;m<p;m++){var b=l?g.insertCell(-1):g.cells[m];if(l)b.style.padding="0px",b.style.border="0px none",b.style.height="1px",b.style.overflow="visible","Fixed"===this.columnWidthSpec&&(o[m].width?b.style.width=o[m].width+"px":b.style.width=this.columnWidth+"px"),s.rtl||(b.style.textAlign="left"),s.$6l(b)}}for(c=0;c<n;c++){g=l?e.insertRow(-1):e.rows[c];var w=c+a;l&&(g.style.MozUserSelect="none",g.style.KhtmlUserSelect="none",g.style.WebkitUserSelect="none");for(m=0;m<p;m++){var $=this.$4R[m];if((b=l?g.insertCell(-1):g.cells[m]).start=$.start.addTime(w*i).addHours(this.$4Y()),b.end=b.start.addTime(i),b.resource=$.id,"function"==typeof this.onBeforeCellRender){this.cellProperties||(this.cellProperties={});var D={};D.resource=b.resource,D.start=b.start,D.end=b.end;var k=m+"_"+w;D.cssClass=null,D.html=null,D.backImage=null,D.backRepeat=null,D.backColor=null,D.business=this.$6w(b.start,b.end),this.cellProperties[k]&&DayPilot.Util.copyProps(this.cellProperties[k],D,["cssClass","html","backImage","backRepeat","backColor","business"]);var C={};C.cell=D,this.onBeforeCellRender(C),this.cellProperties[k]=D}var x=s.$6x(m,w);if(l)if(b.root=this,b.style.padding="0px",b.style.border="0px none",b.style.verticalAlign="top",b.style.height=s.cellHeight+"px",b.style.overflow="hidden",b.setAttribute("unselectable","on"),this.cssOnly){(S=document.createElement("div")).className=s.$4S("_cell"),S.style.position="relative",S.style.height=s.cellHeight+"px",S.style.overflow="hidden",S.setAttribute("unselectable","on");var P=document.createElement("div");P.className=s.$4S("_cell_inner"),S.appendChild(P),b.appendChild(S)}else{var S;(S=document.createElement("div")).style.height=s.cellHeight-1+"px",S.style.width="100%",S.style.overflow="hidden",S.setAttribute("unselectable","on"),b.appendChild(S);var T=document.createElement("div");T.setAttribute("unselectable","on"),T.style.fontSize="1px",T.style.height="0px",b.appendChild(T),(!s.rtl&&m!==p-1||s.rtl)&&(b.style.borderRight="1px solid "+s.cellBorderColor),b.end.getMinutes()+b.end.getSeconds()+b.end.getMilliseconds()>0?(""!==s.hourHalfBorderColor&&(T.style.borderBottom="1px solid "+s.hourHalfBorderColor),T.className=s.$4S("hourhalfcellborder")):(""!==s.hourBorderColor&&(T.style.borderBottom="1px solid "+s.hourBorderColor),T.className=s.$4S("hourcellborder"))}else(S=b.firstChild).className=s.$4S("_cell");b.onmousedown=this.$5t,b.onmousemove=this.$5w,b.onmouseout=this.$5v,DayPilot.re(b,DayPilot.touch.end,this.$65.onCellTouchEnd),b.onmouseup=function(){return!1},b.onclick=function(){return!1},b.ondblclick=function(){if(t.firstMousePos=null,s.$5u(),clearTimeout(t.selectedTimeout),"Disabled"!==s.timeRangeDoubleClickHandling){var e=s.getSelection();s.$5p(e.start,e.end,e.resource)}},b.oncontextmenu=function(){return this.selected||(s.clearSelection(),t.column=t.getColumn(this),s.selectedCells.push(this),t.firstSelected=this,t.topSelectedCell=this,t.bottomSelectedCell=this,s.$5u()),s.contextMenuSelection&&s.contextMenuSelection.show(s.getSelection()),!1};var M=s.$6y(m,w);S=b.firstChild,"Fixed"===this.columnWidthSpec&&($.width?S.style.width=$.width+"px":S.style.width=this.columnWidth+"px"),M&&(this.cssOnly?S.firstChild.style.background=M:S.style.background=M),(x?x.business:this.$6w(b.start,b.end))&&this.cssOnly&&DayPilot.Util.addClass(S,s.$4S("_cell_business"));var H=this.cssOnly?S.firstChild:S;H&&(H.innerHTML=""),S.style.backgroundImage="",S.style.backgroundRepeat="",x&&(x.html&&(H.innerHTML=x.html),x.cssClass&&(this.cssOnly?DayPilot.Util.addClass(S,x.cssClass):DayPilot.Util.addClass(b,s.$4S(x.cssClass))),x.backImage&&(S.style.backgroundImage="url('"+x.backImage+"')"),x.backRepeat&&(S.style.backgroundRepeat=x.backRepeat)),this.cssOnly||DayPilot.Util.addClass(b,s.$4S("cellbackground"))}}e.onmouseup=this.$5x,e.root=this,s.nav.scrollable.style.display=""},this.$6w=function(e,t){return this.businessBeginsHour<this.businessEndsHour?!(e.getHours()<this.businessBeginsHour||e.getHours()>=this.businessEndsHour||6===e.getDayOfWeek()||0===e.getDayOfWeek()):e.getHours()>=this.businessBeginsHour||e.getHours()<this.businessEndsHour},this.$6h=function(e){(e=e||window.event).insideMainD=!0,window.event&&(window.event.srcElement.inside=!0),t.activeCalendar=this;var i=s.nav.main;s.coords=DayPilot.mo3(i,e);var n=DayPilot.mc(e),a=s.crosshairType&&"Disabled"!==s.crosshairType,o=s.coords.x<s.hourWidth;if(DayPilot.Global.moving||DayPilot.Global.resizing||t.selecting||o?s.$4r():a&&s.$6z(),DayPilot.Global.resizing){if(!DayPilot.Global.resizing.event)return DayPilot.Global.resizing=null,DayPilot.de(t.resizingShadow),void(t.resizingShadow=null);t.resizingShadow||(t.resizingShadow=s.$4Q(DayPilot.Global.resizing,!1,s.shadow));var l=DayPilot.Global.resizing.event.calendar.cellHeight,r=0,d=n.y-t.originalMouse.y;if("bottom"===DayPilot.Global.resizing.dpBorder){(c=Math.floor((t.originalHeight+t.originalTop+d+l/2)/l)*l-t.originalTop+r)<l&&(c=l);var h=DayPilot.Global.resizing.event.calendar.nav.main.clientHeight;t.originalTop+c>h&&(c=h-t.originalTop),t.resizingShadow.style.height=c+"px"}else if("top"===DayPilot.Global.resizing.dpBorder){var c;(u=Math.floor((t.originalTop+d-r+l/2)/l)*l+r)<r&&(u=r),u>t.originalTop+t.originalHeight-l&&(u=t.originalTop+t.originalHeight-l),(c=t.originalHeight-(u-t.originalTop))<l?c=l:t.resizingShadow.style.top=u+"px",t.resizingShadow.style.height=c+"px"}}else if(DayPilot.Global.moving){if(!DayPilot.Global.moving.helper)return void(t.movingShadow=null);if(!t.movingShadow){if(!(DayPilot.distance(n,t.originalMouse)>3))return;t.movingShadow=s.$4Q(DayPilot.Global.moving,!s.$49.ie,s.shadow),t.movingShadow.style.width=t.movingShadow.parentNode.offsetWidth+1+"px"}if(!s.coords)return;l=s.cellHeight,r=0;var u,f=t.moveOffsetY;f||(f=l/2),"Top"===this.moveBy&&(f=0),(u=Math.floor((s.coords.y-f-r+l/2)/l)*l+r)<r&&(u=r);var v=s.nav.main,p=(h=v.clientHeight,parseInt(t.movingShadow.style.height));u+p>h&&(u=h-p),t.movingShadow.style.top=u+"px";var y=v.clientWidth/v.rows[0].cells.length,g=Math.floor(s.coords.x/y);g<0&&(g=0),s.rtl&&(g=s.$4R.length-g-1);var m=s.nav.events;g<m.rows[0].cells.length&&g>=0&&t.movingShadow.column!==g&&(t.movingShadow.column=g,t.moveShadow(m.rows[0].cells[g]))}if(t.drag){if(t.gShadow&&document.body.removeChild(t.gShadow),t.gShadow=null,!t.movingShadow&&s.coords){var b=s.$4Q(t.drag,!1,t.drag.shadowType);if(b){t.movingShadow=b;var w=(new DayPilot.Date).getDatePart(),$=(e={value:t.drag.id,start:w,end:w.addSeconds(t.drag.duration),text:t.drag.text},new DayPilot.Event(e,s));$.external=!0,DayPilot.Global.moving={},DayPilot.Global.moving.event=$,DayPilot.Global.moving.helper={}}}e.cancelBubble=!0}},this.temp={},this.temp.getPosition=function(){var e=s.$6A.getCellCoords();if(!e)return null;var t=s.$4R[e.x],i={};return i.resource=t.id,i.start=new DayPilot.Date(t.start).addHours(s.$4Y(!0)).addMinutes(e.y*s.cellDuration),i.end=i.start.addMinutes(s.cellDuration),i},this.$6A={},this.$6A.getCellCoords=function(){var e={x:0,y:0};if(!s.coords)return null;for(var t=s.nav.main,i=s.coords.x,n=0,a=this.col(t,n);a&&i>a.left;)n+=1,a=this.col(t,n);e.x=n-1;var o=Math.floor((s.coords.y-0)/s.cellHeight);return e.y=o,e.x<0?null:e},this.$6A.col=function(e,t){var i={left:0,width:0};if(!e)return null;if(!e.rows)return null;if(0===e.rows.length)return null;if(0==e.rows[0].cells.length)return null;var n=e.rows[0].cells[t];if(!n)return null;var a=DayPilot.abs(e),s=DayPilot.abs(n);return i.left=s.x-a.x,i.width=n.offsetWidth,i},this.$6z=function(){this.$4r(),this.elements.crosshair||(this.elements.crosshair=[]);var e=this.$6A.getCellCoords();if(e){var t=e.x,i=Math.floor(e.y/(60/s.cellDuration)*(60/s.timeHeaderCellDuration));if(!(i<0)){if(this.nav.hourTable){if(i>=this.nav.hourTable.rows.length)return;var n=document.createElement("div");n.style.position="absolute",n.style.left="0px",n.style.right="0px",n.style.top="0px",n.style.bottom="0px",n.style.opacity=.5,n.style.backgroundColor=this.crosshairColor,n.style.opacity=this.crosshairOpacity/100,n.style.filter="alpha(opacity="+this.crosshairOpacity+")",this.nav.hourTable.rows[i].cells[0].firstChild.appendChild(n),this.elements.crosshair.push(n)}if(this.nav.header){var a=document.createElement("div");a.style.position="absolute",a.style.left="0px",a.style.right="0px",a.style.top="0px",a.style.bottom="0px",a.style.opacity=.5,a.style.backgroundColor=this.crosshairColor,a.style.opacity=this.crosshairOpacity/100,a.style.filter="alpha(opacity="+this.crosshairOpacity+")";var o=this.nav.header.rows[this.headerLevels-1];o.cells[t]&&(o.cells[t].firstChild.appendChild(a),this.elements.crosshair.push(a))}if("Header"!==this.crosshairType){var l=this.nav.crosshair,r=Math.floor((s.coords.y-0)/s.cellHeight)*s.cellHeight+0,d=s.cellHeight,h=document.createElement("div");h.style.position="absolute",h.style.left="0px",h.style.right="0px",h.style.top=r+"px",h.style.height=d+"px",h.style.backgroundColor=this.crosshairColor,h.style.opacity=this.crosshairOpacity/100,h.style.filter="alpha(opacity="+this.crosshairOpacity+")",h.onmousedown=this.$6B,l.appendChild(h),this.elements.crosshair.push(h);var c=this.$6A.col(this.nav.main,t);if(d=this.nav.main.clientHeight,c){var u=document.createElement("div");u.style.position="absolute",u.style.left=c.left+"px",u.style.width=c.width+"px",u.style.top="0px",u.style.height=d+"px",u.style.backgroundColor=this.crosshairColor,u.style.opacity=this.crosshairOpacity/100,u.style.filter="alpha(opacity="+this.crosshairOpacity+")",u.onmousedown=this.$6B,l.appendChild(u),this.elements.crosshair.push(u)}}}}},this.$6B=function(e){s.$4r();var t=s.$6A.getCellCoords(),i=s.nav.main.rows[t.y+0].cells[t.x];s.$5t.apply(i,[e])},this.$4r=function(){if(this.elements.crosshair&&0!==this.elements.crosshair.length){for(var e=0;e<this.elements.crosshair.length;e++){var t=this.elements.crosshair[e];t&&t.parentNode&&t.parentNode.removeChild(t)}this.elements.crosshair=[]}},this.$4y=function(){if(this.cellConfig){var e=this.cellConfig;if(e.vertical)for(var t=0;t<e.x;t++)for(var i=this.cellProperties[t+"_0"],n=1;n<e.y;n++)this.cellProperties[t+"_"+n]=i;if(e.horizontal)for(n=0;n<e.y;n++)for(i=this.cellProperties["0_"+n],t=1;t<e.x;t++)this.cellProperties[t+"_"+n]=i;if(e.default)for(i=e.default,n=0;n<e.y;n++)for(t=0;t<e.x;t++)this.cellProperties[t+"_"+n]||(this.cellProperties[t+"_"+n]=i)}},this.$6x=function(e,t){return this.cellProperties?this.cellProperties[e+"_"+t]:null},this.$6C=function(e,t){var i=e+"_"+t;return!(!this.cellProperties||!this.cellProperties[i])&&this.cellProperties[i].business},this.$6y=function(e,t){var i=e+"_"+t;return this.cellProperties&&this.cellProperties[i]?this.cellProperties[i].backColor:null},this.$4m=function(){var e=this.nav.header;if(e&&e.rows)for(var t=0;t<e.rows.length;t++)for(var i=e.rows[t],n=0;n<i.cells.length;n++){var a=i.cells[n];a.onclick=null,a.onmousemove=null,a.onmouseout=null}this.$46||DayPilot.pu(e)},this.$6D=function(e,t){for(var i=t?this.nav.header.insertRow(-1):this.nav.header.rows[e-1],n=this.$5W(e),a=n.length,o=e===s.headerLevels,r=0;r<a;r++){var d=n[r];if(s.$4P()&&"function"==typeof s.onBeforeHeaderRender){var h={header:{}};DayPilot.Util.copyProps(d,h.header,["id","start","name","html","backColor","toolTip","areas","children"]),this.onBeforeHeaderRender(h),DayPilot.Util.copyProps(h.header,d,["html","backColor","toolTip","areas"])}var c=!!d.getChildren,u=t?i.insertCell(-1):i.cells[r];if(u.data=d,o);else{var f=1;c&&(f=d.getChildrenCount(s.headerLevels-e+1)),u.colSpan=f}c&&(u.onclick=this.$59,u.onmousemove=this.$5a,u.onmouseout=this.$5b,d.toolTip&&(u.title=d.toolTip)),u.style.overflow="hidden",u.style.padding="0px",u.style.border="0px none",u.style.height=l.headerHeight()+"px",this.cssOnly||(u.style.borderLeft="0px none",r!==a-1&&(u.style.borderRight="1px solid "+this.borderColor));var v=t?document.createElement("div"):u.firstChild;if(t){if(v.setAttribute("unselectable","on"),v.style.MozUserSelect="none",v.style.KhtmlUserSelect="none",v.style.WebkitUserSelect="none",v.style.position="relative",v.style.height=l.headerHeight()+"px",this.cssOnly){v.className=s.$4S("_colheader");var p=document.createElement("div");p.className=s.$4S("_colheader_inner"),d.backColor&&(p.style.background=d.backColor),v.appendChild(p)}else{v.className=s.$4S("colheader"),v.style.cursor="default",v.style.fontFamily=this.headerFontFamily,v.style.fontSize=this.headerFontSize,v.style.color=this.headerFontColor,v.style.backgroundColor=d.backColor,v.style.textAlign="center";var y=document.createElement("div");y.style.position="absolute",y.style.left="0px",y.style.right="0px",y.style.top="0px",y.style.bottom="0px",y.style.padding="2px",y.setAttribute("unselectable","on"),1!==e&&(y.style.borderTop="1px solid "+this.borderColor),"Disabled"!==this.headerClickHandling&&(y.style.cursor="pointer"),v.appendChild(y)}u.appendChild(v)}else v.style.height=l.headerHeight()+"px";this.$6E(v,d),c&&(v.firstChild.innerHTML=d.html)}},this.$6E=function(e,i){for(var n=[],a=0;a<e.childNodes.length;a++){(s=e.childNodes[a]).isActiveArea&&n.push(s)}for(a=0;a<n.length;a++){var s=n[a];DayPilot.de(s)}if(i.areas){var o=i.areas;for(a=0;a<o.length;a++){var l=o[a];if("Visible"===l.v){var r=new t.Column(i.id,i.name,i.start),d=DayPilot.Areas.createArea(e,r,l);e.appendChild(d)}}}},this.$4B=function(){if(this.showHeader){var e=this.nav.header,t=this.$5W(s.headerLevels,!0),i=t.length;for(this.$6F&&s.$49.ielt9&&(DayPilot.de(this.nav.header),this.$6t());this.$6F&&e&&e.rows&&e.rows.length>0;)this.$46||DayPilot.pu(e.rows[0]),e.deleteRow(0);this.$6F=!0;s.cornerHTML||s.cornerHtml;for(var n=0;n<s.headerLevels;n++)this.$6D(n+1,!0);if(this.showAllDayEvents){var a=this.nav.header.insertRow(-1);for(n=0;n<i;n++){var o=t[n],r=a.insertCell(-1);r.data=o,r.style.padding="0px",r.style.border="0px none",r.style.overflow="hidden",this.cssOnly||(r.style.lineHeight="1.2");var d=document.createElement("div");if(d.setAttribute("unselectable","on"),d.style.MozUserSelect="none",d.style.KhtmlUserSelect="none",d.style.WebkitUserSelect="none",d.style.overflow="hidden",d.style.position="relative",d.style.height=l.allDayHeaderHeight()+"px",this.cssOnly){d.className=this.$4S("_alldayheader");var h=document.createElement("div");h.className=this.$4S("_alldayheader_inner"),d.appendChild(h)}else{d.className=this.$4S("alldayheader"),d.style.textAlign="center",d.style.backgroundColor=o.backColor,d.style.cursor="default";var c=document.createElement("div");c.style.position="absolute",c.style.left="0px",c.style.right="0px",c.style.top="0px",c.style.bottom="0px",c.setAttribute("unselectable","on"),c.style.borderTop="1px solid "+this.borderColor,d.appendChild(c),s.rtl?c.style.borderLeft=n===i-1?"1px solid "+o.backColor:"1px solid "+this.borderColor:n!==i-1&&(c.style.borderRight="1px solid "+this.borderColor)}r.appendChild(d),d.style.height=l.allDayHeaderHeight()+"px"}}}},this.$4f=function(){this.loadingLabelVisible&&this.nav.loading&&(this.nav.loading.innerHTML=this.loadingLabelText,this.nav.loading.style.top=this.$4Z()+5+"px",this.nav.loading.style.display="")},this.$4u=function(){this.callbackTimeout&&window.clearTimeout(this.callbackTimeout),this.nav.loading&&(this.nav.loading.style.display="none")},this.$6G=function(){var e=this.$5A(),t=this.initScrollPos;t||(t=this.businessBeginsHour*(60/s.cellDuration)*s.cellHeight);e.root=this,e.onscroll=this.$5y,0===e.scrollTop?e.scrollTop=t-this.$5C():this.$5y()},this.$6H=function(){var e=s.nav.top;return e.offsetWidth>0&&e.offsetHeight>0},this.$6I=function(){var e=s.$6H;e()||(s.$6J=setInterval(function(){e()&&(s.$6G(),s.$4I(),clearInterval(s.$6J))},100))},this.scrollToY=function(e){this.$5A().scrollTop=e},this.scrollToHour=function(e){var t=this.$5A(),i=e*(60/s.cellDuration)*s.cellHeight;t.scrollTop=i-this.$5C()},this.$5A=function(){return"Fixed"===this.columnWidthSpec||this.$5z?this.nav.bottomRight:this.nav.scroll},this.onCallbackError=function(e,t){alert("Error!\r\nResult: "+e+"\r\nContext:"+t)},this.scrollbarVisible=this.$6r,this.$4I=function(){var e=this.$6r(),t=!!this.nav.cornerRight;if(this.$5z){this.nav.unifiedCornerRight&&DayPilot.de(this.nav.unifiedCornerRight);var i=this.$6k();if("100%"!=i&&parseInt(i)<this.$5A().clientWidth)return;var n=DayPilot.sw(this.nav.bottomRight);this.nav.unifiedCornerRight=this.nav.header.rows[0].insertCell(-1),(l=this.nav.unifiedCornerRight).rowSpan=this.nav.header.rows.length,l.style.width=n+"px";var a=document.createElement("div");a.setAttribute("unselectable","on"),this.cssOnly&&(a.className=this.$4S("_cornerright")),a.style.overflow="hidden",a.style.height=this.$4Z()+"px",a.style.position="relative";var o=document.createElement("div");return this.cssOnly&&(o.className=this.$4S("_cornerright_inner")),a.appendChild(o),l.appendChild(a),void(!("Fixed"===this.columnWidthSpec)&&this.nav.allday&&(this.nav.allday.style.right=n+"px"))}if(e!==t)if(e)this.$6u();else{var l;if(this.nav.fullHeader&&3===this.nav.fullHeader.rows[0].cells.length)(l=this.nav.fullHeader.rows[0].cells[2]).parentNode&&l.parentNode.removeChild(l);this.nav.cornerRight=null}var r=this.nav.cornerRight;if(r){n=DayPilot.sw(s.$50());return this.cssOnly?r&&(r.style.width=n+"px"):n>=3&&(r.style.width=n-3+"px"),n}},this.$4O=function(e){if(e&&(this.autoRefreshEnabled=!0),this.autoRefreshEnabled&&!(this.autoRefreshCount>=this.autoRefreshMaxCount)){this.$4j();var t=this.autoRefreshInterval;if(!t||t<10)throw"The minimum autoRefreshInterval is 10 seconds";this.autoRefreshTimeout=window.setTimeout(function(){s.$6K()},1e3*this.autoRefreshInterval)}},this.$4j=function(){this.autoRefreshTimeout&&window.clearTimeout(this.autoRefreshTimeout)},this.$6K=function(){if(!(DayPilot.Global.resizing||DayPilot.Global.moving||t.drag||t.selecting)){var e=!1;if("function"==typeof this.onAutoRefresh){var i={};i.i=this.autoRefreshCount,i.preventDefault=function(){this.preventDefault.value=!0},s.onAutoRefresh(i),i.preventDefault.value&&(e=!0)}!e&&this.$4e()&&this.commandCallBack(this.autoRefreshCommand),this.autoRefreshCount++}this.autoRefreshCount<this.autoRefreshMaxCount&&(this.autoRefreshTimeout=window.setTimeout(function(){s.$6K()},1e3*this.autoRefreshInterval))},this.$4n=function(){"Parent100Pct"===s.heightSpec&&s.setHeight(parseInt(s.nav.top.clientHeight,10)),s.$4H(),s.$4N()},this.$6L=function(){t.globalHandlers||(t.globalHandlers=!0,DayPilot.re(document,"mousemove",t.gMouseMove),DayPilot.re(document,"mouseup",t.gMouseUp),DayPilot.re(document,DayPilot.touch.move,t.gTouchMove),DayPilot.re(document,DayPilot.touch.end,t.gTouchEnd)),DayPilot.re(window,"resize",this.$4n)},this.$64=function(e){if(!o.active&&!o.using){e=e||window.event;var i=DayPilot.Util.mouseButton(e);if(void 0!==DayPilotBubble&&DayPilotBubble.hideActive(),"n-resize"!==this.style.cursor&&"s-resize"!==this.style.cursor||!i.left){if(("move"===this.style.cursor||"Full"===s.moveBy&&this.event.client.moveEnabled())&&i.left){DayPilot.Global.moving=this,(DayPilot.Global.moving.helper={}).oldColumn=s.$4R[this.event.part.dayIndex].id,t.originalMouse=DayPilot.mc(e),t.originalTop=this.offsetTop;var n=DayPilot.mo3(this,e);t.moveOffsetY=n?n.y:0,s.nav.top.style.cursor=this.style.cursor}}else DayPilot.Global.resizing=this,t.originalMouse=DayPilot.mc(e),t.originalHeight=this.offsetHeight,t.originalTop=this.offsetTop,s.nav.top.style.cursor=this.style.cursor;return!1}},this.$6M=function(e){var t=this.$45.events,i=this.events.list[e],n={};for(var a in i)n[a]=i[a];if(s.showEventStartEnd){var o=i.start.getDatePart().getTime()===i.end.getDatePart().getTime()?l.locale().timePattern:l.locale().dateTimePattern,r=i.start.toString(o),d=i.end.toString(o);n.html=n.text+" ("+r+" - "+d+")"}if("function"==typeof this.onBeforeEventRender){var h={};h.e=n,this.onBeforeEventRender(h)}t[e]=n},this.$65={};var o=s.$65;o.active=!1,o.start=null,o.timeout=null,o.startcell=null,this.$65.getCellCoords=function(e){var t,i;e.touches?(t=e.touches[0].pageX,i=e.touches[0].pageY):(t=e.pageX,i=e.pageY);var n=DayPilot.abs(s.nav.main),a=t-n.x,o=i-n.y,l=s.nav.main.clientWidth/s.$4R.length;return{pageX:t,pageY:i,x:Math.floor(a/l),y:Math.floor(o/s.cellHeight),toString:function(){return"x: "+this.x+" y:"+this.y}}},this.$65.startSelecting=function(e){var i=s.nav.main.rows[e.y].cells[e.x];o.startcell=e,s.clearSelection(),t.column=t.getColumn(i),s.selectedCells.push(i),t.firstSelected=i,t.topSelectedCell=i,t.bottomSelectedCell=i,s.$5u()},this.$65.extendSelection=function(e){var i=s.nav.main.rows[e.y].cells[e.x];s.clearSelection(),e.y<o.startcell.y?(s.selectedCells=t.getCellsBelow(i),t.topSelectedCell=s.selectedCells[0],t.bottomSelectedCell=t.firstSelected):(s.selectedCells=t.getCellsAbove(i),t.topSelectedCell=t.firstSelected,t.bottomSelectedCell=s.selectedCells[0]),s.$5u()},this.$65.onMainTouchStart=function(e){if(!DayPilot.Util.isMouseEvent(e)&&!o.active){o.using=!0;var t=o.getCellCoords(e);o.startCoords=t;var i=s.tapAndHoldTimeout;o.timeout=window.setTimeout(function(){switch(e.preventDefault(),o.active=!0,s.timeRangeTapAndHoldHandling){case"Select":o.startSelecting(t);break;case"ContextMenu":o.startSelecting(t),o.active=!1,s.contextMenuSelection&&s.contextMenuSelection.show(s.getSelection())}},i)}},this.$65.onCellTouchMove=function(e){},this.$65.onCellTouchEnd=function(e){if(o.active){e.preventDefault(),o.startcell=null;var t=s.getSelection();t.toString=function(){return"start: "+this.start+"\nend: "+this.end},s.$5o(t.start,t.end,t.resource),window.setTimeout(function(){o.active=!1},500)}else window.clearTimeout(o.timeout)},this.$65.startMoving=function(e,i){DayPilot.Global.moving=e,(DayPilot.Global.moving.helper={}).oldColumn=s.$4R[e.event.part.dayIndex].id,t.originalMouse=i,t.originalTop=this.offsetTop;var n=DayPilot.abs(e);t.moveOffsetY=i.y-n.y,t.movingShadow||(t.movingShadow=s.$4Q(DayPilot.Global.moving,!s.$49.ie,s.shadow),t.movingShadow.style.width=t.movingShadow.parentNode.offsetWidth+1+"px")},this.$65.updateMoving=function(){var e=s.coords,i=s.cellHeight,n=t.moveOffsetY;n||(n=i/2);var a=Math.floor((e.y-n-0+i/2)/i)*i+0;a<0&&(a=0);var o=s.nav.main,l=o.clientHeight,r=parseInt(t.movingShadow.style.height);a+r>l&&(a=l-r),t.movingShadow.style.top=a+"px";var d=o.clientWidth/o.rows[0].cells.length,h=Math.floor(e.x/d);h<0&&(h=0);var c=s.nav.events;h<c.rows[0].cells.length&&h>=0&&t.movingShadow.column!==h&&(t.movingShadow.column=h,t.moveShadow(c.rows[0].cells[h]))},this.$65.onEventTouchStart=function(e){if(!o.active&&!DayPilot.Util.isMouseEvent(e)){e.stopPropagation(),o.preventEventTap=!1,o.using=!0,o.startCoords=o.getCellCoords(e);var t=this,i={x:e.touches?e.touches[0].pageX:e.pageX,y:e.touches?e.touches[0].pageY:e.pageY,$d:this};s.coords=o.relativeCoords(e);var n=s.tapAndHoldTimeout;o.timeout=window.setTimeout(function(){switch(o.active=!0,s.eventTapAndHoldHandling){case"Move":o.startMoving(t,i);break;case"ContextMenu":var n=t.event,a=n.client.contextMenu();DayPilot.Menu&&DayPilot.Menu.touchPosition(e),a?a.show(n):s.contextMenu&&s.contextMenu.show(n)}},n)}},this.$65.onMainTouchMove=function(e){if(!DayPilot.Util.isMouseEvent(e)){if(o.timeout)(i=o.getCellCoords(e))&&o.startCoords&&(i.pageX===o.startCoords.pageX&&i.pageY===o.startCoords.pageY||window.clearTimeout(s.$65.timeout));if(DayPilot.Global.moving&&t.movingShadow)return e.preventDefault(),s.coords=o.relativeCoords(e),void o.updateMoving();if(o.startcell){if(e.preventDefault(),!o.active)return void window.clearTimeout(o.timeout);var i=o.getCellCoords(e);o.extendSelection(i)}o.preventEventTap=!0}},this.$65.relativeCoords=function(e){var t=s.nav.main,i=e.touches?e.touches[0].pageX:e.pageX,n=e.touches?e.touches[0].pageY:e.pageY,a=DayPilot.abs(t);return{x:i-a.x,y:n-a.y,toString:function(){return"x: "+this.x+", y:"+this.y}}},this.$65.onMainTouchEnd=function(e){if(!DayPilot.Util.isMouseEvent(e))if(DayPilot.Global.moving){o.active=!1,e.preventDefault(),e.stopPropagation();var i=t.movingShadow.offsetTop;t.deleteShadow(t.movingShadow);var n=DayPilot.Global.moving.event,a=t.movingShadow.column;DayPilot.Global.moving=null,t.movingShadow=null,n.calendar.$5h(n,a,i,e,t.drag)}else if(o.startcell){if(!o.active)return void window.clearTimeout(o.timeout);e.preventDefault(),o.startcell=null;var l=s.getSelection();l.toString=function(){return"start: "+this.start+"\nend: "+this.end},s.$5o(l.start,l.end,l.resource),window.setTimeout(function(){o.active=!1},500)}},this.$65.onEventTouchMove=function(e){o.preventEventTap=!0},this.$65.onEventTouchEnd=function(e){if(!DayPilot.Util.isMouseEvent(e)){if(!o.active){if(o.preventEventTap)return;return e.preventDefault(),window.clearTimeout(o.timeout),void s.$54(this,!1)}o.active=!1,o.timeout?window.clearTimeout(o.timeout):e.preventDefault()}},this.$62=function(e){var i=Math.max(s.durationBarWidth,10),n="Top"===s.moveBy;if(void 0!==t){var a=DayPilot.mo3(this,e);if(a){var o=this;if(!o.active){var l=[];o.event.client.deleteEnabled()&&l.push({action:"JavaScript",v:"Hover",w:17,h:17,top:2,right:2,css:s.$4S("_event_delete"),js:function(e){s.$5c(e)}});var r=o.event.cache?o.event.cache.areas:o.event.data.areas;r&&r.length>0&&(l=l.concat(r)),DayPilot.Areas.showAreas(o,o.event,null,l),s.cssOnly&&DayPilot.Util.addClass(o,s.$4S("_event_hover"))}if(!DayPilot.Global.resizing&&!DayPilot.Global.moving){var d=this.isFirst,h=this.isLast;if("Disabled"!==s.moveBy&&"None"!==s.moveBy)if(!n&&a.x<=i&&this.event.client.moveEnabled()?this.style.cursor=d?"move":"not-allowed":!n&&a.y<=5&&this.event.client.resizeEnabled()?d?(this.style.cursor="n-resize",this.dpBorder="top"):this.style.cursor="not-allowed":n&&a.y<=i&&this.event.client.moveEnabled()?this.style.cursor="move":this.offsetHeight-a.y<=5&&this.event.client.resizeEnabled()?h?(this.style.cursor="s-resize",this.dpBorder="bottom"):this.style.cursor="not-allowed":DayPilot.Global.resizing||DayPilot.Global.moving||(this.event.client.clickEnabled()?this.style.cursor="pointer":this.style.cursor="default"),void 0!==DayPilotBubble&&s.bubble&&"Disabled"!==s.eventHoverHandling)if("default"===this.style.cursor||"pointer"===this.style.cursor)this.$6N&&a.x===this.$6N.x&&a.y===this.$6N.y||(this.$6N=a,s.bubble.showEvent(this.event))}}}},this.$63=function(e){s.cssOnly&&DayPilot.Util.removeClass(this,s.$4S("_event_hover")),s.bubble&&s.bubble.hideOnMouseOut(),DayPilot.Areas.hideAreas(this,e)},this.$6O=null,this.$4J=function(){if(this.showCurrentTime&&(this.$6P(),this.$6Q(new DayPilot.Date),this.nav.events&&!this.$6O)){this.$6O=setTimeout(function(){s.$6O=null,s.$4J()},3e4)}},this.$6P=function(){DayPilot.de(s.elements.separators),s.elements.separators=[]},this.$6Q=function(e){var t=e.getTime(),i=s.nav.events;if(i)for(var n=0;n<s.$4R.length;n++){var a=s.$4R[n],o=s.$4U(!0),l=new DayPilot.Date(a.start).addHours(this.$4Y(!0)),r=l.getTime(),d=l.addTime(o).getTime();if(r<=t&&t<=d){var h=this.$6R(e,a.start).top-1,c=i.rows[0].cells[n].separators,u=document.createElement("div");u.style.position="absolute",u.style.top=h+"px",u.style.height="1px",u.style.left="0px",u.style.right="0px",u.className=s.$4S("_now"),c.insertBefore(u,c.firstChild),s.elements.separators.push(u)}}},this.$4z=function(e){if(e?this.events.list=e:e=this.events.list,e){this.$5Z={},this.$5Z.events=[],this.$5Z.lines=[];var t=e.length,i=this.$4U(!0);this.$45.pixels={};var n=[];this.$5B=[],this.$5e=1e4,this.$4X=0,this.startDate=new DayPilot.Date(this.startDate);for(var a=0;a<t;a++){(M=e[a]).start=new DayPilot.Date(M.start),M.end=new DayPilot.Date(M.end)}if("function"==typeof this.onBeforeEventRender||s.showEventStartEnd)for(a=0;a<t;a++)this.$6M(a);var o="Resources"===this.viewType,r=this.$5X(),d=r.start,h=r.end;for(a=0;a<this.$4R.length;a++){var c={minEnd:1e6,maxStart:-1};this.$5B.push(c),(T=this.$4R[a]).events=[],T.lines=[],T.blocks=[];var u=new DayPilot.Date(T.start).addHours(this.$4Y(!0)),f=u.getTime(),v=u.addTime(i),p=v.getTime();o&&(d=u.getDatePart(),h=v.getDatePart());for(var y=0;y<t;y++)if(!n[y]){var g=(M=e[y]).start,m=M.end,b=g.getTime(),w=m.getTime();if(!(w<b))if(M.allday){var $=!1;$="Date"===s.allDayEnd?!(w<d.getTime()||b>=h.getTime()):!(w<=d.getTime()||b>=h.getTime()),o&&($=$&&(M.resource===T.id||"*"===T.id)),$&&((D=new DayPilot.Event(M,this)).part.start=d.getTime()<b?g:d,D.part.end=h.getTime()>w?m:h,D.part.colStart=DayPilot.Date.daysDiff(d.d,D.part.start.d),D.part.colWidth=DayPilot.Date.daysSpan(D.part.start.d,D.part.end.d)+1,o&&(D.part.colStart=a,D.part.colWidth=1),this.$5Z.events.push(D),("function"==typeof this.onBeforeEventRender||s.showEventStartEnd)&&(D.cache=this.$45.events[y]),n[y]=!0,!o||D.part.start.getTime()===b&&D.part.end.getTime()===w||(n[y]=!1))}else{$=!1;if($=o?T.id===M.resource&&!(w<=f||b>=p):!(w<=f||b>=p)||w===b&&b===f){var D;(D=new DayPilot.Event(M,s)).part.dayIndex=a,D.part.start=f<b?g:u,D.part.end=p>w?m:v;var k=this.$6R(D.part.start,T.start),C=this.$6R(D.part.end,T.start),x=k.top,P=C.top;if(x===P&&(k.cut||C.cut))continue;D.part.box=l.useBox(w-b);if(D.part.box){var S=C.boxBottom;D.part.top=Math.floor(x/this.cellHeight)*this.cellHeight+0,D.part.height=Math.max(Math.ceil(S/this.cellHeight)*this.cellHeight-D.part.top,this.cellHeight-1),D.part.barTop=Math.max(x-D.part.top-1,0),D.part.barHeight=Math.max(P-x-2,1)}else D.part.top=x+0,D.part.height=Math.max(P-x,0),D.part.barTop=0,D.part.barHeight=Math.max(P-x-2,1);g=D.part.top,m=D.part.top+D.part.height;g>c.maxStart&&(c.maxStart=g),m<c.minEnd&&(c.minEnd=m),g<this.$5e&&(this.$5e=g),m>this.$4X&&(this.$4X=m),T.events.push(D),("function"==typeof this.onBeforeEventRender||s.showEventStartEnd)&&(D.cache=this.$45.events[y]),D.part.start.getTime()===b&&D.part.end.getTime()===w&&(n[y]=!0)}}}}for(a=0;a<this.$4R.length;a++){var T;(T=this.$4R[a]).events.sort(this.$6S);for(y=0;y<T.events.length;y++){var M=T.events[y];T.putIntoBlock(M)}for(y=0;y<T.blocks.length;y++){var H=T.blocks[y];H.events.sort(this.$6T);for(var A=0;A<H.events.length;A++){M=H.events[A];H.putIntoLine(M)}}}this.$5Z.events.sort(this.$6T),this.$5Z.putIntoLine=function(e){for(var t=0;t<this.lines.length;t++){if((i=this.lines[t]).isFree(e.part.colStart,e.part.colWidth))return i.push(e),t}var i;return(i=[]).isFree=function(e,t){for(var i=e+t-1,n=this.length,a=0;a<n;a++){var s=this[a];if(!(i<s.part.colStart||e>s.part.colStart+s.part.colWidth-1))return!1}return!0},i.push(e),this.lines.push(i),this.lines.length-1};for(a=0;a<this.$5Z.events.length;a++){M=this.$5Z.events[a];this.$5Z.putIntoLine(M)}var E=Math.max(this.$5Z.lines.length,1);this.$45.allDayHeaderHeight=E*(l.allDayEventHeight()+2)+2}},this.$6S=function(e,t){if(!(e&&t&&e.start&&t.start))return 0;var i=e.start().ticks-t.start().ticks;return 0!==i?i:t.end().ticks-e.end().ticks},this.$6T=function(e,t){if(!e||!t)return 0;if(!(e.data&&t.data&&e.data.sort&&t.data.sort&&0!==e.data.sort.length&&0!==t.data.sort.length))return s.$6S(e,t);for(var i=0,n=0;0===i&&e.data.sort[n]&&t.data.sort[n];)i=e.data.sort[n]===t.data.sort[n]?0:s.$6U(e.data.sort[n],t.data.sort[n],s.sortDirections[n]),n++;return i},this.$6U=function(e,t,i){var n="desc"!==i?-1:1,a=-n;if(null===e&&null===t)return 0;if(null===t)return a;if(null===e)return n;var s=[];return s[0]=e,s[1]=t,s.sort(),e===s[0]?n:a},this.$6V=function(e){for(var t=0;t<s.elements.events.length;t++){var i=s.elements.events[t];if(i.event===e||i.event.data===e.data)return i}return null},this.events.find=function(e){if(!s.events.list||void 0===s.events.list.length)return null;for(var t=s.events.list.length,i=0;i<t;i++)if(s.events.list[i].id===e)return new DayPilot.Event(s.events.list[i],s);return null},this.events.findRecurrent=function(e,t){if(!s.events.list||void 0===s.events.list.length)return null;for(var i=s.events.list.length,n=0;n<i;n++)if(s.events.list[n].recurrentMasterId===e&&s.events.list[n].start.getTime()===t.getTime())return new DayPilot.Event(s.events.list[n],s);return null},this.events.update=function(e,t){var i={};i.oldEvent=new DayPilot.Event(e.copy(),s),i.newEvent=new DayPilot.Event(e.temp(),s);var n=new DayPilot.Action(s,"EventUpdate",i,t);return e.commit(),s.$48&&s.update(),s.$6W.notify(),n},this.events.remove=function(e,t){var i={};i.e=new DayPilot.Event(e.data,s);var n=new DayPilot.Action(s,"EventRemove",i,t),a=DayPilot.indexOf(s.events.list,e.data);return s.events.list.splice(a,1),s.$48&&s.update(),s.$6W.notify(),n},this.events.add=function(e,t){e.calendar=s,s.events.list||(s.events.list=[]),s.events.list.push(e.data);var i={};i.e=e;var n=new DayPilot.Action(s,"EventAdd",i,t);return s.$48&&s.update(),s.$6W.notify(),n},this.queue={},this.queue.list=[],this.queue.list.ignoreToJSON=!0,this.queue.add=function(e){if(e){if(!e.isAction)throw"DayPilot.Action object required for queue.add()";s.queue.list.push(e)}},this.queue.notify=function(e){var t={};t.actions=s.queue.list,s.$4d("Notify",t,e,"Notify"),s.queue.list=[]},this.queue.clear=function(){s.queue.list=[]},this.queue.pop=function(){return s.queue.list.pop()},this.$6X=function(e){if(this.$48&&this.$4R){var t=!(e=e||{}).eventsOnly;s.cssOnly||(s.cssOnly=!0,DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0.")),t?(s.$4k(),this.$6Y(),this.$4x(),this.$4z(),s.$4B(),s.$4C(),s.$4D(),s.$4E(),s.$4a(),s.$4F(),s.$5u(),s.$4G(),s.$4H(),s.$4I(),s.$6e(),this.$4L(),this.$4M(),this.$4J(),s.$4N()):(s.$4k(),s.$4z(),s.$4A(),s.$4L(),s.$4M(),s.$4N()),this.visible?this.show():this.hide()}},this.update=function(){this.$6X()},this.show=function(){s.visible=!0,s.nav.top.style.display="",s.$4n(),s.$4I()},this.hide=function(){s.visible=!1,s.nav.top.style.display="none"},this.$6W={},this.$6W.scope=null,this.$6W.notify=function(){s.$6W.scope&&s.$6W.scope.$apply()},this.debug=new DayPilot.Debug(this),this.$6R=function(e,t){t||(t=this.startDate);var i=t.getTime(),n=e.getTime(),a=this.$45.pixels[n+"_"+i];if(a)return a;i=t.addHours(this.$4Y(!0)).getTime();var s=60*this.cellDuration*1e3,o=n-i,l=o%s,r=o-l,d=r+s;0===l&&(d=r);var h={cut:!1};return h.top=this.$6Z(o),h.boxTop=this.$6Z(r),h.boxBottom=this.$6Z(d),this.$45.pixels[n+"_"+i]=h,h},this.$6Z=function(e){return Math.floor(this.cellHeight*e/(6e4*this.cellDuration))},this.$6Y=function(){this.startDate=new DayPilot.Date(this.startDate).getDatePart(),this.allDayHeaderHeight=l.allDayEventHeight()+4},this.$4A=function(){var e=this.$4Z(),t=this.$68();if(this.nav.corner&&(this.nav.corner.style.height=e+"px"),this.nav.cornerRight&&(this.nav.cornerRight.style.height=e+"px"),this.nav.mid&&(this.nav.mid.style.height=e+"px"),this.showAllDayEvents&&this.nav.header)for(var i=this.nav.header.rows[this.nav.header.rows.length-1],n=0;n<i.cells.length;n++){i.cells[n].firstChild.style.height=l.allDayHeaderHeight()+"px"}this.nav.upperRight&&(this.nav.upperRight.style.height=e+"px"),this.nav.scroll.style.top=e+"px",this.nav.top.style.height=t+"px"},this.$4H=function(){var e=this.$69();this.nav.scroll&&e>0&&(this.nav.scroll.style.height=e+"px",this.scrollHeight=s.nav.scroll.clientHeight,this.nav.bottomLeft&&(this.nav.bottomLeft.style.height=e+"px"),this.nav.bottomRight&&(this.nav.bottomRight.style.height=e+"px")),"Parent100Pct"===this.heightSpec?this.nav.top.style.height="100%":this.nav.top.style.height=this.$68()+"px"},this.setHeight=function(e){"Parent100Pct"!==this.heightSpec&&(this.heightSpec="Fixed"),this.cssOnly?this.height=e-this.$4Z():this.height=e-(this.$4Z()+3),this.$4H()},this.$70=function(e){var t=document.createElement("div");t.style.position="absolute",t.style.top="-2000px",t.style.left="-2000px",t.className=this.$4S(e),document.body.appendChild(t);var i=t.offsetHeight,n=t.offsetWidth;document.body.removeChild(t);var a={};return a.height=i,a.width=n,a},this.$60={};var l=this.$60;l.locale=function(){return DayPilot.Locale.find(s.locale)},l.weekStarts=function(){return void 0!==s.weekStarts?s.weekStarts:l.locale().weekStarts},l.timeFormat=function(){return"Auto"!==s.timeFormat?s.timeFormat:this.locale().timeFormat},l.useBox=function(e){return"Always"===s.useEventBoxes||"Never"!==s.useEventBoxes&&e<60*s.cellDuration*1e3},l.notifyType=function(){var e;if("Immediate"===s.notifyCommit)e="Notify";else{if("Queue"!==s.notifyCommit)throw"Invalid notifyCommit value: "+s.notifyCommit;e="Queue"}return e},l.allDayEventHeight=function(){if(s.$45.allDayEventHeight)return s.$45.allDayEventHeight;var e=s.$70("_alldayevent_height").height;return e||(e=s.allDayEventHeight),s.$45.allDayEventHeight=e,e},l.allDayHeaderHeight=function(){if(s.$45.allDayHeaderHeight)return s.$45.allDayHeaderHeight;var e=s.allDayHeaderHeight;return s.$45.allDayHeaderHeight=e,e},l.headerHeight=function(){if(s.$45.headerHeight)return s.$45.headerHeight;var e=s.$70("_header_height").height;return e||(e=s.headerHeight),s.$45.headerHeight=e,e},this.$71=function(){return!!this.backendUrl&&(void 0===s.events.list||!s.events.list)},this.$72=function(){if(this.id&&this.id.tagName)this.nav.top=this.id;else{if("string"!=typeof this.id)throw"DayPilot.Calendar() constructor requires the target element or its ID as a parameter";if(this.nav.top=document.getElementById(this.id),!this.nav.top)throw"DayPilot.Calendar: The placeholder element not found: '"+e+"'."}},this.$73=function(){this.$72(),this.$6Y(),this.$4x(),this.$6a(),this.$4B(),this.$4C(),this.$4F(),this.$4I(),this.$6G(),this.$6L(),this.$4o(),t.register(this),this.$4n(),this.$4J(),this.$6I(),this.$4O(),this.$4d("Init")},this.init=function(){if(this.$72(),!this.nav.top.dp){var e=this.$71();if(s.cssOnly||(s.cssOnly=!0,DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0.")),e)return this.$73(),void(this.$48=!0);this.$6Y(),this.$4x(),this.$4y(),this.events.list&&this.$4z(),this.$6a(),this.$4B(),this.$4C(),this.$4F(),this.$4K(),this.$6e(),this.$4I(),this.$6G(),this.$6L(),this.$4o(),t.register(this),this.events.list&&(this.$4A(),this.$4L(),this.$4M()),this.$4n(),this.messageHTML&&this.message(this.messageHTML),this.$4J(),this.$4v(null,!1),this.$6I(),this.$4O(),this.$48=!0,this.$74()}},this.$75=null,this.$76=function(e){var t={events:{preInit:function(){var e=this.data;e&&(DayPilot.isArray(e.list)?s.events.list=e.list:s.events.list=e)}},scrollToHour:{postInit:function(){void 0!==this.data&&s.scrollToHour(this.data)}}};for(var i in this.$75=t,e)if(t[i]){var n=t[i];n.data=e[i],n.preInit&&n.preInit()}else s[i]=e[i]},this.$74=function(){var e=this.$75;for(var t in e){var i=e[t];i.postInit&&i.postInit()}},this.internal={},this.internal.initialized=function(){return s.$48},this.internal.invokeEvent=this.$5d,this.internal.eventMenuClick=this.$5m,this.internal.timeRangeMenuClick=this.$5n,this.internal.bubbleCallBack=this.$5k,this.internal.findEventDiv=this.$6V,this.internal.eventDeleteDispatch=this.$5c,this.internal.touch=this.$65,this.Init=this.init,this.$76(i)};var e,t={};t.topSelectedCell=null,t.bottomSelectedCell=null,t.selecting=!1,t.column=null,t.firstSelected=null,t.firstMousePos=null,t.originalMouse=null,t.originalHeight=null,t.originalTop=null,t.globalHandlers=!1,t.editing=!1,t.originalText=null,t.register=function(e){t.registered||(t.registered=[]);for(var i=t.registered,n=0;n<i.length;n++)if(i[n]===e)return;i.push(e)},t.unregister=function(e){var i=t.registered;if(i){var n=DayPilot.indexOf(i,e);-1!==n&&i.splice(n,1),0===i.length&&(i=null)}i||(DayPilot.ue(document,"mousemove",t.gMouseMove),DayPilot.ue(document,"mouseup",t.gMouseUp),DayPilot.ue(document,"touchmove",t.gTouchMove),DayPilot.ue(document,"touchend",t.gTouchEnd),t.globalHandlers=!1)},t.getCellsAbove=function(e){for(var i=[],n=t.getColumn(e),a=e.parentNode,s=null;a&&s!==t.firstSelected;)for(s=a.getElementsByTagName("td")[n],i.push(s),a=a.previousSibling;a&&"TR"!==a.tagName;)a=a.previousSibling;return i},t.getCellsBelow=function(e){for(var i=[],n=t.getColumn(e),a=e.parentNode,s=null;a&&s!==t.firstSelected;)for(s=a.getElementsByTagName("td")[n],i.push(s),a=a.nextSibling;a&&"TR"!==a.tagName;)a=a.nextSibling;return i},t.getColumn=function(e){for(var t=0;e.previousSibling;)"TD"===(e=e.previousSibling).tagName&&t++;return t},t.getShadowColumn=function(e){if(!e)return null;for(var t=e.parentNode;t&&"TD"!==t.tagName;)t=t.parentNode;return t},t.gTouchMove=function(e){if(!DayPilot.Util.isMouseEvent(e)&&t.drag){e.preventDefault();var i=e.touches?e.touches[0].pageX:e.pageX,n=e.touches?e.touches[0].pageY:e.pageY,a={};a.x=i,a.y=n;var s=function(){for(var t=e.touches?e.touches[0].clientX:e.clientX,i=e.touches?e.touches[0].clientY:e.clientY,n=document.elementFromPoint(t,i);n&&n.parentNode;)if((n=n.parentNode).daypilotMainD)return n.calendar;return!1}();if(s){if(t.gShadow&&document.body.removeChild(t.gShadow),t.gShadow=null,s.coords=s.$65.relativeCoords(e),!t.movingShadow&&s.coords)if(r=s.$4Q(t.drag,!1,t.drag.shadowType)){t.movingShadow=r;var o=(new DayPilot.Date).getDatePart(),l=(e={value:t.drag.id,start:o,end:o.addSeconds(t.drag.duration),text:t.drag.text},new DayPilot.Event(e,s));l.external=!0,DayPilot.Global.moving={},DayPilot.Global.moving.event=l,DayPilot.Global.moving.helper={}}DayPilot.Global.moving&&s.$65.updateMoving()}else{var r;DayPilot.de(t.movingShadow),DayPilot.Global.moving=null,t.movingShadow=null,t.gShadow||(t.gShadow=t.createGShadow(t.drag.shadowType)),(r=t.gShadow).style.left=a.x+"px",r.style.top=a.y+"px"}}},t.gTouchEnd=function(e){DayPilot.Util.isMouseEvent(e)||t.gMouseUp(e)},t.gMouseMove=function(e){if(void 0!==t&&!(e.insideMainD||e.srcElement&&e.srcElement.inside)){var i=DayPilot.mc(e);if(t.drag){document.body.style.cursor="move",t.gShadow||(t.gShadow=t.createGShadow(t.drag.shadowType));var n=t.gShadow;n.style.left=i.x+"px",n.style.top=i.y+"px",DayPilot.Global.moving=null,t.deleteShadow(t.movingShadow),t.movingShadow=null}for(var a=0;a<t.registered.length;a++)t.registered[a].$4q&&t.registered[a].$4q()}},t.gUnload=function(e){if(t.registered)for(var i=t.registered,n=0;n<i.length;n++){var a=i[n];t.unregister(a)}},t.gMouseUp=function(e){e=e||window.event;if(DayPilot.Global.resizing){if(!t.resizingShadow)return DayPilot.Global.resizing.style.cursor="default",DayPilot.Global.resizing.event.calendar.nav.top.style.cursor="auto",void(DayPilot.Global.resizing=null);var i=DayPilot.Global.resizing.event,n=DayPilot.Global.resizing.dpBorder,a=t.resizingShadow.clientHeight,s=t.resizingShadow.offsetTop;if(t.deleteShadow(t.resizingShadow),t.resizingShadow=null,DayPilot.Global.resizing.style.cursor="default",i.calendar.nav.top.style.cursor="auto",DayPilot.Global.resizing.onclick=null,DayPilot.Global.resizing=null,i.calendar.overlap)return;i.calendar.$5f(i,a,s,n)}else if(DayPilot.Global.moving){if(!DayPilot.Global.moving.helper)return t.deleteShadow(t.movingShadow),DayPilot.Global.moving=null,void(t.movingShadow=null);if(!t.movingShadow)return DayPilot.Global.moving.event.calendar.nav.top.style.cursor="auto",void(DayPilot.Global.moving=null);DayPilot.Global.moving.helper.oldColumn,s=t.movingShadow.offsetTop;t.deleteShadow(t.movingShadow);i=DayPilot.Global.moving.event;var o=t.movingShadow.column,l=t.drag;if(DayPilot.Global.moving.event.calendar.nav.top.style.cursor="auto",DayPilot.Global.moving=null,t.movingShadow=null,l&&(i.calendar.todo||(i.calendar.todo={}),i.calendar.todo.del=l.element),i.calendar.overlap)return;var r=e||window.event;i.calendar.$5h(i,o,s,r,l)}t.drag&&(t.drag=null,document.body.style.cursor=""),t.gShadow&&(document.body.removeChild(t.gShadow),t.gShadow=null),t.moveOffsetY=null},t.dragStart=function(e,i,n,a,s){DayPilot.us(e);var o=t.drag={};return o.element=e,o.duration=i,o.text=a,o.id=n,o.shadowType=s||"Fill",!1},DayPilot.Calendar.makeDraggable=function(e){var i=e.element,n=e.keepElement?null:i,a=e.duration||1;navigator.msPointerEnabled&&(i.style.msTouchAction="none",i.style.touchAction="none"),DayPilot.us(i),DayPilot.re(i,"mousedown",function(i){t.dragStart(n,a,e.id,e.text);var s=i.target||i.srcElement;if(s.tagName){var o=s.tagName.toLowerCase();if("textarea"===o||"select"===o||"input"===o)return!1}return i.preventDefault&&i.preventDefault(),!1});DayPilot.re(i,DayPilot.touch.start,function(i){DayPilot.Util.isMouseEvent(i)||(window.setTimeout(function(){var s=t.drag={};s.element=n,s.id=e.id,s.text=e.text||"",s.duration=a,s.shadowType="Fill",t.gTouchMove(i),i.preventDefault()},0),i.preventDefault())})},t.deleteShadow=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},t.createGShadow=function(e){var t=document.createElement("div");return t.setAttribute("unselectable","on"),t.style.position="absolute",t.style.width="100px",t.style.height="20px",t.style.border="2px dotted #666666",t.style.zIndex=101,t.style.pointerEvents="none","Fill"===e&&(t.style.backgroundColor="#aaaaaa",t.style.opacity=.5,t.style.filter="alpha(opacity=50)",t.style.border="2px solid #aaaaaa"),document.body.appendChild(t),t},t.moveShadow=function(e){var i=t.movingShadow;i.parentNode&&i.parentNode.removeChild(i),e.firstChild.appendChild(i),i.style.left="0px",i.style.width=t.movingShadow.parentNode.offsetWidth+"px"},t.Column=function(e,t,i){this.value=e,this.id=e,this.name=t,this.date=new DayPilot.Date(i)},DayPilot.CalendarVisible.dragStart=t.dragStart,DayPilot.CalendarVisible.Calendar=t.Calendar,"undefined"!=typeof jQuery&&(jQuery.fn.daypilotCalendar=function(e){var t=null,i=this.each(function(){if(!this.daypilot){var i=new DayPilot.Calendar(this.id,e);i.init(),this.daypilot=i,t||(t=i)}});return 1===this.length?t:i}),(e=DayPilot.am())&&e.directive("daypilotCalendar",function(){return{restrict:"E",template:"<div></div>",replace:!0,link:function(e,t,i){var n=new DayPilot.Calendar(t[0]);n.$6W.scope=e,n.init();var a=i.id;a&&(e[a]=n);var s=e.$watch;s.call(e,i.daypilotConfig,function(e){for(var t in e)n[t]=e[t];n.update()}),s.call(e,i.daypilotEvents,function(e){n.events.list=e,n.$6X({eventsOnly:!0})},!0)}}}),"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),void 0===DayPilot)var DayPilot={};if(void 0===DayPilot.Global&&(DayPilot.Global={}),void 0===DayPilot.DatePicker&&(DayPilot.DatePicker=function(e){this.v="1659";var t="navigator_"+(new Date).getTime(),i=this;this.onShow=null,this.prepare=function(){if(this.locale="en-us",this.target=null,this.resetTarget=!0,this.pattern=this.$m.locale().datePattern,this.theme=null,this.patterns=[],e)for(var t in e)this[t]=e[t];this.init()},this.init=function(){this.date=new DayPilot.Date(this.date);var e=this.$n();this.resetTarget&&!e&&this.$o(this.date),DayPilot.re(document,"mousedown",function(){i.close()})},this.close=function(){this.$p&&(this.navigator&&this.navigator.dispose(),this.div.innerHTML="",this.div&&this.div.parentNode===document.body&&document.body.removeChild(this.div))},this.$n=function(){var e=this.$q();if(!e)return this.date;var t=null;if(!(t="INPUT"===e.tagName?e.value:e.innerText))return null;for(var n=DayPilot.Date.parse(t,i.pattern),a=0;a<i.patterns.length;a++){if(n)return n;n=DayPilot.Date.parse(t,i.patterns[a])}return n},this.$o=function(e){var t=this.$q();if(t){var n=e.toString(i.pattern,i.locale);"INPUT"===t.tagName?t.value=n:t.innerHTML=n}},this.$m={},this.$m.locale=function(){return DayPilot.Locale.find(i.locale)},this.$q=function(){var e=this.target;return e&&e.nodeType&&1===e.nodeType?e:document.getElementById(e)},this.show=function(){var e=this.$q(),n=this.navigator;(n=new DayPilot.Navigator(t)).api=2,n.cssOnly=!0,n.theme=i.theme,n.weekStarts="Auto",n.locale=i.locale,n.onTimeRangeSelected=function(e){i.date=e.start;var t=e.start,n=t.toString(i.pattern,i.locale);(e={}).start=t,e.date=t,e.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof i.onTimeRangeSelect&&(i.onTimeRangeSelect(e),e.preventDefault.value)||(i.$o(n),i.close(),"function"==typeof i.onTimeRangeSelected&&i.onTimeRangeSelected(e))},this.navigator=n;var a=DayPilot.abs(e),s=e.offsetHeight,o=document.createElement("div");o.style.position="absolute",o.style.left=a.x+"px",o.style.top=a.y+s+"px";var l=document.createElement("div");l.id=t,o.appendChild(l),DayPilot.re(o,"mousedown",function(e){(e=e||window.event).cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}),document.body.appendChild(o),this.div=o;var r=i.$n()||(new DayPilot.Date).getDatePart();n.startDate=r,n.selectionStart=r,n.init(),this.$p=!0,this.onShow&&this.onShow()},this.prepare()}),void 0===DayPilot)var DayPilot={};if(void 0===DayPilot.Global&&(DayPilot.Global={}),function(){if(void 0===DayPilot.Gantt){var e;DayPilot.Gantt=function(e,t){this.v="1659";var i=this;this.id=e,this.isGantt=!0;var n=new DayPilot.Scheduler(e);this.scheduler=n,n.viewType="Resources",n.onCallBackHeader=function(e){e.header.taskGroupMode=i.taskGroupMode,e.header.rowHeaderColumns=i.columns,e.header.clientState=i.clientState},n.onGetNodeState=function(e){var t,i,a;e.result=(t=e.row,i=t.task,(a={}).start=i.start,a.end=i.end,a.id=i.id,a.complete=i.complete,a.text=i.text,a.type=i.type,a.expanded=t.expanded,a.loaded=t.loaded,a.tags=function(e){var t={};if(e.tags)for(var i in e.tags)t[i]=""+e.tags[i];return t}(i),a.children=n.internal.getNodeChildren(t.children),a),e.preventDefault()},n.onCallBackResult=function(e){var t=e.result;if(e.preventDefault(),"None"!==t.updateType){var a=function(e){for(var n=0;n<e.length;n++){var a=e[n];void 0!==t[a]&&(i[a]=t[a])}};i.links.list=t.links,i.tasks.list=t.tasks,i.startDate=new DayPilot.Date(t.startDate),a(["days","cellDuration","cellGroupBy","cellWidth","cellWidthSpec","cornerHtml","separators","rowMinHeight","rowMarginBottom","taskGroupMode"]),a(["cellProperties","cellConfig","timeHeader","timeHeaders","timeline","columns"]),o.translate(),o.$0d(),o.$0e(),n.update(),n.show()}},this.taskGroupMode="Auto",this.autoRefreshCommand="refresh",this.autoRefreshEnabled=!1,this.autoRefreshInterval=60,this.autoRefreshMaxCount=20,this.autoScroll="Drag",this.bubbleTask=null,this.bubbleCell=null,this.bubbleRow=null,this.cellDuration=1440,this.cellGroupBy="Month",this.cellWidth=40,this.cellWidthSpec="Fixed",this.completeBarVisible=!0,this.completeBarHeight=3,this.contextMenuTask=null,this.contextMenuRow=null,this.contextMenuLink=null,this.cornerHtml="",this.crosshairColor="Gray",this.crosshairOpacity=20,this.crosshairType="Header",this.doubleClickTimeout=300,this.progressiveTaskRendering="Progressive",this.progressiveTaskRenderingMargin=500,this.progressiveTaskRenderingCacheSweeping=!1,this.progressiveTaskRenderingCacheSize=200,this.floatingTasks=!0,this.floatingTimeHeaders=!0,this.headerHeight=20,this.height=300,this.heightSpec="Max",this.hideUntilInit=!1,this.linkBottomMargin=10,this.loadingLabelVisible=!0,this.loadingLabelText="Loading...",this.locale="en-us",this.messageBarPosition="Top",this.messageHideAfter=5e3,this.numberFormat=null,this.progressiveRowRendering=!0,this.progressiveRowRenderingPreload=25,this.rowHeaderScrolling=!1,this.rowHeaderSplitterWidth=3,this.rowHeaderHideIconEnabled=!0,this.rowHeaderWidth=80,this.rowHeaderWidthAutoFit=!0,this.rowMarginBottom=4,this.rowMinHeight=0,this.scrollDelayTasks=200,this.scrollDelayCells=20,this.scrollDelayFloats=0,this.scale="Day",this.snapToGrid=!0,this.syncTasks=!0,this.syncLinks=!0,this.tapAndHoldTimeout=500,this.taskHeight=24,this.taskResizeMargin=5,this.taskMovingStartEndEnabled=!1,this.taskMovingStartEndFormat="MMMM d, yyyy",this.taskResizingStartEndEnabled=!1,this.taskResizingStartEndFormat="MMMM d, yyyy",this.theme="gantt_default",this.treeAutoExpand=!0,this.treeIndent=20,this.treeImageMarginLeft=5,this.treeImageMarginTop=5,this.timeline=null,this.timeHeaders=[{groupBy:"Month",format:"MMMM yyyy"},{groupBy:"Day",format:"d"}],this.useEventBoxes="Never",this.visible=!0,this.taskMoveHandling="Update",this.taskClickHandling="Enabled",this.taskResizeHandling="Update",this.linkCreateHandling="Update",this.taskRightClickHandling="ContextMenu",this.taskDoubleClickHandling="Disabled",this.rowCreateHandling="Disabled",this.rowMoveHandling="Update",this.rowClickHandling="Disabled",this.rowDoubleClickHandling="Disabled",this.rowEditHandling="Update",this.rowSelectHandling="Update",this.separators=[],this.members={},this.members.obsolete=[],this.members.ignore=["members","scheduler","internal","cellProperties"],this.members.noCssOnly=[],this.links={},this.links.list=[],this.links.add=function(e){if(e){var t=e.isLink?e.data:e;i.links.list.push(t),i.$0f&&(o.$0e(),n.update()),i.$0g.notify()}},this.links.remove=function(e){if(e){var t;t=e.isLink?e.data:e;var a=DayPilot.indexOf(i.links.list,t);-1!==a&&(i.links.list.splice(a,1),i.$0f&&(o.$0e(),n.update()),i.$0g.notify())}},this.links.find=function(e){if(!DayPilot.isArray(i.links.list))return null;for(var t=0;t<i.links.list.length;t++){var n=i.links.list[t];if(n.id===e)return new DayPilot.Link(n,i)}return null},this.links.findFromTo=function(e,t){if(!DayPilot.isArray(i.links.list))return null;for(var n=0;n<i.links.list.length;n++){var a=i.links.list[n];if(a.from===e&&a.to===t)return new DayPilot.Link(a,i)}return null},this.$0h={};var a=this.$0h;a.timeout=null,a.update=function(){i.$0f&&(window.clearTimeout(a.timeout),a.timeout=setTimeout(function(){o.$0d(),n.update()},0))},this.tasks={},this.tasks.list=[],this.tasks.add=function(e){if(e){if(e instanceof DayPilot.Event)throw"DayPilot.Task object required. You have supplied DayPilot.Event.";var t=e.isTask?e.data:e;i.tasks.list.push(t),a.update(),i.$0g.notify()}},this.tasks.find=function(e){var t=s.findInCache(e);return t?new DayPilot.Task(t,i):null},this.tasks.update=function(e){if(e){if(!e.isTask)throw"DayPilot.Task object expected";e.commit(),a.update(),i.$0g.notify()}},this.tasks.remove=function(e){if(e){if(!e.isTask)throw"DayPilot.Task object expected";var t=s.findParentArray(e.data);if(t){var n=DayPilot.indexOf(t,e.data);t.splice(n,1),a.update(),i.$0g.notify()}}},this.visibleStart=function(){return n.visibleStart()},this.visibleEnd=function(){return n.visibleEnd()},this.onAfterRender=null,this.onBeforeRowHeaderRender=null,this.onBeforeTaskRender=null,this.onBeforeTimeHeaderRender=null,this.onBeforeCellRender=null,this.onTaskClick=null,this.onTaskClicked=null,this.onTaskDoubleClick=null,this.onTaskDoubleClicked=null,this.onTaskRightClick=null,this.onTaskRightClicked=null,this.onRowCreate=null,this.onRowCreated=null,this.onRowMove=null,this.onRowMoved=null,this.onRowMoving=null,this.onRowClick=null,this.onRowClicked=null,this.onRowDoubleClick=null,this.onRowDoubleClicked=null,this.onRowEdit=null,this.onRowEdited=null,this.onRowSelect=null,this.onRowSelected=null,this.onTaskMove=null,this.onTaskMoved=null,this.onTaskMoving=null,this.onTaskResize=null,this.onTaskResized=null,this.onTaskResizing=null,this.onLinkCreate=null,this.onLinkCreated=null,this.$0i=function(){return!!this.backendUrl||!("function"!=typeof WebForm_DoCallback||!this.uniqueID)},this.$0j=function(){if("string"==typeof i.startDate&&(i.startDate=new DayPilot.Date(i.startDate)),!i.startDate||!i.days){for(var e=null,t=null,a=0;a<i.tasks.list.length;a++){var s=i.tasks.list[a],o=new DayPilot.Date(s.start),l=new DayPilot.Date(s.end);(null===e||o.getTime()<e)&&(e=o.getTime()),(null===t||l.getTime()>t)&&(t=l.getTime())}if(e&&t){o=new DayPilot.Date(e).getDatePart(),l=new DayPilot.Date(t).getDatePart().addDays(1);n.startDate=i.startDate||o,n.days=i.days||DayPilot.Date.daysDiff(o,l)}else n.startDate=i.startDate,n.days=i.days}},this.commandCallBack=function(e,t){o.translate(),n.commandCallBack(e,t)},this.message=function(e,t,i,a){n.message(e,t,i,a)},this.setHeight=function(e){n.setHeight(e)},this.$0k=function(){return!!this.backendUrl&&(!DayPilot.isArray(i.tasks.list)||0==i.tasks.list.length)},this.init=function(){o.translate(),o.$0d(),o.$0e(),this.$0j(),n.init(),this.$0f=!0,this.$0l(),this.$0k()&&n.internal.callback("Init")},this.update=function(){o.translate(),o.$0d(),o.$0e(),i.$0j(),n.update()},this.scrollTo=function(e){n.scrollTo(e)},this.$0m={};var s=this.$0m;s.cache={},s.clearCache=function(){s.cache={}},s.addToCache=function(e,t){var i=e.id;if(i){var n={isTaskWrapper:!0};if(n.data=e,n.parent=t,s.cache[i])throw"Duplicate task id detected";s.cache[i]=n}},s.findInCache=function(e){return e?s.cache[e.toString()]:null},s.getProperty=function(e,t){return e.tags&&e.tags[t]?e.tags[t]:e[t]},s.findParentArray=function(e){return s.findInArray(i.tasks.list,e)},s.findInArray=function(e,t){if(-1!==DayPilot.indexOf(e,t))return e;for(var i=0;i<e.length;i++){var n=e[i];if(n.children&&n.children.length>0){var a=s.findInArray(n.children,t);if(a)return a}}return null},this.$0n={};var o=this.$0n;o.translate=function(){if(n.durationBarMode="PercentComplete",n.timeRangeSelectedHandling="Disabled",n.treeEnabled=!0,n.autoRefreshCommand=i.autoRefreshCommand,n.autoRefreshEnabled=i.autoRefreshEnabled,n.autoRefreshInterval=i.autoRefreshInterval,n.autoRefreshMaxCount=i.autoRefreshMaxCount,n.autoScroll=i.autoScroll,n.backendUrl=i.backendUrl,n.crosshairColor=i.crosshairColor,n.crosshairOpacity=i.crosshairOpacity,n.crosshairType=i.crosshairType,n.doubleClickTimeout=i.doubleClickTimeout,n.durationBarVisible=i.completeBarVisible,n.durationBarHeight=i.completeBarHeight,n.dynamicEventRendering=i.progressiveTaskRendering?"Progressive":"Disabled",n.dynamicEventRenderingMargin=i.progressiveTaskRenderingMargin,n.dynamicEventRenderingCacheSweeping=i.progressiveTaskRenderingCacheSweeping,n.dynamicEventRenderingCacheSize=i.progressiveTaskRenderingCacheSize,n.startDate=new DayPilot.Date(i.startDate),n.days=i.days,n.cellDuration=i.cellDuration,n.cellGroupBy=i.cellGroupBy,n.cellWidth=i.cellWidth,n.cellWidthSpec=i.cellWidthSpec,n.cornerHtml=i.cornerHtml,n.eventHeight=i.taskHeight,n.eventResizeMargin=i.taskResizeMargin,n.floatingEvents=i.floatingTasks,n.floatingTimeHeaders=i.floatingTimeHeaders,n.headerHeight=i.headerHeight,n.heightSpec=i.heightSpec,n.height=i.height,n.linkBottomMargin=i.linkBottomMargin,n.loadingLabelVisible=i.loadingLabelVisible,n.loadingLabelText=i.loadingLabelText,n.locale=i.locale,n.messageBarPosition=i.messageBarPosition,n.messageHideAfter=i.messageHideAfter,n.rowCreateHandling=i.rowCreateHandling,n.numberFormat=i.numberFormat,n.progressiveRowRendering=i.progressiveRowRendering,n.progressiveRowRenderingPreload=i.progressiveRowRenderingPreload,n.scale=i.scale,n.scrollDelayEvents=i.scrollDelayTasks,n.scrollDelayCells=i.scrollDelayCells,n.scrollDelayFloats=i.scrollDelayFloats,n.separators=i.separators,n.tapAndHoldTimeout=i.tapAndHoldTimeout,n.eventMovingStartEndEnabled=i.taskMovingStartEndEnabled,n.eventMovingStartEndFormat=i.taskMovingStartEndFormat,n.eventResizingStartEndEnabled=i.taskResizingStartEndEnabled,n.eventResizingStartEndFormat=i.taskResizingStartEndFormat,n.hideUntilInit=i.hideUntilInit,n.treeIndent=i.treeIndent,n.treeAutoExpand=i.treeAutoExpand,n.treeImageMarginLeft=i.treeImageMarginLeft,n.treeImageMarginTop=i.treeImageMarginTop,n.timeHeaders=i.timeHeaders,n.rowHeaderHideIconEnabled=i.rowHeaderHideIconEnabled,n.rowHeaderScrolling=i.rowHeaderScrolling,n.rowHeaderSplitterWidth=i.rowHeaderSplitterWidth,n.rowHeaderWidth=i.rowHeaderWidth,n.rowHeaderWidthAutoFit=i.rowHeaderWidthAutoFit,n.rowMarginBottom=i.rowMarginBottom,n.rowMinHeight=i.rowMinHeight,n.theme=i.theme,n.useEventBoxes=i.useEventBoxes,n.snapToGrid=i.snapToGrid,n.uniqueID=i.uniqueID,n.bubble=i.bubbleTask,n.cellBubble=i.bubbleCell,n.resourceBubble=i.bubbleRow,n.contextMenu=i.contextMenuTask,n.contextMenuResource=i.contextMenuRow,n.contextMenuLink=i.contextMenuLink,n.syncResourceTree=i.syncTasks,n.syncLinks=i.syncLinks,n.timeline=i.timeline,n.visible=i.visible,n.eventMoveHandling=i.taskMoveHandling,n.eventClickHandling=i.taskClickHandling,n.eventResizeHandling=i.taskResizeHandling,n.linkCreateHandling=i.linkCreateHandling,n.eventRightClickHandling=i.taskRightClickHandling,n.eventDoubleClickHandling=i.taskDoubleClickHandling,n.rowMoveHandling=i.rowMoveHandling,n.rowClickHandling=i.rowClickHandling,n.rowDoubleClickHandling=i.rowDoubleClickHandling,n.rowEditHandling=i.rowEditHandling,n.rowSelectHandling=i.rowSelectHandling,DayPilot.isArray(i.columns)){n.rowHeaderColumns=[];for(var e=0;e<i.columns.length;e++){var t=i.columns[e],a={};DayPilot.Util.copyProps(t,a,["title","width"]),n.rowHeaderColumns.push(a)}}i.$0i()&&(n.timeHeader=i.timeHeader,n.cellProperties=i.cellProperties,n.cellConfig=i.cellConfig),n.onRowCreate=function(e){"function"==typeof i.onRowCreate&&i.onRowCreate(e)},n.onRowCreated=function(e){"function"==typeof i.onRowCreated&&i.onRowCreated(e)},n.onAfterRender=function(e){"function"==typeof i.onAfterRender&&i.onAfterRender(e)},n.onRowHeaderResized=function(e){i.rowHeaderWidth=n.rowHeaderWidth},n.onAjaxError=function(e){"function"==typeof i.onAjaxError&&i.onAjaxError(e)},n.onRowHeaderColumnResized=function(e){for(var t=e.column,a=DayPilot.indexOf(n.rowHeaderColumns,t),s=0;s<i.columns.length;s++){var o=n.rowHeaderColumns[s];i.columns[s].width=o.width}if("function"==typeof i.onColumnResized){var l={};l.column=i.columns[a],i.onColumnResized(l)}},n.onBeforeRowHeaderRender=function(e){e.task=new DayPilot.Task(e.row.$.row.task,i);var t=[];if(DayPilot.isArray(i.columns))for(var n=0;n<i.columns.length;n++){var a=i.columns[n].property,o={};o.value=s.getProperty(e.task.data,a),e.task.data.row&&e.task.data.row.columns&&e.task.data.row.columns[n]?o.html=e.task.data.row.columns[n].html:o.html=o.value,t.push(o)}if(e.row.columns=t,"function"==typeof i.onBeforeRowHeaderRender&&i.onBeforeRowHeaderRender(e),DayPilot.isArray(i.columns))for(n=0;n<i.columns.length;n++){var l=t[n].html;0===n?e.row.html=l:e.row.columns[n-1].html=l}},n.onBeforeCellRender=function(e){e.task=i.tasks.find(e.cell.resource),delete e.cell.resource,"function"==typeof i.onBeforeCellRender&&i.onBeforeCellRender(e)},n.onBeforeTimeHeaderRender=function(e){"function"==typeof i.onBeforeTimeHeaderRender&&i.onBeforeTimeHeaderRender(e)},n.onEventClick=function(e){e.task=new DayPilot.Task(e.e,i),"function"==typeof i.onTaskClick&&i.onTaskClick(e)},n.onEventClicked=function(e){"function"==typeof i.onTaskClicked&&i.onTaskClicked(e)},n.onEventDelete=function(e){"function"==typeof i.onTaskDelete&&i.onTaskDelete(e)},n.onEventDeleted=function(e){"function"==typeof i.onTaskDeleted&&i.onTaskDeleted(e)},n.onEventDoubleClick=function(e){e.task=new DayPilot.Task(e.e,i),"function"==typeof i.onTaskDoubleClick&&i.onTaskDoubleClick(e)},n.onEventDoubleClicked=function(e){"function"==typeof i.onTaskDoubleClicked&&i.onTaskDoubleClicked(e)},n.onEventRightClick=function(e){e.task=new DayPilot.Task(e.e,i),"function"==typeof i.onTaskRightClick&&i.onTaskRightClick(e)},n.onEventRightClicked=function(e){"function"==typeof i.onTaskRightClicked&&i.onTaskRightClicked(e)},n.onRowMoving=function(e){e.$0o=e.source,e.$0p=e.target,e.source=new DayPilot.Task(e.$0o.$.row.task,i),e.target=new DayPilot.Task(e.$0p.$.row.task,i),"function"==typeof i.onRowMoving&&i.onRowMoving(e)},n.onRowMove=function(e){e.$0o=e.source,e.$0p=e.target,e.source=new DayPilot.Task(e.$0o.$.row.task,i),e.target=new DayPilot.Task(e.$0p.$.row.task,i),"function"==typeof i.onRowMove&&i.onRowMove(e),e.source=e.$0o,e.target=e.$0p},n.onRowMoved=function(e){if("Update"===i.rowMoveHandling||"Notify"===i.rowMoveHandling){var t=e.$0o.$.row.task,n=e.$0p.$.row.task,a=e.position;if("forbidden"===a)return;var o=s.findParentArray(t);if(!o)throw"Cannot find source node parent";var l=DayPilot.indexOf(o,t);o.splice(l,1);var r=s.findParentArray(n);if(!r)throw"Cannot find target node parent";var d=DayPilot.indexOf(r,n);switch(a){case"before":r.splice(d,0,t);break;case"after":r.splice(d+1,0,t);break;case"child":n.children||(n.children=[],n.expanded=!0),n.children.push(t)}i.$0g.notify(),i.update()}e.source=new DayPilot.Task(e.$0o.$.row.task,i),e.target=new DayPilot.Task(e.$0p.$.row.task,i),"function"==typeof i.onRowMoved&&i.onRowMoved(e)},n.onRowClick=function(e){e.task=new DayPilot.Task(e.resource.$.row.task,i),"function"==typeof i.onRowClick&&i.onRowClick(e)},n.onRowClicked=function(e){"function"==typeof i.onRowClicked&&i.onRowClicked(e)},n.onRowDoubleClick=function(e){e.task=new DayPilot.Task(e.resource.$.row.task,i),"function"==typeof i.onRowDoubleClick&&i.onRowDoubleClick(e)},n.onRowDoubleClicked=function(e){"function"==typeof i.onRowDoubleClicked&&i.onRowDoubleClicked(e)},n.onRowEdit=function(e){e.task=new DayPilot.Task(e.resource.$.row.task,i),"function"==typeof i.onRowEdit&&i.onRowEdit(e)},n.onRowEdited=function(e){"function"==typeof i.onRowEdited&&i.onRowEdited(e)},n.onRowSelect=function(e){e.task=new DayPilot.Task(e.row.$.row.task,i),"function"==typeof i.onRowSelect&&i.onRowSelect(e)},n.onRowSelected=function(e){"function"==typeof i.onRowSelected&&i.onRowSelected(e)},n.onEventMove=function(e){e._e=e.e,e.task=new DayPilot.Task(e.e,i),"function"==typeof i.onTaskMove&&i.onTaskMove(e)},n.onEventMoved=function(e){if("Auto"===i.taskGroupMode){var t=e._e,a=t.data.task;for(a.start=t.start(),a.end=t.end();t.data.parent;){var s=n.events.find(t.data.parent.id),l=o.childrenStartEnd(t.data.parent);s.start(l.start),s.end(l.end),n.events.update(s),t=s}}i.$0g.notify(),"function"==typeof i.onTaskMoved&&i.onTaskMoved(e)},n.onEventMoving=function(e){e.task=new DayPilot.Task(e.e,i),e._e=e.e,delete e.position,delete e.overlapping,delete e.resource,"function"==typeof i.onTaskMoving&&i.onTaskMoving(e)},n.onEventResize=function(e){e._e=e.e,e.task=new DayPilot.Task(e.e,i),"function"==typeof i.onTaskResize&&i.onTaskResize(e)},n.onEventResized=function(e){if("Auto"===i.taskGroupMode){var t=e._e,a=t.data.task;for(a.start=t.start(),a.end=t.end();t.data.parent;){var s=n.events.find(t.data.parent.id),l=o.childrenStartEnd(t.data.parent);s.start(l.start),s.end(l.end),n.events.update(s),t=s}}i.$0g.notify(),"function"==typeof i.onTaskResized&&i.onTaskResized(e)},n.onEventResizing=function(e){e.task=new DayPilot.Task(e.e,i),e._e=e.e,"function"==typeof i.onTaskResizing&&i.onTaskResizing(e)},n.onLinkCreate=function(e){e.source=i.tasks.find(e.from),e.target=i.tasks.find(e.to),"function"==typeof i.onLinkCreate&&i.onLinkCreate(e)},n.onLinkCreated=function(e){"function"==typeof i.onLinkCreated&&i.onLinkCreated(e)},n.onResourceExpand=function(e){var t=e.resource.$.row.task;t.row||(t.row={}),t.row.collapsed=!1},n.onResourceCollapse=function(e){var t=e.resource.$.row.task;t.row||(t.row={}),t.row.collapsed=!0}},o.$0q=function(e){for(var t=0;t<n.rowlist.length;t++){var i=n.rowlist[t];if(i.task===e)return n.internal.createRowObject(i)}return null},o.$0e=function(){n.links.list=i.links.list?i.links.list:[]},o.$0d=function(){n.resources=[],n.events.list=[],s.clearCache(),o.$0r(i.tasks.list,n.resources,null)},o.$0s=function(e){var t=e.type||"Task";e.children&&e.children.length&&(t="Group");var n={};for(var a in e)"children"!==a&&(n[a]=e[a]);var s={};if(s.data=n,s.type=t,n.box||(n.box={}),void 0===n.box.html)if("Task"===s.type){var o=n.complete||0;n.box.html=o+"%"}else n.box.html="";return void 0===n.box.htmlRight&&(n.box.htmlRight=n.text),"function"==typeof i.onBeforeTaskRender&&i.onBeforeTaskRender(s),s.type=t,s},o.$0r=function(e,t,a){if(DayPilot.isArray(e))for(var l=0;l<e.length;l++){var r=e[l];s.addToCache(r,a);var d=o.$0s(r),h=d.data,c=d.type,u={};if(DayPilot.Util.copyProps(h,u,["id","start","end","text","complete","tags"]),DayPilot.Util.copyProps(h.box,u),u.parent=a,u.task=r,u.resource=h.id,"Group"==c){if(u.type="Group",u.html="",delete u.backColor,"Auto"===i.taskGroupMode){var f=o.childrenStartEnd(r);u.start=f.start,u.end=f.end,u.resizeDisabled=!0,u.moveDisabled=!0}}else"Milestone"===c&&(r.end=r.start,h.end=h.start,u.end=h.start,u.barHidden=!0,u.resizeDisabled=!0,u.type="Milestone",u.width=i.taskHeight,delete u.backColor);u.moveVDisabled=!0,u.htmlRight=h.box.htmlRight,u.htmlLeft=h.box.htmlLeft,n.events.list.push(u);var v={};v.task=r,DayPilot.Util.copyProps(h.row,v),v.name=h.text,v.id=h.id,v.children=[],v.expanded=!h.row||!h.row.collapsed,r.children&&r.children.length&&o.$0r(r.children,v.children,r),t.push(v)}},o.childrenStartEnd=function(e){if(!e.children||!e.children.length){var t=e.start,i=e.end;return"Milestone"===e.type&&(i=t),{start:new DayPilot.Date(t),end:new DayPilot.Date(i)}}t=null,i=null;for(var n=0;n<e.children.length;n++){var a=o.childrenStartEnd(e.children[n]);(!t||a.start.getTime()<t.getTime())&&(t=a.start),(!i||a.end.getTime()>i.getTime())&&(i=a.end)}return{start:t,end:i}},this.rows={},this.rows.expand=function(e){n.rows.expand(e)},this.rows.expandAll=function(){n.rows.expandAll()},this.internal={},this.internal.initialized=function(){return i.$0f},this.internal.rowObjectForTaskData=o.$0q,this.$0g={},this.$0g.scope=null,this.$0g.notify=function(){i.$0g.scope&&i.$0g.scope.$apply()},this.$0t=null,this.$0u=function(e){var t={tasks:{preInit:function(){var e=this.data;e&&(DayPilot.isArray(e.list)?i.tasks.list=e.list:i.tasks.list=e)}},links:{preInit:function(){var e=this.data;e&&(DayPilot.isArray(e.list)?i.links.list=e.list:i.links.list=e)}},scrollTo:{postInit:function(){this.data&&i.scrollTo(this.data)}}};for(var n in this.$0t=t,e)if(t[n]){var a=t[n];a.data=e[n],a.preInit&&a.preInit()}else i[n]=e[n]},this.$0l=function(){var e=this.$0t;for(var t in e){var i=e[t];i.postInit&&i.postInit()}},this.$0u(t)},"undefined"!=typeof jQuery&&(jQuery.fn.daypilotGantt=function(e){var t=null,i=this.each(function(){if(!this.daypilot){var i=new DayPilot.Gantt(this.id,e);i.init(),this.daypilot=i,t||(t=i)}});return 1===this.length?t:i}),(e=DayPilot.am())&&e.directive("daypilotGantt",function(){return{restrict:"E",template:"<div id='{{id}};'></div>",compile:function(e,t){return e.replaceWith(this.template.replace("{{id}};",t.id)),function(e,t,i){var n=new DayPilot.Gantt(t[0]);n.$0g.scope=e,n.init();var a=i.id;a&&(e[a]=n),e.$watch.call(e,i.daypilotConfig,function(e){n.$0u(e),n.update()},!0)}}}}),"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),void 0===DayPilot)var DayPilot={};if(void 0===DayPilot.Global&&(DayPilot.Global={}),void 0===DayPilotMenu)var DayPilotMenu=DayPilot.MenuVisible={};if(function(){if(void 0===DayPilot.Menu){var e={mouse:null,menu:null,clickRegistered:!1,hideTimeout:null};DayPilot.Menu=function(t){var i=this;this.v="1659",this.zIndex=10,this.useShadow=!0,this.cssClassPrefix="menu_default",this.cssOnly=!0,this.menuTitle=null,this.showMenuTitle=!1,this.hideOnMouseOut=!1,this.$I=function(){},this.$I.ref=null,t&&DayPilot.isArray(t)&&(this.items=t),this.show=function(t,n){var a=null;if("string"==typeof t.id||"number"==typeof t.id?a=t.id:"function"==typeof t.id?a=t.id():"function"==typeof t.value&&(a=t.value()),void 0!==DayPilot.Bubble&&DayPilot.Bubble.hideActive(),n||e.menuClean(),this.$I.submenu=null,null!==e.mouse){i.cssOnly||(i.cssOnly=!0,DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0."));var s=document.createElement("div");if(s.style.position="absolute",s.style.top="0px",s.style.left="0px",s.style.display="none",s.style.overflow="hidden",s.style.zIndex=this.zIndex+1,s.className=this.applyCssClass("main"),s.onclick=function(){this.parentNode.removeChild(this)},this.hideOnMouseOut&&(s.onmousemove=function(t){clearTimeout(e.hideTimeout)},s.onmouseout=function(e){i.delayedHide()}),!this.items||0===this.items.length)throw"No menu items defined.";if(this.showMenuTitle){var o=document.createElement("div");o.innerHTML=this.menuTitle,o.className=this.applyCssClass("title"),s.appendChild(o)}for(var l=0;l<this.items.length;l++){var r=this.items[l],d=document.createElement("div");if(void 0!==r){if("-"===r.text){var h=document.createElement("div");d.appendChild(h)}else{var c=document.createElement("a");if(c.style.position="relative",c.style.display="block",r.disabled)DayPilot.Util.addClass(c,i.applyCssClass("item_disabled"));else if(r.href)c.href=r.href.replace(/\x7B0\x7D/gim,a),r.target&&c.setAttribute("target",r.target);else if(r.onclick)c.item=r,c.onclick=r.onclick,c.ontouchend=r.onclick;else if(r.command){var u=function(e,t){return function(i){var n=t.source,a=e;a.action=a.action?a.action:"CallBack";var s=n.calendar||n.root;if(n instanceof DayPilot.Link)s.internal.linkMenuClick(a.command,n,a.action);else if(n instanceof DayPilot.Selection)s.internal.timeRangeMenuClick(a.command,n,a.action);else if(n instanceof DayPilot.Event)s.internal.eventMenuClick(a.command,n,a.action);else if(n instanceof DayPilot.Selection)s.internal.timeRangeMenuClick(a.command,n,a.action);else if(n instanceof DayPilot.Task)"resource"===n.menuType?s.internal.resourceHeaderMenuClick(a.command,t.menuSource,a.action):s.internal.eventMenuClick(a.command,t.menuSource,a.action);else{switch(n.menuType){case"resource":return void s.internal.resourceHeaderMenuClick(a.command,n,a.action);case"selection":return void s.internal.timeRangeMenuClick(a.command,n,a.action);default:return void s.internal.eventMenuClick(a.command,n,a.action)}i.preventDefault()}}};c.onclick=u(r,c),c.ontouchend=u(r,c)}t&&t.isRow&&t.$.row.task?(c.source=new DayPilot.Task(t.$.row.task,t.calendar),c.source.menuType="resource"):t&&t.isEvent&&t.data.task?c.source=new DayPilot.Task(t,t.calendar):c.source=t,c.menuSource=t;var f=document.createElement("span");if(f.innerHTML=r.text,c.appendChild(f),r.image){var v=document.createElement("img");v.src=r.image,v.style.position="absolute",v.style.top="0px",v.style.left="0px",c.appendChild(v)}c.onmouseover=function(e,t){return function(){var n=t.source,a=e;setTimeout(function(){if((!i.$I.submenu||i.$I.submenu.item!==a)&&(i.$I.submenu&&i.$I.submenu.item!==a&&(i.$I.submenu.menu.hide(),i.$I.submenu=null),a.items)){var e=i.cloneOptions();e.items=a.items,i.$I.submenu={},i.$I.submenu.menu=new DayPilot.Menu(e),i.$I.submenu.menu.show(n,!0),i.$I.submenu.item=a}},500)}}(r,c),d.appendChild(c)}s.appendChild(d)}}var p=function(t){window.setTimeout(function(){e.menuClean()},100)};s.onclick=p,s.ontouchend=p,s.onmousedown=function(e){(e=e||window.event).cancelBubble=!0,e.stopPropagation&&e.stopPropagation()},s.oncontextmenu=function(){return!1},document.body.appendChild(s),i.$I.visible=!0,i.$I.source=t,s.style.display="";var y=s.clientHeight,g=s.offsetWidth;s.style.display="none";var m=document.documentElement.clientHeight;if(this.$I.ref){var b=DayPilot.abs(this.$I.ref);y=this.$I.ref.offsetHeight;s.style.left=b.x+"px",s.style.top=b.y+y+"px"}else{var w=e.mouse.x+1,$=e.mouse.y+1;if(e.mouse.clientY>m-y&&0!==m){var D=e.mouse.clientY-(m-y)+5;s.style.top=$-D+"px"}else s.style.top=$+"px";var k=document.documentElement.clientWidth;if(e.mouse.clientX>k-g&&0!==k){var C=e.mouse.clientX-(k-g)+5;s.style.left=w-C+"px"}else s.style.left=w+"px"}s.style.display="",this.addShadow(s),this.$I.div=s,n||(DayPilot.Menu.active=this)}},this.applyCssClass=function(e){var t=this.theme||this.cssClassPrefix,i=this.cssOnly?"_":"";return t?t+i+e:""},this.cloneOptions=function(){for(var e={},t=["cssOnly","cssClassPrefix","useShadow","zIndex"],i=0;i<t.length;i++){var n=t[i];e[n]=this[n]}return e},this.hide=function(){this.$I.submenu&&this.$I.submenu.menu.hide(),this.removeShadow(),this.$I.div&&this.$I.div.parentNode===document.body&&document.body.removeChild(this.$I.div),i.$I.visible=!1,i.$I.source=null},this.delayedHide=function(){e.hideTimeout=setTimeout(function(){i.hide()},200)},this.cancelHideTimeout=function(){clearTimeout(e.hideTimeout)},this.init=function(t){e.mouseMove(t)},this.addShadow=function(e){if(this.useShadow&&!this.cssOnly&&e){this.$I.shadows&&this.$I.shadows.length>0&&this.removeShadow(),this.$I.shadows=[];for(var t=0;t<5;t++){var i=document.createElement("div");i.style.position="absolute",i.style.width=e.offsetWidth+"px",i.style.height=e.offsetHeight+"px",i.style.top=e.offsetTop+t+"px",i.style.left=e.offsetLeft+t+"px",i.style.zIndex=this.zIndex,i.style.filter="alpha(opacity:10)",i.style.opacity=.1,i.style.backgroundColor="#000000",document.body.appendChild(i),this.$I.shadows.push(i)}}},this.removeShadow=function(){if(this.$I.shadows){for(var e=0;e<this.$I.shadows.length;e++)document.body.removeChild(this.$I.shadows[e]);this.$I.shadows=[]}};var n=DayPilot.isArray(t)?null:t;if(n)for(var a in n)this[a]=n[a];e.clickRegistered||(DayPilot.re(document,"mousemove",e.mouseMove),DayPilot.re(document,"touchmove",e.touchMove),DayPilot.re(document,"touchstart",e.touchStart),DayPilot.re(document,"touchend",e.touchEnd),DayPilot.re(document,"mousedown",e.menuClean),e.clickRegistered=!0)},e.menuClean=function(e){void 0!==DayPilot.Menu.active&&DayPilot.Menu.active&&(DayPilot.Menu.active.hide(),DayPilot.Menu.active=null)},e.mouseMove=function(t){void 0!==e&&(e.mouse=e.mousePosition(t))},e.touchMove=function(t){void 0!==e&&(e.mouse=e.touchPosition(t))},e.touchStart=function(t){void 0!==e&&(e.mouse=e.touchPosition(t))},e.touchEnd=function(e){},e.touchPosition=function(e){var t=e.touches[0],i={};return i.x=t.pageX,i.y=t.pageY,i.clientX=t.clientX,i.clientY=t.clientY,i},e.mousePosition=function(e){var t=0,i=0;if(!e)e=window.event;e.pageX||e.pageY?(t=e.pageX,i=e.pageY):(e.clientX||e.clientY)&&(t=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,i=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);var n={};return n.x=t,n.y=i,n.clientY=e.clientY,n.clientX=e.clientX,n},DayPilot.Menu.touchPosition=function(t){e.mouse=e.touchPosition(t)},DayPilot.MenuVisible.Menu=e.Menu,"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),void 0===DayPilot&&(DayPilot={}),function(){DayPilot.ModalStatic={},DayPilot.ModalStatic.list=[],DayPilot.ModalStatic.hide=function(){if(this.list.length>0){var e=this.list.pop();e&&e.hide()}},DayPilot.ModalStatic.remove=function(e){for(var t=DayPilot.ModalStatic.list,i=0;i<t.length;i++)if(t[i]===e)return void t.splice(i,1)},DayPilot.ModalStatic.close=function(e){DayPilot.ModalStatic.result(e),DayPilot.ModalStatic.hide()},DayPilot.ModalStatic.result=function(e){var t=DayPilot.ModalStatic.list;t.length>0&&(t[t.length-1].result=e)},DayPilot.ModalStatic.displayed=function(e){for(var t=DayPilot.ModalStatic.list,i=0;i<t.length;i++)if(t[i]===e)return!0;return!1},DayPilot.ModalStatic.stretch=function(){if(this.list.length>0){var e=this.list[this.list.length-1];e&&e.stretch()}};navigator&&navigator.userAgent&&navigator.userAgent.indexOf("MSIE");DayPilot.Modal=function(e){this.autoStretch=!0,this.autoStretchFirstLoadOnly=!1,this.border="10px solid #ccc",this.corners="Rounded",this.className=null,this.dragDrop=!0,this.height=200,this.maxHeight=null,this.opacity=30,this.scrollWithPage=!0,this.top=20,this.useIframe=!0,this.width=500,this.zIndex=null,this.closed=null,this.onClosed=null;var t=this;this.id="_"+(new Date).getTime()+"n"+10*Math.random(),this.registered=!1,this.start=null,this.coords=null,this.showHtml=function(e){if(DayPilot.ModalStatic.displayed(this))throw"This modal dialog is already displayed.";if(this.div||this.create(),this.update(),this.useIframe){window.setTimeout((t=this,i=e,function(){t.setInnerHTML(t.id+"iframe",i)}),0)}else e.nodeType?this.div.appendChild(e):this.div.innerHTML=e;var t,i;this.update(),this.register()},this.rounded=function(){return this.corners&&"rounded"===this.corners.toLowerCase()},this.showUrl=function(e){if(DayPilot.ModalStatic.displayed(this))throw"This modal dialog is already displayed.";this.useIframe=!0,this.div||this.create(),this.re(this.iframe,"load",this.onIframeLoad),this.iframe.src=e,this.update(),this.register()},this.update=function(){var e=window,i=document,n=e.pageYOffset?e.pageYOffset:i.documentElement&&i.documentElement.scrollTop?i.documentElement.scrollTop:i.body.scrollTop;this.hideDiv.style.filter="alpha(opacity="+this.opacity+")",this.hideDiv.style.opacity="0."+this.opacity,this.hideDiv.style.backgroundColor="black",this.zIndex&&(this.hideDiv.style.zIndex=this.zIndex),this.hideDiv.style.display="",window.setTimeout(function(){t.hideDiv.onclick=function(){t.hide()}},500),this.div.className=this.className,this.div.style.border=this.border,this.rounded()&&(this.div.style.MozBorderRadius="5px",this.div.style.webkitBorderRadius="5px",this.div.style.borderRadius="5px"),this.div.style.marginLeft="-"+Math.floor(this.width/2)+"px",this.div.style.position="absolute",this.div.style.top=n+this.top+"px",this.div.style.width=this.width+"px",this.zIndex&&(this.div.style.zIndex=this.zIndex),this.height&&(this.div.style.height=this.height+"px"),this.useIframe&&this.height&&(this.iframe.style.height=this.height+"px"),this.div.style.display="",DayPilot.ModalStatic.list.push(this)},this.onIframeLoad=function(){t.iframe.contentWindow.modal=t,t.autoStretch&&t.stretch()},this.stretch=function(){for(var e=t.windowRect().x-40,i=this.width;i<e&&this.hasHorizontalScrollbar();i+=10)this.div.style.width=i+"px",this.div.style.marginLeft="-"+Math.floor(i/2)+"px";for(var n=this.maxHeight||t.windowRect().y-2*this.top,a=this.height;a<n&&this.hasVerticalScrollbar();a+=10)this.iframe.style.height=a+"px",this.div.style.height=a+"px";this.autoStretchFirstLoadOnly&&this.ue(this.iframe,"load",this.onIframeLoad)},this.hasHorizontalScrollbar=function(){for(var e=this.iframe.contentWindow.document,t="BackCompat"===e.compatMode?e.body:e.documentElement,i=t.scrollWidth,n=e.body.children,a=0;a<n.length;a++){var s=n[a].offsetLeft+n[a].offsetWidth;i=Math.max(i,s)}return i>t.clientWidth},this.hasVerticalScrollbar=function(){for(var e=this.iframe.contentWindow.document,t="BackCompat"===e.compatMode?e.body:e.documentElement,i=t.scrollHeight,n=e.body.children,a=0;a<n.length;a++){var s=n[a].offsetTop+n[a].offsetHeight;i=Math.max(i,s)}return i>t.clientHeight},this.windowRect=function(){var e=document;return"CSS1Compat"===e.compatMode&&e.documentElement&&e.documentElement.clientWidth?{x:e.documentElement.clientWidth,y:e.documentElement.clientHeight}:{x:e.body.clientWidth,y:e.body.clientHeight}},this.register=function(){this.registered||(this.re(window,"resize",this.resize),this.re(window,"scroll",this.resize),this.dragDrop&&(this.re(document,"mousemove",this.drag),this.re(document,"mouseup",this.drop)),this.registered=!0)},this.drag=function(e){if(t.coords){e=e||window.event;var i=t.mc(e),n=i.x-t.coords.x,a=i.y-t.coords.y;t.div.style.marginLeft="0px",t.div.style.top=t.start.y+a+"px",t.div.style.left=t.start.x+n+"px"}},this.drop=function(e){t.coords&&(t.unmaskIframe(),t.coords=null)},this.maskIframe=function(){if(this.useIframe){var e=document.createElement("div");e.style.backgroundColor="#ffffff",e.style.filter="alpha(opacity=80)",e.style.opacity="0.80",e.style.width="100%",e.style.height=this.height+"px",e.style.position="absolute",e.style.left="0px",e.style.top="0px",this.div.appendChild(e),this.mask=e}},this.unmaskIframe=function(){this.useIframe&&(this.div.removeChild(this.mask),this.mask=null)},this.resize=function(){if(t.hideDiv&&t.div&&"none"!==t.hideDiv.style.display&&"none"!==t.div.style.display){var e=window.pageYOffset?window.pageYOffset:document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;t.scrollWithPage||(t.div.style.top=e+t.top+"px")}},this.re=function(e,t,i){e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent&&e.attachEvent("on"+t,i)},this.ue=function(e,t,i){e.removeEventListener?e.removeEventListener(t,i,!1):e.detachEvent&&e.detachEvent("on"+t,i)},this.mc=function(e){return e.pageX||e.pageY?{x:e.pageX,y:e.pageY}:{x:e.clientX+document.documentElement.scrollLeft,y:e.clientY+document.documentElement.scrollTop}},this.abs=function(e){for(var t={x:e.offsetLeft,y:e.offsetTop};e.offsetParent;)e=e.offsetParent,t.x+=e.offsetLeft,t.y+=e.offsetTop;return t},this.create=function(){var e=document.createElement("div");e.id=this.id+"hide",e.style.position="fixed",e.style.left="0px",e.style.top="0px",e.style.right="0px",e.style.bottom="0px",e.style.backgroundColor="black",e.style.opacity=.5,e.oncontextmenu=function(){return!1},document.body.appendChild(e);var t=document.createElement("div");t.id=this.id+"popup",t.style.position="fixed",t.style.left="50%",t.style.top="0px",t.style.backgroundColor="white",t.style.width="50px",t.style.height="50px",this.dragDrop&&(t.onmousedown=this.dragStart);var i=null;this.useIframe&&((i=document.createElement("iframe")).id=this.id+"iframe",i.name=this.id+"iframe",i.frameBorder="0",i.style.width="100%",i.style.height="50px",t.appendChild(i)),document.body.appendChild(t),this.div=t,this.iframe=i,this.hideDiv=e},this.dragStart=function(e){t.maskIframe(),t.coords=t.mc(e||window.event),t.start={x:t.div.offsetLeft,y:t.div.offsetTop}},this.setInnerHTML=function(e,t){var i=window.frames[e],n=i.contentWindow||i.document||i.contentDocument;n.document&&(n=n.document),t.nodeType?n.body.appendChild(t):n.body.innerHTML=t},this.close=function(e){this.result=e,this.hide()},this.hide=function(){if(this.div&&(this.div.style.display="none",this.hideDiv.style.display="none",this.useIframe||(this.div.innerHTML=null)),DayPilot.ModalStatic.remove(this),this.onClosed){var e={};e.result=this.result,this.onClosed(e)}else this.closed&&this.closed()},this.$I=function(){if(e)for(var t in e)this[t]=e[t]},this.$I()},DayPilot.Modal.close=function(e){if(!(parent&&parent.DayPilot&&parent.DayPilot.ModalStatic))throw"Unable to close DayPilot.Modal dialog.";parent.DayPilot.ModalStatic.close(e)}}(),void 0===DayPilot)var DayPilot={};if(void 0===DayPilot.Global&&(DayPilot.Global={}),void 0===DayPilotMonth)var DayPilotMonth=DayPilot.MonthVisible={};if(function(){if(void 0===DayPilot.Month){var e,t={};DayPilot.Month=function(e,i){this.v="1659",this.nav={};var n=this;this.id=e,this.isMonth=!0,this.api=2,this.$1V=!1,this.hideUntilInit=!0,this.startDate=new DayPilot.Date,this.width="100%",this.cssClassPrefix="month_default",this.cellHeight=100,this.cellMarginBottom=0,this.allowMultiSelect=!0,this.autoRefreshCommand="refresh",this.autoRefreshEnabled=!1,this.autoRefreshInterval=60,this.autoRefreshMaxCount=20,this.doubleClickTimeout=300,this.eventFontColor="#000000",this.eventFontFamily="Tahoma",this.eventFontSize="11px",this.headerBackColor="#ECE9D8",this.headerFontColor="#000000",this.headerFontFamily="Tahoma",this.headerFontSize="10pt",this.headerHeight=20,this.heightSpec="Auto",this.weekStarts=1,this.innerBorderColor="#cccccc",this.borderColor="black",this.eventHeight=25,this.cellHeaderHeight=16,this.numberFormat=null,this.clientState={},this.afterRender=function(){},this.backColor="#FFFFD5",this.nonBusinessBackColor="#FFF4BC",this.cellHeaderBackColor="",this.cellHeaderFontColor="#000000",this.cellHeaderFontFamily="Tahoma",this.cellHeaderFontSize="10pt",this.cssOnly=!0,this.eventBackColor="White",this.eventBorderColor="Black",this.eventCorners="Regular",this.eventFontColor="#000000",this.eventFontFamily="Tahoma",this.eventFontSize="11px",this.cellWidth=14.285,this.lineSpace=1,this.locale="en-us",this.messageHideAfter=5e3,this.notifyCommit="Immediate",this.visible=!0,this.eventMoveToPosition=!1,this.eventTextLayer="Top",this.eventStartTime=!1,this.eventEndTime=!1,this.eventStartEndWidth=60,this.eventTextAlignment=null,this.eventTextLeftIndent=20,this.showWeekend=!0,this.cellMode=!1,this.shadowType="Fill",this.tapAndHoldTimeout=500,this.timeFormat="Auto",this.eventTimeFontColor="gray",this.eventTimeFontFamily="Tahoma",this.eventTimeFontSize="8pt",this.viewType="Month",this.weeks=1,this.eventClickHandling="Enabled",this.eventDeleteHandling="Disabled",this.eventDoubleClickHandling="Enabled",this.eventMoveHandling="Update",this.eventResizeHandling="Update",this.eventRightClickHandling="ContextMenu",this.eventSelectHandling="Update",this.headerClickHandling="Enabled",this.timeRangeSelectedHandling="Enabled",this.timeRangeDoubleClickHandling="Enabled",this.backendUrl=null,this.cellEvents=[],this.elements={},this.elements.events=[],this.$1W={},this.$1W.events={},this.events={},this.autoRefreshCount=0,this.$1X=function(e,t){if((e=DayPilot.Util.parseJSON(e)).BubbleGuid){var i=e.BubbleGuid,a=this.bubbles[i];return delete this.bubbles[i],n.$1Y(),void(void 0!==e.Result.BubbleHTML&&a.updateView(e.Result.BubbleHTML,a))}if(e.CallBackRedirect)document.location.href=e.CallBackRedirect;else{if(void 0!==e.ClientState&&(n.clientState=e.ClientState),"None"===e.UpdateType)return n.$1Z(e.CallBackData,!0),void(e.Message&&n.message(e.Message));if(e.VsUpdate){var s=document.createElement("input");s.type="hidden",s.name=n.id+"_vsupdate",s.id=s.name,s.value=e.VsUpdate,n.$20.innerHTML="",n.$20.appendChild(s)}n.events.list=e.Events,void 0!==e.TagFields&&(n.tagFields=e.TagFields),void 0!==e.SortDirections&&(n.sortDirections=e.SortDirections),"Full"===e.UpdateType&&(n.cellProperties=e.CellProperties,n.headerProperties=e.HeaderProperties,n.startDate=e.StartDate,void 0!==e.ShowWeekend&&(n.showWeekend=e.ShowWeekend),n.headerBackColor=e.HeaderBackColor?e.HeaderBackColor:n.headerBackColor,n.backColor=e.BackColor?e.BackColor:n.backColor,n.nonBusinessBackColor=e.NonBusinessBackColor?e.NonBusinessBackColor:n.nonBusinessBackColor,n.locale=e.Locale?e.Locale:n.locale,n.timeFormat=e.TimeFormat?e.TimeFormat:n.timeFormat,void 0!==e.WeekStarts&&(n.weekStarts=e.WeekStarts),n.hashes=e.Hashes),n.multiselect.clear(!0),n.multiselect.initList=e.SelectedEvents,n.$21(),n.$22(),n.$23(),"Full"===e.UpdateType&&(n.$24(),n.$25()),n.$26(),n.$27(),n.$28(),n.$1Z(e.CallBackData,!0),n.$29(),e.Message&&n.message(e.Message)}},this.$1Z=function(e,t){window.setTimeout(function(e,t){return function(){if(n.$2a()){if("function"==typeof n.onAfterRender){var i={};i.isCallBack=t,i.data=e,n.onAfterRender(i)}}else n.afterRender&&n.afterRender(e,t)}}(e,t),0)},this.$2a=function(){return 2===n.api},this.$2b=function(e){var t=this.theme||this.cssClassPrefix;return t?t+e:""},this.$23=function(){if(this.events.list){if("function"==typeof this.onBeforeEventRender)for(var e=this.events.list.length,t=0;t<e;t++)this.$2c(t);this.cellMode?this.$2d():this.$2e()}},this.$1Y=function(){},this.$2e=function(){if(this.events.list){for(var e=0;e<this.events.list.length;e++){var t=this.events.list[e];if(t.start=new DayPilot.Date(t.start),t.end=new DayPilot.Date(t.end),!(t.start.getTime()>t.end.getTime()))for(var i=0;i<this.rows.length;i++){if((o=this.rows[i]).belongsHere(t)){var a=new DayPilot.Event(t,n);o.events.push(a),"function"==typeof this.onBeforeEventRender&&(a.cache=this.$1W.events[e])}}}for(var s=0;s<this.rows.length;s++){var o;(o=this.rows[s]).events.sort(this.$2f);for(var l=0;l<this.rows[s].events.length;l++){var r=o.events[l],d=o.getStartColumn(r),h=o.getWidth(r);o.putIntoLine(r,d,h,s)}}}},this.$2d=function(){this.cellEvents=[];for(var e=0;e<this.$2g();e++){this.cellEvents[e]=[];for(var t=0;t<this.rows.length;t++){var i={},a=DayPilot.Date.addDays(this.firstDate,7*t+e);i.start=a,i.end=DayPilot.Date.addDays(a,1),i.events=[],this.cellEvents[e][t]=i}}for(var s=0;s<this.events.list.length;s++){var o=this.events.list[s];if(o.start=new DayPilot.Date(o.start),o.end=new DayPilot.Date(o.start),!(o.start.getTime()>o.end.getTime()))for(e=0;e<this.$2g();e++)for(t=0;t<this.rows.length;t++){i=this.cellEvents[e][t];if(o.start.getTime()>=i.start.getTime()&&o.start.getTime()<i.end.getTime()){var l=new DayPilot.Event(o,n);i.events.push(l),"function"==typeof this.onBeforeEventRender&&(l.cache=this.$1W.events[s])}}}for(e=0;e<this.$2g();e++)for(t=0;t<this.rows.length;t++){(i=this.cellEvents[e][t]).events.sort(this.$2f)}},this.$21=function(){for(var e=0;e<this.elements.events.length;e++){var t=this.elements.events[e];t.event=null,t.click=null,t.parentNode.removeChild(t)}this.elements.events=[]},this.$28=function(){this.$1W.events={},this.cellMode?this.$2h():this.$2i(),this.multiselect.redraw()},this.$2h=function(){this.elements.events=[];for(var e=0;e<this.$2g();e++)for(var t=0;t<this.rows.length;t++)for(var i=this.cellEvents[e][t],n=(this.cells[e][t],0);n<i.events.length;n++){var a=i.events[n];a.part.colStart=e,a.part.colWidth=1,a.part.row=t,a.part.line=n,a.part.startsHere=!0,a.part.endsHere=!0,this.$2j(a)}},this.$2i=function(){this.elements.events=[];for(var e=0;e<this.rows.length;e++)for(var t=this.rows[e],i=0;i<t.lines.length;i++)for(var n=t.lines[i],a=0;a<n.length;a++)this.$2j(n[a])},this.$2k=function(e,t){if(!(e&&t&&e.start&&t.start))return 0;var i=e.start().ticks-t.start().ticks;return 0!==i?i:t.end().ticks-e.end().ticks},this.$2f=function(e,t){if(!e||!t)return 0;if(!(e.data&&t.data&&e.data.sort&&t.data.sort&&0!==e.data.sort.length&&0!==t.data.sort.length))return n.$2k(e,t);for(var i=0,a=0;0===i&&e.data.sort[a]&&t.data.sort[a];)i=e.data.sort[a]===t.data.sort[a]?0:n.$2l(e.data.sort[a],t.data.sort[a],n.sortDirections[a]),a++;return i},this.$2l=function(e,t,i){var n="desc"!==i?-1:1,a=-n;if(null===e&&null===t)return 0;if(null===t)return a;if(null===e)return n;var s=[];return s[0]=e,s[1]=t,s.sort(),e===s[0]?n:a},this.$2m=function(e,i,n,a,s,o){s||(s=0);var l=a;this.shadow={},this.shadow.list=[],this.shadow.start={x:e,y:i},this.shadow.width=a,this.eventMoveToPosition&&(l=1,this.shadow.position=n);var r=7*i+e-s;r<0&&(l+=r,e=0,i=0);for(var d=s;d>=7;)i--,d-=7;d>e?d>e+(7-this.$2g())?(i--,e=e+7-d):(l=l-d+e,e=0):e-=d;i<0&&(i=0,e=0);var h=null;for(t.resizingEvent?h="w-resize":t.movingEvent&&(h="move"),this.nav.top.style.cursor=h;l>0&&i<this.rows.length;){var c=Math.min(this.$2g()-e,l),u=this.rows[i],f=this.$2n(i),v=u.getHeight();this.eventMoveToPosition&&(f=this.$2o(i,n),v=2);var p=document.createElement("div");p.setAttribute("unselectable","on"),p.style.position="absolute",p.style.left=this.$2p()*e+"%",p.style.width=this.$2p()*c+"%",p.style.top=f+"px",p.style.height=v+"px",p.style.cursor=h;var y=document.createElement("div");y.setAttribute("unselectable","on"),p.appendChild(y),this.cssOnly&&(p.className=this.$2b("_shadow"),y.className=this.$2b("_shadow_inner")),this.cssOnly||(y.style.position="absolute",y.style.top="0px",y.style.right="0px",y.style.left="0px",y.style.bottom="0px","Fill"===this.shadowType?(y.style.backgroundColor="#aaaaaa",y.style.opacity=.5,y.style.filter="alpha(opacity=50)",o&&o.event&&(y.style.overflow="hidden",y.style.fontSize=this.eventFontSize,y.style.fontFamily=this.eventFontFamily,y.style.color=this.eventFontColor,y.innerHTML=o.event.client.innerHTML()?o.event.client.innerHTML():o.event.text())):y.style.border="2px dotted #666666"),this.nav.events.appendChild(p),this.shadow.list.push(p),l-=c+7-this.$2g(),e=0,i++}},this.$2q=function(){if(this.shadow){for(var e=this.nav.events,t=0;t<this.shadow.list.length;t++)e.removeChild(this.shadow.list[t]);this.shadow=null,this.nav.top.style.cursor=""}},this.$2o=function(e,t){for(var i=0,n=0;n<e;n++)i+=this.rows[n].getHeight();return i+=this.cellHeaderHeight,i+=t*o.lineHeight()},this.$2r=function(e,t){return DayPilot.Date.addDays(this.firstDate,7*t+e)},this.$2c=function(e){var t=this.$1W.events,i=this.events.list[e],n={};for(var a in i)n[a]=i[a];if("function"==typeof this.onBeforeEventRender){var s={};s.e=n,this.onBeforeEventRender(s)}t[e]=n},this.$2j=function(e,t){t=this.cellMode;var i=e.part.row,s=e.part.line,l=e.part.colStart,r=e.part.colWidth,d=e.cache||e.data,h=t?0:this.$2p()*l,c=t?100:this.$2p()*r,u=t?s*o.lineHeight():this.$2o(i,s),f=document.createElement("div");if(f.setAttribute("unselectable","on"),f.style.height=o.eventHeight()+"px",this.cssOnly?(f.style.position="relative",f.style.overflow="hidden",f.className=this.$2b("_event")):f.style.fontFamily=this.eventFontFamily,d.cssClass&&DayPilot.Util.addClass(f,d.cssClass),f.event=e,t?(f.style.marginRight="2px",f.style.marginBottom="2px"):(f.style.width=c+"%",f.style.position="absolute",f.style.left=h+"%",f.style.top=u+"px"),this.showToolTip&&d.toolTip&&!this.bubble&&(f.title=d.toolTip),f.onclick=this.$2s,f.ondblclick=this.$2t,f.oncontextmenu=this.$2u,f.onmousedown=this.$2v,f.onmousemove=this.$2w,f.onmouseout=this.$2x,f.ontouchstart=a.onEventTouchStart,f.ontouchmove=a.onEventTouchMove,f.ontouchend=a.onEventTouchEnd,this.cssOnly){e.part.startsHere||DayPilot.Util.addClass(f,this.$2b("_event_continueleft")),e.part.endsHere||DayPilot.Util.addClass(f,this.$2b("_event_continueright")),(g=document.createElement("div")).setAttribute("unselectable","on"),g.className=this.$2b("_event_inner"),e.client.innerHTML()?g.innerHTML=e.client.innerHTML():g.innerHTML=e.text(),d.backColor&&(g.style.background=d.backColor,(DayPilot.browser.ie9||DayPilot.browser.ielt9)&&(g.style.filter="")),f.appendChild(g),this.eventTextAlignment&&(g.style.textAlign=this.eventTextAlignment.toLowerCase());var v=n.eventStartEndWidth;if(this.eventStartTime){var p={left:5,top:3,width:v,bottom:2,v:"Visible",html:DayPilot.Date.hours(e.start().d,"Clock12Hours"===o.timeFormat()),css:n.$2b("_event_timeleft")},y=DayPilot.Areas.createArea(f,e,p);f.appendChild(y),g.style.paddingLeft=v+"px"}if(this.eventEndTime){p={right:5,top:3,width:v,bottom:2,v:"Visible",html:DayPilot.Date.hours(e.end().d,"Clock12Hours"===o.timeFormat()),css:n.$2b("_event_timeright")},y=DayPilot.Areas.createArea(f,e,p);f.appendChild(y),g.style.paddingRight=v+"px"}}else{var g,m=e.client.backColor()?e.client.backColor():this.eventBackColor;(g=document.createElement("div")).setAttribute("unselectable","on"),g.style.height=o.eventHeight()-2+"px",g.style.overflow="hidden",g.style.position="absolute",g.style.left="2px",g.style.right="2px",g.style.paddingLeft="2px",g.style.border="1px solid "+n.eventBorderColor,g.style.backgroundColor=m,g.style.fontFamily="",g.className=this.$2b("event"),o.rounded()&&(g.style.MozBorderRadius="5px",g.style.webkitBorderRadius="5px",g.style.borderRadius="5px");var b=[],w="Top"===this.eventTextLayer,$=this.eventStartTime,D=this.eventEndTime,k=this.eventTextAlignment,C=this.eventTextLeftIndent;if("Floats"===this.eventTextLayer)$&&(b.push("<div unselectable='on' style='float:left; font-size:"),b.push(this.eventTimeFontSize),b.push(";color:"),b.push(this.eventTimeFontColor),b.push(";font-family:"),b.push(this.eventTimeFontFamily),b.push("'>"),b.push(DayPilot.Date.hours(e.start().d,"Clock12Hours"===n.timeFormat)),b.push("</div>")),D&&(b.push("<div unselectable='on' style='float:right;font-size:"),b.push(this.eventTimeFontSize),b.push(";color:"),b.push(this.eventTimeFontColor),b.push(";font-family:"),b.push(this.eventTimeFontFamily),b.push("'>"),b.push(DayPilot.Date.hours(e.end().d,"Clock12Hours"===n.timeFormat)),b.push("</div>")),b.push("<div unselectable='on' style='"),b.push("font-size:"),b.push(this.eventFontSize),b.push(";color:"),b.push(this.eventFontColor),b.push(";font-family:"),b.push(this.eventFontFamily),"Center"===k&&b.push(";text-align:center;"),b.push("'>"),e.client.innerHTML()?b.push(e.client.innerHTML()):b.push(e.text()),b.push("</div>");else if($&&("Left"===k?(b.push("<div unselectable='on' style='position:absolute;text-align:left;height:1px;font-size:1px;width:100%'><div unselectable='on' style='font-size:"),b.push(this.eventTimeFontSize),b.push(";color:"),b.push(this.eventTimeFontColor),b.push(";font-family:"),b.push(this.eventTimeFontFamily),b.push(";text-align:right;"),b.push("width:"),b.push(C-4),b.push("px;"),b.push("><span style='background-color:")):(b.push("<div unselectable='on' style='position:absolute;text-align:left;height:1px;font-size:1px;width:100%'><div unselectable='on' style='font-size:"),b.push(this.eventTimeFontSize),b.push(";color:"),b.push(this.eventTimeFontColor),b.push(";font-family:"),b.push(this.eventTimeFontFamily),b.push(";'><span style='background-color:")),b.push(m),b.push("' unselectable='on'>"),e.part.startsHere?b.push(DayPilot.Date.hours(e.start().d,"Clock12Hours"===n.timeFormat)):b.push("~"),b.push("</span></div></div>")),D&&(b.push("<div unselectable='on' style='position:absolute;text-align:right;height:1px;font-size:1px;width:100%'><div unselectable='on' style='margin-right:4px;font-size:"),b.push(this.eventTimeFontSize),b.push(";color:"),b.push(this.eventTimeFontColor),b.push(";font-family:"),b.push(this.eventTimeFontFamily),b.push(";'><span style='background-color:"),b.push(m),b.push("' unselectable='on'>"),e.part.endsHere?b.push(DayPilot.Date.hours(e.end().d,"Clock12Hours"===n.timeFormat)):b.push("~"),b.push("</span></div></div>")),"Left"===k){h=$?C:0;b.push("<div style='margin-top:0px;height:"),b.push(o.eventHeight()-2),b.push("px;"),b.push(";overflow:hidden;text-align:left;padding-left:"),b.push(h),b.push("px;font-size:"),b.push(this.eventFontSize),b.push(";color:"),b.push(this.eventFontColor),b.push(";font-family:"),b.push(this.eventFontFamily),b.push("' unselectable='on'>"),e.client.innerHTML()?b.push(e.client.innerHTML()):b.push(e.text()),b.push("</div>")}else"Center"===k&&(w?(b.push("<div style='position:absolute; text-align:center; width: 98%; height:1px; font-size: 1px;'>"),b.push("<span style='background-color:"),b.push(m),b.push(";font-size:"),b.push(this.eventFontSize),b.push(";color:"),b.push(this.eventFontColor),b.push(";font-family:"),b.push(this.eventFontFamily),b.push("' unselectable='on'>"),e.client.innerHTML()?b.push(e.client.innerHTML()):b.push(e.text()),b.push("</span>"),b.push("</div>")):(b.push("<div style='margin-top:0px;height:"),b.push(o.eventHeight()-2),b.push("px;"),b.push(";overflow:hidden;text-align:center;font-size:"),b.push(this.eventFontSize),b.push(";color:"),b.push(this.eventFontColor),b.push(";font-family:"),b.push(this.eventFontFamily),b.push("' unselectable='on'>"),e.client.innerHTML()?b.push(e.client.innerHTML()):b.push(e.text()),b.push("</div>")));g.innerHTML=b.join(""),f.appendChild(g)}if(d.areas)for(var x=d.areas,P=0;P<x.length;P++){if("Visible"===(p=x[P]).v){y=DayPilot.Areas.createArea(f,e,p);f.appendChild(y)}}this.elements.events.push(f),t?this.cells[l][i].body.appendChild(f):this.nav.events.appendChild(f),n.multiselect.$2y(f.event)&&n.multiselect.add(f.event,!0);var S=f;if(n.$2a()){if("function"==typeof n.onAfterEventRender){var T={};T.e=S.event,T.div=S,n.onAfterEventRender(T)}}else n.afterEventRender&&n.afterEventRender(S.event,S)},this.$2s=function(e){a.start||n.$2z(this,e)},this.$2t=function(e){n.$2A(this,e)},this.$2w=function(e){var i=this,a=i.event;if(void 0!==t&&!t.movingEvent&&!t.resizingEvent){var s=DayPilot.mo3(i,e);if(s){!function(){var e=i;if(!e.active){var t=[];"Disabled"!==n.eventDeleteHandling&&t.push({action:"JavaScript",v:"Hover",w:17,h:17,top:2,right:2,css:n.$2b("_event_delete"),js:function(e){n.$2B(e)}});var a=e.event.cache?e.event.cache.areas:e.event.data.areas;a&&a.length>0&&(t=t.concat(a)),DayPilot.Areas.showAreas(e,e.event,null,t)}}(),n.cssOnly&&n.$2C(i.event).each(function(e){DayPilot.Util.addClass(e,n.$2b("_event_hover"))});if(!n.cellMode&&s.x<=6&&a.client.resizeEnabled()?a.part.startsHere?(i.style.cursor="w-resize",i.dpBorder="left"):i.style.cursor="not-allowed":!n.cellMode&&i.clientWidth-s.x<=6&&a.client.resizeEnabled()?a.part.endsHere?(i.style.cursor="e-resize",i.dpBorder="right"):i.style.cursor="not-allowed":i.style.cursor="default",void 0!==DayPilotBubble&&n.bubble&&"Disabled"!==n.eventHoverHandling)if(t.movingEvent||t.resizingEvent)DayPilotBubble.hideActive();else this.$2D&&s.x===this.$2D.x&&s.y===this.$2D.y||(this.$2D=s,n.bubble.showEvent(i.event))}}},this.$2x=function(e){var t=this;void 0!==DayPilotBubble&&n.bubble&&n.bubble.hideOnMouseOut(),t.style.cursor="",n.cssOnly&&n.$2C(t.event).each(function(e){DayPilot.Util.removeClass(e,n.$2b("_event_hover"))}),DayPilot.Areas.hideAreas(t,e)},this.$2u=function(){return n.$2E(this.event),!1},this.$2v=function(e){if(!a.start){var i=this,s=i.event,o=s.part.row,l=s.part.colStart,r=s.part.line,d=s.part.colWidth;e=e||window.event;var h=DayPilot.Util.mouseButton(e);if(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),h.left)if(void 0!==DayPilotBubble&&n.bubble&&DayPilotBubble.hideActive(),t.movingEvent=null,"w-resize"===this.style.cursor||"e-resize"===this.style.cursor){var c={start:{}};c.start.x=l,c.start.y=o,c.event=i.event,c.width=DayPilot.Date.daysSpan(c.event.start().d,c.event.end().d)+1,c.direction=this.style.cursor,t.resizingEvent=c}else if("move"===this.style.cursor||s.client.moveEnabled()){n.$2q();var u=DayPilot.mo3(n.nav.events,e);if(!u)return;var f=n.$2F(u.x,u.y);if(!f)return;var v=DayPilot.Date.daysDiff(s.start(),n.rows[o].start),p=7*f.y+f.x-(7*o+l);v&&(p+=v);var y={start:{}};y.start.x=l,y.start.y=o,y.start.line=r,y.offset=n.eventMoveToPosition?0:p,y.colWidth=d,y.event=i.event,y.coords=u,t.movingEvent=y}}},this.temp={},this.temp.getPosition=function(){if(!n.coords)return null;if(!(e=n.$2F(n.coords.x,n.coords.y)))return null;var e,t=new DayPilot.Date(n.$2r(e.x,e.y));return(e={}).start=t,e.end=t.addDays(1),e},this.$2G={};var a=n.$2G;a.active=!1,a.start=!1,a.timeouts=[],a.onEventTouchStart=function(e){if(!a.active&&!a.start){a.clearTimeouts(),a.start=!0,a.active=!1;var t=this,i=n.tapAndHoldTimeout;a.timeouts.push(window.setTimeout(function(){a.active=!0,a.start=!1;var i=a.relativeCoords(e);a.startMoving(t,i),e.preventDefault()},i)),e.stopPropagation()}},a.onEventTouchMove=function(e){a.clearTimeouts(),a.start=!1},a.onEventTouchEnd=function(e){a.clearTimeouts(),a.start&&n.$2H(this,!1),window.setTimeout(function(){a.start=!1,a.active=!1},500)},a.onMainTouchStart=function(e){if(!a.active&&!a.start){a.clearTimeouts(),a.start=!0,a.active=!1;var t=n.tapAndHoldTimeout;a.timeouts.push(window.setTimeout(function(){a.active=!0,a.start=!1,e.preventDefault();var t=a.relativeCoords(e);a.startRange(t)},t))}},a.onMainTouchMove=function(e){if(a.clearTimeouts(),a.start=!1,a.active){e.preventDefault();var t=a.relativeCoords(e);if(a.moving)return void a.updateMoving(t);a.range&&a.updateRange(t)}},a.onMainTouchEnd=function(e){if(a.clearTimeouts(),a.active){if(a.moving){a.moving;var t=a.moving.event,i=n.shadow.start,s=n.shadow.position,o=a.moving.offset;n.$2q(),a.moving=null,n.$2I(t,i.x,i.y,o,e,s)}if(a.range){var l=a.range,r=(i=new DayPilot.Date(n.$2r(l.from.x,l.from.y))).addDays(l.width);a.range=null,n.$2J(i,r)}}window.setTimeout(function(){a.start=!1,a.active=!1},500)},a.clearTimeouts=function(){for(var e=0;e<a.timeouts.length;e++)clearTimeout(a.timeouts[e]);a.timeouts=[]},a.relativeCoords=function(e){var t=n.nav.events,i=e.touches[0].pageX,a=e.touches[0].pageY,s=DayPilot.abs(t);return{x:i-s.x,y:a-s.y,toString:function(){return"x: "+this.x+", y:"+this.y}}},a.startMoving=function(e,t){n.$2q();var i=e.event,s=n.$2F(t.x,t.y);if(s){var o=DayPilot.Date.daysDiff(i.start(),n.rows[i.part.row].start),l=7*s.y+s.x-(7*i.part.row+i.part.colStart);o&&(l+=o);var r={start:{}};r.start.x=i.part.colStart,r.start.y=i.part.row,r.start.line=i.part.line,r.offset=n.eventMoveToPosition?0:l,r.colWidth=i.part.colWidth,r.event=i,r.coords=t,a.moving=r,a.updateMoving(t)}},a.updateMoving=function(e){var t=n.$2F(e.x,e.y);if(t){var i=n.$2K(t);n.$2q();var s=a.moving.event,o=a.moving.offset,l=n.cellMode?1:DayPilot.Date.daysSpan(s.start().d,s.end().d)+1;l<1&&(l=1),n.$2m(t.x,t.y,i,l,o,s)}},a.startRange=function(e){var t=n.$2F(e.x,e.y);if(t){n.$2q();var i={start:{}};i.start.x=t.x,i.start.y=t.y,i.x=t.x,i.y=t.y,i.width=1,a.range=i,a.updateRange(e)}},a.updateRange=function(e){var t=n.$2F(e.x,e.y);if(t){n.$2q();var i=a.range.start,s=7*i.y+i.x,o=7*t.y+t.x,l=Math.abs(o-s)+1;l<1&&(l=1);var r=s<o?i:t;a.range.width=l,a.range.from={x:r.x,y:r.y},n.$2m(r.x,r.y,0,l,0,null)}},this.isWeekend=function(e){return 0===e.dayOfWeek()||6===e.dayOfWeek()},this.$2L=function(){var e=this.startDate.lastDayOfMonth();if(this.showWeekend)return e;for(;this.isWeekend(e);)e=e.addDays(-1);return e},this.$22=function(){if("string"==typeof this.startDate&&(this.startDate=DayPilot.Date.fromStringSortable(this.startDate)),"Month"===this.viewType?this.startDate=this.startDate.firstDayOfMonth():this.startDate=this.startDate.getDatePart(),this.firstDate=this.startDate.firstDayOfWeek(o.getWeekStart()),!this.showWeekend){for(var e=this.startDate.addMonths(-1).getMonth(),t=new DayPilot.Date(this.firstDate).addDays(6);this.isWeekend(t);)t=t.addDays(-1);t.getMonth()===e&&(this.firstDate=DayPilot.Date.addDays(this.firstDate,7))}var i;this.startDate;if("Month"===this.viewType){var a=this.$2L().d,s=DayPilot.Date.daysDiff(this.firstDate,a)+1;i=Math.ceil(s/7)}else i=this.weeks;this.days=7*i,this.rows=[];for(var l=0;l<i;l++){var r={};r.start=DayPilot.Date.addDays(this.firstDate,7*l),r.end=DayPilot.Date.addDays(r.start,this.$2g()),r.events=[],r.lines=[],r.index=l,r.minHeight=this.cellHeight,r.calendar=this,r.belongsHere=function(e){return e.end.getTime()===e.start.getTime()&&e.start.getTime()===this.start.getTime()||!(e.end.getTime()<=this.start.getTime()||e.start.getTime()>=this.end.getTime())},r.getPartStart=function(e){return DayPilot.Date.max(this.start,e.start())},r.getPartEnd=function(e){return DayPilot.Date.min(this.end,e.end())},r.getStartColumn=function(e){var t=this.getPartStart(e);return DayPilot.Date.daysDiff(this.start,t)},r.getWidth=function(e){return DayPilot.Date.daysSpan(this.getPartStart(e),this.getPartEnd(e))+1},r.putIntoLine=function(e,t,i,n){for(var a=this,s=0;s<this.lines.length;s++){if((o=this.lines[s]).isFree(t,i))return o.addEvent(e,t,i,n,s),s}var o;return(o=[]).isFree=function(e,t){for(var i=!0,n=0;n<this.length;n++){var a=this[n];e+t-1<a.part.colStart||e>a.part.colStart+a.part.colWidth-1||(i=!1)}return i},o.addEvent=function(e,t,i,n,s){e.part.colStart=t,e.part.colWidth=i,e.part.row=n,e.part.line=s,e.part.startsHere=a.start.getTime()<=e.start().getTime(),e.part.endsHere=a.end.getTime()>=e.end().getTime(),this.push(e)},o.addEvent(e,t,i,n,this.lines.length),this.lines.push(o),this.lines.length-1},r.getStart=function(){for(var e=0;e<n.rows.length&&e<this.index;e++)n.rows[e].getHeight()},r.getHeight=function(){return Math.max(this.lines.length*o.lineHeight()+n.cellHeaderHeight+n.cellMarginBottom,this.calendar.cellHeight)},this.rows.push(r)}this.$2M=DayPilot.Date.addDays(this.firstDate,7*i)},this.$2N=function(){switch(this.heightSpec){case"Auto":for(var e=o.headerHeight(),t=0;t<this.rows.length;t++)e+=this.rows[t].getHeight();return e;case"Fixed":return this.height}},this.$2O=function(e,t){return 7*t.y+t.x-(7*e.y+e.x)+1},this.$2P={},this.$2P.scope=null,this.$2P.notify=function(){n.$2P.scope&&n.$2P.scope.$apply()},this.debug=new DayPilot.Debug(this),this.$2Q=function(){var e=this.nav.top;this.nav.top.dp=this,e.setAttribute("unselectable","on"),e.style.MozUserSelect="none",e.style.KhtmlUserSelect="none",e.style.WebkitUserSelect="none",e.style.WebkitTapHighlightColor="rgba(0,0,0,0)",e.style.WebkitTouchCallout="none",e.style.position="relative",this.width&&(e.style.width=this.width),e.onselectstart=function(e){return!1},this.cssOnly?e.className=this.$2b("_main"):e.style.border="1px solid "+this.borderColor,this.hideUntilInit&&(e.style.visibility="hidden"),this.visible||(e.style.display="none"),e.onmousemove=this.$2R,e.ontouchstart=a.onMainTouchStart,e.ontouchmove=a.onMainTouchMove,e.ontouchend=a.onMainTouchEnd,this.$20=document.createElement("div"),this.$20.style.display="none",this.nav.top.appendChild(this.$20);var t=document.createElement("div");t.style.position="relative",t.style.height=o.headerHeight()+"px",t.oncontextmenu=function(){return!1},this.nav.top.appendChild(t),this.nav.header=t;var i=document.createElement("div");i.style.zoom="1";var n=document.createElement("div");n.style.position="relative",i.appendChild(n),this.nav.top.appendChild(i),this.nav.scrollable=i,this.nav.events=n},this.$2R=function(e){n.coords=DayPilot.mo3(n.nav.events,e);var i=n.coords;if(i){var a=n.$2F(i.x,i.y);if(a)if(t.resizingEvent){n.$2q();var s=t.resizingEvent;s.start;if("w-resize"===s.direction){c=a;var o=s.event.end().d;DayPilot.Date.getDate(o).getTime()===o.getTime()&&(o=DayPilot.Date.addDays(o,-1));var l=n.$2S(o);u=n.$2O(a,l)}else c=n.$2S(s.event.start().d),u=n.$2O(c,a);u<1&&(u=1),n.$2m(c.x,c.y,0,u)}else if(t.movingEvent){if(n.debug.message("mousemove/moving start coords: "+t.movingEvent.coords.x+" "+t.movingEvent.coords.y),n.debug.message("mousemove/current coords: "+i.x+" "+i.y),i.x===t.movingEvent.coords.x&&i.y===t.movingEvent.coords.y)return;var r=n.$2K(a);n.$2q();var d=t.movingEvent.event,h=t.movingEvent.offset;(u=n.cellMode?1:DayPilot.Date.daysSpan(d.start().d,d.end().d)+1)<1&&(u=1),n.$2m(a.x,a.y,r,u,h,d)}else if(t.timeRangeSelecting){t.cancelCellClick=!0,n.$2q();var c,u,f=7*(c=t.timeRangeSelecting).y+c.x,v=7*a.y+a.x;(u=Math.abs(v-f)+1)<1&&(u=1);var p=f<v?c:a;t.timeRangeSelecting.from={x:p.x,y:p.y},t.timeRangeSelecting.width=u,t.timeRangeSelecting.moved=!0,n.$2m(p.x,p.y,0,u,0,null)}}},this.$2K=function(e){for(var t=e.relativeY,i=n.rows[e.y],a=n.cellHeaderHeight,s=o.lineHeight(),l=i.lines.length,r=0;r<i.lines.length;r++){if(i.lines[r].isFree(e.x,1)){l=r;break}}var d=Math.floor((t-a+s/2)/s);d=Math.min(l,d);return d=Math.max(0,d)},this.message=function(e,t,i,a){if(null!==e){t=t||this.messageHideAfter||2e3,i=i||"#ffffff",a=a||"#000000";var s,l=o.headerHeight();if(this.nav.message)s=n.nav.message;else{(s=document.createElement("div")).setAttribute("unselectable","on"),s.style.position="absolute",s.style.right="0px",s.style.left="0px",s.style.top=l+"px",s.style.opacity=.8,s.style.filter="alpha(opacity=80)",s.style.display="none",s.onmousemove=function(){s.messageTimeout&&!s.status&&clearTimeout(s.messageTimeout)},s.onmouseout=function(){"none"!==n.nav.message.style.display&&(s.messageTimeout=setTimeout(n.$2T,500))},this.cssOnly||(s.style.textAlign="left");var r=document.createElement("div");r.setAttribute("unselectable","on"),r.onclick=function(){n.nav.message.style.display="none"},this.cssOnly?r.className=this.$2b("_message"):r.style.padding="5px",s.appendChild(r);var d=document.createElement("div");d.setAttribute("unselectable","on"),d.style.position="absolute",this.cssOnly?d.className=this.$2b("_message_close"):(d.style.top="5px",d.style.right=DayPilot.sw(n.nav.scroll)+5+"px",d.style.color=i,d.style.lineHeight="100%",d.style.cursor="pointer",d.style.fontWeight="bold",d.innerHTML="X"),d.onclick=function(){n.nav.message.style.display="none"},s.appendChild(d),this.nav.top.appendChild(s),this.nav.message=s}var h=function(){n.nav.message.style.opacity=.8;var o=n.nav.message.firstChild;n.cssOnly||(o.style.backgroundColor=a,o.style.color=i),o.innerHTML=e;DayPilot.fade(n.nav.message,.2,function(){s.messageTimeout=setTimeout(n.$2T,t)})};clearTimeout(s.messageTimeout),"none"!==this.nav.message.style.display?DayPilot.fade(n.nav.message,-.2,h):h()}},this.message.show=function(e){n.message(e)},this.message.hide=function(){n.$2T()},this.$2T=function(){DayPilot.fade(n.nav.message,-.2,function(){n.nav.message.style.display="none"})},this.$2U=function(e){"Parent100Pct"===n.heightSpec&&n.$26()},this.$26=function(){var e=this.nav.scrollable;if("Parent100Pct"===this.heightSpec||"Fixed"===this.heightSpec?(e.style.top=this.headerHeight+"px",e.style.bottom="0px",e.style.left="0px",e.style.right="0px",e.style.overflow="auto",e.style.position="absolute"):e.style.position="relative","Parent100Pct"===this.heightSpec){this.nav.top.style.height="100%";this.nav.top.clientHeight}else this.nav.top.style.height=this.$2N()+"px";for(var t=0;t<this.cells.length;t++)for(var i=0;i<this.cells[t].length;i++)this.cells[t][i].style.top=this.$2n(i)+"px",this.cells[t][i].style.height=this.rows[i].getHeight()+"px";this.$2V()},this.$2F=function(e,t){for(var i=Math.floor(this.nav.top.clientWidth/this.$2g()),n=Math.min(Math.floor(e/i),this.$2g()-1),a=null,s=0,o=0,l=0,r=0;r<this.rows.length;r++){if(t<(o+=this.rows[r].getHeight())){s=t-l,a=r;break}l=o}null===a&&(a=this.rows.length-1);var d={};return d.x=n,d.y=a,d.relativeY=s,d},this.$2S=function(e){for(var t=DayPilot.Date.daysDiff(this.firstDate,e),i={x:0,y:0};t>=7;)i.y++,t-=7;return i.x=t,i},this.$2V=function(){var e=DayPilot.sw(this.nav.scrollable);this.nav.header.style.marginRight=e+"px"};var s=null;this.$25=function(){var e=this.nav.header,t=this.nav.events;this.cells=[];for(var i=0;i<this.$2g();i++){this.cells[i]=[];var a=this.headerProperties?this.headerProperties[i]:null,l=i+o.getWeekStart();if(l>6&&(l-=7),!a)(a={}).html=o.locale().dayNames[l],this.cssOnly||(a.backColor=this.headerBackColor);if("function"==typeof n.onBeforeHeaderRender){var r={header:{}};r.header.dayOfWeek=l;var d=["html","backColor","cssClass"];DayPilot.Util.copyProps(a,r.header,d),n.onBeforeHeaderRender(r),DayPilot.Util.copyProps(r.header,a,d)}var h=document.createElement("div");h.setAttribute("unselectable","on"),h.style.position="absolute",h.style.left=this.$2p()*i+"%",h.style.width=this.$2p()+"%",h.style.top="0px",h.style.height=o.headerHeight()+"px",function(e){h.onclick=function(){n.$2W(e)}}(l);var c=document.createElement("div");c.setAttribute("unselectable","on"),c.className=this.$2b("_header_inner"),c.innerHTML=a.html,h.appendChild(c),this.cssOnly?(h.className=this.$2b("_header"),a&&(a.cssClass&&DayPilot.Util.addClass(h,a.cssClass),a.backColor&&(c.style.background=a.backColor))):(c.style.position="absolute",c.style.top="0px",c.style.bottom="0px",c.style.left="0px",c.style.right="0px",c.style.backgroundColor=a.backColor,c.style.fontFamily=this.headerFontFamily,c.style.fontSize=this.headerFontSize,c.style.color=this.headerFontColor,c.style.textAlign="center",c.style.cursor="default",c.className=this.$2b("header"),i!==this.$2g()-1&&(c.style.borderRight="1px solid "+this.borderColor)),e.appendChild(h);for(var u=0;u<this.rows.length;u++)this.$2X(i,u,t)}if(!DayPilot.contains(this.nav.top.childNodes,s)&&this.numberFormat){var f=document.createElement("div");f.style.position="absolute",f.style.padding="2px",f.style.top="0px",f.style.left="0px",f.style.backgroundColor="#FF6600",f.style.color="white",f.innerHTML="DEMO",s=f,this.nav.top.appendChild(f)}},this.$24=function(){for(var e=0;e<this.cells.length;e++)for(var t=0;t<this.cells[e].length;t++)this.cells[e][t].onclick=null;this.nav.header.innerHTML="",this.nav.events.innerHTML=""},this.$2X=function(e,t,i){var a,s=this.rows[t],l=new DayPilot.Date(DayPilot.Date.addDays(this.firstDate,7*t+e)),r=null;if(a=this.cellProperties?this.cellProperties[t*this.$2g()+e]:null)r=a.headerHtml;else{var d=l.getDay();r=1===d?o.locale().monthNames[l.getMonth()]+" "+d:d+""}a||((a={}).business=!n.isWeekend(l));if("function"==typeof n.onBeforeCellRender){var h={cell:{}};h.cell.areas=null,h.cell.backColor=null,h.cell.backImage=null,h.cell.backRepeat=null,h.cell.business=n.isWeekend(l),h.cell.headerHtml=r,h.cell.headerBackColor=null,h.cell.cssClass=null,h.cell.html=null,h.cell.start=l,h.cell.end=h.cell.start.addDays(1),DayPilot.Util.copyProps(a,h.cell),n.onBeforeCellRender(h),DayPilot.Util.copyProps(h.cell,a,["areas","backColor","backImage","backRepeat","business","headerHtml","headerBackColor","cssClass","html"])}var c=document.createElement("div");c.setAttribute("unselectable","on"),c.style.position="absolute",c.style.cursor="default",c.style.left=this.$2p()*e+"%",c.style.width=this.$2p()+"%",c.style.top=this.$2n(t)+"px",c.style.height=s.getHeight()+"px",c.d=l,c.x=e,c.y=t,c.props=a;var u=this.startDate.addMonths(-1).getMonth(),f=this.startDate.addMonths(1).getMonth(),v=this.startDate.getMonth(),p=document.createElement("div");p.setAttribute("unselectable","on"),c.appendChild(p),this.cssOnly&&(p.className=this.$2b("_cell_inner")),this.cssOnly?(p.className=this.$2b("_cell_inner"),l.getMonth()===v?c.className=this.$2b("_cell"):l.getMonth()===u?c.className=this.$2b("_cell")+" "+this.$2b("_previous"):l.getMonth()===f&&(c.className=this.$2b("_cell")+" "+this.$2b("_next")),a&&(a.cssClass&&DayPilot.Util.addClass(c,a.cssClass),a.business&&DayPilot.Util.addClass(c,this.$2b("_cell_business")),a.backColor&&(p.style.backgroundColor=a.backColor),a.backImage&&(p.style.backgroundImage="url('"+a.backImage+"')"),a.backRepeat&&(p.style.backgroundRepeat=a.backRepeat))):(p.style.position="absolute",p.style.left="0px",p.style.right="0px",p.style.top="0px",p.style.bottom="0px",l.getMonth()===v?c.className=this.$2b("cell"):l.getMonth()===u?c.className=this.$2b("cell")+" "+this.$2b("previous"):l.getMonth()===f&&(c.className=this.$2b("cell")+" "+this.$2b("next")),a?(a.backColor&&(p.style.background=a.backColor),a.cssClass&&(p.className+=" "+this.$2b(a.cssClass)),a.backImage&&(p.style.backgroundImage="url('"+a.backImage+"')"),a.backRepeat&&(p.style.backgroundRepeat=a.backRepeat)):p.style.background=this.$2Y(l),e!==this.$2g()-1&&(p.style.borderRight="1px solid "+this.innerBorderColor),0===t&&(p.style.borderTop="1px solid "+this.borderColor),p.style.borderBottom="1px solid "+this.innerBorderColor),c.onmousedown=this.$2Z,c.onmousemove=this.$30,c.onmouseout=this.$31,c.oncontextmenu=this.$32,c.onclick=this.$33,c.ondblclick=this.$34;var y=document.createElement("div");if(y.setAttribute("unselectable","on"),y.style.height=this.cellHeaderHeight+"px",this.cssOnly?(a&&a.headerBackColor&&(y.style.background=a.headerBackColor),y.className=this.$2b("_cell_header")):(a&&a.headerBackColor?y.style.backgroundColor=a.headerBackColor:this.cellHeaderBackColor&&(y.style.backgroundColor=this.cellHeaderBackColor),y.style.paddingRight="2px",y.style.textAlign="right",y.style.fontFamily=this.cellHeaderFontFamily,y.style.fontSize=this.cellHeaderFontSize,y.style.color=this.cellHeaderFontColor,y.className=this.$2b("cellheader")),y.innerHTML=r,p.appendChild(y),a&&a.html){var g=document.createElement("div");g.setAttribute("unselectable","on"),g.style.height=s.getHeight()-this.cellHeaderHeight+"px",g.style.overflow="hidden",g.innerHTML=a.html,p.appendChild(g)}if(this.cellMode){var m=document.createElement("div");m.setAttribute("unselectable","on"),m.style.height=this.cellHeight-this.cellHeaderHeight+"px",m.style.overflow="auto",m.style.position="relative";var b=document.createElement("div");b.setAttribute("unselectable","on"),b.style.paddingTop="1px",b.style.paddingBottom="1px",m.appendChild(b),p.appendChild(m),c.body=b,c.scrolling=m}if(c.props)for(var w=c.props.areas||[],$=0;$<w.length;$++){var D=w[$];if("Visible"===D.v){var k=DayPilot.Areas.createArea(c,c.props,D);c.appendChild(k)}}this.cells[e][t]=c,i.appendChild(c)},this.$30=function(){var e=this;e.props&&DayPilot.Areas.showAreas(e,e.props)},this.$31=function(e){this.props&&DayPilot.Areas.hideAreas(this,e)},this.$32=function(){return function(e){var t=new DayPilot.Date(e),i=t.addDays(1),a=new DayPilot.Selection(t,i,null,n);n.contextMenuSelection&&n.contextMenuSelection.show(a)}(this.d),!1},this.$34=function(){var e=this.d;if(n.timeouts){for(var t in n.timeouts)window.clearTimeout(n.timeouts[t]);n.timeouts=null}if("Disabled"!==n.timeRangeDoubleClickHandling){var i=new DayPilot.Date(e),a=i.addDays(1);n.$35(i,a)}},this.$33=function(){if(!t.cancelCellClick){var e=this.d,i=function(e){var t=new DayPilot.Date(e),i=t.addDays(1);n.$2J(t,i)};if("Disabled"===n.timeRangeSelectedHandling||"Disabled"!==n.timeRangeDoubleClickHandling){n.timeouts||(n.timeouts=[]);n.timeouts.push(window.setTimeout(function(e){return function(){i(e)}}(e),n.doubleClickTimeout))}else i(e)}},this.$2Z=function(e){var i=this,a=i.x,s=i.y;if(t.cancelCellClick=!1,i.scrolling){var o=DayPilot.mo3(i.scrolling,e),l=DayPilot.sw(i.scrolling),r=i.scrolling.offsetWidth;if(o.x>r-l)return}"Disabled"!==n.timeRangeSelectedHandling&&(n.$2q(),t.timeRangeSelecting={root:n,x:a,y:s,from:{x:a,y:s},width:1})},this.$2g=function(){return this.showWeekend?7:5},this.$2p=function(){return this.showWeekend?14.285:20},this.$2Y=function(e){return 6===e.getUTCDay()||0===e.getUTCDay()?this.nonBusinessBackColor:this.backColor},this.$2n=function(e){for(var t=0,i=0;i<e;i++)t+=this.rows[i].getHeight();return t},this.clearSelection=function(){this.$2q()},this.$36=function(e,t,i){var a={};a.action=e,a.parameters=i,a.data=t,a.header=this.$37();var s="JSON"+DayPilot.JSON.stringify(a);__doPostBack(n.uniqueID,s)},this.$38=function(e,t,i,a){if(this.$39()){void 0===a&&(a="CallBack");var s={};s.action=e,s.type=a,s.parameters=t,s.data=i,s.header=this.$37();var o="JSON"+DayPilot.JSON.stringify(s);this.backendUrl?DayPilot.request(this.backendUrl,this.$3a,o,this.$3b):"function"==typeof WebForm_DoCallback&&WebForm_DoCallback(this.uniqueID,o,this.$1X,null,this.callbackError,!0)}else n.debug.message("Callback invoked without the server-side backend specified. Callback canceled.","warning")},this.$39=function(){return!!this.backendUrl||!("function"!=typeof WebForm_DoCallback||!this.uniqueID)},this.$3b=function(e){if("function"==typeof n.onAjaxError){var t={};t.request=e,n.onAjaxError(t)}else"function"==typeof n.ajaxError&&n.ajaxError(e)},this.$3a=function(e){n.$1X(e.responseText)},this.$37=function(){var e={};return e.v=this.v,e.control="dpm",e.id=this.id,e.visibleStart=new DayPilot.Date(this.firstDate),e.visibleEnd=e.visibleStart.addDays(this.days),e.clientState=this.clientState,e.cssOnly=n.cssOnly,e.cssClassPrefix=n.cssClassPrefix,e.startDate=n.startDate,e.showWeekend=this.showWeekend,e.headerBackColor=this.headerBackColor,e.backColor=this.backColor,e.nonBusinessBackColor=this.nonBusinessBackColor,e.locale=this.locale,e.timeFormat=this.timeFormat,e.weekStarts=this.weekStarts,e.viewType=this.viewType,e.weeks=this.weeks,e.selected=n.multiselect.events(),e.hashes=n.hashes,e},this.visibleStart=function(){return new DayPilot.Date(this.firstDate)},this.visibleEnd=function(){return n.visibleStart().addDays(n.days)},this.$3c=function(e,t,i,a){if("PostBack"===e)n.postBack2(t,i,a);else if("CallBack"===e)n.$38(t,i,a,"CallBack");else if("Immediate"===e)n.$38(t,i,a,"Notify");else if("Queue"===e)n.queue.add(new DayPilot.Action(this,t,i,a));else{if("Notify"!==e)throw"Invalid event invocation type";"Notify"===o.notifyType()?n.$38(t,i,a,"Notify"):n.queue.add(new DayPilot.Action(n,t,i,a))}},this.$3d=function(e,t){var i=n.$3e(t),a={};a.args=e,a.guid=i,n.$38("Bubble",a)},this.$3e=function(e){var t=DayPilot.guid();return this.bubbles||(this.bubbles=[]),this.bubbles[t]=e,t},this.eventClickPostBack=function(e,t){this.$36("EventClick",t,e)},this.eventClickCallBack=function(e,t){this.$38("EventClick",e,t)},this.$2z=function(e,i){t.movingEvent=null,t.resizingEvent=null;var a=(i=i||window.event).ctrlKey,s=i.metaKey;if(i.cancelBubble=!0,i.stopPropagation&&i.stopPropagation(),void 0!==DayPilotBubble&&DayPilotBubble.hideActive(),"Disabled"!==n.eventDoubleClickHandling){if(n.timeouts){for(var o in n.timeouts)window.clearTimeout(n.timeouts[o]);n.timeouts=[]}else n.timeouts=[];n.timeouts.push(window.setTimeout(function(e,t,i){return function(){n.$2H(e,t,i)}}(e,a,s),n.doubleClickTimeout))}else n.$2H(e,a,s)},this.$2H=function(e,t,i){var a=e.event;if(a.client.clickEnabled())if(n.$2a()){var s={};if(s.e=a,s.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof n.onEventClick&&(n.onEventClick(s),s.preventDefault.value))return;switch(n.eventClickHandling){case"PostBack":n.eventClickPostBack(a);break;case"CallBack":n.eventClickCallBack(a);break;case"Select":n.$3f(e,a,t,i);break;case"ContextMenu":(o=a.client.contextMenu())?o.show(a):n.contextMenu&&n.contextMenu.show(a);break;case"Bubble":n.bubble&&n.bubble.showEvent(a)}"function"==typeof n.onEventClicked&&n.onEventClicked(s)}else switch(n.eventClickHandling){case"PostBack":n.eventClickPostBack(a);break;case"CallBack":n.eventClickCallBack(a);break;case"JavaScript":n.onEventClick(a);break;case"Select":n.$3f(e,a,t,i);break;case"ContextMenu":var o;(o=a.client.contextMenu())?o.show(a):n.contextMenu&&n.contextMenu.show(a);break;case"Bubble":n.bubble&&n.bubble.showEvent(a)}},this.$2B=function(e){if(n.$2a()){var t={};if(t.e=e,t.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof n.onEventDelete&&(n.onEventDelete(t),t.preventDefault.value))return;switch(n.eventDeleteHandling){case"PostBack":n.eventDeletePostBack(e);break;case"CallBack":n.eventDeleteCallBack(e);break;case"Update":n.events.remove(e)}"function"==typeof n.onEventDeleted&&n.onEventDeleted(t)}else switch(n.eventDeleteHandling){case"PostBack":n.eventDeletePostBack(e);break;case"CallBack":n.eventDeleteCallBack(e);break;case"JavaScript":n.onEventDelete(e)}},this.eventDeletePostBack=function(e,t){this.$36("EventDelete",e,t)},this.eventDeleteCallBack=function(e,t){this.$38("EventDelete",e,t)},this.eventDoubleClickPostBack=function(e,t){this.$36("EventDoubleClick",t,e)},this.eventDoubleClickCallBack=function(e,t){this.$38("EventDoubleClick",e,t)},this.$2A=function(e,t){if(void 0!==DayPilotBubble&&DayPilotBubble.hideActive(),n.timeouts){for(var i in n.timeouts)window.clearTimeout(n.timeouts[i]);n.timeouts=null}t=t||window.event;var a=e.event;if(n.$2a()){var s={};if(s.e=a,s.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof n.onEventDoubleClick&&(n.onEventDoubleClick(s),s.preventDefault.value))return;switch(n.eventDoubleClickHandling){case"PostBack":n.eventDoubleClickPostBack(a);break;case"CallBack":n.eventDoubleClickCallBack(a);break;case"Select":n.$3f(e,a,t.ctrlKey,t.metaKey);break;case"Bubble":n.bubble&&n.bubble.showEvent(a)}"function"==typeof n.onEventDoubleClicked&&n.onEventDoubleClicked(s)}else switch(n.eventDoubleClickHandling){case"PostBack":n.eventDoubleClickPostBack(a);break;case"CallBack":n.eventDoubleClickCallBack(a);break;case"JavaScript":n.onEventDoubleClick(a);break;case"Select":n.$3f(e,a,t.ctrlKey,t.metaKey);break;case"Bubble":n.bubble&&n.bubble.showEvent(a)}},this.$3f=function(e,t,i,a){n.$3g(e,t,i,a)},this.eventSelectPostBack=function(e,t,i){var n={};n.e=e,n.change=t,this.$36("EventSelect",i,n)},this.eventSelectCallBack=function(e,t,i){var n={};n.e=e,n.change=t,this.$38("EventSelect",n,i)},this.$3g=function(e,t,i,a){var s=n.multiselect,o=s.isSelected(t);if(i||a||!o||1!==s.list.length)if(n.$2a()){s.previous=s.events();var l={};if(l.e=t,l.selected=s.isSelected(t),l.ctrl=i,l.meta=a,l.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof n.onEventSelect&&(n.onEventSelect(l),l.preventDefault.value))return;switch(n.eventSelectHandling){case"PostBack":n.eventSelectPostBack(t,r);break;case"CallBack":"undefined"!=typeof WebForm_InitCallback&&(window.__theFormPostData="",window.__theFormPostCollection=[],WebForm_InitCallback()),n.eventSelectCallBack(t,r);break;case"Update":s.$3h(e,i)}"function"==typeof n.onEventSelected&&(l.change=s.isSelected(t)?"selected":"deselected",l.selected=s.isSelected(t),n.onEventSelected(l))}else{s.previous=s.events(),s.$3h(e,i);var r=s.isSelected(t)?"selected":"deselected";switch(n.eventSelectHandling){case"PostBack":n.eventSelectPostBack(t,r);break;case"CallBack":"undefined"!=typeof WebForm_InitCallback&&(window.__theFormPostData="",window.__theFormPostCollection=[],WebForm_InitCallback()),n.eventSelectCallBack(t,r);break;case"JavaScript":n.onEventSelect(t,r)}}},this.eventRightClickPostBack=function(e,t){this.$36("EventRightClick",t,e)},this.eventRightClickCallBack=function(e,t){this.$38("EventRightClick",e,t)},this.$2E=function(e){if(this.event=e,!e.client.rightClickEnabled())return!1;if(n.$2a()){var t={};if(t.e=e,t.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof n.onEventRightClick&&(n.onEventRightClick(t),t.preventDefault.value))return;switch(n.eventRightClickHandling){case"PostBack":n.eventRightClickPostBack(e);break;case"CallBack":n.eventRightClickCallBack(e);break;case"ContextMenu":(i=e.client.contextMenu())?i.show(e):n.contextMenu&&n.contextMenu.show(this.event);break;case"Bubble":n.bubble&&n.bubble.showEvent(e)}"function"==typeof n.onEventRightClicked&&n.onEventRightClicked(t)}else switch(n.eventRightClickHandling){case"PostBack":n.eventRightClickPostBack(e);break;case"CallBack":n.eventRightClickCallBack(e);break;case"JavaScript":n.onEventRightClick(e);break;case"ContextMenu":var i;(i=e.client.contextMenu())?i.show(e):n.contextMenu&&n.contextMenu.show(this.event);break;case"Bubble":n.bubble&&n.bubble.showEvent(e)}return!1},this.eventMenuClickPostBack=function(e,t,i){var n={};n.e=e,n.command=t,this.$36("EventMenuClick",i,n)},this.eventMenuClickCallBack=function(e,t,i){var n={};n.e=e,n.command=t,this.$38("EventMenuClick",n,i)},this.$3i=function(e,t,i){switch(i){case"PostBack":n.eventMenuClickPostBack(t,e);break;case"CallBack":n.eventMenuClickCallBack(t,e)}},this.eventMovePostBack=function(e,t,i,n,a){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var s={};s.e=e,s.newStart=t,s.newEnd=i,s.position=a,this.$36("EventMove",n,s)},this.eventMoveCallBack=function(e,t,i,n,a){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var s={};s.e=e,s.newStart=t,s.newEnd=i,s.position=a,this.$38("EventMove",s,n)},this.$2I=function(e,t,i,a,s,o){var l=DayPilot.Date.getTime(e.start().d),r=DayPilot.Date.getDate(e.end().d);r.getTime()!==e.end().d.getTime()&&(r=DayPilot.Date.addDays(r,1));var d=DayPilot.Date.diff(e.end().d,r),h=this.$2r(t,i);h=DayPilot.Date.addDays(h,-a);var c=DayPilot.Date.daysSpan(e.start().d,e.end().d)+1,u=DayPilot.Date.addDays(h,c),f=new DayPilot.Date(DayPilot.Date.addTime(h,l)),v=new DayPilot.Date(DayPilot.Date.addTime(u,d));if(n.$2a()){var p={};if(p.e=e,p.newStart=f,p.newEnd=v,p.position=o,p.ctrl=!1,s&&(p.ctrl=s.ctrlKey),p.shift=!1,s&&(p.shift=s.shiftKey),p.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof n.onEventMove&&(n.onEventMove(p),p.preventDefault.value))return;switch(n.eventMoveHandling){case"PostBack":n.eventMovePostBack(e,f,v,null,o);break;case"CallBack":n.eventMoveCallBack(e,f,v,null,o);break;case"Notify":n.eventMoveNotify(e,f,v,null,o);break;case"Update":e.start(f),e.end(v),n.events.update(e)}"function"==typeof n.onEventMoved&&n.onEventMoved(p)}else switch(n.eventMoveHandling){case"PostBack":n.eventMovePostBack(e,f,v,null,o);break;case"CallBack":n.eventMoveCallBack(e,f,v,null,o);break;case"JavaScript":n.onEventMove(e,f,v,s.ctrlKey,s.shiftKey,o);break;case"Notify":n.eventMoveNotify(e,f,v,null,o)}},this.eventMoveNotify=function(e,t,i,a,s){var o=new DayPilot.Event(e.copy(),this);e.start(t),e.end(i),e.commit(),n.update(),this.$3j("Notify",o,t,i,a,s)},this.$3j=function(e,t,i,n,a,s){var o={};o.e=t,o.newStart=i,o.newEnd=n,o.position=s,this.$3c(e,"EventMove",o,a)},this.eventResizePostBack=function(e,t,i,n){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var a={};a.e=e,a.newStart=t,a.newEnd=i,this.$36("EventResize",n,a)},this.eventResizeCallBack=function(e,t,i,n){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var a={};a.e=e,a.newStart=t,a.newEnd=i,this.$38("EventResize",a,n)},this.$3k=function(e,t,i){var a=DayPilot.Date.getTime(e.start().d),s=DayPilot.Date.getDate(e.end().d);DayPilot.Date.equals(s,e.end().d)||(s=DayPilot.Date.addDays(s,1));var o=DayPilot.Date.diff(e.end().d,s),l=this.$2r(t.x,t.y),r=DayPilot.Date.addDays(l,i),d=new DayPilot.Date(DayPilot.Date.addTime(l,a)),h=new DayPilot.Date(DayPilot.Date.addTime(r,o));if(n.$2a()){var c={};if(c.e=e,c.newStart=d,c.newEnd=h,c.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof n.onEventResize&&(n.onEventResize(c),c.preventDefault.value))return;switch(n.eventResizeHandling){case"PostBack":n.eventResizePostBack(e,d,h);break;case"CallBack":n.eventResizeCallBack(e,d,h);break;case"Notify":n.eventResizeNotify(e,d,h);break;case"Update":e.start(d),e.end(h),n.events.update(e)}"function"==typeof n.onEventResized&&n.onEventResized(c)}else switch(n.eventResizeHandling){case"PostBack":n.eventResizePostBack(e,d,h);break;case"CallBack":n.eventResizeCallBack(e,d,h);break;case"JavaScript":n.onEventResize(e,d,h);break;case"Notify":n.eventResizeNotify(e,d,h)}},this.eventResizeNotify=function(e,t,i,a){var s=new DayPilot.Event(e.copy(),this);e.start(t),e.end(i),e.commit(),n.update(),this.$3l("Notify",s,t,i,a)},this.$3l=function(e,t,i,n,a){var s={};s.e=t,s.newStart=i,s.newEnd=n,this.$3c(e,"EventResize",s,a)},this.timeRangeSelectedPostBack=function(e,t,i){var n={};n.start=e,n.end=t,this.$36("TimeRangeSelected",i,n)},this.timeRangeSelectedCallBack=function(e,t,i){var n={};n.start=e,n.end=t,this.$38("TimeRangeSelected",n,i)},this.$2J=function(e,t){if(n.$2a()){var i={};if(i.start=e,i.end=t,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof n.onTimeRangeSelect&&(n.onTimeRangeSelect(i),i.preventDefault.value))return;switch(n.timeRangeSelectedHandling){case"PostBack":n.timeRangeSelectedPostBack(e,t),n.clearSelection();break;case"CallBack":n.timeRangeSelectedCallBack(e,t),n.clearSelection()}"function"==typeof n.onTimeRangeSelected&&n.onTimeRangeSelected(i)}else switch(n.timeRangeSelectedHandling){case"PostBack":n.timeRangeSelectedPostBack(e,t),n.clearSelection();break;case"CallBack":n.timeRangeSelectedCallBack(e,t),n.clearSelection();break;case"JavaScript":n.onTimeRangeSelected(e,t)}},this.timeRangeMenuClickPostBack=function(e,t,i){var n={};n.selection=e,n.command=t,this.$36("TimeRangeMenuClick",i,n)},this.timeRangeMenuClickCallBack=function(e,t,i){var n={};n.selection=e,n.command=t,this.$38("TimeRangeMenuClick",n,i)},this.$3m=function(e,t,i){switch(i){case"PostBack":n.timeRangeMenuClickPostBack(t,e);break;case"CallBack":n.timeRangeMenuClickCallBack(t,e)}},this.headerClickPostBack=function(e,t){this.$36("HeaderClick",t,e)},this.headerClickCallBack=function(e,t){this.$38("HeaderClick",e,t)},this.$2W=function(e){this.data;var t={$13:e};if(n.$2a()){var i={header:{}};if(i.header.dayOfWeek=e,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof n.onHeaderClick&&(n.onHeaderClick(i),i.preventDefault.value))return;switch(n.headerClickHandling){case"PostBack":n.headerClickPostBack(t);break;case"CallBack":n.headerClickCallBack(t)}"function"==typeof n.onHeaderClicked&&n.onHeaderClicked(i)}else switch(n.headerClickHandling){case"PostBack":n.headerClickPostBack(t);break;case"CallBack":n.headerClickCallBack(t);break;case"JavaScript":n.onHeaderClick(t)}},this.timeRangeDoubleClickPostBack=function(e,t,i){var n={};n.start=e,n.end=t,this.$36("TimeRangeDoubleClick",i,n)},this.timeRangeDoubleClickCallBack=function(e,t,i){var n={};n.start=e,n.end=t,this.$38("TimeRangeDoubleClick",n,i)},this.$35=function(e,t){if(n.$2a()){var i={};if(i.start=e,i.end=t,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof n.onTimeRangeDoubleClick&&(n.onTimeRangeDoubleClick(i),i.preventDefault.value))return;switch(n.timeRangeDoubleClickHandling){case"PostBack":n.timeRangeDoubleClickPostBack(e,t);break;case"CallBack":n.timeRangeDoubleClickCallBack(e,t)}"function"==typeof n.onTimeRangeDoubleClicked&&n.onTimeRangeDoubleClicked(i)}else switch(n.timeRangeDoubleClickHandling){case"PostBack":n.timeRangeDoubleClickPostBack(e,t);break;case"CallBack":n.timeRangeDoubleClickCallBack(e,t);break;case"JavaScript":n.onTimeRangeDoubleClick(e,t)}},this.commandCallBack=function(e,t){this.$3n();var i={};i.command=e,this.$38("Command",i,t)},this.$3o=function(e){for(var t=0;t<n.elements.events.length;t++){var i=n.elements.events[t];if(i.event===e||i.event.data===e.data)return i}return null},this.$2C=function(e){for(var t={list:[],each:function(e){if(e)for(var t=0;t<this.list.length;t++)e(this.list[t])}},i=0;i<this.elements.events.length;i++){var n=this.elements.events[i];n.event.data===e.data&&t.list.push(n)}return t},this.$3p=function(e){var t=document.createElement("div");t.style.position="absolute",t.style.top="-2000px",t.style.left="-2000px",t.className=this.$2b(e),document.body.appendChild(t);var i=t.offsetHeight,n=t.offsetWidth;document.body.removeChild(t);var a={};return a.height=i,a.width=n,a},this.$3q={};var o=this.$3q;o.lineHeight=function(){return o.eventHeight()+n.lineSpace},o.rounded=function(){return"Rounded"===n.eventCorners},o.loadFromServer=function(){return!!n.backendUrl&&(void 0===n.events.list||!n.events.list)},o.locale=function(){return DayPilot.Locale.find(n.locale)},o.getWeekStart=function(){return n.showWeekend?n.weekStarts:1},o.notifyType=function(){var e;if("Immediate"===n.notifyCommit)e="Notify";else{if("Queue"!==n.notifyCommit)throw"Invalid notifyCommit value: "+n.notifyCommit;e="Queue"}return e},o.eventHeight=function(){if(n.$1W.eventHeight)return n.$1W.eventHeight;var e=n.$3p("_event_height").height;return e||(e=n.eventHeight),n.$1W.eventHeight=e,e},o.headerHeight=function(){if(n.$1W.headerHeight)return n.$1W.headerHeight;var e=n.$3p("_header_height").height;return e||(e=n.headerHeight),n.$1W.headerHeight=e,e},o.timeFormat=function(){return"Auto"!==n.timeFormat?n.timeFormat:o.locale().timeFormat},this.multiselect={},this.multiselect.initList=[],this.multiselect.list=[],this.multiselect.divs=[],this.multiselect.previous=[],this.multiselect.$3r=function(){var e=n.multiselect;return DayPilot.JSON.stringify(e.events())},this.multiselect.events=function(){var e=n.multiselect,t=[];t.ignoreToJSON=!0;for(var i=0;i<e.list.length;i++)t.push(e.list[i]);return t},this.multiselect.$3s=function(){},this.multiselect.$3h=function(e,t){var i=n.multiselect;if(i.isSelected(e.event))if(n.allowMultiSelect)if(t)i.remove(e.event,!0);else{var a=i.list.length;i.clear(!0),a>1&&i.add(e.event,!0)}else i.clear(!0);else n.allowMultiSelect&&t?i.add(e.event,!0):(i.clear(!0),i.add(e.event,!0));i.redraw(),i.$3s()},this.multiselect.$2y=function(e){var t=n.multiselect;return t.$3t(e,t.initList)},this.multiselect.$3u=function(){for(var e=n.multiselect,t=[],i=0;i<e.list.length;i++){var a=e.list[i];t.push(a.value())}alert(t.join("\n"))},this.multiselect.add=function(e,t){var i=n.multiselect;-1===i.indexOf(e)&&i.list.push(e),t||i.redraw()},this.multiselect.remove=function(e,t){var i=n.multiselect,a=i.indexOf(e);-1!==a&&i.list.splice(a,1)},this.multiselect.clear=function(e){var t=n.multiselect;t.list=[],e||t.redraw()},this.multiselect.redraw=function(){for(var e=n.multiselect,t=0;t<n.elements.events.length;t++){var i=n.elements.events[t];e.isSelected(i.event)?e.$3v(i):e.$3w(i)}},this.multiselect.$3v=function(e){var t=n.multiselect,i=n.cssOnly?n.$2b("_selected"):n.$2b("selected");e=t.$3x(e);DayPilot.Util.addClass(e,i),t.divs.push(e)},this.multiselect.$3x=function(e){return n.cssOnly?e:e.firstChild},this.multiselect.$3y=function(){for(var e=n.multiselect,t=0;t<e.divs.length;t++){var i=e.divs[t];e.$3w(i,!0)}e.divs=[]},this.multiselect.$3w=function(e,t){var i=n.multiselect,a=n.cssOnly?n.$2b("_selected"):n.$2b("selected"),s=i.$3x(e);if(s&&s.className&&-1!==s.className.indexOf(a)&&(s.className=s.className.replace(a,"")),!t){var o=DayPilot.indexOf(i.divs,e);-1!==o&&i.divs.splice(o,1)}},this.multiselect.isSelected=function(e){return n.multiselect.$3t(e,n.multiselect.list)},this.multiselect.indexOf=function(e){return DayPilot.indexOf(n.multiselect.list,e)},this.multiselect.$3t=function(e,t){if(!t)return!1;for(var i=0;i<t.length;i++){var n=t[i];if(e===n)return!0;if("function"==typeof n.value){if(null!==n.value()&&null!==e.value()&&n.value()===e.value())return!0;if(null===n.value()&&null===e.value()&&n.recurrentMasterId()===e.recurrentMasterId()&&e.start().toStringSortable()===n.start())return!0}else{if(null!==n.value&&null!==e.value()&&n.value===e.value())return!0;if(null===n.value&&null===e.value()&&n.recurrentMasterId===e.recurrentMasterId()&&e.start().toStringSortable()===n.start)return!0}}return!1},this.events.find=function(e){if(!n.events.list||void 0===n.events.list.length)return null;for(var t=n.events.list.length,i=0;i<t;i++)if(n.events.list[i].id===e)return new DayPilot.Event(n.events.list[i],n);return null},this.events.findRecurrent=function(e,t){if(!n.events.list||void 0===n.events.list.length)return null;for(var i=n.events.list.length,a=0;a<i;a++)if(n.events.list[a].recurrentMasterId===e&&n.events.list[a].start.getTime()===t.getTime())return new DayPilot.Event(n.events.list[a],n);return null},this.events.update=function(e,t){var i={};i.oldEvent=new DayPilot.Event(e.copy(),n),i.newEvent=new DayPilot.Event(e.temp(),n);var a=new DayPilot.Action(n,"EventUpdate",i,t);return e.commit(),n.$1V&&n.update(),n.$2P.notify(),a},this.events.remove=function(e,t){var i={};i.e=new DayPilot.Event(e.data,n);var a=new DayPilot.Action(n,"EventRemove",i,t),s=DayPilot.indexOf(n.events.list,e.data);return n.events.list.splice(s,1),n.$1V&&n.update(),n.$2P.notify(),a},this.events.add=function(e,t){e.calendar=n,n.events.list||(n.events.list=[]),n.events.list.push(e.data);var i={};i.e=e;var a=new DayPilot.Action(n,"EventAdd",i,t);return n.$1V&&n.update(),n.$2P.notify(),a},this.queue={},this.queue.list=[],this.queue.list.ignoreToJSON=!0,this.queue.add=function(e){if(e){if(!e.isAction)throw"DayPilot.Action object required for queue.add()";n.queue.list.push(e)}},this.queue.notify=function(e){var t={};t.actions=n.queue.list,n.$38("Notify",t,e,"Notify"),n.queue.list=[]},this.queue.clear=function(){n.queue.list=[]},this.queue.pop=function(){return n.queue.list.pop()},this.$29=function(e){if(e&&(this.autoRefreshEnabled=!0),this.autoRefreshEnabled&&!(this.autoRefreshCount>=this.autoRefreshMaxCount)){this.$3n();var t=this.autoRefreshInterval;if(!t||t<10)throw"The minimum autoRefreshInterval is 10 seconds";this.autoRefreshTimeout=window.setTimeout(function(){n.$3z()},1e3*this.autoRefreshInterval)}},this.$3n=function(){this.autoRefreshTimeout&&window.clearTimeout(this.autoRefreshTimeout)},this.$3z=function(){if(!t.eventResizing&&!t.eventMoving&&!t.timeRangeSelecting){var e=!1;if("function"==typeof this.onAutoRefresh){var i={};i.i=this.autoRefreshCount,i.preventDefault=function(){this.preventDefault.value=!0},n.onAutoRefresh(i),i.preventDefault.value&&(e=!0)}!e&&this.$39()&&this.commandCallBack(this.autoRefreshCommand),this.autoRefreshCount++}this.autoRefreshCount<this.autoRefreshMaxCount&&(this.autoRefreshTimeout=window.setTimeout(function(){n.$3z()},1e3*this.autoRefreshInterval))},this.$3A=function(e){if(this.cells){var t=!(e=e||{}).eventsOnly;n.cssOnly||(n.cssOnly=!0,DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0.")),n.$21(),n.$22(),n.$23(),t&&(n.$24(),n.$25()),n.$26(),n.$27(),n.$28(),this.visible?this.show():this.hide()}},this.update=function(){this.$3A()},this.dispose=function(){var e=n;e.nav.top&&(e.$3n(),e.$21(),e.nav.top.removeAttribute("style"),e.nav.top.removeAttribute("class"),e.nav.top.innerHTML="",e.nav.top.dp=null,e.nav.top=null,t.unregister(e))},this.$3B=function(){t.globalHandlers||(t.globalHandlers=!0,DayPilot.re(document,"mouseup",t.gMouseUp)),DayPilot.re(window,"resize",this.$2U)},this.$27=function(){"hidden"===this.nav.top.style.visibility&&(this.nav.top.style.visibility="visible")},this.show=function(){n.visible=!0,n.nav.top.style.display=""},this.hide=function(){n.visible=!1,n.nav.top.style.display="none"},this.$3C=function(){if(this.id&&this.id.tagName)this.nav.top=this.id;else{if("string"!=typeof this.id)throw"DayPilot.Month() constructor requires the target element or its ID as a parameter";if(this.nav.top=document.getElementById(this.id),!this.nav.top)throw"DayPilot.Month: The placeholder element not found: '"+e+"'."}},this.$3D=function(){this.$3C(),this.$22(),this.$2Q(),this.$25(),this.$3B(),this.$29(),this.$38("Init"),t.register(this)},this.init=function(){if(this.$3C(),!this.nav.top.dp){var e=o.loadFromServer();if(n.cssOnly||(n.cssOnly=!0,window.console&&window.console.log&&window.console.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0.")),e)return this.$3D(),void(this.$1V=!0);this.$22(),this.$23(),this.$2Q(),this.$25(),this.$27(),this.$28(),this.$26(),this.$3B(),this.messageHTML&&this.message(this.messageHTML),this.$1Z(null,!1),this.$29(),t.register(this),this.$1V=!0,this.$3E()}},this.$3F=null,this.$3G=function(e){var t={events:{preInit:function(){var e=this.data;e&&(DayPilot.isArray(e.list)?n.events.list=e.list:n.events.list=e)}}};for(var i in this.$3F=t,e)if(t[i]){var a=t[i];a.data=e[i],a.preInit&&a.preInit()}else n[i]=e[i]},this.$3E=function(){var e=this.$3F;for(var t in e){var i=e[t];i.postInit&&i.postInit()}},this.internal={},this.internal.initialized=function(){return n.$1V},this.internal.invokeEvent=this.$3c,this.internal.eventMenuClick=this.$3i,this.internal.timeRangeMenuClick=this.$3m,this.internal.bubbleCallBack=this.$3d,this.internal.findEventDiv=this.$3o,this.Init=this.init,this.$3G(i)},t.register=function(e){t.registered||(t.registered=[]);for(var i=0;i<t.registered.length;i++)if(t.registered[i]===e)return;t.registered.push(e)},t.unregister=function(e){var i=t.registered;if(i){var n=DayPilot.indexOf(i,e);-1!==n&&i.splice(n,1),0===i.length&&(i=null)}i||(DayPilot.ue(document,"mouseup",t.gMouseUp),t.globalHandlers=!1)},t.gMouseUp=function(e){if(t.movingEvent){var i=t.movingEvent;if(t.movingEvent=null,!(i.event&&i.event.calendar&&i.event.calendar.shadow&&i.event.calendar.shadow.start))return;var n=i.event.calendar,a=i.event,s=n.shadow.start,o=n.shadow.position,l=i.offset;n.$2q();e=e||window.event;return n.$2I(a,s.x,s.y,l,e,o),e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),!1}if(t.resizingEvent){i=t.resizingEvent;if(t.resizingEvent=null,!(i.event&&i.event.calendar&&i.event.calendar.shadow&&i.event.calendar.shadow.start))return;n=i.event.calendar,a=i.event,s=n.shadow.start;var r=n.shadow.width;return n.$2q(),n.$3k(a,s,r),e.cancelBubble=!0,!1}if(t.timeRangeSelecting){if(t.timeRangeSelecting.moved){var d=t.timeRangeSelecting,h=(n=d.root,(s=new DayPilot.Date(n.$2r(d.from.x,d.from.y))).addDays(d.width));n.$2J(s,h)}t.timeRangeSelecting=null}},DayPilot.MonthVisible.Month=t.Month,"undefined"!=typeof jQuery&&(jQuery.fn.daypilotMonth=function(e){var t=null,i=this.each(function(){if(!this.daypilot){var i=new DayPilot.Month(this.id,e);i.init(),this.daypilot=i,t||(t=i)}});return 1===this.length?t:i}),(e=DayPilot.am())&&e.directive("daypilotMonth",function(){return{restrict:"E",template:"<div></div>",replace:!0,link:function(e,t,i){var n=new DayPilot.Month(t[0]);n.$2P.scope=e,n.init();var a=i.id;a&&(e[a]=n);var s=e.$watch;s.call(e,i.daypilotConfig,function(e){for(var t in e)n[t]=e[t];n.update()}),s.call(e,i.daypilotEvents,function(e){n.events.list=e,n.$3A({eventsOnly:!0})},!0)}}}),"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),void 0===DayPilot)var DayPilot={};if(void 0===DayPilot.Global&&(DayPilot.Global={}),void 0===DayPilotNavigator)var DayPilotNavigator=DayPilot.NavigatorVisible={};if(function(){var e;void 0===DayPilot.Navigator&&(DayPilotNavigator={},DayPilot.Navigator=function(e,t){this.v="1659";var i=this;this.id=e,this.api=2,this.isNavigator=!0,this.weekStarts="Auto",this.selectMode="day",this.titleHeight=20,this.dayHeaderHeight=20,this.cellWidth=20,this.cellHeight=20,this.cssOnly=!0,this.cssClassPrefix="navigator_default",this.selectionStart=(new DayPilot.Date).getDatePart(),this.selectionEnd=null,this.selectionDay=null,this.showMonths=1,this.skipMonths=1,this.command="navigate",this.year=(new DayPilot.Date).getYear(),this.month=(new DayPilot.Date).getMonth()+1,this.showWeekNumbers=!1,this.weekNumberAlgorithm="Auto",this.rowsPerMonth="Six",this.orientation="Vertical",this.locale="en-us",this.visible=!0,this.timeRangeSelectedHandling="Bind",this.visibleRangeChangedHandling="Enabled",this.nav={},this.$0g=function(){this.root.dp=this,this.cssOnly?this.root.className=this.$0h("_main"):this.root.className=this.$0h("main"),"Horizontal"===this.orientation?(this.root.style.width=this.showMonths*(7*this.cellWidth+this.$0i())+"px",this.root.style.height=6*this.cellHeight+this.titleHeight+this.dayHeaderHeight+"px"):this.root.style.width=7*this.cellWidth+this.$0i()+"px",this.root.style.position="relative",this.visible||(this.root.style.display="none");var e=document.createElement("input");e.type="hidden",e.name=i.id+"_state",e.id=e.name,this.root.appendChild(e),this.state=e,this.startDate?this.startDate=new DayPilot.Date(this.startDate).firstDayOfMonth():this.startDate=new DayPilot.Date(DayPilot.Date.firstDayOfMonth(this.year,this.month)),this.calendars=[],this.selected=[],this.months=[]},this.$0j=function(){return 2===i.api},this.$0k=function(){this.root.innerHTML=""},this.$0h=function(e){var t=this.theme||this.cssClassPrefix;return t?t+e:""},this.$0l=function(e,t){var i=this.cssOnly?this.$0h("_"+t):this.$0h(t);DayPilot.Util.addClass(e,i)},this.$0m=function(e,t){var i=this.cssOnly?this.$0h("_"+t):this.$0h(t);DayPilot.Util.removeClass(e,i)},this.$0n=function(e,t){var a={cells:[],days:[],weeks:[]},s=this.startDate.addMonths(e),o=t.before,l=t.after,r=s.firstDayOfMonth(),d=r.firstDayOfWeek(n.weekStarts()),h=r.addMonths(1),c=DayPilot.Date.daysDiff(d.d,h.d),u="Auto"===this.rowsPerMonth?Math.ceil(c/7):6;a.rowCount=u;var f=(new DayPilot.Date).getDatePart(),v=7*this.cellWidth+this.$0i(),p=this.cellHeight*u+this.titleHeight+this.dayHeaderHeight;a.height=p;var y=document.createElement("div");y.style.width=v+"px",y.style.height=p+"px","Horizontal"===this.orientation?(y.style.position="absolute",y.style.left=v*e+"px",y.style.top="0px"):y.style.position="relative",this.cssOnly?y.className=this.$0h("_month"):y.className=this.$0h("month"),y.style.cursor="default",y.style.MozUserSelect="none",y.style.KhtmlUserSelect="none",y.style.WebkitUserSelect="none",y.month=a,this.root.appendChild(y);var g=this.titleHeight+this.dayHeaderHeight,m=document.createElement("div");m.style.position="absolute",m.style.left="0px",m.style.top="0px",m.style.width=this.cellWidth+"px",m.style.height=this.titleHeight+"px",m.style.lineHeight=this.titleHeight+"px",m.style.textAlign="left",m.setAttribute("unselectable","on"),this.cssOnly?m.className=this.$0h("_titleleft"):m.className=this.$0h("titleleft"),t.left&&(m.style.cursor="pointer",m.innerHTML="<span style='margin-left:2px;'>&lt;</span>",m.onclick=this.$0o),y.appendChild(m),this.tl=m;var b=document.createElement("div");b.style.position="absolute",b.style.left=this.cellWidth+"px",b.style.top="0px",b.style.width=5*this.cellWidth+this.$0i()+"px",b.style.height=this.titleHeight+"px",b.style.lineHeight=this.titleHeight+"px",b.style.textAlign="center",b.setAttribute("unselectable","on"),this.cssOnly?b.className=this.$0h("_title"):b.className=this.$0h("title"),b.innerHTML=n.locale().monthNames[s.getMonth()]+" "+s.getYear(),y.appendChild(b),this.ti=b;var w=document.createElement("div");w.style.position="absolute",w.style.left=6*this.cellWidth+this.$0i()+"px",w.style.top="0px",w.style.width=this.cellWidth+"px",w.style.height=this.titleHeight+"px",w.style.lineHeight=this.titleHeight+"px",w.style.textAlign="right",w.setAttribute("unselectable","on"),this.cssOnly?w.className=this.$0h("_titleright"):w.className=this.$0h("titleright"),t.right&&(w.style.cursor="pointer",w.innerHTML="<span style='margin-right:2px;'>&gt;</span>",w.onclick=this.$0p),y.appendChild(w),this.tr=w;var $=this.$0i();if(this.showWeekNumbers)for(var D=0;D<u;D++){var k=d.addDays(7*D),C=null;switch(this.weekNumberAlgorithm){case"Auto":C=0===n.weekStarts()?k.weekNumber():k.weekNumberISO();break;case"US":C=k.weekNumber();break;case"ISO8601":C=k.weekNumberISO();break;default:throw"Unknown weekNumberAlgorithm value."}(P=document.createElement("div")).style.position="absolute",P.style.left="0px",P.style.top=D*this.cellHeight+g+"px",P.style.width=this.cellWidth+"px",P.style.height=this.cellHeight+"px",P.style.lineHeight=this.cellHeight+"px",P.style.textAlign="right",P.setAttribute("unselectable","on"),this.cssOnly?P.className=this.$0h("_weeknumber"):P.className=this.$0h("weeknumber"),P.innerHTML="<span style='margin-right: 2px'>"+C+"</span>",y.appendChild(P),a.weeks.push(P)}for(var x=0;x<7;x++){var P;a.cells[x]=[],(P=document.createElement("div")).style.position="absolute",P.style.left=x*this.cellWidth+$+"px",P.style.top=this.titleHeight+"px",P.style.width=this.cellWidth+"px",P.style.height=this.dayHeaderHeight+"px",P.style.lineHeight=this.dayHeaderHeight+"px",P.style.textAlign="right",P.setAttribute("unselectable","on"),this.cssOnly?P.className=this.$0h("_dayheader"):P.className=this.$0h("dayheader"),P.innerHTML="<span style='margin-right: 2px'>"+this.$0q(x)+"</span>",y.appendChild(P),a.days.push(P);for(D=0;D<u;D++){k=d.addDays(7*D+x);var S=this.$0r(k)&&"none"!==this.$0s(),T=k.getMonth()===s.getMonth(),M=k.getTime()<s.getTime(),H=k.getTime()>s.getTime(),A=document.createElement("div");a.cells[x][D]=A,A.day=k,A.x=x,A.y=D,A.isCurrentMonth=T,this.cssOnly?A.className=this.$0h(T?"_day":"_dayother"):A.className=this.$0h(T?"day":"dayother"),i.$0l(A,"cell"),k.getTime()===f.getTime()&&T&&this.$0l(A,"today"),0!==k.dayOfWeek()&&6!==k.dayOfWeek()||this.$0l(A,"weekend"),A.style.position="absolute",A.style.left=x*this.cellWidth+$+"px",A.style.top=D*this.cellHeight+g+"px",A.style.width=this.cellWidth+"px",A.style.height=this.cellHeight+"px",A.style.lineHeight=this.cellHeight+"px";var E=document.createElement("div");E.style.position="absolute",this.cssOnly?E.className=k.getTime()===f.getTime()&&T?this.$0h("_todaybox"):this.$0h("_daybox"):E.className=k.getTime()===f.getTime()&&T?this.$0h("todaybox"):this.$0h("daybox"),i.$0l(E,"cell_box"),E.style.left="0px",E.style.top="0px",E.style.right="0px",E.style.bottom="0px",A.appendChild(E);var B=null;if(this.cells&&this.cells[k.toStringSortable()]&&((B=this.cells[k.toStringSortable()]).cssClass||B.css)&&DayPilot.Util.addClass(A,B.cssClass||B.css),T||o&&M||l&&H){var R=document.createElement("div");R.innerHTML=k.getDay(),R.style.position="absolute",R.style.left="0px",R.style.top="0px",R.style.right="0px",R.style.bottom="0px",i.$0l(R,"cell_text"),A.style.cursor="pointer",A.isClickable=!0,B&&B.html&&(R.innerHTML=B.html),R.style.marginRight="2px",A.appendChild(R)}A.setAttribute("unselectable","on"),A.onclick=this.$0t,A.onmousedown=this.$0u,A.onmousemove=this.$0v,y.appendChild(A),S&&(i.$0w(y,x,D),this.selected.push(A))}}var _=document.createElement("div");_.style.position="absolute",_.style.left="0px",_.style.top=g-2+"px",_.style.width=7*this.cellWidth+this.$0i()+"px",_.style.height="1px",_.style.fontSize="1px",_.style.lineHeight="1px",this.cssOnly?_.className=this.$0h("_line"):_.className=this.$0h("line"),y.appendChild(_),this.months.push(a)},this.$0w=function(e,t,n){var a=e.month.cells[t][n];i.$0l(a,"select")},this.$0x=function(e,t,n){var a=e.month.cells[t][n];i.$0m(a,"select")},this.$0i=function(){return this.showWeekNumbers?this.cellWidth:0},this.$0y=function(){if(this.items)for(var e=0;e<this.showMonths;e++)for(var t=0;t<7;t++)for(var i=0;i<6;i++){var n=this.months[e].cells[t][i];n&&(1===this.items[n.day.toStringSortable()]?this.$0l(n,"busy"):this.$0m(n,"busy"))}},this.$0z=function(){var e={};e.startDate=i.startDate,e.selectionStart=i.selectionStart,e.selectionEnd=i.selectionEnd.addDays(1),i.state.value=DayPilot.JSON.stringify(e)},this.$0s=function(){return(this.selectMode||"").toLowerCase()},this.$0A=function(){switch(this.$0s()){case"day":this.selectionEnd=this.selectionStart;break;case"week":this.selectionStart=this.selectionStart.firstDayOfWeek(n.weekStarts()),this.selectionEnd=this.selectionStart.addDays(6);break;case"month":this.selectionStart=this.selectionStart.firstDayOfMonth(),this.selectionEnd=this.selectionStart.lastDayOfMonth();break;case"none":this.selectionEnd=this.selectionStart;break;default:throw"Unkown selectMode value."}},this.select=function(e){var t=this.selectionStart,i=this.selectionEnd;this.selectionStart=new DayPilot.Date(e).getDatePart(),this.selectionDay=this.selectionStart;var n=!1,a=this.startDate;(this.selectionStart.getTime()<this.visibleStart().getTime()||this.selectionStart.getTime()>this.visibleEnd().getTime())&&(a=this.selectionStart.firstDayOfMonth()),a.toStringSortable()!==this.startDate.toStringSortable()&&(n=!0),this.startDate=a,this.$0A(),this.$0k(),this.$0g(),this.$0B(),this.$0y(),this.$0z(),t.equals(this.selectionStart)&&i.equals(this.selectionEnd)||this.$0C(),n&&this.$0D()},this.update=function(){i.cssOnly||(i.cssOnly=!0,DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0.")),this.$0k(),this.$0g(),this.$0A(),this.$0B(),this.$0E(),this.$0y(),this.$0z(),this.visible?this.show():this.hide()},this.$0F=function(e,t,i){var n={};n.action=e,n.parameters=i,n.data=t,n.header=this.$0G();var a="JSON"+DayPilot.JSON.stringify(n);this.backendUrl?DayPilot.request(this.backendUrl,this.$0H,a,this.$0I):WebForm_DoCallback(this.uniqueID,a,this.$0J,null,this.callbackError,!0)},this.$0I=function(e){if("function"==typeof i.onAjaxError){var t={};t.request=e,i.onAjaxError(t)}else"function"==typeof i.ajaxError&&i.ajaxError(e)},this.$0H=function(e){i.$0J(e.responseText)},this.$0K=function(e,t,n){var a={};a.action=e,a.parameters=n,a.data=t,a.header=this.$0G();var s="JSON"+DayPilot.JSON.stringify(a);__doPostBack(i.uniqueID,s)},this.$0G=function(){var e={};return e.v=this.v,e.startDate=this.startDate,e.selectionStart=this.selectionStart,e},this.$0L=function(e,t){"refresh"===e&&this.$0D()},this.$0q=function(e){var t=e+n.weekStarts();return t>6&&(t-=7),n.locale().dayNamesShort[t]},this.$0r=function(e){return null!==this.selectionStart&&null!==this.selectionEnd&&(this.selectionStart.getTime()<=e.getTime()&&e.getTime()<=this.selectionEnd.getTime())},this.$0u=function(e){},this.$0v=function(e){},this.$0t=function(e){var t=this.parentNode,n=this.parentNode.month,a=this.x,s=this.y,o=n.cells[a][s].day;if(n.cells[a][s].isClickable){i.clearSelection(),i.selectionDay=o;o=i.selectionDay;switch(i.$0s()){case"none":i.selectionStart=o,i.selectionEnd=o;break;case"day":var l=n.cells[a][s];i.$0w(t,a,s),i.selected.push(l),i.selectionStart=l.day,i.selectionEnd=l.day;break;case"week":for(var r=0;r<7;r++)i.$0w(t,r,s),i.selected.push(n.cells[r][s]);i.selectionStart=n.cells[0][s].day,i.selectionEnd=n.cells[6][s].day;break;case"month":var d=null,h=null;for(s=0;s<6;s++)for(a=0;a<7;a++){(l=n.cells[a][s])&&(l.day.getYear()===o.getYear()&&l.day.getMonth()===o.getMonth()&&(i.$0w(t,a,s),i.selected.push(l),null===d&&(d=l.day),h=l.day))}i.selectionStart=d,i.selectionEnd=h;break;default:throw"unknown selectMode"}i.$0z(),i.$0C()}},this.$0C=function(){var e=i.selectionStart,t=i.selectionEnd.addDays(1),n=DayPilot.Date.daysDiff(e.d,t.d),a=i.selectionDay;if(i.$0j()){var s={};if(s.start=e,s.end=t,s.day=a,s.days=n,s.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof i.onTimeRangeSelect&&(i.onTimeRangeSelect(s),s.preventDefault.value))return;switch(i.timeRangeSelectedHandling){case"Bind":if(o=DayPilot.Util.evalVariable(i.bound))(l={}).start=e,l.end=t,l.days=n,l.day=a,o.commandCallBack(i.command,l);break;case"None":break;case"PostBack":i.timeRangeSelectedPostBack(e,t,a)}"function"==typeof i.onTimeRangeSelected&&i.onTimeRangeSelected(s)}else switch(i.timeRangeSelectedHandling){case"Bind":var o,l;if(o=DayPilot.Util.evalVariable(i.bound))(l={}).start=e,l.end=t,l.days=n,l.day=a,o.commandCallBack(i.command,l);break;case"JavaScript":i.onTimeRangeSelected(e,t,a);break;case"None":break;case"PostBack":i.timeRangeSelectedPostBack(e,t,a)}},this.timeRangeSelectedPostBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.day=n,this.$0K("TimeRangeSelected",i,a)},this.$0p=function(e){i.$0M(i.skipMonths)},this.$0o=function(e){i.$0M(-i.skipMonths)},this.$0M=function(e){this.startDate=this.startDate.addMonths(e),this.$0k(),this.$0g(),this.$0B(),this.$0z(),this.$0D(),this.$0y()},this.visibleStart=function(){return i.startDate.firstDayOfMonth().firstDayOfWeek(n.weekStarts())},this.visibleEnd=function(){return i.startDate.firstDayOfMonth().addMonths(this.showMonths-1).firstDayOfWeek(n.weekStarts()).addDays(42)},this.$0D=function(){var e=this.visibleStart(),t=this.visibleEnd();if(i.$0j()){var n={};if(n.start=e,n.end=t,n.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof i.onVisibleRangeChange&&(i.onVisibleRangeChange(n),n.preventDefault.value))return;switch(this.visibleRangeChangedHandling){case"CallBack":this.visibleRangeChangedCallBack(null);break;case"PostBack":this.visibleRangeChangedPostBack(null)}"function"==typeof i.onVisibleRangeChanged&&i.onVisibleRangeChanged(n)}else switch(this.visibleRangeChangedHandling){case"CallBack":this.visibleRangeChangedCallBack(null);break;case"PostBack":this.visibleRangeChangedPostBack(null);break;case"JavaScript":this.onVisibleRangeChanged(e,t)}},this.visibleRangeChangedCallBack=function(e){this.$0F("Visible",e,{})},this.visibleRangeChangedPostBack=function(e){this.$0K("Visible",e,{})},this.$0J=function(e,t){e=DayPilot.Util.parseJSON(e);i.items=e.Items,i.cells=e.Cells,i.$0y()},this.$0B=function(){for(var e=0;e<this.showMonths;e++){var t=this.$0N(e);this.$0n(e,t)}this.root.style.height=this.$0O()+"px"},this.$0O=function(){if("Horizontal"===this.orientation){for(var e=0,t=0;t<this.months.length;t++){(n=this.months[t]).height>e&&(e=n.height)}return e}var i=0;for(t=0;t<this.months.length;t++){var n;i+=(n=this.months[t]).height}return i},this.$0N=function(e){if(this.internal.showLinks)return this.internal.showLinks;var t={};return t.left=0===e,t.right=0===e,t.before=0===e,t.after=e===this.showMonths-1,"Horizontal"===this.orientation&&(t.right=e===this.showMonths-1),t},this.$0P={},this.$0P.scope=null,this.$0P.notify=function(){i.$0P.scope&&i.$0P.scope.$apply()},this.internal={},this.internal.initialized=function(){return i.$0Q},this.$0R={};var n=this.$0R;n.locale=function(){return DayPilot.Locale.find(i.locale)},n.weekStarts=function(){if("Auto"===i.weekStarts){var e=n.locale();return e?e.weekStarts:0}return i.weekStarts},this.clearSelection=function(){for(var e=0;e<this.selected.length;e++){var t=this.selected[e];i.$0x(t.parentNode,t.x,t.y)}this.selected=[]},this.$0S=function(){return!!this.backendUrl&&(void 0===i.items||!i.items)},this.events={},this.$0E=function(){if(DayPilot.isArray(this.events.list)){this.items={};for(var e=0;e<this.events.list.length;e++){var t=this.events.list[e],i=this.$0T(t);for(var n in i)this.items[n]=1}}},this.$0T=function(e){for(var t=new DayPilot.Date(e.start),i=new DayPilot.Date(e.end),n={},a=t.getDatePart();a.getTime()<i.getTime();)n[a.toStringSortable()]=1,a=a.addDays(1);return n},this.show=function(){i.visible=!0,i.root.style.display=""},this.hide=function(){i.visible=!1,i.root.style.display="none"},this.$0U=function(){if(this.id&&this.id.tagName)this.nav.top=this.id;else{if("string"!=typeof this.id)throw"DayPilot.Navigator() constructor requires the target element or its ID as a parameter";if(this.nav.top=document.getElementById(this.id),!this.nav.top)throw"DayPilot.Navigator: The placeholder element not found: '"+e+"'."}this.root=this.nav.top},this.init=function(){(this.$0U(),this.root.dp)||(i.cssOnly||(i.cssOnly=!0,DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0.")),this.$0A(),this.$0g(),this.$0B(),this.$0E(),this.$0y(),this.$0V(),this.$0S()&&this.$0D(),this.$0Q=!0)},this.dispose=function(){var e=i;e.root&&(e.root.removeAttribute("style"),e.root.removeAttribute("class"),e.root.dp=null,e.root.innerHTML=null,e.root=null)},this.$0V=function(){this.root.dispose=this.dispose},this.Init=this.init},DayPilot.NavigatorVisible.Navigator=DayPilotNavigator.Navigator,"undefined"!=typeof jQuery&&(jQuery.fn.daypilotNavigator=function(e){var t=null,i=this.each(function(){if(!this.daypilot){var i=new DayPilot.Navigator(this.id);for(var n in this.daypilot=i,e)i[n]=e[n];i.Init(),t||(t=i)}});return 1===this.length?t:i}),(e=DayPilot.am())&&e.directive("daypilotNavigator",function(){return{restrict:"E",template:"<div id='{{id}};'></div>",compile:function(e,t){return e.replaceWith(this.template.replace("{{id}};",t.id)),function(e,t,i){var n=new DayPilot.Navigator(t[0]);n.$0P.scope=e,n.init();var a=i.id;a&&(e[a]=n),e.$watch.call(e,i.daypilotConfig,function(e){for(var t in e)n[t]=e[t];n.update()},!0)}}}}),"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded())}(),void 0===DayPilot)var DayPilot={};if(void 0===DayPilot.Global&&(DayPilot.Global={}),void 0===DayPilotScheduler)var DayPilotScheduler=DayPilot.SchedulerVisible={};if(function(){if(void 0===DayPilot.Scheduler){var e,t=(e=navigator.userAgent).indexOf("Mozilla/5.0")>-1&&e.indexOf("Android ")>-1&&e.indexOf("AppleWebKit")>-1&&!(e.indexOf("Chrome")>-1),i={};DayPilot.Scheduler=function(e,a){this.v="1659";var o=this;this.id=e,this.isScheduler=!0,this.hideUntilInit=!0,this.api=2,this.allowDefaultContextMenu=!1,this.allowEventOverlap=!0,this.allowMultiMove=!1,this.allowMultiRange=!1,this.allowMultiResize=!1,this.allowMultiSelect=!0,this.multiSelectRectangle="Disabled",this.autoRefreshCommand="refresh",this.autoRefreshEnabled=!1,this.autoRefreshInterval=60,this.autoRefreshMaxCount=20,this.autoScroll="Drag",this.blockOnCallBack=!1,this.borderColor="#000000",this.businessBeginsHour=9,this.businessEndsHour=18,this.cellBackColor="#FFFFD5",this.cellBackColorNonBusiness="#FFF4BC",this.cellBorderColor="#EAD098",this.cellDuration=60,this.cellGroupBy="Day",this.cellSelectColor="#316AC5",this.cellWidth=40,this.cellWidthSpec="Fixed",this.groupConcurrentEvents=!1,this.groupConcurrentEventsLimit=1,this.$81=!0,this.cellSweeping=!0,this.cellSweepingCacheSize=1e3,this.crosshairColor="Gray",this.crosshairOpacity=20,this.crosshairType="Header",this.doubleClickTimeout=300,this.dragOutAllowed=!1,this.durationBarColor="blue",this.durationBarHeight=3,this.durationBarVisible=!0,this.durationBarMode="Duration",this.durationBarDetached=!1,this.days=1,this.drawBlankCells=!0,this.dynamicEventRendering="Progressive",this.dynamicEventRenderingMargin=50,this.dynamicEventRenderingMarginX=null,this.dynamicEventRenderingMarginY=null,this.dynamicEventRenderingCacheSweeping=!1,this.dynamicEventRenderingCacheSize=200,this.dynamicLoading=!1,this.eventBorderColor="#000000",this.eventBorderVisible=!0,this.eventBackColor="#FFFFFF",this.eventEndSpec="DateTime",this.eventFontFamily="Tahoma, Arial",this.eventFontSize="8pt",this.eventFontColor="#000000",this.eventHeight=25,this.eventMoveMargin=5,this.eventMoveToPosition=!1,this.eventResizeMargin=5,this.eventStackingLineHeight=100,this.eventTapAndHoldHandling="Move",this.eventTextWrappingEnabled=!1,this.$82=!1,this.headerFontColor="#000000",this.headerFontFamily="Tahoma, Arial",this.headerFontSize="8pt",this.headerHeight=20,this.heightSpec="Auto",this.hideBorderFor100PctHeight=!1,this.hourFontFamily="Tahoma, Arial",this.hourFontSize="10pt",this.hourNameBackColor="#ECE9D8",this.hourNameBorderColor="#ACA899",this.layout="Auto",this.linkCreateHandling="Disabled",this.linkBottomMargin=10,this.locale="en-us",this.loadingLabelText="Loading...",this.loadingLabelVisible=!0,this.loadingLabelBackColor="orange",this.loadingLabelFontColor="#ffffff",this.loadingLabelFontFamily="Tahoma",this.loadingLabelFontSize="10pt",this.messageHideAfter=5e3,this.messageHideOnMouseOut=!0,this.multiMoveVerticalMode="Disabled",this.moveBy="Full",this.notifyCommit="Immediate",this.numberFormat=null,this.progressiveRowRendering=!0,this.progressiveRowRenderingPreload=25,this.tapAndHoldTimeout=500,this.timeHeaders=[{groupBy:"Default"},{groupBy:"Cell"}],this.treePreventParentUsage=!1,this.treeAutoExpand=!0,this.rowHeaderHideIconEnabled=!1,this.rowHeaderWidth=80,this.rowHeaderScrolling=!1,this.rowHeaderSplitterWidth=3,this.rowHeaderWidthAutoFit=!0,this.rowHeaderCols=null,this.rowMarginBottom=0,this.rowMarginTop=0,this.rowMinHeight=0,this.scale="CellDuration",this.scrollDelayDynamic=500,this.scrollDelayEvents=200,this.scrollDelayCells=20,this.scrollDelayFloats=0,this.scrollX=0,this.scrollY=0,this.shadow="Fill",this.showBaseTimeHeader=!0,this.showNonBusiness=!0,this.showToolTip=!0,this.snapToGrid=!0,this.startDate=(new DayPilot.Date).getDatePart(),this.syncResourceTree=!1,this.timeBreakColor="#000000",this.timeHeaderTextWrappingEnabled=!1,this.treeEnabled=!1,this.treeIndent=20,this.treeImageMarginLeft=5,this.treeImageMarginTop=5,this.timeFormat="Auto",this.useEventBoxes="Always",this.viewType="Resources",this.visible=!0,this.weekStarts="Auto",this.width=null,this.floatingEvents=!0,this.floatingTimeHeaders=!0,this.eventCorners="Regular",this.separators=[],this.cornerHtml="",this.$83=-1,this.$84=-1,this.eventClickHandling="Enabled",this.eventDeleteHandling="Disabled",this.eventHoverHandling="Bubble",this.eventDoubleClickHandling="Disabled",this.eventEditHandling="Update",this.eventMoveHandling="Update",this.eventResizeHandling="Update",this.eventRightClickHandling="ContextMenu",this.eventSelectHandling="Update",this.rowClickHandling="Enabled",this.rowDoubleClickHandling="Disabled",this.rowCreateHandling="Disabled",this.rowEditHandling="Update",this.rowHeaderColumnResizedHandling="Update",this.rowSelectHandling="Update",this.rowMoveHandling="Disabled",this.timeRangeDoubleClickHandling="Disabled",this.timeRangeSelectedHandling="Enabled",this.eventMovingStartEndEnabled=!1,this.eventMovingStartEndFormat="MMMM d, yyyy",this.timeRangeSelectingStartEndEnabled=!1,this.timeRangeSelectingStartEndFormat="MMMM d, yyyy",this.eventResizingStartEndEnabled=!1,this.eventResizingStartEndFormat="MMMM d, yyyy",this.cssOnly=!0,this.cssClassPrefix="scheduler_default",this.backendUrl=null,1===o.api&&(this.onEventMove=function(){},this.onEventResize=function(){},this.onResourceExpand=function(){},this.onResourceCollapse=function(){}),this.onBeforeTimeHeaderRender=null,this.onEventMove=null,this.onEventMoved=null,this.onEventMoving=null,this.onEventResize=null,this.onEventResized=null,this.onEventResizing=null,this.onEventMouseOver=null,this.onEventMouseOut=null,this.onTimeRangeSelect=null,this.onTimeRangeSelected=null,this.onTimeRangeSelecting=null,this.onRowHeaderResized=null,this.onBeforeCellRender=null,this.onCellMouseOver=null,this.onCellMouseOut=null,this.onRectangleEventSelecting=null,this.onRectangleEventSelect=null,this.onRectangleEventSelected=null,this.autoRefreshCount=0,this.$85=0,this.rowlist=[],this.itline=[],this.timeline=null,this.events={},this.cells={},this.elements={},this.elements.events=[],this.elements.bars=[],this.elements.text=[],this.elements.cells=[],this.elements.linesVertical=[],this.elements.separators=[],this.elements.range=[],this.elements.breaks=[],this.elements.links=[],this.elements.linkpoints=[],this.elements.rectangle=[],this.$86={},this.$86.cells=[],this.$86.linesVertical={},this.$86.linesHorizontal={},this.$86.timeHeaderGroups=[],this.$86.timeHeader={},this.$86.pixels=[],this.$86.breaks=[],this.$86.events=[],this.clientState={},this.q=new DayPilot.Queue,this.members={},this.members.obsolete=["Init","cleanSelection","cssClassPrefix","getHScrollPosition","setHScrollPosition","getVScrollPosition","setVScrollPosition","showBaseTimeHeader"],this.members.ignoreFilter=function(e){return 0===e.indexOf("div")},this.members.ignore=["internal","nav","debug","temp","elements","members","cellProperties","itline","rowlist","timeHeader"],this.members.noCssOnly=["borderColor","cellBackColor","cellBackColorNonBusiness","cellBorderColor","cellSelectColor","durationBarColor","eventBackColor","eventBorderColor","eventBorderVisible","eventCorners","eventFontColor","eventFontFamily","eventFontSize","headerFontColor","headerFontFamily","headerFontSize","hourFontFamily","hourFontSize","hourNameBackColor","hourNameBorderColor","loadingLabelBackColor","loadingLabelFontColor","loadingLabelFontFamily","loadingLabelFontSize","shadow","timeBreakColor"],this.nav={},this.$87=function(e,t){e=DayPilot.Util.parseJSON(e);if(o.onScrollCalled=!1,"function"==typeof o.onCallBackResult){var i={};if(i.result=e,i.preventDefault=function(){i.preventDefault.value=!0},o.onCallBackResult(i),i.preventDefault.value)return o.$88(),o.$89(),o.$8a(),e.Message&&o.message&&o.message(e.Message),o.$8b(e.CallBackData,!0),o.$8c(),void o.$8d()}if(e.BubbleGuid){var n=e.BubbleGuid,a=this.bubbles[n];return delete this.bubbles[n],o.$89(),void 0!==e.Result.BubbleHTML&&a&&a.updateView(e.Result.BubbleHTML,a),void o.$8c()}if(e.CallBackRedirect)document.location.href=e.CallBackRedirect;else{if(void 0!==DayPilot.Bubble&&DayPilot.Bubble.hideActive(),void 0!==e.ClientState&&(null===e.ClientState?o.clientState={}:o.clientState=e.ClientState),"None"===e.UpdateType)return o.$89(),o.$8c(),e.Message&&o.message(e.Message),void o.$8b(e.CallBackData,!0);if(e.VsUpdate){var s=document.createElement("input");s.type="hidden",s.name=o.id+"_vsupdate",s.id=s.name,s.value=e.VsUpdate,o.$8e.innerHTML="",o.$8e.appendChild(s)}void 0!==e.TagFields&&(o.tagFields=e.TagFields),void 0!==e.SortDirections&&(o.sortDirections=e.SortDirections),o.$86.drawArea=null,"Full"===e.UpdateType&&(o.resources=e.Resources,o.colors=e.Colors,o.palette=e.Palette,o.dirtyColors=e.DirtyColors,o.cellProperties=e.CellProperties,o.cellConfig=e.CellConfig,o.separators=e.Separators,o.timeline=e.Timeline,o.timeHeader=e.TimeHeader,o.timeHeaders=e.TimeHeaders,void 0!==e.Links&&(o.links.list=e.Links),void 0!==e.RowHeaderColumns&&(o.rowHeaderColumns=e.RowHeaderColumns),o.startDate=e.StartDate?new DayPilot.Date(e.StartDate):o.startDate,o.days=e.Days?e.Days:o.days,o.cellDuration=e.CellDuration?e.CellDuration:o.cellDuration,o.cellGroupBy=e.CellGroupBy?e.CellGroupBy:o.cellGroupBy,o.cellWidth=e.CellWidth?e.CellWidth:o.cellWidth,o.viewType=e.ViewType?e.ViewType:o.viewType,o.hourNameBackColor=e.HourNameBackColor?e.HourNameBackColor:o.hourNameBackColor,void 0!==e.ShowNonBusiness&&(o.showNonBusiness=e.ShowNonBusiness),o.businessBeginsHour=e.BusinessBeginsHour?e.BusinessBeginsHour:o.businessBeginsHour,o.businessEndsHour=e.BusinessEndsHour?e.BusinessEndsHour:o.businessEndsHour,void 0!==e.DynamicLoading&&(o.dynamicLoading=e.DynamicLoading),void 0!==e.TreeEnabled&&(o.treeEnabled=e.TreeEnabled),o.backColor=e.BackColor?e.BackColor:o.backColor,o.nonBusinessBackColor=e.NonBusinessBackColor?e.NonBusinessBackColor:o.nonBusinessBackColor,o.locale=e.Locale?e.Locale:o.locale,void 0!==e.TimeZone&&(o.timeZone=e.TimeZone),o.timeFormat=e.TimeFormat?e.TimeFormat:o.timeFormat,o.rowHeaderCols=e.RowHeaderCols?e.RowHeaderCols:o.rowHeaderCols,void 0!==e.DurationBarMode&&(o.durationBarMode=e.DurationBarMode),o.cornerBackColor=e.CornerBackColor?e.CornerBackColor:o.cornerBackColor,void 0!==e.CornerHTML&&(o.cornerHtml=e.CornerHTML),o.hashes=e.Hashes,o.$8f(),o.$8g(),o.$8h(),o.$8i()),"Scroll"!==e.Action&&o.$8j(e.Events),"Full"===e.UpdateType&&(o.$8k(),o.$8l()),o.$8m(),o.$8n(),o.$8o(),o.$86.drawArea=null,"Scroll"!==e.Action?(o.$8p(),o.$8q(),"Auto"!==o.heightSpec&&"Max"!==o.heightSpec||o.$8r(),o.$8s(),o.$8t(),o.$8u(),o.multiselect.clear(!0),o.multiselect.$8v(e.SelectedEvents),o.$8w(),o.$8x(),o.$8y()):(o.multiselect.clear(!0),o.multiselect.$8v(e.SelectedEvents),o.$8z(e.Events)),DayPilot.list(o.multiselect.list).isEmpty()||o.multiselect.redraw(),"HoldForever"!==o.timeRangeSelectedHandling&&o.$8A(),"Full"===e.UpdateType&&(o.setScroll(e.ScrollX,e.ScrollY),o.$8B()),o.$8C(),o.$88(),e.SelectedRows&&o.$8D(e.SelectedRows),o.$89(),"Full"===e.UpdateType&&-1!==navigator.appVersion.indexOf("MSIE 7.")&&window.setTimeout(function(){o.$8k(),o.$8r()},0),o.$8a(),e.Message&&o.message&&o.message(e.Message),o.$8b(e.CallBackData,!0),o.$8c(),o.$8d(),"Full"!==e.UpdateType||"Scroll"===e.Action||o.onScrollCalled||setTimeout(function(){o.$8E()},0)}},this.$88=function(){if(o.todo&&o.todo.del){var e=o.todo.del;e.parentNode.removeChild(e),o.todo.del=null}},this.$8b=function(e,t){window.setTimeout(function(e,t){return function(){if(o.$8F()){if("function"==typeof o.onAfterRender){var i={};i.isCallBack=t,i.data=e,o.onAfterRender(i)}}else o.afterRender&&o.afterRender(e,t)}}(e,t),0)},this.scrollTo=function(e,t,i){if(e){var n;if(e.isDayPilotDate)n=this.getPixels(e).left;else if("string"==typeof e)n=this.getPixels(new DayPilot.Date(e)).left;else{if("number"!=typeof e)throw"Invalid scrollTo() parameter. Accepted parameters: string (ISO date), number (pixels), DayPilot.Date object";n=e}var a=this.$8G.clientWidth,s=this.nav.scroll.clientWidth;switch((i=i||"left").toLowerCase()){case"left":break;case"middle":n-=s/2;break;case"right":n-=s}n<0&&(n=0),n>a-s&&(n=a-s),t?this.$8H(n):this.setScrollX(n)}},this.$8H=function(e){for(var t={steps:[],index:0,delay:10,next:function(){var e=t.steps[t.index];return t.index+=1,e},finished:function(){o.$8E()}},i=o.getScrollX(),n=e-i,a=0;a<100;a++){var s=a/100,l=2*(s-.5)/(Math.pow(2*(s-.5),2)+1)+.5;t.steps.push(i+n*l)}t.steps.push(e),function e(t){var i=t.next();if(void 0===i)return void(t.finished&&t.finished());o.setScrollX(i);window.clearTimeout(o.refreshTimeout);setTimeout(function(){e(t)},t.delay)}(t)},this.scrollToResource=function(e){DayPilot.complete(function(){var t=o.$8I(e);t&&setTimeout(function(){var e=t.top;o.nav.scroll.scrollTop=e},100)})},this.$8J=function(){if(this.cssOnly&&this.floatingTimeHeaders&&this.timeHeader){var e=this.$8K();if(e){this.$8L();for(var t=e.pixels.left,i=e.pixels.right,n=[],a=0;a<this.timeHeader.length;a++)for(var s=0;s<this.timeHeader[a].length;s++){var o=this.timeHeader[a][s],l=o.left,r=o.left+o.width,d=null;if(l<t&&t<r&&((d={}).x=s,d.y=a,d.marginLeft=t-l,d.marginRight=0,d.div=this.$86.timeHeader[s+"_"+a],n.push(d)),l<i&&i<r){d||((d={}).x=s,d.y=a,d.marginLeft=0,d.div=this.$86.timeHeader[s+"_"+a],n.push(d)),d.marginRight=r-i;break}}for(var h=0;h<n.length;h++){d=n[h];this.$8M(d.div,d.marginLeft,d.marginRight)}}}},this.$8C=function(){this.$8J(),this.$8N()},this.$8O={};var l=this.$8O;l.eventsInRectangle=function(e,t,i,n){var a=e,s=e+i,l=t,r=t+n;return DayPilot.list(o.elements.events).filter(function(e){var t=e.event,i=t.part.left,n=t.part.left+t.part.width,d=o.rowlist[t.part.dayIndex].top+t.part.top,h=d+t.part.height;if(DayPilot.Util.overlaps(i,n,a,s)&&DayPilot.Util.overlaps(d,h,l,r))return!0})},l.events=function(e){var t=[],i=(e=e||"All",o.$8K());if(!i)return DayPilot.list(t);for(var n=i.pixels.left,a=i.pixels.right,s=0;s<o.elements.events.length;s++){var l=o.elements.events[s],r=l.event,d=r.part.left,h=r.part.left+r.part.width;switch(e){case"Left":d<n&&n<h&&t.push(l);break;case"All":DayPilot.Util.overlaps(d,h,n,a)&&t.push(l)}}return DayPilot.list(t).addProps({area:i})},this.$8N=function(){if(this.cssOnly&&this.floatingEvents){var e=l.events("Left");this.$8P(),e.each(function(t){var i=e.area.pixels.left-t.event.part.left;o.$8Q(t,i,0)})}},this.elements.sections=[],this.elements.hsections=[],this.$8M=function(e,t,i){var n=document.createElement("div");n.setAttribute("unselectable","on"),n.className=this.$8R("_timeheader_float"),n.style.position="absolute",n.style.left=t+"px",n.style.right=i+"px",n.style.top="0px",n.style.bottom="0px",n.style.overflow="hidden";var a=document.createElement("div");a.className=this.$8R("_timeheader_float_inner"),a.setAttribute("unselectable","on"),a.innerHTML=e.cell.th.innerHTML,n.appendChild(a),e.section=n,e.insertBefore(n,e.firstChild.nextSibling),e.firstChild.innerHTML="",this.elements.hsections.push(e)},this.$8L=function(){for(var e=0;e<this.elements.hsections.length;e++){var t=this.elements.hsections[e],i=t.cell;i&&t.firstChild&&(t.firstChild.innerHTML=i.th.innerHTML),DayPilot.de(t.section),t.section=null}this.elements.hsections=[]},this.$8Q=function(e,t,i){var n=document.createElement("div");n.setAttribute("unselectable","on"),n.className=this.$8R("_event_float"),n.style.position="absolute",n.style.left=t+"px",n.style.right=i+"px",n.style.top="0px",n.style.bottom="0px",n.style.overflow="hidden";var a=document.createElement("div");a.className=this.$8R("_event_float_inner"),a.setAttribute("unselectable","on"),a.innerHTML=e.event.client.html(),n.appendChild(a),e.section=n,e.insertBefore(n,e.firstChild.nextSibling),e.firstChild.innerHTML="",this.elements.sections.push(e)},this.$8P=function(){for(var e=0;e<this.elements.sections.length;e++){var t=this.elements.sections[e],i=t.event;i&&(t.firstChild.innerHTML=i.client.html()),DayPilot.de(t.section),t.section=null}this.elements.sections=[]},this.setScrollX=function(e){this.setScroll(e,o.scrollY)},this.setScrollY=function(e){this.setScroll(o.scrollX,e)},this.setScroll=function(e,t){var i=o.nav.scroll,n=o.$85,a=o.$8S()*o.cellWidth;i.clientWidth+e>a&&(e=a-i.clientWidth),i.clientHeight+t>n&&(t=n-i.clientHeight),o.divTimeScroll.scrollLeft=e,o.divResScroll.scrollTop=t,i.scrollLeft=e,i.scrollTop=t},this.message=function(e,t,i,n){if(null!==e){t=t||this.messageHideAfter||2e3,i=i||"#ffffff",n=n||"#000000";var a,s=this.$8T()+1,l=this.$8U()+k.splitterWidth(),r=DayPilot.sw(o.nav.scroll)+1,d=DayPilot.sh(o.nav.scroll)+1;if(this.nav.message)a=o.nav.message;else{(a=document.createElement("div")).style.position="absolute",a.style.left=l+"px",a.style.right=r+"px",a.style.display="none",a.onmousemove=function(){o.messageHideOnMouseOut&&a.messageTimeout&&!a.status&&clearTimeout(a.messageTimeout)},a.onmouseout=function(){o.messageHideOnMouseOut&&"none"!==o.nav.message.style.display&&(a.messageTimeout=setTimeout(o.$8V,500))};var h=document.createElement("div");h.onclick=function(){o.nav.message.style.display="none"},this.cssOnly?h.className=this.$8R("_message"):(h.style.padding="5px",h.style.opacity=.8,h.style.filter="alpha(opacity=80)"),a.appendChild(h);var c=document.createElement("div");c.style.position="absolute",this.cssOnly?c.className=this.$8R("_message_close"):(c.style.top="5px",c.style.right=DayPilot.sw(o.nav.scroll)+5+"px",c.style.color=i,c.style.lineHeight="100%",c.style.cursor="pointer",c.style.fontWeight="bold",c.innerHTML="X"),c.onclick=function(){o.nav.message.style.display="none"},a.appendChild(c),this.nav.top.appendChild(a),this.nav.message=a}var u=function(){var l=o.nav.message.firstChild;o.cssOnly||(l.style.backgroundColor=n,l.style.color=i),l.innerHTML=e;var r=DayPilot.sw(o.nav.scroll)+1;o.nav.message.style.right=r+"px";var h=o.messageBarPosition||"Top";"Bottom"===h?(o.nav.message.style.bottom=d+"px",o.nav.message.style.top=""):"Top"===h&&(o.nav.message.style.bottom="",o.nav.message.style.top=s+"px");DayPilot.fade(o.nav.message,.2,function(){a.messageTimeout=setTimeout(o.$8V,t)})};clearTimeout(a.messageTimeout),"none"!==this.nav.message.style.display?DayPilot.fade(o.nav.message,-.2,u):u()}},this.$8V=function(){if(o.nav.message){DayPilot.fade(o.nav.message,-.2,function(){o.nav.message.style.display="none"})}},this.message.show=function(e){o.message(e)},this.message.hide=function(){o.$8V()},this.$8W=null,this.$8r=function(){if(this.nav.scroll){null!==this.$8W&&(this.nav.top.style.border=this.$8W,this.$8W=null),"Parent100Pct"===this.heightSpec&&(this.nav.top.style.height="100%",this.hideBorderFor100PctHeight&&(this.$8W=this.nav.top.style.border,this.nav.top.style.border="0 none"),this.height=parseInt(this.nav.top.clientHeight,10)-this.$8T()-1),this.nav.scroll.style.height="30px";var e=this.$8X(),t=e+this.$8T()+1;e>=0&&(this.nav.scroll.style.height=e+"px",this.$8Y.style.height=e+"px"),this.nav.divider&&((!t||isNaN(t)||t<0)&&(t=0),this.nav.divider.style.height=t+"px"),"Parent100Pct"!==this.heightSpec&&(this.nav.top.style.height=t+"px"),o.nav.resScrollSpace&&(o.nav.resScrollSpace.style.height=e+20+"px");for(var i=0;i<this.elements.separators.length;i++)this.elements.separators[i].style.height=this.$85+"px";for(i=0;i<this.elements.linesVertical.length;i++)this.elements.linesVertical[i].style.height=this.$85+"px"}},this.$8g=function(){this.startDate=new DayPilot.Date(this.startDate).getDatePart(),this.$8Z="Days"!==this.viewType?this.startDate.addDays(this.days):this.startDate.addDays(1),this.$86.pixels=[],this.itline=[];var e="Auto"===this.cellWidthSpec;if(function(){if(e){var t=0;o.timeHeader?t=o.timeline?o.timeline.length:o.timeHeader[o.timeHeader.length-1].length:"Manual"===o.scale?t=o.timeline.length:(o.$90(),t=o.itline.length,o.itline=[]);var i=o.$91();t>0&&i>0&&(o.cellWidth=i/t)}}(),this.$92()&&this.timeline){if(this.timeline){this.itline=[];for(var t=null,i=0,n=0;n<this.timeline.length;n++){var a=this.timeline[n];if((l={}).start=new DayPilot.Date(a.start),l.end=a.end?new DayPilot.Date(a.end):l.start.addMinutes(this.cellDuration),a.width)l.left=a.left||i,l.width=a.width||this.cellWidth,i+=l.width;else{var s=Math.floor(i+this.cellWidth)-Math.floor(i);l.left=Math.floor(i),l.width=s,i+=this.cellWidth}l.breakBefore=t&&t.ticks!==l.start.ticks,t=l.end,this.itline.push(l)}}e&&this.$93()}else{if(this.timeHeader=[],"Manual"===this.scale){this.itline=[];for(i=0,t=null,n=0;n<this.timeline.length;n++){var l;a=this.timeline[n];(l={}).start=new DayPilot.Date(a.start),l.end=a.end?new DayPilot.Date(a.end):l.start.addMinutes(this.cellDuration);var r=a.width||this.cellWidth;s=Math.floor(i+r)-Math.floor(i);l.left=Math.floor(i),l.width=s,i+=r,l.breakBefore=t&&t.ticks!==l.start.ticks,t=l.end,this.itline.push(l)}}else this.$90();this.$94()}},this.$90=function(){for(var e=this.startDate,t=this.$95(e),i=!1,n=(this.timeHeaders,0);t.ticks<=this.$8Z.ticks&&t.ticks>e.ticks;){if(this.$96(e,t)){var a=Math.floor(n+this.cellWidth)-Math.floor(n),s={};s.start=e,s.end=t,s.left=Math.floor(n),s.width=a,s.breakBefore=i,this.itline.push(s),n+=this.cellWidth,i=!1}else i=!0;e=t,t=this.$95(e)}},this.$93=function(){if(this.timeHeader)for(var e=0;e<this.timeHeader.length;e++)for(var t=this.timeHeader[e],i=0;i<t.length;i++){var n=t[i];n.left=this.getPixels(new DayPilot.Date(n.start)).left;var a=this.getPixels(new DayPilot.Date(n.end)).left-n.left;n.width=a}},this.$94=function(){var e=this.timeHeaders;e||(e=[{groupBy:this.cellGroupBy},{groupBy:"Cell"}]);for(var t=0;t<e.length;t++){var i=e[t].groupBy,n=e[t].format;"Default"===i&&(i=this.cellGroupBy);for(var a=[],s=this.$97();s.ticks<this.$8Z.ticks;){var o={};if(o.start=s,o.end=this.$98(o.start,i),o.start.ticks===o.end.ticks)break;o.left=this.getPixels(o.start).left;var l=this.getPixels(o.end).left-o.left;if(o.width=l,o.colspan=Math.ceil(l/(1*this.cellWidth)),o.innerHTML=n?o.start.toString(n,k.locale()):this.$99(o,i),l>0){if("function"==typeof this.onBeforeTimeHeaderRender){var r={};r.start=o.start,r.end=o.end,r.html=o.innerHTML,r.toolTip=o.innerHTML,r.backColor=null,this.cssOnly||(r.backColor=this.hourNameBackColor),r.level=this.timeHeader.length;var d={};d.header=r,this.onBeforeTimeHeaderRender(d),o.innerHTML=r.html,o.backColor=r.backColor,o.toolTip=r.toolTip}a.push(o)}s=o.end}this.timeHeader.push(a)}},this.$96=function(e,t){if("function"==typeof this.onIncludeTimeCell){var i={};i.start=e,i.end=t,i.visible=!0;var n={};return n.cell=i,this.onIncludeTimeCell(n),i.visible}return!!this.showNonBusiness||this.isBusiness({start:e,end:t})},this.getPixels=function(e){var t=e.ticks,i=this.$86.pixels[t];if(i)return i;var n=2218768416e5;if(0===this.itline.length||t<this.itline[0].start.ticks)return(d={cut:!1,left:0}).boxLeft=d.left,d.boxRight=d.left,d.i=null,d;for(var a=0;a<this.itline.length;a++){var s=this.itline[a],o=s.start.ticks,l=s.end.ticks;if(o<t&&t<l){var r=t-o;(d={cut:!1}).left=s.left+this.$9a(s,r),d.boxLeft=s.left,d.boxRight=s.left+s.width,d.i=a;break}if(o===t){(d={cut:!1}).left=s.left,d.boxLeft=d.left,d.boxRight=d.left+s.width,d.i=a;break}if(l===t){(d={cut:!1}).left=s.left+s.width,d.boxLeft=d.left,d.boxRight=d.left,d.i=a+1;break}if(t<o&&t>n){(d={cut:!0}).left=s.left,d.boxLeft=d.left,d.boxRight=d.left,d.i=a;break}n=l}if(!d){var d,h=this.itline[this.itline.length-1];(d={cut:!0}).left=h.left+h.width,d.boxLeft=d.left,d.boxRight=d.left,d.i=null}return this.$86.pixels[t]=d,d},this.getDate=function(e,t,i){var n=this.$9b(e,i);if(!n)return null;var a=n.x,s=this.itline[a];if(!s)return null;var o=i&&!t?s.end:s.start;return t?o.addTime(this.$9c(n.cell,n.offset)):o},this.$9b=function(e,t){if(0===this.itline.length)return null;for(var i=0,n=0,a=0;a<this.itline.length;a++){if(e<(i+=(o=this.itline[a]).width||this.cellWidth)||t&&e===i)return(s={}).x=a,s.offset=e-n,s.cell=o,s;n=i}var s,o=this.itline[this.itline.length-1];return(s={}).x=this.itline.length-1,s.offset=o.width||this.cellWidth,s.cell=o,s},this.$9d=function(e){for(var t=new DayPilot.Date(e),i=0;i<this.itline.length;i++){var n=this.itline[i];if(n.start.ticks<=t.ticks&&t.ticks<n.end.ticks)return(a={hidden:!1}).current=n,a;if(t.ticks<n.start.ticks)return(a={hidden:!0}).previous=i>0?this.itline[i-1]:null,a.current=null,a.next=this.itline[i],a}var a;return(a={past:!0}).previous=this.itline[this.itline.length-1],a},this.$9a=function(e,t){var i=e.width||this.cellWidth,n=e.end.ticks-e.start.ticks;return Math.floor(i*t/n)},this.$9c=function(e,t){var i=e.end.ticks-e.start.ticks,n=e.width||this.cellWidth;return Math.floor(t/n*i)},this.$9e=function(e){w.start||(b={},o.$9f(this,e))},this.eventClickPostBack=function(e,t){this.$9g("EventClick",e,t)},this.eventClickCallBack=function(e,t){this.$9h("EventClick",e,t)},this.$9f=function(e,t){var i=e.event;t=t||window.event;if(void 0!==DayPilotBubble&&DayPilotBubble.hideActive(),i.client.doubleClickEnabled()){o.timeouts.click||(o.timeouts.click=[]);o.timeouts.click.push(window.setTimeout(function(e,t){return function(){o.$9i(e,t)}}(e,t),o.doubleClickTimeout))}else o.$9i(e,t)},this.$9i=function(e,t){if("boolean"==typeof t)throw"Invalid _eventClickSingle parameters";var i=e.event,n=t.ctrlKey,a=t.metaKey;if(i.client.clickEnabled())if(o.$8F()){var s={};if(s.e=i,s.div=e,s.originalEvent=t,s.ctrl=n,s.meta=a,s.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onEventClick&&(o.onEventClick(s),s.preventDefault.value))return;switch(o.eventClickHandling){case"PostBack":o.eventClickPostBack(i);break;case"CallBack":o.eventClickCallBack(i);break;case"Edit":o.$9j(e);break;case"Select":o.$9k(e,i,n,a);break;case"ContextMenu":(l=i.client.contextMenu())?l.show(i):o.contextMenu&&o.contextMenu.show(i);break;case"Bubble":o.bubble&&o.bubble.showEvent(i);break;case"RectangleSelect":if("Disabled"!==o.multiSelectRectangle)return $.start(),!1}"function"==typeof o.onEventClicked&&o.onEventClicked(s)}else switch(o.eventClickHandling){case"PostBack":o.eventClickPostBack(i);break;case"CallBack":o.eventClickCallBack(i);break;case"JavaScript":o.onEventClick(i);break;case"Edit":o.$9j(e);break;case"Select":o.$9k(e,i,n,a);break;case"ContextMenu":var l;(l=i.client.contextMenu())?l.show(i):o.contextMenu&&o.contextMenu.show(i);break;case"Bubble":o.bubble&&o.bubble.showEvent(i);break;case"RectangleSelect":if("Disabled"!==o.multiSelectRectangle)return $.start(),!1}},this.$9l=function(e){if(o.$8F()){var t={};if(t.e=e,t.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onEventDelete&&(o.onEventDelete(t),t.preventDefault.value))return;switch(o.eventDeleteHandling){case"PostBack":o.eventDeletePostBack(e);break;case"CallBack":o.eventDeleteCallBack(e);break;case"Update":o.events.remove(e)}"function"==typeof o.onEventDeleted&&o.onEventDeleted(t)}else switch(o.eventDeleteHandling){case"PostBack":o.eventDeletePostBack(e);break;case"CallBack":o.eventDeleteCallBack(e);break;case"JavaScript":o.onEventDelete(e)}},this.eventDeletePostBack=function(e,t){this.$9g("EventDelete",e,t)},this.eventDeleteCallBack=function(e,t){this.$9h("EventDelete",e,t)},this.setHScrollPosition=function(e){this.nav.scroll.scrollLeft=e},this.getScrollX=function(){return this.nav.scroll.scrollLeft},this.getHScrollPosition=this.getScrollX,this.getScrollY=function(){return this.nav.scroll.scrollTop},this.$9k=function(e,t,i,n){o.$9m(e,t,i,n)},this.eventSelectPostBack=function(e,t,i){var n={};n.e=e,n.change=t,this.$9g("EventSelect",n,i)},this.eventSelectCallBack=function(e,t,i){var n={};n.e=e,n.change=t,this.$9h("EventSelect",n,i)},this.$9m=function(e,t,i,n){var a=o.multiselect,s=a.isSelected(t);if(i||n||!s||1!==a.list.length)if(o.$8F()){a.previous=a.events();var l={};if(l.e=t,l.selected=s,l.ctrl=i,l.meta=n,l.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onEventSelect&&(o.onEventSelect(l),l.preventDefault.value))return;switch(o.eventSelectHandling){case"PostBack":o.eventSelectPostBack(t,r);break;case"CallBack":"undefined"!=typeof WebForm_InitCallback&&(window.__theFormPostData="",window.__theFormPostCollection=[],WebForm_InitCallback()),o.eventSelectCallBack(t,r);break;case"Update":a.$9n(e,i,n)}"function"==typeof o.onEventSelected&&(l.change=a.isSelected(t)?"selected":"deselected",l.selected=a.isSelected(t),o.onEventSelected(l))}else{a.previous=a.events(),a.$9n(e,i,n);var r=a.isSelected(t)?"selected":"deselected";switch(o.eventSelectHandling){case"PostBack":o.eventSelectPostBack(t,r);break;case"CallBack":"undefined"!=typeof WebForm_InitCallback&&(window.__theFormPostData="",window.__theFormPostCollection=[],WebForm_InitCallback()),o.eventSelectCallBack(t,r);break;case"JavaScript":o.onEventSelect(t,r)}}},this.eventRightClickPostBack=function(e,t){this.$9g("EventRightClick",e,t)},this.eventRightClickCallBack=function(e,t){this.$9h("EventRightClick",e,t)},this.$9o=function(e){var t=this.event;if((e=e||window.event).cancelBubble=!0,!this.event.client.rightClickEnabled())return!1;if(o.$8F()){var i={};if(i.e=t,i.div=this,i.originalEvent=e,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onEventRightClick&&(o.onEventRightClick(i),i.preventDefault.value))return;switch(o.eventRightClickHandling){case"PostBack":o.eventRightClickPostBack(t);break;case"CallBack":o.eventRightClickCallBack(t);break;case"ContextMenu":(n=t.client.contextMenu())?n.show(t):o.contextMenu&&o.contextMenu.show(this.event);break;case"Bubble":o.bubble&&o.bubble.showEvent(t)}"function"==typeof o.onEventRightClicked&&o.onEventRightClicked(i)}else switch(o.eventRightClickHandling){case"PostBack":o.eventRightClickPostBack(t);break;case"CallBack":o.eventRightClickCallBack(t);break;case"JavaScript":o.onEventRightClick(t);break;case"ContextMenu":var n;(n=t.client.contextMenu())?n.show(t):o.contextMenu&&o.contextMenu.show(this.event);break;case"Bubble":o.bubble&&o.bubble.showEvent(t)}return!1},this.eventDoubleClickPostBack=function(e,t){this.$9g("EventDoubleClick",e,t)},this.eventDoubleClickCallBack=function(e,t){this.$9h("EventDoubleClick",e,t)},this.$9p=function(e){if(void 0!==DayPilotBubble&&DayPilotBubble.hideActive(),o.timeouts.click){for(var t in o.timeouts.click)window.clearTimeout(o.timeouts.click[t]);o.timeouts.click=null}e=e||window.event;var i=this.event;if(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,o.$8F()){var n={};if(n.e=i,n.originalEvent=e,n.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onEventDoubleClick&&(o.onEventDoubleClick(n),n.preventDefault.value))return;switch(o.eventDoubleClickHandling){case"PostBack":o.eventDoubleClickPostBack(i);break;case"CallBack":o.eventDoubleClickCallBack(i);break;case"Edit":o.$9j(this);break;case"Select":o.$9k($V,i,e.ctrlKey,e.metaKey);break;case"Bubble":o.bubble&&o.bubble.showEvent(i);break;case"ContextMenu":(a=i.client.contextMenu())?a.show(i):o.contextMenu&&o.contextMenu.show(i)}"function"==typeof o.onEventDoubleClicked&&o.onEventDoubleClicked(n)}else switch(o.eventDoubleClickHandling){case"PostBack":o.eventDoubleClickPostBack(i);break;case"CallBack":o.eventDoubleClickCallBack(i);break;case"JavaScript":o.onEventDoubleClick(i);break;case"Edit":o.$9j(this);break;case"Select":o.$9k($V,i,e.ctrlKey,e.metaKey);break;case"Bubble":o.bubble&&o.bubble.showEvent(i);break;case"ContextMenu":var a;(a=i.client.contextMenu())?a.show(i):o.contextMenu&&o.contextMenu.show(i)}},this.eventResizePostBack=function(e,t,i,n){this.$9q("PostBack",e,t,i,n)},this.eventResizeCallBack=function(e,t,i,n){this.$9q("CallBack",e,t,i,n)},this.$9q=function(e,t,i,n,a){var s={};s.e=t,s.newStart=i,s.newEnd=n,this.$9r(e,"EventResize",s,a)},this.$9s=function(e,t,i){if("Disabled"!==this.eventResizeHandling)if(i=o.$9t(i),o.$8F()){var n={};if(n.e=e,n.newStart=t,n.newEnd=i,n.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onEventResize){if(o.onEventResize(n),n.preventDefault.value)return;t=n.newStart,i=n.newEnd}switch(o.eventResizeHandling){case"PostBack":o.eventResizePostBack(e,t,i);break;case"CallBack":o.eventResizeCallBack(e,t,i);break;case"Notify":o.eventResizeNotify(e,t,i);break;case"Update":e.start(t),e.end(i),o.events.update(e)}"function"==typeof o.onEventResized&&o.onEventResized(n)}else switch(o.eventResizeHandling){case"PostBack":o.eventResizePostBack(e,t,i);break;case"CallBack":o.eventResizeCallBack(e,t,i);break;case"JavaScript":o.onEventResize(e,t,i);break;case"Notify":o.eventResizeNotify(e,t,i);break;case"Update":e.start(t),e.end(i),o.events.update(e)}},this.eventMovePostBack=function(e,t,i,n,a,s){this.$9u("PostBack",e,t,i,n,a,s)},this.eventMoveCallBack=function(e,t,i,n,a,s){this.$9u("CallBack",e,t,i,n,a,s)},this.$9u=function(e,t,i,n,a,s,l){var r={};if(t&&!!t.preventDefault){var d=t;r.e=d.e,r.newStart=d.newStart,r.newEnd=d.newEnd,r.newResource=d.newResource,r.position=d.position,r.multimove=[],d.multimove.each(function(e){var t={};if(t.e=e.event,t.newStart=e.start,t.newEnd=e.end,t.newResource=e.event.resource(),t.e===d.e||t.e.data.id==d.e.data.id)t.newResource=d.newResource;else if(f.rowoffset){var i=e.event.part.dayIndex+f.rowoffset;t.newResource=o.rowlist[i].id}r.multimove.push(t)})}else r.e=t,r.newStart=i,r.newEnd=n,r.newResource=a,r.position=l;this.$9r(e,"EventMove",r,s)},this.$9v=function(e,t,i){var n={};n.start=t.start,n.end=t.end,n.resource=t.resource,n.multirange=[],t.multirange.each(function(e){var t={};t.start=e.start,t.end=e.end,t.resource=e.resource,n.multirange.push(t)}),this.$9r(e,"TimeRangeSelected",n,i)},this.$9r=function(e,t,i,n){if("PostBack"===e)o.$9g(t,i,n);else if("CallBack"===e)o.$9h(t,i,n,"CallBack");else if("Immediate"===e)o.$9h(t,i,n,"Notify");else if("Queue"===e)o.queue.add(new DayPilot.Action(this,t,i,n));else{if("Notify"!==e)throw"Invalid event invocation type";"Notify"===k.notifyType()?o.$9h(t,i,n,"Notify"):o.queue.add(new DayPilot.Action(o,t,i,n))}},this.eventMoveNotify=function(e,t,i,n,a,s){if(e&&!!e.preventDefault){var l=e;l.old=new DayPilot.Event(l.e.copy(),o),l.multimove.each(function(e){e.old=new DayPilot.Event(e.event.copy(),o)}),o.$9w(l),l.e=l.old,delete l.old,l.multimove.each(function(e){e.event=e.old,delete e.old})}else{e=new DayPilot.Event(e.copy(),o);var r=o.events.$9x(e.data);e.start(t),e.end(i),e.resource(n),e.commit(),r=r.concat(o.events.$9y(e.data)),o.$9z(r),o.$9A(),o.$9B(r)}this.$9u("Notify",e,t,i,n,a,s)},this.eventResizeNotify=function(e,t,i,n){var a=new DayPilot.Event(e.copy(),this),s=o.events.$9x(e.data);e.start(t),e.end(i),e.commit(),s=s.concat(o.events.$9y(e.data)),o.$9z(s),o.$9A(),o.$9B(s),this.$9q("Notify",a,t,i,n)},this.multiselect={},this.multiselect.list=[],this.multiselect.divs=[],this.multiselect.previous=[],this.multiselect.$8v=function(e){o.multiselect.list=DayPilot.list(e).map(function(e){return new DayPilot.Event(e,o)})},this.multiselect.$9C=function(){var e=o.multiselect;return DayPilot.JSON.stringify(e.events())},this.multiselect.events=function(){var e=o.multiselect,t=DayPilot.list();t.ignoreToJSON=!0;for(var i=0;i<e.list.length;i++)t.push(e.list[i]);return t},this.multiselect.$9D=function(){},this.multiselect.$9n=function(e,t,i){var n=o.multiselect;if(n.isSelected(e.event))if(o.allowMultiSelect)if(t||i)n.remove(e.event,!0);else{var a=n.list.length;n.clear(),a>1&&n.add(e.event,!0)}else n.clear();else o.allowMultiSelect&&(t||i)?n.add(e.event,!0):(n.clear(),n.add(e.event,!0));n.$9E(e),n.$9D()},this.multiselect.$9F=function(e){var t=o.multiselect;return t.$9G(e,t.initList)},this.multiselect.$9H=function(){for(var e=o.multiselect,t=[],i=0;i<e.list.length;i++){var n=e.list[i];t.push(n.value())}alert(t.join("\n"))},this.multiselect.add=function(e,t){var i=o.multiselect;-1===i.indexOf(e)&&i.list.push(e),t||i.redraw()},this.multiselect.remove=function(e,t){var i=o.multiselect,n=i.indexOf(e);-1!==n&&i.list.splice(n,1),t||i.redraw()},this.multiselect.clear=function(e){var t=o.multiselect;t.list=[],e||t.redraw()},this.multiselect.redraw=function(){var e=o.multiselect;e.divs=[];for(var t=0;t<o.elements.events.length;t++){var i=o.elements.events[t];i.event&&(i.event.isEvent&&(e.isSelected(i.event)?e.$9I(i):e.$9J(i)))}},this.multiselect.$9K=function(e){for(var t=o.multiselect,i=null,n=0;n<o.elements.events.length;n++)if(t.isSelected(o.elements.events[n].event)){i=o.elements.events[n];break}t.$9E(i)},this.multiselect.$9E=function(e){if(e){var t=o.multiselect;t.isSelected(e.event)?t.$9I(e):t.$9J(e)}},this.multiselect.$9I=function(e){var t=o.multiselect,i=o.cssOnly?o.$8R("_selected"):o.$8R("selected");e=t.$9L(e);DayPilot.Util.addClass(e,i),t.divs.push(e)},this.multiselect.$9L=function(e){return e},this.multiselect.$9M=function(){for(var e=o.multiselect,t=0;t<e.divs.length;t++){var i=e.divs[t];e.$9J(i,!0)}e.divs=[]},this.multiselect.$9J=function(e,t){var i=o.multiselect,n=o.cssOnly?o.$8R("_selected"):o.$8R("selected");if(DayPilot.Util.removeClass(e,n),!t){var a=DayPilot.indexOf(i.divs,e);-1!==a&&i.divs.splice(a,1)}},this.multiselect.isSelected=function(e){return!!e&&(!!e.isEvent&&o.multiselect.$9G(e,o.multiselect.list))},this.multiselect.indexOf=function(e){for(var t=e.data,i=0;i<o.multiselect.list.length;i++){if(o.multiselect.list[i].data===t)return i}return-1},this.multiselect.$9G=function(e,t){if(!t)return!1;for(var i=0;i<t.length;i++){var n=t[i];if(e===n)return!0;if("function"==typeof n.id){if(null!==n.id()&&null!==e.id()&&n.id()===e.id())return!0;if(null===n.id()&&null===e.id()&&n.recurrentMasterId()===e.recurrentMasterId()&&e.start().toStringSortable()===n.start().toStringSortable())return!0}else{if(null!==n.id&&null!==e.id()&&n.id===e.id())return!0;if(null===n.id&&null===e.id()&&n.recurrentMasterId===e.recurrentMasterId()&&e.start().toStringSortable()===n.start)return!0}}return!1},this.multiselect.startRectangle=function(){$.start()},this.$9E=function(e){var t=!(e=e||{}).eventsOnly;o.cssOnly||(o.cssOnly=!0,DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0.")),t&&(this.$92()||(o.timeHeader=null,o.cellProperties={}),o.$8f(),o.$8g(),e&&e.dontLoadResources||o.$8h()),this.$8j(),t&&(o.$9N(),o.$8k(),o.$8l()),o.$8m(),o.$8p(),o.$9O(),o.$8q(),d.hideLinkpoints(),this.$8t(),this.$8u(),this.$8s(),this.$8d(),this.$8i(),this.$8w(),this.$8x(),o.$8r(),e.immediateEvents||e.eventsOnly?o.$8y():setTimeout(function(){o.$8y()},100),DayPilot.list(o.multiselect.list).isEmpty()||this.multiselect.redraw(),this.visible?this.show():this.hide(),this.$8C(),this.$8E()},this.update=function(){this.$9E({immediateEvents:!0})},this.$9B=function(e,t,i){e=DayPilot.ua(e);for(var n=0;n<e.length;n++){var a=e[n];o.$9P(a)}if(this.$9Q){this.$8m(),this.$8p(),this.$8s(),this.$8u();for(n=0;n<e.length;n++){a=e[n];this.$9R(a)}for(n=0;n<e.length;n++){a=e[n];this.$9S(a)}this.$8w(),this.$8x(),this.$9T()}else{var s=function(n){if(!(n>=e.length)){var a=e[n];t||o.$9R(a),o.$9S(a),n+1<e.length?setTimeout(function(){s(n+1)},10):(o.$8N(),d.load(),o.multiselect.redraw(),i&&i())}};s(0),DayPilot.list(e).each(function(e){o.$9U(e)}),o.$8w()}o.$8N(),d.load(),o.multiselect.redraw(),i&&i(),this.$8d()},this.$9t=function(e){return"DateTime"===o.eventEndSpec?e:e.getDatePart().ticks===e.ticks?e.addDays(-1):e.getDatePart()},this.$9V=function(e){return"DateTime"===o.eventEndSpec?e:e.getDatePart().addDays(1)},this.$9W=function(e){return"DateTime"===o.eventEndSpec?e:e.getDatePart()},this.$9X=function(e,t,i,n,a,s,l){if("Disabled"!==o.eventMoveHandling){i=o.$9t(i);var r={};r.e=e,r.newStart=t,r.newEnd=i,r.newResource=n,r.external=a,r.ctrl=!1,r.meta=!1,r.shift=!1,s&&(r.shift=s.shiftKey,r.ctrl=s.ctrlKey,r.meta=s.metaKey),r.multimove=DayPilot.list(f.list);var d={};if(d.event=e,d.start=t,d.end=i,r.multimove.splice(0,0,d),r.position=l,r.preventDefault=function(){this.preventDefault.value=!0},o.$8F()){if("function"==typeof o.onEventMove){if(o.onEventMove(r),r.preventDefault.value)return;t=r.newStart,i=r.newEnd}switch(o.eventMoveHandling){case"PostBack":o.eventMovePostBack(r);break;case"CallBack":o.eventMoveCallBack(r);break;case"Notify":o.eventMoveNotify(r);break;case"Update":o.$9w(r)}"function"==typeof o.onEventMoved&&o.onEventMoved(r)}else switch(o.eventMoveHandling){case"PostBack":o.eventMovePostBack(r);break;case"CallBack":o.eventMoveCallBack(r);break;case"JavaScript":o.onEventMove(e,t,i,n,a,!!s&&s.ctrlKey,!!s&&s.shiftKey,l);break;case"Notify":o.eventMoveNotify(r);break;case"Update":o.$9w(r)}}},this.$9w=function(e){var t=e.e,i=e.newStart,n=e.newEnd,a=e.newResource,s=e.external;t.start(i),t.end(n),t.resource(a),s?(t.commit(),o.events.add(t)):o.events.update(t),e.multimove.isEmpty()||e.multimove.each(function(e){if(e.event!==t){if(e.event.start(e.start),e.event.end(e.end),f.rowoffset){var i=e.event.part.dayIndex+f.rowoffset,n=o.rowlist[i].id;e.event.resource(n)}e.event.commit(),o.events.update(e.event)}}),o.$88()},this.$9Y=function(e,t){var i=o.$9Z(t),n={};n.args=e,n.guid=i,o.$9h("Bubble",n)},this.$9Z=function(e){var t=DayPilot.guid();return this.bubbles||(this.bubbles=[]),this.bubbles[t]=e,t},this.eventMenuClickPostBack=function(e,t,i){var n={};n.e=e,n.command=t,this.$9g("EventMenuClick",n,i)},this.eventMenuClickCallBack=function(e,t,i){var n={};n.e=e,n.command=t,this.$9h("EventMenuClick",n,i)},this.$a0=function(e,t,i){switch(i){case"PostBack":o.eventMenuClickPostBack(t,e);break;case"CallBack":o.eventMenuClickCallBack(t,e)}},this.timeRangeSelectedPostBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.$9g("TimeRangeSelected",a,n)},this.timeRangeSelectedCallBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.$9h("TimeRangeSelected",a,n)},this.$a1=function(e){if(e)if(e.disabled)o.clearSelection();else{var t=o.$a2(e);t&&o.$a3(t.start,t.end,t.resource)}},this.$a3=function(e,t,n){if("Disabled"!==o.timeRangeSelectedHandling){var a=t;t=o.$9t(a);var s={};if(s.start=e,s.end=t,s.resource=n,s.preventDefault=function(){this.preventDefault.value=!0},s.multirange=DayPilot.list(D.list).map(function(e){return o.$a2(e)}),s.multirange.isEmpty()&&s.multirange.push({start:s.start,end:s.end,resource:s.resource}),o.$8F()){if("function"==typeof o.onTimeRangeSelect){if(o.onTimeRangeSelect(s),s.preventDefault.value)return;e=s.start,t=s.end}switch(o.$a4(i.rangeHold,e,t,s.multirange),o.$a5(i.rangeHold,!0),o.timeRangeSelectedHandling){case"PostBack":o.$9v("PostBack",s);break;case"CallBack":o.$9v("CallBack",s)}"function"==typeof o.onTimeRangeSelected&&o.onTimeRangeSelected(s)}else switch(o.timeRangeSelectedHandling){case"PostBack":o.$9v("PostBack",s);break;case"CallBack":o.$9v("CallBack",s);break;case"JavaScript":o.onTimeRangeSelected(e,t,n,s.multirange)}}},this.$a4=function(e,t,i,n){if(e&&!(n&&n.length>1)){var a,s,l=o.$9V(i),r=0;if("Days"===o.viewType)r=o.$a6(t).start.getTime()-o.startDate.getTime();t.getTime()<o.itline[0].start.getTime()?e.start.x=0:(s=(a=o.$9d(t.addTime(-r))).current||a.previous,e.start.x=DayPilot.indexOf(o.itline,s)),(a=o.$9d(l.addMilliseconds(-1).addTime(-r))).past?e.end.x=o.itline.length-1:(s=a.current||a.next,e.end.x=DayPilot.indexOf(o.itline,s))}},this.$a6=function(e){for(var t=e.getDatePart().getTime(),i=0;i<o.rowlist.length;i++){var n=o.rowlist[i];if(n.start.getTime()===t)return n}},this.timeRangeDoubleClickPostBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.$9g("TimeRangeDoubleClick",a,n)},this.timeRangeDoubleClickCallBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.$9h("TimeRangeDoubleClick",a,n)},this.$a7=function(e,t,i){if(t=o.$9t(t),o.$8F()){var n={};if(n.start=e,n.end=t,n.resource=i,n.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onTimeRangeDoubleClick&&(o.onTimeRangeDoubleClick(n),n.preventDefault.value))return;switch(o.timeRangeDoubleClickHandling){case"PostBack":o.timeRangeDoubleClickPostBack(e,t,i);break;case"CallBack":o.timeRangeDoubleClickCallBack(e,t,i)}"function"==typeof o.onTimeRangeDoubleClicked&&o.onTimeRangeDoubleClicked(n)}else switch(o.timeRangeDoubleClickHandling){case"PostBack":o.timeRangeDoubleClickPostBack(e,t,i);break;case"CallBack":o.timeRangeDoubleClickCallBack(e,t,i);break;case"JavaScript":o.onTimeRangeDoubleClick(e,t,i)}},this.timeRangeMenuClickPostBack=function(e,t,i){var n={};n.selection=e,n.command=t,this.$9g("TimeRangeMenuClick",n,i)},this.timeRangeMenuClickCallBack=function(e,t,i){var n={};n.selection=e,n.command=t,this.$9h("TimeRangeMenuClick",n,i)},this.$a8=function(e,t,i){switch(i){case"PostBack":o.timeRangeMenuClickPostBack(t,e);break;case"CallBack":o.timeRangeMenuClickCallBack(t,e)}},this.linkMenuClickPostBack=function(e,t,i){var n={};n.link=e,n.command=t,this.$9g("LinkMenuClick",n,i)},this.linkMenuClickCallBack=function(e,t,i){var n={};n.link=e,n.command=t,this.$9h("LinkMenuClick",n,i)},this.$a9=function(e,t,i){switch(i){case"PostBack":o.linkMenuClickPostBack(t,e);break;case"CallBack":o.linkMenuClickCallBack(t,e)}},this.rowMenuClickPostBack=function(e,t,i){var n={};n.resource=e,n.command=t,this.$9g("RowMenuClick",n,i)},this.resourceHeaderMenuClickPostBack=this.rowMenuClickPostBack,this.rowMenuClickCallBack=function(e,t,i){var n={};n.resource=e,n.command=t,this.$9h("RowMenuClick",n,i)},this.resourceHeaderMenuClickCallBack=this.rowMenuClickCallBack,this.$aa=function(e,t,i){switch(i){case"PostBack":o.rowMenuClickPostBack(t,e);break;case"CallBack":o.rowMenuClickCallBack(t,e)}},this.$ab=function(e,t){y.$ac(e).cells[0].textDiv.innerHTML=t,e.Text=t,e.html=t},this.$ad=function(e,t){if(t){var i={};if(i.text=t,i.preventDefault=function(){this.preventDefault.value=!0},"function"!=typeof o.onRowCreate||(o.onRowCreate(i),!i.preventDefault.value)){switch(o.rowCreateHandling){case"CallBack":o.rowCreateCallBack(i.text);break;case"PostBack":o.rowCreatePostBack(i.text)}"function"==typeof o.onRowCreated&&o.onRowCreated(i)}}},this.$ae=function(e,t){if(e.isNewRow)o.$ad(e,t);else{var i=DayPilot.indexOf(o.rowlist,e),n=o.$af(e,i);if(o.$8F()){var a={};if(a.resource=n,a.newText=t,a.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onRowEdit&&(o.onRowEdit(a),a.preventDefault.value))return;switch(o.rowEditHandling){case"PostBack":o.rowEditPostBack(n,t);break;case"CallBack":o.rowEditCallBack(n,t);break;case"Update":o.$ab(e,t)}"function"==typeof o.onRowEdited&&o.onRowEdited(a)}else switch(o.rowEditHandling){case"PostBack":o.rowEditPostBack(n,t);break;case"CallBack":o.rowEditCallBack(n,t);break;case"JavaScript":o.onrowEdit(n,t)}}},this.rowCreatePostBack=function(e,t){var i={};i.text=e,this.$9g("RowCreate",i,t)},this.rowCreateCallBack=function(e,t){var i={};i.text=e,this.$9h("RowCreate",i,t)},this.rowEditPostBack=function(e,t,i){var n={};n.resource=e,n.newText=t,this.$9g("RowEdit",n,i)},this.rowEditCallBack=function(e,t,i){var n={};n.resource=e,n.newText=t,this.$9h("RowEdit",n,i)},this.rowMovePostBack=function(e,t,i,n){var a={};a.source=e,a.target=t,a.position=i,this.$9g("RowMove",a,n)},this.rowMoveCallBack=function(e,t,i,n){var a={};a.source=e,a.target=t,a.position=i,this.$9h("RowMove",a,n)},this.rowMoveNotify=function(e,t,i,n){var a={};a.source=e,a.target=t,a.position=i,this.$9h("RowMove",a,n,"Notify")},this.rowClickPostBack=function(e,t){var i={};i.resource=e,this.$9g("RowClick",i,t)},this.resourceHeaderClickPostBack=this.rowClickPostBack,this.rowClickCallBack=function(e,t){var i={};i.resource=e,this.$9h("RowClick",i,t)},this.resourceHeaderClickCallBack=this.rowClickCallBack,this.$ag=function(e,t,i,n){if("Disabled"!==o.rowDoubleClickHandling){o.timeouts.resClick||(o.timeouts.resClick=[]);o.timeouts.resClick.push(window.setTimeout(function(e,t,i,n){return function(){o.$ah(e,t,i,n)}}(e,t,i,n),o.doubleClickTimeout))}else o.$ah(e,t,i,n)},this.$ah=function(e,t,i,n){var a=o.resourceHeaderClickHandling||o.rowClickHandling;if(o.$8F()){var s={};if(s.resource=e,s.row=e,s.ctrl=t,s.shift=i,s.meta=n,s.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onRowClick&&(o.onRowClick(s),s.preventDefault.value))return;if("function"==typeof o.onResourceHeaderClick&&(o.onResourceHeaderClick(s),s.preventDefault.value))return;switch(a){case"PostBack":o.rowClickPostBack(e);break;case"CallBack":o.rowClickCallBack(e);break;case"Select":o.$ai(e.$.row,t,i,n);break;case"Edit":o.$aj.edit(e.$.row)}"function"==typeof o.onRowClicked&&o.onRowClicked(s),"function"==typeof o.onResourceHeaderClicked&&o.onResourceHeaderClicked(s)}else switch(a){case"PostBack":o.rowClickPostBack(e);break;case"CallBack":o.rowClickCallBack(e);break;case"JavaScript":o.onRowClick(e);break;case"Select":o.$ai(e.$.row,t,i);break;case"Edit":o.$aj.edit(e.$.row)}},this.timeHeaderClickPostBack=function(e,t){var i={};i.header=e,this.$9g("TimeHeaderClick",i,t)},this.timeHeaderClickCallBack=function(e,t){var i={};i.header=e,this.$9h("TimeHeaderClick",i,t)},this.$ak=function(e){if(o.$8F()){var t={};if(t.header=e,t.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onTimeHeaderClick&&(o.onTimeHeaderClick(t),t.preventDefault.value))return;switch(this.timeHeaderClickHandling){case"PostBack":o.timeHeaderClickPostBack(e);break;case"CallBack":o.timeHeaderClickCallBack(e)}"function"==typeof o.onTimeHeaderClicked&&o.onTimeHeaderClicked(t)}else switch(this.timeHeaderClickHandling){case"PostBack":o.timeHeaderClickPostBack(e);break;case"CallBack":o.timeHeaderClickCallBack(e);break;case"JavaScript":o.onTimeHeaderClick(e)}},this.resourceCollapsePostBack=function(e,t){var i={};i.resource=e,this.$9g("ResourceCollapse",i,t)},this.resourceCollapseCallBack=function(e,t){var i={};i.resource=e,this.$9h("ResourceCollapse",i,t)},this.$al=function(e){if(o.$8F()){var t={};if(t.resource=e,t.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onResourceCollapse&&(o.onResourceCollapse(t),t.preventDefault.value))return;switch(this.resourceCollapseHandling){case"PostBack":o.resourceCollapsePostBack(e);break;case"CallBack":o.resourceCollapseCallBack(e)}}else switch(this.resourceCollapseHandling){case"PostBack":o.resourceCollapsePostBack(e);break;case"CallBack":o.resourceCollapseCallBack(e);break;case"JavaScript":o.onResourceCollapse(e)}},this.resourceExpandPostBack=function(e,t){var i={};i.resource=e,this.$9g("ResourceExpand",i,t)},this.resourceExpandCallBack=function(e,t){var i={};i.resource=e,this.$9h("ResourceExpand",i,t)},this.$am=function(e){if(o.$8F()){var t={};if(t.resource=e,t.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onResourceExpand&&(o.onResourceExpand(t),t.preventDefault.value))return;switch(this.resourceExpandHandling){case"PostBack":o.resourceExpandPostBack(e);break;case"CallBack":o.resourceExpandCallBack(e)}}else switch(this.resourceExpandHandling){case"PostBack":o.resourceExpandPostBack(e);break;case"CallBack":o.resourceExpandCallBack(e);break;case"JavaScript":o.onResourceExpand(e)}},this.eventEditPostBack=function(e,t,i){var n={};n.e=e,n.newText=t,this.$9g("EventEdit",n,i)},this.eventEditCallBack=function(e,t,i){var n={};n.e=e,n.newText=t,this.$9h("EventEdit",n,i)},this.$an=function(e,t){if(o.$8F()){var i={};if(i.e=e,i.newText=t,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onEventEdit&&(o.onEventEdit(i),i.preventDefault.value))return;switch(o.eventEditHandling){case"PostBack":o.eventEditPostBack(e,t);break;case"CallBack":o.eventEditCallBack(e,t);break;case"Update":e.text(t),o.events.update(e)}if("function"==typeof o.onEventEdited&&(o.onEventEdited(i),i.preventDefault.value))return}else switch(o.eventEditHandling){case"PostBack":o.eventEditPostBack(e,t);break;case"CallBack":o.eventEditCallBack(e,t);break;case"JavaScript":o.onEventEdit(e,t)}},this.commandCallBack=function(e,t){this.$ao("CallBack",e,t)},this.commandPostBack=function(e,t){this.$ao("PostBack",e,t)},this.$ao=function(e,t,i){var n={};n.command=t,this.$9r(e,"Command",n,i)},this.$9g=function(e,t,i){var n={};n.action=e,n.type="PostBack",n.parameters=t,n.data=i,n.header=this.$ap();var a="JSON"+DayPilot.JSON.stringify(n);__doPostBack(o.uniqueID,a)},this.$9h=function(e,t,i,n){if(o.$92()){void 0===n&&(n="CallBack"),this.$aq(),o.$ar();var a={};a.action=e,a.type=n,a.parameters=t,a.data=i,a.header=this.$ap();var s,l=DayPilot.JSON.stringify(a);s="undefined"!=typeof Iuppiter&&Iuppiter.compress?"LZJB"+Iuppiter.Base64.encode(Iuppiter.compress(l)):"JSON"+l,this.$as(a);this.backendUrl?DayPilot.request(this.backendUrl,this.$at,s,this.$au):"function"==typeof WebForm_DoCallback&&WebForm_DoCallback(this.uniqueID,s,this.$87,null,this.callbackError,!0)}else o.debug.message("Callback invoked without the server-side backend specified. Callback canceled.","warning")},this.$as=function(e){"function"==typeof o.onCallBackStart&&o.onCallBackStart({})},this.$8c=function(){var e={};"function"==typeof o.onCallBackEnd&&setTimeout(function(){o.onCallBackEnd(e)},0)},this.$92=function(){return!!this.backendUrl||!!this.$av()},this.$av=function(){return!("function"!=typeof WebForm_DoCallback||!this.uniqueID)},this.$au=function(e){if("function"==typeof o.onAjaxError){var t={};t.request=e,o.onAjaxError(t)}else"function"==typeof o.ajaxError&&o.ajaxError(e)},this.$at=function(e){o.$87(e.responseText)},this.$ap=function(){var e={};e.v=this.v,e.control="dps",e.id=this.id,e.startDate=o.startDate,e.days=o.days,e.cellDuration=o.cellDuration,e.cellGroupBy=o.cellGroupBy,e.cellWidth=o.cellWidth,e.cellWidthSpec=o.cellWidthSpec,e.viewType=o.viewType,e.hourNameBackColor=o.hourNameBackColor,e.showNonBusiness=o.showNonBusiness,e.businessBeginsHour=o.businessBeginsHour,e.businessEndsHour=o.businessEndsHour,e.weekStarts=o.weekStarts,e.treeEnabled=o.treeEnabled,e.backColor=o.cellBackColor,e.nonBusinessBackColor=o.cellBackColorNonBusiness,e.locale=o.locale,e.timeZone=o.timeZone,e.tagFields=o.tagFields,e.timeHeaders=o.timeHeaders,e.cssOnly=o.cssOnly,e.cssClassPrefix=o.cssClassPrefix,e.durationBarMode=o.durationBarMode,e.showBaseTimeHeader=!0,e.rowHeaderColumns=o.rowHeaderColumns,e.rowMarginBottom=o.rowMarginBottom,e.rowMarginTop=o.rowMarginTop,e.rowMinHeight=o.rowMinHeight,e.scale=o.scale,e.clientState=o.clientState,this.nav.scroll&&(e.scrollX=this.nav.scroll.scrollLeft,e.scrollY=this.nav.scroll.scrollTop),e.selected=o.multiselect.events(),e.selectedRows=y.$aw(),e.hashes=o.hashes;var t=o.$ax(e.scrollX,e.scrollY),i=o.$ay(t),n=o.$az(t);if(e.rangeStart=i.start,e.rangeEnd=i.end,e.resources=n,e.dynamicLoading=o.dynamicLoading,e.separators=this.separators,this.syncResourceTree&&"Days"!=this.viewType&&(e.tree=this.$aA()),this.syncLinks&&(e.links=this.$aB()),"Manual"===this.scale&&(e.timeline=this.$aC()),"function"==typeof o.onCallBackHeader){var a={};a.header=e,o.onCallBackHeader(a)}return e},this.$aC=function(){var e=[];return DayPilot.list(o.timeline).each(function(t){var i={};i.start=t.start,i.end=t.end,i.width=t.width,e.push(i)}),e},this.$aB=function(){var e=[],t=function(e){var t={};if(e.tags)for(var i in e.tags)t[i]=""+e.tags[i];return t};if(!DayPilot.isArray(o.links.list))return e;for(var i=0;i<o.links.list.length;i++){var n=o.links.list[i],a={};a.id=n.id,a.from=n.from,a.to=n.to,a.type=n.type,a.tags=t(n),e.push(a)}return e},this.getViewPort=function(){var e=this.nav.scroll.scrollLeft,t=this.nav.scroll.scrollTop,i=this.$ax(e,t),n=this.$ay(i),a=this.$az(i),s={};return s.start=n.start,s.end=n.end,s.resources=a,s},this.$ax=function(e,t){var i={start:{},end:{}};i.start.x=Math.floor(e/o.cellWidth),i.end.x=Math.floor((e+o.nav.scroll.clientWidth)/o.cellWidth),i.start.y=o.$aD(t).i,i.end.y=o.$aD(t+o.nav.scroll.clientHeight).i;var n=this.itline.length;return i.end.x>=n&&(i.end.x=n-1),i},this.$ay=function(e){var t={};if(this.itline.length<=0)return t.start=this.startDate,t.end=this.startDate,t;if(!this.itline[e.start.x])throw"Internal error: area.start.x is null.";return t.start=this.itline[e.start.x].start,t.end=this.itline[e.end.x].end,t},this.$az=function(e){if(!e)e=this.$ax(this.nav.scroll.scrollLeft,this.nav.scroll.scrollTop);var t=[];t.ignoreToJSON=!0;for(var i=e.start.y;i<=e.end.y;i++){var n=o.rowlist[i];n&&!n.hidden&&t.push(n.id)}return t},this.$aA=function(){var e=[];e.ignoreToJSON=!0;for(var t=0;t<this.rowlist.length;t++){var i=this.rowlist[t];if(!(i.level>0)&&!i.isNewRow){var n=this.$aE(t);e.push(n)}}return e},this.$aF=function(e){var t=[];t.ignoreToJSON=!0;for(var i=0;i<e.length;i++){var n=e[i];o.rowlist[n].isNewRow||t.push(o.$aE(n))}return t},this.$aE=function(e){var t=this.rowlist[e];if("function"==typeof o.onGetNodeState){var i={};if(i.row=t,i.preventDefault=function(){i.preventDefault.value=!0},i.result={},o.onGetNodeState(i),i.preventDefault.value)return i.result}var n={};return n.Value=t.id,n.BackColor=t.backColor,n.Name=t.name,n.InnerHTML=t.html,n.ToolTip=t.toolTip,n.Expanded=t.expanded,n.Children=this.$aF(t.children),n.Loaded=t.loaded,n.IsParent=t.isParent,n.Columns=this.$aG(t),t.start.getTime()!==o.startDate.getTime()&&(n.Start=t.start),t.minHeight!==o.rowMinHeight&&(n.MinHeight=t.minHeight),t.marginBottom!==o.rowMarginBottom&&(n.MarginBottom=t.marginBottom),t.marginTop!==o.rowMarginTop&&(n.MarginTop=t.marginTop),t.eventHeight!==o.eventHeight&&(n.EventHeight=t.eventHeight),n},this.$aG=function(e){if(!e.columns||0===e.columns.length)return null;var t=[];t.ignoreToJSON=!0;for(var i=0;i<e.columns.length;i++){var n={};n.InnerHTML=e.columns[i].html,t.push(n)}return t},this.$8R=function(e){var t=this.theme||this.cssClassPrefix;return t?t+e:""},this.$aH=function(){this.nav.top.dispose=this.dispose},this.dispose=function(){var e=o;e.nav.top&&(e.$aq(),e.$8t(),e.divBreaks=null,e.divCells=null,e.divCorner=null,e.divCrosshair=null,e.divEvents=null,e.divHeader&&(e.divHeader.rows=null),e.divHeader=null,e.divLines=null,e.divNorth=null,e.divRange=null,e.divResScroll=null,e.divSeparators=null,e.divSeparatorsAbove=null,e.divStretch=null,e.divTimeScroll=null,e.$8Y=null,e.$8e=null,e.$8G.calendar=null,e.$8G=null,e.nav.loading=null,e.nav.top.onmousemove=null,e.nav.top.dispose=null,e.nav.top.ontouchstart=null,e.nav.top.ontouchmove=null,e.nav.top.ontouchend=null,e.nav.top.removeAttribute("style"),e.nav.top.removeAttribute("class"),e.nav.top.innerHTML="",e.nav.top.dp=null,e.nav.top=null,e.nav.scroll.onscroll=null,e.nav.scroll.root=null,e.nav.scroll=null,DayPilot.ue(window,"resize",e.$8o),i.unregister(e))},this.$aI=function(e,t){var i=o.$8G,n=o.$aJ(e),a=e.event,s=a.part.height||o.$aK.eventHeight(),l=a.part&&a.part.top?a.part.top+o.rowlist[a.part.dayIndex].top:n.top,r=document.createElement("div");r.setAttribute("unselectable","on"),r.style.position="absolute",r.style.width=n.width+"px",r.style.height=s+"px",r.style.left=n.left+"px",r.style.top=l+"px",r.style.zIndex=101,r.style.overflow="hidden";var d=document.createElement("div");return r.appendChild(d),this.cssOnly&&(r.className=this.$8R("_shadow"),d.className=this.$8R("_shadow_inner")),this.cssOnly||("Fill"===t?(d.style.backgroundColor="#aaaaaa",d.style.opacity=.5,d.style.filter="alpha(opacity=50)",d.style.height="100%",e&&e.event&&e.style&&(d.style.fontSize=e.style.fontSize,d.style.fontFamily=e.style.fontFamily,d.style.color=e.style.color,d.innerHTML=e.event.client.innerHTML())):(r.style.paddingTop="2px",d.style.border="2px dotted #666666")),i.appendChild(r),r.calendar=o,r},this.$aL=function(e,t){var n=o.$8G,a=o.$aJ(e),s=e.event,l=s;if(!o.$aM(a.rowIndex)){var r=s.part.height||o.$aK.eventHeight(),d=s.part&&s.part.top?s.part.top+o.rowlist[s.part.dayIndex].top:a.top,h=a.left,c=l.cache&&void 0!==l.cache.moveVDisabled?!l.cache.moveVDisabled:!l.data.moveVDisabled,u=l.cache&&void 0!==l.cache.moveHDisabled?!l.cache.moveHDisabled:!l.data.moveHDisabled;!c&&i.moving&&(d=o.rowlist[l.part.dayIndex].top),!u&&i.moving&&(h=s.part.left);var f=document.createElement("div");f.setAttribute("unselectable","on"),f.style.position="absolute",f.style.width=a.width+"px",f.style.height=r+"px",f.style.left=h+"px",f.style.top=d+"px",f.style.zIndex=101,f.style.overflow="hidden";var v=document.createElement("div");return f.appendChild(v),this.cssOnly&&(f.className=this.$8R("_shadow"),v.className=this.$8R("_shadow_inner")),this.cssOnly||("Fill"===t?(v.style.backgroundColor="#aaaaaa",v.style.opacity=.5,v.style.filter="alpha(opacity=50)",v.style.height="100%",e&&e.event&&e.style&&(v.style.fontSize=e.style.fontSize,v.style.fontFamily=e.style.fontFamily,v.style.color=e.style.color,v.innerHTML=e.event.client.innerHTML())):(f.style.paddingTop="2px",v.style.border="2px dotted #666666")),n.appendChild(f),f.calendar=o,f}},this.$aD=function(e){for(var t,i={},n=0,a=0,s=this.rowlist.length,o=0;o<s;o++){var l=this.rowlist[o];if(!l.hidden&&(e<(a+=l.height)||o===s-1)){n=a-l.height,t=l;break}}return i.top=n,i.bottom=a,i.i=o,i.element=t,i},this.links={};var d={};this.$aN=d,d.clear=function(){o.divLinksAbove.innerHTML="",o.divLinksBelow.innerHTML="",o.elements.links=[]},d.showLinkpoints=function(){l.events().each(function(e){d.showLinkpoint(e)})},d.showLinkpoint=function(e){var t=e.event.part.left,i=o.rowlist[e.event.part.dayIndex].top+e.event.part.top,n=e.event.part.height,a=e.event.part.right,s=DayPilot.Util.div(o.divLinkpoints,t-5,i-5+n/2,10,10);s.style.backgroundColor="white",s.style.border="1px solid gray",s.style.borderRadius="5px",s.style.boxSizing="border-box",s.coords={x:t,y:i+n/2},s.type="Start",s.event=e.event,d.activateLinkpoint(s),o.elements.linkpoints.push(s);var l=DayPilot.Util.div(o.divLinkpoints,a-5,i-5+n/2,10,10);l.style.backgroundColor="white",l.style.border="1px solid gray",l.style.borderRadius="5px",l.style.boxSizing="border-box",l.coords={x:a,y:i+n/2},l.type="Finish",l.event=e.event,d.activateLinkpoint(l),o.elements.linkpoints.push(l)},d.activateLinkpoint=function(e){e.onmousedown=function(t){t=t||window.event;return s.source=e,s.calendar=o,d.showLinkpoints(),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),!1},e.onmousemove=function(t){e.style.backgroundColor="black",d.clearHideTimeout()},e.onmouseout=function(t){s.source&&s.source.event===e.event||(e.style.backgroundColor="white")},e.onmouseup=function(t){if(s.source){var i=s.source.type+"To"+e.type,n=s.source.event.id(),a=e.event.id(),l={};if(l.from=n,l.to=a,l.type=i,l.id=null,l.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onLinkCreate&&(o.onLinkCreate(l),l.preventDefault.value))return;var r=function(){o.links.list.push({from:n,to:a,type:i,id:l.id}),d.load()};switch(o.linkCreateHandling){case"Update":r();break;case"CallBack":o.$aO(l);break;case"PostBack":o.$aP(l);break;case"Notify":r(),o.$aQ(l)}"function"==typeof o.onLinkCreated&&o.onLinkCreated(l)}}},d.hideLinkpoints=function(){o.divLinkpoints.innerHTML="",o.elements.linkpoints=[]},d.hideTimeout=null,d.hideLinkpointsWithDelay=function(){d.hideTimeout=setTimeout(function(){d.hideLinkpoints()},100)},d.clearHideTimeout=function(){d.hideTimeout&&(clearTimeout(d.hideTimeout),d.hideTimeout=null)},d.load=function(){if(d.clear(),DayPilot.isArray(o.links.list))for(var e=0;e<o.links.list.length;e++){var t=o.links.list[e];d.drawLinkId(t.from,t.to,t)}},d.drawLinkId=function(e,t,i){var n=o.events.find(e),a=o.events.find(t);d.drawLink(n,a,i)},d.drawLink=function(e,t,i){var n=o.$aR(e),a=o.$aR(t);if(n&&a){var s,l,r=i.type||"FinishToStart",h=o.rowlist[n.event.part.dayIndex].top,c=o.rowlist[a.event.part.dayIndex].top;switch(r){case"FinishToStart":s={x:n.event.part.right,y:h+n.event.part.top},l={x:a.event.part.left,y:c+a.event.part.top};break;case"StartToFinish":s={x:n.event.part.left,y:h+n.event.part.top},l={x:a.event.part.right,y:c+a.event.part.top};break;case"StartToStart":s={x:n.event.part.left,y:h+n.event.part.top},l={x:a.event.part.left,y:c+a.event.part.top};break;case"FinishToFinish":s={x:n.event.part.right,y:h+n.event.part.top},l={x:a.event.part.right,y:c+a.event.part.top}}d.drawLinkXy(s,l,i)}},d.clearShadow=function(){o.divLinkShadow.innerHTML="",o.elements.linkshadow=[]},d.drawShadow=function(e,t){if(d.clearShadow(),DayPilot.browser.ielt9)d.drawShadowOldStyle(e,t);else{var i=o.divLinkShadow,n=DayPilot.line(e.x,e.y,t.x,t.y,!0);i.appendChild(n),o.elements.linkshadow.push(n)}},d.drawShadowOldStyle=function(e,t){var i=Math.min(e.x,t.x),n=o.divLinkShadow,a="black",s=DayPilot.Util.div(n,i,e.y,e.x-i,2);s.style.backgroundColor=a,o.elements.linkshadow.push(s);var l=DayPilot.Util.div(n,i,e.y,2,t.y-e.y);l.style.backgroundColor=a,o.elements.linkshadow.push(l);var r=DayPilot.Util.div(n,i,t.y,t.x-i,2);r.style.backgroundColor=a,o.elements.linkshadow.push(r);var d=DayPilot.Util.div(n,t.x-6,t.y-5,0,0);d.style.borderColor="transparent transparent transparent "+a,d.style.borderStyle="solid",d.style.borderWidth="6px",o.elements.linkshadow.push(d)},d.drawLinkXy=function(e,t,i){var n=o.eventHeight/2,a=i.width||1,s=i.type||"FinishToStart",l=i.color,r=i.style,d=(w="Above"===(i.layer||"Above"))?o.divLinksAbove:o.divLinksBelow,h=o.eventHeight,c=o.linkBottomMargin,u=function(e,t){l&&(e.style["border"+t+"Color"]=l),r&&(e.style["border"+t+"Style"]=r)},f=[],v=function(e,t){o.elements.links.push(e),y(e),p(e),e.divs=f,t||f.push(e)},p=function(e){e.oncontextmenu=function(e){if(e=e||window.event,o.contextMenuLink){var t=new DayPilot.Link(i,o);o.contextMenuLink.show(t)}e.cancelBubble=!0,e.preventDefault&&e.preventDefault()}},y=function(e){e.onmouseenter=function(){DayPilot.Util.addClass(e.divs,o.$8R("_link_hover"))},e.onmouseleave=function(){DayPilot.Util.removeClass(e.divs,o.$8R("_link_hover"))}};if("FinishToStart"===s)if(e.y===t.y){var g=e.x,m=e.y+h-c,b=t.x;(P=DayPilot.Util.div(d,g,m,b-e.x,a)).style.boxSizing="border-box",P.style.borderBottomWidth=a+"px",P.className=o.$8R("_link_horizontal"),DayPilot.Util.addClass(P,i.cssClass),u(P,"Bottom"),v(P),l?((M=DayPilot.Util.div(d,t.x-6,t.y+h-c-5,0,0)).style.borderWidth="6px",M.style.borderColor="transparent transparent transparent "+l,M.style.borderStyle="solid"):((M=DayPilot.Util.div(d,t.x-6,t.y+h-c-5,6,6)).className=o.$8R("_link_arrow_right"),DayPilot.Util.addClass(M,i.cssClass)),v(M,!0)}else if(e.x>t.x){var w=5,$=t.y-w;(P=DayPilot.Util.div(d,e.x,e.y+h-c,n+a,a)).style.boxSizing="border-box",P.style.borderBottomWidth=a+"px",P.className=o.$8R("_link_horizontal"),DayPilot.Util.addClass(P,i.cssClass),u(P,"Bottom"),v(P),(S=DayPilot.Util.div(d,e.x+n,e.y+h-c,a,$-(e.y+h-c))).style.boxSizing="border-box",S.style.borderRightWidth=a+"px",S.className=o.$8R("_link_vertical"),DayPilot.Util.addClass(S,i.cssClass),u(S,"Right"),v(S),(k=DayPilot.Util.div(d,t.x-n,$,e.x+2*n+a-t.x,a)).style.boxSizing="border-box",k.style.borderBottomWidth=a+"px",k.className=o.$8R("_link_horizontal"),DayPilot.Util.addClass(k,i.cssClass),u(k,"Bottom"),v(k),(C=DayPilot.Util.div(d,t.x-n,$,a,t.y-$+h-c)).style.boxSizing="border-box",C.style.borderRightWidth=a+"px",C.className=o.$8R("_link_vertical"),DayPilot.Util.addClass(C,i.cssClass),u(C,"Right"),v(C),(T=DayPilot.Util.div(d,t.x-n,t.y+h-c,n,a)).style.boxSizing="border-box",T.style.borderBottomWidth=a+"px",T.className=o.$8R("_link_horizontal"),DayPilot.Util.addClass(T,i.cssClass),u(T,"Bottom"),v(T),l?((M=DayPilot.Util.div(d,t.x-6,t.y+h-c-5,0,0)).style.borderWidth="6px",M.style.borderColor="transparent transparent transparent "+l,M.style.borderStyle="solid"):((M=DayPilot.Util.div(d,t.x-6,t.y+h-c-5,6,6)).className=o.$8R("_link_arrow_right"),DayPilot.Util.addClass(M,i.cssClass)),v(M,!0)}else{g=e.x,m=e.y+h-c,b=t.x+n;var D=t.y;(P=DayPilot.Util.div(d,g,m,b-e.x,a)).style.boxSizing="border-box",P.style.borderBottomWidth=a+"px",P.className=o.$8R("_link_horizontal"),DayPilot.Util.addClass(P,i.cssClass),u(P,"Bottom"),v(P),(S=DayPilot.Util.div(d,b,m,a,D-m)).style.boxSizing="border-box",S.style.borderRightWidth=a+"px",S.className=o.$8R("_link_vertical"),DayPilot.Util.addClass(S,i.cssClass),u(S,"Right"),v(S),l?((M=DayPilot.Util.div(d,b-5+Math.floor(a/2),D-5,0,0)).style.borderColor=l+" transparent transparent transparent",M.style.borderStyle="solid",M.style.borderWidth="5px"):((M=DayPilot.Util.div(d,b-6+Math.floor(a/2),D-6,6,6)).className=o.$8R("_link_arrow_down"),DayPilot.Util.addClass(M,i.cssClass)),v(M,!0)}else if("StartToFinish"===s){var k,C;w=5,$=t.y-w;(P=DayPilot.Util.div(d,t.x,t.y+h-c,n+a,a)).style.boxSizing="border-box",P.style.borderBottomWidth=a+"px",P.className=o.$8R("_link_horizontal"),DayPilot.Util.addClass(P,i.cssClass),u(P,"Bottom"),v(P),(S=DayPilot.Util.div(d,t.x+n,t.y+h-c,a,$-(t.y+h-c)+0)).style.boxSizing="border-box",S.style.borderRightWidth=a+"px",S.className=o.$8R("_link_vertical"),DayPilot.Util.addClass(S,i.cssClass),u(S,"Right"),v(S),(k=DayPilot.Util.div(d,e.x-n,$,t.x+2*n+a-e.x,a)).style.boxSizing="border-box",k.style.borderBottomWidth=a+"px",k.className=o.$8R("_link_horizontal"),DayPilot.Util.addClass(k,i.cssClass),u(k,"Bottom"),v(k),(C=DayPilot.Util.div(d,e.x-n,$,a,e.y+h-c-$+0)).style.boxSizing="border-box",C.style.borderRightWidth=a+"px",C.className=o.$8R("_link_vertical"),DayPilot.Util.addClass(C,i.cssClass),u(C,"Right"),v(C),(T=DayPilot.Util.div(d,e.x-n,e.y+h-c,n,a)).style.boxSizing="border-box",T.style.borderBottomWidth=a+"px",T.className=o.$8R("_link_horizontal"),DayPilot.Util.addClass(T,i.cssClass),u(T,"Bottom"),v(T),l?((M=DayPilot.Util.div(d,t.x-6,t.y+h-c-5,0,0)).style.borderColor="transparent "+l+" transparent transparent",M.style.borderStyle="solid",M.style.borderWidth="6px"):((M=DayPilot.Util.div(d,t.x-6,t.y+h-c-5,6,6)).className=o.$8R("_link_arrow_left"),DayPilot.Util.addClass(M,i.cssClass)),v(M,!0)}else if("StartToStart"===s){var x=Math.min(e.x,t.x)-n;(P=DayPilot.Util.div(d,x,e.y+h-c,e.x-x,a)).style.boxSizing="border-box",P.style.borderBottomWidth=a+"px",P.className=o.$8R("_link_horizontal"),DayPilot.Util.addClass(P,i.cssClass),u(P,"Bottom"),v(P),(S=DayPilot.Util.div(d,x,e.y+h-c,a,t.y-e.y)).style.boxSizing="border-box",S.style.borderRightWidth=a+"px",S.className=o.$8R("_link_vertical"),DayPilot.Util.addClass(S,i.cssClass),u(S,"Right"),v(S),(T=DayPilot.Util.div(d,x,t.y+h-c,t.x-x,a)).style.boxSizing="border-box",T.style.borderBottomWidth=a+"px",T.className=o.$8R("_link_horizontal"),DayPilot.Util.addClass(T,i.cssClass),u(T,"Bottom"),v(T),l?((M=DayPilot.Util.div(d,t.x-6,t.y+h-c-5,0,0)).style.borderColor="transparent transparent transparent "+l,M.style.borderStyle="solid",M.style.borderWidth="6px"):((M=DayPilot.Util.div(d,t.x-6,t.y+h-c-5,6,6)).className=o.$8R("_link_arrow_right"),DayPilot.Util.addClass(M,i.cssClass)),v(M,!0)}else if("FinishToFinish"===s){var P,S,T,M,H=Math.max(t.x,e.x)+n;(P=DayPilot.Util.div(d,e.x,e.y+h-c,H-e.x,a)).style.boxSizing="border-box",P.style.borderBottomWidth=a+"px",P.className=o.$8R("_link_horizontal"),DayPilot.Util.addClass(P,i.cssClass),u(P,"Bottom"),v(P),(S=DayPilot.Util.div(d,H,e.y+h-c,a,t.y-e.y)).style.boxSizing="border-box",S.style.borderRightWidth=a+"px",S.className=o.$8R("_link_vertical"),DayPilot.Util.addClass(S,i.cssClass),u(S,"Right"),v(S),(T=DayPilot.Util.div(d,t.x,t.y+h-c,H-t.x,a)).style.boxSizing="border-box",T.style.borderBottomWidth=a+"px",T.className=o.$8R("_link_horizontal"),DayPilot.Util.addClass(T,i.cssClass),u(T,"Bottom"),v(T),l?((M=DayPilot.Util.div(d,t.x-6,t.y+h-c-5,0,0)).style.borderColor="transparent "+l+" transparent transparent",M.style.borderStyle="solid",M.style.borderWidth="6px"):((M=DayPilot.Util.div(d,t.x-6,t.y+h-c-5,6,6)).className=o.$8R("_link_arrow_left"),DayPilot.Util.addClass(M,i.cssClass)),v(M,!0)}},this.$aO=function(e,t){var i={};i.from=e.from,i.to=e.to,i.type=e.type,o.$9h("LinkCreate",i,t)},this.$aQ=function(e,t){var i={};i.from=e.from,i.to=e.to,i.type=e.type,o.$9h("LinkCreate",i,t,"Notify")},this.$aP=function(e,t){var i={};i.from=e.from,i.to=e.to,i.type=e.type,o.$9g("LinkCreate",i,t)},this.$aS=function(e){var t,i=0,n=0;if(e>this.rowlist.length-1)throw"Row index too high (DayPilotScheduler._getRowByIndex)";for(var a=0;a<=e;a++){var s=this.rowlist[a];s.hidden||(i+=s.height,n++)}t=i-s.height;var o={};return o.top=t,o.height=s.height,o.bottom=i,o.i=n-1,o.data=s,o},this.$aT=function(){return!!this.backendUrl&&(void 0===o.events.list||!o.events.list)},this.events.find=function(e){if(!o.events.list||void 0===o.events.list.length)return null;for(var t=o.events.list.length,i=0;i<t;i++)if(o.events.list[i].id===e)return new DayPilot.Event(o.events.list[i],o);return null},this.events.all=function(){for(var e=[],t=0;t<o.events.list.length;t++){var i=new DayPilot.Event(o.events.list[t],o);e.push(i)}return DayPilot.list(e)},this.events.filter=function(e){o.events.$aU=e,o.$9E({eventsOnly:!0})},this.events.edit=function(e){var t=o.$aR(e);t&&o.$9j(t)},this.events.load=function(e,t,i){var n=function(e){var t={};t.exception=e.exception,t.request=e.request,"function"==typeof i&&i(t)};DayPilot.ajax({url:e,success:function(e){var i,a=e.request;try{i=DayPilot.Util.parseJSON(a.responseText)}catch(e){var s={};return s.exception=e,void n(s)}if(DayPilot.isArray(i)){var l={preventDefault:function(){this.preventDefault.value=!0}};if(l.data=i,"function"==typeof t&&t(l),l.preventDefault.value)return;o.events.list=i,o.$aV&&o.update()}},error:n})},this.events.findRecurrent=function(e,t){if(!o.events.list||void 0===o.events.list.length)return null;for(var i=o.events.list.length,n=0;n<i;n++)if(o.events.list[n].recurrentMasterId===e&&o.events.list[n].start.getTime()===t.getTime())return new DayPilot.Event(o.events.list[n],o);return null},this.events.$9x=function(e){for(var t=[],i=0;i<o.rowlist.length;i++){var n=o.rowlist[i];if(!n.isNewRow){o.$aW(i);for(var a=0;a<n.events.length;a++)if(n.events[a].data===e){t.push(i),n.events.splice(a,1);break}}}return t},this.events.$9y=function(e){var t=[],i=o.$aX()||"Days"===o.viewType,n=DayPilot.indexOf(o.events.list,e);o.$aY(n);for(var a=0;a<o.rowlist.length;a++){var s=o.rowlist[a];if(!s.isNewRow){o.$aW(a);var l=o.$aZ(e,s);if(l&&("function"==typeof o.onBeforeEventRender&&(l.cache=o.$86.events[n]),t.push(a),!i))break}}return t},this.events.update=function(e,t){var i={};i.oldEvent=new DayPilot.Event(e.copy(),o),i.newEvent=new DayPilot.Event(e.temp(),o);var n=new DayPilot.Action(o,"EventUpdate",i,t);if(o.$b0.scope)e.commit(),o.$b0.notify();else{var a=o.events.$9x(e.data);e.commit(),a=a.concat(o.events.$9y(e.data)),o.$9z(a),o.$9A(),o.$aV&&("Gantt"===o.viewType?o.update():(o.$9B(a),o.$8r()))}return n},this.events.remove=function(e,t){var i={};i.e=new DayPilot.Event(e.data,o);var n=new DayPilot.Action(o,"EventRemove",i,t),a=DayPilot.indexOf(o.events.list,e.data);if(o.events.list.splice(a,1),o.$b0.scope)o.$b0.notify();else{var s=o.events.$9x(e.data);o.$9z(s),o.$9A(),o.$aV&&("Gantt"===o.viewType?o.update():(o.$9B(s),o.$8r()))}return n},this.events.add=function(e,t){if(e.calendar=o,o.events.list||(o.events.list=[]),o.events.list.push(e.data),o.$b0.scope)o.$b0.notify();else{var i={};i.e=e;var n=new DayPilot.Action(o,"EventAdd",i,t),a=o.events.$9y(e.data);o.$9z(a),o.$9A(),o.$aV&&("Gantt"===o.viewType?o.update():(o.$9B(a),o.$8r()))}return n},this.queue={},this.queue.list=[],this.queue.list.ignoreToJSON=!0,this.queue.add=function(e){if(e){if(!e.isAction)throw"DayPilot.Action object required for queue.add()";o.queue.list.push(e)}},this.queue.notify=function(e){var t={};t.actions=o.queue.list,o.$9h("Notify",t,e,"Notify"),o.queue.list=[]},this.queue.clear=function(){o.queue.list=[]},this.queue.pop=function(){return o.queue.list.pop()},this.cells.find=function(e,t){var i=o.getPixels(new DayPilot.Date(e));if(!i)return h();var n=i.i,a=o.$8I(t);if(!a)return h();var s=a.top,l=o.$aD(s).i;return this.findXy(n,l)},this.cells.findByPixels=function(e,t){var i=o.$9b(e);if(!i)return h();e=i.x;var n=o.$aD(t);if(!n)return h();t=n.i;return this.findXy(e,t)},this.cells.all=function(){for(var e=[],t=o.itline.length,i=o.rowlist.length,n=0;n<t;n++)for(var a=0;a<i;a++){var s=o.cells.findXy(n,a);e.push(s[0])}return h(e)},this.cells.$b1=function(e,t){var i=o.itline[e],n=o.rowlist[t],a=n.start.getTime()-o.$97().getTime(),s=i.start.addTime(a),l=i.end.addTime(a),r={};r.x=e,r.y=t,r.i=e+"_"+t,r.resource=n.id,r.start=i.start,r.end=i.end,r.update=function(){if(!o.rowlist[r.y].hidden){var e=o.$8K();if(e.xStart<=r.x&&r.x<=e.xEnd&&e.yStart<=r.y&&r.y<=e.yEnd){var t=o.$86.cells[r.i];o.$b2(t),o.$b3(r.x,r.y)}}},r.utilization=function(e){return n.sections||n.calculateUtilization(),n.sections.forRange(s,l).maxSum(e)},r.events=function(){return n.events.forRange(s,l)},r.div=o.$86.cells[r.i];var d=o.$b4(e,t);return r.properties=d,r},this.cells.findXy=function(e,t){if(DayPilot.isArray(e)){for(var i=[],n=0;n<e.length;n++){var a=e[n];i.push(o.cells.$b1(a.x,a.y))}return h(i)}if(null===e||null===t)return h();var s=o.cells.$b1(e,t);return h(s)};var h=function(e){var t=[];if(DayPilot.isArray(e))for(var i=0;i<e.length;i++)t.push(e[i]);else"object"==typeof e&&t.push(e);return t.cssClass=function(e){return this.each(function(t){t.properties.cssClass=DayPilot.Util.addClassToString(t.properties.cssClass,e),t.update()}),this},t.removeClass=function(e){return this.each(function(t){t.properties.cssClass=DayPilot.Util.removeClassFromString(t.properties.cssClass,e),t.update()}),this},t.addClass=t.cssClass,t.html=function(e){return this.each(function(t){t.properties.html=e,t.update()}),this},t.each=function(e){if(e)for(var i=0;i<this.length;i++)e(t[i])},t};this.$b0={},this.$b0.scope=null,this.$b0.notify=function(){o.$b0.scope&&o.$b0.scope.$apply()},this.debug=new DayPilot.Debug(this),this.$b5=function(e){if("Days"!==o.viewType)throw"Checking row start when viewType !== 'Days'";for(var t=0;t<o.rowlist.length;t++){var i=o.rowlist[t],n=(i.element?i.element.data:i.data).start;if(e.getTime()>=n.getTime()&&e.getTime()<n.addDays(1).getTime())return n}return null},this.$b6=function(e){if(e.ticks===this.startDate.ticks)return e;var t=this.startDate;if(e.ticks<this.startDate.ticks){for(var i=this.itline[0].end.ticks-this.itline[0].start.ticks;t.ticks>e.ticks;)t=t.addTime(-i);return t}if("Days"===o.viewType){var n,a=this.$b5(e).getTime()-o.startDate.getTime();if((n=this.$9d(e.addTime(-a))).current)return n.current.start.addTime(a);if(n.past)return n.previous.end.addTime(a);throw"getBoxStart(): time not found"}if((n=this.$9d(e)).current)return n.current.start;if(n.past)return n.previous.end;if(n.hidden){var s=n.next.start.getTime()-e.getTime(),l=n.next.end.getTime()-n.next.start.getTime(),r=Math.ceil(s/l)*l;return n.next.start.addTime(-r)}throw"getBoxStart(): time not found"},this.$aJ=function(e){var t=this.$aD(o.coords.y),n=e.event;if("function"!=typeof n.end)throw"e.end function is not defined";if(!n.end())throw"e.end() returns null";var a=DayPilot.Date.diff(n.rawend().d,n.start().d);a=Math.max(a,1);var s=k.useBox(a),l=n.data&&"Milestone"===n.data.type,r=o.eventHeight,d=0,h=o.coords.x;if(l&&(h+=r/2),"Manual"===o.scale){var c=function(){var e,t=(e=o.getDate(o.coords.x,!0,!0)).addTime(-a),i=o.getPixels(t).boxLeft,n=o.getPixels(e).boxRight;return(e=Math.min(n,o.coords.x))-i}(),u=Math.min(i.moveOffsetX,c);h=o.coords.x-u}var f=0,v="Days"===this.viewType||this.$b7();if(v&&(f=this.rowlist[n.part.dayIndex].start.getTime()-this.$97().getTime()),s&&!l){var p=o.$9d(n.start()),y=!p.hidden&&!p.past;d=n.start().getTime()-this.$b6(n.start().addTime(-f)).addTime(f).getTime(),y&&(d=function(e,t){var i=o.$b8(o.$9d(e).current),n=o.$b8(o.$9b(h).cell);if(i>1.2*n){var a=t>0?1:-1;for(t=Math.abs(t);t>=n;)t-=n;t*=a}return t}(n.start(),d))}var g=0;if(i.moveDragStart&&"Manual"!==o.scale)if(s){var m=n.start().addTime(-f),b=this.$b6(m);g=i.moveDragStart.getTime()-b.getTime();var w=60*o.$b9()*1e3;g=Math.floor(g/w)*w}else g=i.moveDragStart.getTime()-n.start().addTime(f).getTime();else g=0;this.eventMoveToPosition&&(g=0);var $=this.getDate(h,!0).addTime(-g).addTime(f);i.resizing&&($=n.start()),this.snapToGrid&&($=this.$b6($.addTime(-f)).addTime(f));var D=($=$.addTime(d)).addTime(a),C=$,x=D;if(v){x=(C=$.addTime(-f)).addTime(a);var P=t.element.data.start.getTime()-this.$97().getTime();D=($=C.addTime(P)).addTime(a)}var S=this.getPixels(C),T=this.getPixels(x),M=s?S.boxLeft:S.left,H=s?T.boxRight-M:T.left-M;l&&(M-=(H=r)/2);var A={};return A.top=t.top,A.left=M,A.row=t.element,A.rowIndex=t.i,A.width=H,A.start=$,A.end=D,A.relativeY=o.coords.y-t.top,A},this.$b9=function(){switch(this.scale){case"CellDuration":return this.cellDuration;case"Minute":return 1;case"Hour":return 60;case"Day":return 1440;case"Week":return 10080;case"Month":return 43200;case"Year":return 525600}throw"can't guess cellDuration value"},this.$b8=function(e){return e.end.ticks-e.start.ticks},this.$aM=function(e){return this.treePreventParentUsage&&this.$ba(e)},this.$ba=function(e){var t=this.rowlist[e];return!!t.isParent||!!(this.treeEnabled&&t.children&&t.children.length>0)},this.$bb={},this.$bc=function(){if(o.treeAutoExpand){var e=this.$aJ(i.moving).rowIndex,t=this.$ba(e),n=this.$bb;n.timeout&&n.y!==e&&(clearTimeout(n.timeout),n.timeout=null),t&&(n.y=e,n.timeout||(n.timeout=setTimeout(function(){!o.rowlist[n.y].expanded&&(o.$bd(n.y),o.$be()),n.timeout=null},500)))}},this.$bf=function(){var e=i.resizingShadow.clientWidth,t=i.resizingShadow.offsetLeft,n=i.resizing.event,a=i.resizing.dpBorder,s=o.rowlist[i.resizing.event.part.dayIndex],l=0;l="Days"===o.viewType?s.start.getTime()-o.startDate.getTime():s.start.getTime()-o.$97().getTime();var r=null,d=null,h=!o.snapToGrid;"left"===a?(r=o.getDate(t,h).addTime(l),d=n.rawend()):"right"===a&&(r=n.start(),d=o.getDate(t+e,h,!0).addTime(l)),i.resizingShadow.start=r,i.resizingShadow.end=d,u.update()},this.$bg={},this.$bg.canvas=function(){var e=document.createElement("canvas");e.width=500,e.height=500;var t,i,n,a,s=e.getContext("2d");s.save(),s.strokeStyle="black",s.rect(0,0,e.width,e.height),s.stroke(),s.restore(),t=10,i=10,n="red",a=(a=10)||1,s.save(),s.fillStyle=n,s.fillRect(t,i,a,a),s.restore(),function(e,t){if(navigator.msSaveBlob){var i=e.msToBlob();navigator.msSaveBlob(i,t)}else{var n=document.createElement("a");n.download=t,n.href=e.toDataURL(),n.click()}}(e,"image.png")},this.$bh={};var c=this.$bh;c.findJointDivs=function(e){var t=e.data.join;return t?DayPilot.list(o.elements.events).filter(function(i){return i.event.data.join===t&&i.event!==e}):DayPilot.list()},this.$bi={};var u=this.$bi;u.divs=[],u.list=[],u.forbidden=!1,u.additional=function(){var e=DayPilot.list(),t=o.multiselect.isSelected(i.resizing.event),n=o.allowMultiResize;e=DayPilot.list();t&&n&&(e=DayPilot.list(o.multiselect.divs).filter(function(e){return e!==i.resizing}));var a=c.findJointDivs(i.resizing.event);return e=e.concat(a)},u.update=function(){u.clear(),u.draw()},u.clear=function(){DayPilot.de(u.divs),u.divs=[]},u.draw=function(){if(i.resizing){var e=i.resizing.event,t=i.resizingShadow,n=t.start.getTime()-e.start().getTime(),a=t.end.getTime()-e.end().getTime();if(u.list=[],u.forbidden=!1,u.invalid=!1,u.rowoffset=0,u.additional().each(function(e){if(e.event){var t=e.event,i=o.rowlist[t.part.dayIndex+0];if(i){var s=t.part.top+i.top,l=t.part.height;0;var r=t.start().addTime(n),d=t.end().addTime(a),h={};h.event=t,h.start=r,h.end=d,h.overlapping=!1,u.list.push(h);var c=o.getPixels(r),f=o.getPixels(d),v=DayPilot.Date.diff(t.rawend().d,t.start().d);v=Math.max(v,1);var p=k.useBox(v),y=p?c.boxLeft:c.left,g=p?f.boxRight-y:f.left-y,m=document.createElement("div");m.style.position="absolute",m.style.left=y+"px",m.style.top=s+"px",m.style.height=l+"px",m.style.width=g+"px",m.style.zIndex=101,m.style.overflow="hidden",m.className=o.$8R("_shadow"),m.info=h;var b=document.createElement("div");b.className=o.$8R("_shadow_inner"),m.appendChild(b),o.$8G.appendChild(m),u.divs.push(m)}else u.invalid=!0}}),u.invalid){var s=o.$8R("_shadow_overlap");DayPilot.list(u.divs).each(function(e){DayPilot.Util.addClass(e,s)})}else DayPilot.list(u.divs).each(function(e){if(e.info){var t=e,n=e.info,a=e.info.event,s=o.rowlist[a.part.dayIndex+0],l=o.getPixels(n.start),r=o.getPixels(n.end),d=l.left,h=r.left-d,c=DayPilot.list(u.list).map(function(e){return e.event.data}).add(i.resizing.event.data);o.$bj(t,s,d,h,c),t.overlapping&&(n.overlapping=!0,u.forbidden=!0)}})}},this.$bk={};var f=this.$bk;f.divs=[],f.list=[],f.forbidden=!1,f.verticalAll=function(){return"All"===o.multiMoveVerticalMode},f.additional=function(){var e=DayPilot.list(),t=o.multiselect.isSelected(i.moving.event),n=o.allowMultiMove;e=DayPilot.list();t&&n&&(e=DayPilot.list(o.multiselect.divs).filter(function(e){return e!==i.moving&&e!==b.moving}));var a=c.findJointDivs(i.moving.event);return e=e.concat(a)},f.update=function(){f.clear(),f.draw()},f.draw=function(){if(i.moving){var e=i.moving.event,t=i.movingShadow.start.getTime()-e.start().getTime(),n=e.part.dayIndex,a=DayPilot.indexOf(o.rowlist,i.movingShadow.row)-n;if(f.verticalAll()||(a=0),f.list=[],f.forbidden=!1,f.invalid=!1,f.rowoffset=a,f.additional().each(function(e){if(e.event){var i=e.event,n=o.rowlist[i.part.dayIndex+a];if(n){var s=i.part.top+n.top,l=i.part.height;a&&(s=n.top,l=n.height);var r=i.start().addTime(t),d=i.end().addTime(t),h={};h.event=i,h.start=r,h.end=d,h.overlapping=!1,f.list.push(h);var c=o.getPixels(r),u=o.getPixels(d),v=DayPilot.Date.diff(i.rawend().d,i.start().d);v=Math.max(v,1);var p=k.useBox(v),y=p?c.boxLeft:c.left,g=p?u.boxRight-y:u.left-y,m=document.createElement("div");m.style.position="absolute",m.style.left=y+"px",m.style.top=s+"px",m.style.height=l+"px",m.style.width=g+"px",m.style.zIndex=101,m.style.overflow="hidden",m.className=o.$8R("_shadow"),m.info=h;var b=document.createElement("div");b.className=o.$8R("_shadow_inner"),m.appendChild(b),o.$8G.appendChild(m),f.divs.push(m)}else f.invalid=!0}}),f.invalid){var s=o.$8R("_shadow_overlap");DayPilot.list(f.divs).each(function(e){DayPilot.Util.addClass(e,s)})}else DayPilot.list(f.divs).each(function(e){if(e.info){var t=e,n=e.info,s=e.info.event,l=o.rowlist[s.part.dayIndex+a],r=o.getPixels(n.start),d=o.getPixels(n.end),h=r.left,c=d.left-h,u=DayPilot.list(f.list).map(function(e){return e.event.data}).add(i.moving.event.data);o.$bj(t,l,h,c,u),t.overlapping&&(n.overlapping=!0,f.forbidden=!0)}})}},f.clear=function(){DayPilot.de(f.divs),f.divs=[]},this.$be=function(){this.nav.scroll;if(o.coords&&i.moving){o.$8V();var e=i.movingShadow,t=this.$aJ(i.moving);if(!o.$aM(t.rowIndex)){var n=i.moving.event,a=0;!function(){for(var e=t.relativeY,i=t.row,n=(i.lines.length,o.$aK.eventHeight()),s=i.lines.length,l=0;l<i.lines.length;l++){if(i.lines[l].isFree(t.left,o.cellWidth)){s=l;break}}var r=Math.floor((e-0+n/2)/n);r=Math.min(s,r),r=Math.max(0,r);a=r}();var s=n.cache&&void 0!==n.cache.moveVDisabled?!n.cache.moveVDisabled:!n.data.moveVDisabled,l=n.cache&&void 0!==n.cache.moveHDisabled?!n.cache.moveHDisabled:!n.data.moveHDisabled,r=!f.additional().isEmpty();r&&"Disabled"===o.multiMoveVerticalMode&&(s=!1);var d=a*o.$aK.eventHeight();if(d>0&&(d-=3),s)if(this.$aM(t.rowIndex)){var h=1;if(!(v=e.row))return;h=t.rowIndex<v.index?1:-1;for(var c=t.rowIndex;c!==v.index;c+=h){var u=this.rowlist[c];if(!this.$aM(c)&&!u.hidden){e.style.top=u.top+"px",e.style.height=Math.max(u.height,0)+"px",e.row=u,o.eventMoveToPosition&&(a=h>0?0:u.lines.length-1,e.style.top=t.top+d+"px",e.style.height="3px",e.line=a);break}}}else e.row=t.row,e.style.height=Math.max(t.row.height,0)+"px",e.style.top=t.top+"px",o.eventMoveToPosition&&(e.style.top=t.top+d+"px",e.style.height="3px",e.line=a);else{var v,p=(v=o.rowlist[n.part.dayIndex]).lines.length;for(c=0;c<v.lines.length;c++){if(v.lines[c].isFree(t.left,o.cellWidth)){p=c;break}}if(r||(e.style.height=Math.max(v.height,0)+"px",e.style.top=v.top+"px"),e.row=v,o.eventMoveToPosition&&!r)if(t.row===v)e.style.top=v.top+d+"px",e.style.height="3px",e.line=a;else{var y=t.rowIndex>v.index&&p>0?p*o.$aK.eventHeight()-3:0;e.style.top=v.top+y+"px",e.style.height="3px",e.line=0}}l?(e.style.left=t.left+"px",o.eventMoveToPosition?e.style.width=o.cellWidth+"px":e.style.width=t.width+"px",e.start=t.start,e.end=t.end):(e.style.left=n.part.left+"px",e.start=n.start(),e.end=n.rawend()),function(){var i=e.row,a=n.data,s=t.width,l=t.left,r=DayPilot.list(f.list).map(function(e){return e.event.data}).add(a);o.$bj(e,i,l,s,r)}(),function(){var t=o.$bl;if(!t||t.start.getTime()!==e.start.getTime()||t.end.getTime()!==e.end.getTime()||t.resource!==e.row.id){f.update();var a={};a.start=e.start,a.end=o.$9t(e.end),a.duration=new DayPilot.Duration(a.start,a.end),a.e=n,a.resource=e.row.id,a.row=o.$af(e.row),a.position=e.line,a.overlapping=e.overlapping||f.forbidden,a.allowed=!0,a.left={},a.left.html=a.start.toString(o.eventMovingStartEndFormat),a.left.enabled=o.eventMovingStartEndEnabled,a.right={},a.right.html=a.end.toString(o.eventMovingStartEndFormat),a.right.enabled=o.eventMovingStartEndEnabled,a.multimove=DayPilot.list(f.list);var s={};s.event=n,s.start=a.start,s.end=a.end,a.multimove.splice(0,0,s),o.$bl=a,"function"==typeof o.onEventMoving&&o.onEventMoving(a),e.allowed=a.allowed,o.$bm(e,a),DayPilot.Util.addClass(i.moving,o.$8R("_event_moving_source")),o.$bn(i.movingShadow,a)}}()}}},this.$bj=function(e,t,i,n,a){if(!o.allowEventOverlap){!function(){e.overlapping=!1;for(var s=0;s<t.lines.length;s++){if(!t.lines[s].isFree(i,n,a))return void(e.overlapping=!0)}if(o.allowMultiRange){var l=t.index;DayPilot.list(D.list).some(function(t){var a=t.div,s=parseInt(a.style.left),o=parseInt(a.style.width),r=t.start.y;return e!==a&&(r===l&&DayPilot.Util.overlaps(i,i+n,s,s+o))})&&(e.overlapping=!0)}}();var s=e.overlapping,l=o.$8R("_shadow_overlap");s?DayPilot.Util.addClass(e,l):DayPilot.Util.removeClass(e,l)}},this.$bm=function(e,t){var i=o.$8R("_shadow_forbidden");!t.allowed||f.invalid?DayPilot.Util.addClass(e,i):DayPilot.Util.removeClass(e,i)},this.$bn=function(e,t){this.$bo();var i={};i.left=parseInt(e.style.left),i.top=parseInt(e.style.top),i.right=i.left+parseInt(e.style.width);var n=t.left.width||10,a=document.createElement("div");if(a.style.position="absolute",a.style.left=i.left-n-5+"px",a.style.top=i.top+"px",a.style.height=o.eventHeight+"px",a.style.overflow="hidden",a.innerHTML=t.left.html,a.className=this.$8R("_event_move_left"),t.left.enabled&&o.divHover.appendChild(a),t.left.width)a.style.width=n+"px";else{a.style.whiteSpace="nowrap";var s=a.offsetWidth,l=i.left-s-5;a.style.width=s+"px",a.style.left=l+"px"}var r=document.createElement("div");r.style.position="absolute",r.style.left=i.right+5+"px",r.style.top=i.top+"px",r.style.height=o.eventHeight+"px",r.style.overflow="hidden",t.right.width?r.style.width=t.right.width+"px":r.style.whiteSpace="nowrap",r.innerHTML=t.right.html,r.className=this.$8R("_event_move_right"),t.right.enabled&&o.divHover.appendChild(r)},this.$bo=function(){o.divHover.innerHTML=""},this.$bp=function(){this.rowHeaderColumns&&(this.rowHeaderCols=DayPilot.Util.propArray(this.rowHeaderColumns,"width"))},this.$bq=function(){var e=0;if(this.$bp(),this.rowHeaderCols)for(var t=0;t<this.rowHeaderCols.length;t++)e+=this.rowHeaderCols[t];else e=this.rowHeaderWidth;return e},this.$br=function(){return this.$bs(o.progressiveRowRenderingPreload)},this.$bs=function(e){e=e||0;var t=0,i=o.rowlist.length;if(o.progressiveRowRendering){var n=o.$8K();t=n.yStart,i=n.yEnd+1,t=Math.max(0,t-e),i=Math.min(o.rowlist.length,i+e)}return{start:t,end:i}},this.$bt=function(){if(this.$bu()&&this.rowHeaderWidthAutoFit){var e=this.divHeader;if(e&&e.rows){for(var t=[],i=o.$br(),n=i.start;n<i.end;n++){var a=e.rows[n];if(a&&(!a.hidden&&!a.autofitDone)){a.autofitDone=!0;for(var s=0;s<a.cells.length;s++){var l=a.cells[s].firstChild.firstChild;if(l&&l.style){var r=l.style.width,d=l.style.right;l.style.position="absolute",l.style.width="auto",l.style.right="auto",l.style.whiteSpace="nowrap";var h=l.offsetWidth+2;l.style.position="",l.style.width=r,l.style.right=d,l.style.whiteSpace="",void 0===t[s]&&(t[s]=0),t[s]=Math.max(t[s],h)}}}}var c=0,u=!1;if(this.$bp(),this.rowHeaderCols)for(n=0;n<t.length;n++)this.rowHeaderCols[n]&&(t[n]>this.rowHeaderCols[n]&&(this.rowHeaderCols[n]=t[n],u=!0),c+=this.rowHeaderCols[n]);else c=this.rowHeaderWidth,this.rowHeaderWidth<t[0]&&(c=t[0],u=!0);o.progressiveRowRendering,u&&(this.$bv&&(this.$bv.widths=this.rowHeaderCols,this.$bv.updateWidths(),DayPilot.Util.updatePropsFromArray(this.rowHeaderColumns,"width",this.rowHeaderCols)),this.rowHeaderScrolling||(this.rowHeaderWidth=c),this.$9O(),this.$bw())}}},this.$8k=function(){this.$bx=!0,this.$bp();var e=this.$bq(),t=this.divHeader;if(t?(t.innerHTML="",DayPilot.puc(t)):((t=document.createElement("div")).onmousemove=function(){o.$by()},this.cssOnly||(t.className=this.$8R("resourceheader")),this.divHeader=t),t.style.width=e+"px",t.style.height=o.$85+"px",t.rows=[],o.progressiveRowRendering);else for(var i=this.rowlist.length,n=0;n<i;n++)o.$bz(n);o.$bA(),this.divResScroll.appendChild(t),this.rowHeaderWidthAutoFit&&this.$bt()},this.$bB=function(){if(o.progressiveRowRendering){for(var e=this.$br(),t=0;t<o.rowlist.length;t++)e.start<=t&&t<e.end?o.$bz(t):o.$bC(t);if(this.rowHeaderWidthAutoFit){var i=o.$8U();if(this.$bt(),o.$8U()!==i){var n=this.cellWidth;this.$8f(),this.cellWidth!==n&&(this.$8g(),this.$8l(),this.$8r(),this.$8j())}}}},this.$bA=function(){var e=o.divHeader,t=this.rowHeaderCols?this.rowHeaderCols.length:0,i=this.$bq(),n=document.createElement("div");if(n.style.position="absolute",n.style.top=this.$85+"px",n.colSpan=t+1,n.style.width=i+"px",n.style.height=o.divResScroll.clientHeight+20+"px",e.appendChild(n),o.nav.resScrollSpace=n,this.cssOnly||(n.style.backgroundColor=this.hourNameBackColor,n.style.cursor="default"),n.setAttribute("unselectable","on"),this.cssOnly||(n.className=this.$8R("rowheader"),n.style.fontSize="1px",n.innerHTML="&nbsp;"),this.cssOnly){var a=document.createElement("div");a.style.position="relative",a.style.height="100%",a.className=this.$8R("_rowheader"),n.appendChild(a)}},this.$bC=function(e){var t=o.divHeader.rows[e];t&&(DayPilot.de(t.cells),o.divHeader.rows[e]=null)},this.$9P=function(e){this.$bC(e),this.$bz(e)},this.$bz=function(e){var t=o.divHeader,i=this.divHeader;if(!i.rows[e]){var a=this.rowHeaderCols,s=a?this.rowHeaderCols.length:0,l=this.$bq(),r=this.rowlist[e];if(r&&!r.hidden){var d=this.$bD(r);i.rows[e]={},i.rows[e].cells=[],(w=document.createElement("div")).style.position="absolute",w.style.top=r.top+"px",w.row=r,w.index=e;var h=d.row,c=a?a[0]:this.rowHeaderWidth;w.style.width=c+"px",w.style.border="0px none",this.cssOnly||(w.style.borderRight="1px solid "+this.borderColor,w.style.backgroundColor=void 0===h.backColor?o.hourNameBackColor:h.backColor,w.style.fontFamily=this.headerFontFamily,w.style.fontSize=this.headerFontSize,w.style.color=this.headerFontColor,w.style.cursor="default",w.style.padding="0px"),h.toolTip&&(w.title=h.toolTip),w.setAttribute("unselectable","on"),w.onmousemove=o.$bE,w.onmouseout=o.$bF,w.onmouseup=o.$bG,w.oncontextmenu=o.$bH,w.onclick=o.$bI,w.ondblclick=o.$bJ,(k=document.createElement("div")).style.width=c+"px",k.setAttribute("unselectable","on"),k.className=this.cssOnly?this.$8R("_rowheader"):this.$8R("rowheader"),h.cssClass&&DayPilot.Util.addClass(k,h.cssClass),h.backColor&&(k.style.background=h.backColor),k.style.height=r.height+"px",k.style.overflow="hidden",k.style.position="relative",($=document.createElement("div")).setAttribute("unselectable","on"),$.className=this.cssOnly?this.$8R("_rowheader_inner"):"",k.appendChild($);var u="Disabled"!==this.rowMoveHandling,f=h.areas||[];u&&!h.moveDisabled&&f.push({v:"Hover",w:10,bottom:0,top:0,left:0,css:o.$8R("_rowmove_handle"),action:"Move"});var v=o.$af(r);if(DayPilot.Areas.attach(k,v,{areas:f,allowed:function(){return!n.row}}),(D=document.createElement("div")).style.position="absolute",D.style.bottom="0px",D.style.width="100%",D.style.height="1px",this.cssOnly?D.className=this.$8R("_resourcedivider"):D.style.backgroundColor=this.borderColor,k.appendChild(D),function(){if(o.treeEnabled&&!r.isNewRow){var t=r.level*o.treeIndent+o.treeImageMarginLeft;u&&(t+=10);var i=10,n=document.createElement("div");n.style.width="10px",n.style.height=i+"px",n.style.backgroundRepeat="no-repeat",n.style.position="absolute",n.style.left=t+"px",n.style.top=o.treeImageMarginTop+"px",r.loaded||0!==r.children.length?r.children.length>0?(r.expanded?(o.treeImageCollapse&&!o.cssOnly&&(n.style.backgroundImage="url('"+o.treeImageCollapse+"')"),n.className=o.cssOnly?o.$8R("_tree_image_collapse"):o.$8R("tree_image_collapse")):(o.treeImageExpand&&!o.cssOnly&&(n.style.backgroundImage="url('"+o.treeImageExpand+"')"),n.className=o.cssOnly?o.$8R("_tree_image_expand"):o.$8R("tree_image_expand")),n.style.cursor="pointer",n.index=e,n.onclick=function(e){o.$bd(this.index),(e=e||window.event).cancelBubble=!0}):(o.treeImageNoChildren&&!o.cssOnly&&(n.style.backgroundImage="url('"+o.treeImageNoChildren+"')"),n.className=o.cssOnly?o.$8R("_tree_image_no_children"):o.$8R("tree_image_no_children")):(o.treeImageExpand&&!o.cssOnly&&(n.style.backgroundImage="url('"+o.treeImageExpand+"')"),n.className=o.cssOnly?o.$8R("_tree_image_expand"):o.$8R("tree_image_expand"),n.style.cursor="pointer",n.index=e,n.onclick=function(e){o.$bK(this.index),(e=e||window.event).cancelBubble=!0}),$.appendChild(n)}var a=document.createElement("div");o.treeEnabled?a.style.marginLeft=t+i+"px":o.cssOnly||(a.style.marginLeft="4px"),a.innerHTML=h.html,w.textDiv=a,$.appendChild(a)}(),w.appendChild(k),h.areas)for(var p=0;p<h.areas.length;p++){var y=h.areas[p];if("Visible"===(y.v||"Visible")){var g=o.$af(r),m=DayPilot.Areas.createArea(k,g,y);k.appendChild(m)}}if(t.appendChild(w),i.rows[e].cells.push(w),r.columns&&0!==r.columns.length){var b=c;for(p=1;p<s;p++){var w;(w=document.createElement("div")).style.position="absolute",w.style.top=r.top+"px",w.style.left=b+"px",t.appendChild(w),i.rows[e].cells.push(w),w.row=r,w.index=e,this.cssOnly||(w.style.borderRight="1px solid "+this.borderColor,w.style.backgroundColor=h.backColor,w.style.fontFamily=this.headerFontFamily,w.style.fontSize=this.headerFontSize,w.style.color=this.headerFontColor,w.style.cursor="default",w.style.padding="0px"),h.toolTip&&(w.title=h.toolTip),w.setAttribute("unselectable","on"),this.cssOnly||(w.className=this.$8R("rowheader")),w.onmousemove=o.$bE,w.onmouseout=o.$bF,w.onmouseup=o.$bG,w.oncontextmenu=o.$bH,w.onclick=o.$bI,w.ondblclick=o.$bJ;var $,D,k=document.createElement("div"),C=this.cssOnly?a[p]:a[p]-1;b+=C,h.backColor&&(k.style.backgroundColor=h.backColor),k.style.width=C+"px",k.style.height=r.height+"px",k.style.overflow="hidden",k.style.position="relative",k.setAttribute("unselectable","on"),this.cssOnly&&(DayPilot.Util.addClass(k,this.$8R("_rowheader")),DayPilot.Util.addClass(k,this.$8R("_rowheadercol")),DayPilot.Util.addClass(k,this.$8R("_rowheadercol"+p))),h.cssClass&&DayPilot.Util.addClass(k,h.cssClass),($=document.createElement("div")).setAttribute("unselectable","on"),this.cssOnly&&($.className=this.$8R("_rowheader_inner")),k.appendChild($),(D=document.createElement("div")).style.position="absolute",D.style.bottom="0px",D.style.width="100%",D.style.height="1px",D.className=this.$8R("_resourcedivider"),this.cssOnly||(D.style.backgroundColor=this.borderColor),k.appendChild(D);var x=document.createElement("div");this.cssOnly||(x.style.marginLeft="4px");var P=h.columns[p-1],S=P&&P.html?P.html:"";x.innerHTML=S,w.textDiv=x,$.appendChild(x),w.appendChild(k)}}else w.colSpan=s>0?s:1,k.style.width=l+"px"}}},this.$bH=function(){var e=this.row;return e.contextMenu&&e.contextMenu.show(o.$af(e)),!1},this.$bI=function(e){if(!y.cancelClick){var t=this.row,i=o.$af(t,this.index);t.isNewRow?o.$aj.edit(t):o.$ag(i,e.ctrlKey,e.shiftKey,e.metaKey)}},this.$bJ=function(e){if(o.timeouts.resClick){for(var t in o.timeouts.resClick)window.clearTimeout(o.timeouts.resClick[t]);o.timeouts.resClick=null}var i=this.row,n=o.$af(i,this.index);if(o.$8F()){var a={};if(a.resource=n,a.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onRowDoubleClick&&(o.onRowDoubleClick(a),a.preventDefault.value))return;switch(o.rowDoubleClickHandling){case"PostBack":o.rowDoubleClickPostBack(n);break;case"CallBack":o.rowDoubleClickCallBack(n);break;case"Select":o.$ai(i,e.ctrlKey,e.shiftKey,e.metaKey);break;case"Edit":o.$aj.edit(i)}"function"==typeof o.onRowDoubleClicked&&o.onRowDoubleClicked(a)}else switch(o.rowDoubleClickHandling){case"PostBack":o.rowDoubleClickPostBack(n);break;case"CallBack":o.rowDoubleClickCallBack(n);break;case"JavaScript":o.onRowDoubleClick(n);break;case"Select":o.$ai(i,e.ctrlKey,e.shiftKey,e.metaKey);break;case"Edit":o.$aj.edit(i)}},this.rowDoubleClickPostBack=function(e,t){var i={};i.resource=e,this.$9g("RowDoubleClick",i,t)},this.rowDoubleClickCallBack=function(e,t){var i={};i.resource=e,this.$9h("RowDoubleClick",i,t)},this.$bL=function(e){var t={};t.start=this.cell.start,t.level=this.cell.level,t.end=this.cell.end,t.end||(t.end=new DayPilot.Date(t.start).addMinutes(o.cellDuration)),o.$ak(t)},this.$af=function(e){return new DayPilot.Row(e,o)},this.$aW=function(e){var t=this.rowlist[e];if(t.events||t.resetEvents(),!t.data){t.data={},t.data.start=new DayPilot.Date(t.start),t.data.startTicks=t.data.start.getTime();var i=this.$bM().getTime()-this.$97().getTime();t.data.end=k.isResourcesView()?t.data.start.addTime(i):t.data.start.addDays(1),t.data.endTicks=t.data.end.getTime(),"Days"===o.viewType?t.data.offset=t.start.getTime()-this.startDate.getTime():t.data.offset=t.start.getTime()-this.$97().getTime(),t.data.i=e}},this.$8j=function(e){e?this.events.list=e:this.events.list||(this.events.list=[]),v.prepareRows(!0);for(var t,i=this.events.list,n=i.length,a="function"==typeof this.onBeforeEventRender,s="Resources"===o.viewType,l=0;l<n;l++){var r=i[l];if(r){a&&this.$aY(l),"*"===r.resource?t=o.rowlist:s?t=v.rowcache[r.resource]:"Days"===o.viewType?t=o.rowlist:"Gantt"===o.viewType&&(t=v.rowcache[r.id]);for(var d=0;t&&d<t.length;d++){var h=t[d],c=this.$aZ(r,h);c&&(a&&(c.cache=this.$86.events[l]))}}}for(var u=0;u<this.rowlist.length;u++){h=this.rowlist[u];this.$bN(h)}this.$9A()},this.$bO=function(e){var t=[],i=[],n=null;if(e&&$3W){for(var a=e,s=(n=[],0);s<a.length;s++){for(var l=a[s],r=!1,d=0;d<this.events.list.length;d++){var h=this.events.list[d];if(h.id===l.id&&h.start.toString()===l.start.toString()&&h.resource===l.resource){var c=o.events.$9x(h);i=i.concat(c),this.events.list[d]=l,r=!0;break}}r||n.push(l)}this.events.list=this.events.list.concat(n)}else e?this.events.list=e:this.events.list||(this.events.list=[]);var u=n||this.events.list;e?this.events.list=e:this.events.list||(this.events.list=[]);var f=(u=this.events.list).length;if("function"==typeof this.onBeforeEventRender){var p=n?this.events.list.length-n.length:0,y=this.events.list.length;for(s=p;s<y;s++)this.$aY(s)}this.$aX();var g=!n||void 0===$.events;v.prepareRows(g);for(var d=0;u&&d<f;d++)if(!t[d]){var m=u[d];if(m){c=[];c="*"===m.resource?o.rowlist:"Days"===o.viewType?o.rowlist:"Gantt"===o.viewType?v.rowcache[m.id]:v.rowcache[m.resource];for(var b=0;c&&b<c.length;b++){var w,$=c[b];(w=this.$aZ(m,$))&&("function"==typeof this.onBeforeEventRender&&(w.cache=this.$86.events[d+p]),i.push($.index))}}}for(s=0;s<this.rowlist.length;s++){$=this.rowlist[s];this.$bN($)}return this.$9A(),DayPilot.ua(i)},this.$bP={};var v=this.$bP;v.rowCache={},v.prepareRows=function(e){v.rowcache={};for(var t=0;t<o.rowlist.length;t++){var i=o.rowlist[t];if(e&&i.resetEvents(),o.$aW(t),i.id){var n=i.id.toString();v.rowcache[n]||(v.rowcache[n]=[]),v.rowcache[n].push(i)}}},v.loadEvent=function(e){},this.$aX=function(){var e={};if("Resources"!==o.viewType)return!1;for(var t=0;t<o.rowlist.length;t++){var i=o.rowlist[t].id;if(e[i])return!0;e[i]=!0}return!1},this.$aY=function(e){var t=this.$86.events,i=this.events.list[e],n={};for(var a in i)n[a]=i[a];if("function"==typeof this.onBeforeEventRender){var s={};s.e=n,this.onBeforeEventRender(s)}t[e]=n},this.$bN=function(e){if(e.lines=[],e.sections=null,!e.isNewRow){this.sortDirections?e.events.sort(this.$bQ):e.events.sort(this.$bR);var t=o.groupConcurrentEvents;if(t)for(var i=0;i<e.blocks.length;i++)e.blocks[i].events=[];for(var n=0;n<e.events.length;n++){var a=e.events[n];e.putIntoLine(a),t&&e.putIntoBlock(a)}var s=0;for(i=0;i<e.lines.length;i++){(d=e.lines[i]).top=s,s+=(d.height||e.eventHeight)*this.eventStackingLineHeight/100}if(t)for(n=0;n<e.blocks.length;n++){var l=e.blocks[n];l.lines=[],l.events.sort(this.$bQ);for(var r=0;r<l.events.length;r++){a=l.events[r];l.putIntoLine(a)}l.lines.length<=o.groupConcurrentEventsLimit&&(l.expanded=!0);for(s=0,i=0;i<l.lines.length;i++){var d;(d=l.lines[i]).top=s,s+=(d.height||e.eventHeight)*this.eventStackingLineHeight/100}}}},this.$9z=function(e){e=DayPilot.ua(e);for(var t=0;t<e.length;t++){var i=e[t];o.$bN(o.rowlist[i])}for(t=0;t<e.length;t++){i=e[t];var n=o.rowlist[i];o.$bS(n)}},this.$b7=function(){var e="Manual"===o.scale?o.itline[0].start:o.startDate;return DayPilot.list(o.rowlist).some(function(t){return!!t.start&&t.start.getTime()!==new DayPilot.Date(e).getTime()})},this.$aZ=function(e,t){var i=new DayPilot.Date(e.start),n=new DayPilot.Date(e.end);n=o.$9V(n);var a=i.ticks,s=n.ticks;if(s<a)return null;var l=null;if("function"==typeof o.onBeforeEventRender){var r=DayPilot.indexOf(o.events.list,e);l=o.$86.events[r]}if(l){if(l.hidden)return null}else if(e.hidden)return null;var d=!1;switch(this.viewType){case"Days":d=!(s<=t.data.startTicks||a>=t.data.endTicks)||a===s&&a===t.data.startTicks;break;case"Resources":d=(t.id===e.resource||"*"===t.id||"*"===e.resource)&&(!(s<=t.data.startTicks||a>=t.data.endTicks)||a===s&&a===t.data.startTicks);break;case"Gantt":d=t.id===e.id&&!(s<=t.data.startTicks||a>=t.data.endTicks)}if(!d)return null;var h=new DayPilot.Event(e,o);h.part.dayIndex=t.data.i,h.part.start=t.data.startTicks<a?i:t.data.start,h.part.end=t.data.endTicks>s?n:t.data.end;var c=this.getPixels(h.part.start.addTime(-t.data.offset)),u=this.getPixels(h.part.end.addTime(-t.data.offset));h.part.start.ticks===h.part.end.ticks&&(u=this.getPixels(h.part.end.addTime(-t.data.offset).addTime(1))),l&&l.height&&(h.part.height=l.height);var f=c.left,v=u.left;if(f===v&&(c.cut||u.cut))return null;h.part.box=k.useBox(s-a);var p=o.eventHeight;if("Milestone"===e.type){var y=e.width||p;h.part.end=h.part.start,h.part.left=f-y/2,h.part.width=y,h.part.barLeft=0,h.part.barWidth=y}else if(h.part.box){var g=c.boxLeft,m=u.boxRight;h.part.left=g,h.part.width=m-g,h.part.barLeft=Math.max(f-h.part.left,0),h.part.barWidth=Math.max(v-f,1)}else h.part.left=f,h.part.width=Math.max(v-f,0),h.part.barLeft=0,h.part.barWidth=Math.max(v-f-1,1);if("function"==typeof o.onEventFilter&&o.events.$aU){var b={};if(b.filter=o.events.$aU,b.visible=!0,b.e=h,o.onEventFilter(b),!b.visible)return null}return t.events.push(h),h},this.$bR=function(e,t){if(!(e&&t&&e.start&&t.start))return 0;var i=e.start().ticks-t.start().ticks;return 0!==i?i:t.end().ticks-e.end().ticks},this.$bQ=function(e,t){if(!e||!t)return 0;if(!(e.data&&t.data&&e.data.sort&&t.data.sort&&0!==e.data.sort.length&&0!==t.data.sort.length))return o.$bR(e,t);for(var i=0,n=0;0===i&&e.data.sort[n]&&t.data.sort[n];)i=e.data.sort[n]===t.data.sort[n]?0:o.$bT(e.data.sort[n],t.data.sort[n],o.sortDirections[n]),n++;return i},this.$bT=function(e,t,i){var n="desc"!==i?-1:1,a=-n;if(null===e&&null===t)return 0;if(null===t)return a;if(null===e)return n;var s=[];return s[0]=e,s[1]=t,s.sort(),e===s[0]?n:a},this.$ai=function(e,t,i,n){if(o.$8F()){var a=DayPilot.indexOf(o.rowlist,e),s=o.$af(e,a),l=(d=-1!==DayPilot.indexOf(y.selected,e))?"deselected":"selected",r={};if(r.row=s,r.selected=d,r.ctrl=t,r.shift=i,r.meta=n,r.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onRowSelect&&(o.onRowSelect(r),r.preventDefault.value))return;switch(o.rowSelectHandling){case"PostBack":o.rowSelectPostBack(s,l);break;case"CallBack":o.rowSelectCallBack(s,l);break;case"Update":y.select(e,t,i,n)}"function"==typeof o.onRowSelected&&(r.selected=-1!==DayPilot.indexOf(y.selected,e),o.onRowSelected(r))}else{y.select(e,t,i);var d;a=DayPilot.indexOf(o.rowlist,e),s=o.$af(e,a),l=(d=-1!==DayPilot.indexOf(y.selected,e))?"deselected":"selected";switch(o.rowSelectHandling){case"PostBack":o.rowSelectPostBack(s,l);break;case"CallBack":o.rowSelectCallBack(s,l);break;case"JavaScript":o.onRowSelect(s,l)}}},this.rowSelectPostBack=function(e,t,i){var n={};n.resource=e,n.change=t,this.$9g("RowSelect",n,i)},this.rowSelectCallBack=function(e,t,i){var n={};n.resource=e,n.change=t,this.$9h("RowSelect",n,i)},this.rows={},this.rows.selection={};var p=this.rows.selection;p.get=function(){var e=[];return DayPilot.list(y.selected).each(function(t){e.push(o.$af(t))}),e},p.clear=function(){y.clearSelection()},p.add=function(e){if(!e||!e.isRow)throw"DayPilot.Scheduler.rows.selection.add(): DayPilot.Row object expected";DayPilot.list(y.selected).some(function(t){return t===e.$.row})||y.selected.push(e.$.row),y.$bU()},this.rows.all=function(){for(var e=[],t=0;t<o.rowlist.length;t++){var i=o.$af(o.rowlist[t]);e.push(i)}return function(e){var t=[];if(DayPilot.isArray(e))for(var i=0;i<e.length;i++)t.push(e[i]);else"object"==typeof e&&t.push(e);return t.each=function(e){if(e)for(var i=0;i<t.length;i++)e(t[i])},t}(e)},this.rows.each=function(e){o.rows.all().each(e)},this.rows.filter=function(e){o.rows.$aU=e,o.$9E({immediateEvents:!0})},this.rows.find=function(e,t){for(var i=o.rows.all(),n=0;n<i.length;n++){var a=i[n];if(a.id===e){if("string"!=typeof t)return a;if(t===a.start.toString())return a}}},this.rows.load=function(e){DayPilot.ajax({url:e,success:function(e){var t=e.request,i=DayPilot.Util.parseJSON(t.responseText);DayPilot.isArray(i)&&(o.resources=i,o.$aV&&o.update())}})},this.rows.expand=function(e){for(var t=[],i=e||1,n=0;n<o.rowlist.length;n++){var a=-1===i;(s=o.rowlist[n]).level<i&&(a=!0),a&&!s.expanded&&s.children&&s.children.length>0&&t.push(s.index)}if(0!==t.length)if(1===t.length)o.$bd(t[0]);else{for(n=0;n<t.length;n++){var s,l=t[n];(s=o.rowlist[l]).expanded=!0}o.$9E()}},this.rows.expandAll=function(){o.rows.expand(-1)},this.rows.headerHide=function(){o.$bV=!0,o.$bW(),o.$bw()},this.rows.headerShow=function(){o.$bV=!1,o.$bW(),o.$bw()},this.rows.headerToggle=function(){o.$bV?o.rows.headerShow():o.rows.headerHide()},this.$bX=function(){var e=n.source,t=n.target,i=n.position;if(y.resetMoving(),o.$8F()){var a={};if(a.source=o.$af(e),a.target=o.$af(t),a.position=i,a.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof o.onRowMove&&(o.onRowMove(a),a.preventDefault.value))return;switch(o.rowMoveHandling){case"Update":y.move(a);break;case"CallBack":o.rowMoveCallBack(a.source,a.target,a.position);break;case"PostBack":o.rowMovePostBack(a.source,a.target,a.position);break;case"Notify":y.move(a),o.rowMoveNotify(a.source,a.target,a.position)}"function"==typeof o.onRowMoved&&o.onRowMoved(a)}else{e=o.$af(e),t=o.$af(t),i=i;switch(o.rowMoveHandling){case"CallBack":o.rowMoveCallBack(e,t,i);break;case"PostBack":o.rowMovePostBack(e,t,i);break;case"JavaScript":o.onRowMove(e,t,i)}}},this.$8D=function(e){var t=DayPilot.list(e);y.selected=[],t.each(function(e){var t=o.$8I(e);t&&y.selected.push(t)}),y.$bU()},this.$aj={};var y=this.$aj;y.edit=function(e){y.$bY(e)},y.createOverlay=function(e){var t=o.$bq(),i=o.$8R("_rowmove_source"),n=DayPilot.Util.div(o.divHeader,0,e.top,t,e.height);n.className=i,e.moveOverlay=n},y.deleteOverlay=function(e){DayPilot.de(e.moveOverlay),e.moveOverlay=null},y.$bY=function(e){var t=y.$ac(e).cells[0];if(t.input)return t.input;var i=t.clientWidth;e.isNewRow&&(i=o.$8U());var n=document.createElement("textarea");n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.width=i+"px",n.style.height=e.height+"px",n.style.border="0px none",n.style.overflow="hidden",n.style.boxSizing="border-box",n.style.resize="none";var a=t.textDiv;n.style.fontFamily=DayPilot.gs(a,"fontFamily")||DayPilot.gs(a,"font-family"),n.style.fontSize=DayPilot.gs(a,"fontSize")||DayPilot.gs(a,"font-size"),n.value=e.html,t.firstChild.appendChild(n),t.input=n;var s=function(){try{t.input.parentNode.removeChild(t.input)}catch(e){}t.input=null};return n.focus(),n.onblur=function(){n.onblur=null;var t=n.value;DayPilot.indexOf(o.rowlist,e);s(),n.canceled||o.$ae(e,t)},n.onkeydown=function(e){var t=window.event?event.keyCode:e.keyCode;return 27===t&&(n.canceled=!0,s()),13!==t||(n.onblur(),!1)},n.setSelectionRange?n.setSelectionRange(0,9999):n.select(),n},y.selected=[],y.select=function(e,t,i,n){var a=-1!==DayPilot.indexOf(y.selected,e);if(t||n){if(a)return y.unselect(e),void DayPilot.rfa(y.selected,e)}else a=!1,y.clearSelection();y.$bZ(e),a||y.selected.push(e)},y.$bU=function(){for(var e=0;e<y.selected.length;e++){var t=y.selected[e];y.$bZ(t)}},y.$bZ=function(e){if(-1===(l=DayPilot.indexOf(o.rowlist,e))){var t=o.$8I(e.id).index;if(!t)return;l=t.index}for(var i=o.$8R("_cell_selected"),n=[],a=0;a<o.itline.length;a++){(h={}).x=a,h.y=l,n.push(h)}o.cells.findXy(n).addClass(i);i=o.$8R("_rowheader_selected");for(var s=o.divHeader,l=0;l<s.rows.length;l++){var r=s.rows[l];if(r&&r.cells[0]&&r.cells[0].row===e)for(var d=0;d<r.cells.length;d++){var h,c=(h=r.cells[d]).firstChild;DayPilot.Util.addClass(c,i)}}},y.$c0=function(e){for(var t=0;t<y.selected.length;t++){if(y.selected[t].id===e)return!0}return!1},y.$aw=function(){var e=[];if(!y.selected)return e;for(var t=0;t<y.selected.length;t++){var i=y.selected[t],n=DayPilot.indexOf(o.rowlist,i),a=o.$af(i,n);e.push(a.toJSON())}return e},y.unselect=function(e){for(var t=o.$8R("_cell_selected"),i=DayPilot.indexOf(o.rowlist,e),n=[],a=0;a<o.itline.length;a++){(r={}).x=a,r.y=i,n.push(r)}o.cells.findXy(n).removeClass(t);t=o.$8R("_rowheader_selected"),o.divHeader;var s=y.$ac(e);if(s)for(var l=0;l<s.cells.length;l++){var r,d=(r=s.cells[l]).firstChild;DayPilot.Util.removeClass(d,t)}},y.clearSelection=function(){for(var e=0;e<y.selected.length;e++){var t=y.selected[e];y.unselect(t)}y.selected=[]},y.$ac=function(e){for(var t=o.divHeader,i=0;i<t.rows.length;i++){var n=t.rows[i];if(n&&n.cells[0]&&n.cells[0].row===e)return n}return null},y.selectById=function(e){var t=o.$8I(e);t&&y.select(t)},y.startMoving=function(e){var t=DayPilot.Global.rowmoving;t.row=e,t.cursor=o.divResScroll.style.cursor,o.divResScroll.style.cursor="move",y.createOverlay(e)},y.resetMoving=function(){o.divResScroll.style.cursor=n.cursor,DayPilot.de(n.div),y.deleteOverlay(n.row),DayPilot.Global.rowmoving=n={}},y.move=function(e){var t=e.source.$.row.resource,i=e.target.$.row.resource,n=e.position;if("forbidden"!==n){var a=g.findParentArray(t);if(!a)throw"Cannot find source node parent";var s=DayPilot.indexOf(a,t);a.splice(s,1);var l=g.findParentArray(i);if(!l)throw"Cannot find target node parent";var r=DayPilot.indexOf(l,i);switch(n){case"before":l.splice(r,0,t);break;case"after":l.splice(r+1,0,t);break;case"child":i.children||(i.children=[],i.expanded=!0),i.children.push(t)}o.update()}};var g={findParentArray:function(e){return g.findInArray(o.resources,e)},findInArray:function(e,t){if(-1!==DayPilot.indexOf(e,t))return e;for(var i=0;i<e.length;i++){var n=e[i];if(n.children&&n.children.length>0){var a=g.findInArray(n.children,t);if(a)return a}}return null}};this.$8h=function(){this.rowlist=[];var e=this.resources,t=this.$92();t||("Gantt"===this.viewType?e=this.$c1():"Days"===this.viewType&&(e=this.$c2())),!t||"Days"!==this.viewType||e&&0!==e.length||(e=this.$c2());var i={i:0};this.$c3(e,i,0,null,this.treeEnabled,!1),this.$c4(),"Disabled"!==o.rowCreateHandling&&this.$c5(),this.$c6()},this.$c4=function(){for(var e=0;e<o.rowlist.length;e++);},this.$c5=function(){var e={id:"NEW",isNewRow:!0,html:"",loaded:!0};e.start=this.startDate,e.children=[],e.height=o.eventHeight,e.marginBottom=0,e.marginTop=0,e.getHeight=function(){return o.eventHeight+o.rowMarginBottom+o.rowMarginTop},e.putIntoLine=function(){},e.resetEvents=function(){},this.rowlist.push(e)},this.$c6=function(){for(var e=[],t=0;t<o.rowlist.length;t++){var i=o.rowlist[t],n=i.id;y.$c0(n)&&e.push(i)}y.selected=e},this.$c1=function(){var e=[];if(this.$82&&this.resources)for(var t=0;t<this.resources.length;t++)e.push(this.resources[t]);if(this.events.list){for(t=0;t<this.events.list.length;t++){var i=this.events.list[t],n={};n.id=i.id,n.name=i.text,e.push(n)}return e}},this.$c2=function(){for(var e=[],t=this.$aK.locale(),i=0;i<this.days;i++){var n=this.startDate.addDays(i),a={};a.name=n.toString(t.datePattern,t),a.start=n,e.push(a)}return e},this.$97=function(){return this.itline&&this.itline.length>0?this.itline[0].start:this.startDate},this.$bM=function(){return this.itline&&this.itline.length>0?this.itline[this.itline.length-1].end:this.startDate.addDays(this.days)},this.visibleStart=function(){return this.$97()},this.visibleEnd=function(){return this.$bM()},this.$c3=function(e,t,i,n,a,s){if(e)for(var l=0;l<e.length;l++)if(e[l]){var r={};r.level=i,r.hidden=s,r.index=t.i;var d=this.$c7(e[l],r),h={};if(h.backColor=d.backColor,h.cssClass=d.cssClass,h.expanded=d.expanded,h.name=d.name,h.html=d.html?d.html:h.name,h.eventHeight=void 0!==d.eventHeight?d.eventHeight:o.$aK.eventHeight(),h.minHeight=void 0!==d.minHeight?d.minHeight:o.rowMinHeight,h.marginBottom=void 0!==d.marginBottom?d.marginBottom:o.rowMarginBottom,h.marginTop=void 0!==d.marginTop?d.marginTop:o.rowMarginTop,h.loaded=!d.dynamicChildren,h.id=d.id||d.value,h.toolTip=d.toolTip,h.children=[],h.columns=[],h.start=d.start?new DayPilot.Date(d.start):this.$97(),h.isParent=d.isParent,h.contextMenu=d.contextMenu?DayPilot.Util.evalVariable(d.contextMenu):this.contextMenuResource,h.areas=d.areas,h.moveDisabled=d.moveDisabled,h.tags=d.tags,h.task=d.task,h.height=h.eventHeight,h.hidden=s,h.level=i,h.index=t.i,h.resource=e[l],h.lines=[],h.blocks=[],h.isRow=!0,h.getHeight=function(){var e=0;if(o.groupConcurrentEvents)for(var t=0;t<this.blocks.length;t++){var i=this.blocks[t];e=Math.max(e,i.getHeight())}else if(this.lines.length>0){var n=this.lines.length-1,a=this.lines[n],s=a.height||this.eventHeight;e=(a.top||0)+s}return 0===e&&(e=this.eventHeight),e>this.minHeight?e:this.minHeight},h.resetEvents=function(){var e=this;e.events=[],e.events.forRange=function(t,i){for(var n=[],a=0;a<e.events.length;a++){var s=e.events[a];DayPilot.Util.overlaps(s.start(),s.end(),t,i)&&n.push(s)}return n}},h.calculateUtilization=function(){for(var e=this,t=e.sections=function(){for(var t=function(){for(var t=[],i=0;i<e.events.length;i++){var n=e.events[i];DayPilot.contains(t,n.start().toString())||t.push(n.start().toString()),DayPilot.contains(t,n.rawend().toString())||t.push(n.rawend().toString())}return t.sort(),t}(),i=[],n={start:e.data.start},a=0;a<t.length;a++)n.end=new DayPilot.Date(t[a]),i.push(n),n={start:new DayPilot.Date(t[a])};return n.end=e.data.end,i.push(n),i.forRange=function(e,t){for(var i=[],n=0;n<this.length;n++){var a=this[n];DayPilot.Util.overlaps(e,t,a.start,a.end)&&i.push(a)}return i.maxSum=function(e){for(var t=0,i=0;i<this.length;i++){var n=this[i].sum(e);n>t&&(t=n)}return t},i},i}(),i=0;i<t.length;i++){var n=t[i];n.events=[];for(var a=0;a<e.events.length;a++){var s=e.events[a];DayPilot.Util.overlaps(n.start,n.end,s.start(),s.rawend())&&n.events.push(s)}n.sum=function(e){for(var t=0,i=0;i<this.events.length;i++){var n=this.events[i].data[e];"number"==typeof n&&(t+=n)}return t}}},h.putIntoLine=function(e){for(var t=0;t<this.lines.length;t++){if((i=this.lines[t]).isFree(e.part.left,e.part.width))return i.add(e),t}var i;return(i=[]).height=0,i.add=function(e){this.push(e),e.part.height>i.height&&(i.height=e.part.height)},i.isFree=function(e,t,i){for(var n=e+t-1,a=this.length,s=0;s<a;s++){var o=this[s];if(!(n<o.part.left||e>o.part.left+o.part.width-1)){if(DayPilot.contains(i,o.data))continue;return!1}}return!0},i.add(e),this.lines.push(i),this.lines.length-1},h.putIntoBlock=function(e){for(var t=0;t<this.blocks.length;t++){var i=this.blocks[t];if(-1!==DayPilot.indexOf(i.events,e))return;if(i.overlapsWith(e.part.left,e.part.width))return i.events.push(e),e.part.block=i,i.min=Math.min(i.min,e.part.left),i.max=Math.max(i.max,e.part.left+e.part.width),t}(i={expanded:!1}).row=this,i.events=[],i.lines=[],i.putIntoLine=function(e){for(var t=0;t<this.lines.length;t++){if((i=this.lines[t]).isFree(e.part.left,e.part.width))return i.add(e),t}var i;(i=[]).height=0,i.add=function(e){this.push(e),e.part.height>i.height&&(i.height=e.part.height)},i.isFree=function(e,t){for(var i=e+t-1,n=this.length,a=0;a<n;a++){var s=this[a];if(!(i<s.part.left||e>s.part.left+s.part.width-1))return!1}return!0},i.add(e),this.lines.push(i)},i.overlapsWith=function(e,t){return!(e+t-1<this.min||e>this.max-1)},i.getHeight=function(){if(!this.expanded)return o.eventHeight;if(this.lines.length>0){var e=this.lines.length-1,t=this.lines[e],i=t.height||o.eventHeight;return(t.top||0)+i}},i.events.push(e),e.part.block=i,i.min=e.part.left,i.max=e.part.left+e.part.width,this.blocks.push(i)},h.$c8=s,h.$c9=n,h.$ca=function(){this.$c8||(this.hidden=!1,this.$c9&&this.$c9.$ca())},this.rowlist.push(h),"function"==typeof o.onRowFilter&&o.rows.$aU){var c={visible:!0};c.row=o.$af(h),c.filter=o.rows.$aU,o.onRowFilter(c),c.visible?n&&n.$ca():h.hidden=!0}if(null!==n&&n.children.push(t.i),d.columns)for(var u=0;u<d.columns.length;u++)h.columns.push(d.columns[u]);if(t.i++,a&&d.children&&d.children.length){var f=s||!h.expanded;this.$c3(d.children,t,i+1,h,!0,f)}}},this.$bD=function(e){if(e.isNewRow)return{row:{cssClass:o.$8R("_row_new"),moveDisabled:!0,html:""}};var t={};if(t.row=this.$af(e),DayPilot.Util.copyProps(e,t.row,["html","backColor","cssClass","toolTip","contextMenu","moveDisabled"]),t.row.columns=DayPilot.Util.createArrayCopy(e.columns,["html"]),t.row.areas=DayPilot.Util.createArrayCopy(e.areas),void 0===t.row.columns&&o.rowHeaderColumns&&o.rowHeaderColumns.length>0){r.columns=[];for(var i=0;i<o.rowHeaderColumns.length;i++)r.columns.push({})}return"function"==typeof this.onBeforeRowHeaderRender&&this.onBeforeRowHeaderRender(t),t},this.$c7=function(e,t){var i=this.$cb(e,t);if("function"==typeof this.onBeforeResHeaderRender){var n={};n.resource=i,this.onBeforeResHeaderRender(n)}return i},this.$cb=function(e,t){var i={};for(var n in t)i[n]=t[n];for(var n in e)i[n]=e[n];if(void 0===e.html&&(i.html=e.name),void 0===i.columns&&o.rowHeaderColumns&&o.rowHeaderColumns.length>0){i.columns=[];for(var a=0;a<o.rowHeaderColumns.length;a++)i.columns.push({})}return i},this.$cc=function(){this.$cd(),this.nav.top.dp=this,this.nav.top.innerHTML="",this.cssOnly?DayPilot.Util.addClass(this.nav.top,this.$8R("_main")):this.nav.top.style.border="1px solid "+this.borderColor,DayPilot.browser.ie9&&DayPilot.Util.addClass(this.nav.top,this.$8R("_browser_ie9")),DayPilot.browser.ie8&&DayPilot.Util.addClass(this.nav.top,this.$8R("_browser_ie8")),this.nav.top.style.MozUserSelect="none",this.nav.top.style.KhtmlUserSelect="none",this.nav.top.style.webkitUserSelect="none",this.nav.top.style.WebkitTapHighlightColor="rgba(0,0,0,0)",this.nav.top.style.WebkitTouchCallout="none",this.width&&(this.nav.top.style.width=this.width),"Parent100Pct"===this.heightSpec&&(this.nav.top.style.height="100%"),this.nav.top.style.lineHeight="1.2",this.nav.top.style.position="relative",this.visible||(this.nav.top.style.display="none"),this.nav.top.onmousemove=this.$ce,this.nav.top.ontouchstart=w.onMainTouchStart,this.nav.top.ontouchmove=w.onMainTouchMove,this.nav.top.ontouchend=w.onMainTouchEnd,this.hideUntilInit&&this.backendUrl&&(this.nav.top.style.visibility="hidden");var e=this.$8U();if("DivBased"===this.$aK.layout()){var t=document.createElement("div");t.style.position="absolute",t.style.left="0px",t.style.width=e+"px",t.appendChild(this.$cf());var i=document.createElement("div");i.style.height="1px",i.className=this.$8R("_divider_horizontal"),this.cssOnly||(i.style.backgroundColor=this.borderColor),t.appendChild(i),this.nav.dh1=i,t.appendChild(this.$cg()),this.nav.left=t;var n=document.createElement("div");n.style.position="absolute",n.style.left=e+"px",n.style.width=k.splitterWidth()+"px",n.style.height=this.$8T()+this.$8X()+"px",n.className=this.$8R("_divider")+" "+this.$8R("_splitter"),n.setAttribute("unselectable","on"),this.cssOnly||(n.style.backgroundColor=this.borderColor),this.nav.divider=n,this.rowHeaderScrolling&&this.$ch();var a=document.createElement("div");a.style.marginLeft=e+k.splitterWidth()+"px",a.style.marginRight="1px",a.style.position="relative",a.appendChild(this.$ci()),this.nav.right=a;var s=document.createElement("div");s.style.height="1px",s.style.position="absolute",s.style.top=this.$8T()+"px",s.style.width="100%",s.className=this.$8R("_divider_horizontal"),this.cssOnly||(s.style.backgroundColor=this.borderColor),a.appendChild(s),this.nav.dh2=s,a.appendChild(this.$cj());var o=document.createElement("div");o.style.clear="left",this.nav.top.appendChild(t),this.nav.top.appendChild(n),this.nav.top.appendChild(a),this.nav.top.appendChild(o)}else{var l=document.createElement("table");l.cellPadding=0,l.cellSpacing=0,l.border=0,l.style.position="absolute",this.cssOnly||(l.style.backgroundColor=this.hourNameBackColor);var r=l.insertRow(-1);r.insertCell(-1).appendChild(this.$cf()),r.insertCell(-1).appendChild(this.$ci());var d=l.insertRow(-1);d.insertCell(-1).appendChild(this.$cg()),d.insertCell(-1).appendChild(this.$cj()),this.nav.top.appendChild(l)}if(this.$8e=document.createElement("div"),this.$8e.style.display="none",this.nav.top.appendChild(this.$8e),this.$av()){var h=document.createElement("input");h.type="hidden",h.id=this.id+"_state",h.name=this.id+"_state",this.nav.state=h,this.nav.top.appendChild(h)}var c=document.createElement("div");c.style.position="absolute",c.style.left=this.$8U()+k.splitterWidth()+5+"px",c.style.top=this.$8T()+5+"px",c.style.display="none",this.cssOnly||(c.style.backgroundColor=this.loadingLabelBackColor,c.style.fontSize=this.loadingLabelFontSize,c.style.fontFamily=this.loadingLabelFontFamily,c.style.color=this.loadingLabelFontColor,c.style.padding="2px"),c.innerHTML=this.loadingLabelText,DayPilot.Util.addClass(c,this.$8R("_loading")),this.nav.loading=c,this.nav.top.appendChild(c),this.$ck()},this.$ce=function(e){if(n.row){var t=DayPilot.mo3(o.divHeader,e),a=o.$aD(t.y),s=o.rowlist[a.i];if(s.isNewRow)return;var l=t.y-a.top,r=a.bottom-a.top,d=r/3,h=2*d,c=r/2,u="before",f=s.children&&s.children.length>0;if(u=function(){for(var e=a.i,t=s.level;e>=0;){var i=o.rowlist[e];if(e--,!(t<=i.level)){if(i===n.row)return!0;if(0===i.level)return!1;t=i.level}}return!1}()||a.i===n.row.index?"forbidden":f?l<c?"before":"child":l<d?"before":l<h?"child":"after",n.row.moveDisabled&&(u="forbidden"),n.calendar=o,n.source=n.row,n.target=o.rowlist[a.i],n.position=u,!n.last||n.last.target!==n.target||n.last.position!==n.position){if("function"==typeof o.onRowMoving){var v={};v.source=o.$af(n.source),v.target=o.$af(n.target),v.position=u,o.onRowMoving(v),n.position=v.position}}else n.last&&(n.position=n.last.position);n.last={},n.last.target=n.target,n.last.position=n.position,function(){n.div&&DayPilot.de(n.div);var e=a.top,t=n.position,i=o.rowlist[a.i].level*o.treeIndent;switch(t){case"before":e=a.top;break;case"child":e=a.top+c;break;case"after":e=a.bottom;break;case"forbidden":e=a.top+c}var s=o.$bq()-i,l=document.createElement("div");l.style.position="absolute",l.style.left=i+"px",l.style.width=s+"px",l.style.top=e+"px",l.className=o.$8R("_rowmove_position_"+t),n.div=l,o.divResScroll.appendChild(l)}()}else if(i.splitting){var p=DayPilot.mo3(o.nav.top,e).x,y=o.$bq(),g=Math.min(y,p-1);o.rowHeaderWidth=g,o.$bV=!1,o.$bW()}},this.$8q=function(){var e=this.$8T();this.nav.corner.style.height=e+"px",this.divTimeScroll.style.height=e+"px",this.divNorth.style.height=e+"px",this.nav.dh1&&this.nav.dh2&&(this.nav.dh1.style.top=e+"px",this.nav.dh2.style.top=e+"px"),this.nav.loading.style.top=e+5+"px",this.nav.scroll.style.top=e+1+"px"},this.$8U=function(){return this.$bV?0:this.rowHeaderScrolling?this.rowHeaderWidth:this.$bq()},this.$ch=function(){var e=this.nav.divider;e.style.cursor="col-resize",e.setAttribute("unselectable","on"),e.onmousedown=function(e){var t=i.splitting={};return t.cursor=o.nav.top.style.cursor,t.cleanup=function(){if(o.nav.top.style.cursor=t.cursor,"function"==typeof o.onRowHeaderResized){o.onRowHeaderResized({})}},o.nav.top.style.cursor="col-resize",!1}},this.$bW=function(){var e=k.splitterWidth(),t=this.$8U();if(this.nav.corner.style.width=t+"px",this.divCorner.style.width=t+"px",this.divResScroll.style.width=t+"px",this.nav.left.style.width=t+"px",this.nav.divider.style.left=t+"px",this.nav.right.style.marginLeft=t+e+"px",this.nav.message&&(this.nav.message.style.left=t+e+"px"),this.nav.loading&&(this.nav.loading.style.left=t+e+5+"px"),this.nav.hideIcon){var i=this.nav.hideIcon,n=o.$8R("_header_icon_show"),a=o.$8R("_header_icon_hide");i.style.left=t+e-1+"px",o.$bV?(DayPilot.Util.removeClass(i,a),DayPilot.Util.addClass(i,n)):(DayPilot.Util.removeClass(i,n),DayPilot.Util.addClass(i,a))}},this.$cl=function(){this.$bp();var e=this.$bq(),t=function(e,t,i){if(e&&e.style){var n=e.firstChild;o.$bx?(e.style.width=t+"px",n.style.width=t+"px","number"==typeof i&&(e.style.left=i+"px")):n.style.width=t+"px"}},i=this.divHeader;i.style.width=e+"px";for(var n=o.$br(),a=n.start;a<n.end;a++){var s=i.rows[a];if(s)if(s.cells[0].colSpan>1)t(s.cells[0],e);else if(this.rowHeaderCols)for(var l=0,r=0;r<s.cells.length;r++){var d=this.rowHeaderCols[r];t(s.cells[r],d,l),l+=d}else{d=this.rowHeaderWidth;t(s.cells[0],d)}}o.nav.resScrollSpace&&(o.nav.resScrollSpace.style.width=e+"px"),this.$cm()},this.$9O=function(){this.$bW(),this.$cl()},this.$cn=function(){var e=o.nav.corner,t=this.rowHeaderColumns,i=document.createElement("div");i.style.position="absolute",i.style.bottom="0px",i.style.left="0px",i.style.width="100%",i.style.height=k.headerHeight()+"px",i.style.overflow="hidden",o.nav.columnScroll=i;var n=document.createElement("div");n.style.position="absolute",n.style.bottom="0px",n.style.left="0px",n.style.width="5000px",n.style.height=k.headerHeight()+"px",n.style.overflow="hidden",n.className=this.$8R("_columnheader"),i.appendChild(n);var a=document.createElement("div");a.style.position="absolute",a.style.top="0px",a.style.bottom="0px",a.style.left="0px",a.style.right="0px",a.className=this.$8R("_columnheader_inner"),n.appendChild(a);var s=new DayPilot.Splitter(a);s.widths=DayPilot.Util.propArray(t,"width"),s.height=k.headerHeight(),s.css.title=this.$8R("_columnheader_cell"),s.css.titleInner=this.$8R("_columnheader_cell_inner"),s.css.splitter=this.$8R("_columnheader_splitter"),s.titles=DayPilot.Util.propArray(t,"title"),s.updating=function(e){DayPilot.Util.updatePropsFromArray(o.rowHeaderColumns,"width",this.widths),o.$9O(),o.cellWidthSpec},s.updated=function(e){if(o.$bw(),o.$8F())"function"==typeof o.onRowHeaderColumnResized&&((t={}).column=o.rowHeaderColumns[e.index],o.onRowHeaderColumnResized(t));else switch(o.rowHeaderColumnResizedHandling){case"CallBack":case"PostBack":break;case"JavaScript":var t;if("function"==typeof o.onRowHeaderColumnResized)(t={}).column=o.rowHeaderColumns[e.index],o.onRowHeaderColumnResized(t)}},s.color="#000000",s.opacity=30,s.init(),e.appendChild(i),this.$bv=s},this.$9N=function(){var e=this.nav.corner;e.innerHTML="",e.className=this.cssOnly?this.$8R("_corner"):this.$8R("corner"),this.cssOnly||(e.style.backgroundColor=this.hourNameBackColor,e.style.fontFamily=this.hourFontFamily,e.style.fontSize=this.hourFontSize,e.style.cursor="default");var t=document.createElement("div");if(t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.right="0px",t.style.bottom="0px",this.cssOnly&&(t.className=this.$8R("_corner_inner")),this.divCorner=t,t.innerHTML="&nbsp;",this.rowHeaderColumns&&this.rowHeaderColumns.length>0){var i=document.createElement("div");i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.right="0px",i.style.bottom=k.headerHeight()+1+"px",e.appendChild(i);var n=document.createElement("div");n.style.position="absolute",n.style.left="0px",n.style.right="0px",n.style.height="1px",n.style.bottom=k.headerHeight()+"px",n.className=this.$8R("_divider"),e.appendChild(n),i.appendChild(t),this.$cn()}else e.appendChild(t);var a=document.createElement("div");a.style.position="absolute",a.style.padding="2px",a.style.top="0px",a.style.left="1px",a.style.backgroundColor="#FF6600",a.style.color="white",a.innerHTML="DEMO",this.numberFormat&&e.appendChild(a)},this.$ck=function(){if(this.rowHeaderHideIconEnabled){var e=this.$8U()+k.splitterWidth()-1,t=this.$8T()+3,i=DayPilot.Util.div(this.nav.top,e,t,10,20);i.style.cursor="pointer",i.className=o.$8R("_header_icon"),DayPilot.Util.addClass(i,o.$8R("_header_icon_hide")),i.onclick=function(){o.rows.headerToggle()},this.nav.hideIcon=i}},this.$cf=function(){var e=this.$8U(),t=document.createElement("div");return o.nav.corner=t,t.style.width=e+"px",t.style.height=this.$8T()+"px",t.style.overflow="hidden",t.style.position="relative",t.setAttribute("unselectable","on"),t.onmousemove=function(){o.$by()},t.oncontextmenu=function(){return!1},this.$9N(),t},this.$8T=function(){return this.timeHeader?this.timeHeader.length*k.headerHeight():2*k.headerHeight()},this.$co=null,this.$cg=function(){var e=document.createElement("div");return this.cssOnly||(e.style.backgroundColor=this.hourNameBackColor),e.style.width=this.$8U()+"px",e.style.height=this.$8X()+"px",e.style.overflow="hidden",e.style.position="relative",e.className=o.$8R("_rowheader_scroll"),e.onmousemove=function(){o.$by()},e.onscroll=function(){o.nav.columnScroll&&o.rowHeaderScrolling&&(o.nav.columnScroll.scrollLeft=e.scrollLeft),o.$co&&clearTimeout(o.$co),o.$co=setTimeout(function(){o.nav.scroll.scrollTop=e.scrollTop},500)},e.onwheel=function(t){var i=t.deltaY>0?o.eventHeight:-o.eventHeight;o.nav.scroll.scrollTop=e.scrollTop+i,t.preventDefault&&t.preventDefault()},e.onmousewheel=function(t){var i=(t=t||window.event).wheelDelta<0?o.eventHeight:-o.eventHeight;o.nav.scroll.scrollTop=e.scrollTop+i,t.preventDefault&&t.preventDefault(),t.returnValue=!1},e.oncontextmenu=function(){return!1},e.onmouseenter=function(){o.rowHeaderScrolling&&(e.style.overflowX="auto")},e.onmouseleave=function(){o.rowHeaderScrolling&&(e.style.overflowX="hidden")},this.divResScroll=e,this.$8Y=e,e},this.$cp=function(e){if("TableBased"===k.layout()){var t=parseInt(this.width,10),i=-1!==this.width.indexOf("%"),n=(/MSIE/i.test(navigator.userAgent),this.$bq());i?this.nav.top&&this.nav.top.offsetWidth>0&&(e.style.width=this.nav.top.offsetWidth-6-n+"px"):e.style.width=t-n+"px"}},this.$8o=function(){"TableBased"===o.$aK.layout()&&(o.$cp(o.nav.scroll),o.$cp(o.divTimeScroll)),o.$8r(),o.$bw(),o.$86.drawArea=null,o.$8J()},this.$bw=function(){o.$aV&&"Auto"===o.cellWidthSpec&&(o.$8f(),o.$8g(),o.$8l(),o.$8s(),o.$8w(),o.$8u(),o.$8x(),o.$8t(),o.$8j(),o.$8y())},this.$8f=function(){if("Auto"===this.cellWidthSpec){var e=(this.nav.top.clientWidth-this.$8U())/this.$8S();this.cellWidth=Math.floor(e)}},this.$91=function(){var e=this.nav.top.clientWidth,t=this.$8U(),i=this.$8X(),n=0;this.$cq()>i&&(n=DayPilot.swa());var a=e-t-2-n;return this.debug.message("scrollableWidth: "+a),a},this.$ci=function(){var e=document.createElement("div");e.style.overflow="hidden",this.cssOnly||(e.style.backgroundColor=this.hourNameBackColor),e.style.position="absolute",e.style.display="block",e.style.top="0px",e.style.width="100%",e.style.height=this.$8T()+"px",e.style.overflow="hidden",e.onmousemove=function(){o.$by(),o.cellBubble&&o.cellBubble.delayedHide()},this.$cp(e),this.divTimeScroll=e;var t=document.createElement("div");return t.style.width=this.$8S()*this.cellWidth+5e3+"px",this.divNorth=t,e.appendChild(t),e},this.$8X=function(){var e=0;return"Fixed"===this.heightSpec||"Parent100Pct"===this.heightSpec?this.height?this.height:0:(e=this.$cq(),"Max"===this.heightSpec&&e>this.height?this.height:e)},this.$cq=function(){var e;if(this.$85){var t=DayPilot.sh(o.nav.scroll);e=0===t?this.$85:this.$85+t}else e=this.rowlist.length*this.$aK.eventHeight();return e},this.$by=function(){this.$cm(),this.$cr(),this.$cs()},this.$cj=function(){var e=document.createElement("div");e.style.overflow="auto",e.style.overflowX="auto",e.style.overflowY="auto",e.style.position="absolute",e.style.height=this.$8X()+"px",e.style.top=this.$8T()+1+"px",e.style.width="100%",this.cssOnly||(e.style.backgroundColor=this.emptyBackColor),e.className=this.$8R("_scrollable"),e.oncontextmenu=function(){return!1},this.$cp(e),this.nav.scroll=e,this.$8G=document.createElement("div"),this.$8G.style.MozUserSelect="none",this.$8G.style.KhtmlUserSelect="none",this.$8G.style.webkitUserSelect="none",this.$8G.daypilotMainD=!0,this.$8G.calendar=this,t&&(this.$8G.style.webkitTransform="translateZ(0px)"),this.$8G.style.position="absolute";var i=this.$ct();return i>0&&!isNaN(i)&&(this.$8G.style.width=i+"px"),this.$8G.setAttribute("unselectable","on"),this.$8G.onmousedown=this.$cu,this.$8G.onmousemove=this.$cv,this.$8G.onmouseup=this.$cw,this.$8G.oncontextmenu=this.$cx,this.$8G.ondblclick=this.$cy,this.$8G.className=this.$8R("_matrix"),this.divStretch=document.createElement("div"),this.divStretch.style.position="absolute",this.divStretch.style.height="1px",this.$8G.appendChild(this.divStretch),this.divCells=document.createElement("div"),this.divCells.style.position="absolute",this.divCells.oncontextmenu=this.$cx,this.$8G.appendChild(this.divCells),this.divLines=document.createElement("div"),this.divLines.style.position="absolute",this.divLines.oncontextmenu=this.$cx,this.$8G.appendChild(this.divLines),this.divBreaks=document.createElement("div"),this.divBreaks.style.position="absolute",this.divBreaks.oncontextmenu=this.$cx,this.$8G.appendChild(this.divBreaks),this.divSeparators=document.createElement("div"),this.divSeparators.style.position="absolute",this.divSeparators.oncontextmenu=this.$cx,this.$8G.appendChild(this.divSeparators),this.divLinksBelow=document.createElement("div"),this.divLinksBelow.style.position="absolute",this.$8G.appendChild(this.divLinksBelow),this.divCrosshair=document.createElement("div"),this.divCrosshair.style.position="absolute",this.divCrosshair.ondblclick=this.$cy,this.$8G.appendChild(this.divCrosshair),this.divRange=document.createElement("div"),this.divRange.style.position="absolute",this.divRange.oncontextmenu=this.$cx,this.$8G.appendChild(this.divRange),this.divEvents=document.createElement("div"),this.divEvents.style.position="absolute",this.$8G.appendChild(this.divEvents),this.divSeparatorsAbove=document.createElement("div"),this.divSeparatorsAbove.style.position="absolute",this.divSeparatorsAbove.oncontextmenu=this.$cx,this.$8G.appendChild(this.divSeparatorsAbove),this.divLinksAbove=document.createElement("div"),this.divLinksAbove.style.position="absolute",this.$8G.appendChild(this.divLinksAbove),this.divLinkShadow=document.createElement("div"),this.divLinkShadow.style.position="absolute",this.$8G.appendChild(this.divLinkShadow),this.divLinkpoints=document.createElement("div"),this.divLinkpoints.style.position="absolute",this.$8G.appendChild(this.divLinkpoints),this.divRectangle=document.createElement("div"),this.divRectangle.style.position="absolute",this.$8G.appendChild(this.divRectangle),this.divHover=document.createElement("div"),this.divHover.style.position="absolute",this.$8G.appendChild(this.divHover),e.appendChild(this.$8G),e},this.$cz={};var m=this.$cz;m.create=function(){if(!o.nav.overlay){var e=document.createElement("div");e.style.position="absolute",e.style.left="0px",e.style.right="0px",e.style.top="0px",e.style.bottom="0px",e.className=o.$8R("_block"),o.nav.top.appendChild(e),o.nav.overlay=e}},m.show=function(){m.create(),o.nav.overlay.style.display=""},m.hide=function(){o.nav.overlay&&(o.nav.overlay.style.display="none")},this.$ar=function(e){o.loadingTimeout&&window.clearTimeout(o.loadingTimeout);var t=e?0:100;o.loadingTimeout=window.setTimeout(function(){o.loadingLabelVisible&&(o.nav.loading.innerHTML=o.loadingLabelText,o.nav.loading.style.display=""),o.blockOnCallBack&&m.show()},t)},this.$89=function(e){this.loadingTimeout&&window.clearTimeout(this.loadingTimeout),e?(this.nav.loading.innerHTML=e,window.setTimeout(function(){o.$89()},1e3)):(this.nav.loading.style.display="none",this.blockOnCallBack&&m.hide())},this.$cA=function(){this.startDate=new DayPilot.Date(this.startDate).getDatePart()},this.$cB=function(e){var t=document.createElement("div");t.style.position="absolute",t.style.top="-2000px",t.style.left="-2000px",t.className=this.$8R(e),document.body.appendChild(t);var i=t.offsetHeight,n=t.offsetWidth;document.body.removeChild(t);var a={};return a.height=i,a.width=n,a},this.$8a=function(e){if(e&&(this.autoRefreshEnabled=!0),this.autoRefreshEnabled&&!(this.autoRefreshCount>=this.autoRefreshMaxCount)){this.$aq();var t=this.autoRefreshInterval;if(!t||t<10)throw"The minimum autoRefreshInterval is 10 seconds";this.autoRefreshTimeout=window.setTimeout(function(){o.$cC()},1e3*this.autoRefreshInterval)}},this.$aq=function(){this.autoRefreshTimeout&&window.clearTimeout(this.autoRefreshTimeout)},this.$cC=function(){if(!(i.resizing||i.moving||i.drag||i.range)){var e=!1;if("function"==typeof this.onAutoRefresh){var t={};t.i=this.autoRefreshCount,t.preventDefault=function(){this.preventDefault.value=!0},o.onAutoRefresh(t),t.preventDefault.value&&(e=!0)}!e&&this.$92()&&this.commandCallBack(this.autoRefreshCommand),this.autoRefreshCount++}this.autoRefreshCount<this.autoRefreshMaxCount&&(this.autoRefreshTimeout=window.setTimeout(function(){o.$cC()},1e3*this.autoRefreshInterval))},this.$cD=function(){i.globalHandlers||(i.globalHandlers=!0,DayPilot.re(document,"mousemove",i.gMouseMove),DayPilot.re(document,"mouseup",i.gMouseUp),DayPilot.re(document,"keyup",i.gKeyUp),DayPilot.re(document,"mousedown",i.gMouseDown),DayPilot.re(document,"touchmove",i.gTouchMove),DayPilot.re(document,"touchend",i.gTouchEnd)),DayPilot.re(window,"resize",this.$8o)},this.$cE=function(){this.nav.scroll.root=this,this.nav.scroll.onscroll=this.$8E,o.$cF=this.nav.scroll.scrollLeft,o.$cG=this.nav.scroll.scrollTop,o.$cH=this.divNorth.clientWidth},this.$8B=function(){if(this.nav.state){var e={};e.scrollX=this.nav.scroll.scrollLeft,e.scrollY=this.nav.scroll.scrollTop,this.syncResourceTree&&(e.tree=this.$aA()),this.nav.state.value=DayPilot.he(DayPilot.JSON.stringify(e))}},this.$8x=function(){if(this.separators)for(var e=0;e<this.separators.length;e++)this.$cI(e)},this.$cJ={},this.$cJ.step=300,this.$cJ.delay=10,this.$cJ.mode="display",this.$cJ.layers=!0,this.$bS=function(e){for(var t=this.durationBarDetached?-10:0,i=0,n=0;n<e.lines.length;n++){for(var a=e.lines[n],s=0;s<a.length;s++){var o=a[s];o.part.top,o.part.line=n,o.part.height||(o.part.height=e.eventHeight),o.part.top=i+e.marginTop,o.part.detachedBarTop=o.part.top-t,o.part.right=o.part.left+o.part.width,o.part.fullTop=this.rowlist[o.part.dayIndex].top+o.part.top,o.part.fullBottom=o.part.fullTop+o.part.height}i+=(a.height||e.eventHeight)*this.eventStackingLineHeight/100}},this.$8y=function(e){var t=this.$cJ.step;this.$cJ.layers&&(o.divEvents=document.createElement("div"),o.divEvents.style.position="absolute",o.$8G.insertBefore(this.divEvents,this.divSeparatorsAbove)),"display"===this.$cJ.mode?this.divEvents.style.display="none":"visibility"===this.$cJ.mode&&(this.divEvents.style.visibility="hidden");for(var i="Progressive"===this.dynamicEventRendering,n=this.$8K(),a=n.pixels.top,s=n.pixels.bottom,l=0;l<this.rowlist.length;l++){var r=this.rowlist[l],h=r.top-this.dynamicEventRenderingMargin,c=h+r.height+2*this.dynamicEventRenderingMargin;if(!i||!(s<=h||a>=c)){this.$bS(r);for(var u=0;u<r.lines.length;u++)for(var f=r.lines[u],v=0;v<f.length;v++){var p=f[v],y=this.$cK(p);if(e&&y&&--t<=0)return this.divEvents.style.visibility="",this.divEvents.style.display="",void window.setTimeout(function(){o.$8y(e)},o.$cJ.delay)}}}this.divEvents.style.display="",this.$8N(),d.load(),this.$89()},this.$9S=function(e){var t=this.rowlist[e];this.divEvents=document.createElement("div"),this.divEvents.style.position="absolute",this.divEvents.style.display="none",this.$8G.insertBefore(this.divEvents,this.divSeparatorsAbove);this.durationBarDetached;this.$bS(t);for(var i=0;i<t.lines.length;i++)for(var n=t.lines[i],a=0;a<n.length;a++){var s=n[a];this.$cK(s)}this.divEvents.style.display=""},this.$8t=function(){if(this.elements.events)for(var e=this.elements.events.length,t=0;t<e;t++){var i=this.elements.events[t];this.$cL(i)}this.elements.events=[]},this.$9R=function(e){if(this.elements.events){for(var t=this.elements.events.length,i=[],n=0;n<t;n++){var a=this.elements.events[n];a.row===e&&(this.$cL(a),i.push(n))}for(n=i.length-1;n>=0;n--)this.elements.events.splice(i[n],1)}},this.$cL=function(e){e.onclick=null,e.oncontextmenu=null,e.onmouseover=null,e.onmouseout=null,e.onmousemove=null,e.onmousedown=null,e.ondblclick=null,e.event&&(e.isBar||(e.event.rendered=null),e.event=null),e.related&&DayPilot.de(e.related),e.parentNode&&e.parentNode.removeChild(e)},this.$cM=function(e){e.event&&(e.event.rendered=!1),e.onclick=null,e.onmousedown=null,e.event=null,e.parentNode&&e.parentNode.removeChild(e)},this.$cN=function(e){if(e||(e=0),"Progressive"===this.dynamicEventRendering){this.divEvents.style.display="none";for(var t=[],i=this.elements.events.length-1;i>=0;i--){var n=this.elements.events[i];this.$cO(n.event)?e>0?(e--,t.unshift(n)):(this.$cL(n),0):t.unshift(n)}this.elements.events=t,this.divEvents.style.display=""}},this.$cP=function(e){for(var t=[],i=this.$8K(),n=this.elements.cells.length-1;n>=0;n--){var a=this.elements.cells[n];i.xStart<a.coords.x&&a.coords.x<=i.xEnd&&i.yStart<a.coords.y&&a.coords.y<=i.yEnd?t.unshift(a):e>0?(e--,t.unshift(a)):(this.$b2(a),0)}},this.$b2=function(e){if(e){var t=e.coords.x,i=e.coords.y,n=DayPilot.indexOf(o.elements.cells,e);o.elements.cells.splice(n,1),e.parentNode&&e.parentNode.removeChild(e),o.$86.cells[t+"_"+i]=null}},this.$8u=function(){if(this.elements.separators)for(var e=0;e<this.elements.separators.length;e++){var t=this.elements.separators[e];DayPilot.de(t)}this.elements.separators=[]},this.$cQ=function(){var e="Progressive"===this.dynamicEventRendering;if(!this.nav.scroll)return!1;for(var t=this.nav.scroll.scrollTop,i=t+this.nav.scroll.clientHeight,n=0;n<this.rowlist.length;n++){var a=this.rowlist[n],s=a.top,o=a.top+a.height;if(!e||!(i<=s||t>=o))for(var l=0;l<a.lines.length;l++)for(var r=a.lines[l],d=0;d<r.length;d++){var h=r[d];if(this.$cR(h))return!0}}return!1},this.$cR=function(e){if(e.rendered)return!1;var t="Progressive"===this.dynamicEventRendering,i=this.nav.scroll.scrollLeft,n=i+this.nav.scroll.clientWidth,a=e.Left,s=e.Left+e.Width;return!t||!(n<=a||i>=s)},this.$cO=function(e){if(!e.rendered)return!0;var t=this.$8K(),i=t.pixels.top,n=t.pixels.bottom,a=t.pixels.left-this.dynamicEventRenderingMargin,s=t.pixels.right+this.dynamicEventRenderingMargin,o=e.part.left,l=e.part.right,r=e.part.fullTop,d=e.part.fullBottom;return s<=o||a>=l||(n<=r||i>=d)},this.$cS=function(e){if(e.rendered)return!1;var t=e.min,i=e.max-e.min,n=o.eventHeight,a=e.row.top,s=document.createElement("div");s.style.position="absolute",s.style.left=t+"px",s.style.top=a+"px",s.style.width=i+"px",s.style.height=n+"px",s.className=o.$8R("_event_group"),s.style.cursor="pointer";var l={group:{}};l.group.count=e.events.length,l.group.html="[+] "+e.events.length+" events","function"==typeof o.onBeforeGroupRender&&o.onBeforeGroupRender(l);var r=document.createElement("div");return r.innerHTML=l.group.html,s.appendChild(r),s.onmousedown=function(e){(e=e||window.event).cancelBubble=!0},s.onclick=function(e){var t=s.event;t.expanded=!0,o.$cM(s);var i=DayPilot.indexOf(o.elements.events,s);-1!==i&&o.elements.events.splice(i,1),o.$9A(),o.$9B(t.part.dayIndex),o.$8r(),(e=e||window.event).cancelBubble=!0},e.part={},e.part.left=t,e.part.width=i,e.part.dayIndex=DayPilot.indexOf(o.rowlist,e.row),e.part.top=0,e.client={},e.client.html=function(){return l.group.html},s.event=e,this.elements.events.push(s),this.divEvents.appendChild(s),e.rendered=!0,!0},this.$cK=function(e){if(e.rendered)return!1;if(o.groupConcurrentEvents){var t=e.part.block;if(t.events.length>1&&!t.expanded)return o.$cS(t)}var i="Progressive"===this.dynamicEventRendering,n=(A=this.$8K()).pixels.left-this.dynamicEventRenderingMargin,a=A.pixels.right+this.dynamicEventRenderingMargin,s=e.part.left,l=e.part.left+e.part.width;if(i&&(a<=s||n>=l))return!1;var r=e.part.dayIndex,d=!this.cssOnly&&this.eventBorderVisible,h=e.part.width,c=e.part.height;d&&(h-=2,c-=2);var u=e.cache||e.data;h=Math.max(0,h),c=Math.max(0,c);var f=this.rowlist[r];if(f.hidden)return!1;var v=f.top,p=document.createElement("div"),y=this.durationBarDetached;if(p.related=[],y){var g=e.part.barLeft,m=e.part.barWidth;"PercentComplete"===this.durationBarMode&&(g=0,m=(u.complete||0)/100*h),(T=document.createElement("div")).style.position="absolute",T.style.left=e.part.left+g+"px",T.style.top=v+e.part.detachedBarTop+"px",T.style.width=m+"px",T.style.height="5px",T.style.backgroundColor="black",T.type="detachedBar",p.related.push(T),this.divEvents.appendChild(T)}if(e.data.htmlLeft){var b=5,$=document.createElement("div");$.style.position="absolute",$.style.right=-(e.part.left-b)+"px",$.style.top=v+e.part.top+"px",$.style.height=o.eventHeight+"px",$.style.boxSizing="border-box",$.innerHTML=e.data.htmlLeft,$.className=o.$8R("_event_left"),$.type="divLeft",p.related.push($),this.divEvents.appendChild($)}if(e.data.htmlRight){b=5;var D=document.createElement("div");D.style.position="absolute",D.style.left=e.part.left+e.part.width+b+"px",D.style.top=v+e.part.top+"px",D.style.height=o.eventHeight+"px",D.style.boxSizing="border-box",D.innerHTML=e.data.htmlRight,D.className=o.$8R("_event_right"),D.type="divRight",p.related.push(D),this.divEvents.appendChild(D)}e.part.top;p.style.position="absolute",p.style.left=e.part.left+"px",p.style.top=v+e.part.top+"px",p.style.width=h+"px",p.style.height=c+"px",this.cssOnly||(o.eventBorderVisible&&(p.style.border="1px solid "+(u.borderColor||this.eventBorderColor)),p.style.backgroundColor=e.client.backColor(),p.style.fontSize=this.eventFontSize,p.style.cursor="default",p.style.fontFamily=this.eventFontFamily,p.style.color=u.fontColor||this.eventFontColor,u.backImage&&!this.durationBarVisible&&(p.style.backgroundImage="url("+u.backImage+")",u.backRepeat&&(p.style.backgroundRepeat=u.backRepeat)),this.$aK.rounded()&&(p.style.MozBorderRadius="5px",p.style.webkitBorderRadius="5px",p.style.borderRadius="5px")),o.eventTextWrappingEnabled||(p.style.whiteSpace="nowrap"),p.style.overflow="hidden",p.className=this.cssOnly?this.$8R("_event"):this.$8R("event"),"Milestone"===e.data.type&&DayPilot.Util.addClass(p,o.$8R("_task_milestone")),"Group"===e.data.type&&(DayPilot.Util.addClass(p,o.$8R("_task_parent")),DayPilot.Util.addClass(p,o.$8R("_task_group"))),u.cssClass&&DayPilot.Util.addClass(p,u.cssClass);DayPilot.Util.addClass(p,this.$8R("_event_line"+e.part.line)),p.setAttribute("unselectable","on"),this.showToolTip&&!this.bubble&&(p.title=e.client.toolTip()),p.onmousemove=this.$cT,p.onmouseout=this.$cU,p.onmousedown=this.$cV,p.ontouchstart=w.onEventTouchStart,p.ontouchmove=w.onEventTouchMove,p.ontouchend=w.onEventTouchEnd,e.client.clickEnabled()&&(p.onclick=this.$9e),e.client.doubleClickEnabled()&&(p.ondblclick=this.$9p),p.oncontextmenu=this.$9o;var k=[],C=0;if(this.cssOnly){var x=document.createElement("div");x.setAttribute("unselectable","on"),x.className=o.$8R("_event_inner"),x.innerHTML=e.client.innerHTML(),u.backColor&&(x.style.background=u.backColor,(DayPilot.browser.ie9||DayPilot.browser.ielt9)&&(x.style.filter="")),u.fontColor&&(x.style.color=u.fontColor),u.borderColor&&(x.style.borderColor=u.borderColor),u.backImage&&(x.style.backgroundImage="url("+u.backImage+")",u.backRepeat&&(x.style.backgroundRepeat=u.backRepeat)),p.appendChild(x);var P=e.start().getTime()===e.part.start.getTime(),S=e.rawend().getTime()===e.part.end.getTime();if(P||DayPilot.Util.addClass(p,this.$8R("_event_continueleft")),S||DayPilot.Util.addClass(p,this.$8R("_event_continueright")),e.client.barVisible()&&h>0){var T;g=100*e.part.barLeft/h,m=Math.ceil(100*e.part.barWidth/h);"PercentComplete"===this.durationBarMode&&(g=0,m=u.complete||0),(T=document.createElement("div")).setAttribute("unselectable","on"),T.className=this.$8R("_event_bar"),T.style.position="absolute",u.barBackColor&&(T.style.backgroundColor=u.barBackColor);var M=document.createElement("div");M.setAttribute("unselectable","on"),M.className=this.$8R("_event_bar_inner"),M.style.left=g+"%",M.style.width=0<m&&m<=1?"1px":m+"%",u.barColor&&(M.style.backgroundColor=u.barColor),u.barImageUrl&&(M.style.backgroundImage="url("+u.barImageUrl+")"),T.appendChild(M),p.appendChild(T)}}else e.client.barVisible()&&(C=o.durationBarHeight,k.push("<div unselectable='on' style='left:0px;background-color:white;width:"),k.push(e.part.barLeft),k.push("px;height:2px;font-size:1px;position:absolute'></div>"),k.push("<div unselectable='on' style='left:"),k.push(e.part.barLeft+e.part.barWidth),k.push("px;background-color:white;width:"),k.push(h-(e.part.barLeft+e.part.barWidth)),k.push("px;height:2px;font-size:1px;position:absolute'></div>"),"Duration"===this.durationBarMode?(k.push("<div unselectable='on' style='width:"),k.push(e.part.barWidth),k.push("px;margin-left:"),k.push(e.part.barLeft),k.push("px;height:")):(k.push("<div unselectable='on' style='width:"),k.push(u.complete),k.push("%;margin-left:0px;height:")),k.push(C-1),k.push("px;background-color:"),k.push(e.client.barColor()),u.barImageUrl&&(k.push(";background-image:url("),k.push(u.barImageUrl),k.push(")")),k.push(";font-size:1px;position:relative'></div>"),k.push("<div unselectable='on' style='width:"),k.push(h),k.push("px;height:1px;background-color:"),k.push(u.borderColor||this.eventBorderColor),k.push(";font-size:1px;overflow:hidden;position:relative'></div>")),k.push("<div unselectable='on' style='padding-left:1px;width:"),k.push(h-1),k.push("px;height:"),k.push(c-C),k.push("px;"),o.rtl&&k.push("direction:rtl;"),u.backImage&&this.durationBarVisible&&(k.push("background-image:url("),k.push(u.backImage),k.push(");"),u.backRepeat&&(k.push("background-repeat:"),k.push(u.backRepeat),k.push(";"))),k.push("'>"),k.push(e.client.innerHTML()),k.push("</div>"),p.innerHTML=k.join("");if(p.row=r,u.areas)for(var H=0;H<u.areas.length;H++){var A;if("Visible"===((A=u.areas[H]).v||"Visible")){var E=DayPilot.Areas.createArea(p,e,A);p.appendChild(E)}}if(this.elements.events.push(p),this.divEvents.appendChild(p),e.rendered=!0,p.event=e,o.multiselect.$9F(p.event)&&(o.multiselect.add(p.event,!0),o.multiselect.$9E(p)),o.$8F()){if("function"==typeof o.onAfterEventRender){var B={};B.e=p.event,B.div=p,o.onAfterEventRender(B)}}else o.afterEventRender&&o.afterEventRender(p.event,p);return!0},this.$8F=function(){return 2===o.api},this.$9T=function(){for(var e=0;e<this.elements.events.length;e++){var t=this.elements.events[e],i=t.event,n=i.part.dayIndex,a=this.rowlist[n].top+i.part.top;if(t.style.top=a+"px",DayPilot.isArray(t.related))for(var s=0;s<t.related.length;s++){var o=t.related[s];"divLeft"!==o.type&&"divRight"!==o.type||(o.style.top=a+"px")}}},this.$aR=function(e){if(!e)return null;for(var t=0;t<o.elements.events.length;t++){var i=o.elements.events[t];if(i.event===e||i.event.data===e.data)return i}return null},this.$cU=function(e){DayPilot.Areas.hideAreas(this,e),o.cssOnly&&DayPilot.Util.removeClass(this,o.$8R("_event_hover")),o.$cW(this),s.source||d.hideLinkpointsWithDelay(),o.bubble&&"Bubble"===o.eventHoverHandling&&o.bubble.hideOnMouseOut()},this.$cX=function(e){if("function"==typeof this.onEventMouseOver){var t={};t.div=e,t.e=e.event,this.onEventMouseOver(t)}},this.$cW=function(e){if("function"==typeof this.onEventMouseOut){var t={};t.div=e,t.e=e.event,this.onEventMouseOut(t)}},this.$cT=function(e){e=e||window.event,o.cellBubble&&o.cellBubble.delayedHide();for(var t=this;t&&!t.event;)t=t.parentNode;if(o.$cY(t,e),!t.active){var n=[];if("Disabled"!==o.eventDeleteHandling){var a=o.durationBarVisible?o.durationBarHeight:0;n.push({action:"JavaScript",v:"Hover",w:17,h:17,top:a+2,right:2,css:o.$8R("_event_delete"),js:function(e){o.$9l(e)}})}var l=t.event.cache?t.event.cache.areas:t.event.data.areas;l&&l.length>0&&(n=n.concat(l)),DayPilot.Areas.showAreas(t,t.event,null,n),o.cssOnly&&DayPilot.Util.addClass(t,o.$8R("_event_hover")),o.$cX(t)}"Disabled"===o.linkCreateHandling||s.source||(d.clearHideTimeout(),d.hideLinkpoints(),i.moving||i.resizing||d.showLinkpoint(t)),e.srcElement?e.srcElement.insideEvent=!0:e.insideEvent=!0},this.$cZ={};var b=this.$cZ;this.$cV=function(e){if(o.$by(),void 0!==DayPilot.Bubble&&DayPilot.Bubble.hideActive(),e=e||window.event,DayPilot.Util.mouseButton(e).left){var t=e.shiftKey;if("Disabled"!==o.multiSelectRectangle&&t)return $.start(),!1;"w-resize"===this.style.cursor||"e-resize"===this.style.cursor?(i.resizing=this,i.originalMouse=DayPilot.mc(e),document.body.style.cursor=this.style.cursor,d.hideLinkpoints()):("move"===this.style.cursor||"Full"===o.moveBy&&this.event.client.moveEnabled())&&(b.start=!0,b.moving=this,b.originalMouse=DayPilot.mc(e),b.moveOffsetX=DayPilot.mo3(this,e).x,b.moveDragStart=o.getDate(o.coords.x,!0),d.hideLinkpoints())}return e.cancelBubble=!0,!1},this.$d0={};var w=o.$d0;w.active=!1,w.start=!1,w.timeouts=[],w.onEventTouchStart=function(e){if(!w.active&&!w.start){e.stopPropagation(),w.clearTimeouts(),w.start=!0,w.active=!1;var t=this,i=o.tapAndHoldTimeout;w.timeouts.push(window.setTimeout(function(){switch(w.active=!0,w.start=!1,o.coords=w.relativeCoords(e),e.preventDefault(),o.eventTapAndHoldHandling){case"Move":w.startMoving(t,e);break;case"ContextMenu":var i=t.event;DayPilot.Menu&&DayPilot.Menu.touchPosition(e);var n=i.client.contextMenu();n?n.show(i):o.contextMenu&&o.contextMenu.show(i)}},i))}},w.onEventTouchMove=function(e){w.clearTimeouts(),w.start=!1},w.onEventTouchEnd=function(e){if(!DayPilot.Util.isMouseEvent(e)){if(w.clearTimeouts(),w.start){w.start=!1,e.preventDefault(),e.stopPropagation();var t=this;window.setTimeout(function(){o.$9i(t,e)})}window.setTimeout(function(){w.start=!1,w.active=!1},500)}},w.onMainTouchStart=function(e){if(!w.active&&!w.start){w.clearTimeouts(),w.start=!0,w.active=!1;var t=o.tapAndHoldTimeout;w.timeouts.push(window.setTimeout(function(){w.active=!0,w.start=!1,e.preventDefault(),o.coords=w.relativeCoords(e),w.range=o.$d1()},t));o.coords=w.relativeCoords(e)}},w.onMainTouchMove=function(e){if(w.clearTimeouts(),w.start=!1,w.active){if(e.preventDefault(),o.coords=w.relativeCoords(e),i.moving)return void w.updateMoving();if(w.range){var t=w.range;t.end={x:Math.floor(o.coords.x/o.cellWidth)},o.$a5(t)}}},w.onMainTouchEnd=function(e){w.clearTimeouts();if(w.active){if(i.moving){e.preventDefault();var t=i.moving.event,n=i.movingShadow.start,a=i.movingShadow.end,s="Days"!==o.viewType?i.movingShadow.row.id:null,l=!!i.drag,r=i.movingShadow.overlapping,d=!i.movingShadow.allowed;if(DayPilot.Util.removeClass(i.moving,o.$8R("_event_moving_source")),DayPilot.de(i.movingShadow),o.$bo(),i.movingShadow.calendar=null,document.body.style.cursor="",i.moving=null,i.movingShadow=null,o.$bk.clear(),r||d||o.$bk.forbidden||o.$bk.invalid)return;o.$9X(t,n,a,s,l)}if(w.range){var h=w.range;w.range=null,(c=o.elements.range2)&&c.overlapping?o.clearSelection():o.$a1(h)}}else if(w.start){var c;h=o.$d1();o.$a5(h),(c=o.elements.range2)&&c.overlapping?o.clearSelection():o.$a1(h)}window.setTimeout(function(){w.start=!1,w.active=!1},500)},w.clearTimeouts=function(){for(var e=0;e<w.timeouts.length;e++)clearTimeout(w.timeouts[e]);w.timeouts=[]},w.relativeCoords=function(e){var t=o.$8G,i=e.touches[0].pageX,n=e.touches[0].pageY,a=DayPilot.abs(t);return{x:i-a.x,y:n-a.y,toString:function(){return"x: "+this.x+", y:"+this.y}}},w.startMoving=function(e,t){var n={x:t.touches[0].pageX,y:t.touches[0].pageY};i.moving=e,i.originalMouse=n;var a=DayPilot.abs(e);i.moveOffsetX=n.x-a.x,i.moveDragStart=o.getDate(o.coords.x,!0),i.movingShadow=o.$aL(e,o.shadow),o.$be()},w.updateMoving=function(){if(i.movingShadow&&i.movingShadow.calendar!==o&&(i.movingShadow.calendar=null,DayPilot.de(i.movingShadow),i.movingShadow=null),!i.movingShadow){var e=i.moving;i.movingShadow=o.$aL(e,o.shadow)}i.moving.target=o,o.$be()},this.$cY=function(e,t){var n=this.eventResizeMargin,a=this.eventMoveMargin,s=e;if(void 0!==i){var l=DayPilot.mo3(e,t);if(l&&(o.eventOffset=l,!i.resizing&&!i.moving)){var r=s.event.part.start.toString()===s.event.start().toString(),d=s.event.part.end.toString()===s.event.rawend().toString();if("Top"===o.moveBy&&l.y<=a&&s.event.client.moveEnabled()&&"Disabled"!==o.eventMoveHandling?e.style.cursor=r?"move":"not-allowed":("Top"===o.moveBy||"Full"===o.moveBy)&&l.x<=n&&s.event.client.resizeEnabled()&&"Disabled"!==o.eventResizeHandling?r?(e.style.cursor="w-resize",e.dpBorder="left"):e.style.cursor="not-allowed":"Left"===o.moveBy&&l.x<=a&&s.event.client.moveEnabled()&&"Disabled"!==o.eventMoveHandling?e.style.cursor=r?"move":"not-allowed":e.offsetWidth-l.x<=n&&s.event.client.resizeEnabled()&&"Disabled"!==o.eventResizeHandling?d?(e.style.cursor="e-resize",e.dpBorder="right"):e.style.cursor="not-allowed":i.resizing||i.moving||(s.event.client.clickEnabled()&&"Disabled"!==o.eventClickHandling?e.style.cursor="pointer":e.style.cursor="default"),void 0!==DayPilotBubble&&o.bubble&&"Bubble"===o.eventHoverHandling)if("default"===e.style.cursor||"pointer"===e.style.cursor)this.$d2&&l.x===this.$d2.x&&l.y===this.$d2.y||(this.$d2=l,o.bubble.showEvent(e.event))}}},this.$8S=function(){return"Days"!==this.viewType?this.itline.length:Math.floor(1440/this.cellDuration)},this.$a2=function(e){if(!(e=e||i.range||i.rangeHold))return null;var t=o.rowlist[e.start.y];if(!t)return null;var n=e.$d3?e.$d3:e,a=t.id,s=n.end.x>n.start.x?n.start.x:n.end.x,l=n.end.x>n.start.x?n.end.x:n.start.x,r=0;if("Days"===o.viewType)r=t.start.getTime()-o.startDate.getTime();else r=t.start.getTime()-this.$97().getTime();var d=this.itline[s].start.addTime(r),h=this.itline[l].end.addTime(r);return new DayPilot.Selection(d,h,a,o)},this.$d4=function(e){var t=e.parentNode,i=document.createElement("textarea");return i.style.position="absolute",i.style.width=(e.offsetWidth<100?100:e.offsetWidth-2)+"px",i.style.height=e.offsetHeight-2+"px",i.style.fontFamily=DayPilot.gs(e,"fontFamily")||DayPilot.gs(e,"font-family"),i.style.fontSize=DayPilot.gs(e,"fontSize")||DayPilot.gs(e,"font-size"),i.style.left=e.offsetLeft+"px",i.style.top=e.offsetTop+"px",i.style.border="1px solid black",i.style.padding="0px",i.style.marginTop="0px",i.style.backgroundColor="white",i.value=DayPilot.tr(e.event.text()),i.event=e.event,t.appendChild(i),i},this.$9j=function(e){if(i.editing&&i.editing.blur(),e.event){var t=this.$d4(e);i.editing=t,t.onblur=function(){if(t.onblur=null,i.editing=null,t.parentNode&&t.parentNode.removeChild(t),e.event){var n=e.event.text(),a=t.value;n===a||t.canceling||o.$an(e.event,a)}},t.onmousedown=function(e){(e=e||window.event).stopPropagation&&e.stopPropagation()},t.onkeypress=function(e){return 13!==(window.event?event.keyCode:e.keyCode)||(this.onblur(),!1)},t.cancel=function(){i.editing&&(i.editing.canceling=!0,i.editing.blur())},t.onkeydown=function(e){27===(window.event?event.keyCode:e.keyCode)&&i.editing.cancel()},t.select(),t.focus()}},this.$bE=function(e){if(void 0!==DayPilotBubble&&(o.cellBubble&&o.cellBubble.hideOnMouseOut(),o.resourceBubble)){var t={};t.calendar=o,t.id=this.row.id,t.toJSON=function(){var e={};return e.id=this.id,e},o.resourceBubble.showResource(t)}},this.$bF=function(e){void 0!==DayPilotBubble&&o.resourceBubble&&o.resourceBubble.hideOnMouseOut();var t=this.firstChild;DayPilot.Areas.hideAreas(t,e),t.data=null},this.$bG=function(e){n.row&&(y.cancelClick=!0,setTimeout(function(){y.cancelClick=!1},100))},this.$8l=function(){this.$d5()},this.$d5=function(){if(this.timeHeader){this.$86.timeHeader={};var e=document.createElement("div");e.style.position="relative",this.nav.timeHeader=e;for(var t=0;t<this.timeHeader.length;t++)for(var i=this.timeHeader[t],n=0;n<i.length;n++)this.$d6(n,t);var a=this.divNorth;DayPilot.puc(a),a.innerHTML="",a.appendChild(e);this.$ct();a.style.width=this.$ct()+5e3+"px";var s=this.divCorner;this.cssOnly||(s.style.backgroundColor=this.cornerBackColor),this.cornerHtml?s.innerHTML=this.cornerHtml:s.innerHTML="",this.$ct()>0&&(this.divStretch.style.width=this.$ct()+"px")}},this.$99=function(e,t){var i=null,n=this.$aK.locale(),a=(t=t||this.cellGroupBy,e.start);e.end,n=this.$aK.locale();switch(t){case"Hour":i="Clock12Hours"===o.$aK.timeFormat()?a.toString("h tt",n):a.toString("H",n);break;case"Day":i=a.toString(n.datePattern);break;case"Week":i=1===k.weekStarts()?a.weekNumberISO():a.weekNumber();break;case"Month":i=a.toString("MMMM yyyy",n);break;case"Year":i=a.toString("yyyy");break;case"None":i="";break;case"Cell":if("Manual"===this.scale||"CellDuration"===this.scale){var s=(e.end.ticks-e.start.ticks)/6e4;i=this.$d7(a,s)}else i=this.$99(e,this.scale);break;default:throw"Invalid cellGroupBy value"}return i},this.$d7=function(e,t){var i=this.$aK.locale();return(t=t||this.cellDuration)<60?e.toString("mm"):t<1440?"Clock12Hours"===o.$aK.timeFormat()?e.toString("h tt",i):e.toString("H",i):t<10080?e.toString("d"):10080===t?1===k.weekStarts()?e.weekNumberISO():e.weekNumber():e.toString("MMMM yyyy",i)},this.$95=function(e){var t=this.scale;switch(t){case"Cell":throw"Invalid scale: Cell";case"Manual":throw"Internal error (addScaleSize in Manual mode)";case"Minute":return e.addMinutes(1);case"CellDuration":return e.addMinutes(this.cellDuration);default:return this.$98(e,t)}},this.$98=function(e,t){var i,n="Days"!==this.viewType?this.days:1,a=this.startDate.addDays(n);switch(t=t||this.cellGroupBy){case"Hour":i=e.addHours(1);break;case"Day":i=e.addDays(1);break;case"Week":for(i=e.addDays(1);i.dayOfWeek()!==k.weekStarts();)i=i.addDays(1);break;case"Month":i=(i=e.addMonths(1)).firstDayOfMonth();for(var s=DayPilot.Date.diff(i.d,e.d)/6e4%60==0;!s;)i=i.addHours(1),s=DayPilot.Date.diff(i.d,e.d)/6e4%60==0;break;case"Year":i=(i=e.addYears(1)).firstDayOfYear();for(s=DayPilot.Date.diff(i.d,e.d)/6e4%60==0;!s;)i=i.addHours(1),s=DayPilot.Date.diff(i.d,e.d)/6e4%60==0;break;case"None":i=a;break;case"Cell":var o=this.$9d(e);i=o.current?o.current.end:o.past?o.previous.end:o.next.start;break;default:throw"Invalid cellGroupBy value"}return i.getTime()>a.getTime()&&(i=a),i},this.$d6=function(e,t){var i=this.nav.timeHeader,n=this.timeHeader[t][e],a=t<this.timeHeader.length-1,s=t*k.headerHeight(),l=n.left,r=n.width,d=k.headerHeight(),h=document.createElement("div");if(h.style.position="absolute",h.style.top=s+"px",h.style.left=l+"px",h.style.width=r+"px",h.style.height=d+"px",n.toolTip&&(h.title=n.toolTip),h.setAttribute("unselectable","on"),h.style.KhtmlUserSelect="none",h.style.MozUserSelect="none",h.style.webkitUserSelect="none",h.oncontextmenu=function(){return!1},h.cell={},h.cell.start=n.start,h.cell.end=n.end,h.cell.level=t,h.cell.th=n,h.onclick=this.$bL,h.style.overflow="hidden",o.timeHeaderTextWrappingEnabled||(h.style.whiteSpace="nowrap"),!this.cssOnly){var c=t===this.timeHeader.length-1;h.style.textAlign="center",h.style.backgroundColor=void 0===h.backColor?o.hourNameBackColor:h.backColor,h.style.fontFamily=this.hourFontFamily,h.style.fontSize=this.hourFontSize,h.style.color=this.headerFontColor,h.style.cursor="default",h.style.border="0px none",c||(h.style.height=d-1+"px",h.style.borderBottom="1px solid "+this.borderColor),h.style.width=r-1+"px",h.style.borderRight="1px solid "+this.hourNameBorderColor,h.style.whiteSpace="nowrap",h.className=this.$8R("timeheadergroup")}var u=document.createElement("div");if(u.setAttribute("unselectable","on"),u.innerHTML=n.innerHTML,n.backColor&&(u.style.background=n.backColor),this.cssOnly){var f=this.$8R("_timeheadercol"),v=this.$8R("_timeheadercol_inner");a&&(f=this.$8R("_timeheadergroup"),v=this.$8R("_timeheadergroup_inner")),DayPilot.Util.addClass(h,f),DayPilot.Util.addClass(u,v)}h.appendChild(u),this.$86.timeHeader[e+"_"+t]=h,i.appendChild(h)},this.$9A=function(){for(var e=0;e<this.rowlist.length;e++){var t=this.rowlist[e],i=t.getHeight()+t.marginBottom+t.marginTop;t.height!==i&&(this.$9Q=!0),t.height=i}},this.$8p=function(){var e=this.divHeader;if(!e)return!1;for(var t=this.rowlist.length,i=(this.rowHeaderCols&&this.rowHeaderCols.length,0),n=0;n<t;n++){var a=this.rowlist[n];if(!a.hidden){var s=this.$bx?n:i;if(e.rows[s]){for(var l=0;l<e.rows[s].cells.length;l++){var r=e.rows[s].cells[l];this.$bx&&(r.style.top=a.top+"px");var d=a.height;r&&r.firstChild&&parseInt(r.firstChild.style.height,10)!==d&&(r.firstChild.style.height=d+"px")}i++}}}this.$bx&&o.nav.resScrollSpace&&(o.nav.resScrollSpace.style.top=o.$85+"px")},this.$cI=function(e){var t=this.separators[e];t.location=t.location||t.Location,t.color=t.color||t.Color,t.layer=t.layer||t.Layer,t.width=t.width||t.Width,t.opacity=t.opacity||t.Opacity;var i=new DayPilot.Date(t.location),n=t.color,a=t.width?t.width:1,s=!!t.layer&&"AboveEvents"===t.layer,l=t.opacity?t.opacity:100;if(!(i.getTime()<this.startDate.getTime()||i.getTime()>=this.startDate.addDays(this.days).getTime())){var r=this.getPixels(i);if(!r.cut&&!(r.left<0||r.left>this.$8S()*this.cellWidth)){var d=document.createElement("div");d.style.width=a+"px",d.style.height=o.$85+"px",d.style.position="absolute",d.style.left=r.left-1+"px",d.style.top="0px",d.style.backgroundColor=n,d.style.opacity=l/100,d.style.filter="alpha(opacity="+l+")",s?this.divSeparatorsAbove.appendChild(d):this.divSeparators.appendChild(d),this.elements.separators.push(d)}}},this.$cy=function(e){if("Disabled"===o.timeRangeDoubleClickHandling)return!1;if(i.timeRangeTimeout&&(clearTimeout(i.timeRangeTimeout),i.timeRangeTimeout=null),!o.coords){var t=o.$8G;o.coords=DayPilot.mo3(t,e)}if((e=e||window.event).stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,o.$d8(o.coords)){var n=o.$a2(i.rangeHold);o.$a7(n.start,n.end,n.resource)}else if(i.range=o.$d1(),i.range){i.rangeCalendar=o;n=o.$a2(i.range);o.$a7(n.start,n.end,n.resource)}i.rangeHold=i.range,i.range=null},this.$cu=function(e){if(!w.start&&!w.active){if(i.timeRangeTimeout,o.$cm(),o.$cr(),!o.coords){var t=o.$8G;o.coords=DayPilot.mo3(t,e)}if(i.rectangleSelect)return!1;e=e||window.event;var n=DayPilot.Util.mouseButton(e);if(n.middle||n.right&&o.$d8(o.coords))return!1;if("Disabled"===o.timeRangeSelectedHandling)return!1;var a=e.ctrlKey||e.metaKey;o.allowMultiRange&&!a&&D.clear();var s=e.shiftKey;if("Disabled"!==o.multiSelectRectangle&&s){var l={};return l.start=o.coords,l.calendar=o,i.rectangleSelect=l,!1}var r=o.$aD(o.coords.y).i;return!o.rowlist[r].isNewRow&&(i.range=o.$d1(),i.range.ctrl=a,i.rangeCalendar=o,!1)}},this.$d1=function(){var e={},t=this.$9b(o.coords.x).x;return e.start={y:o.$aD(o.coords.y).i,x:t},e.end={x:t},this.$aM(o.$aD(o.coords.y).i)?null:(e.calendar=o,o.$a5(e),e)},this.$d9=function(){o.$bf();var e=i.resizingShadow,t=i.resizing;!function(){var n=o.$da;if(!n||n.start.getTime()!==e.start.getTime()||n.end.getTime()!==e.end.getTime()){var a={};a.start=e.start,a.end=o.$9t(e.end),a.duration=new DayPilot.Duration(a.start,a.end),a.e=t.event,a.left={},a.left.html=a.start.toString(o.eventResizingStartEndFormat),a.left.enabled=o.eventResizingStartEndEnabled,a.right={},a.right.html=a.end.toString(o.eventResizingStartEndFormat),a.right.enabled=o.eventResizingStartEndEnabled,o.$da=a,"function"==typeof o.onEventResizing&&o.onEventResizing(a),o.$bn(i.resizingShadow,a)}}()},this.$cw=function(e){if(i.rectangleSelect)return(e=e||window.event).cancelBubble=!0,e.preventDefault&&e.preventDefault(),i.gMouseUp(e),!1},this.$cv=function(e){if(!w.active){i.activeCalendar=o,e=e||window.event;var t=DayPilot.mc(e);if(o.coords=DayPilot.mo3(o.$8G,e),e.insideMainD=!0,window.event&&(window.event.srcElement.inside=!0),b.start&&(b.originalMouse.x===t.x&&b.originalMouse.y===t.y||(DayPilot.Util.copyProps(b,i),document.body.style.cursor="move",b={})),i.resizing&&i.resizing.event.calendar===o){i.resizingShadow||(i.resizingShadow=o.$aL(i.resizing,o.shadow));var n,a,l=i.resizing.event.calendar.cellWidth,r=i.resizing.event.part.width,h=i.resizing.event.part.left,c=t.x-i.originalMouse.x;if("right"===i.resizing.dpBorder){if(n=h,o.snapToGrid){var u=o.$9b(r+h+c).cell,f=u.left+u.width;(a=f-h)<l&&(a=l)}else a=r+c;var v=o.$ct();h+a>v&&(a=v-h),i.resizingShadow.style.width=a+"px"}else if("left"===i.resizing.dpBorder){o.snapToGrid?(c>=r&&(c=r),(n=Math.floor((h+c+0)/l)*l)<0&&(n=0)):n=h+c,a=r-(n-h);var p=h+r,y=l;o.snapToGrid?"Never"===o.useEventBoxes&&(y=r<l?r:1):y=1,a<y&&(n=p-(a=y)),i.resizingShadow.style.left=n+"px",i.resizingShadow.style.width=a+"px"}!function(){var e=i.resizing.event,t=o.rowlist[e.part.dayIndex],s=(i.resizingShadow,n),l=a;o.$bj(i.resizingShadow,t,s,l,e.data)}(),o.$d9()}else if(i.moving&&(i.moving.event.calendar===o||i.moving.event.calendar.dragOutAllowed)){if(i.movingShadow&&i.movingShadow.calendar!==o&&(i.movingShadow.calendar=null,DayPilot.de(i.movingShadow),i.movingShadow=null),!i.movingShadow){var g=i.moving;i.movingShadow=o.$aL(g,o.shadow)}o.$bc(),i.moving.target=o,o.$be()}else if(i.range&&i.range.calendar===o){var m=i.range;m.end={x:o.$9b(o.coords.x).x},o.$a5(m)}else if(s.source){var D=s.source;d.drawShadow(D.coords,o.coords)}else i.rectangleSelect?$.draw():"Disabled"!==o.crosshairType&&o.$db();o.$dc();var k=e.insideEvent;if(window.event&&(k=window.event.srcElement.insideEvent),o.cellBubble&&o.coords&&o.rowlist&&o.rowlist.length>0&&!k){var C=Math.floor(o.coords.x/o.cellWidth);if(0<=(_=o.$aD(o.coords.y).i)&&_<o.rowlist.length&&0<=C&&C<o.itline.length){var x={};x.calendar=o,x.start=o.itline[C].start,x.end=o.itline[C].end,x.resource=o.rowlist[_].id,x.toJSON=function(){var e={};return e.start=this.start,e.end=this.end,e.resource=this.resource,e},o.cellBubble.showCell(x)}}if(i.drag){if(o.$cm(),i.gShadow&&document.body.removeChild(i.gShadow),i.gShadow=null,!i.movingShadow&&o.coords&&o.rowlist.length>0){if(!i.moving){i.moving={};var P=i.drag.event;if(!P){var S=o.itline[0].start;e={id:i.drag.id,start:S,end:S.addSeconds(i.drag.duration),text:i.drag.text};(P=new DayPilot.Event(e)).calendar=o,P.part.external=!0}i.moving.event=P}i.movingShadow=o.$aL(i.moving,i.drag.shadowType)}e.cancelBubble=!0}if("Always"===o.autoScroll||"Drag"===o.autoScroll&&(i.moving||i.resizing||i.range)){var T=o.nav.scroll,M={x:o.coords.x,y:o.coords.y};M.x-=T.scrollLeft,M.y-=T.scrollTop;var H=T.clientWidth,A=T.clientHeight,E=M.x<20,B=(p=H-M.x<20,M.y<20),R=A-M.y<20,_=(C=0,0);E&&(C=-5),p&&(C=5),B&&(_=-5),R&&(_=5),C||_?o.$dd(C,_):o.$cr()}}},this.$de={};var $=this.$de;$.start=function(){var e={};e.start=o.coords,e.calendar=o,i.rectangleSelect=e},$.draw=function(){var e=i.rectangleSelect,t=i.rectangleSelect.start,n=o.coords;$.clear();var a,s,r,d,h,c,u,f,v=e.x,p=e.y,y=e.width,g=e.height;if(h=Math.min(t.x,n.x),u=Math.max(t.x,n.x),"Free"===o.multiSelectRectangle?(c=Math.min(t.y,n.y),f=Math.max(t.y,n.y)):"Row"===o.multiSelectRectangle&&(c=t.y,f=t.y),"Free"===o.multiSelectRectangle)a=h,s=c,r=u-h,d=f-c;else{if("Row"!==o.multiSelectRectangle)throw"Invalid DayPilot.Scheduler.multiSelectRectangle value: "+o.multiSelectRectangle;var m=o.$aD(c).i,b=o.rowlist[m];s=b.top,d=b.height,a=o.$9b(h).cell.left;var w=o.$9b(u).cell;r=w.left+w.width-a}var D=DayPilot.Util.div(o.divRectangle,a,s,r,d);if(D.style.boxSizing="border-box",D.style.backgroundColor="#0000ff",D.style.border="1px solid #000033",D.style.opacity=.4,e.x=a,e.y=s,e.width=r,e.height=d,(e.x!==v||e.y!==p||e.width!==y||e.height!==g)&&"function"==typeof o.onRectangleEventSelecting){var k={};k.events=l.eventsInRectangle(e.x,e.y,e.width,e.height).map(function(e){return e.event}),o.onRectangleEventSelecting(k)}},$.clear=function(){o.divRectangle.innerHTML="",o.elements.rectangle=[]},this.$df=function(){var e,t;return o.coords&&o.rowlist&&o.rowlist.length>0&&o.itline&&o.itline.length>0?(e=o.$9b(o.coords.x).x,(t=o.$aD(o.coords.y).i)>=o.rowlist.length?void 0:o.cells.findXy(e,t)[0]):null},this.$dc=function(){var e=this.$df();if(this.hover.cell){if(this.hover.cell.x===e.x&&this.hover.cell.y===e.y)return;this.$cs()}if(this.hover.cell=e,"function"==typeof this.onCellMouseOver){var t={};t.cell=e,this.onCellMouseOver(t)}},this.$cs=function(){if(this.hover.cell){if("function"==typeof this.onCellMouseOut){var e={};e.cell=this.hover.cell,this.onCellMouseOut(e)}this.hover.cell=null}},this.hover={},this.$db=function(){var e=this.$df();this.hover.cell&&this.hover.cell.x===e.x&&this.hover.cell.y===e.y||this.$dg()},this.$cm=function(){if(this.divCrosshair.innerHTML="",this.$dh=null,this.$di=null,this.crosshairTop&&this.crosshairTop.parentNode&&(this.crosshairTop.parentNode.removeChild(this.crosshairTop),this.crosshairTop=null),this.crosshairLeft){for(var e=0;e<this.crosshairLeft.length;e++){var t=this.crosshairLeft[e];t.parentNode&&t.parentNode.removeChild(t)}this.crosshairLeft=null}this.$84=-1,this.$83=-1},this.$dg=function(){var e,t;if(o.coords&&o.rowlist&&o.rowlist.length>0&&(e=o.$9b(o.coords.x).x,!((t=o.$aD(o.coords.y).i)>=o.rowlist.length))){var i=this.crosshairType,n=o.rowlist[t];if("Full"===i){var a=this.itline[e],s=a.left;if(!(p=this.$dh))(p=document.createElement("div")).style.height=o.$85+"px",p.style.position="absolute",p.style.top="0px",p.style.backgroundColor=this.crosshairColor,p.style.opacity=this.crosshairOpacity/100,p.style.filter="alpha(opacity="+this.crosshairOpacity+")",this.$dh=p,this.divCrosshair.appendChild(p);p.style.left=s+"px",p.style.width=a.width+"px";var l=n.top,r=n.height,d=this.$ct();if(!(p=this.$di))(p=document.createElement("div")).style.width=d+"px",p.style.height=r+"px",p.style.position="absolute",p.style.top=l+"px",p.style.left="0px",p.style.backgroundColor=this.crosshairColor,p.style.opacity=this.crosshairOpacity/100,p.style.filter="alpha(opacity="+this.crosshairOpacity+")",this.$di=p,this.divCrosshair.appendChild(p);p.style.top=l+"px",p.style.height=r+"px"}var h=this.$dj(this.coords.x);if(h&&this.$84!==h.x){this.crosshairTop&&this.crosshairTop.parentNode&&(this.crosshairTop.parentNode.removeChild(this.crosshairTop),this.crosshairTop=null),(p=document.createElement("div")).style.width=h.cell.width+"px",p.style.height=k.headerHeight()+"px",p.style.left="0px",p.style.top="0px",p.style.position="absolute",p.style.backgroundColor=this.crosshairColor,p.style.opacity=this.crosshairOpacity/100,p.style.filter="alpha(opacity="+this.crosshairOpacity+")",this.crosshairTop=p;var c=this.divNorth,u=this.timeHeader?this.timeHeader.length-1:1;this.nav.timeHeader?this.$86.timeHeader[h.x+"_"+u].appendChild(p):c.firstChild.rows[u].cells[e]&&c.firstChild.rows[u].cells[e].firstChild.appendChild(p)}if(this.$83!==t){if(this.crosshairLeft){for(var f=0;f<this.crosshairLeft.length;f++){var v=this.crosshairLeft[f];v.parentNode&&v.parentNode.removeChild(v)}this.crosshairLeft=null}this.rowHeaderCols&&this.rowHeaderCols.length;if(this.crosshairLeft=[],this.divHeader.rows[t])for(f=0;f<this.divHeader.rows[t].cells.length;f++){var p;d=o.$8U();(p=document.createElement("div")).style.width=d+"px",p.style.height=n.height+"px",p.style.left="0px",p.style.top="0px",p.style.position="absolute",p.style.backgroundColor=this.crosshairColor,p.style.opacity=this.crosshairOpacity/100,p.style.filter="alpha(opacity="+this.crosshairOpacity+")",this.crosshairLeft.push(p),this.divHeader.rows[t].cells[f].firstChild.appendChild(p)}}h&&(this.$84=h.x),this.$83=t}},this.$dj=function(e){var t=DayPilot.list(this.timeHeader).last();if(!t)return null;for(var i=0;i<t.length;i++){var n=t[i];if(e>=n.left&&e<n.left+n.width){var a={};return a.cell=n,a.x=i,a}}return null},this.$cx=function(e){if(e=e||window.event,"Disabled"===o.timeRangeSelectedHandling)return!1;if(o.$d8(o.coords)||o.$dk(e),o.contextMenuSelection){var t=null;(t=o.$d8(o.coords)?o.$a2(i.rangeHold):o.$a2()).end=o.$9t(t.end),o.contextMenuSelection.show(t)}return e.cancelBubble=!0,!!o.allowDefaultContextMenu&&void 0},this.$d8=function(e){var t=i.rangeHold;if(!t||!t.start||!t.end)return!1;var n=this.$aS(t.start.y),a=t.start.x<t.end.x,s=(a?t.start.x:t.end.x)*this.cellWidth,o=(a?t.end.x:t.start.x)*this.cellWidth+this.cellWidth,l=n.top,r=n.bottom;return e.x>=s&&e.x<=o&&e.y>=l&&e.y<=r},this.$a5=function(e,t){(e=e||i.range)&&function(){var i=e.end.x>e.start.x?e.start.x:e.end.x,n=e.end.x>e.start.x?e.end.x:e.start.x,a=e.start.y,s=o.rowlist[a],l=o.itline[i],r=o.itline[n],d=o.$dl,h=l.start.addTime(s.data.offset),c=r.end.addTime(s.data.offset);if(!d||d.start.getTime()!==h.getTime()||d.end.getTime()!==c.getTime()||d.resource!==o.rowlist[a].id){var u={start:h,end:o.$9t(c)},f={};f.start=u.start,f.end=u.end,f.duration=new DayPilot.Duration(u.start,u.end),f.resource=o.rowlist[a].id,f.allowed=!0,f.left={},f.left.html=f.start.toString(o.timeRangeSelectingStartEndFormat),f.left.enabled=o.timeRangeSelectingStartEndEnabled,f.right={},f.right.html=f.end.toString(o.timeRangeSelectingStartEndFormat),f.right.enabled=o.timeRangeSelectingStartEndEnabled,o.$dl=f,"function"!=typeof o.onTimeRangeSelecting||t||o.onTimeRangeSelecting(f);var v=o.$dm(e);o.$a4(v,f.start,f.end);var p=function(e){var t=e.end.x>e.start.x?e.start.x:e.end.x,i=e.end.x>e.start.x?e.end.x:e.start.x,n=e.start.y,a=(o.rowlist[n],o.itline[t]),s=o.itline[i],l=a.left,r=s.left+s.width-l,d=o.elements.range2;if(!d){if((d=document.createElement("div")).style.position="absolute",d.setAttribute("unselectable","on"),o.cssOnly){d.className=o.$8R("_shadow");var h=document.createElement("div");h.className=o.$8R("_shadow_inner"),d.appendChild(h)}else d.style.backgroundColor=o.cellSelectColor;o.divRange.appendChild(d)}return d.style.left=a.left+"px",d.style.top=o.rowlist[n].top+"px",d.style.width=r+"px",d.style.height=o.rowlist[n].height-1+"px",o.elements.range2=d,function(){var e=o.rowlist[n],t=a.left;o.$bj(d,e,t,r,null)}(),d}(v);o.$bm(p,f),e.$d3=v,e.disabled=!f.allowed,o.$bn(p,f),f.start=u.start,f.end=u.end}}()},this.$dm=function(e){return{start:{x:e.start.x,y:e.start.y},end:{x:e.end.x},disabled:e.disabled}},this.range={},this.range.all=function(){return D.get()},this.$dn={};var D=this.$dn;this.$dn.list=[],this.$dn.clear=function(){DayPilot.de(DayPilot.list(D.list).map(function(e){return e.div})),D.list=[]},this.$dn.add=function(e){e.div=o.elements.range2,o.elements.range2=null,o.$bo(),D.list.push(e)},this.$dn.get=function(){return DayPilot.list(D.list).map(function(e){return o.$a2(e)})},this.$dn.dispatch=function(){if(o.allowMultiRange&&!i.range){var e=DayPilot.list(D.list).last();o.$a1(e)}},this.$dk=function(e){if("Disabled"===o.timeRangeSelectedHandling)return!1;if(!w.active&&!w.start){e=e||window.event;var t=DayPilot.Util.mouseButton(e);if(!i.range&&!i.rectangleSelect&&!(i.rangeHold&&o.$d8(o.coords)&&(t.right||t.middle)||o.$aM(o.$aD(o.coords.y).i))){var n={},a=o.$9b(o.coords.x).x;n.start={y:o.$aD(o.coords.y).i,x:a},n.end={x:a},o.$a5(n),o.$a1(n),i.rangeHold=n}}},this.timeouts={},this.timeouts.drawEvents=null,this.timeouts.drawCells=null,this.timeouts.click=null,this.$8E=function(e){if(o.$8d(),o.dynamicLoading)o.$do();else{var t=o.nav.scroll;if(o.$cF=t.scrollLeft,o.$cG=t.scrollTop,o.$cH=t.clientWidth,o.divTimeScroll.scrollLeft=o.$cF,o.divResScroll.scrollTop=o.$cG,o.$ar(),o.timeouts.drawEvents&&(clearTimeout(o.timeouts.drawEvents),o.timeouts.drawEvents=null),o.scrollDelayEvents>0)o.timeouts.drawEvents=setTimeout(o.$dp(),o.scrollDelayEvents);else o.$dp()();if(o.timeouts.drawCells&&(clearTimeout(o.timeouts.drawCells),o.timeouts.drawCells=null),o.scrollDelayCells>0)o.timeouts.drawCells=setTimeout(o.$dq(),o.scrollDelayCells);else o.$dq()();o.timeouts.updateFloats&&(clearTimeout(o.timeouts.updateFloats),o.timeouts.updateFloats=null),o.scrollDelayFloats>0?o.timeouts.updateFloats=setTimeout(function(){o.$8C()},o.scrollDelayFloats):o.$8C(),o.onScrollCalled=!0}},this.$dq=function(){return function(){o.$8B(),o.$8w(),o.$89()}},this.$dp=function(){var e=o.dynamicEventRenderingCacheSweeping,t=o.dynamicEventRenderingCacheSize;return function(){o.$cQ()?(o.$ar(),window.setTimeout(function(){e&&o.$cN(t),window.setTimeout(function(){o.$8y(!0)},50)},50)):o.$8N()}},this.$8d=function(){this.$86.eventHeight=null,this.$86.drawArea=null},this.show=function(){this.visible=!0,o.nav.top.style.display="",this.$8n(),this.$8o(),o.$8E()},this.hide=function(){this.visible=!1,o.nav.top.style.display="none"},this.$do=function(){var e=o.nav.scroll;o.$cF=e.scrollLeft,o.$cG=e.scrollTop,o.$cH=e.clientWidth,o.divTimeScroll.scrollLeft=o.$cF,o.divResScroll.scrollTop=o.$cG,o.refreshTimeout&&window.clearTimeout(o.refreshTimeout);var t=o.scrollDelayDynamic;o.refreshTimeout=window.setTimeout(o.$dr(e.scrollLeft,e.scrollTop),t),o.$8C()},this.$ds=function(e){for(var t=e.id,i=new DayPilot.Date(e.start).toString(),n=0;n<this.events.list.length;n++){var a=this.events.list[n];if(a.id===t){if(DayPilot.Util.isNullOrUndefined(t)&&!DayPilot.Util.isNullOrUndefined(e.recurrentMasterId)){var s=new DayPilot.Date(a.start).toString();if(a.recurrentMasterId!==e.recurrentMasterId||i!==s)continue}var l={};return l.ex=a,l.index=n,l.modified=!o.$dt(e,a),l}}return null},this.$dt=function(e,t){for(var i in e)if("object"!=typeof e[i]&&e[i]!==t[i])return!1;for(var i in t)if("object"!=typeof t[i]&&e[i]!==t[i])return!1;return!0},this.$8z=function(e,t){for(var i=[],n=0;n<e.length;n++){var a=e[n],s=o.$ds(a),l=s&&s.modified,r=!s;if(l){this.events.list[s.index]=a;var d=o.events.$9x(s.ex);i=i.concat(d)}else r&&this.events.list.push(a);(l||r)&&(i=i.concat(o.events.$9y(a)))}o.$9z(i),o.$9A(),o.$8m(),o.$8r();o.$8s(),o.$8p(),o.$8w(),o.$9T(),o.$dp()()},this.$dr=function(e,t){return o.$92()?function(){o.scrollX=e,o.scrollY=t,o.$9h("Scroll")}:function(){if("function"==typeof o.onScroll){var i=function(e){o.$8z(e,function(){if(o.$8F()&&"function"==typeof o.onAfterRender){var e={isCallBack:!1,isScroll:!0,data:null};o.onAfterRender(e)}})},n=o.$ax(e,t),a=o.$ay(n),s=o.$az(n),l={viewport:{}};l.viewport.start=a.start,l.viewport.end=a.end,l.viewport.resources=s,l.async=!1,l.events=[],l.loaded=function(){this.async&&i(this.events)},o.onScroll(l),l.async||i(l.events)}}},this.$du=function(){var e=this.$8K(),t=e.xStart,i=e.xEnd-e.xStart,n=e.yStart,a=e.yEnd-e.yStart;this.cellProperties||(this.cellProperties={});for(var s=0;s<=i;s++){for(var o=t+s,l=0;l<a;l++){var r=n+l;this.rowlist[r].hidden||this.$b3(o,r)}this.$dv(o)}var d=this.$br();for(r=d.start;r<d.end;r++)this.rowlist[r].hidden||this.$dw(r)},this.$8w=function(){if(o.progressiveRowRendering&&this.$bB(),null!==this.rowlist&&this.rowlist.length>0){if(this.cellSweeping){var e=this.cellSweepingCacheSize;this.$cP(e)}this.$du(),this.$dx(),y.$bU()}var t=this.$ct();this.$8G.style.height=this.$85+"px",this.$8G.style.width=t+"px","Auto"===o.cellWidthSpec?(o.nav.scroll.style.overflowX="hidden",o.nav.scroll.scrollLeft=0):o.nav.scroll.style.overflowX="auto",this.$9Q=!1},this.$dx=function(){for(var e=this.$8K(),t=e.xStart;t<e.xEnd;t++){t<this.itline.length-1&&this.itline[t+1].breakBefore&&this.$dy(t)}},this.$dy=function(e){var t="x"+e;if(!this.$86.breaks[t]){var i=this.itline[e+1].left-1,n=this.$85,a=document.createElement("div");a.style.left=i+"px",a.style.top="0px",a.style.width="1px",a.style.height=n+"px",a.style.fontSize="1px",a.style.lineHeight="1px",a.style.overflow="hidden",a.style.position="absolute",a.setAttribute("unselectable","on"),this.cssOnly?a.className=this.$8R("_matrix_vertical_break"):a.style.backgroundColor=this.timeBreakColor,this.divBreaks.appendChild(a),this.elements.breaks.push(a),this.$86.breaks[t]=a}},this.$8K=function(){if(o.$86.drawArea)return o.$86.drawArea;if(!this.nav.scroll)return null;var e=o.$cG,t={},i=this.dynamicEventRenderingMargin,n=(i=null!=this.dynamicEventRenderingMarginX?this.dynamicEventRenderingMarginX:this.dynamicEventRenderingMargin,null!=this.dynamicEventRenderingMarginY?this.dynamicEventRenderingMarginY:this.dynamicEventRenderingMargin),a=o.$cF-i,s=a+o.$cH+2*i,l=0,r=0;if(o.itline&&o.itline.length>0){l=o.$9b(a).x,r=o.$9b(s,!0).x;var d=this.$8S();r=Math.min(r,d),l=Math.max(l,0)}var h=e-n,c=e+this.nav.scroll.offsetHeight+2*n,u=this.$aD(h).i,f=this.$aD(c).i;return f<this.rowlist.length&&f++,t.xStart=l,t.xEnd=r,t.yStart=u,t.yEnd=f,t.pixels={},t.pixels.left=this.nav.scroll.scrollLeft,t.pixels.right=this.nav.scroll.scrollLeft+this.nav.scroll.clientWidth,t.pixels.top=this.nav.scroll.scrollTop,t.pixels.bottom=this.nav.scroll.scrollTop+this.nav.scroll.clientHeight,t.pixels.width=this.nav.scroll.scrollWidth,o.$86.drawArea=t,t},this.$ct=function(){var e=0;if("Days"===this.viewType)e=1440/this.cellDuration*this.cellWidth;else{var t=this.itline[this.itline.length-1];e=t?t.left+t.width:0}return(e<0||isNaN(e))&&(e=0),e},this.$dw=function(e){var t="y"+e;if(!this.$86.linesHorizontal[t]){var i=this.rowlist[e].top+this.rowlist[e].height-1,n=this.$ct(),a=document.createElement("div");a.style.left="0px",a.style.top=i+"px",a.style.width=n+"px",a.style.height="1px",a.style.fontSize="1px",a.style.lineHeight="1px",a.style.overflow="hidden",a.style.position="absolute",this.cssOnly||(a.style.backgroundColor=this.cellBorderColor),a.setAttribute("unselectable","on"),this.cssOnly&&(a.className=this.$8R("_matrix_horizontal_line")),this.divLines.appendChild(a),this.$86.linesHorizontal[t]=a}},this.$dv=function(e){var t=this.itline[e];if(t){var i="x"+e;if(!this.$86.linesVertical[i]){var n=t.left+t.width-1,a=document.createElement("div");a.style.left=n+"px",a.style.top="0px",a.style.width="1px",a.style.height=o.$85+"px",a.style.fontSize="1px",a.style.lineHeight="1px",a.style.overflow="hidden",a.style.position="absolute",this.cssOnly||(a.style.backgroundColor=this.cellBorderColor),a.setAttribute("unselectable","on"),this.cssOnly&&(a.className=this.$8R("_matrix_vertical_line")),this.divLines.appendChild(a),this.elements.linesVertical.push(a),this.$86.linesVertical[i]=a}}},this.$bd=function(e){var t=this.rowlist[e],i=!t.expanded;t.expanded=i,t.resource&&(t.resource.expanded=i);var n=this.$dz(e,t.expanded);if(!i)for(var a=0;a<n.length;a++){var s=n[a];this.$9R(s)}if(this.$8m(),this.$8k(),this.$8r(),this.$8d(),i){for(a=0;a<n.length;a++){s=n[a];this.$9S(s)}this.$8N()}this.$9T(),d.load(),this.$8s(),this.$8w(),this.$8B();var o=this.$af(t,e);i?this.$am(o):this.$al(o),this.$8d()},this.$bK=function(e){var t={};if(t.index=e,"function"==typeof this.onLoadNode){var i={},n=this.rowlist[e].resource;i.resource=n,i.async=!1,i.loaded=function(){this.async&&(n.dynamicChildren=!1,n.expanded=!0,o.update())},this.onLoadNode(i),i.async||(n.dynamicChildren=!1,n.expanded=!0,this.update())}else this.$9h("LoadNode",t)},this.$dz=function(e,t){var i=this.rowlist[e],n=[];if(null===i.children||0===i.children.length)return n;for(var a=0;a<i.children.length;a++){var s=i.children[a];this.rowlist[s].hidden=!t||!i.expanded,t===!this.rowlist[s].hidden&&n.push(s);var o=this.$dz(s,t);o.length>0&&(n=n.concat(o))}return n},this.$dd=function(e,t){this.$cr(),this.$dA(e,t)},this.$dB=function(e){if(!e)return!1;var t=this.nav.scroll.scrollWidth,i=this.nav.scroll.scrollLeft,n=i+this.nav.scroll.clientWidth;return!(e<0&&i<=0)&&(!(e>0&&n>=t)&&(this.nav.scroll.scrollLeft+=e,!0))},this.$dC=function(e){if(!e)return!1;var t=this.nav.scroll.scrollHeight,i=this.nav.scroll.scrollTop,n=i+this.nav.scroll.clientHeight;return!(e<0&&i<=0)&&(!(e>0&&n>=t)&&(this.nav.scroll.scrollTop+=e,!0))},this.$dA=function(e,t){if(this.$dB(e)||this.$dC(t)){this.scrolling=window.setTimeout(function(e,t){return function(){o.$dA(e,t)}}(e,t),100)}},this.$cr=function(){this.scrolling&&(window.clearTimeout(this.scrolling),this.scrolling=null)},this.$8m=function(){for(var e=0,t=0;t<this.rowlist.length;t++){var i=this.rowlist[t];i.hidden||(i.top=e,e+=i.height)}this.$85=e},this.$8s=function(){this.elements.cells=[],this.elements.linesVertical=[],this.elements.breaks=[],this.$86.cells=[],this.$86.linesVertical={},this.$86.linesHorizontal={},this.$86.breaks=[],this.divCells.innerHTML="",this.divLines.innerHTML="",this.divBreaks.innerHTML=""},this.$9U=function(e){var t=DayPilot.list();for(var i in o.$86.cells)t.push(o.$86.cells[i]);t.filter(function(t){return t&&t.coords&&t.coords.y===e}).each(function(e){o.$b2(e)})},this.$dD=0,this.$dE=["html","cssClass","backColor","backImage","backRepeat","business"],this.$b3=function(e,t){if(this.$aV){var i=this.itline[e];if(i){var n=e+"_"+t;if(!this.$86.cells[n]){var a=this.$b4(e,t);if("function"==typeof this.onBeforeCellRender){var s=o.rowlist[t],l=(s.id,s.start.getTime()-this.$97().getTime()),r=(i.start.addTime(l),i.end.addTime(l),o.cells.findXy(e,t)[0]),d={};d.cell=r,d.getPixels=function(e){e=new DayPilot.Date(e);return o.getPixels(e).left-i.left},this.onBeforeCellRender(d),DayPilot.Util.copyProps(d.cell,d.cell.properties,o.$dE)}if(!this.drawBlankCells){var h=!1;if(this.cssOnly&&this.$ba(t)?h=!1:this.$dF(a,o.$dE)||(h=!0),h)return}(r=document.createElement("div")).style.left=i.left+"px",r.style.top=this.rowlist[t].top+"px",r.style.width=i.width+"px",r.style.height=this.rowlist[t].height+"px",r.style.position="absolute",a&&a.backColor&&(r.style.backgroundColor=a.backColor),r.setAttribute("unselectable","on"),r.className=this.cssOnly?this.$8R("_cell"):this.$8R("cellbackground"),r.coords={},r.coords.x=e,r.coords.y=t,this.cssOnly&&this.$ba(t)&&DayPilot.Util.addClass(r,this.$8R("_cellparent")),a&&(a.cssClass&&(this.cssOnly?DayPilot.Util.addClass(r,a.cssClass):DayPilot.Util.addClass(r,o.$8R(a.cssClass))),a.html&&(r.innerHTML=a.html),a.backImage&&(r.style.backgroundImage='url("'+a.backImage+'")'),a.backRepeat&&(r.style.backgroundRepeat=a.backRepeat),a.business&&DayPilot.Util.addClass(r,o.$8R("_cell_business"))),r.onclick=this.$dk,r.onmouseup=this.$cw,this.divCells.appendChild(r),this.elements.cells.push(r),this.$86.cells[n]=r}}}},this.$dF=function(e,t){if(t){for(var i=0;i<t.length;i++)if(e[t[i]])return!0}else for(var n in e)if(e[n])return!0;return!1},this.clearSelection=function(){this.$8A(),D.clear()},this.cleanSelection=this.clearSelection,this.$8A=function(){this.divRange.innerHTML='<div style="position:absolute; left:0px; top:0px; width:0px; height:0px;"></div>',this.elements.range=[],this.elements.range2=null,this.$bo(),i.rangeHold=null},this.$aK={};var k=this.$aK;k.locale=function(){return DayPilot.Locale.find(o.locale)},k.timeFormat=function(){return"Auto"!==o.timeFormat?o.timeFormat:k.locale().timeFormat},k.weekStarts=function(){if("Auto"===o.weekStarts){var e=k.locale();return e?e.weekStarts:0}return o.weekStarts},k.rounded=function(){return"Rounded"===o.eventCorners},k.layout=function(){var e=/MSIE 6/i.test(navigator.userAgent);return"Auto"===o.layout?e?"TableBased":"DivBased":o.layout},k.notifyType=function(){var e;if("Immediate"===o.notifyCommit)e="Notify";else{if("Queue"!==o.notifyCommit)throw"Invalid notifyCommit value: "+o.notifyCommit;e="Queue"}return e},k.isResourcesView=function(){return"Days"!==o.viewType},k.useBox=function(e){return"Always"===o.useEventBoxes||"Never"!==o.useEventBoxes&&e<60*o.cellDuration*1e3},k.eventHeight=function(){if(o.$86.eventHeight)return o.$86.eventHeight;var e=o.$cB("_event_height").height;return e||(e=o.eventHeight),o.$86.eventHeight=e,e},k.headerHeight=function(){if(o.$86.headerHeight)return o.$86.headerHeight;var e=o.$cB("_header_height").height;return e||(e=o.headerHeight),o.$86.headerHeight=e,e},k.splitterWidth=function(){return o.rowHeaderScrolling?o.rowHeaderSplitterWidth:1},this.$dG=function(e,t){var i=e+"_"+t;return this.cellProperties&&this.cellProperties[i]?this.cellProperties[i].backColor:null},this.$b4=function(e,t){var i=e+"_"+t;if(this.cellProperties||(this.cellProperties={}),this.cellProperties[i])return this.cellProperties[i];if(this.$81&&(this.cellProperties[i]=o.$dH(e,t)),!this.cellProperties[i]){var n=o.rowlist[t],a=n.id,s=n.start.getTime()-o.$97().getTime(),l=o.itline[e],r=l.start.addTime(s),d=l.end.addTime(s),h={};h.start=r,h.end=d,h.resource=a;var c={};c.business=o.isBusiness(h),this.cssOnly||(c.backColor=c.business?this.cellBackColor:this.cellBackColorNonBusiness),this.cellProperties[i]=c}return this.cellProperties[i]},this.$dI=function(e,t,i){var n=t+"_"+i;return this.cellProperties[n]={},DayPilot.Util.copyProps(e,this.cellProperties[n],o.$dE),this.cellProperties[n]},this.$dH=function(e,t){if(!this.cellConfig)return null;var i=this.cellConfig,n=this.cellProperties[e+"_"+t];!n&&i.vertical&&(n=this.cellProperties[e+"_0"]),!n&&i.horizontal&&(n=this.cellProperties["0_"+t]),!n&&i.default&&(n=i.default);var a={};return DayPilot.Util.copyProps(n,a,o.$dE),a},this.$8i=function(){if(!this.$81&&this.cellConfig){var e=this.cellConfig;if(e.vertical)for(var t=0;t<e.x;t++){if(n=this.cellProperties[t+"_0"])for(var i=1;i<e.y;i++)this.$dI(n,t,i)}if(e.horizontal)for(i=0;i<e.y;i++){if(n=this.cellProperties["0_"+i])for(t=1;t<e.x;t++)this.$dI(n,t,i)}if(e.default){var n=e.default;for(i=0;i<e.y;i++)for(t=0;t<e.x;t++)this.cellProperties[t+"_"+i]||this.$dI(n,t,i)}}},this.isBusiness=function(e){var t=e.start,i=(e.end.getTime()-t.getTime())/6e4;if(i<=1440&&(0===e.start.dayOfWeek()||6===e.start.dayOfWeek()))return!1;if(i<720){var n=t.d.getUTCHours();if(n+=t.d.getUTCMinutes()/60,n+=t.d.getUTCSeconds()/3600,(n+=t.d.getUTCMilliseconds()/36e5)<this.businessBeginsHour)return!1;if(this.businessEndsHour>=24)return!0;if(n>=this.businessEndsHour)return!1}return!0},this.$8n=function(){"hidden"===this.nav.top.style.visibility&&(this.nav.top.style.visibility="visible")},this.$bu=function(){var e=o.nav.top;return e.offsetWidth>0&&e.offsetHeight>0},this.$dJ=function(){var e=o.$bu;e()||(o.debug.message("Not visible during init, starting visibilityInterval"),o.$dK=setInterval(function(){e()&&(o.debug.message("Made visible, calling .show()"),o.show(),o.$bt(),clearInterval(o.$dK))},100))},this.$dL=function(e){"Parent100Pct"!==this.heightSpec&&(this.heightSpec="Fixed"),this.height=e-(this.$8T()+2),this.$8r()},this.setHeight=this.$dL,this.$8I=function(e){for(var t=0;t<this.rowlist.length;t++)if(this.rowlist[t].id===e)return this.rowlist[t];return null},this.$cd=function(){if(this.id&&this.id.tagName)this.nav.top=this.id;else{if("string"!=typeof this.id)throw"DayPilot.Scheduler() constructor requires the target element or its ID as a parameter";if(this.nav.top=document.getElementById(this.id),!this.nav.top)throw"DayPilot.Scheduler: The placeholder element not found: '"+e+"'."}},this.$dM=function(){this.$cA(),this.$8h(),this.$8o(),this.$cD(),this.$aH(),i.register(this),this.$8b(this.afterRenderData,!1),this.$cE(),this.$dJ(),this.$8a(),this.$9h("Init")},this.init=function(){this.$dN()},this.$dN=function(){if(this.$cd(),!this.nav.top.dp){if(this.$cc(),this.$aT())return this.$dM(),this.$aV=!0,void this.$8d();this.$cD(),this.$aH(),i.register(this),this.$cE(),this.$9E(),o.scrollToDate?o.scrollTo(o.scrollToDate):o.setScroll(o.scrollX,o.scrollY);window.setTimeout(function(){o.scrollY&&o.setScroll(o.scrollX,o.scrollY)},200),this.messageHTML&&window.setTimeout(function(){o.message(o.messageHTML)},100),this.$dJ(),this.$8a(),this.$aV=!0,this.$8d(),this.$8b(this.afterRenderData,!1),this.debug.message("Init complete."),this.$dO()}},this.$dP=function(){if(this.$cd(),!this.nav.top.dp){if(this.$aT())return this.$dM(),this.$aV=!0,void this.$8d();this.$cA(),this.$cc(),this.$ar(),this.$8h(),this.$8j(),this.$8m(),this.$8k(),this.$8g(),this.$8i(),this.$8l(),this.$8r(),this.$8x(),this.$8D(this.selectedRows),this.$cD(),this.$aH(),i.register(this),this.$cE(),this.$89(),o.scrollToDate?o.scrollTo(o.scrollToDate):o.setScroll(o.scrollX,o.scrollY),o.onScrollCalled||o.$8E();var e;if(window.setTimeout(function(){o.scrollY&&o.setScroll(o.scrollX,o.scrollY)},200),this.messageHTML){window.setTimeout((e=this.messageHTML,function(){o.message(e)}),100)}this.$dJ(),this.$8a(),this.$aV=!0,this.$8d(),this.$8b(this.afterRenderData,!1),this.debug.message("Init complete."),this.$dO()}},this.$dQ=function(){if(this.$cd(),!this.nav.top.dp){if(this.$aT())return this.$dM(),this.$aV=!0,void this.$8d();this.$cA(),this.$8g(),this.$8h(),this.$8i(),this.$cc(),this.$8f(),this.$8l(),this.$ar(),this.$8j(),this.$8m(),this.$8k(),this.$8r(),this.$8x(),this.$8D(this.selectedRows),this.$8o(),this.$cD(),this.$aH(),i.register(this),this.$cE(),this.$89(),o.scrollToDate?o.scrollTo(o.scrollToDate):o.setScroll(o.scrollX,o.scrollY),o.onScrollCalled||o.$8E();var e;if(window.setTimeout(function(){o.scrollY&&o.setScroll(o.scrollX,o.scrollY)},200),this.messageHTML){window.setTimeout((e=this.messageHTML,function(){o.message(e)}),100)}this.$dJ(),this.$8a(),this.$aV=!0,this.$8d(),this.$8b(this.afterRenderData,!1),this.debug.message("Init complete."),this.$dO()}},this.$dR=null,this.$dS=function(e){var t={events:{preInit:function(){var e=this.data;e&&(DayPilot.isArray(e.list)?o.events.list=e.list:o.events.list=e)},postInit:function(){}},scrollTo:{preInit:function(){},postInit:function(){this.data&&o.scrollTo(this.data)}}};for(var i in this.$dR=t,e)if(t[i]){var n=t[i];n.data=e[i],n.preInit&&n.preInit()}else o[i]=e[i]},this.$dO=function(){var e=this.$dR;for(var t in e){var i=e[t];i.postInit&&i.postInit()}},this.temp={},this.temp.getPosition=function(){var e=Math.floor(o.coords.x/o.cellWidth),t=o.$aD(o.coords.y).i;if(t<o.rowlist.length){var i={};return i.start=o.itline[e].start,i.end=o.itline[e].end,i.resource=o.rowlist[t].id,i}return null},this.internal={},this.internal.initialized=function(){return o.$aV},this.internal.invokeEvent=this.$9r,this.internal.eventMenuClick=this.$a0,this.internal.timeRangeMenuClick=this.$a8,this.internal.resourceHeaderMenuClick=this.$aa,this.internal.linkMenuClick=this.$a9,this.internal.bubbleCallBack=this.$9Y,this.internal.findEventDiv=this.$aR,this.internal.rowtools=this.$aj,this.internal.getNodeChildren=this.$aF,this.internal.callback=function(){o.$9h.apply(o,arguments)},this.internal.createRowObject=this.$af,this.internal.adjustEndIn=o.$9V,this.internal.adjustEndNormalize=o.$9W,this.Init=this.init,this.$dS(a)},DayPilot.Row=function(e,t){if(!e)throw"Now row object supplied when creating DayPilot.Row";if(!t)throw"No parent control supplied when creating DayPilot.Row";var i=DayPilot.indexOf(t.rowlist,e),n=this;n.isRow=!0,n.menuType="resource",n.start=e.start,n.name=e.name,n.value=e.id,n.id=e.id,n.tags=e.tags,n.index=i,n.calendar=t,n.$dT=e,n.$={},n.$.row=e,n.toJSON=function(e){var t={};return t.start=this.start,t.name=this.name,t.value=this.value,t.id=this.id,t.index=this.index,t},n.events={},n.events.all=function(){for(var e=[],t=0;t<n.$dT.events.length;t++)e.push(n.$dT.events[t]);return DayPilot.list(e)},n.events.totalDuration=function(){var e=0;return n.events.all().each(function(t){e+=t.part.end.getTime()-t.part.start.getTime()}),new DayPilot.Duration(e)},n.groups={},n.groups.collapseAll=function(){for(var e=0;e<n.$dT.blocks.length;e++){var i=n.$dT.blocks[e];new a(i).$dU()}t.$9A(),t.$9B(n.index),t.$8r()},n.groups.expandAll=function(){for(var e=0;e<n.$dT.blocks.length;e++){var i=n.$dT.blocks[e];new a(i).$dV()}t.$9A(),t.$9B(n.index),t.$8r()},n.groups.expanded=function(){for(var e=[],i=0;i<n.$dT.blocks.length;i++){var s=n.$dT.blocks[i];s.expanded&&s.lines.length>t.groupConcurrentEventsLimit&&e.push(new a(s))}return DayPilot.list(e)},n.groups.collapsed=function(){for(var e=[],t=0;t<n.$dT.blocks.length;t++){var i=n.$dT.blocks[t];i.expanded||e.push(new a(i))}return DayPilot.list(e)},n.groups.all=function(){for(var e=[],t=0;t<n.$dT.blocks.length;t++){var i=n.$dT.blocks[t];e.push(new a(i))}return DayPilot.list(e)},n.events.collapseGroups=n.groups.collapseAll,n.events.expandGroups=n.groups.expandAll,n.column=function(e){return new s(n,e)},n.toggle=function(){t.$bd(n.index)};var a=function(e){this.$dV=function(){e.expanded=!0;var i=function(e){for(var i=0;i<t.elements.events.length;i++){var n=t.elements.events[i];if(n.event===e)return n}return null}(e);if(i){t.$cM(i);var n=DayPilot.indexOf(t.elements.events,i);-1!==n&&t.elements.events.splice(n,1)}},this.expand=function(){this.$dV(),t.$9A(),t.$9B(e.row.index),t.$8r()},this.$dU=function(){e.lines.length>t.groupConcurrentEventsLimit&&(e.expanded=!1)},this.collapse=function(){this.$dU(),t.$9A(),t.$9B(e.row.index),t.$8r()}},s=function(e,t){this.html=function(i){var n=e.calendar.divHeader.rows[e.index].cells[t].textDiv;if(void 0===i)return n.innerHTML;n.innerHTML=i}}},i.moving=null,i.originalMouse=null,i.resizing=null,i.globalHandlers=!1,i.timeRangeTimeout=null,i.selectedCells=null,i.dragStart=function(e,t,n,a,s){DayPilot.us(e);var o=i.drag={};return o.element=e,o.duration=t,o.text=a,o.id=n,o.shadowType=s||"Fill",!1},DayPilot.Scheduler.makeDraggable=function(e){var t=e.element,n=e.keepElement?null:t;DayPilot.us(t),DayPilot.re(t,"mousedown",function(t){i.dragStart(n,e.duration,e.id,e.text);var a=t.target||t.srcElement;if(a.tagName){var s=a.tagName.toLowerCase();if("textarea"===s||"select"===s||"input"===s)return!1}return t.preventDefault&&t.preventDefault(),!1}),t.ontouchstart=function(t){window.setTimeout(function(){var a=i.drag={};a.element=n,a.id=e.id,a.text=e.text||"",a.duration=e.duration||60,a.shadowType="Fill",i.gTouchMove(t),t.preventDefault()},0),t.preventDefault()}},i.dragStop=function(){i.gShadow&&(document.body.removeChild(i.gShadow),i.gShadow=null),i.drag=null},i.register=function(e){i.registered||(i.registered=[]);for(var t=0;t<i.registered.length;t++)if(i.registered[t]===e)return;i.registered.push(e)},i.unregister=function(e){var t=i.registered;if(t){var n=DayPilot.indexOf(t,e);-1!==n&&t.splice(n,1),0===t.length&&(t=null)}t||(DayPilot.ue(document,"mousemove",i.gMouseMove),DayPilot.ue(document,"mouseup",i.gMouseUp),DayPilot.ue(document,"keyup",i.gKeyUp),DayPilot.ue(document,"touchmove",i.gTouchMove),DayPilot.ue(document,"touchend",i.gTouchEnd),i.globalHandlers=!1)},i.gTouchMove=function(e){if(i.drag){e.preventDefault();var t=e.touches[0].pageX,n=e.touches[0].pageY,a={};a.x=t,a.y=n;var s=function(){for(var t=e.touches[0].clientX,i=e.touches[0].clientY,n=document.elementFromPoint(t,i);n&&n.parentNode;)if((n=n.parentNode).daypilotMainD)return n.calendar;return!1}();if(s){if(i.gShadow&&document.body.removeChild(i.gShadow),i.gShadow=null,s.coords=s.$d0.relativeCoords(e),!i.movingShadow&&s.rowlist.length>0){if(!i.moving){i.moving={};var o=i.drag.event;if(!o){var l=s.itline[0].start;e={id:i.drag.id,start:l,end:l.addSeconds(i.drag.duration),text:i.drag.text};(o=new DayPilot.Event(e)).calendar=s,o.part.external=!0}i.moving.event=o}i.movingShadow=s.$aL(i.moving,i.drag.shadowType)}i.moving&&s.$d0.updateMoving()}else{DayPilot.de(i.movingShadow);var r=i.moving;i.moving=null,i.movingShadow=null,i.gShadow||(i.gShadow=i.createGShadow(i.drag.shadowType),i.gShadow.source=r);var d=i.gShadow;d.style.left=a.x+"px",d.style.top=a.y+"px"}}},i.gTouchEnd=function(e){i.gMouseUp(e)},i.gMouseMove=function(e){if(void 0!==i&&!((e=e||window.event).insideMainD||e.srcElement&&e.srcElement.inside)){var t=DayPilot.mc(e);if(i.drag){if(document.body.style.cursor="move",i.gShadow||(i.gShadow=i.createGShadow(i.drag.shadowType)),(n=i.gShadow).style.left=t.x+"px",n.style.top=t.y+"px",i.moving=null,i.movingShadow)(a=i.movingShadow.calendar).$bo(),i.movingShadow.calendar=null,DayPilot.de(i.movingShadow),i.movingShadow=null}else if(i.moving&&i.moving.event.calendar.dragOutAllowed&&!i.drag){var n,a=i.moving.event.calendar;e=i.moving.event;i.moving.target=null,document.body.style.cursor="move",i.gShadow||(i.gShadow=i.createGShadow(a.shadow),i.gShadow.source=i.moving),(n=i.gShadow).style.left=t.x+"px",n.style.top=t.y+"px",i.drag={};var s=i.drag;s.element=null,s.duration=(e.rawend().getTime()-e.start().getTime())/1e3,s.text=e.text(),s.id=e.value(),s.shadowType=a.shadow,s.event=e,a.$bo(),DayPilot.de(i.movingShadow),i.movingShadow.calendar=null,i.movingShadow=null}for(var o=0;o<i.registered.length;o++)i.registered[o].$by&&i.registered[o].$by()}},i.gUnload=function(e){if(i.registered)for(var t=0;t<i.registered.length;t++){var n=i.registered[t];i.unregister(n)}},i.gMouseDown=function(e){i.editing&&i.editing.blur()},i.gKeyUp=function(e){17===(e=e||window.event).keyCode&&(i.rangeCalendar&&i.rangeCalendar.$dn.dispatch())},i.gMouseUp=function(e){if(i.resizing){if(!i.resizingShadow)return document.body.style.cursor="",void(i.resizing=null);var t=i.resizing.event;(p=t.calendar).$bf();var a=i.resizingShadow.start,o=i.resizingShadow.end,l=i.resizingShadow.overlapping;if(DayPilot.de(i.resizingShadow),i.resizing=null,i.resizingShadow=null,p.$bo(),p.$bi.clear(),document.body.style.cursor="",l)return;p.$9s(t,a,o)}else if(i.moving){var r=function(){i.movingShadow&&(DayPilot.de(i.movingShadow),i.movingShadow.calendar=null),document.body.style.cursor="",i.moving=null,i.drag=null};if(!i.movingShadow)return void r();t=i.moving.event;if(!(p=i.moving.target))return void r();if(DayPilot.Util.removeClass(i.moving,p.$8R("_event_moving_source")),!i.movingShadow.row)return void r();clearTimeout(p.$bb.timeout);a=i.movingShadow.start,o=i.movingShadow.end;var d="Days"!==p.viewType?i.movingShadow.row.id:null,h=!!i.drag&&t.part.external,c=i.movingShadow.line,u=(l=i.movingShadow.overlapping,!i.movingShadow.allowed);if(DayPilot.de(i.movingShadow),p.$bo(),i.drag&&(p.todo||(p.todo={}),p.todo.del=i.drag.element,i.drag=null),i.movingShadow.calendar=null,document.body.style.cursor="",i.moving=null,i.movingShadow=null,p.$bk.clear(),l||u||p.$bk.forbidden||p.$bk.invalid)return;e=e||window.event;p.$9X(t,a,o,d,h,e,c)}else if(i.range){e=e||window.event;var f=DayPilot.Util.mouseButton(e),v=i.range,p=v.calendar,y=e.ctrlKey||e.metaKey;if(p.allowMultiRange)return p.elements.range2.overlapping?(DayPilot.de(p.elements.range2),p.elements.range2=null,p.$bo()):p.$dn.add(v),i.range=null,void(y||p.$dn.dispatch());if(i.timeRangeTimeout)return clearTimeout(i.timeRangeTimeout),void(i.timeRangeTimeout=null);i.rangeHold=v,i.range=null;var g=function(e){return function(){i.timeRangeTimeout=null;var t=p.elements.range2;t&&t.overlapping?p.clearSelection():(p.$a1(e),"Hold"!==p.timeRangeSelectedHandling&&"HoldForever"!==p.timeRangeSelectedHandling||(i.rangeHold=e))}},m=p.$dm(v);if(!f.left)return void(i.timeRangeTimeout=null);if("Disabled"===p.timeRangeDoubleClickHandling)return g(m)(),(e=e||window.event).cancelBubble=!0,!1;i.timeRangeTimeout=setTimeout(g(m),p.doubleClickTimeout)}else if(n.row){(p=n.calendar)&&p.$bX()}else if(s.source){(p=s.calendar).$aN.clearShadow(),p.$aN.hideLinkpoints(),s.source=null,s.calendar=null}else if(i.splitting){i.splitting.cleanup(),i.splitting=null}else if(i.rectangleSelect){var b=i.rectangleSelect,w=(p=b.calendar,b.x),$=b.y,D=b.width,k=b.height,C=!1,x=p.$8O.eventsInRectangle(w,$,D,k).map(function(e){return e.event});if("function"==typeof p.onRectangleEventSelect){var P;if((P={}).events=x,P.append=!1,P.preventDefault=function(){this.preventDefault.value=!0},p.onRectangleEventSelect(P),P.preventDefault.value)return p.$de.clear(),void(i.rectangleSelect=null);C=P.append}if(C||p.multiselect.clear(!0),x.each(function(e){p.multiselect.add(e,!0)}),p.multiselect.redraw(),setTimeout(function(){p.$de.clear(),i.rectangleSelect=null},0),"function"==typeof p.onRectangleEventSelected)(P={}).events=x,p.onRectangleEventSelected(P)}if(i.drag&&(delete i.drag.event.part.external,i.drag=null,document.body.style.cursor=""),i.gShadow){if(i.gShadow.source){p=i.gShadow.source.event.calendar;DayPilot.Util.removeClass(i.gShadow.source,p.$8R("_event_moving_source"))}document.body.removeChild(i.gShadow),i.gShadow=null}i.moveOffsetX=null,i.moveDragStart=null},i.createGShadow=function(e){var t=document.createElement("div");return t.setAttribute("unselectable","on"),t.style.position="absolute",t.style.width="100px",t.style.height="20px",t.style.border="2px dotted #666666",t.style.zIndex=101,t.style.pointerEvents="none","Fill"===e&&(t.style.backgroundColor="#aaaaaa",t.style.opacity=.5,t.style.filter="alpha(opacity=50)",t.style.border="2px solid #aaaaaa"),document.body.appendChild(t),t};var n={};DayPilot.Global.rowmoving=n;var a,s={};DayPilot.Global.linking=s,DayPilot.SchedulerVisible.dragStart=i.dragStart,DayPilot.SchedulerVisible.dragStop=i.dragStop,DayPilot.SchedulerVisible.Scheduler=i.Scheduler,DayPilot.SchedulerVisible.globalHandlers=i.globalHandlers,"undefined"!=typeof jQuery&&(jQuery.fn.daypilotScheduler=function(e){var t=null,i=this.each(function(){if(!this.daypilot){var i=new DayPilot.Scheduler(this.id,e);i.init(),this.daypilot=i,t||(t=i)}});return 1===this.length?t:i}),(a=DayPilot.am())&&a.directive("daypilotScheduler",function(){return{restrict:"E",template:"<div id='{{id}};'></div>",compile:function(e,t){return e.replaceWith(this.template.replace("{{id}};",t.id)),function(e,t,i){var n=new DayPilot.Scheduler(t[0]);n.$b0.scope=e,n.init();var a=i.id;a&&(e[a]=n);var s=e.$watch;s.call(e,i.daypilotConfig,function(e,t){for(var i in e)n[i]=e[i];n.update()},!0),s.call(e,i.daypilotEvents,function(e){n.events.list=e,n.$9E({eventsOnly:!0})},!0)}}}}),"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),void 0===DayPilot)var DayPilot={};void 0===DayPilot.Global&&(DayPilot.Global={}),void 0===DayPilot.Year&&(DayPilot.Year=function(e,t){this.v="1659",this.startDate=new DayPilot.Date,this.cssOnly=!0,this.cssClassPrefix=null,this.columns=4,this.cellWidth=20,this.showWeekNumbers=!1,this.$i=[],this.$j=function(){this.root.dp=this,this.$k=new DayPilot.Date(this.startDate.toString("yyyy-01-01","en-us"))},this.$l=function(e){return this.cssClassPrefix?this.cssClassPrefix+e:""},this.$m=function(){return this.showWeekNumbers?this.cellWidth:0},this.$n=function(){this.$i=[];var e=this.columns,t=12/e;this.root.className=this.$l("_main"),this.root.style.width=e*(7*this.cellWidth+this.$m())+"px";for(var i=0;i<t;i++){for(var n=0;n<e;n++){var a=i*e+n,s=s+"_nav_"+a,o=document.createElement("div");o.id=s,o.style.float="left",this.root.appendChild(o);var l=new DayPilot.Navigator(s);l.startDate=this.$k.addMonths(a),l.cssOnly=this.cssOnly,l.cssClassPrefix=this.cssClassPrefix,l.cellWidth=this.cellWidth,l.showWeekNumbers=this.showWeekNumbers,l.internal.showLinks={},l.selectMode="none",l.timeRangeSelectedHandling="JavaScript",l.onTimeRangeSelected=this.$o,l.init(),l.root.className="",this.$i.push(l)}var r=document.createElement("div");r.style.clear="left",this.root.appendChild(r)}},this.$o=function(e){alert("clicked: "+e.day)},this.init=function(){this.root=document.getElementById(e),this.root.dp||(this.$j(),this.$n())}});;angular.module("infiniteScroll",[]).directive("infiniteScroll",["$window",function(i){return{link:function(i,n,l){var o=parseInt(l.threshold)||0,e=n[0];n.bind("scroll",function(){i.$eval(l.canLoad)&&e.scrollTop+e.offsetHeight>=e.scrollHeight-o&&i.$apply(l.infiniteScroll)})}}}]);;!function(t,e){function i(e,i){var n,o,a,r=e.nodeName.toLowerCase();return"area"===r?(o=(n=e.parentNode).name,!(!e.href||!o||"map"!==n.nodeName.toLowerCase())&&(!!(a=t("img[usemap=#"+o+"]")[0])&&s(a))):(/input|select|textarea|button|object/.test(r)?!e.disabled:"a"===r&&e.href||i)&&s(e)}function s(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var n=0,o=/^ui-id-\d+$/;t.ui=t.ui||{},t.extend(t.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({focus:function(e){return function(i,s){return"number"==typeof i?this.each(function(){var e=this;setTimeout(function(){t(e).focus(),s&&s.call(e)},i)}):e.apply(this,arguments)}}(t.fn.focus),scrollParent:function(){var e;return e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(i){if(i!==e)return this.css("zIndex",i);if(this.length)for(var s,n,o=t(this[0]);o.length&&o[0]!==document;){if(("absolute"===(s=o.css("position"))||"relative"===s||"fixed"===s)&&(n=parseInt(o.css("zIndex"),10),!isNaN(n)&&0!==n))return n;o=o.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){o.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])},focusable:function(e){return i(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var s=t.attr(e,"tabindex"),n=isNaN(s);return(n||s>=0)&&i(e,!n)}}),t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],function(i,s){function n(e,i,s,n){return t.each(o,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),n&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var o="Width"===s?["Left","Right"]:["Top","Bottom"],a=s.toLowerCase(),r={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+s]=function(i){return i===e?r["inner"+s].call(this):this.each(function(){t(this).css(a,n(this,i)+"px")})},t.fn["outer"+s]=function(e,i){return"number"!=typeof e?r["outer"+s].call(this,e):this.each(function(){t(this).css(a,n(this,e,!0,i)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.support.selectstart="onselectstart"in document.createElement("div"),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i){var s,n=t.plugins[e];if(n&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(s=0;n.length>s;s++)t.options[n[s][0]]&&n[s][1].apply(t.element,i)}},hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0||(e[s]=1,n=e[s]>0,e[s]=0,n)}})}(jQuery),function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(t){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),(h=new s).options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a&&h.widgetEventPrefix||i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h))!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e:t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},i=(n=i.split(".")).shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||!0!==a.options.disabled&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},(i=t.Event(i)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&!1===a.apply(this.element[0],[i].concat(s))||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?!0===n||"number"==typeof n?i:n.effect||i:e;"number"==typeof(n=n||{})&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})}(jQuery),function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,o=!("string"!=typeof this.options.cancel||!i.target.nodeName)&&t(i.target).closest(this.options.cancel).length;return!(n&&!o&&this._mouseCapture(i))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=!1!==this._mouseStart(i),!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0))}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(jQuery),function(t,e){function i(t,e,i){return[parseFloat(t[0])*(d.test(t[0])?e/100:1),parseFloat(t[1])*(d.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}t.ui=t.ui||{};var n,o=Math.max,a=Math.abs,r=Math.round,h=/left|center|right/,l=/top|center|bottom/,c=/[\+\-]\d+(\.[\d]+)?%?/,u=/^\w+/,d=/%$/,p=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),e===(i=o.offsetWidth)&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth;return{width:"scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]);return{element:i,isWindow:s,isDocument:!!i[0]&&9===i[0].nodeType,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return p.apply(this,arguments);e=t.extend({},e);var n,d,f,g,m,v,_=t(e.of),b=t.position.getWithinInfo(e.within),y=t.position.getScrollInfo(b),w=(e.collision||"flip").split(" "),k={};return v=function(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}(_),_[0].preventDefault&&(e.at="left top"),d=v.width,f=v.height,g=v.offset,m=t.extend({},g),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=h.test(s[0])?s.concat(["center"]):l.test(s[0])?["center"].concat(s):["center","center"]),s[0]=h.test(s[0])?s[0]:"center",s[1]=l.test(s[1])?s[1]:"center",t=c.exec(s[0]),i=c.exec(s[1]),k[this]=[t?t[0]:0,i?i[0]:0],e[this]=[u.exec(s[0])[0],u.exec(s[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?m.left+=d:"center"===e.at[0]&&(m.left+=d/2),"bottom"===e.at[1]?m.top+=f:"center"===e.at[1]&&(m.top+=f/2),n=i(k.at,d,f),m.left+=n[0],m.top+=n[1],this.each(function(){var h,l,c=t(this),u=c.outerWidth(),p=c.outerHeight(),v=s(this,"marginLeft"),x=s(this,"marginTop"),D=u+v+s(this,"marginRight")+y.width,C=p+x+s(this,"marginBottom")+y.height,I=t.extend({},m),P=i(k.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?I.left-=u:"center"===e.my[0]&&(I.left-=u/2),"bottom"===e.my[1]?I.top-=p:"center"===e.my[1]&&(I.top-=p/2),I.left+=P[0],I.top+=P[1],t.support.offsetFractions||(I.left=r(I.left),I.top=r(I.top)),h={marginLeft:v,marginTop:x},t.each(["left","top"],function(i,s){t.ui.position[w[i]]&&t.ui.position[w[i]][s](I,{targetWidth:d,targetHeight:f,elemWidth:u,elemHeight:p,collisionPosition:h,collisionWidth:D,collisionHeight:C,offset:[n[0]+P[0],n[1]+P[1]],my:e.my,at:e.at,within:b,elem:c})}),e.using&&(l=function(t){var i=g.left-I.left,s=i+d-u,n=g.top-I.top,r=n+f-p,h={target:{element:_,left:g.left,top:g.top,width:d,height:f},element:{element:c,left:I.left,top:I.top,width:u,height:p},horizontal:0>s?"left":i>0?"right":"center",vertical:0>r?"top":n>0?"bottom":"middle"};u>d&&d>a(i+s)&&(h.horizontal="center"),p>f&&f>a(n+r)&&(h.vertical="middle"),h.important=o(a(i),a(s))>o(a(n),a(r))?"horizontal":"vertical",e.using.call(this,t,h)}),c.offset(t.extend(I,{using:l}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(0>(i=t.left+d+p+f+e.collisionWidth-r-o)||a(c)>i)&&(t.left+=d+p+f):u>0&&(((s=t.left-e.collisionPosition.marginLeft+d+p+f-h)>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,p="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,f=-2*e.offset[1];0>c?(s=t.top+d+p+f+e.collisionHeight-r-o,t.top+d+p+f>c&&(0>s||a(c)>s)&&(t.top+=d+p+f)):u>0&&(i=t.top-e.collisionPosition.marginTop+d+p+f-h,t.top+d+p+f>u&&(i>0||u>a(i))&&(t.top+=d+p+f))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,o,a=document.getElementsByTagName("body")[0],r=document.createElement("div");for(o in e=document.createElement(a?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},a&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"}),s)e.style[o]=s[o];e.appendChild(r),(i=a||document.documentElement).insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()}(jQuery),function(t){var e=0,i={},s={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",s.height=s.paddingTop=s.paddingBottom=s.borderTopWidth=s.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.10.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||!1!==e.active&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t(),content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("<span>").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?void this._activate(e):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),void("disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e)))},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),o.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus()},refresh:function(){var e=this.options;this._processPanels(),!1===e.active&&!0===e.collapsible||!this.headers.length?(e.active=!1,this.active=t()):!1===e.active?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,s=this.options,n=s.heightStyle,o=this.element.parent(),a=this.accordionId="ui-accordion-"+(this.element.attr("id")||++e);this.active=this._findActive(s.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(e){var i=t(this),s=i.attr("id"),n=i.next(),o=n.attr("id");s||(s=a+"-header-"+e,i.attr("id",s)),o||(o=a+"-panel-"+e,n.attr("id",o)),i.attr("aria-controls",o),n.attr("aria-labelledby",s)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(s.event),"fill"===n?(i=o.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===n&&(i=0,this.headers.next().each(function(){i=Math.max(i,t(this).css("height","").height())}).height(i))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n[0]===s[0],a=o&&i.collapsible,r=a?t():n.next(),h={oldHeader:s,oldPanel:s.next(),newHeader:a?t():n,newPanel:r};e.preventDefault(),o&&!i.collapsible||!1===this._trigger("beforeActivate",e,h)||(i.active=!a&&this.headers.index(n),this.active=o?t():n,this._toggle(h),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),o||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(t,e,n){var o,a,r,h=this,l=0,c=t.length&&(!e.length||t.index()<e.index()),u=this.options.animate||{},d=c&&u.down||u,p=function(){h._toggleComplete(n)};return"number"==typeof d&&(r=d),"string"==typeof d&&(a=d),a=a||d.easing||u.easing,r=r||d.duration||u.duration,e.length?t.length?(o=t.show().outerHeight(),e.animate(i,{duration:r,easing:a,step:function(t,e){e.now=Math.round(t)}}),void t.hide().animate(s,{duration:r,easing:a,complete:p,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?l+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(o-e.outerHeight()-l),l=0)}})):e.animate(i,r,a,p):t.animate(s,r,a,p)},_toggleComplete:function(t){var e=t.oldPanel;e.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}})}(jQuery),function(t){t.widget("ui.autocomplete",{version:"1.10.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n;this.isMultiLine=!!o||!a&&this.element.prop("isContentEditable"),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,void(i=!0);e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:case o.NUMPAD_ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,void((!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault());if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,void t.preventDefault()):void this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?void delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),void this._change(t))}}),this._initSource(),this.menu=t("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];t(e.target).closest(".ui-menu-item").length||this._delay(function(){var e=this;this.document.one("mousedown",function(s){s.target===e.element[0]||s.target===i||t.contains(i,s.target)||e.close()})})},menufocus:function(e,i){if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)});var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",e,{item:s})?e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=t("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e||(e=this.element.closest(".ui-front")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({label:e.label||e.value,value:e.value||e.label},e)})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<a>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this._value(this.term),void this.menu.blur()):void this.menu[t](e):void this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.text(e))}})}(jQuery),function(t){var e,i="ui-button ui-widget ui-state-default ui-corner-all",s="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",n=function(){var e=t(this);setTimeout(function(){e.find(":ui-button").button("refresh")},1)},o=function(e){var i=e.name,s=e.form,n=t([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?t(s).find("[name='"+i+"']"):t("[name='"+i+"']",e.ownerDocument).filter(function(){return!this.form})),n};t.widget("ui.button",{version:"1.10.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,n),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var s=this,a=this.options,r="checkbox"===this.type||"radio"===this.type,h=r?"":"ui-state-active";null===a.label&&(a.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(i).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){a.disabled||this===e&&t(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){a.disabled||t(this).removeClass(h)}).bind("click"+this.eventNamespace,function(t){a.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),r&&this.element.bind("change"+this.eventNamespace,function(){s.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return!a.disabled&&void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(a.disabled)return!1;t(this).addClass("ui-state-active"),s.buttonElement.attr("aria-pressed","true");var e=s.element[0];o(e).not(e).map(function(){return t(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return!a.disabled&&(t(this).addClass("ui-state-active"),e=this,void s.document.one("mouseup",function(){e=null}))}).bind("mouseup"+this.eventNamespace,function(){return!a.disabled&&void t(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(e){return!a.disabled&&void((e.keyCode===t.ui.keyCode.SPACE||e.keyCode===t.ui.keyCode.ENTER)&&t(this).addClass("ui-state-active"))}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){t(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(e){e.keyCode===t.ui.keyCode.SPACE&&t(this).click()})),this._setOption("disabled",a.disabled),this._resetButton()},_determineButtonType:function(){var t,e,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(t=this.element.parents().last(),e="label[for='"+this.element.attr("id")+"']",this.buttonElement=t.find(e),this.buttonElement.length||(t=t.length?t.siblings():this.element.siblings(),this.buttonElement=t.filter(e),this.buttonElement.length||(this.buttonElement=t.find(e))),this.element.addClass("ui-helper-hidden-accessible"),(i=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(i+" ui-state-active "+s).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(t,e){return this._super(t,e),"disabled"===t?(this.element.prop("disabled",!!e),void(e&&this.buttonElement.removeClass("ui-state-focus"))):void this._resetButton()},refresh:function(){var e=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOption("disabled",e),"radio"===this.type?o(this.element[0]).each(function(){t(this).is(":checked")?t(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):t(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"!==this.type){var e=this.buttonElement.removeClass(s),i=t("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),n=this.options.icons,o=n.primary&&n.secondary,a=[];n.primary||n.secondary?(this.options.text&&a.push("ui-button-text-icon"+(o?"s":n.primary?"-primary":"-secondary")),n.primary&&e.prepend("<span class='ui-button-icon-primary ui-icon "+n.primary+"'></span>"),n.secondary&&e.append("<span class='ui-button-icon-secondary ui-icon "+n.secondary+"'></span>"),this.options.text||(a.push(o?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||e.attr("title",t.trim(i)))):a.push("ui-button-text-only"),e.addClass(a.join(" "))}else this.options.label&&this.element.val(this.options.label)}}),t.widget("ui.buttonset",{version:"1.10.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(t,e){"disabled"===t&&this.buttons.button("option",t,e),this._super(t,e)},refresh:function(){var e="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(e?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(e?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})}(jQuery),function(t,e){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.dpDiv=s(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function s(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(i,"mouseout",function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){t.datepicker._isDisabledDatepicker(o.inline?e.parent()[0]:o.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))})}function n(e,i){for(var s in t.extend(e,i),i)null==i[s]&&(e[s]=i[s]);return e}t.extend(t.ui,{datepicker:{version:"1.10.4"}});var o,a="datepicker";t.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return n(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;n="div"===(s=e.nodeName.toLowerCase())||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),(o=this._newInst(t(e),n)).settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){return{id:e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?s(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),t.data(e,a,i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),("focus"===(s=this._get(i,"showOn"))||"both"===s)&&e.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.click(function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,a,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,o,r){var h,l,c,u,d,p=this._dialogInst;return p||(this.uuid+=1,h="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+h+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),t("body").append(this._dialogInput),(p=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},t.data(this._dialogInput[0],a,p)),n(p.settings,o||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=r?r.length?r:[r.pageX,r.pageY]:null,this._pos||(l=document.documentElement.clientWidth,c=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+u,c/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],a,p),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,a);s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,a),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,a);n.hasClass(this.markerClassName)&&("input"===(i=e.nodeName.toLowerCase())?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&((s=n.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,a);n.hasClass(this.markerClassName)&&("input"===(i=e.nodeName.toLowerCase())?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&((s=n.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,a)}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,s,o){var a,r,h,l,c=this._getInst(i);return 2===arguments.length&&"string"==typeof s?"defaults"===s?t.extend({},t.datepicker._defaults):c?"all"===s?t.extend({},c.settings):this._get(c,s):null:(a=s||{},"string"==typeof s&&((a={})[s]=o),c&&(this._curInst===c&&this._hideDatepicker(),r=this._getDateDatepicker(i,!0),h=this._getMinMaxDate(c,"min"),l=this._getMinMaxDate(c,"max"),n(c.settings,a),null!==h&&a.dateFormat!==e&&a.minDate===e&&(c.settings.minDate=this._formatDate(c,h)),null!==l&&a.dateFormat!==e&&a.maxDate===e&&(c.settings.maxDate=this._formatDate(c,l)),"disabled"in a&&(a.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(t(i),c),this._autoSize(c),this._setDate(c,r),this._updateAlternate(c),this._updateDatepicker(c)),e)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return(n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv))[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),(i=t.datepicker._get(o,"onSelect"))?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(i){var s,n,o=t.datepicker._getInst(i.target);return t.datepicker._get(o,"constrainInput")?(s=t.datepicker._possibleChars(t.datepicker._get(o,"dateFormat")),n=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">n||!s||s.indexOf(n)>-1):e},_doKeyUp:function(e){var i=t.datepicker._getInst(e.target);if(i.input.val()!==i.lastVal)try{t.datepicker.parseDate(t.datepicker._get(i,"dateFormat"),i.input?i.input.val():null,t.datepicker._getFormatConfig(i))&&(t.datepicker._setDateFromField(i),t.datepicker._updateAlternate(i),t.datepicker._updateDatepicker(i))}catch(t){}return!0},_showDatepicker:function(e){var i,s,o,a,r,h,l;("input"!==(e=e.target||e).nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),t.datepicker._isDisabledDatepicker(e)||t.datepicker._lastInput===e)||(i=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==i&&(t.datepicker._curInst.dpDiv.stop(!0,!0),i&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),!1!==(o=(s=t.datepicker._get(i,"beforeShow"))?s.apply(e,[e,i]):{})&&(n(i.settings,o),i.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(i),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),a=!1,t(e).parents().each(function(){return!(a|="fixed"===t(this).css("position"))}),r={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(i),r=t.datepicker._checkOffset(i,r,a),i.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":a?"fixed":"absolute",display:"none",left:r.left+"px",top:r.top+"px"}),i.inline||(h=t.datepicker._get(i,"showAnim"),l=t.datepicker._get(i,"duration"),i.dpDiv.zIndex(t(e).zIndex()+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?i.dpDiv.show(h,t.datepicker._get(i,"showOptions"),l):i.dpDiv[h||"show"](h?l:null),t.datepicker._shouldFocusInput(i)&&i.input.focus(),t.datepicker._curInst=i)))},_updateDatepicker:function(e){this.maxRows=4,o=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,s=this._getNumberOfMonths(e),n=s[1];e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",17*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.focus(),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-a:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+o>l&&l>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return[(i=t(e).offset()).left,i.top]},_hideDatepicker:function(e){var i,s,n,o,r=this._curInst;!r||e&&r!==t.data(e,a)||this._datepickerShowing&&(i=this._get(r,"showAnim"),s=this._get(r,"duration"),n=function(){t.datepicker._tidyDialog(r)},t.effects&&(t.effects.effect[i]||t.effects[i])?r.dpDiv.hide(i,t.datepicker._get(r,"showOptions"),s,n):r.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,(o=this._get(r,"onClose"))&&o.apply(r.input?r.input[0]:null,[r.input?r.input.val():"",r]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+("M"===s?this._get(o,"showCurrentAtPos"):0),s),this._updateDatepicker(o))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),o=this._getInst(n[0]);o["selected"+("M"===s?"Month":"Year")]=o["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(n)},_selectDay:function(e,i,s,n){var o,a=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||((o=this._getInst(a[0])).selectedDay=o.currentDay=t("a",n).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=s,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),o=this._getInst(n[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),(s=this._get(o,"onSelect"))?s.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(o).each(function(){t(this).val(n)}))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(i,s,n){if(null==i||null==s)throw"Invalid arguments";if(""===(s="object"==typeof s?""+s:s+""))return null;var o,a,r,h,l=0,c=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),d=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,p=(n?n.dayNames:null)||this._defaults.dayNames,f=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,g=(n?n.monthNames:null)||this._defaults.monthNames,m=-1,v=-1,_=-1,b=-1,y=!1,w=function(t){var e=i.length>o+1&&i.charAt(o+1)===t;return e&&o++,e},k=function(t){var e=w(t),i=RegExp("^\\d{1,"+("@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2)+"}"),n=s.substring(l).match(i);if(!n)throw"Missing number at position "+l;return l+=n[0].length,parseInt(n[0],10)},x=function(i,n,o){var a=-1,r=t.map(w(i)?o:n,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(r,function(t,i){var n=i[1];return s.substr(l,n.length).toLowerCase()===n.toLowerCase()?(a=i[0],l+=n.length,!1):e}),-1!==a)return a+1;throw"Unknown name at position "+l},D=function(){if(s.charAt(l)!==i.charAt(o))throw"Unexpected literal at position "+l;l++};for(o=0;i.length>o;o++)if(y)"'"!==i.charAt(o)||w("'")?D():y=!1;else switch(i.charAt(o)){case"d":_=k("d");break;case"D":x("D",d,p);break;case"o":b=k("o");break;case"m":v=k("m");break;case"M":v=x("M",f,g);break;case"y":m=k("y");break;case"@":m=(h=new Date(k("@"))).getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"!":m=(h=new Date((k("!")-this._ticksTo1970)/1e4)).getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"'":w("'")?D():y=!0;break;default:D()}if(s.length>l&&(r=s.substr(l),!/^\s+/.test(r)))throw"Extra/unparsed characters found in date: "+r;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),b>-1)for(v=1,_=b;!((a=this._getDaysInMonth(m,v-1))>=_);)v++,_-=a;if((h=this._daylightSavingAdjust(new Date(m,v-1,_))).getFullYear()!==m||h.getMonth()+1!==v||h.getDate()!==_)throw"Invalid date";return h},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:864e9*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,o);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),a,r);break;case"y":u+=h("y")?e.getFullYear():(10>e.getYear()%100?"0":"")+e.getYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,i){return t.settings[i]!==e?t.settings[i]:this._defaults[i]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(t){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=null==i||""===i?s:"string"==typeof i?function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(t){}for(var s=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,n=s.getFullYear(),o=s.getMonth(),a=s.getDate(),r=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,h=r.exec(i);h;){switch(h[2]||"d"){case"d":case"D":a+=parseInt(h[1],10);break;case"w":case"W":a+=7*parseInt(h[1],10);break;case"m":case"M":o+=parseInt(h[1],10),a=Math.min(a,t.datepicker._getDaysInMonth(n,o));break;case"y":case"Y":n+=parseInt(h[1],10),a=Math.min(a,t.datepicker._getDaysInMonth(n,o))}h=r.exec(i)}return new Date(n,o,a)}(i):"number"==typeof i?isNaN(i)?s:function(t){var e=new Date;return e.setDate(e.getDate()+t),e}(i):new Date(i.getTime());return(n=n&&"Invalid Date"==""+n?s:n)&&(n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setMilliseconds(0)),this._daylightSavingAdjust(n)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){return!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay))},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,h,l,c,u,d,p,f,g,m,v,_,b,y,w,k,x,D,C,I,P,T,M,S,z,A,H,E,W,N,O,F,R,L=new Date,j=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(t,"isRTL"),B=this._get(t,"showButtonPanel"),K=this._get(t,"hideIfNoPrevNext"),q=this._get(t,"navigationAsDateFormat"),U=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),Q=this._get(t,"stepMonths"),X=1!==U[0]||1!==U[1],$=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(t,"min"),J=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,tt=t.drawYear;if(0>Z&&(Z+=12,tt--),J)for(e=this._daylightSavingAdjust(new Date(J.getFullYear(),J.getMonth()-U[0]*U[1]+1,J.getDate())),e=G&&G>e?G:e;this._daylightSavingAdjust(new Date(tt,Z,1))>e;)0>--Z&&(Z=11,tt--);for(t.drawMonth=Z,t.drawYear=tt,i=this._get(t,"prevText"),i=q?this.formatDate(i,this._daylightSavingAdjust(new Date(tt,Z-Q,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,tt,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":K?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(tt,Z+Q,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,tt,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":K?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?$:j,a=q?this.formatDate(a,r,this._getFormatConfig(t)):a,h=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),v=this._get(t,"showOtherMonths"),_=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;U[0]>k;k++){for(x="",this.maxRows=4,D=0;U[1]>D;D++){if(C=this._daylightSavingAdjust(new Date(tt,Z,t.selectedDay)),I=" ui-corner-all",P="",X){if(P+="<div class='ui-datepicker-group",U[1]>1)switch(D){case 0:P+=" ui-datepicker-group-first",I=" ui-corner-"+(Y?"right":"left");break;case U[1]-1:P+=" ui-datepicker-group-last",I=" ui-corner-"+(Y?"left":"right");break;default:P+=" ui-datepicker-group-middle",I=""}P+="'>"}for(P+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+I+"'>"+(/all|left/.test(I)&&0===k?Y?o:s:"")+(/all|right/.test(I)&&0===k?Y?s:o:"")+this._generateMonthYearHeader(t,Z,tt,G,J,k>0||D>0,f,g)+"</div><table class='ui-datepicker-calendar'><thead><tr>",T=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;7>w;w++)M=(w+c)%7,T+="<th"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+d[M]+"'>"+p[M]+"</span></th>";for(P+=T+"</tr></thead><tbody>",S=this._getDaysInMonth(tt,Z),tt===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),z=(this._getFirstDayOfMonth(tt,Z)-c+7)%7,A=Math.ceil((z+S)/7),H=X&&this.maxRows>A?this.maxRows:A,this.maxRows=H,E=this._daylightSavingAdjust(new Date(tt,Z,1-z)),W=0;H>W;W++){for(P+="<tr>",N=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(E)+"</td>":"",w=0;7>w;w++)O=m?m.apply(t.input?t.input[0]:null,[E]):[!0,""],R=(F=E.getMonth()!==Z)&&!_||!O[0]||G&&G>E||J&&E>J,N+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(E.getTime()===C.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===E.getTime()&&b.getTime()===C.getTime()?" "+this._dayOverClass:"")+(R?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!v?"":" "+O[1]+(E.getTime()===$.getTime()?" "+this._currentClass:"")+(E.getTime()===j.getTime()?" ui-datepicker-today":""))+"'"+(F&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"&#39;")+"'")+(R?"":" data-handler='selectDay' data-event='click' data-month='"+E.getMonth()+"' data-year='"+E.getFullYear()+"'")+">"+(F&&!v?"&#xa0;":R?"<span class='ui-state-default'>"+E.getDate()+"</span>":"<a class='ui-state-default"+(E.getTime()===j.getTime()?" ui-state-highlight":"")+(E.getTime()===$.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+E.getDate()+"</a>")+"</td>",E.setDate(E.getDate()+1),E=this._daylightSavingAdjust(E);P+=N+"</tr>"}++Z>11&&(Z=0,tt++),x+=P+="</tbody></table>"+(X?"</div>"+(U[0]>0&&D===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}y+=x}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var h,l,c,u,d,p,f,g,m=this._get(t,"changeMonth"),v=this._get(t,"changeYear"),_=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(o||!m)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!h||c>=s.getMonth())&&(!l||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(_||(b+=y+(!o&&m&&v?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",o||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),f=(p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e})(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";g>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),_&&(b+=(!o&&m&&v?"":"&#xa0;")+y),b+"</div>"},_adjustInstDate:function(t,e,i){var s=t.drawYear+("Y"===i?e:0),n=t.drawMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||e.getTime()>=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||r>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).mousedown(t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new i,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.10.4"}(jQuery),function(t){var e={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};t.widget("ui.dialog",{version:"1.10.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i,s=this;if(this._isOpen&&!1!==this._trigger("beforeClose",e)){if(this._isOpen=!1,this._destroyOverlay(),!this.opener.filter(":focusable").focus().length)try{(i=this.document[0].activeElement)&&"body"!==i.nodeName.toLowerCase()&&t(i).blur()}catch(t){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",e)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!e&&this._trigger("focus",t),i},open:function(){var e=this;return this._isOpen?void(this._moveToTop()&&this._focusTabbable()):(this._isOpen=!0,this.opener=t(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),void this._trigger("open"))},_focusTabbable:function(){var t=this.element.find("[autofocus]");t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).focus()},_keepFocus:function(e){function i(){var e=this.document[0].activeElement;this.uiDialog[0]===e||t.contains(this.uiDialog[0],e)||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),void this.close(e);if(e.keyCode===t.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(n.focus(1),e.preventDefault()):(s.focus(1),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(e),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title||t.html("&#160;"),t.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?void this.uiDialog.removeClass("ui-dialog-buttons"):(t.each(i,function(i,s){var n,o;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(e.element[0],arguments)},o={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,t("<button></button>",s).button(o).appendTo(e.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),void this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){t(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,o){s.position=[o.position.left-i.document.scrollLeft(),o.position.top-i.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(o))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,o=this.uiDialog.css("position"),a="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:a,start:function(s,n){t(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,o){s.height=t(this).height(),s.width=t(this).width(),t(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(o))}}).css("position",o)},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(s){var n=this,o=!1,a={};t.each(s,function(t,s){n._setOption(t,s),t in e&&(o=!0),t in i&&(a[t]=s)}),o&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",a)},_setOption:function(t,e){var i,s,n=this.uiDialog;"dialogClass"===t&&n.removeClass(this.options.dialogClass).addClass(e),"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:""+e}),"draggable"===t&&((i=n.is(":data(ui-draggable)"))&&!e&&n.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&((s=n.is(":data(ui-resizable)"))&&!e&&n.resizable("destroy"),s&&"string"==typeof e&&n.resizable("option","handles",e),s||!1===e||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return!!t(e.target).closest(".ui-dialog").length||!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=this,i=this.widgetFullName;t.ui.dialog.overlayInstances||this._delay(function(){t.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(s){e._allowInteraction(s)||(s.preventDefault(),t(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=t("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),t.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(t.ui.dialog.overlayInstances--,t.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),t.ui.dialog.overlayInstances=0,!1!==t.uiBackCompat&&t.widget("ui.dialog",t.ui.dialog,{_position:function(){var e,i=this.options.position,s=[],n=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(1===(s=i.split?i.split(" "):[i[0],i[1]]).length&&(s[1]=s[0]),t.each(["left","top"],function(t,e){+s[t]===s[t]&&(n[t]=s[t],s[t]=e)}),i={my:s[0]+(0>n[0]?n[0]:"+"+n[0])+" "+s[1]+(0>n[1]?n[1]:"+"+n[1]),at:s.join(" ")}),i=t.extend({},t.ui.dialog.prototype.options.position,i)):i=t.ui.dialog.prototype.options.position,(e=this.uiDialog.is(":visible"))||this.uiDialog.show(),this.uiDialog.position(i),e||this.uiDialog.hide()}})}(jQuery),function(t){t.widget("ui.draggable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return!(this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(e),!!this.handle&&(t(!0===i.iframeFix?"iframe":i.iframeFix).each(function(){t("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0))},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),!1===this._trigger("start",e)?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(!1===this._trigger("drag",e,s))return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),!("original"===this.options.helper&&!t.contains(this.element[0].ownerDocument,this.element[0]))&&("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||!0===this.options.revert||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==i._trigger("stop",e)&&i._clear()}):!1!==this._trigger("stop",e)&&this._clear(),!1)},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return!this.options.handle||!!t(e.target).closest(this.element.find(this.options.handle)).length},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;return n.containment?"window"===n.containment?void(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===n.containment?void(this.containment=[0,0,t(document).width()-this.helperProportions.width-this.margins.left,(t(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):n.containment.constructor===Array?void(this.containment=n.containment):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),void((s=(i=t(n.containment))[0])&&(e="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i))):void(this.containment=null)},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(e){var i,s,n,o,a=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=e.pageX,l=e.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("ui-draggable"),n=s.options,o=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,o))})},stop:function(e,i){var s=t(this).data("ui-draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("ui-draggable"),n=this;t.each(s.sortables,function(){var o=!1,a=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==a&&this.instance._intersectsWith(this.instance.containerCache)&&t.contains(a.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(){var e=t("body"),i=t(this).data("ui-draggable").options;e.css("cursor")&&(i._cursor=e.css("cursor")),e.css("cursor",i.cursor)},stop:function(){var e=t(this).data("ui-draggable").options;e._cursor&&t("body").css("cursor",e._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(){var e=t(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var i=t(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:e.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-e.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:e.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(e.pageY-t(document).scrollTop()<s.scrollSensitivity?n=t(document).scrollTop(t(document).scrollTop()-s.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<s.scrollSensitivity&&(n=t(document).scrollTop(t(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(e.pageX-t(document).scrollLeft()<s.scrollSensitivity?n=t(document).scrollLeft(t(document).scrollLeft()-s.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<s.scrollSensitivity&&(n=t(document).scrollLeft(t(document).scrollLeft()+s.scrollSpeed)))),!1!==n&&t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(){var e=t(this).data("ui-draggable"),i=e.options;e.snapElements=[],t(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=t(this),s=i.offset();this!==e.element[0]&&e.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(e,i){var s,n,o,a,r,h,l,c,u,d,p=t(this).data("ui-draggable"),f=p.options,g=f.snapTolerance,m=i.offset.left,v=m+p.helperProportions.width,_=i.offset.top,b=_+p.helperProportions.height;for(u=p.snapElements.length-1;u>=0;u--)h=(r=p.snapElements[u].left)+p.snapElements[u].width,c=(l=p.snapElements[u].top)+p.snapElements[u].height,r-g>v||m>h+g||l-g>b||_>c+g||!t.contains(p.snapElements[u].item.ownerDocument,p.snapElements[u].item)?(p.snapElements[u].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=!1):("inner"!==f.snapMode&&(s=g>=Math.abs(l-b),n=g>=Math.abs(c-_),o=g>=Math.abs(r-v),a=g>=Math.abs(h-m),s&&(i.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h}).left-p.margins.left)),d=s||n||o||a,"outer"!==f.snapMode&&(s=g>=Math.abs(l-_),n=g>=Math.abs(c-b),o=g>=Math.abs(r-m),a=g>=Math.abs(h-v),s&&(i.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[u].snapping&&(s||n||o||a||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=s||n||o||a||d)}}),t.ui.plugin.add("draggable","stack",{start:function(){var e,i=this.data("ui-draggable").options,s=t.makeArray(t(i.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});s.length&&(e=parseInt(t(s[0]).css("zIndex"),10)||0,t(s).each(function(i){t(this).css("zIndex",e+i)}),this.css("zIndex",e+s.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})}(jQuery),function(t){function e(t,e,i){return t>e&&e+i>t}t.widget("ui.droppable",{version:"1.10.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?void(e=arguments[0]):e||(e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight})},t.ui.ddmanager.droppables[i.scope]=t.ui.ddmanager.droppables[i.scope]||[],t.ui.ddmanager.droppables[i.scope].push(this),i.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,i=t.ui.ddmanager.droppables[this.options.scope];i.length>e;e++)i[e]===this&&i.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"===e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return!(!s||(s.currentItem||s.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=t.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(n=!0,!1):void 0}),!n&&(!!this.accept.call(this.element[0],s.currentItem||s.element)&&(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(s)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(t,i,s){if(!i.offset)return!1;var n,o=(t.positionAbs||t.position.absolute).left,a=(t.positionAbs||t.position.absolute).top,r=o+t.helperProportions.width,h=a+t.helperProportions.height,l=i.offset.left,c=i.offset.top,u=l+i.proportions().width,d=c+i.proportions().height;switch(s){case"fit":return o>=l&&u>=r&&a>=c&&d>=h;case"intersect":return o+t.helperProportions.width/2>l&&u>r-t.helperProportions.width/2&&a+t.helperProportions.height/2>c&&d>h-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,e((t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,c,i.proportions().height)&&e(n,l,i.proportions().width);case"touch":return(a>=c&&d>=a||h>=c&&d>=h||c>a&&h>d)&&(o>=l&&u>=o||r>=l&&u>=r||l>o&&r>u);default:return!1}},t.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;o.length>s;s++)if(!(o[s].options.disabled||e&&!o[s].accept.call(o[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue t}o[s].visible="none"!==o[s].element.css("display"),o[s].visible&&("mousedown"===a&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,o,a=t.ui.intersect(e,this,this.options.tolerance),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,(o=this.element.parents(":data(ui-droppable)").filter(function(){return t.data(this,"ui-droppable").options.scope===n})).length&&((s=t.data(o[0],"ui-droppable")).greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}}(jQuery),function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=c[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=h(),n=s._rgba=[];return i=i.toLowerCase(),p(r,function(t,o){var a,r=o.re.exec(i),h=r&&o.parse(r),c=o.space||"rgba";return h?(a=s[c](h),s[l[c].cache]=a[l[c].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return 1>6*(i=(i+1)%1)?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a=/^([\-+])=\s*(\d+\.?\d*)/,r=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},l={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},c={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},u=h.support={},d=t("<p>")[0],p=t.each;d.style.cssText="background-color:rgba(1,1,1,.5)",u.rgba=d.style.backgroundColor.indexOf("rgba")>-1,p(l,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(n,a,r,c){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),f=this._rgba=[];return a!==e&&(n=[n,a,r,c],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(p(l.rgba.props,function(t,e){f[e.idx]=i(n[e.idx],e)}),this):"object"===d?(p(l,n instanceof h?function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}:function(e,s){var o=s.cache;p(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=h(t),s=!0,n=this;return p(l,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],p(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return p(l,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=h(t),n=s._space(),o=l[n],a=0===this.alpha()?h("transparent"):this,r=a[o.cache]||o.to(a._rgba),u=r.slice();return s=s[o.cache],p(o.props,function(t,n){var o=n.idx,a=r[o],h=s[o],l=c[n.type]||{};null!==h&&(null===a?u[o]=h:(l.mod&&(h-a>l.mod/2?a+=l.mod:a-h>l.mod/2&&(a-=l.mod)),u[o]=i((h-a)*e+a,n)))}),this[n](u)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=h(e)._rgba;return h(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return 1===(t=(t||0).toString(16)).length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,l.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},l.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},p(l,function(s,n){var o=n.props,r=n.cache,l=n.to,c=n.from;h.fn[s]=function(s){if(l&&!this[r]&&(this[r]=l(this._rgba)),s===e)return this[r].slice();var n,a=t.type(s),u="array"===a||"object"===a?s:arguments,d=this[r].slice();return p(o,function(t,e){var s=u["object"===a?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?((n=h(c(d)))[r]=d,n):h(d)},p(o,function(e,i){h.fn[e]||(h.fn[e]=function(n){var o,r=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===r?c:("function"===r&&(n=n.call(this,c),r=t.type(n)),null==n&&i.empty?this:("string"===r&&((o=a.exec(n))&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),h.hook=function(e){var i=e.split(" ");p(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=h(o||n),!u.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(t){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(t){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),t.cssHooks.borderColor={expand:function(t){var e={};return p(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)"string"==typeof n[i=n[s]]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function s(e,i){var s,n,a={};for(s in i)n=i[s],e[s]!==n&&(o[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(a[s]=n));return a}var n=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){return{el:t(this),start:i(this)}}),(o=function(){t.each(n,function(t,i){e[i]&&a[i+"Class"](e[i])})})(),l=l.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,o,a,r){return"boolean"==typeof n||n===e?o?t.effects.animateClass.call(this,n?{add:s}:{remove:s},o,a,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,o,a)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!(e&&"number"!=typeof e&&!t.fx.speeds[e])||("string"==typeof e&&!t.effects.effect[e]||(!!t.isFunction(e)||"object"==typeof e&&!e.effect))}t.extend(t.effects,{version:"1.10.4",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,o;for(o=0;s.length>o;o++)null!==s[o]&&((n=t.data(i+s[o]))===e&&(n=""),t.css(s[o],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),float:e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(t){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(o)&&o.call(n[0]),t.isFunction(e)&&e()}var n=t(this),o=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):a.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,o=i.queue,a=t.effects.effect[i.effect];return t.fx.off||!a?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):!1===o?this.each(e):this.queue(o||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()}(jQuery),function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var o,a,r,h=t(this),l=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(h,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",g=i.test(u),m={},v="show"===c;h.parent().is(".ui-effects-wrapper")?t.effects.save(h.parent(),l):t.effects.save(h,l),h.show(),a=(o=t.effects.createWrapper(h).css({overflow:"hidden"}))[p](),r=parseFloat(o.css(f))||0,m[p]=v?a:0,g||(h.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),m[f]=v?r:a+r),v&&(o.css(p,0),g||o.css(f,r+a)),o.animate(m,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&h.hide(),t.effects.restore(h,l),t.effects.removeWrapper(h),n()}})}}(jQuery),function(t){t.effects.effect.bounce=function(e,i){var s,n,o,a=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(a,e.mode||"effect"),l="hide"===h,c="show"===h,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||l?1:0),g=e.duration/f,m=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=a.queue(),y=b.length;for((c||l)&&r.push("opacity"),t.effects.save(a,r),a.show(),t.effects.createWrapper(a),d||(d=a["top"===v?"outerHeight":"outerWidth"]()/3),c&&((o={opacity:1})[v]=0,a.css("opacity",0).css(v,_?2*-d:2*d).animate(o,g,m)),l&&(d/=Math.pow(2,p-1)),(o={})[v]=0,s=0;p>s;s++)(n={})[v]=(_?"-=":"+=")+d,a.animate(n,g,m).animate(o,g,m),d=l?2*d:d/2;l&&((n={opacity:0})[v]=(_?"-=":"+=")+d,a.animate(n,g,m)),a.queue(function(){l&&a.hide(),t.effects.restore(a,r),t.effects.removeWrapper(a),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),a.dequeue()}}(jQuery),function(t){t.effects.effect.clip=function(e,i){var s,n,o,a=t(this),r=["position","top","bottom","left","right","height","width"],h="show"===t.effects.setMode(a,e.mode||"hide"),l="vertical"===(e.direction||"vertical"),c=l?"height":"width",u=l?"top":"left",d={};t.effects.save(a,r),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),o=(n="IMG"===a[0].tagName?s:a)[c](),h&&(n.css(c,0),n.css(u,o/2)),d[c]=h?o:0,d[u]=h?0:o/2,n.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){h||a.hide(),t.effects.restore(a,r),t.effects.removeWrapper(a),i()}})}}(jQuery),function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),o=["position","top","bottom","left","right","opacity","height","width"],a=t.effects.setMode(n,e.mode||"hide"),r="show"===a,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,o),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===c?-s:s),u[l]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&n.hide(),t.effects.restore(n,o),t.effects.removeWrapper(n),i()}})}}(jQuery),function(t){t.effects.effect.explode=function(e,i){function s(){v.push(this),v.length===c*u&&(d.css({visibility:"visible"}),t(v).remove(),p||d.hide(),i())}var n,o,a,r,h,l,c=e.pieces?Math.round(Math.sqrt(e.pieces)):3,u=c,d=t(this),p="show"===t.effects.setMode(d,e.mode||"hide"),f=d.show().css("visibility","hidden").offset(),g=Math.ceil(d.outerWidth()/u),m=Math.ceil(d.outerHeight()/c),v=[];for(n=0;c>n;n++)for(r=f.top+n*m,l=n-(c-1)/2,o=0;u>o;o++)a=f.left+o*g,h=o-(u-1)/2,d.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*g,top:-n*m}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g,height:m,left:a+(p?h*g:0),top:r+(p?l*m:0),opacity:p?0:1}).animate({left:a+(p?0:h*g),top:r+(p?0:l*m),opacity:p?1:0},e.duration||500,e.easing,s)}}(jQuery),function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}}(jQuery),function(t){t.effects.effect.fold=function(e,i){var s,n,o=t(this),a=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(o,e.mode||"hide"),h="show"===r,l="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=h!==d,f=p?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(o,a),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[l?0:1]),h&&s.css(d?{height:0,width:c}:{height:c,width:0}),m[f[0]]=h?n[0]:c,v[f[1]]=h?n[1]:0,s.animate(m,g,e.easing).animate(v,g,e.easing,function(){l&&o.hide(),t.effects.restore(o,a),t.effects.removeWrapper(o),i()})}}(jQuery),function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],o=t.effects.setMode(s,e.mode||"show"),a={backgroundColor:s.css("backgroundColor")};"hide"===o&&(a.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(a,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&s.hide(),t.effects.restore(s,n),i()}})}}(jQuery),function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),o=t.effects.setMode(n,e.mode||"show"),a="show"===o,r="hide"===o,h=a||"hide"===o,l=2*(e.times||5)+(h?1:0),c=e.duration/l,u=0,d=n.queue(),p=d.length;for((a||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;l>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,l+1))),n.dequeue()}}(jQuery),function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),o="hide"===n,a=parseInt(e.percent,10)||150,r=a/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:o?a:100,from:o?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),o=t.effects.setMode(s,e.mode||"effect"),a=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===o?0:100),r=e.direction||"both",h=e.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c="horizontal"!==r?a/100:1,u="vertical"!==r?a/100:1;n.effect="size",n.queue=!1,n.complete=i,"effect"!==o&&(n.origin=h||["middle","center"],n.restore=!0),n.from=e.from||("show"===o?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*c,width:l.width*u,outerHeight:l.outerHeight*c,outerWidth:l.outerWidth*u},n.fade&&("show"===o&&(n.from.opacity=0,n.to.opacity=1),"hide"===o&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,o,a=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["width","height","overflow"],l=["fontSize"],c=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],u=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],d=t.effects.setMode(a,e.mode||"effect"),p=e.restore||"effect"!==d,f=e.scale||"both",g=e.origin||["middle","center"],m=a.css("position"),v=p?r:["position","top","bottom","left","right","overflow","opacity"],_={height:0,width:0,outerHeight:0,outerWidth:0};"show"===d&&a.show(),s={height:a.height(),width:a.width(),outerHeight:a.outerHeight(),outerWidth:a.outerWidth()},"toggle"===e.mode&&"show"===d?(a.from=e.to||_,a.to=e.from||s):(a.from=e.from||("show"===d?_:s),a.to=e.to||("hide"===d?_:s)),o={from:{y:a.from.height/s.height,x:a.from.width/s.width},to:{y:a.to.height/s.height,x:a.to.width/s.width}},("box"===f||"both"===f)&&(o.from.y!==o.to.y&&(v=v.concat(c),a.from=t.effects.setTransition(a,c,o.from.y,a.from),a.to=t.effects.setTransition(a,c,o.to.y,a.to)),o.from.x!==o.to.x&&(v=v.concat(u),a.from=t.effects.setTransition(a,u,o.from.x,a.from),a.to=t.effects.setTransition(a,u,o.to.x,a.to))),("content"===f||"both"===f)&&o.from.y!==o.to.y&&(v=v.concat(l).concat(h),a.from=t.effects.setTransition(a,l,o.from.y,a.from),a.to=t.effects.setTransition(a,l,o.to.y,a.to)),t.effects.save(a,v),a.show(),t.effects.createWrapper(a),a.css("overflow","hidden").css(a.from),g&&(n=t.effects.getBaseline(g,s),a.from.top=(s.outerHeight-a.outerHeight())*n.y,a.from.left=(s.outerWidth-a.outerWidth())*n.x,a.to.top=(s.outerHeight-a.to.outerHeight)*n.y,a.to.left=(s.outerWidth-a.to.outerWidth)*n.x),a.css(a.from),("content"===f||"both"===f)&&(c=c.concat(["marginTop","marginBottom"]).concat(l),u=u.concat(["marginLeft","marginRight"]),h=r.concat(c).concat(u),a.find("*[width]").each(function(){var i=t(this),s=i.height(),n=i.width(),a=i.outerHeight(),r=i.outerWidth();p&&t.effects.save(i,h),i.from={height:s*o.from.y,width:n*o.from.x,outerHeight:a*o.from.y,outerWidth:r*o.from.x},i.to={height:s*o.to.y,width:n*o.to.x,outerHeight:s*o.to.y,outerWidth:n*o.to.x},o.from.y!==o.to.y&&(i.from=t.effects.setTransition(i,c,o.from.y,i.from),i.to=t.effects.setTransition(i,c,o.to.y,i.to)),o.from.x!==o.to.x&&(i.from=t.effects.setTransition(i,u,o.from.x,i.from),i.to=t.effects.setTransition(i,u,o.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){p&&t.effects.restore(i,h)})})),a.animate(a.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===a.to.opacity&&a.css("opacity",a.from.opacity),"hide"===d&&a.hide(),t.effects.restore(a,v),p||("static"===m?a.css({position:"relative",top:a.to.top,left:a.to.left}):t.each(["top","left"],function(t,e){a.css(e,function(e,i){var s=parseInt(i,10),n=t?a.to.left:a.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(a),i()}})}}(jQuery),function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),o=["position","top","bottom","left","right","height","width"],a=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",h=e.distance||20,l=e.times||3,c=2*l+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},g={},m={},v=n.queue(),_=v.length;for(t.effects.save(n,o),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+h,g[d]=(p?"+=":"-=")+2*h,m[d]=(p?"-=":"+=")+2*h,n.animate(f,u,e.easing),s=1;l>s;s++)n.animate(g,u,e.easing).animate(m,u,e.easing);n.animate(g,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===a&&n.hide(),t.effects.restore(n,o),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}}(jQuery),function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),o=["position","top","bottom","left","right","width","height"],a=t.effects.setMode(n,e.mode||"show"),r="show"===a,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u={};t.effects.save(n,o),n.show(),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,c?isNaN(s)?"-"+s:-s:s),u[l]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&n.hide(),t.effects.restore(n,o),t.effects.removeWrapper(n),i()}})}}(jQuery),function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,h=o?a.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}}(jQuery),function(t){t.widget("ui.menu",{version:"1.10.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&t(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,o,a,r,h=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:h=!1,n=this.previousFilter||"",o=String.fromCharCode(e.keyCode),a=!1,clearTimeout(this.filterTimer),o===n?a=!0:o=n+o,r=RegExp("^"+i(o),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),(s=a&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s).length||(o=String.fromCharCode(e.keyCode),r=RegExp("^"+i(o),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=o,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),(e=s.add(this.element)).children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?void(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return 0>(i=t(this)).offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]()))):void this.next(e)},previousPage:function(e){var i,s,n;return this.active?void(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return(i=t(this)).offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first()))):void this.next(e)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})}(jQuery),function(t,e){t.widget("ui.progressbar",{version:"1.10.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=!1===t,"number"!=typeof t&&(t=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})}(jQuery),function(t){function e(t){return parseInt(t,10)||0}function i(t){return!isNaN(parseInt(t,10))}t.widget("ui.resizable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var e,i,s,n,o=this,a=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;e.length>i;i++)s=t.trim(e[i]),(n=t("<div class='ui-resizable-handle "+("ui-resizable-"+s)+"'></div>")).css({zIndex:a.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(e){var i,s,n,o;for(i in e=e||this.element,this.handles)this.handles[i].constructor===String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),t(this.handles[i]).length},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),a.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){a.disabled||(t(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){a.disabled||o.resizing||(t(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)((s=t(this.handles[i])[0])===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,o,a=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=e(this.helper.css("left")),n=e(this.helper.css("top")),a.containment&&(s+=t(a.containment).scrollLeft()||0,n+=t(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,o=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===o?this.axis+"-resize":o),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(e){var i,s=this.helper,n={},o=this.originalMousePosition,a=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,c=this.size.height,u=e.pageX-o.left||0,d=e.pageY-o.top||0,p=this._change[a];return!!p&&(i=p.apply(this,[e,u,d]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==c&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||this._trigger("resize",e,this.ui()),!1)},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(n=(s=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&t.ui.hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,h=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,s,n,o,a,r=this.options;a={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=a.minHeight*this.aspectRatio,n=a.minWidth/this.aspectRatio,s=a.maxHeight*this.aspectRatio,o=a.maxWidth/this.aspectRatio,e>a.minWidth&&(a.minWidth=e),n>a.minHeight&&(a.minHeight=n),a.maxWidth>s&&(a.maxWidth=s),a.maxHeight>o&&(a.maxHeight=o)),this._vBoundaries=a},_updateCache:function(t){this.offset=this.helper.offset(),i(t.left)&&(this.position.left=t.left),i(t.top)&&(this.position.top=t.top),i(t.height)&&(this.size.height=t.height),i(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,s=this.size,n=this.axis;return i(t.height)?t.width=t.height*this.aspectRatio:i(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(s.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(s.height-t.height),t.left=e.left+(s.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,s=this.axis,n=i(t.width)&&e.maxWidth&&e.maxWidth<t.width,o=i(t.height)&&e.maxHeight&&e.maxHeight<t.height,a=i(t.width)&&e.minWidth&&e.minWidth>t.width,r=i(t.height)&&e.minHeight&&e.minHeight>t.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,c=/sw|nw|w/.test(s),u=/nw|ne|n/.test(s);return a&&(t.width=e.minWidth),r&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),o&&(t.height=e.maxHeight),a&&c&&(t.left=h-e.minWidth),n&&c&&(t.left=h-e.maxWidth),r&&u&&(t.top=l-e.minHeight),o&&u&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var t,e,i,s,n,o=this.helper||this.element;for(t=0;this._proportionallyResizeElements.length>t;t++){if(n=this._proportionallyResizeElements[t],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],e=0;i.length>e;e++)this.borderDif[e]=(parseInt(i[e],10)||0)+(parseInt(s[e],10)||0);n.css({height:o.height()-this.borderDif[0]-this.borderDif[2]||0,width:o.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&t.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,o,a,r,h,l=t(this).data("ui-resizable"),c=l.options,u=l.element,d=c.containment,p=d instanceof t?d.get(0):/parent/.test(d)?u.parent().get(0):d;p&&(l.containerElement=t(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(i=t(p),s=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){s[t]=e(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,o=l.containerSize.height,a=l.containerSize.width,r=t.ui.hasScroll(p,"left")?p.scrollWidth:a,h=t.ui.hasScroll(p)?p.scrollHeight:o,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(e){var i,s,n,o,a=t(this).data("ui-resizable"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio),a.position.top=a._helper?h.top:0),a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top,i=Math.abs((a._helper,a.offset.left-u.left+a.sizeDiff.width)),s=Math.abs((a._helper?a.offset.top-u.top:a.offset.top-h.top)+a.sizeDiff.height),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o&&(i-=Math.abs(a.parentData.left)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio))},stop:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).data("ui-resizable").options,i=function(e){t(e).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof e.alsoResize||e.alsoResize.parentNode?i(e.alsoResize):e.alsoResize.length?(e.alsoResize=e.alsoResize[0],i(e.alsoResize)):t.each(e.alsoResize,function(t){i(t)})},resize:function(e,i){var s=t(this).data("ui-resizable"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0},h=function(e,s){t(e).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),o={},a=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(a,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(o[e]=i||null)}),e.css(o)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):t.each(n.alsoResize,function(t,e){h(t,e)})},stop:function(){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).data("ui-resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).data("ui-resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,c=Math.round((s.width-n.width)/h)*h,u=Math.round((s.height-n.height)/l)*l,d=n.width+c,p=n.height+u,f=i.maxWidth&&d>i.maxWidth,g=i.maxHeight&&p>i.maxHeight,m=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=h),v&&(p+=l),f&&(d-=h),g&&(p-=l),/^(se|s|e)$/.test(a)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.top=o.top-u):/^(sw)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.left=o.left-c):(p-l>0?(e.size.height=p,e.position.top=o.top-u):(e.size.height=l,e.position.top=o.top+n.height-l),d-h>0?(e.size.width=d,e.position.left=o.left-c):(e.size.width=h,e.position.left=o.left+n.width-h))}})}(jQuery),function(t){t.widget("ui.selectable",t.ui.mouse,{version:"1.10.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){(e=t(i.options.filter,i.element[0])).addClass("ui-selectee"),e.each(function(){var e=t(this),i=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:i.left,top:i.top,right:i.left+e.outerWidth(),bottom:i.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=t("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,o=this.opos[0],a=this.opos[1],r=e.pageX,h=e.pageY;return o>r&&(i=r,r=o,o=i),a>h&&(i=h,h=a,a=i),this.helper.css({left:o,top:a,width:r-o,height:h-a}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||o>i.right||i.top>h||a>i.bottom):"fit"===n.tolerance&&(l=i.left>o&&r>i.right&&i.top>a&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}})}(jQuery),function(t){t.widget("ui.slider",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(!0===e.range&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,o,a,r,h,l=this,c=this.options;return!c.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-l.values(e));(n>i||n===i&&(e===l._lastChangedValue||l.values(e)===c.min))&&(n=i,o=t(this),a=e)}),!1!==this._start(e,a)&&(this._mouseSliding=!0,this._handleIndex=a,o.addClass("ui-state-active").focus(),r=o.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-r.left-o.width()/2,top:e.pageY-r.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),(s=i/e)>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,o;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&!0===this.options.range&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&((n=this.values())[e]=i,o=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),!1!==o&&this.values(e,i))):i!==this.value()&&(!1!==(o=this._trigger("slide",t,{handle:this.handles[e],value:i}))&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),void this._change(null,e);if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&!0===this.options.range&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,h=this,l=!this._animateOff&&r.animate,c={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=(h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())*100,c["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](c,r.animate),!0===h.options.range&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?(s-n)/(o-n)*100:0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(e){var i,s,n,o=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(e.target).addClass("ui-state-active"),!1===this._start(e,o)))return}switch(n=this.options.step,i=s=this.options.values&&this.options.values.length?this.values(o):this.value(),e.keyCode){case t.ui.keyCode.HOME:s=this._valueMin();break;case t.ui.keyCode.END:s=this._valueMax();break;case t.ui.keyCode.PAGE_UP:s=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/5);break;case t.ui.keyCode.PAGE_DOWN:s=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/5);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(i===this._valueMax())return;s=this._trimAlignValue(i+n);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i===this._valueMin())return;s=this._trimAlignValue(i-n)}this._slide(e,o,s)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})}(jQuery),function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=!!this.items.length&&("x"===t.axis||i(this.items[0].item)),this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):void 0}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),!!s&&(!(this.options.handle&&!i&&(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),!n))&&(this.currentItem=s,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-t(document).scrollTop()<a.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-a.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<a.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+a.scrollSpeed)),e.pageX-t(document).scrollLeft()<a.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-a.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<a.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+a.scrollSpeed))),!1!==r&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(n=(s=this.items[i]).item[0],(o=this._intersectsWithPointer(s))&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"!==this.options.type||!t.contains(this.element[0],n))){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return!!n&&(this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1))},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&s||"left"===o&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(n=(o=t(l[s])).length-1;n>=0;n--)(a=t.data(o[n],this.widgetFullName))&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(s=(n=t(d[i])).length-1;s>=0;s--)(o=t.data(n[s],this.widgetFullName))&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],s=0,l=(r=u[i][0]).length;l>s;s++)(h=t(r[s])).data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){var i,s,n,o;for(this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),i=this.items.length-1;i>=0;i--)(s=this.items[i]).instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){var i,s=(e=e||this).options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t("<td>&#160;</td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,o,a,r,h,l,c,u,d,p,f=null,g=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],g=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[g].containerCache.over||(this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1);else{for(a=1e4,r=null,h=(p=f.floating||i(this.currentItem))?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],o=this.items.length-1;o>=0;o--)t.contains(this.containers[g].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))&&(u=this.items[o].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[o][l]-c)&&(d=!0,u+=this.items[o][l]),a>Math.abs(u-c)&&(a=Math.abs(u-c),r=this.items[o],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[g].element,!0),this._trigger("change",s,this._uiHash()),this.containers[g]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[g],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){!1===t.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})}(jQuery),function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?void delete this.cancelBlur:(this._stop(),this._refresh(),void(this.previous!==this.element.val()&&this._trigger("change",t)))},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){this.element[0]===this.document[0].activeElement||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),!1!==this._start(e)&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?!1!==this._start(e)&&void this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span></a><a class='ui-spinner-button ui-spinner-down ui-corner-br'><span class='ui-icon "+this.options.icons.down+"'>&#9660;</span></a>"},_start:function(t){return!(!this.spinning&&!1===this._trigger("start",t))&&(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",e,{value:i})||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return i=t-(e=null!==s.min?s.min:0),t=e+(i=Math.round(i/s.step)*s.step),t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,void this.element.val(this._format(i))}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(null!==(i=this._parse(t))&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?void e(this._value).call(this,t):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})}(jQuery),function(t,e){function i(t){return(t=t.cloneNode(!1)).hash.length>1&&decodeURIComponent(t.href.replace(n,""))===decodeURIComponent(location.href.replace(n,""))}var s=0,n=/#.*$/;t.widget("ui.tabs",{version:"1.10.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=!1!==this.options.active&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,o){return t(o).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=!!this.tabs.length&&0)),!1!==i&&(-1===(i=this.tabs.index(this.tabs.eq(i)))&&(i=!s&&0)),!s&&!1===i&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),o=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:o=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n!==this.options.active&&n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,o),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){for(var s=this.tabs.length-1;-1!==t.inArray((e>s&&(e=0),0>e&&(e=s),e),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+ ++s},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),!1!==e.active&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(s,n){var o,a,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),c=l.attr("aria-controls");i(n)?(o=n.hash,a=e.element.find(e._sanitizeSelector(o))):(o="#"+(r=e._tabId(l)),(a=e.element.find(o)).length||(a=e._createPanel(r)).insertAfter(e.panels[s-1]||e.tablist),a.attr("aria-live","polite")),a.length&&(e.panels=e.panels.add(a)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":o.substring(1),"aria-labelledby":h}),a.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)!0===e||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget).closest("li"),o=n[0]===s[0],a=o&&i.collapsible,r=a?t():this._getPanelForTab(n),h=s.length?this._getPanelForTab(s):t(),l={oldTab:s,oldPanel:h,newTab:a?t():n,newPanel:r};e.preventDefault(),n.hasClass("ui-state-disabled")||n.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||!1===this._trigger("beforeActivate",e,l)||(i.active=!a&&this.tabs.index(n),this.active=o?t():n,this.xhr&&this.xhr.abort(),h.length||r.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),r.length&&this.load(this.tabs.index(n),e),this._toggle(e,l))},_toggle:function(e,i){function s(){o.running=!1,o._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show(),s())}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return!1===e?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;!1!==s&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(!0!==s){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,s){e=this._getIndex(e);var n=this,o=this.tabs.eq(e),a=o.find(".ui-tabs-anchor"),r=this._getPanelForTab(o),h={tab:o,panel:r};i(a[0])||(this.xhr=t.ajax(this._ajaxSettings(a,s,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(o.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",s,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),o.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})}(jQuery),function(t){var e=0;t.widget("ui.tooltip",{version:"1.10.4",options:{content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),void(this.options[e]=i)):(this._super(e,i),void("content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)})))},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&((e=t.Event("blur")).target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s?this._open(e,t,s):void((i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=o),this._open(e,t,i)})}))&&this._open(e,t,i))},_open:function(e,i,s){function n(t){h.of=t,o.is(":hidden")||o.position(h)}var o,a,r,h=t.extend({},this.options.position);if(s){if((o=this._find(i)).length)return void o.find(".ui-tooltip-content").html(s);i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),o=this._tooltip(i),function(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}(i,o.attr("id")),o.find(".ui-tooltip-content").html(s),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:n}),n(e)):o.position(t.extend({of:i},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){o.is(":visible")&&(n(h.of),clearInterval(r))},t.fx.interval)),this._trigger("open",e,{tooltip:o}),a={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}},remove:function(){this._removeTooltip(o)}},e&&"mouseover"!==e.type||(a.mouseleave="close"),e&&"focusin"!==e.type||(a.focusout="close"),this._on(!0,i,a)}},close:function(e){var i=this,s=t(e?e.currentTarget:this.element),n=this._find(s);this.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&s.attr("title",s.data("ui-tooltip-title")),function(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),(s=t.trim(s.join(" ")))?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}(s),n.stop(!0),this._hide(n,this.options.hide,function(){i._removeTooltip(t(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,s){t(s.element).attr("title",s.title),delete i.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:n}),this.closing=!1)},_tooltip:function(i){var s="ui-tooltip-"+e++,n=t("<div>").attr({id:s,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[s]=i,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})}(jQuery);;!function(t,e,i){var n=t.L,o={version:"0.7.1"};"object"==typeof module&&"object"==typeof module.exports?module.exports=o:"function"==typeof define&&define.amd&&define(o),o.noConflict=function(){return t.L=n,this},t.L=o,o.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++)for(e in o=s[i]||{})o.hasOwnProperty(e)&&(t[e]=o[e]);return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),invokeEach:function(t,e,i){var n,o;if("object"==typeof t){for(n in o=Array.prototype.slice.call(arguments,3),t)e.apply(i,[n,t[n]].concat(o));return!0}return!1},limitExecByInterval:function(t,e,i){var n,o;return function s(){var a=arguments;return n?void(o=!0):(n=!0,setTimeout(function(){n=!1,o&&(s.apply(i,a),o=!1)},e),void t.apply(i,a))}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},splitWords:function(t){return o.Util.trim(t).split(/\s+/)},setOptions:function(t,e){return t.options=o.extend({},t.options,e),t.options},getParamString:function(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,n){var o=e[n];if(o===i)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o})},isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;i<o.length&&!n;i++)n=t[o[i]+e];return n}function i(e){var i=+new Date,o=Math.max(0,16-(i-n));return n=i+o,t.setTimeout(e,o)}var n=0,s=t.requestAnimationFrame||e("RequestAnimationFrame")||i,a=t.cancelAnimationFrame||e("CancelAnimationFrame")||e("CancelRequestAnimationFrame")||function(e){t.clearTimeout(e)};o.Util.requestAnimFrame=function(e,n,a,r){return e=o.bind(e,n),a&&s===i?void e():s.call(t,e,r)},o.Util.cancelAnimFrame=function(e){e&&a.call(t,e)}}(),o.extend=o.Util.extend,o.bind=o.Util.bind,o.stamp=o.Util.stamp,o.setOptions=o.Util.setOptions,o.Class=function(){},o.Class.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this._initHooks&&this.callInitHooks()},i=function(){};i.prototype=this.prototype;var n=new i;for(var s in n.constructor=e,e.prototype=n,this)this.hasOwnProperty(s)&&"prototype"!==s&&(e[s]=this[s]);t.statics&&(o.extend(e,t.statics),delete t.statics),t.includes&&(o.Util.extend.apply(null,[n].concat(t.includes)),delete t.includes),t.options&&n.options&&(t.options=o.extend({},n.options,t.options)),o.extend(n,t),n._initHooks=[];var a=this;return e.__super__=a.prototype,n.callInitHooks=function(){if(!this._initHooksCalled){a.prototype.callInitHooks&&a.prototype.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=n._initHooks.length;e>t;t++)n._initHooks[t].call(this)}},e},o.Class.include=function(t){o.extend(this.prototype,t)},o.Class.mergeOptions=function(t){o.extend(this.prototype.options,t)},o.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";o.Mixin={},o.Mixin.Events={addEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d=this[s]=this[s]||{},p=i&&i!==this&&o.stamp(i);for(n=0,a=(t=o.Util.splitWords(t)).length;a>n;n++)r={action:e,context:i||this},h=t[n],p?(u=(l=h+"_idx")+"_len",(c=d[l]=d[l]||{})[p]||(c[p]=[],d[u]=(d[u]||0)+1),c[p].push(r)):(d[h]=d[h]||[],d[h].push(r));return this},hasEventListeners:function(t){var e=this[s];return!!e&&(t in e&&e[t].length>0||t+"_idx"in e&&e[t+"_idx_len"]>0)},removeEventListener:function(t,e,i){if(!this[s])return this;if(!t)return this.clearAllEventListeners();if(o.Util.invokeEach(t,this.removeEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d,p=this[s],_=i&&i!==this&&o.stamp(i);for(n=0,a=(t=o.Util.splitWords(t)).length;a>n;n++)if(c=(u=(r=t[n])+"_idx")+"_len",d=p[u],e){if(h=_&&d?d[_]:p[r]){for(l=h.length-1;l>=0;l--)h[l].action!==e||i&&h[l].context!==i||(h.splice(l,1)[0].action=o.Util.falseFn);i&&d&&0===h.length&&(delete d[_],p[c]--)}}else delete p[r],delete p[u],delete p[c];return this},clearAllEventListeners:function(){return delete this[s],this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;var i,n,a,r,h,l=o.Util.extend({},e,{type:t,target:this}),u=this[s];if(u[t])for(n=0,a=(i=u[t].slice()).length;a>n;n++)i[n].action.call(i[n].context,l);for(h in r=u[t+"_idx"])if(i=r[h].slice())for(n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context,l);return this},addOneTimeEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addOneTimeEventListener,this,e,i))return this;var n=o.bind(function(){this.removeEventListener(t,e,i).removeEventListener(t,n,i)},this);return this.addEventListener(t,e,i).addEventListener(t,n,i)}},o.Mixin.Events.on=o.Mixin.Events.addEventListener,o.Mixin.Events.off=o.Mixin.Events.removeEventListener,o.Mixin.Events.once=o.Mixin.Events.addOneTimeEventListener,o.Mixin.Events.fire=o.Mixin.Events.fireEvent,function(){var n="ActiveXObject"in t,s=n&&!e.addEventListener,a=navigator.userAgent.toLowerCase(),r=-1!==a.indexOf("webkit"),h=-1!==a.indexOf("chrome"),l=-1!==a.indexOf("phantom"),u=-1!==a.indexOf("android"),c=-1!==a.search("android [23]"),d=-1!==a.indexOf("gecko"),p=typeof orientation!=i+"",_=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints&&!t.PointerEvent,m=t.PointerEvent&&t.navigator.pointerEnabled&&t.navigator.maxTouchPoints||_,f="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,g=e.documentElement,v=n&&"transition"in g.style,y="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix&&!c,P="MozPerspective"in g.style,L="OTransition"in g.style,x=!t.L_DISABLE_3D&&(v||y||P||L)&&!l,w=!t.L_NO_TOUCH&&!l&&function(){var t="ontouchstart";if(m||t in g)return!0;var i=e.createElement("div"),n=!1;return!!i.setAttribute&&(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n)}();o.Browser={ie:n,ielt9:s,webkit:r,gecko:d&&!r&&!t.opera&&!n,android:u,android23:c,chrome:h,ie3d:v,webkit3d:y,gecko3d:P,opera3d:L,any3d:x,mobile:p,mobileWebkit:p&&r,mobileWebkit3d:p&&y,mobileOpera:p&&t.opera,touch:w,msPointer:_,pointer:m,retina:f}}(),o.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},o.Point.prototype={clone:function(){return new o.Point(this.x,this.y)},add:function(t){return this.clone()._add(o.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(o.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(t){var e=(t=o.point(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=o.point(t)).x===this.x&&t.y===this.y},contains:function(t){return t=o.point(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+o.Util.formatNum(this.x)+", "+o.Util.formatNum(this.y)+")"}},o.point=function(t,e,n){return t instanceof o.Point?t:o.Util.isArray(t)?new o.Point(t[0],t[1]):t===i||null===t?t:new o.Point(t,e,n)},o.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.Bounds.prototype={extend:function(t){return t=o.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new o.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new o.Point(this.min.x,this.max.y)},getTopRight:function(){return new o.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof o.Point?o.point(t):o.bounds(t))instanceof o.Bounds?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=o.bounds(t);var e=this.min,i=this.max,n=t.min,s=t.max,a=s.x>=e.x&&n.x<=i.x,r=s.y>=e.y&&n.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},o.bounds=function(t,e){return!t||t instanceof o.Bounds?t:new o.Bounds(t,e)},o.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},o.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new o.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},o.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,n=0,s=0,a=t,r=e.body,h=e.documentElement;do{if(n+=a.offsetTop||0,s+=a.offsetLeft||0,n+=parseInt(o.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(o.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=o.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){n+=r.scrollTop||h.scrollTop||0,s+=r.scrollLeft||h.scrollLeft||0;break}if("relative"===i&&!a.offsetLeft){var l=o.DomUtil.getStyle(a,"width"),u=o.DomUtil.getStyle(a,"max-width"),c=a.getBoundingClientRect();("none"!==l||"none"!==u)&&(s+=c.left+a.clientLeft),n+=c.top+(r.scrollTop||h.scrollTop||0);break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;n-=a.scrollTop||0,s-=a.scrollLeft||0,a=a.parentNode}while(a);return new o.Point(s,n)},documentIsLtr:function(){return o.DomUtil._docIsLtrCached||(o.DomUtil._docIsLtrCached=!0,o.DomUtil._docIsLtr="ltr"===o.DomUtil.getStyle(e.body,"direction")),o.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},hasClass:function(t,e){if(t.classList!==i)return t.classList.contains(e);var n=o.DomUtil._getClass(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)},addClass:function(t,e){if(t.classList!==i)for(var n=o.Util.splitWords(e),s=0,a=n.length;a>s;s++)t.classList.add(n[s]);else if(!o.DomUtil.hasClass(t,e)){var r=o.DomUtil._getClass(t);o.DomUtil._setClass(t,(r?r+" ":"")+e)}},removeClass:function(t,e){t.classList!==i?t.classList.remove(e):o.DomUtil._setClass(t,o.Util.trim((" "+o.DomUtil._getClass(t)+" ").replace(" "+e+" "," ")))},_setClass:function(t,e){t.className.baseVal===i?t.className=e:t.className.baseVal=e},_getClass:function(t){return t.className.baseVal===i?t.className:t.className.baseVal},setOpacity:function(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;n<t.length;n++)if(t[n]in i)return t[n];return!1},getTranslateString:function(t){var e=o.Browser.webkit3d,i=(e?",0":"")+")";return"translate"+(e?"3d":"")+"("+t.x+"px,"+t.y+"px"+i},getScaleString:function(t,e){return o.DomUtil.getTranslateString(e.add(e.multiplyBy(-1*t)))+(" scale("+t+") ")},setPosition:function(t,e,i){t._leaflet_pos=e,!i&&o.Browser.any3d?t.style[o.DomUtil.TRANSFORM]=o.DomUtil.getTranslateString(e):(t.style.left=e.x+"px",t.style.top=e.y+"px")},getPosition:function(t){return t._leaflet_pos}},o.DomUtil.TRANSFORM=o.DomUtil.testProp(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),o.DomUtil.TRANSITION=o.DomUtil.testProp(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),o.DomUtil.TRANSITION_END="webkitTransition"===o.DomUtil.TRANSITION||"OTransition"===o.DomUtil.TRANSITION?o.DomUtil.TRANSITION+"End":"transitionend",function(){if("onselectstart"in e)o.extend(o.DomUtil,{disableTextSelection:function(){o.DomEvent.on(t,"selectstart",o.DomEvent.preventDefault)},enableTextSelection:function(){o.DomEvent.off(t,"selectstart",o.DomEvent.preventDefault)}});else{var i=o.DomUtil.testProp(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);o.extend(o.DomUtil,{disableTextSelection:function(){if(i){var t=e.documentElement.style;this._userSelect=t[i],t[i]="none"}},enableTextSelection:function(){i&&(e.documentElement.style[i]=this._userSelect,delete this._userSelect)}})}o.extend(o.DomUtil,{disableImageDrag:function(){o.DomEvent.on(t,"dragstart",o.DomEvent.preventDefault)},enableImageDrag:function(){o.DomEvent.off(t,"dragstart",o.DomEvent.preventDefault)}})}(),o.LatLng=function(t,e,n){if(t=parseFloat(t),e=parseFloat(e),isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=t,this.lng=e,n!==i&&(this.alt=parseFloat(n))},o.extend(o.LatLng,{DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,MAX_MARGIN:1e-9}),o.LatLng.prototype={equals:function(t){return!!t&&(t=o.latLng(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=o.LatLng.MAX_MARGIN)},toString:function(t){return"LatLng("+o.Util.formatNum(this.lat,t)+", "+o.Util.formatNum(this.lng,t)+")"},distanceTo:function(t){t=o.latLng(t);var e=o.LatLng.DEG_TO_RAD,i=(t.lat-this.lat)*e,n=(t.lng-this.lng)*e,s=this.lat*e,a=t.lat*e,r=Math.sin(i/2),h=Math.sin(n/2),l=r*r+h*h*Math.cos(s)*Math.cos(a);return 12756274*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))},wrap:function(t,e){var i=this.lng;return t=t||-180,i=(i+(e=e||180))%(e-t)+(t>i||i===e?e:t),new o.LatLng(this.lat,i)}},o.latLng=function(t,e){return t instanceof o.LatLng?t:o.Util.isArray(t)?"number"==typeof t[0]||"string"==typeof t[0]?new o.LatLng(t[0],t[1],t[2]):null:t===i||null===t?t:"object"==typeof t&&"lat"in t?new o.LatLng(t.lat,"lng"in t?t.lng:t.lon):e===i?null:new o.LatLng(t,e)},o.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.LatLngBounds.prototype={extend:function(t){if(!t)return this;var e=o.latLng(t);return(t=null!==e?e:o.latLngBounds(t))instanceof o.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new o.LatLng(t.lat,t.lng),this._northEast=new o.LatLng(t.lat,t.lng)):t instanceof o.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new o.LatLngBounds(new o.LatLng(e.lat-n,e.lng-s),new o.LatLng(i.lat+n,i.lng+s))},getCenter:function(){return new o.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new o.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new o.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof o.LatLng?o.latLng(t):o.latLngBounds(t);var e,i,n=this._southWest,s=this._northEast;return t instanceof o.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=s.lat&&e.lng>=n.lng&&i.lng<=s.lng},intersects:function(t){t=o.latLngBounds(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&n.lat<=i.lat,r=s.lng>=e.lng&&n.lng<=i.lng;return a&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t){return!!t&&(t=o.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast()))},isValid:function(){return!(!this._southWest||!this._northEast)}},o.latLngBounds=function(t,e){return!t||t instanceof o.LatLngBounds?t:new o.LatLngBounds(t,e)},o.Projection={},o.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=n*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new o.Point(s,a)},unproject:function(t){var e=o.LatLng.RAD_TO_DEG,i=t.x*e,n=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new o.LatLng(n,i)}},o.Projection.LonLat={project:function(t){return new o.Point(t.lng,t.lat)},unproject:function(t){return new o.LatLng(t.y,t.x)}},o.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)},getSize:function(t){var e=this.scale(t);return o.point(e,e)}},o.CRS.Simple=o.extend({},o.CRS,{projection:o.Projection.LonLat,transformation:new o.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),o.CRS.EPSG3857=o.extend({},o.CRS,{code:"EPSG:3857",projection:o.Projection.SphericalMercator,transformation:new o.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){return this.projection.project(t).multiplyBy(6378137)}}),o.CRS.EPSG900913=o.extend({},o.CRS.EPSG3857,{code:"EPSG:900913"}),o.CRS.EPSG4326=o.extend({},o.CRS,{code:"EPSG:4326",projection:o.Projection.LonLat,transformation:new o.Transformation(1/360,.5,-1/360,.5)}),o.Map=o.Class.extend({includes:o.Mixin.Events,options:{crs:o.CRS.EPSG3857,fadeAnimation:o.DomUtil.TRANSITION&&!o.Browser.android23,trackResize:!0,markerZoomAnimation:o.DomUtil.TRANSITION&&o.Browser.any3d},initialize:function(t,e){e=o.setOptions(this,e),this._initContainer(t),this._initLayout(),this._onResize=o.bind(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(o.latLng(e.center),e.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0,this.callInitHooks(),this._addLayers(e.layers)},setView:function(t,e){return e=e===i?this.getZoom():e,this._resetView(o.latLng(t),this._limitZoom(e)),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=this._limitZoom(t),this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t||1),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t||1),e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),s=this.getSize().divideBy(2),a=(t instanceof o.Point?t:this.latLngToContainerPoint(t)).subtract(s).multiplyBy(1-1/n),r=this.containerPointToLatLng(s.add(a));return this.setView(r,e,{zoom:i})},fitBounds:function(t,e){e=e||{},t=t.getBounds?t.getBounds():o.latLngBounds(t);var i=o.point(e.paddingTopLeft||e.padding||[0,0]),n=o.point(e.paddingBottomRight||e.padding||[0,0]),s=this.getBoundsZoom(t,!1,i.add(n)),a=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),s),h=this.project(t.getNorthEast(),s),l=this.unproject(r.add(h).divideBy(2).add(a),s);return s=e&&e.maxZoom?Math.min(e.maxZoom,s):s,this.setView(l,s,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t){return this.fire("movestart"),this._rawPanBy(o.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t){return t=o.latLngBounds(t),this.options.maxBounds=t,t?(this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds,this)):this.off("moveend",this._panInsideMaxBounds,this)},panInsideBounds:function(t,e){var i=this.getCenter(),n=this._limitCenter(i,this._zoom,t);return i.equals(n)?this:this.panTo(n,e)},addLayer:function(t){var e=o.stamp(t);return this._layers[e]?this:(this._layers[e]=t,!t.options||isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[e]=t,this._updateZoomLevels()),this.options.zoomAnimation&&o.TileLayer&&t instanceof o.TileLayer&&(this._tileLayersNum++,this._tileLayersToLoad++,t.on("load",this._onTileLayerLoad,this)),this._loaded&&this._layerAdd(t),this)},removeLayer:function(t){var e=o.stamp(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&this.fire("layerremove",{layer:t}),this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels()),this.options.zoomAnimation&&o.TileLayer&&t instanceof o.TileLayer&&(this._tileLayersNum--,this._tileLayersToLoad--,t.off("load",this._onTileLayerLoad,this)),this):this},hasLayer:function(t){return!!t&&o.stamp(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},invalidateSize:function(t){if(!this._loaded)return this;t=o.extend({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._initialCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),s=i.divideBy(2).round(),a=n.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o.bind(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){this._loaded&&this.fire("unload"),this._initEvents("off");try{delete this._container._leaflet}catch(t){this._container._leaflet=i}return this._clearPanes(),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this},getCenter:function(){return this._checkIfLoaded(),this._initialCenter&&!this._moved()?this._initialCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new o.LatLngBounds(e,i)},getMinZoom:function(){return this.options.minZoom===i?this._layersMinZoom===i?0:this._layersMinZoom:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===i?this._layersMaxZoom===i?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=o.latLngBounds(t);var n,s=this.getMinZoom()-(e?1:0),a=this.getMaxZoom(),r=this.getSize(),h=t.getNorthWest(),l=t.getSouthEast(),u=!0;i=o.point(i||[0,0]);do{s++,n=this.project(l,s).subtract(this.project(h,s)).add(i),u=e?n.x<r.x||n.y<r.y:r.contains(n)}while(u&&a>=s);return u&&e?null:e?s:s-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new o.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new o.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(o.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(o.point(t),e)},layerPointToLatLng:function(t){var e=o.point(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(o.latLng(t))._round()._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(t){return o.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return o.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(o.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(o.latLng(t)))},mouseEventToContainerPoint:function(t){return o.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=o.DomUtil.get(t);if(!e)throw new Error("Map container not found.");if(e._leaflet)throw new Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;o.DomUtil.addClass(t,"leaflet-container"+(o.Browser.touch?" leaflet-touch":"")+(o.Browser.retina?" leaflet-retina":"")+(o.Browser.ielt9?" leaflet-oldie":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var e=o.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(o.DomUtil.addClass(t.markerPane,e),o.DomUtil.addClass(t.shadowPane,e),o.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return o.DomUtil.create("div",t,e||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(t){for(var e=0,i=(t=t?o.Util.isArray(t)?t:[t]:[]).length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,n){var s=this._zoom!==e;n||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialCenter=t,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):o.DomUtil.setPosition(this._mapPane,new o.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,a&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("viewreset",{hard:!i}),this.fire("move"),(s||n)&&this.fire("zoomend"),this.fire("moveend",{hard:!i})},_rawPanBy:function(t){o.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var t,e=1/0,n=-1/0,o=this._getZoomSpan();for(t in this._zoomBoundLayers){var s=this._zoomBoundLayers[t];isNaN(s.options.minZoom)||(e=Math.min(e,s.options.minZoom)),isNaN(s.options.maxZoom)||(n=Math.max(n,s.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e),o!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){if(o.DomEvent){e=e||"on",o.DomEvent[e](this._container,"click",this._onMouseClick,this);var i,n,s=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(i=0,n=s.length;n>i;i++)o.DomEvent[e](this._container,s[i],this._fireMouseEvent,this);this.options.trackResize&&o.DomEvent[e](t,"resize",this._onResize,this)}},_onResize:function(){o.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=o.Util.requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this,!1,this._container)},_onMouseClick:function(t){!this._loaded||!t._simulated&&(this.dragging&&this.dragging.moved()||this.boxZoom&&this.boxZoom.moved())||o.DomEvent._skipped(t)||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded&&!o.DomEvent._skipped(t)){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&o.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),n=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(n);this.fire(e,{latlng:s,layerPoint:n,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var t=0,e=this._handlers.length;e>t;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_layerAdd:function(t){t.onAdd(this),this.fire("layeradd",{layer:t})},_getMapPanePos:function(){return o.DomUtil.getPosition(this._mapPane)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),s=this.getSize().divideBy(2),a=new o.Bounds(n.subtract(s),n.add(s)),r=this._getBoundsOffset(a,i,e);return this.unproject(n.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new o.Bounds(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=this.project(e.getNorthWest(),i).subtract(t.min),s=this.project(e.getSouthEast(),i).subtract(t.max),a=this._rebound(n.x,-s.x),r=this._rebound(n.y,-s.y);return new o.Point(a,r)},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom();return Math.max(e,Math.min(i,t))}}),o.map=function(t,e){return new o.Map(t,e)},o.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.314245179,R_MAJOR:6378137,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=n*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var d=Math.tan(.5*(.5*Math.PI-h))/c;return h=-s*Math.log(d),new o.Point(r,h)},unproject:function(t){for(var e,i=o.LatLng.RAD_TO_DEG,n=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/n,r=s/n,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/n),u=Math.PI/2-2*Math.atan(l),c=15,d=.1;Math.abs(d)>1e-7&&--c>0;)e=h*Math.sin(u),u+=d=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u;return new o.LatLng(u*i,a)}},o.CRS.EPSG3395=o.extend({},o.CRS,{code:"EPSG:3395",projection:o.Projection.Mercator,transformation:function(){var t=o.Projection.Mercator.R_MAJOR,e=.5/(Math.PI*t);return new o.Transformation(e,.5,-e,.5)}()}),o.TileLayer=o.Class.extend({includes:o.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:o.Browser.mobile,updateWhenIdle:o.Browser.mobile},initialize:function(t,e){(e=o.setOptions(this,e)).detectRetina&&o.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),e.bounds&&(e.bounds=o.latLngBounds(e.bounds)),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._animated=t._zoomAnimated,this._initContainer(),t.on({viewreset:this._reset,moveend:this._update},this),this._animated&&t.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=o.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._reset,moveend:this._update},this),this._animated&&t.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){var t,e=this._tiles;if(o.Browser.ielt9)for(t in e)o.DomUtil.setOpacity(e[t],this.options.opacity);else o.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var t=this._map._panes.tilePane;if(!this._container){if(this._container=o.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var e="leaflet-tile-container";this._bgBuffer=o.DomUtil.create("div",e,this._container),this._tileContainer=o.DomUtil.create("div",e,this._container)}else this._tileContainer=this._container;t.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(t){for(var e in this._tiles)this.fire("tileunload",{tile:this._tiles[e]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&t&&t.hard&&this._clearBgBuffer(),this._initContainer()},_getTileSize:function(){var t=this._map,e=t.getZoom()+this.options.zoomOffset,i=this.options.maxNativeZoom,n=this.options.tileSize;return i&&e>i&&(n=Math.round(t.getZoomScale(e)/t.getZoomScale(i)*n)),n},_update:function(){if(this._map){var t=this._map,e=t.getPixelBounds(),i=t.getZoom(),n=this._getTileSize();if(!(i>this.options.maxZoom||i<this.options.minZoom)){var s=o.bounds(e.min.divideBy(n)._floor(),e.max.divideBy(n)._floor());this._addTilesFromCenterOut(s),(this.options.unloadInvisibleTiles||this.options.reuseTiles)&&this._removeOtherTiles(s)}}},_addTilesFromCenterOut:function(t){var i,n,s,a=[],r=t.getCenter();for(i=t.min.y;i<=t.max.y;i++)for(n=t.min.x;n<=t.max.x;n++)s=new o.Point(n,i),this._tileShouldBeLoaded(s)&&a.push(s);var h=a.length;if(0!==h){a.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)});var l=e.createDocumentFragment();for(this._tilesToLoad||this.fire("loading"),this._tilesToLoad+=h,n=0;h>n;n++)this._addTile(a[n],l);this._tileContainer.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;var e=this.options;if(!e.continuousWorld){var i=this._getWrapTileNum();if(e.noWrap&&(t.x<0||t.x>=i.x)||t.y<0||t.y>=i.y)return!1}if(e.bounds){var n=e.tileSize,o=t.multiplyBy(n),s=o.add([n,n]),a=this._map.unproject(o),r=this._map.unproject(s);if(e.continuousWorld||e.noWrap||(a=a.wrap(),r=r.wrap()),!e.bounds.intersects([a,r]))return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(i<t.min.x||i>t.max.x||n<t.min.y||n>t.max.y)&&this._removeTile(o)},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(o.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._tileContainer&&this._tileContainer.removeChild(e),o.Browser.android||(e.onload=null,e.src=o.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),n=this._getTile();o.DomUtil.setPosition(n,i,o.Browser.chrome),this._tiles[t.x+":"+t.y]=n,this._loadTile(n,t),n.parentNode!==this._tileContainer&&e.appendChild(n)},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+=t.zoomOffset,t.maxNativeZoom?Math.min(e,t.maxNativeZoom):e},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this._getTileSize();return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return o.Util.template(this._url,o.extend({s:this._getSubdomain(t),z:t.z,x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){return this._map.options.crs.getSize(this._map.getZoom()).divideBy(this.options.tileSize)},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e.x+e.x)%e.x),this.options.tms&&(t.y=e.y-t.y-1),t.z=this._getZoomForUrl()},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=o.DomUtil.create("img","leaflet-tile");return t.style.width=t.style.height=this._getTileSize()+"px",t.galleryimg="no",t.onselectstart=t.onmousemove=o.Util.falseFn,o.Browser.ielt9&&this.options.opacity!==i&&o.DomUtil.setOpacity(t,this.options.opacity),o.Browser.mobileWebkit3d&&(t.style.WebkitBackfaceVisibility="hidden"),t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,this._adjustTilePoint(e),t.src=this.getTileUrl(e),this.fire("tileloadstart",{tile:t,url:t.src})},_tileLoaded:function(){this._tilesToLoad--,this._animated&&o.DomUtil.addClass(this._tileContainer,"leaflet-zoom-animated"),this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(o.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var t=this._layer;this.src!==o.Util.emptyImageUrl&&(o.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),o.tileLayer=function(t,e){return new o.TileLayer(t,e)},o.TileLayer.WMS=o.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=o.extend({},this.defaultWmsParams),n=e.tileSize||this.options.tileSize;for(var s in i.width=i.height=e.detectRetina&&o.Browser.retina?2*n:n,e)this.options.hasOwnProperty(s)||"crs"===s||(i[s]=e[s]);this.wmsParams=i,o.setOptions(this,e)},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,o.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._map,i=this.options.tileSize,n=t.multiplyBy(i),s=n.add([i,i]),a=this._crs.project(e.unproject(n,t.z)),r=this._crs.project(e.unproject(s,t.z)),h=this._wmsVersion>=1.3&&this._crs===o.CRS.EPSG4326?[r.y,a.x,a.y,r.x].join(","):[a.x,r.y,r.x,a.y].join(","),l=o.Util.template(this._url,{s:this._getSubdomain(t)});return l+o.Util.getParamString(this.wmsParams,l,!0)+"&BBOX="+h},setParams:function(t,e){return o.extend(this.wmsParams,t),e||this.redraw(),this}}),o.tileLayer.wms=function(t,e){return new o.TileLayer.WMS(t,e)},o.TileLayer.Canvas=o.TileLayer.extend({options:{async:!1},initialize:function(t){o.setOptions(this,t)},redraw:function(){for(var t in this._map&&(this._reset({hard:!0}),this._update()),this._tiles)this._redrawTile(this._tiles[t]);return this},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTile:function(){var t=o.DomUtil.create("canvas","leaflet-tile");return t.width=t.height=this.options.tileSize,t.onselectstart=t.onmousemove=o.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),o.tileLayer.canvas=function(t){return new o.TileLayer.Canvas(t)},o.ImageOverlay=o.Class.extend({includes:o.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=o.latLngBounds(e),o.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&o.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},setUrl:function(t){this._url=t,this._image.src=this._url},getAttribution:function(){return this.options.attribution},_initImage:function(){this._image=o.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&o.Browser.any3d?o.DomUtil.addClass(this._image,"leaflet-zoom-animated"):o.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),o.extend(this._image,{galleryimg:"no",onselectstart:o.Util.falseFn,onmousemove:o.Util.falseFn,onload:o.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,n=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/n)));i.style[o.DomUtil.TRANSFORM]=o.DomUtil.getTranslateString(l)+" scale("+n+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);o.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){o.DomUtil.setOpacity(this._image,this.options.opacity)}}),o.imageOverlay=function(t,e,i){return new o.ImageOverlay(t,e,i)},o.Icon=o.Class.extend({options:{className:""},initialize:function(t){o.setOptions(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i,n=this._getIconUrl(t);if(!n){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}return i=e&&"IMG"===e.tagName?this._createImg(n,e):this._createImg(n),this._setIconStyles(i,t),i},_setIconStyles:function(t,e){var i,n=this.options,s=o.point(n[e+"Size"]);!(i="shadow"===e?o.point(n.shadowAnchor||n.iconAnchor):o.point(n.iconAnchor))&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+n.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t,i){return(i=i||e.createElement("img")).src=t,i},_getIconUrl:function(t){return o.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),o.icon=function(t){return new o.Icon(t)},o.Icon.Default=o.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];o.Browser.retina&&"icon"===t&&(t+="-2x");var i=o.Icon.Default.imagePath;if(!i)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),o.Icon.Default.imagePath=function(){var t,i,n,o,s=e.getElementsByTagName("script"),a=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=s.length;i>t;t++)if((n=s[t].src).match(a))return((o=n.split(a)[0])?o+"/":"")+"images"}(),o.Marker=o.Class.extend({includes:o.Mixin.Events,options:{icon:new o.Icon.Default,title:"",alt:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){o.setOptions(this,e),this._latlng=o.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),this.fire("add"),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this.dragging&&this.dragging.disable(),this._removeIcon(),this._removeShadow(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=o.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation?"leaflet-zoom-animated":"leaflet-zoom-hide",n=t.icon.createIcon(this._icon),s=!1;n!==this._icon&&(this._icon&&this._removeIcon(),s=!0,t.title&&(n.title=t.title),t.alt&&(n.alt=t.alt)),o.DomUtil.addClass(n,i),t.keyboard&&(n.tabIndex="0"),this._icon=n,this._initInteraction(),t.riseOnHover&&o.DomEvent.on(n,"mouseover",this._bringToFront,this).on(n,"mouseout",this._resetZIndex,this);var a=t.icon.createShadow(this._shadow),r=!1;a!==this._shadow&&(this._removeShadow(),r=!0),a&&o.DomUtil.addClass(a,i),this._shadow=a,t.opacity<1&&this._updateOpacity();var h=this._map._panes;s&&h.markerPane.appendChild(this._icon),a&&r&&h.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&o.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),this._map._panes.markerPane.removeChild(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._shadow=null},_setPos:function(t){o.DomUtil.setPosition(this._icon,t),this._shadow&&o.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];o.DomUtil.addClass(t,"leaflet-clickable"),o.DomEvent.on(t,"click",this._onMouseClick,this),o.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;i<e.length;i++)o.DomEvent.on(t,e[i],this._fireMouseEvent,this);o.Handler.MarkerDrag&&(this.dragging=new o.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_onMouseClick:function(t){var e=this.dragging&&this.dragging.moved();(this.hasEventListeners(t.type)||e)&&o.DomEvent.stopPropagation(t),e||(this.dragging&&this.dragging._enabled||!this._map.dragging||!this._map.dragging.moved())&&this.fire(t.type,{originalEvent:t,latlng:this._latlng})},_onKeyPress:function(t){13===t.keyCode&&this.fire("click",{originalEvent:t,latlng:this._latlng})},_fireMouseEvent:function(t){this.fire(t.type,{originalEvent:t,latlng:this._latlng}),"contextmenu"===t.type&&this.hasEventListeners(t.type)&&o.DomEvent.preventDefault(t),"mousedown"!==t.type?o.DomEvent.stopPropagation(t):o.DomEvent.preventDefault(t)},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){o.DomUtil.setOpacity(this._icon,this.options.opacity),this._shadow&&o.DomUtil.setOpacity(this._shadow,this.options.opacity)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)}}),o.marker=function(t,e){return new o.Marker(t,e)},o.DivIcon=o.Icon.extend({options:{iconSize:[12,12],className:"leaflet-div-icon",html:!1},createIcon:function(t){var i=t&&"DIV"===t.tagName?t:e.createElement("div"),n=this.options;return i.innerHTML=!1!==n.html?n.html:"",n.bgPos&&(i.style.backgroundPosition=-n.bgPos.x+"px "+-n.bgPos.y+"px"),this._setIconStyles(i,"icon"),i},createShadow:function(){return null}}),o.divIcon=function(t){return new o.DivIcon(t)},o.Map.mergeOptions({closePopupOnClick:!0}),o.Popup=o.Class.extend({includes:o.Mixin.Events,options:{minWidth:50,maxWidth:300,autoPan:!0,closeButton:!0,offset:[0,7],autoPanPadding:[5,5],keepInView:!1,className:"",zoomAnimation:!0},initialize:function(t,e){o.setOptions(this,t),this._source=e,this._animated=o.Browser.any3d&&this.options.zoomAnimation,this._isOpen=!1},onAdd:function(t){this._map=t,this._container||this._initLayout();var e=t.options.fadeAnimation;e&&o.DomUtil.setOpacity(this._container,0),t._panes.popupPane.appendChild(this._container),t.on(this._getEvents(),this),this.update(),e&&o.DomUtil.setOpacity(this._container,1),this.fire("open"),t.fire("popupopen",{popup:this}),this._source&&this._source.fire("popupopen",{popup:this})},addTo:function(t){return t.addLayer(this),this},openOn:function(t){return t.openPopup(this),this},onRemove:function(t){t._panes.popupPane.removeChild(this._container),o.Util.falseFn(this._container.offsetWidth),t.off(this._getEvents(),this),t.options.fadeAnimation&&o.DomUtil.setOpacity(this._container,0),this._map=null,this.fire("close"),t.fire("popupclose",{popup:this}),this._source&&this._source.fire("popupclose",{popup:this})},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=o.latLng(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},_getEvents:function(){var t={viewreset:this._updatePosition};return this._animated&&(t.zoomanim=this._zoomAnimation),("closeOnClick"in this.options?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t,e="leaflet-popup",i=e+" "+this.options.className+" leaflet-zoom-"+(this._animated?"animated":"hide"),n=this._container=o.DomUtil.create("div",i);this.options.closeButton&&((t=this._closeButton=o.DomUtil.create("a",e+"-close-button",n)).href="#close",t.innerHTML="&#215;",o.DomEvent.disableClickPropagation(t),o.DomEvent.on(t,"click",this._onCloseButtonClick,this));var s=this._wrapper=o.DomUtil.create("div",e+"-content-wrapper",n);o.DomEvent.disableClickPropagation(s),this._contentNode=o.DomUtil.create("div",e+"-content",s),o.DomEvent.disableScrollPropagation(this._contentNode),o.DomEvent.on(s,"contextmenu",o.DomEvent.stopPropagation),this._tipContainer=o.DomUtil.create("div",e+"-tip-container",n),this._tip=o.DomUtil.create("div",e+"-tip",this._tipContainer)},_updateContent:function(){if(this._content){if("string"==typeof this._content)this._contentNode.innerHTML=this._content;else{for(;this._contentNode.hasChildNodes();)this._contentNode.removeChild(this._contentNode.firstChild);this._contentNode.appendChild(this._content)}this.fire("contentupdate")}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,s=this.options.maxHeight,a="leaflet-popup-scrolled";s&&n>s?(e.height=s+"px",o.DomUtil.addClass(t,a)):o.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=o.point(this.options.offset);e&&o.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);o.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,n=new o.Point(this._containerLeft,-e-this._containerBottom);this._animated&&n._add(o.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(n),a=o.point(this.options.autoPanPadding),r=o.point(this.options.autoPanPaddingTopLeft||a),h=o.point(this.options.autoPanPaddingBottomRight||a),l=t.getSize(),u=0,c=0;s.x+i+h.x>l.x&&(u=s.x+i-l.x+h.x),s.x-u-r.x<0&&(u=s.x-r.x),s.y+e+h.y>l.y&&(c=s.y+e-l.y+h.y),s.y-c-r.y<0&&(c=s.y-r.y),(u||c)&&t.fire("autopanstart").panBy([u,c])}},_onCloseButtonClick:function(t){this._close(),o.DomEvent.stop(t)}}),o.popup=function(t,e){return new o.Popup(t,e)},o.Map.include({openPopup:function(t,e,i){if(this.closePopup(),!(t instanceof o.Popup)){var n=t;t=new o.Popup(i).setLatLng(e).setContent(n)}return t._isOpen=!0,this._popup=t,this.addLayer(t)},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&(this.removeLayer(t),t._isOpen=!1),this}}),o.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(){return this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup()),this},bindPopup:function(t,e){var i=o.point(this.options.icon.options.popupAnchor||[0,0]);return i=i.add(o.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=o.extend({offset:i},e),this._popupHandlersAdded||(this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),this._popupHandlersAdded=!0),t instanceof o.Popup?(o.setOptions(t,e),this._popup=t):this._popup=new o.Popup(e,this).setContent(t),this},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.togglePopup,this).off("remove",this.closePopup,this).off("move",this._movePopup,this),this._popupHandlersAdded=!1),this},getPopup:function(){return this._popup},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),o.LayerGroup=o.Class.extend({initialize:function(t){var e,i;if(this._layers={},t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&(t in this._layers||this.getLayerId(t)in this._layers)},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];for(var e in this._layers)t.push(this._layers[e]);return t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return o.stamp(t)}}),o.layerGroup=function(t){return new o.LayerGroup(t)},o.FeatureGroup=o.LayerGroup.extend({includes:o.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(t){return this.hasLayer(t)?this:("on"in t&&t.on(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.off(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})):this},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},openPopup:function(t){for(var e in this._layers){this._layers[e].openPopup(t);break}return this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new o.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof o.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t=o.extend({layer:t.target,target:this},t),this.fire(t.type,t)}}),o.featureGroup=function(t){return new o.FeatureGroup(t)},o.Path=o.Class.extend({includes:[o.Mixin.Events],statics:{CLIP_PADDING:function(){var e=((o.Browser.mobile?1280:2e3)/Math.max(t.outerWidth,t.outerHeight)-1)/2;return Math.max(0,Math.min(.5,e))}()},options:{stroke:!0,color:"#0033ff",dashArray:null,lineCap:null,lineJoin:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){o.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,o.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return o.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),o.Map.include({_updatePathViewport:function(){var t=o.Path.CLIP_PADDING,e=this.getSize(),i=o.DomUtil.getPosition(this._mapPane).multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),n=i.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new o.Bounds(i,n)}}),o.Path.SVG_NS="http://www.w3.org/2000/svg",o.Browser.svg=!(!e.createElementNS||!e.createElementNS(o.Path.SVG_NS,"svg").createSVGRect),o.Path=o.Path.extend({statics:{SVG:o.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(o.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this.options.className&&o.DomUtil.addClass(this._path,this.options.className),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray"),this.options.lineCap&&this._path.setAttribute("stroke-linecap",this.options.lineCap),this.options.lineJoin&&this._path.setAttribute("stroke-linejoin",this.options.lineJoin)):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(o.Browser.svg||!o.Browser.vml)&&o.DomUtil.addClass(this._path,"leaflet-clickable"),o.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;e<t.length;e++)o.DomEvent.on(this._container,t[e],this._fireMouseEvent,this)}},_onMouseClick:function(t){this._map.dragging&&this._map.dragging.moved()||this._fireMouseEvent(t)},_fireMouseEvent:function(t){if(this.hasEventListeners(t.type)){var e=this._map,i=e.mouseEventToContainerPoint(t),n=e.containerPointToLayerPoint(i),s=e.layerPointToLatLng(n);this.fire(t.type,{latlng:s,layerPoint:n,containerPoint:i,originalEvent:t}),"contextmenu"===t.type&&o.DomEvent.preventDefault(t),"mousemove"!==t.type&&o.DomEvent.stopPropagation(t)}}}),o.Map.include({_initPathRoot:function(){this._pathRoot||(this._pathRoot=o.Path.prototype._createElement("svg"),this._panes.overlayPane.appendChild(this._pathRoot),this.options.zoomAnimation&&o.Browser.any3d?(o.DomUtil.addClass(this._pathRoot,"leaflet-zoom-animated"),this.on({zoomanim:this._animatePathZoom,zoomend:this._endPathZoom})):o.DomUtil.addClass(this._pathRoot,"leaflet-zoom-hide"),this.on("moveend",this._updateSvgViewport),this._updateSvgViewport())},_animatePathZoom:function(t){var e=this.getZoomScale(t.zoom),i=this._getCenterOffset(t.center)._multiplyBy(-e)._add(this._pathViewport.min);this._pathRoot.style[o.DomUtil.TRANSFORM]=o.DomUtil.getTranslateString(i)+" scale("+e+") ",this._pathZooming=!0},_endPathZoom:function(){this._pathZooming=!1},_updateSvgViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max,n=i.x-e.x,s=i.y-e.y,a=this._pathRoot,r=this._panes.overlayPane;o.Browser.mobileWebkit&&r.removeChild(a),o.DomUtil.setPosition(a,e),a.setAttribute("width",n),a.setAttribute("height",s),a.setAttribute("viewBox",[e.x,e.y,n,s].join(" ")),o.Browser.mobileWebkit&&r.appendChild(a)}}}),o.Path.include({bindPopup:function(t,e){return t instanceof o.Popup?this._popup=t:((!this._popup||e)&&(this._popup=new o.Popup(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on("click",this._openPopup,this).on("remove",this.closePopup,this),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this._openPopup).off("remove",this.closePopup),this._popupHandlersAdded=!1),this},openPopup:function(t){return this._popup&&(t=t||this._latlng||this._latlngs[Math.floor(this._latlngs.length/2)],this._openPopup({latlng:t})),this},closePopup:function(){return this._popup&&this._popup._close(),this},_openPopup:function(t){this._popup.setLatLng(t.latlng),this._map.openPopup(this._popup)}}),o.Browser.vml=!o.Browser.svg&&function(){try{var t=e.createElement("div");t.innerHTML='<v:shape adj="1"/>';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(t){return!1}}(),o.Path=o.Browser.svg||!o.Browser.vml?o.Path:o.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape");o.DomUtil.addClass(t,"leaflet-vml-shape"+(this.options.className?" "+this.options.className:"")),this.options.clickable&&o.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||((t=this._stroke=this._createElement("stroke")).endcap="round",n.appendChild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,t.dashStyle=i.dashArray?o.Util.isArray(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):"",i.lineCap&&(t.endcap=i.lineCap.replace("butt","flat")),i.lineJoin&&(t.joinstyle=i.lineJoin)):t&&(n.removeChild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createElement("fill"),n.appendChild(e)),e.color=i.fillColor||i.color,e.opacity=i.fillOpacity):e&&(n.removeChild(e),this._fill=null)},_updatePath:function(){var t=this._container.style;t.display="none",this._path.v=this.getPathString()+" ",t.display=""}}),o.Map.include(o.Browser.svg||!o.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var t=this._pathRoot=e.createElement("div");t.className="leaflet-vml-container",this._panes.overlayPane.appendChild(t),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),o.Browser.canvas=!!e.createElement("canvas").getContext,o.Path=o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?o.Path:o.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(t){return o.setOptions(this,t),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(t){t.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!o.Path._updateRequest&&(o.Path._updateRequest=o.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){o.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var t=this.options;t.stroke&&(this._ctx.lineWidth=t.weight,this._ctx.strokeStyle=t.color),t.fill&&(this._ctx.fillStyle=t.fillColor||t.color)},_drawPath:function(){var t,e,i,n,s,a;for(this._ctx.beginPath(),t=0,i=this._parts.length;i>t;t++){for(e=0,n=this._parts[t].length;n>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"To",this._ctx[a](s.x,s.y);this instanceof o.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill()),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onClick,this))},_onClick:function(t){this._containsPoint(t.layerPoint)&&this.fire("click",t)},_onMouseMove:function(t){this._map&&!this._map._animatingZoom&&(this._containsPoint(t.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",t)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",t)))}}),o.Map.include(o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?{}:{_initPathRoot:function(){var t,i=this._pathRoot;i||((i=this._pathRoot=e.createElement("canvas")).style.position="absolute",(t=this._canvasCtx=i.getContext("2d")).lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(i),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),n=this._pathRoot;o.DomUtil.setPosition(n,e),n.width=i.x,n.height=i.y,n.getContext("2d").translate(-e.x,-e.y)}}}),o.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var n=t.length,o=new(typeof Uint8Array!=i+""?Uint8Array:Array)(n);o[0]=o[n-1]=1,this._simplifyDPStep(t,o,e,0,n-1);var s,a=[];for(s=0;n>s;s++)o[s]&&a.push(t[s]);return a},_simplifyDPStep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)(r=this._sqClosestPointOnSegment(t[a],t[n],t[o],!0))>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o,s,a,r=n?this._lastCode:this._getBitCode(t,i),h=this._getBitCode(e,i);for(this._lastCode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getEdgeIntersection(t,e,o,i),a=this._getBitCode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getEdgeIntersection:function(t,e,i,n){var s=e.x-t.x,a=e.y-t.y,r=n.min,h=n.max;return 8&i?new o.Point(t.x+s*(h.y-t.y)/a,h.y):4&i?new o.Point(t.x+s*(r.y-t.y)/a,r.y):2&i?new o.Point(h.x,t.y+a*(h.x-t.x)/s):1&i?new o.Point(r.x,t.y+a*(r.x-t.x)/s):void 0},_getBitCode:function(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,n){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&((s=((t.x-a)*h+(t.y-r)*l)/u)>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,n?h*h+l*l:new o.Point(a,r)}},o.Polyline=o.Path.extend({initialize:function(t,e){o.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(o.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),t},closestLayerPoint:function(t){for(var e,i,n=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u];var d=o.LineUtil._sqClosestPointOnSegment(t,e,i,!0);n>d&&(n=d,a=o.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(n)),a},getBounds:function(){return new o.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(t,e){var i,n,s=e?t:[];for(i=0,n=t.length;n>i;i++){if(o.Util.isArray(t[i])&&"number"!=typeof t[i][0])return;s[i]=o.latLng(t[i])}return s},_initEvents:function(){o.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=o.Path.VML,n=0,s=t.length,a="";s>n;n++)e=t[n],i&&e._round(),a+=(n?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,i,n=this._originalPoints,s=n.length;if(this.options.noClip)this._parts=[n];else{this._parts=[];var a=this._parts,r=this._map._pathViewport,h=o.LineUtil;for(t=0,e=0;s-1>t;t++)(i=h.clipSegment(n[t],n[t+1],r,t))&&(a[e]=a[e]||[],a[e].push(i[0]),(i[1]!==n[t+1]||t===s-2)&&(a[e].push(i[1]),e++))}},_simplifyPoints:function(){for(var t=this._parts,e=o.LineUtil,i=0,n=t.length;n>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),o.Path.prototype._updatePath.call(this))}}),o.polyline=function(t,e){return new o.Polyline(t,e)},o.PolyUtil={},o.PolyUtil.clipPolygon=function(t,e){var i,n,s,a,r,h,l,u,c,d=[1,4,2,8],p=o.LineUtil;for(n=0,l=t.length;l>n;n++)t[n]._code=p._getBitCode(t[n],e);for(a=0;4>a;a++){for(u=d[a],i=[],n=0,s=(l=t.length)-1;l>n;s=n++)r=t[n],h=t[s],r._code&u?h._code&u||((c=p._getEdgeIntersection(h,r,u,e))._code=p._getBitCode(c,e),i.push(c)):(h._code&u&&((c=p._getEdgeIntersection(h,r,u,e))._code=p._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},o.Polygon=o.Polyline.extend({options:{fill:!0},initialize:function(t,e){o.Polyline.prototype.initialize.call(this,t,e),this._initWithHoles(t)},_initWithHoles:function(t){var e,i,n;if(t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0])for(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1),e=0,i=this._holes.length;i>e;e++)(n=this._holes[e]=this._convertLatLngs(this._holes[e]))[0].equals(n[n.length-1])&&n.pop();(t=this._latlngs).length>=2&&t[0].equals(t[t.length-1])&&t.pop()},projectLatlngs:function(){var t,e,i,n;if(o.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes)for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,n=this._holes[t].length;n>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])},setLatLngs:function(t){return t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0]?(this._initWithHoles(t),this.redraw()):o.Polyline.prototype.setLatLngs.call(this,t)},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,n=this._parts.length;n>i;i++){var s=o.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){return o.Polyline.prototype._getPathPartStr.call(this,t)+(o.Browser.svg?"z":"x")}}),o.polygon=function(t,e){return new o.Polygon(t,e)},function(){function t(t){return o.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this},getLatLngs:function(){var t=[];return this.eachLayer(function(e){t.push(e.getLatLngs())}),t}})}o.MultiPolyline=t(o.Polyline),o.MultiPolygon=t(o.Polygon),o.multiPolyline=function(t,e){return new o.MultiPolyline(t,e)},o.multiPolygon=function(t,e){return new o.MultiPolygon(t,e)}}(),o.Rectangle=o.Polygon.extend({initialize:function(t,e){o.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=o.latLngBounds(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),o.rectangle=function(t,e){return new o.Rectangle(t,e)},o.Circle=o.Path.extend({initialize:function(t,e,i){o.Path.prototype.initialize.call(this,i),this._latlng=o.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=o.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=this._latlng,i=this._map.latLngToLayerPoint([e.lat,e.lng-t]);this._point=this._map.latLngToLayerPoint(e),this._radius=Math.max(this._point.x-i.x,1)},getBounds:function(){var t=this._getLngRadius(),e=this._mRadius/40075017*360,i=this._latlng;return new o.LatLngBounds([i.lat-e,i.lng-t],[i.lat+e,i.lng+t])},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":o.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,23592600")},getRadius:function(){return this._mRadius},_getLatRadius:function(){return this._mRadius/40075017*360},_getLngRadius:function(){return this._getLatRadius()/Math.cos(o.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+e<t.min.x||i.y+e<t.min.y}}),o.circle=function(t,e,i){return new o.Circle(t,e,i)},o.CircleMarker=o.Circle.extend({options:{radius:10,weight:2},initialize:function(t,e){o.Circle.prototype.initialize.call(this,t,null,e),this._radius=this.options.radius},projectLatlngs:function(){this._point=this._map.latLngToLayerPoint(this._latlng)},_updateStyle:function(){o.Circle.prototype._updateStyle.call(this),this.setRadius(this.options.radius)},setLatLng:function(t){return o.Circle.prototype.setLatLng.call(this,t),this._popup&&this._popup._isOpen&&this._popup.setLatLng(t),this},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius}}),o.circleMarker=function(t,e){return new o.CircleMarker(t,e)},o.Polyline.include(o.Path.CANVAS?{_containsPoint:function(t,e){var i,n,s,a,r,h,l=this.options.weight/2;for(o.Browser.touch&&(l+=10),i=0,a=this._parts.length;a>i;i++)for(n=0,s=(r=(h=this._parts[i]).length)-1;r>n;s=n++)if((e||0!==n)&&l>=o.LineUtil.pointToSegmentDistance(t,h[s],h[n]))return!0;return!1}}:{}),o.Polygon.include(o.Path.CANVAS?{_containsPoint:function(t){var e,i,n,s,a,r,h,l,u=!1;if(o.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(a=0,r=(l=(e=this._parts[s]).length)-1;l>a;r=a++)i=e[a],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(u=!u);return u}}:{}),o.Circle.include(o.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),o.CircleMarker.include(o.Path.CANVAS?{_updateStyle:function(){o.Path.prototype._updateStyle.call(this)}}:{}),o.GeoJSON=o.FeatureGroup.extend({initialize:function(t,e){o.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,s=o.Util.isArray(t)?t:t.features;if(s){for(e=0,i=s.length;i>e;e++)((n=s[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(s[e]);return this}var a=this.options;if(!a.filter||a.filter(t)){var r=o.GeoJSON.geometryToLayer(t,a.pointToLayer,a.coordsToLatLng,a);return r.feature=o.GeoJSON.asFeature(t),r.defaultOptions=r.options,this.resetStyle(r),a.onEachFeature&&a.onEachFeature(t,r),this.addLayer(r)}},resetStyle:function(t){var e=this.options.style;e&&(o.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),o.extend(o.GeoJSON,{geometryToLayer:function(t,e,i,n){var s,a,r,h,l="Feature"===t.type?t.geometry:t,u=l.coordinates,c=[];switch(i=i||this.coordsToLatLng,l.type){case"Point":return s=i(u),e?e(t,s):new o.Marker(s);case"MultiPoint":for(r=0,h=u.length;h>r;r++)s=i(u[r]),c.push(e?e(t,s):new o.Marker(s));return new o.FeatureGroup(c);case"LineString":return a=this.coordsToLatLngs(u,0,i),new o.Polyline(a,n);case"Polygon":if(2===u.length&&!u[1].length)throw new Error("Invalid GeoJSON object.");return a=this.coordsToLatLngs(u,1,i),new o.Polygon(a,n);case"MultiLineString":return a=this.coordsToLatLngs(u,1,i),new o.MultiPolyline(a,n);case"MultiPolygon":return a=this.coordsToLatLngs(u,2,i),new o.MultiPolygon(a,n);case"GeometryCollection":for(r=0,h=l.geometries.length;h>r;r++)c.push(this.geometryToLayer({geometry:l.geometries[r],type:"Feature",properties:t.properties},e,i,n));return new o.FeatureGroup(c);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t){return new o.LatLng(t[1],t[0],t[2])},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):(i||this.coordsToLatLng)(t[o]),a.push(n);return a},latLngToCoords:function(t){var e=[t.lng,t.lat];return t.alt!==i&&e.push(t.alt),e},latLngsToCoords:function(t){for(var e=[],i=0,n=t.length;n>i;i++)e.push(o.GeoJSON.latLngToCoords(t[i]));return e},getFeature:function(t,e){return t.feature?o.extend({},t.feature,{geometry:e}):o.GeoJSON.asFeature(e)},asFeature:function(t){return"Feature"===t.type?t:{type:"Feature",properties:{},geometry:t}}});var a={toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"Point",coordinates:o.GeoJSON.latLngToCoords(this.getLatLng())})}};o.Marker.include(a),o.Circle.include(a),o.CircleMarker.include(a),o.Polyline.include({toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"LineString",coordinates:o.GeoJSON.latLngsToCoords(this.getLatLngs())})}}),o.Polygon.include({toGeoJSON:function(){var t,e,i,n=[o.GeoJSON.latLngsToCoords(this.getLatLngs())];if(n[0].push(n[0][0]),this._holes)for(t=0,e=this._holes.length;e>t;t++)(i=o.GeoJSON.latLngsToCoords(this._holes[t])).push(i[0]),n.push(i);return o.GeoJSON.getFeature(this,{type:"Polygon",coordinates:n})}}),function(){function t(t){return function(){var e=[];return this.eachLayer(function(t){e.push(t.toGeoJSON().geometry.coordinates)}),o.GeoJSON.getFeature(this,{type:t,coordinates:e})}}o.MultiPolyline.include({toGeoJSON:t("MultiLineString")}),o.MultiPolygon.include({toGeoJSON:t("MultiPolygon")}),o.LayerGroup.include({toGeoJSON:function(){var e,i=this.feature&&this.feature.geometry,n=[];if(i&&"MultiPoint"===i.type)return t("MultiPoint").call(this);var s=i&&"GeometryCollection"===i.type;return this.eachLayer(function(t){t.toGeoJSON&&(e=t.toGeoJSON(),n.push(s?e.geometry:o.GeoJSON.asFeature(e)))}),s?o.GeoJSON.getFeature(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}})}(),o.geoJson=function(t,e){return new o.GeoJSON(t,e)},o.DomEvent={addListener:function(t,e,i,n){var s,a,r,h=o.stamp(i),l="_leaflet_"+e+h;return t[l]?this:(s=function(e){return i.call(n||t,e||o.DomEvent._getEvent())},o.Browser.pointer&&0===e.indexOf("touch")?this.addPointerListener(t,e,s,h):(o.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,s,h),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",s,!1),t.addEventListener(e,s,!1)):"mouseenter"===e||"mouseleave"===e?(a=s,r="mouseenter"===e?"mouseover":"mouseout",s=function(e){return o.DomEvent._checkMouse(t,e)?a(e):void 0},t.addEventListener(r,s,!1)):"click"===e&&o.Browser.android?(a=s,s=function(t){return o.DomEvent._filterClick(t,a)},t.addEventListener(e,s,!1)):t.addEventListener(e,s,!1):"attachEvent"in t&&t.attachEvent("on"+e,s),t[l]=s,this))},removeListener:function(t,e,i){var n=o.stamp(i),s="_leaflet_"+e+n,a=t[s];return a?(o.Browser.pointer&&0===e.indexOf("touch")?this.removePointerListener(t,e,n):o.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,n):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this):this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,o.DomEvent._skipped(t),this},disableScrollPropagation:function(t){var e=o.DomEvent.stopPropagation;return o.DomEvent.on(t,"mousewheel",e).on(t,"MozMousePixelScroll",e)},disableClickPropagation:function(t){for(var e=o.DomEvent.stopPropagation,i=o.Draggable.START.length-1;i>=0;i--)o.DomEvent.on(t,o.Draggable.START[i],e);return o.DomEvent.on(t,"click",o.DomEvent._fakeStop).on(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return o.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,i){var n=e.body,s=e.documentElement,a=o.DomUtil.documentIsLtr()?t.pageX?t.pageX-n.scrollLeft-s.scrollLeft:t.clientX:o.Browser.gecko?t.pageX-n.scrollLeft-s.scrollLeft:t.pageX?t.pageX-n.scrollLeft+s.scrollLeft:t.clientX,r=t.pageY?t.pageY-n.scrollTop-s.scrollTop:t.clientY,h=new o.Point(a,r);if(!i)return h;var l=i.getBoundingClientRect(),u=l.left-i.clientLeft,c=l.top-i.clientTop;return h._subtract(new o.Point(u,c))},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_skipEvents:{},_fakeStop:function(t){o.DomEvent._skipEvents[t.type]=!0},_skipped:function(t){var e=this._skipEvents[t.type];return this._skipEvents[t.type]=!1,e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(!(e=i.arguments[0])||t.Event!==e.constructor);)i=i.caller;return e},_filterClick:function(t,e){var i=t.timeStamp||t.originalEvent.timeStamp,n=o.DomEvent._lastClick&&i-o.DomEvent._lastClick;return n&&n>100&&1e3>n||t.target._simulatedClick&&!t._simulated?void o.DomEvent.stop(t):(o.DomEvent._lastClick=i,e(t))}},o.DomEvent.on=o.DomEvent.addListener,o.DomEvent.off=o.DomEvent.removeListener,o.Draggable=o.Class.extend({includes:o.Mixin.Events,statics:{START:o.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"}},initialize:function(t,e){this._element=t,this._dragStartTarget=e||t},enable:function(){if(!this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.on(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.off(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(this._moved=!1,!(t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(o.DomEvent.stopPropagation(t),o.Draggable._disabled||(o.DomUtil.disableImageDrag(),o.DomUtil.disableTextSelection(),this._moving)))){var i=t.touches?t.touches[0]:t;this._startPoint=new o.Point(i.clientX,i.clientY),this._startPos=this._newPos=o.DomUtil.getPosition(this._element),o.DomEvent.on(e,o.Draggable.MOVE[t.type],this._onMove,this).on(e,o.Draggable.END[t.type],this._onUp,this)}},_onMove:function(t){if(t.touches&&t.touches.length>1)this._moved=!0;else{var i=t.touches&&1===t.touches.length?t.touches[0]:t,n=new o.Point(i.clientX,i.clientY).subtract(this._startPoint);(n.x||n.y)&&(o.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=o.DomUtil.getPosition(this._element).subtract(n),o.DomUtil.addClass(e.body,"leaflet-dragging"),o.DomUtil.addClass(t.target||t.srcElement,"leaflet-drag-target")),this._newPos=this._startPos.add(n),this._moving=!0,o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))}},_updatePosition:function(){this.fire("predrag"),o.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(t){for(var i in o.DomUtil.removeClass(e.body,"leaflet-dragging"),o.DomUtil.removeClass(t.target||t.srcElement,"leaflet-drag-target"),o.Draggable.MOVE)o.DomEvent.off(e,o.Draggable.MOVE[i],this._onMove).off(e,o.Draggable.END[i],this._onUp);o.DomUtil.enableImageDrag(),o.DomUtil.enableTextSelection(),this._moved&&this._moving&&(o.Util.cancelAnimFrame(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1}}),o.Handler=o.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),o.Map.mergeOptions({dragging:!0,inertia:!o.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:o.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1}),o.Map.Drag=o.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new o.Draggable(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this),t.whenReady(this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,a=Math.abs(o+i)<Math.abs(s+i)?o:s;this._draggable._newPos.x=a},_onDragEnd:function(t){var e=this._map,i=e.options,n=+new Date-this._lastTime,s=!i.inertia||n>i.inertiaThreshold||!this._positions[0];if(e.fire("dragend",t),s)e.fire("moveend");else{var a=this._lastPos.subtract(this._positions[0]),r=(this._lastTime+n-this._times[0])/1e3,h=i.easeLinearity,l=a.multiplyBy(h/r),u=l.distanceTo([0,0]),c=Math.min(i.inertiaMaxSpeed,u),d=l.multiplyBy(c/u),p=c/(i.inertiaDeceleration*h),_=d.multiplyBy(-p/2).round();_.x&&_.y?(_=e._limitOffset(_,e.options.maxBounds),o.Util.requestAnimFrame(function(){e.panBy(_,{duration:p,easeLinearity:h,noMoveStart:!0})})):e.fire("moveend")}}}),o.Map.addInitHook("addHandler","dragging",o.Map.Drag),o.Map.mergeOptions({doubleClickZoom:!0}),o.Map.DoubleClickZoom=o.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom()+(t.originalEvent.shiftKey?-1:1);"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}}),o.Map.addInitHook("addHandler","doubleClickZoom",o.Map.DoubleClickZoom),o.Map.mergeOptions({scrollWheelZoom:!0}),o.Map.ScrollWheelZoom=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),o.DomEvent.on(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault),this._delta=0},removeHooks:function(){o.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll),o.DomEvent.off(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault)},_onWheelScroll:function(t){var e=o.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o.bind(this._performZoom,this),i),o.DomEvent.preventDefault(t),o.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();e=e>0?Math.ceil(e):Math.floor(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e&&("center"===t.options.scrollWheelZoom?t.setZoom(i+e):t.setZoomAround(this._lastMousePos,i+e))}}),o.Map.addInitHook("addHandler","scrollWheelZoom",o.Map.ScrollWheelZoom),o.extend(o.DomEvent,{_touchstart:o.Browser.msPointer?"MSPointerDown":o.Browser.pointer?"pointerdown":"touchstart",_touchend:o.Browser.msPointer?"MSPointerUp":o.Browser.pointer?"pointerup":"touchend",addDoubleTapListener:function(t,i,n){function s(t){var e;if(o.Browser.pointer?(_.push(t.pointerId),e=_.length):e=t.touches.length,!(e>1)){var i=Date.now(),n=i-(r||i);h=t.touches?t.touches[0]:t,l=n>0&&u>=n,r=i}}function a(t){if(o.Browser.pointer){var e=_.indexOf(t.pointerId);if(-1===e)return;_.splice(e,1)}if(l){if(o.Browser.pointer){var n,s={};for(var a in h)n=h[a],s[a]="function"==typeof n?n.bind(h):n;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",d=this._touchstart,p=this._touchend,_=[];t[c+d+n]=s,t[c+p+n]=a;var m=o.Browser.pointer?e.documentElement:t;return t.addEventListener(d,s,!1),m.addEventListener(p,a,!1),o.Browser.pointer&&m.addEventListener(o.DomEvent.POINTER_CANCEL,a,!1),this},removeDoubleTapListener:function(t,i){var n="_leaflet_";return t.removeEventListener(this._touchstart,t[n+this._touchstart+i],!1),(o.Browser.pointer?e.documentElement:t).removeEventListener(this._touchend,t[n+this._touchend+i],!1),o.Browser.pointer&&e.documentElement.removeEventListener(o.DomEvent.POINTER_CANCEL,t[n+this._touchend+i],!1),this}}),o.extend(o.DomEvent,{POINTER_DOWN:o.Browser.msPointer?"MSPointerDown":"pointerdown",POINTER_MOVE:o.Browser.msPointer?"MSPointerMove":"pointermove",POINTER_UP:o.Browser.msPointer?"MSPointerUp":"pointerup",POINTER_CANCEL:o.Browser.msPointer?"MSPointerCancel":"pointercancel",_pointers:[],_pointerDocumentListener:!1,addPointerListener:function(t,e,i,n){switch(e){case"touchstart":return this.addPointerListenerStart(t,e,i,n);case"touchend":return this.addPointerListenerEnd(t,e,i,n);case"touchmove":return this.addPointerListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addPointerListenerStart:function(t,i,n,s){var a=this._pointers,r=function(t){o.DomEvent.preventDefault(t);for(var e=!1,i=0;i<a.length;i++)if(a[i].pointerId===t.pointerId){e=!0;break}e||a.push(t),t.touches=a.slice(),t.changedTouches=[t],n(t)};if(t["_leaflet_touchstart"+s]=r,t.addEventListener(this.POINTER_DOWN,r,!1),!this._pointerDocumentListener){var h=function(t){for(var e=0;e<a.length;e++)if(a[e].pointerId===t.pointerId){a.splice(e,1);break}};e.documentElement.addEventListener(this.POINTER_UP,h,!1),e.documentElement.addEventListener(this.POINTER_CANCEL,h,!1),this._pointerDocumentListener=!0}return this},addPointerListenerMove:function(t,e,i,n){function o(t){if(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons){for(var e=0;e<s.length;e++)if(s[e].pointerId===t.pointerId){s[e]=t;break}t.touches=s.slice(),t.changedTouches=[t],i(t)}}var s=this._pointers;return t["_leaflet_touchmove"+n]=o,t.addEventListener(this.POINTER_MOVE,o,!1),this},addPointerListenerEnd:function(t,e,i,n){var o=this._pointers,s=function(t){for(var e=0;e<o.length;e++)if(o[e].pointerId===t.pointerId){o.splice(e,1);break}t.touches=o.slice(),t.changedTouches=[t],i(t)};return t["_leaflet_touchend"+n]=s,t.addEventListener(this.POINTER_UP,s,!1),t.addEventListener(this.POINTER_CANCEL,s,!1),this},removePointerListener:function(t,e,i){var n=t["_leaflet_"+e+i];switch(e){case"touchstart":t.removeEventListener(this.POINTER_DOWN,n,!1);break;case"touchmove":t.removeEventListener(this.POINTER_MOVE,n,!1);break;case"touchend":t.removeEventListener(this.POINTER_UP,n,!1),t.removeEventListener(this.POINTER_CANCEL,n,!1)}return this}}),o.Map.mergeOptions({touchZoom:o.Browser.touch&&!o.Browser.android23,bounceAtZoomLimits:!0}),o.Map.TouchZoom=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){o.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingZoom&&!this._zooming){var n=i.mouseEventToLayerPoint(t.touches[0]),s=i.mouseEventToLayerPoint(t.touches[1]),a=i._getCenterLayerPoint();this._startCenter=n.add(s)._divideBy(2),this._startDist=n.distanceTo(s),this._moved=!1,this._zooming=!0,this._centerOffset=a.subtract(this._startCenter),i._panAnim&&i._panAnim.stop(),o.DomEvent.on(e,"touchmove",this._onTouchMove,this).on(e,"touchend",this._onTouchEnd,this),o.DomEvent.preventDefault(t)}},_onTouchMove:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&this._zooming){var i=e.mouseEventToLayerPoint(t.touches[0]),n=e.mouseEventToLayerPoint(t.touches[1]);this._scale=i.distanceTo(n)/this._startDist,this._delta=i._add(n)._divideBy(2)._subtract(this._startCenter),1!==this._scale&&(e.options.bounceAtZoomLimits||!(e.getZoom()===e.getMinZoom()&&this._scale<1||e.getZoom()===e.getMaxZoom()&&this._scale>1))&&(this._moved||(o.DomUtil.addClass(e._mapPane,"leaflet-touching"),e.fire("movestart").fire("zoomstart"),this._moved=!0),o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),o.DomEvent.preventDefault(t))}},_updateOnMove:function(){var t=this._map,e=this._getScaleOrigin(),i=t.layerPointToLatLng(e),n=t.getScaleZoom(this._scale);t._animateZoom(i,n,this._startCenter,this._scale,this._delta)},_onTouchEnd:function(){if(this._moved&&this._zooming){var t=this._map;this._zooming=!1,o.DomUtil.removeClass(t._mapPane,"leaflet-touching"),o.Util.cancelAnimFrame(this._animRequest),o.DomEvent.off(e,"touchmove",this._onTouchMove).off(e,"touchend",this._onTouchEnd);var i=this._getScaleOrigin(),n=t.layerPointToLatLng(i),s=t.getZoom(),a=t.getScaleZoom(this._scale)-s,r=a>0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r),l=t.getZoomScale(h)/this._scale;t._animateZoom(n,h,i,l)}else this._zooming=!1},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),o.Map.addInitHook("addHandler","touchZoom",o.Map.TouchZoom),o.Map.mergeOptions({tap:!0,tapTolerance:15}),o.Map.Tap=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){o.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(o.DomEvent.preventDefault(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var i=t.touches[0],n=i.target;this._startPos=this._newPos=new o.Point(i.clientX,i.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._holdTimeout=setTimeout(o.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),o.DomEvent.on(e,"touchmove",this._onMove,this).on(e,"touchend",this._onUp,this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),o.DomEvent.off(e,"touchmove",this._onMove,this).off(e,"touchend",this._onUp,this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],n=i.target;n&&n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.removeClass(n,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new o.Point(e.clientX,e.clientY)},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o._simulated=!0,n.target._simulatedClick=!0,o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),o.Browser.touch&&!o.Browser.pointer&&o.Map.addInitHook("addHandler","tap",o.Map.Tap),o.Map.mergeOptions({boxZoom:!0}),o.Map.BoxZoom=o.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._moved=!1},addHooks:function(){o.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){o.DomEvent.off(this._container,"mousedown",this._onMouseDown),this._moved=!1},moved:function(){return this._moved},_onMouseDown:function(t){return this._moved=!1,!(!t.shiftKey||1!==t.which&&1!==t.button)&&(o.DomUtil.disableTextSelection(),o.DomUtil.disableImageDrag(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),void o.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).on(e,"keydown",this._onKeyDown,this))},_onMouseMove:function(t){this._moved||(this._box=o.DomUtil.create("div","leaflet-zoom-box",this._pane),o.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",this._map.fire("boxzoomstart"));var e=this._startLayerPoint,i=this._box,n=this._map.mouseEventToLayerPoint(t),s=n.subtract(e),a=new o.Point(Math.min(n.x,e.x),Math.min(n.y,e.y));o.DomUtil.setPosition(i,a),this._moved=!0,i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._moved&&(this._pane.removeChild(this._box),this._container.style.cursor=""),o.DomUtil.enableTextSelection(),o.DomUtil.enableImageDrag(),o.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp).off(e,"keydown",this._onKeyDown)},_onMouseUp:function(t){this._finish();var e=this._map,i=e.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(i)){var n=new o.LatLngBounds(e.layerPointToLatLng(this._startLayerPoint),e.layerPointToLatLng(i));e.fitBounds(n),e.fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}}),o.Map.addInitHook("addHandler","boxZoom",o.Map.BoxZoom),o.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),o.Map.Keyboard=o.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),o.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;o.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var i=e.body,n=e.documentElement,o=i.scrollTop||n.scrollTop,s=i.scrollLeft||n.scrollLeft;this._map._container.focus(),t.scrollTo(s,o)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){o.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){o.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(e in this._panKeys){if(i._panAnim&&i._panAnim._inProgress)return;i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds)}else{if(!(e in this._zoomKeys))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}o.DomEvent.stop(t)}}),o.Map.addInitHook("addHandler","keyboard",o.Map.Keyboard),o.Handler.MarkerDrag=o.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new o.Draggable(t,t)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable(),o.DomUtil.addClass(this._marker._icon,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this),this._draggable.disable(),o.DomUtil.removeClass(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=o.DomUtil.getPosition(t._icon),n=t._map.layerPointToLatLng(i);e&&o.DomUtil.setPosition(e,i),t._latlng=n,t.fire("move",{latlng:n}).fire("drag")},_onDragEnd:function(t){this._marker.fire("moveend").fire("dragend",t)}}),o.Control=o.Class.extend({options:{position:"topright"},initialize:function(t){o.setOptions(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return o.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this},removeFrom:function(t){var e=this.getPosition();return t._controlCorners[e].removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this},_refocusOnMap:function(){this._map&&this._map.getContainer().focus()}}),o.control=function(t){return new o.Control(t)},o.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=o.DomUtil.create("div",a,n)}var e=this._controlCorners={},i="leaflet-",n=this._controlContainer=o.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),o.Control.Zoom=o.Control.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"-",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=o.DomUtil.create("div",e+" leaflet-bar");return this._map=t,this._zoomInButton=this._createButton(this.options.zoomInText,this.options.zoomInTitle,e+"-in",i,this._zoomIn,this),this._zoomOutButton=this._createButton(this.options.zoomOutText,this.options.zoomOutTitle,e+"-out",i,this._zoomOut,this),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,n,s,a){var r=o.DomUtil.create("a",i,n);r.innerHTML=t,r.href="#",r.title=e;var h=o.DomEvent.stopPropagation;return o.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",o.DomEvent.preventDefault).on(r,"click",s,a).on(r,"click",this._refocusOnMap,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";o.DomUtil.removeClass(this._zoomInButton,e),o.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&o.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&o.DomUtil.addClass(this._zoomInButton,e)}}),o.Map.mergeOptions({zoomControl:!0}),o.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new o.Control.Zoom,this.addControl(this.zoomControl))}),o.control.zoom=function(t){return new o.Control.Zoom(t)},o.Control.Attribution=o.Control.extend({options:{position:"bottomright",prefix:'<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){o.setOptions(this,t),this._attributions={}},onAdd:function(t){for(var e in this._container=o.DomUtil.create("div","leaflet-control-attribution"),o.DomEvent.disableClickPropagation(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):void 0},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):void 0},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),o.Map.mergeOptions({attributionControl:!0}),o.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new o.Control.Attribution).addTo(this))}),o.control.attribution=function(t){return new o.Control.Attribution(t)},o.Control.Scale=o.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=o.DomUtil.create("div",e),n=this.options;return this._addScales(n,e,i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=o.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=o.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180)*(t.getNorthEast().lng-t.getSouthWest().lng)/180,n=this._map.getSize(),o=this.options,s=0;n.x>0&&(s=i*(o.maxWidth/n.x)),this._updateScales(o,s)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),o.control.scale=function(t){return new o.Control.Scale(t)},o.Control.Layers=o.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){for(var n in o.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._update(),this},removeLayer:function(t){var e=o.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=o.DomUtil.create("div",t);e.setAttribute("aria-haspopup",!0),o.Browser.touch?o.DomEvent.on(e,"click",o.DomEvent.stopPropagation):o.DomEvent.disableClickPropagation(e).disableScrollPropagation(e);var i=this._form=o.DomUtil.create("form",t+"-list");if(this.options.collapsed){o.Browser.android||o.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var n=this._layersLink=o.DomUtil.create("a",t+"-toggle",e);n.href="#",n.title="Layers",o.Browser.touch?o.DomEvent.on(n,"click",o.DomEvent.stop).on(n,"click",this._expand,this):o.DomEvent.on(n,"focus",this._expand,this),o.DomEvent.on(i,"click",function(){setTimeout(o.bind(this._onInputClick,this),0)},this),this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=o.DomUtil.create("div",t+"-base",i),this._separator=o.DomUtil.create("div",t+"-separator",i),this._overlaysList=o.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var n=o.stamp(t);this._layers[n]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t,e,i=!1,n=!1;for(t in this._layers)e=this._layers[t],this._addItem(e),n=n||e.overlay,i=i||!e.overlay;this._separator.style.display=n&&i?"":"none"}},_onLayerChange:function(t){var e=this._layers[o.stamp(t.layer)];if(e){this._handlingClick||this._update();var i=e.overlay?"layeradd"===t.type?"overlayadd":"overlayremove":"layeradd"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)}},_createRadioElement:function(t,i){var n='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"';i&&(n+=' checked="checked"'),n+="/>";var o=e.createElement("div");return o.innerHTML=n,o.firstChild},_addItem:function(t){var i,n=e.createElement("label"),s=this._map.hasLayer(t.layer);t.overlay?((i=e.createElement("input")).type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=s):i=this._createRadioElement("leaflet-base-layers",s),i.layerId=o.stamp(t.layer),o.DomEvent.on(i,"click",this._onInputClick,this);var a=e.createElement("span");return a.innerHTML=" "+t.name,n.appendChild(i),n.appendChild(a),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),n},_onInputClick:function(){var t,e,i,n=this._form.getElementsByTagName("input"),o=n.length;for(this._handlingClick=!0,t=0;o>t;t++)e=n[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?this._map.addLayer(i.layer):!e.checked&&this._map.hasLayer(i.layer)&&this._map.removeLayer(i.layer);this._handlingClick=!1,this._refocusOnMap()},_expand:function(){o.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),o.control.layers=function(t,e,i){return new o.Control.Layers(t,e,i)},o.PosAnimation=o.Class.extend({includes:o.Mixin.Events,run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._newPos=e,this.fire("start"),t.style[o.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(n||.5)+",1)",o.DomEvent.on(t,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),o.DomUtil.setPosition(t,e),o.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(o.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(o.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),o.Util.falseFn(this._el.offsetWidth))},_onStep:function(){var t=this._getPos();return t?(this._el._leaflet_pos=t,void this.fire("step")):void this._onTransitionEnd()},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var e,i,n,s=this._el,a=t.getComputedStyle(s);if(o.Browser.any3d){if(!(n=a[o.DomUtil.TRANSFORM].match(this._transformRe)))return;e=parseFloat(n[1]),i=parseFloat(n[2])}else e=parseFloat(a.left),i=parseFloat(a.top);return new o.Point(e,i,!0)},_onTransitionEnd:function(){o.DomEvent.off(this._el,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[o.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),o.Map.include({setView:function(t,e,n){if((e=e===i?this._zoom:this._limitZoom(e),t=this._limitCenter(o.latLng(t),e,this.options.maxBounds),n=n||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!n.reset&&!0!==n)&&(n.animate!==i&&(n.zoom=o.extend({animate:n.animate},n.zoom),n.pan=o.extend({animate:n.animate},n.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan)))return clearTimeout(this._sizeTimer),this;return this._resetView(t,e),this},panBy:function(t,e){if(t=o.point(t).round(),e=e||{},!t.x&&!t.y)return this;if(this._panAnim||(this._panAnim=new o.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){o.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t);this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){o.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._floor();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i))&&(this.panBy(i,e),!0)}}),o.PosAnimation=o.DomUtil.TRANSITION?o.PosAnimation:o.PosAnimation.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=o.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=o.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));o.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){o.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),o.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),o.DomUtil.TRANSITION&&o.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&o.DomUtil.TRANSITION&&o.Browser.any3d&&!o.Browser.android23&&!o.Browser.mobileOpera,this._zoomAnimated&&o.DomEvent.on(this._mapPane,o.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),o.Map.include(o.DomUtil.TRANSITION?{_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n),s=this._getCenterLayerPoint()._add(o);return!(!0!==i.animate&&!this.getSize().contains(o))&&(this.fire("movestart").fire("zoomstart"),this._animateZoom(t,e,s,n,null,!0),!0)},_animateZoom:function(t,e,i,n,s,a){this._animatingZoom=!0,o.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=t,this._animateToZoom=e,o.Draggable&&(o.Draggable._disabled=!0),this.fire("zoomanim",{center:t,zoom:e,origin:i,scale:n,delta:s,backwards:a})},_onZoomTransitionEnd:function(){this._animatingZoom=!1,o.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),o.Draggable&&(o.Draggable._disabled=!1)}}:{}),o.TileLayer.include({_animateZoom:function(t){this._animating||(this._animating=!0,this._prepareBgBuffer());var e=this._bgBuffer,i=o.DomUtil.TRANSFORM,n=t.delta?o.DomUtil.getTranslateString(t.delta):e.style[i],s=o.DomUtil.getScaleString(t.scale,t.origin);e.style[i]=t.backwards?s+" "+n:n+" "+s},_endZoomAnim:function(){var t=this._tileContainer,e=this._bgBuffer;t.style.visibility="",t.parentNode.appendChild(t),o.Util.falseFn(e.offsetWidth),this._animating=!1},_clearBgBuffer:function(){var t=this._map;!t||t._animatingZoom||t.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[o.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var t=this._tileContainer,e=this._bgBuffer,i=this._getLoadedTilesPercentage(e),n=this._getLoadedTilesPercentage(t);return e&&i>.5&&.5>n?(t.style.visibility="hidden",void this._stopLoadingImages(t)):(e.style.visibility="hidden",e.style[o.DomUtil.TRANSFORM]="",this._tileContainer=e,e=this._bgBuffer=t,this._stopLoadingImages(e),void clearTimeout(this._clearBgBufferTimer))},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,n,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)(n=s[e]).complete||(n.onload=o.Util.falseFn,n.onerror=o.Util.falseFn,n.src=o.Util.emptyImageUrl,n.parentNode.removeChild(n))}}),o.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locateOptions=o.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o.bind(this._handleGeolocationResponse,this),i=o.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=t.coords.latitude,i=t.coords.longitude,n=new o.LatLng(e,i),s=180*t.coords.accuracy/40075017,a=s/Math.cos(o.LatLng.DEG_TO_RAD*e),r=o.latLngBounds([e-s,i-a],[e+s,i+a]),h=this._locateOptions;if(h.setView){var l=Math.min(this.getBoundsZoom(r),h.maxZoom);this.setView(n,l)}var u={latlng:n,bounds:r,timestamp:t.timestamp};for(var c in t.coords)"number"==typeof t.coords[c]&&(u[c]=t.coords[c]);this.fire("locationfound",u)}})}(window,document);;!function(o,e,n){"use strict";L.AwesomeMarkers={},L.AwesomeMarkers.version="2.0.1",L.AwesomeMarkers.Icon=L.Icon.extend({options:{iconSize:[35,45],iconAnchor:[17,42],popupAnchor:[1,-32],shadowAnchor:[10,12],shadowSize:[36,16],className:"awesome-marker",prefix:"glyphicon",spinClass:"fa-spin",extraClasses:"",icon:"home",markerColor:"blue",iconColor:"white"},initialize:function(o){o=L.Util.setOptions(this,o)},createIcon:function(){var o=e.createElement("div"),n=this.options;return n.icon&&(o.innerHTML=this._createInner()),n.bgPos&&(o.style.backgroundPosition=-n.bgPos.x+"px "+-n.bgPos.y+"px"),this._setIconStyles(o,"icon-"+n.markerColor),o},_createInner:function(){var o,e="",n="",i="",s=this.options;return o=s.icon.slice(0,s.prefix.length+1)===s.prefix+"-"?s.icon:s.prefix+"-"+s.icon,s.spin&&"string"==typeof s.spinClass&&(e=s.spinClass),s.iconColor&&("white"===s.iconColor||"black"===s.iconColor?n="icon-"+s.iconColor:i="style='color: "+s.iconColor+"' "),"<i "+i+"class='"+s.extraClasses+" "+s.prefix+" "+o+" "+e+" "+n+"'></i>"},_setIconStyles:function(o,e){var n,i=this.options,s=L.point(i["shadow"===e?"shadowSize":"iconSize"]);!(n="shadow"===e?L.point(i.shadowAnchor||i.iconAnchor):L.point(i.iconAnchor))&&s&&(n=s.divideBy(2,!0)),o.className="awesome-marker-"+e+" "+i.className,n&&(o.style.marginLeft=-n.x+"px",o.style.marginTop=-n.y+"px"),s&&(o.style.width=s.x+"px",o.style.height=s.y+"px")},createShadow:function(){var o=e.createElement("div");return this._setIconStyles(o,"shadow"),o}}),L.AwesomeMarkers.icon=function(o){return new L.AwesomeMarkers.Icon(o)}}(0,document);;(function(){var n,r=[],t=[],e=0,u=+new Date+"",o=75,i=40,a=" \t\v\f \ufeff\n\r\u2028\u2029 ᠎             　",f=/\b__p \+= '';/g,l=/\b(__p \+=) '' \+/g,c=/(__e\(.*?\)|\b__t\)) \+\n'';/g,p=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,v=/\w*$/,s=/^\s*function[ \n\r\t]+\w/,h=/<%=([\s\S]+?)%>/g,y=RegExp("^["+a+"]*0+(?=.$)"),g=/($^)/,b=/\bthis\b/,_=/['\n\r\t\u2028\u2029\\]/g,d=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],m=0,w="[object Arguments]",j="[object Array]",k="[object Boolean]",x="[object Date]",C="[object Function]",O="[object Number]",N="[object Object]",R="[object RegExp]",E="[object String]",I={};I[C]=!1,I[w]=I[j]=I[k]=I[x]=I[O]=I[N]=I[R]=I[E]=!0;var S={leading:!1,maxWait:0,trailing:!1},A={configurable:!1,enumerable:!1,value:null,writable:!1},D={boolean:!1,function:!0,object:!0,number:!1,string:!1,undefined:!1},T={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},$=D[typeof window]&&window||this,F=D[typeof exports]&&exports&&!exports.nodeType&&exports,B=D[typeof module]&&module&&!module.nodeType&&module,W=B&&B.exports===F&&F,q=D[typeof global]&&global;function z(n,r,t){for(var e=(t||0)-1,u=n?n.length:0;++e<u;)if(n[e]===r)return e;return-1}function L(n,r){var t=typeof r;if(n=n.cache,"boolean"==t||null==r)return n[r]?0:-1;"number"!=t&&"string"!=t&&(t="object");var e="number"==t?r:u+r;return n=(n=n[t])&&n[e],"object"==t?n&&z(n,r)>-1?0:-1:n?0:-1}function P(n){var r=this.cache,t=typeof n;if("boolean"==t||null==n)r[n]=!0;else{"number"!=t&&"string"!=t&&(t="object");var e="number"==t?n:u+n,o=r[t]||(r[t]={});"object"==t?(o[e]||(o[e]=[])).push(n):o[e]=!0}}function K(n){return n.charCodeAt(0)}function U(n,r){for(var t=n.criteria,e=r.criteria,u=-1,o=t.length;++u<o;){var i=t[u],a=e[u];if(i!==a){if(i>a||void 0===i)return 1;if(i<a||void 0===a)return-1}}return n.index-r.index}function M(n){var r=-1,t=n.length,e=n[0],u=n[t/2|0],o=n[t-1];if(e&&"object"==typeof e&&u&&"object"==typeof u&&o&&"object"==typeof o)return!1;var i=H();i.false=i.null=i.true=i[void 0]=!1;var a=H();for(a.array=n,a.cache=i,a.push=P;++r<t;)a.push(n[r]);return a}function V(n){return"\\"+T[n]}function G(){return r.pop()||[]}function H(){return t.pop()||{array:null,cache:null,criteria:null,false:!1,index:0,null:!1,number:null,object:null,push:null,string:null,true:!1,undefined:!1,value:null}}function J(n){n.length=0,r.length<i&&r.push(n)}function Q(n){var r=n.cache;r&&Q(r),n.array=n.cache=n.criteria=n.object=n.number=n.string=n.value=null,t.length<i&&t.push(n)}function X(n,r,t){r||(r=0),void 0===t&&(t=n?n.length:0);for(var e=-1,u=t-r||0,o=Array(u<0?0:u);++e<u;)o[e]=n[r+e];return o}!q||q.global!==q&&q.window!==q||($=q);var Y=function r(t){var i=(t=t?Y.defaults($.Object(),t,Y.pick($,d)):$).Array,T=t.Boolean,F=t.Date,B=t.Function,W=t.Math,q=t.Number,P=t.Object,Z=t.RegExp,nn=t.String,rn=t.TypeError,tn=[],en=P.prototype,un=t._,on=en.toString,an=Z("^"+nn(on).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),fn=W.ceil,ln=t.clearTimeout,cn=W.floor,pn=B.prototype.toString,vn=Gn(vn=P.getPrototypeOf)&&vn,sn=en.hasOwnProperty,hn=tn.push,yn=t.setTimeout,gn=tn.splice,bn=tn.unshift,_n=function(){try{var n={},r=Gn(r=P.defineProperty)&&r,t=r(n,n,n)&&r}catch(n){}return t}(),dn=Gn(dn=P.create)&&dn,mn=Gn(mn=i.isArray)&&mn,wn=t.isFinite,jn=t.isNaN,kn=Gn(kn=P.keys)&&kn,xn=W.max,Cn=W.min,On=t.parseInt,Nn=W.random,Rn={};function En(n){return n&&"object"==typeof n&&!Yn(n)&&sn.call(n,"__wrapped__")?n:new In(n)}function In(n,r){this.__chain__=!!r,this.__wrapped__=n}Rn[j]=i,Rn[k]=T,Rn[x]=F,Rn[C]=B,Rn[N]=P,Rn[O]=q,Rn[R]=Z,Rn[E]=nn,In.prototype=En.prototype;var Sn=En.support={};function An(n){var r=n[0],t=n[2],e=n[4];function u(){if(t){var n=X(t);hn.apply(n,arguments)}if(this instanceof u){var o=Tn(r.prototype),i=r.apply(o,n||arguments);return vr(i)?i:o}return r.apply(e,n||arguments)}return Hn(u,n),u}function Dn(n,r,t,e,u){if(t){var o=t(n);if(void 0!==o)return o}if(!vr(n))return n;var i=on.call(n);if(!I[i])return n;var a=Rn[i];switch(i){case k:case x:return new a(+n);case O:case E:return new a(n);case R:return(o=a(n.source,v.exec(n))).lastIndex=n.lastIndex,o}var f=Yn(n);if(r){var l=!e;e||(e=G()),u||(u=G());for(var c=e.length;c--;)if(e[c]==n)return u[c];o=f?a(n.length):{}}else o=f?X(n):ur({},n);return f&&(sn.call(n,"index")&&(o.index=n.index),sn.call(n,"input")&&(o.input=n.input)),r?(e.push(n),u.push(o),(f?jr:ar)(n,function(n,i){o[i]=Dn(n,r,t,e,u)}),l&&(J(e),J(u)),o):o}function Tn(n,r){return vr(n)?dn(n):{}}function $n(n,r,t){if("function"!=typeof n)return Kr;if(void 0===r||!("prototype"in n))return n;var e=n.__bindData__;if(void 0===e&&(Sn.funcNames&&(e=!n.name),!(e=e||!Sn.funcDecomp))){var u=pn.call(n);Sn.funcNames||(e=!s.test(u)),e||(e=b.test(u),Hn(n,e))}if(!1===e||!0!==e&&1&e[1])return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,o){return n.call(r,t,e,u,o)}}return Lr(n,r)}function Fn(n){var r=n[0],t=n[1],e=n[2],u=n[3],o=n[4],i=n[5],a=1&t,f=2&t,l=4&t,c=8&t,p=r;function v(){var n=a?o:this;if(e){var s=X(e);hn.apply(s,arguments)}if((u||l)&&(s||(s=X(arguments)),u&&hn.apply(s,u),l&&s.length<i))return t|=16,Fn([r,c?t:-4&t,s,null,o,i]);if(s||(s=arguments),f&&(r=n[p]),this instanceof v){n=Tn(r.prototype);var h=r.apply(n,s);return vr(h)?h:n}return r.apply(n,s)}return Hn(v,n),v}function Bn(n,r){var t=-1,e=Vn(),u=n?n.length:0,i=u>=o&&e===z,a=[];if(i){var f=M(r);f?(e=L,r=f):i=!1}for(;++t<u;){var l=n[t];e(r,l)<0&&a.push(l)}return i&&Q(r),a}function Wn(n,r,t,e){for(var u=(e||0)-1,o=n?n.length:0,i=[];++u<o;){var a=n[u];if(a&&"object"==typeof a&&"number"==typeof a.length&&(Yn(a)||Xn(a))){r||(a=Wn(a,r,t));var f=-1,l=a.length,c=i.length;for(i.length+=l;++f<l;)i[c++]=a[f]}else t||i.push(a)}return i}function qn(n,r,t,e,u,o){if(t){var i=t(n,r);if(void 0!==i)return!!i}if(n===r)return 0!==n||1/n==1/r;var a=typeof r;if(!(n!=n||n&&D[typeof n]||r&&D[a]))return!1;if(null==n||null==r)return n===r;var f=on.call(n),l=on.call(r);if(f==w&&(f=N),l==w&&(l=N),f!=l)return!1;switch(f){case k:case x:return+n==+r;case O:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case R:case E:return n==nn(r)}var c=f==j;if(!c){var p=sn.call(n,"__wrapped__"),v=sn.call(r,"__wrapped__");if(p||v)return qn(p?n.__wrapped__:n,v?r.__wrapped__:r,t,e,u,o);if(f!=N)return!1;var s=n.constructor,h=r.constructor;if(s!=h&&!(pr(s)&&s instanceof s&&pr(h)&&h instanceof h)&&"constructor"in n&&"constructor"in r)return!1}var y=!u;u||(u=G()),o||(o=G());for(var g=u.length;g--;)if(u[g]==n)return o[g]==r;var b=0;if(i=!0,u.push(n),o.push(r),c){if(g=n.length,b=r.length,(i=b==g)||e)for(;b--;){var _=g,d=r[b];if(e)for(;_--&&!(i=qn(n[_],d,t,e,u,o)););else if(!(i=qn(n[b],d,t,e,u,o)))break}}else ir(r,function(r,a,f){if(sn.call(f,a))return b++,i=sn.call(n,a)&&qn(n[a],r,t,e,u,o)}),i&&!e&&ir(n,function(n,r,t){if(sn.call(t,r))return i=--b>-1});return u.pop(),o.pop(),y&&(J(u),J(o)),i}function zn(n,r,t,e,u){(Yn(r)?jr:ar)(r,function(r,o){var i,a,f=r,l=n[o];if(r&&((a=Yn(r))||hr(r))){for(var c,p=e.length;p--;)if(i=e[p]==r){l=u[p];break}i||(t&&(c=void 0!==(f=t(l,r)))&&(l=f),c||(l=a?Yn(l)?l:[]:hr(l)?l:{}),e.push(r),u.push(l),c||zn(l,r,t,e,u))}else t&&void 0===(f=t(l,r))&&(f=r),void 0!==f&&(l=f);n[o]=l})}function Ln(n,r){return n+cn(Nn()*(r-n+1))}function Pn(n,r,t){var e=-1,u=Vn(),i=n?n.length:0,a=[],f=!r&&i>=o&&u===z,l=t||f?G():a;for(f&&(u=L,l=M(l));++e<i;){var c=n[e],p=t?t(c,e,n):c;(r?!e||l[l.length-1]!==p:u(l,p)<0)&&((t||f)&&l.push(p),a.push(c))}return f?(J(l.array),Q(l)):t&&J(l),a}function Kn(n){return function(r,t,e){var u={};t=En.createCallback(t,e,3);var o=-1,i=r?r.length:0;if("number"==typeof i)for(;++o<i;){var a=r[o];n(u,a,t(a,o,r),r)}else ar(r,function(r,e,o){n(u,r,t(r,e,o),o)});return u}}function Un(n,r,t,e,u,o){var i=1&r,a=4&r,f=16&r,l=32&r;if(!(2&r||pr(n)))throw new rn;f&&!t.length&&(r&=-17,f=t=!1),l&&!e.length&&(r&=-33,l=e=!1);var c=n&&n.__bindData__;return c&&!0!==c?((c=X(c))[2]&&(c[2]=X(c[2])),c[3]&&(c[3]=X(c[3])),!i||1&c[1]||(c[4]=u),!i&&1&c[1]&&(r|=8),!a||4&c[1]||(c[5]=o),f&&hn.apply(c[2]||(c[2]=[]),t),l&&bn.apply(c[3]||(c[3]=[]),e),c[1]|=r,Un.apply(null,c)):(1==r||17===r?An:Fn)([n,r,t,e,u,o])}function Mn(n){return nr[n]}function Vn(){var n=(n=En.indexOf)===$r?z:n;return n}function Gn(n){return"function"==typeof n&&an.test(n)}Sn.funcDecomp=!Gn(t.WinRTError)&&b.test(r),Sn.funcNames="string"==typeof B.name,En.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:h,variable:"",imports:{_:En}},dn||(Tn=function(){function n(){}return function(r){if(vr(r)){n.prototype=r;var e=new n;n.prototype=null}return e||t.Object()}}());var Hn=_n?function(n,r){A.value=r,_n(n,"__bindData__",A)}:Mr;function Jn(n){var r,t;return!(!n||on.call(n)!=N||pr(r=n.constructor)&&!(r instanceof r))&&(ir(n,function(n,r){t=r}),void 0===t||sn.call(n,t))}function Qn(n){return rr[n]}function Xn(n){return n&&"object"==typeof n&&"number"==typeof n.length&&on.call(n)==w||!1}var Yn=mn||function(n){return n&&"object"==typeof n&&"number"==typeof n.length&&on.call(n)==j||!1},Zn=kn?function(n){return vr(n)?kn(n):[]}:function(n){var r,t=n,e=[];if(!t)return e;if(!D[typeof n])return e;for(r in t)sn.call(t,r)&&e.push(r);return e},nr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},rr=cr(nr),tr=Z("("+Zn(rr).join("|")+")","g"),er=Z("["+Zn(nr).join("")+"]","g"),ur=function(n,r,t){var e,u=n,o=u;if(!u)return o;var i=arguments,a=0,f="number"==typeof t?2:i.length;if(f>3&&"function"==typeof i[f-2])var l=$n(i[--f-1],i[f--],2);else f>2&&"function"==typeof i[f-1]&&(l=i[--f]);for(;++a<f;)if((u=i[a])&&D[typeof u])for(var c=-1,p=D[typeof u]&&Zn(u),v=p?p.length:0;++c<v;)o[e=p[c]]=l?l(o[e],u[e]):u[e];return o};var or=function(n,r,t){var e,u=n,o=u;if(!u)return o;for(var i=arguments,a=0,f="number"==typeof t?2:i.length;++a<f;)if((u=i[a])&&D[typeof u])for(var l=-1,c=D[typeof u]&&Zn(u),p=c?c.length:0;++l<p;)void 0===o[e=c[l]]&&(o[e]=u[e]);return o};var ir=function(n,r,t){var e,u=n,o=u;if(!u)return o;if(!D[typeof u])return o;for(e in r=r&&void 0===t?r:$n(r,t,3),u)if(!1===r(u[e],e,n))return o;return o};var ar=function(n,r,t){var e,u=n,o=u;if(!u)return o;if(!D[typeof u])return o;r=r&&void 0===t?r:$n(r,t,3);for(var i=-1,a=D[typeof u]&&Zn(u),f=a?a.length:0;++i<f;)if(!1===r(u[e=a[i]],e,n))return o;return o};function fr(n,r,t){var e=Zn(n),u=e.length;for(r=$n(r,t,3);u--;){var o=e[u];if(!1===r(n[o],o,n))break}return n}function lr(n){var r=[];return ir(n,function(n,t){pr(n)&&r.push(t)}),r.sort()}function cr(n){for(var r=-1,t=Zn(n),e=t.length,u={};++r<e;){var o=t[r];u[n[o]]=o}return u}function pr(n){return"function"==typeof n}function vr(n){return!(!n||!D[typeof n])}function sr(n){return"number"==typeof n||n&&"object"==typeof n&&on.call(n)==O||!1}var hr=vn?function(n){if(!n||on.call(n)!=N)return!1;var r=n.valueOf,t=Gn(r)&&(t=vn(r))&&vn(t);return t?n==t||vn(n)==t:Jn(n)}:Jn;function yr(n){return"string"==typeof n||n&&"object"==typeof n&&on.call(n)==E||!1}function gr(n){for(var r=-1,t=Zn(n),e=t.length,u=i(e);++r<e;)u[r]=n[t[r]];return u}function br(n,r,t){var e=-1,u=Vn(),o=n?n.length:0,i=!1;return t=(t<0?xn(0,o+t):t)||0,Yn(n)?i=u(n,r,t)>-1:"number"==typeof o?i=(yr(n)?n.indexOf(r,t):u(n,r,t))>-1:ar(n,function(n){if(++e>=t)return!(i=n===r)}),i}var _r=Kn(function(n,r,t){sn.call(n,t)?n[t]++:n[t]=1});function dr(n,r,t){var e=!0;r=En.createCallback(r,t,3);var u=-1,o=n?n.length:0;if("number"==typeof o)for(;++u<o&&(e=!!r(n[u],u,n)););else ar(n,function(n,t,u){return e=!!r(n,t,u)});return e}function mr(n,r,t){var e=[];r=En.createCallback(r,t,3);var u=-1,o=n?n.length:0;if("number"==typeof o)for(;++u<o;){var i=n[u];r(i,u,n)&&e.push(i)}else ar(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function wr(n,r,t){r=En.createCallback(r,t,3);var e,u=-1,o=n?n.length:0;if("number"!=typeof o)return ar(n,function(n,t,u){if(r(n,t,u))return e=n,!1}),e;for(;++u<o;){var i=n[u];if(r(i,u,n))return i}}function jr(n,r,t){var e=-1,u=n?n.length:0;if(r=r&&void 0===t?r:$n(r,t,3),"number"==typeof u)for(;++e<u&&!1!==r(n[e],e,n););else ar(n,r);return n}function kr(n,r,t){var e=n?n.length:0;if(r=r&&void 0===t?r:$n(r,t,3),"number"==typeof e)for(;e--&&!1!==r(n[e],e,n););else{var u=Zn(n);e=u.length,ar(n,function(n,t,o){return t=u?u[--e]:--e,r(o[t],t,o)})}return n}var xr=Kn(function(n,r,t){(sn.call(n,t)?n[t]:n[t]=[]).push(r)}),Cr=Kn(function(n,r,t){n[t]=r});function Or(n,r,t){var e=-1,u=n?n.length:0;if(r=En.createCallback(r,t,3),"number"==typeof u)for(var o=i(u);++e<u;)o[e]=r(n[e],e,n);else o=[],ar(n,function(n,t,u){o[++e]=r(n,t,u)});return o}function Nr(n,r,t){var e=-1/0,u=e;if("function"!=typeof r&&t&&t[r]===n&&(r=null),null==r&&Yn(n))for(var o=-1,i=n.length;++o<i;){var a=n[o];a>u&&(u=a)}else r=null==r&&yr(n)?K:En.createCallback(r,t,3),jr(n,function(n,t,o){var i=r(n,t,o);i>e&&(e=i,u=n)});return u}var Rr=Or;function Er(n,r,t,e){if(!n)return t;var u=arguments.length<3;r=En.createCallback(r,e,4);var o=-1,i=n.length;if("number"==typeof i)for(u&&(t=n[++o]);++o<i;)t=r(t,n[o],o,n);else ar(n,function(n,e,o){t=u?(u=!1,n):r(t,n,e,o)});return t}function Ir(n,r,t,e){var u=arguments.length<3;return r=En.createCallback(r,e,4),kr(n,function(n,e,o){t=u?(u=!1,n):r(t,n,e,o)}),t}function Sr(n){var r=-1,t=n?n.length:0,e=i("number"==typeof t?t:0);return jr(n,function(n){var t=Ln(0,++r);e[r]=e[t],e[t]=n}),e}function Ar(n,r,t){var e;r=En.createCallback(r,t,3);var u=-1,o=n?n.length:0;if("number"==typeof o)for(;++u<o&&!(e=r(n[u],u,n)););else ar(n,function(n,t,u){return!(e=r(n,t,u))});return!!e}var Dr=mr;function Tr(r,t,e){var u=0,o=r?r.length:0;if("number"!=typeof t&&null!=t){var i=-1;for(t=En.createCallback(t,e,3);++i<o&&t(r[i],i,r);)u++}else if(null==(u=t)||e)return r?r[0]:n;return X(r,0,Cn(xn(0,u),o))}function $r(n,r,t){if("number"==typeof t){var e=n?n.length:0;t=t<0?xn(0,e+t):t||0}else if(t){var u=Br(n,r);return n[u]===r?u:-1}return z(n,r,t)}function Fr(n,r,t){if("number"!=typeof r&&null!=r){var e=0,u=-1,o=n?n.length:0;for(r=En.createCallback(r,t,3);++u<o&&r(n[u],u,n);)e++}else e=null==r||t?1:xn(0,r);return X(n,e)}function Br(n,r,t,e){var u=0,o=n?n.length:u;for(r=(t=t?En.createCallback(t,e,1):Kr)(r);u<o;){var i=u+o>>>1;t(n[i])<r?u=i+1:o=i}return u}function Wr(n,r,t,e){return"boolean"!=typeof r&&null!=r&&(e=t,t="function"!=typeof r&&e&&e[r]===n?null:r,r=!1),null!=t&&(t=En.createCallback(t,e,3)),Pn(n,r,t)}function qr(){for(var n=arguments.length>1?arguments:arguments[0],r=-1,t=n?Nr(Rr(n,"length")):0,e=i(t<0?0:t);++r<t;)e[r]=Rr(n,r);return e}function zr(n,r){var t=-1,e=n?n.length:0,u={};for(r||!e||Yn(n[0])||(r=[]);++t<e;){var o=n[t];r?u[o]=r[t]:o&&(u[o[0]]=o[1])}return u}function Lr(n,r){return arguments.length>2?Un(n,17,X(arguments,2),null,r):Un(n,1,null,null,r)}function Pr(r,t,e){var u,o,i,a,f,l,c,p=0,v=!1,s=!0;if(!pr(r))throw new rn;if(t=xn(0,t)||0,!0===e){var h=!0;s=!1}else vr(e)&&(h=e.leading,v="maxWait"in e&&(xn(t,e.maxWait)||0),s="trailing"in e?e.trailing:s);var y=function(){var e=t-(Gr()-a);if(e<=0){o&&ln(o);var v=c;o=l=c=n,v&&(p=Gr(),i=r.apply(f,u),l||o||(u=f=null))}else l=yn(y,e)},g=function(){l&&ln(l),o=l=c=n,(s||v!==t)&&(p=Gr(),i=r.apply(f,u),l||o||(u=f=null))};return function(){if(u=arguments,a=Gr(),f=this,c=s&&(l||!h),!1===v)var n=h&&!l;else{o||h||(p=a);var e=v-(a-p),b=e<=0;b?(o&&(o=ln(o)),p=a,i=r.apply(f,u)):o||(o=yn(g,e))}return b&&l?l=ln(l):l||t===v||(l=yn(y,t)),n&&(b=!0,i=r.apply(f,u)),!b||l||o||(u=f=null),i}}function Kr(n){return n}function Ur(n,r,t){var e=!0,u=r&&lr(r);r&&(t||u.length)||(null==t&&(t=r),o=In,r=n,n=En,u=lr(r)),!1===t?e=!1:vr(t)&&"chain"in t&&(e=t.chain);var o=n,i=pr(o);jr(u,function(t){var u=n[t]=r[t];i&&(o.prototype[t]=function(){var r=this.__chain__,t=this.__wrapped__,i=[t];hn.apply(i,arguments);var a=u.apply(n,i);if(e||r){if(t===a&&vr(a))return this;(a=new o(a)).__chain__=r}return a})})}function Mr(){}var Vr,Gr=Gn(Gr=F.now)&&Gr||function(){return(new F).getTime()},Hr=8==On(a+"08")?On:function(n,r){return On(yr(n)?n.replace(y,""):n,r||0)};function Jr(n){return function(r){return r[n]}}function Qr(){return this.__wrapped__}return En.after=function(n,r){if(!pr(r))throw new rn;return function(){if(--n<1)return r.apply(this,arguments)}},En.assign=ur,En.at=function(n){for(var r=arguments,t=-1,e=Wn(r,!0,!1,1),u=r[2]&&r[2][r[1]]===n?1:e.length,o=i(u);++t<u;)o[t]=n[e[t]];return o},En.bind=Lr,En.bindAll=function(n){for(var r=arguments.length>1?Wn(arguments,!0,!1,1):lr(n),t=-1,e=r.length;++t<e;){var u=r[t];n[u]=Un(n[u],1,null,null,n)}return n},En.bindKey=function(n,r){return arguments.length>2?Un(r,19,X(arguments,2),null,n):Un(r,3,null,null,n)},En.chain=function(n){return(n=new In(n)).__chain__=!0,n},En.compact=function(n){for(var r=-1,t=n?n.length:0,e=[];++r<t;){var u=n[r];u&&e.push(u)}return e},En.compose=function(){for(var n=arguments,r=n.length;r--;)if(!pr(n[r]))throw new rn;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}},En.constant=function(n){return function(){return n}},En.countBy=_r,En.create=function(n,r){var t=Tn(n);return r?ur(t,r):t},En.createCallback=function(n,r,t){var e=typeof n;if(null==n||"function"==e)return $n(n,r,t);if("object"!=e)return Jr(n);var u=Zn(n),o=u[0],i=n[o];return 1!=u.length||i!=i||vr(i)?function(r){for(var t=u.length,e=!1;t--&&(e=qn(r[u[t]],n[u[t]],null,!0)););return e}:function(n){var r=n[o];return i===r&&(0!==i||1/i==1/r)}},En.curry=function(n,r){return Un(n,4,null,null,null,r="number"==typeof r?r:+r||n.length)},En.debounce=Pr,En.defaults=or,En.defer=function(r){if(!pr(r))throw new rn;var t=X(arguments,1);return yn(function(){r.apply(n,t)},1)},En.delay=function(r,t){if(!pr(r))throw new rn;var e=X(arguments,2);return yn(function(){r.apply(n,e)},t)},En.difference=function(n){return Bn(n,Wn(arguments,!0,!0,1))},En.filter=mr,En.flatten=function(n,r,t,e){return"boolean"!=typeof r&&null!=r&&(e=t,t="function"!=typeof r&&e&&e[r]===n?null:r,r=!1),null!=t&&(n=Or(n,t,e)),Wn(n,r)},En.forEach=jr,En.forEachRight=kr,En.forIn=ir,En.forInRight=function(n,r,t){var e=[];ir(n,function(n,r){e.push(r,n)});var u=e.length;for(r=$n(r,t,3);u--&&!1!==r(e[u--],e[u],n););return n},En.forOwn=ar,En.forOwnRight=fr,En.functions=lr,En.groupBy=xr,En.indexBy=Cr,En.initial=function(n,r,t){var e=0,u=n?n.length:0;if("number"!=typeof r&&null!=r){var o=u;for(r=En.createCallback(r,t,3);o--&&r(n[o],o,n);)e++}else e=null==r||t?1:r||e;return X(n,0,Cn(xn(0,u-e),u))},En.intersection=function(){for(var n=[],r=-1,t=arguments.length,e=G(),u=Vn(),i=u===z,a=G();++r<t;){var f=arguments[r];(Yn(f)||Xn(f))&&(n.push(f),e.push(i&&f.length>=o&&M(r?n[r]:a)))}var l=n[0],c=-1,p=l?l.length:0,v=[];n:for(;++c<p;){var s=e[0];if(f=l[c],(s?L(s,f):u(a,f))<0){for(r=t,(s||a).push(f);--r;)if(((s=e[r])?L(s,f):u(n[r],f))<0)continue n;v.push(f)}}for(;t--;)(s=e[t])&&Q(s);return J(e),J(a),v},En.invert=cr,En.invoke=function(n,r){var t=X(arguments,2),e=-1,u="function"==typeof r,o=n?n.length:0,a=i("number"==typeof o?o:0);return jr(n,function(n){a[++e]=(u?r:n[r]).apply(n,t)}),a},En.keys=Zn,En.map=Or,En.mapValues=function(n,r,t){var e={};return r=En.createCallback(r,t,3),ar(n,function(n,t,u){e[t]=r(n,t,u)}),e},En.max=Nr,En.memoize=function(n,r){if(!pr(n))throw new rn;var t=function(){var e=t.cache,o=r?r.apply(this,arguments):u+arguments[0];return sn.call(e,o)?e[o]:e[o]=n.apply(this,arguments)};return t.cache={},t},En.merge=function(n){var r=arguments,t=2;if(!vr(n))return n;if("number"!=typeof r[2]&&(t=r.length),t>3&&"function"==typeof r[t-2])var e=$n(r[--t-1],r[t--],2);else t>2&&"function"==typeof r[t-1]&&(e=r[--t]);for(var u=X(arguments,1,t),o=-1,i=G(),a=G();++o<t;)zn(n,u[o],e,i,a);return J(i),J(a),n},En.min=function(n,r,t){var e=1/0,u=e;if("function"!=typeof r&&t&&t[r]===n&&(r=null),null==r&&Yn(n))for(var o=-1,i=n.length;++o<i;){var a=n[o];a<u&&(u=a)}else r=null==r&&yr(n)?K:En.createCallback(r,t,3),jr(n,function(n,t,o){var i=r(n,t,o);i<e&&(e=i,u=n)});return u},En.omit=function(n,r,t){var e={};if("function"!=typeof r){var u=[];ir(n,function(n,r){u.push(r)});for(var o=-1,i=(u=Bn(u,Wn(arguments,!0,!1,1))).length;++o<i;){var a=u[o];e[a]=n[a]}}else r=En.createCallback(r,t,3),ir(n,function(n,t,u){r(n,t,u)||(e[t]=n)});return e},En.once=function(n){var r,t;if(!pr(n))throw new rn;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},En.pairs=function(n){for(var r=-1,t=Zn(n),e=t.length,u=i(e);++r<e;){var o=t[r];u[r]=[o,n[o]]}return u},En.partial=function(n){return Un(n,16,X(arguments,1))},En.partialRight=function(n){return Un(n,32,null,X(arguments,1))},En.pick=function(n,r,t){var e={};if("function"!=typeof r)for(var u=-1,o=Wn(arguments,!0,!1,1),i=vr(n)?o.length:0;++u<i;){var a=o[u];a in n&&(e[a]=n[a])}else r=En.createCallback(r,t,3),ir(n,function(n,t,u){r(n,t,u)&&(e[t]=n)});return e},En.pluck=Rr,En.property=Jr,En.pull=function(n){for(var r=arguments,t=0,e=r.length,u=n?n.length:0;++t<e;)for(var o=-1,i=r[t];++o<u;)n[o]===i&&(gn.call(n,o--,1),u--);return n},En.range=function(n,r,t){n=+n||0,t="number"==typeof t?t:+t||1,null==r&&(r=n,n=0);for(var e=-1,u=xn(0,fn((r-n)/(t||1))),o=i(u);++e<u;)o[e]=n,n+=t;return o},En.reject=function(n,r,t){return r=En.createCallback(r,t,3),mr(n,function(n,t,e){return!r(n,t,e)})},En.remove=function(n,r,t){var e=-1,u=n?n.length:0,o=[];for(r=En.createCallback(r,t,3);++e<u;){var i=n[e];r(i,e,n)&&(o.push(i),gn.call(n,e--,1),u--)}return o},En.rest=Fr,En.shuffle=Sr,En.sortBy=function(n,r,t){var e=-1,u=Yn(r),o=n?n.length:0,a=i("number"==typeof o?o:0);for(u||(r=En.createCallback(r,t,3)),jr(n,function(n,t,o){var i=a[++e]=H();u?i.criteria=Or(r,function(r){return n[r]}):(i.criteria=G())[0]=r(n,t,o),i.index=e,i.value=n}),o=a.length,a.sort(U);o--;){var f=a[o];a[o]=f.value,u||J(f.criteria),Q(f)}return a},En.tap=function(n,r){return r(n),n},En.throttle=function(n,r,t){var e=!0,u=!0;if(!pr(n))throw new rn;return!1===t?e=!1:vr(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),S.leading=e,S.maxWait=r,S.trailing=u,Pr(n,r,S)},En.times=function(n,r,t){n=(n=+n)>-1?n:0;var e=-1,u=i(n);for(r=$n(r,t,1);++e<n;)u[e]=r(e);return u},En.toArray=function(n){return n&&"number"==typeof n.length?X(n):gr(n)},En.transform=function(n,r,t,e){var u=Yn(n);if(null==t)if(u)t=[];else{var o=n&&n.constructor,i=o&&o.prototype;t=Tn(i)}return r&&(r=En.createCallback(r,e,4),(u?jr:ar)(n,function(n,e,u){return r(t,n,e,u)})),t},En.union=function(){return Pn(Wn(arguments,!0,!0))},En.uniq=Wr,En.values=gr,En.where=Dr,En.without=function(n){return Bn(n,X(arguments,1))},En.wrap=function(n,r){return Un(r,16,[n])},En.xor=function(){for(var n=-1,r=arguments.length;++n<r;){var t=arguments[n];if(Yn(t)||Xn(t))var e=e?Pn(Bn(e,t).concat(Bn(t,e))):t}return e||[]},En.zip=qr,En.zipObject=zr,En.collect=Or,En.drop=Fr,En.each=jr,En.eachRight=kr,En.extend=ur,En.methods=lr,En.object=zr,En.select=mr,En.tail=Fr,En.unique=Wr,En.unzip=qr,Ur(En),En.clone=function(n,r,t,e){return"boolean"!=typeof r&&null!=r&&(e=t,t=r,r=!1),Dn(n,r,"function"==typeof t&&$n(t,e,1))},En.cloneDeep=function(n,r,t){return Dn(n,!0,"function"==typeof r&&$n(r,t,1))},En.contains=br,En.escape=function(n){return null==n?"":nn(n).replace(er,Mn)},En.every=dr,En.find=wr,En.findIndex=function(n,r,t){var e=-1,u=n?n.length:0;for(r=En.createCallback(r,t,3);++e<u;)if(r(n[e],e,n))return e;return-1},En.findKey=function(n,r,t){var e;return r=En.createCallback(r,t,3),ar(n,function(n,t,u){if(r(n,t,u))return e=t,!1}),e},En.findLast=function(n,r,t){var e;return r=En.createCallback(r,t,3),kr(n,function(n,t,u){if(r(n,t,u))return e=n,!1}),e},En.findLastIndex=function(n,r,t){var e=n?n.length:0;for(r=En.createCallback(r,t,3);e--;)if(r(n[e],e,n))return e;return-1},En.findLastKey=function(n,r,t){var e;return r=En.createCallback(r,t,3),fr(n,function(n,t,u){if(r(n,t,u))return e=t,!1}),e},En.has=function(n,r){return!!n&&sn.call(n,r)},En.identity=Kr,En.indexOf=$r,En.isArguments=Xn,En.isArray=Yn,En.isBoolean=function(n){return!0===n||!1===n||n&&"object"==typeof n&&on.call(n)==k||!1},En.isDate=function(n){return n&&"object"==typeof n&&on.call(n)==x||!1},En.isElement=function(n){return n&&1===n.nodeType||!1},En.isEmpty=function(n){var r=!0;if(!n)return r;var t=on.call(n),e=n.length;return t==j||t==E||t==w||t==N&&"number"==typeof e&&pr(n.splice)?!e:(ar(n,function(){return r=!1}),r)},En.isEqual=function(n,r,t,e){return qn(n,r,"function"==typeof t&&$n(t,e,2))},En.isFinite=function(n){return wn(n)&&!jn(parseFloat(n))},En.isFunction=pr,En.isNaN=function(n){return sr(n)&&n!=+n},En.isNull=function(n){return null===n},En.isNumber=sr,En.isObject=vr,En.isPlainObject=hr,En.isRegExp=function(n){return n&&"object"==typeof n&&on.call(n)==R||!1},En.isString=yr,En.isUndefined=function(n){return void 0===n},En.lastIndexOf=function(n,r,t){var e=n?n.length:0;for("number"==typeof t&&(e=(t<0?xn(0,e+t):Cn(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},En.mixin=Ur,En.noConflict=function(){return t._=un,this},En.noop=Mr,En.now=Gr,En.parseInt=Hr,En.random=function(n,r,t){var e=null==n,u=null==r;if(null==t&&("boolean"==typeof n&&u?(t=n,n=1):u||"boolean"!=typeof r||(t=r,u=!0)),e&&u&&(r=1),n=+n||0,u?(r=n,n=0):r=+r||0,t||n%1||r%1){var o=Nn();return Cn(n+o*(r-n+parseFloat("1e-"+((o+"").length-1))),r)}return Ln(n,r)},En.reduce=Er,En.reduceRight=Ir,En.result=function(n,r){if(n){var t=n[r];return pr(t)?n[r]():t}},En.runInContext=r,En.size=function(n){var r=n?n.length:0;return"number"==typeof r?r:Zn(n).length},En.some=Ar,En.sortedIndex=Br,En.template=function(r,t,e){var u=En.templateSettings;r=nn(r||""),e=or({},e,u);var o,i=or({},e.imports,u.imports),a=Zn(i),v=gr(i),s=0,y=e.interpolate||g,b="__p += '",d=Z((e.escape||g).source+"|"+y.source+"|"+(y===h?p:g).source+"|"+(e.evaluate||g).source+"|$","g");r.replace(d,function(n,t,e,u,i,a){return e||(e=u),b+=r.slice(s,a).replace(_,V),t&&(b+="' +\n__e("+t+") +\n'"),i&&(o=!0,b+="';\n"+i+";\n__p += '"),e&&(b+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),s=a+n.length,n}),b+="';\n";var w=e.variable,j=w;j||(b="with ("+(w="obj")+") {\n"+b+"\n}\n"),b=(o?b.replace(f,""):b).replace(l,"$1").replace(c,"$1;"),b="function("+w+") {\n"+(j?"":w+" || ("+w+" = {});\n")+"var __t, __p = '', __e = _.escape"+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+b+"return __p\n}";var k="\n/*\n//# sourceURL="+(e.sourceURL||"/lodash/template/source["+m+++"]")+"\n*/";try{var x=B(a,"return "+b+k).apply(n,v)}catch(n){throw n.source=b,n}return t?x(t):(x.source=b,x)},En.unescape=function(n){return null==n?"":nn(n).replace(tr,Qn)},En.uniqueId=function(n){var r=++e;return nn(null==n?"":n)+r},En.all=dr,En.any=Ar,En.detect=wr,En.findWhere=wr,En.foldl=Er,En.foldr=Ir,En.include=br,En.inject=Er,Ur((Vr={},ar(En,function(n,r){En.prototype[r]||(Vr[r]=n)}),Vr),!1),En.first=Tr,En.last=function(r,t,e){var u=0,o=r?r.length:0;if("number"!=typeof t&&null!=t){var i=o;for(t=En.createCallback(t,e,3);i--&&t(r[i],i,r);)u++}else if(null==(u=t)||e)return r?r[o-1]:n;return X(r,xn(0,o-u))},En.sample=function(r,t,e){if(r&&"number"!=typeof r.length&&(r=gr(r)),null==t||e)return r?r[Ln(0,r.length-1)]:n;var u=Sr(r);return u.length=Cn(xn(0,t),u.length),u},En.take=Tr,En.head=Tr,ar(En,function(n,r){var t="sample"!==r;En.prototype[r]||(En.prototype[r]=function(r,e){var u=this.__chain__,o=n(this.__wrapped__,r,e);return u||null!=r&&(!e||t&&"function"==typeof r)?new In(o,u):o})}),En.VERSION="2.4.1",En.prototype.chain=function(){return this.__chain__=!0,this},En.prototype.toString=function(){return nn(this.__wrapped__)},En.prototype.value=Qr,En.prototype.valueOf=Qr,jr(["join","pop","shift"],function(n){var r=tn[n];En.prototype[n]=function(){var n=this.__chain__,t=r.apply(this.__wrapped__,arguments);return n?new In(t,n):t}}),jr(["push","reverse","sort","unshift"],function(n){var r=tn[n];En.prototype[n]=function(){return r.apply(this.__wrapped__,arguments),this}}),jr(["concat","slice","splice"],function(n){var r=tn[n];En.prototype[n]=function(){return new In(r.apply(this.__wrapped__,arguments),this.__chain__)}}),En}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?($._=Y,define(function(){return Y})):F&&B?W?(B.exports=Y)._=Y:F._=Y:$._=Y}).call(this);;!function(c,M){"use strict";"function"==typeof define&&define.amd?define(["moment"],M):"object"==typeof exports?module.exports=M(require("moment")):M(c.moment)}(this,function(c){"use strict";if(void 0!==c.tz)return f("Moment Timezone "+c.tz.version+" was already loaded "+(c.tz.dataVersion?"with data from ":"without any data")+c.tz.dataVersion),c;var M={},A={},z={},b=c.version.split("."),o=+b[0],p=+b[1];function n(c){return c>96?c-87:c>64?c-29:c-48}function a(c){var M=0,A=c.split("."),z=A[0],b=A[1]||"",o=1,p=0,a=1;for(45===c.charCodeAt(0)&&(M=1,a=-1);M<z.length;M++)p=60*p+n(z.charCodeAt(M));for(M=0;M<b.length;M++)o/=60,p+=n(b.charCodeAt(M))*o;return p*a}function O(c){for(var M=0;M<c.length;M++)c[M]=a(c[M])}function L(c,M){var A,z=[];for(A=0;A<M.length;A++)z[A]=c[M[A]];return z}function q(c){var M=c.split("|"),A=M[2].split(" "),z=M[3].split(""),b=M[4].split(" ");return O(A),O(z),O(b),function(c,M){for(var A=0;A<M;A++)c[A]=Math.round((c[A-1]||0)+6e4*c[A]);c[M-1]=1/0}(b,z.length),{name:M[0],abbrs:L(M[1].split(" "),z),offsets:L(A,z),untils:b}}function T(c){c&&this._set(q(c))}function N(c){return(c||"").toLowerCase().replace(/\//g,"_")}function i(c){var A,b,o;for("string"==typeof c&&(c=[c]),A=0;A<c.length;A++)o=N(b=c[A].split("|")[0]),M[o]=c[A],z[o]=b}function W(c,b){c=N(c);var o,p=M[c];return p instanceof T?p:"string"==typeof p?(p=new T(p),M[c]=p,p):A[c]&&b!==W&&(o=W(A[c],W))?((p=M[c]=new T)._set(o),p.name=z[c],p):null}function d(c){var M,b,o,p;for("string"==typeof c&&(c=[c]),M=0;M<c.length;M++)o=N((b=c[M].split("|"))[0]),p=N(b[1]),A[o]=p,z[o]=b[0],A[p]=o,z[p]=b[1]}function X(c){i(c.zones),d(c.links),l.dataVersion=c.version}function B(c){return!(!c._a||void 0!==c._tzm)}function f(c){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(c)}function l(M){var A=Array.prototype.slice.call(arguments,0,-1),z=arguments[arguments.length-1],b=W(z),o=c.utc.apply(null,A);return b&&!c.isMoment(M)&&B(o)&&o.add(b.parse(o),"minutes"),o.tz(z),o}(o<2||2===o&&p<6)&&f("Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js "+c.version+". See momentjs.com"),T.prototype={_set:function(c){this.name=c.name,this.abbrs=c.abbrs,this.untils=c.untils,this.offsets=c.offsets},_index:function(c){var M,A=+c,z=this.untils;for(M=0;M<z.length;M++)if(A<z[M])return M},parse:function(c){var M,A,z,b,o=+c,p=this.offsets,n=this.untils,a=n.length-1;for(b=0;b<a;b++)if(M=p[b],A=p[b+1],z=p[b?b-1:b],M<A&&l.moveAmbiguousForward?M=A:M>z&&l.moveInvalidForward&&(M=z),o<n[b]-6e4*M)return p[b];return p[a]},abbr:function(c){return this.abbrs[this._index(c)]},offset:function(c){return this.offsets[this._index(c)]}},l.version="0.4.1",l.dataVersion="",l._zones=M,l._links=A,l._names=z,l.add=i,l.link=d,l.load=X,l.zone=W,l.zoneExists=function c(M){return c.didShowError||(c.didShowError=!0,f("moment.tz.zoneExists('"+M+"') has been deprecated in favor of !moment.tz.zone('"+M+"')")),!!W(M)},l.names=function(){var c,b=[];for(c in z)z.hasOwnProperty(c)&&(M[c]||M[A[c]])&&z[c]&&b.push(z[c]);return b.sort()},l.Zone=T,l.unpack=q,l.unpackBase60=a,l.needsOffset=B,l.moveInvalidForward=!0,l.moveAmbiguousForward=!1;var e,r=c.fn;function u(c){return function(){return this._z?this._z.abbr(this):c.call(this)}}c.tz=l,c.defaultZone=null,c.updateOffset=function(M,A){var z,b=c.defaultZone;void 0===M._z&&(b&&B(M)&&!M._isUTC&&(M._d=c.utc(M._a)._d,M.utc().add(b.parse(M),"minutes")),M._z=b),M._z&&(z=M._z.offset(M),Math.abs(z)<16&&(z/=60),void 0!==M.utcOffset?M.utcOffset(-z,A):M.zone(z,A))},r.tz=function(M){return M?(this._z=W(M),this._z?c.updateOffset(this):f("Moment Timezone has no data for "+M+". See http://momentjs.com/timezone/docs/#/data-loading/."),this):this._z?this._z.name:void 0},r.zoneName=u(r.zoneName),r.zoneAbbr=u(r.zoneAbbr),r.utc=(e=r.utc,function(){return this._z=null,e.apply(this,arguments)}),c.tz.setDefault=function(M){return(o<2||2===o&&p<9)&&f("Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js "+c.version+"."),c.defaultZone=M?W(M):null,c};var S=c.momentProperties;return"[object Array]"===Object.prototype.toString.call(S)?(S.push("_z"),S.push("_a")):S&&(S._z=null),X({version:"2015g",zones:["Africa/Abidjan|LMT GMT|g.8 0|01|-2ldXH.Q","Africa/Accra|LMT GMT GHST|.Q 0 -k|012121212121212121212121212121212121212121212121|-26BbX.8 6tzX.8 MnE 1BAk MnE 1BAk MnE 1BAk MnE 1C0k MnE 1BAk MnE 1BAk MnE 1BAk MnE 1C0k MnE 1BAk MnE 1BAk MnE 1BAk MnE 1C0k MnE 1BAk MnE 1BAk MnE 1BAk MnE 1C0k MnE 1BAk MnE 1BAk MnE 1BAk MnE 1C0k MnE 1BAk MnE 1BAk MnE","Africa/Addis_Ababa|LMT EAT BEAT BEAUT|-2r.g -30 -2u -2J|01231|-1F3Cr.g 3Dzr.g okMu MFXJ","Africa/Algiers|PMT WET WEST CET CEST|-9.l 0 -10 -10 -20|0121212121212121343431312123431213|-2nco9.l cNb9.l HA0 19A0 1iM0 11c0 1oo0 Wo0 1rc0 QM0 1EM0 UM0 DA0 Imo0 rd0 De0 9Xz0 1fb0 1ap0 16K0 2yo0 mEp0 hwL0 jxA0 11A0 dDd0 17b0 11B0 1cN0 2Dy0 1cN0 1fB0 1cL0","Africa/Bangui|LMT WAT|-d.A -10|01|-22y0d.A","Africa/Bissau|LMT WAT GMT|12.k 10 0|012|-2ldWV.E 2xonV.E","Africa/Blantyre|LMT CAT|-2a.k -20|01|-2GJea.k","Africa/Cairo|EET EEST|-20 -30|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-1bIO0 vb0 1ip0 11z0 1iN0 1nz0 12p0 1pz0 10N0 1pz0 16p0 1jz0 s3d0 Vz0 1oN0 11b0 1oO0 10N0 1pz0 10N0 1pb0 10N0 1pb0 10N0 1pb0 10N0 1pz0 10N0 1pb0 10N0 1pb0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1WL0 rd0 1Rz0 wp0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1qL0 Xd0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1ny0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 WL0 1qN0 Rb0 1wp0 On0 1zd0 Lz0 1EN0 Fb0 c10 8n0 8Nd0 gL0 e10 mn0","Africa/Casablanca|LMT WET WEST CET|u.k 0 -10 -10|0121212121212121213121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2gMnt.E 130Lt.E rb0 Dd0 dVb0 b6p0 TX0 EoB0 LL0 gnd0 rz0 43d0 AL0 1Nd0 XX0 1Cp0 pz0 dEp0 4mn0 SyN0 AL0 1Nd0 wn0 1FB0 Db0 1zd0 Lz0 1Nf0 wM0 co0 go0 1o00 s00 dA0 vc0 11A0 A00 e00 y00 11A0 uM0 e00 Dc0 11A0 s00 e00 IM0 WM0 mo0 gM0 LA0 WM0 jA0 e00 Rc0 11A0 e00 e00 U00 11A0 8o0 e00 11A0 11A0 5A0 e00 17c0 1fA0 1a00 1a00 1fA0 17c0 1io0 14o0 1lc0 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1lc0 14o0 1fA0","Africa/Ceuta|WET WEST CET CEST|0 -10 -10 -20|010101010101010101010232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-25KN0 11z0 drd0 18o0 3I00 17c0 1fA0 1a00 1io0 1a00 1y7p0 LL0 gnd0 rz0 43d0 AL0 1Nd0 XX0 1Cp0 pz0 dEp0 4VB0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Africa/El_Aaiun|LMT WAT WET WEST|Q.M 10 0 -10|01232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-1rDz7.c 1GVA7.c 6L0 AL0 1Nd0 XX0 1Cp0 pz0 1cBB0 AL0 1Nd0 wn0 1FB0 Db0 1zd0 Lz0 1Nf0 wM0 co0 go0 1o00 s00 dA0 vc0 11A0 A00 e00 y00 11A0 uM0 e00 Dc0 11A0 s00 e00 IM0 WM0 mo0 gM0 LA0 WM0 jA0 e00 Rc0 11A0 e00 e00 U00 11A0 8o0 e00 11A0 11A0 5A0 e00 17c0 1fA0 1a00 1a00 1fA0 17c0 1io0 14o0 1lc0 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1lc0 14o0 1fA0","Africa/Johannesburg|SAST SAST SAST|-1u -20 -30|012121|-2GJdu 1Ajdu 1cL0 1cN0 1cL0","Africa/Juba|LMT CAT CAST EAT|-2a.8 -20 -30 -30|01212121212121212121212121212121213|-1yW2a.8 1zK0a.8 16L0 1iN0 17b0 1jd0 17b0 1ip0 17z0 1i10 17X0 1hB0 18n0 1hd0 19b0 1gp0 19z0 1iN0 17b0 1ip0 17z0 1i10 18n0 1hd0 18L0 1gN0 19b0 1gp0 19z0 1iN0 17z0 1i10 17X0 yGd0","Africa/Monrovia|MMT LRT GMT|H.8 I.u 0|012|-23Lzg.Q 29s01.m","Africa/Ndjamena|LMT WAT WAST|-10.c -10 -20|0121|-2le10.c 2J3c0.c Wn0","Africa/Tripoli|LMT CET CEST EET|-Q.I -10 -20 -20|012121213121212121212121213123123|-21JcQ.I 1hnBQ.I vx0 4iP0 xx0 4eN0 Bb0 7ip0 U0n0 A10 1db0 1cN0 1db0 1dd0 1db0 1eN0 1bb0 1e10 1cL0 1c10 1db0 1dd0 1db0 1cN0 1db0 1q10 fAn0 1ep0 1db0 AKq0 TA0 1o00","Africa/Tunis|PMT CET CEST|-9.l -10 -20|0121212121212121212121212121212121|-2nco9.l 18pa9.l 1qM0 DA0 3Tc0 11B0 1ze0 WM0 7z0 3d0 14L0 1cN0 1f90 1ar0 16J0 1gXB0 WM0 1rA0 11c0 nwo0 Ko0 1cM0 1cM0 1rA0 10M0 zuM0 10N0 1aN0 1qM0 WM0 1qM0 11A0 1o00","Africa/Windhoek|SWAT SAST SAST CAT WAT WAST|-1u -20 -30 -20 -10 -20|012134545454545454545454545454545454545454545454545454545454545454545454545454545454545454545|-2GJdu 1Ajdu 1cL0 1SqL0 9NA0 11D0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 11B0 1nX0 11B0","America/Adak|NST NWT NPT BST BDT AHST HST HDT|b0 a0 a0 b0 a0 a0 a0 90|012034343434343434343434343434343456767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676|-17SX0 8wW0 iB0 Qlb0 52O0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cm0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Anchorage|CAT CAWT CAPT AHST AHDT YST AKST AKDT|a0 90 90 a0 90 90 90 80|012034343434343434343434343434343456767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676|-17T00 8wX0 iA0 Qlb0 52O0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cm0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Anguilla|LMT AST|46.4 40|01|-2kNvR.U","America/Araguaina|LMT BRT BRST|3c.M 30 20|0121212121212121212121212121212121212121212121212121|-2glwL.c HdKL.c 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 dMN0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 ny10 Lz0","America/Argentina/Buenos_Aires|CMT ART ARST ART ARST|4g.M 40 30 30 20|0121212121212121212121212121212121212121213434343434343234343|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wp0 Rb0 1wp0 TX0 g0p0 10M0 j3c0 uL0 1qN0 WL0","America/Argentina/Catamarca|CMT ART ARST ART ARST WART|4g.M 40 30 30 20 40|0121212121212121212121212121212121212121213434343454343235343|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 g0p0 10M0 ako0 7B0 8zb0 uL0","America/Argentina/Cordoba|CMT ART ARST ART ARST WART|4g.M 40 30 30 20 40|0121212121212121212121212121212121212121213434343454343234343|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 g0p0 10M0 j3c0 uL0 1qN0 WL0","America/Argentina/Jujuy|CMT ART ARST ART ARST WART WARST|4g.M 40 30 30 20 40 30|01212121212121212121212121212121212121212134343456543432343|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1ze0 TX0 1ld0 WK0 1wp0 TX0 g0p0 10M0 j3c0 uL0","America/Argentina/La_Rioja|CMT ART ARST ART ARST WART|4g.M 40 30 30 20 40|01212121212121212121212121212121212121212134343434534343235343|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Qn0 qO0 16n0 Rb0 1wp0 TX0 g0p0 10M0 ako0 7B0 8zb0 uL0","America/Argentina/Mendoza|CMT ART ARST ART ARST WART WARST|4g.M 40 30 30 20 40 30|0121212121212121212121212121212121212121213434345656543235343|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1u20 SL0 1vd0 Tb0 1wp0 TW0 g0p0 10M0 agM0 Op0 7TX0 uL0","America/Argentina/Rio_Gallegos|CMT ART ARST ART ARST WART|4g.M 40 30 30 20 40|0121212121212121212121212121212121212121213434343434343235343|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wp0 Rb0 1wp0 TX0 g0p0 10M0 ako0 7B0 8zb0 uL0","America/Argentina/Salta|CMT ART ARST ART ARST WART|4g.M 40 30 30 20 40|01212121212121212121212121212121212121212134343434543432343|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 g0p0 10M0 j3c0 uL0","America/Argentina/San_Juan|CMT ART ARST ART ARST WART|4g.M 40 30 30 20 40|01212121212121212121212121212121212121212134343434534343235343|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Qn0 qO0 16n0 Rb0 1wp0 TX0 g0p0 10M0 ak00 m10 8lb0 uL0","America/Argentina/San_Luis|CMT ART ARST ART ARST WART WARST|4g.M 40 30 30 20 40 30|01212121212121212121212121212121212121212134343456536353465653|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 XX0 1q20 SL0 AN0 kin0 10M0 ak00 m10 8lb0 8L0 jd0 1qN0 WL0 1qN0","America/Argentina/Tucuman|CMT ART ARST ART ARST WART|4g.M 40 30 30 20 40|012121212121212121212121212121212121212121343434345434323534343|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 g0p0 10M0 ako0 4N0 8BX0 uL0 1qN0 WL0","America/Argentina/Ushuaia|CMT ART ARST ART ARST WART|4g.M 40 30 30 20 40|0121212121212121212121212121212121212121213434343434343235343|-20UHH.c pKnH.c Mn0 1iN0 Tb0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 1C10 LX0 1C10 LX0 1C10 LX0 1C10 Mn0 MN0 2jz0 MN0 4lX0 u10 5Lb0 1pB0 Fnz0 u10 uL0 1vd0 SL0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wp0 Rb0 1wp0 TX0 g0p0 10M0 ajA0 8p0 8zb0 uL0","America/Aruba|LMT ANT AST|4z.L 4u 40|012|-2kV7o.d 28KLS.d","America/Asuncion|AMT PYT PYT PYST|3O.E 40 30 30|012131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313|-1x589.k 1DKM9.k 3CL0 3Dd0 10L0 1pB0 10n0 1pB0 10n0 1pB0 1cL0 1dd0 1db0 1dd0 1cL0 1dd0 1cL0 1dd0 1cL0 1dd0 1db0 1dd0 1cL0 1dd0 1cL0 1dd0 1cL0 1dd0 1db0 1dd0 1cL0 1lB0 14n0 1dd0 1cL0 1fd0 WL0 1rd0 1aL0 1dB0 Xz0 1qp0 Xb0 1qN0 10L0 1rB0 TX0 1tB0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 1cL0 WN0 1qL0 11B0 1nX0 1ip0 WL0 1qN0 WL0 1qN0 WL0 1tB0 TX0 1tB0 TX0 1tB0 19X0 1a10 1fz0 1a10 1fz0 1cN0 17b0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0 17b0 1ip0","America/Atikokan|CST CDT CWT CPT EST|60 50 50 50 50|0101234|-25TQ0 1in0 Rnb0 3je0 8x30 iw0","America/Bahia|LMT BRT BRST|2y.4 30 20|01212121212121212121212121212121212121212121212121212121212121|-2glxp.U HdLp.U 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 l5B0 Rb0","America/Bahia_Banderas|LMT MST CST PST MDT CDT|71 70 60 80 60 50|0121212131414141414141414141414141414152525252525252525252525252525252525252525252525252525252|-1UQF0 deL0 8lc0 17c0 10M0 1dd0 otX0 gmN0 P2N0 13Vd0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nW0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0","America/Barbados|LMT BMT AST ADT|3W.t 3W.t 40 30|01232323232|-1Q0I1.v jsM0 1ODC1.v IL0 1ip0 17b0 1ip0 17b0 1ld0 13b0","America/Belem|LMT BRT BRST|3d.U 30 20|012121212121212121212121212121|-2glwK.4 HdKK.4 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0","America/Belize|LMT CST CHDT CDT|5Q.M 60 5u 50|01212121212121212121212121212121212121212121212121213131|-2kBu7.c fPA7.c Onu 1zcu Rbu 1wou Rbu 1wou Rbu 1zcu Onu 1zcu Onu 1zcu Rbu 1wou Rbu 1wou Rbu 1wou Rbu 1zcu Onu 1zcu Onu 1zcu Rbu 1wou Rbu 1wou Rbu 1zcu Onu 1zcu Onu 1zcu Onu 1zcu Rbu 1wou Rbu 1wou Rbu 1zcu Onu 1zcu Onu 1zcu Rbu 1wou Rbu 1f0Mu qn0 lxB0 mn0","America/Blanc-Sablon|AST ADT AWT APT|40 30 30 30|010230|-25TS0 1in0 UGp0 8x50 iu0","America/Boa_Vista|LMT AMT AMST|42.E 40 30|0121212121212121212121212121212121|-2glvV.k HdKV.k 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 smp0 WL0 1tB0 2L0","America/Bogota|BMT COT COST|4U.g 50 40|0121|-2eb73.I 38yo3.I 2en0","America/Boise|PST PDT MST MWT MPT MDT|80 70 70 60 60 60|0101023425252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252|-261q0 1nX0 11B0 1nX0 8C10 JCL0 8x20 ix0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 Dd0 1Kn0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Cambridge_Bay|zzz MST MWT MPT MDDT MDT CST CDT EST|0 70 60 60 50 60 60 50 50|0123141515151515151515151515151515151515151515678651515151515151515151515151515151515151515151515151515151515151515151515151|-21Jc0 RO90 8x20 ix0 LCL0 1fA0 zgO0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11A0 1nX0 2K0 WQ0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Campo_Grande|LMT AMT AMST|3C.s 40 30|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212|-2glwl.w HdLl.w 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 1C10 Lz0 1Ip0 HX0 1zd0 On0 1HB0 IL0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1C10 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1C10 Lz0 1C10 Lz0 1C10 Lz0 1C10 On0 1zd0 Rb0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0","America/Cancun|LMT CST EST EDT CDT|5L.4 60 50 40 50|0123232341414141414141414141414141414141412|-1UQG0 2q2o0 yLB0 1lb0 14p0 1lb0 14p0 Lz0 xB0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 Dd0","America/Caracas|CMT VET VET|4r.E 4u 40|0121|-2kV7w.k 28KM2.k 1IwOu","America/Cayenne|LMT GFT GFT|3t.k 40 30|012|-2mrwu.E 2gWou.E","America/Cayman|KMT EST EDT|57.b 50 40|0121212121212121212121212121212121212121212121|-2l1uQ.N 4duNQ.N 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Chicago|CST CDT EST CWT CPT|60 50 50 50 50|01010101010101010101010101010101010102010101010103401010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261s0 1nX0 11B0 1nX0 1wp0 TX0 WN0 1qL0 1cN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 11B0 1Hz0 14p0 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 RB0 8x30 iw0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Chihuahua|LMT MST CST CDT MDT|74.k 70 60 50 60|0121212323241414141414141414141414141414141414141414141414141414141414141414141414141414141|-1UQF0 deL0 8lc0 17c0 10M0 1dd0 2zQN0 1lb0 14p0 1lb0 14q0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0","America/Costa_Rica|SJMT CST CDT|5A.d 60 50|0121212121|-1Xd6n.L 2lu0n.L Db0 1Kp0 Db0 pRB0 15b0 1kp0 mL0","America/Creston|MST PST|70 80|010|-29DR0 43B0","America/Cuiaba|LMT AMT AMST|3I.k 40 30|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212|-2glwf.E HdLf.E 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 4a10 HX0 1zd0 On0 1HB0 IL0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1C10 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1C10 Lz0 1C10 Lz0 1C10 Lz0 1C10 On0 1zd0 Rb0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0","America/Danmarkshavn|LMT WGT WGST GMT|1e.E 30 20 0|01212121212121212121212121212121213|-2a5WJ.k 2z5fJ.k 19U0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 DC0","America/Dawson|YST YDT YWT YPT YDDT PST PDT|90 80 80 80 70 80 70|0101023040565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565|-25TN0 1in0 1o10 13V0 Ser0 8x00 iz0 LCL0 1fA0 jrA0 fNd0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Dawson_Creek|PST PDT PWT PPT MST|80 70 70 70 70|0102301010101010101010101010101010101010101010101010101014|-25TO0 1in0 UGp0 8x10 iy0 3NB0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 ML0","America/Denver|MST MDT MWT MPT|70 60 60 60|01010101023010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261r0 1nX0 11B0 1nX0 11B0 1qL0 WN0 mn0 Ord0 8x20 ix0 LCN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Detroit|LMT CST EST EWT EPT EDT|5w.b 60 50 40 40 40|01234252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252|-2Cgir.N peqr.N 156L0 8x40 iv0 6fd0 11z0 Jy10 SL0 dnB0 1cL0 s10 1Vz0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Edmonton|LMT MST MDT MWT MPT|7x.Q 70 60 60 60|01212121212121341212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2yd4q.8 shdq.8 1in0 17d0 hz0 2dB0 1fz0 1a10 11z0 1qN0 WL0 1qN0 11z0 IGN0 8x20 ix0 3NB0 11z0 LFB0 1cL0 3Cp0 1cL0 66N0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Eirunepe|LMT ACT ACST AMT|4D.s 50 40 40|0121212121212121212121212121212131|-2glvk.w HdLk.w 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 dPB0 On0 yTd0 d5X0","America/El_Salvador|LMT CST CDT|5U.M 60 50|012121|-1XiG3.c 2Fvc3.c WL0 1qN0 WL0","America/Ensenada|LMT MST PST PDT PWT PPT|7M.4 70 80 70 70 70|012123245232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-1UQE0 4PX0 8mM0 8lc0 SN0 1cL0 pHB0 83r0 zI0 5O10 1Rz0 cOP0 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 BUp0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 U10 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Fort_Nelson|PST PDT PWT PPT MST|80 70 70 70 70|01023010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010104|-25TO0 1in0 UGp0 8x10 iy0 3NB0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0","America/Fort_Wayne|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|010101023010101010101010101040454545454545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 QI10 Db0 RB0 8x30 iw0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 5Tz0 1o10 qLb0 1cL0 1cN0 1cL0 1qhd0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Fortaleza|LMT BRT BRST|2y 30 20|0121212121212121212121212121212121212121|-2glxq HdLq 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 nsp0 WL0 1tB0 5z0 2mN0 On0","America/Glace_Bay|LMT AST ADT AWT APT|3X.M 40 30 30 30|012134121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2IsI0.c CwO0.c 1in0 UGp0 8x50 iu0 iq10 11z0 Jg10 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Godthab|LMT WGT WGST|3q.U 30 20|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2a5Ux.4 2z5dx.4 19U0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","America/Goose_Bay|NST NDT NST NDT NWT NPT AST ADT ADDT|3u.Q 2u.Q 3u 2u 2u 2u 40 30 20|010232323232323245232323232323232323232323232323232323232326767676767676767676767676767676767676767676768676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676|-25TSt.8 1in0 DXb0 2HbX.8 WL0 1qN0 WL0 1qN0 WL0 1tB0 TX0 1tB0 WL0 1qN0 WL0 1qN0 7UHu itu 1tB0 WL0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1tB0 WL0 1ld0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 S10 g0u 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14n1 1lb0 14p0 1nW0 11C0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zcX Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Grand_Turk|KMT EST EDT AST|57.b 50 40 40|0121212121212121212121212121212121212121212121212121212121212121212121212123|-2l1uQ.N 2HHBQ.N 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Guatemala|LMT CST CDT|62.4 60 50|0121212121|-24KhV.U 2efXV.U An0 mtd0 Nz0 ifB0 17b0 zDB0 11z0","America/Guayaquil|QMT ECT|5e 50|01|-1yVSK","America/Guyana|LMT GBGT GYT GYT GYT|3Q.E 3J 3J 30 40|01234|-2dvU7.k 24JzQ.k mlc0 Bxbf","America/Halifax|LMT AST ADT AWT APT|4e.o 40 30 30 30|0121212121212121212121212121212121212121212121212134121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2IsHJ.A xzzJ.A 1db0 3I30 1in0 3HX0 IL0 1E10 ML0 1yN0 Pb0 1Bd0 Mn0 1Bd0 Rz0 1w10 Xb0 1w10 LX0 1w10 Xb0 1w10 Lz0 1C10 Jz0 1E10 OL0 1yN0 Un0 1qp0 Xb0 1qp0 11X0 1w10 Lz0 1HB0 LX0 1C10 FX0 1w10 Xb0 1qp0 Xb0 1BB0 LX0 1td0 Xb0 1qp0 Xb0 Rf0 8x50 iu0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 3Qp0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 3Qp0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 6i10 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Havana|HMT CST CDT|5t.A 50 40|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1Meuu.o 72zu.o ML0 sld0 An0 1Nd0 Db0 1Nd0 An0 6Ep0 An0 1Nd0 An0 JDd0 Mn0 1Ap0 On0 1fd0 11X0 1qN0 WL0 1wp0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 14n0 1ld0 14L0 1kN0 15b0 1kp0 1cL0 1cN0 1fz0 1a10 1fz0 1fB0 11z0 14p0 1nX0 11B0 1nX0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 14n0 1ld0 14n0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 1a10 1in0 1a10 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 17c0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 11A0 6i00 Rc0 1wo0 U00 1tA0 Rc0 1wo0 U00 1wo0 U00 1zc0 U00 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0","America/Hermosillo|LMT MST CST PST MDT|7n.Q 70 60 80 60|0121212131414141|-1UQF0 deL0 8lc0 17c0 10M0 1dd0 otX0 gmN0 P2N0 13Vd0 1lb0 14p0 1lb0 14p0 1lb0","America/Indiana/Knox|CST CDT CWT CPT EST|60 50 50 50 50|0101023010101010101010101010101010101040101010101010101010101010101010101010101010101010141010101010101010101010101010101010101010101010101010101010101010|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 3NB0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 1fz0 1cN0 1cL0 1cN0 11z0 1o10 11z0 1o10 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 3Cn0 8wp0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 z8o0 1o00 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Indiana/Marengo|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|0101023010101010101010104545454545414545454545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 dyN0 11z0 6fd0 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 jrz0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1VA0 LA0 1BX0 1e6p0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Indiana/Petersburg|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|01010230101010101010101010104010101010101010101010141014545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 njX0 WN0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 3Fb0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 19co0 1o00 Rd0 1zb0 Oo0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Indiana/Tell_City|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|01010230101010101010101010101010454541010101010101010101010101010101010101010101010101010101010101010|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 1o10 11z0 g0p0 11z0 1o10 11z0 1qL0 WN0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 1fz0 1cN0 WL0 1qN0 1cL0 1cN0 1cL0 1cN0 caL0 1cL0 1cN0 1cL0 1qhd0 1o00 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Indiana/Vevay|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|010102304545454545454545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 kPB0 Awn0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1lnd0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Indiana/Vincennes|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|01010230101010101010101010101010454541014545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 1o10 11z0 g0p0 11z0 1o10 11z0 1qL0 WN0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 1fz0 1cN0 WL0 1qN0 1cL0 1cN0 1cL0 1cN0 caL0 1cL0 1cN0 1cL0 1qhd0 1o00 Rd0 1zb0 Oo0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Indiana/Winamac|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|01010230101010101010101010101010101010454541054545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 1fz0 1cN0 1cL0 1cN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 jrz0 1cL0 1cN0 1cL0 1qhd0 1o00 Rd0 1za0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Inuvik|zzz PST PDDT MST MDT|0 80 60 70 60|0121343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343|-FnA0 tWU0 1fA0 wPe0 2pz0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Iqaluit|zzz EWT EPT EST EDDT EDT CST CDT|0 40 40 50 30 40 60 50|01234353535353535353535353535353535353535353567353535353535353535353535353535353535353535353535353535353535353535353535353|-16K00 7nX0 iv0 LCL0 1fA0 zgO0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11C0 1nX0 11A0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Jamaica|KMT EST EDT|57.b 50 40|0121212121212121212121|-2l1uQ.N 2uM1Q.N 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0","America/Juneau|PST PWT PPT PDT YDT YST AKST AKDT|80 70 70 70 80 90 90 80|01203030303030303030303030403030356767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676|-17T20 8x10 iy0 Vo10 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cM0 1cM0 1cL0 1cN0 1fz0 1a10 1fz0 co0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Kentucky/Louisville|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|0101010102301010101010101010101010101454545454545414545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 3Fd0 Nb0 LPd0 11z0 RB0 8x30 iw0 Bb0 10N0 2bB0 8in0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 xz0 gso0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1VA0 LA0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Kentucky/Monticello|CST CDT CWT CPT EST EDT|60 50 50 50 50 40|0101023010101010101010101010101010101010101010101010101010101010101010101454545454545454545454545454545454545454545454545454545454545454545454545454|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 SWp0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11A0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/La_Paz|CMT BOST BOT|4w.A 3w.A 40|012|-1x37r.o 13b0","America/Lima|LMT PET PEST|58.A 50 40|0121212121212121|-2tyGP.o 1bDzP.o zX0 1aN0 1cL0 1cN0 1cL0 1PrB0 zX0 1O10 zX0 6Gp0 zX0 98p0 zX0","America/Los_Angeles|PST PDT PWT PPT|80 70 70 70|010102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261q0 1nX0 11B0 1nX0 SgN0 8x10 iy0 5Wp0 1Vb0 3dB0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Maceio|LMT BRT BRST|2m.Q 30 20|012121212121212121212121212121212121212121|-2glxB.8 HdLB.8 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 dMN0 Lz0 8Q10 WL0 1tB0 5z0 2mN0 On0","America/Managua|MMT CST EST CDT|5J.c 60 50 50|0121313121213131|-1quie.M 1yAMe.M 4mn0 9Up0 Dz0 1K10 Dz0 s3F0 1KH0 DB0 9In0 k8p0 19X0 1o30 11y0","America/Manaus|LMT AMT AMST|40.4 40 30|01212121212121212121212121212121|-2glvX.U HdKX.U 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 dPB0 On0","America/Martinique|FFMT AST ADT|44.k 40 30|0121|-2mPTT.E 2LPbT.E 19X0","America/Matamoros|LMT CST CDT|6E 60 50|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1UQG0 2FjC0 1nX0 i6p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 U10 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Mazatlan|LMT MST CST PST MDT|75.E 70 60 80 60|0121212131414141414141414141414141414141414141414141414141414141414141414141414141414141414141|-1UQF0 deL0 8lc0 17c0 10M0 1dd0 otX0 gmN0 P2N0 13Vd0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0","America/Menominee|CST CDT CWT CPT EST|60 50 50 50 50|01010230101041010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 1o10 11z0 LCN0 1fz0 6410 9Jb0 1cM0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Merida|LMT CST EST CDT|5W.s 60 50 50|0121313131313131313131313131313131313131313131313131313131313131313131313131313131313131|-1UQG0 2q2o0 2hz0 wu30 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0","America/Metlakatla|PST PWT PPT PDT|80 70 70 70|0120303030303030303030303030303030|-17T20 8x10 iy0 Vo10 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0","America/Mexico_City|LMT MST CST CDT CWT|6A.A 70 60 50 50|012121232324232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-1UQF0 deL0 8lc0 17c0 10M0 1dd0 gEn0 TX0 3xd0 Jb0 6zB0 SL0 e5d0 17b0 1Pff0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0","America/Miquelon|LMT AST PMST PMDT|3I.E 40 30 20|012323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-2mKkf.k 2LTAf.k gQ10 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Moncton|EST AST ADT AWT APT|50 40 30 30 30|012121212121212121212134121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2IsH0 CwN0 1in0 zAo0 An0 1Nd0 An0 1Nd0 An0 1Nd0 An0 1Nd0 An0 1Nd0 An0 1K10 Lz0 1zB0 NX0 1u10 Wn0 S20 8x50 iu0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 3Cp0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14n1 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 ReX 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Monterrey|LMT CST CDT|6F.g 60 50|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1UQG0 2FjC0 1nX0 i6p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0","America/Montevideo|MMT UYT UYHST UYST UYT UYHST|3I.I 3u 30 20 30 2u|012121212121212121212121213434343434345454543453434343434343434343434343434343434343434|-20UIf.g 8jzJ.g 1cLu 1dcu 1cLu 1dcu 1cLu ircu 11zu 1o0u 11zu 1o0u 11zu 1qMu WLu 1qMu WLu 1qMu WLu 1qMu 11zu 1o0u 11zu NAu 11bu 2iMu zWu Dq10 19X0 pd0 jz0 cm10 19X0 1fB0 1on0 11d0 1oL0 1nB0 1fzu 1aou 1fzu 1aou 1fzu 3nAu Jb0 3MN0 1SLu 4jzu 2PB0 Lb0 3Dd0 1pb0 ixd0 An0 1MN0 An0 1wp0 On0 1wp0 Rb0 1zd0 On0 1wp0 Rb0 s8p0 1fB0 1ip0 11z0 1ld0 14n0 1o10 11z0 1o10 11z0 1o10 14n0 1ld0 14n0 1ld0 14n0 1o10 11z0 1o10 11z0 1o10 11z0","America/Montreal|EST EDT EWT EPT|50 40 40 40|01010101010101010101010101010101010101010101012301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-25TR0 1in0 11Wu 1nzu 1fD0 WJ0 1wr0 Nb0 1Ap0 On0 1zd0 On0 1wp0 TX0 1tB0 TX0 1tB0 TX0 1tB0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 4kM0 8x40 iv0 1o10 11z0 1nX0 11z0 1o10 11z0 1o10 1qL0 11D0 1nX0 11B0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Nassau|LMT EST EDT|59.u 50 40|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2kNuO.u 26XdO.u 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/New_York|EST EDT EWT EPT|50 40 40 40|01010101010101010101010101010101010101010101010102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261t0 1nX0 11B0 1nX0 11B0 1qL0 1a10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 RB0 8x40 iv0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Nipigon|EST EDT EWT EPT|50 40 40 40|010123010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-25TR0 1in0 Rnb0 3je0 8x40 iv0 19yN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Nome|NST NWT NPT BST BDT YST AKST AKDT|b0 a0 a0 b0 a0 90 90 80|012034343434343434343434343434343456767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676|-17SX0 8wW0 iB0 Qlb0 52O0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cl0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Noronha|LMT FNT FNST|29.E 20 10|0121212121212121212121212121212121212121|-2glxO.k HdKO.k 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 nsp0 WL0 1tB0 2L0 2pB0 On0","America/North_Dakota/Beulah|MST MDT MWT MPT CST CDT|70 60 60 60 60 50|010102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101014545454545454545454545454545454545454545454545454545454|-261r0 1nX0 11B0 1nX0 SgN0 8x20 ix0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Oo0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/North_Dakota/Center|MST MDT MWT MPT CST CDT|70 60 60 60 60 50|010102301010101010101010101010101010101010101010101010101014545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454|-261r0 1nX0 11B0 1nX0 SgN0 8x20 ix0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14o0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/North_Dakota/New_Salem|MST MDT MWT MPT CST CDT|70 60 60 60 60 50|010102301010101010101010101010101010101010101010101010101010101010101010101010101454545454545454545454545454545454545454545454545454545454545454545454|-261r0 1nX0 11B0 1nX0 SgN0 8x20 ix0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14o0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Ojinaga|LMT MST CST CDT MDT|6V.E 70 60 50 60|0121212323241414141414141414141414141414141414141414141414141414141414141414141414141414141|-1UQF0 deL0 8lc0 17c0 10M0 1dd0 2zQN0 1lb0 14p0 1lb0 14q0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 U10 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Panama|CMT EST|5j.A 50|01|-2uduE.o","America/Pangnirtung|zzz AST AWT APT ADDT ADT EDT EST CST CDT|0 40 30 30 20 30 40 50 60 50|012314151515151515151515151515151515167676767689767676767676767676767676767676767676767676767676767676767676767676767676767|-1XiM0 PnG0 8x50 iu0 LCL0 1fA0 zgO0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1o00 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11C0 1nX0 11A0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Paramaribo|LMT PMT PMT NEGT SRT SRT|3E.E 3E.Q 3E.A 3u 3u 30|012345|-2nDUj.k Wqo0.c qanX.I 1dmLN.o lzc0","America/Phoenix|MST MDT MWT|70 60 60|01010202010|-261r0 1nX0 11B0 1nX0 SgN0 4Al1 Ap0 1db0 SWqX 1cL0","America/Port-au-Prince|PPMT EST EDT|4N 50 40|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-28RHb 2FnMb 19X0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14q0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 i6n0 1nX0 11B0 1nX0 d430 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Porto_Acre|LMT ACT ACST AMT|4v.c 50 40 40|01212121212121212121212121212131|-2glvs.M HdLs.M 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 NBd0 d5X0","America/Porto_Velho|LMT AMT AMST|4f.A 40 30|012121212121212121212121212121|-2glvI.o HdKI.o 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0","America/Puerto_Rico|AST AWT APT|40 30 30|0120|-17lU0 7XT0 iu0","America/Rainy_River|CST CDT CWT CPT|60 50 50 50|010123010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-25TQ0 1in0 Rnb0 3je0 8x30 iw0 19yN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Rankin_Inlet|zzz CST CDDT CDT EST|0 60 40 50 50|012131313131313131313131313131313131313131313431313131313131313131313131313131313131313131313131313131313131313131313131|-vDc0 keu0 1fA0 zgO0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Recife|LMT BRT BRST|2j.A 30 20|0121212121212121212121212121212121212121|-2glxE.o HdLE.o 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 nsp0 WL0 1tB0 2L0 2pB0 On0","America/Regina|LMT MST MDT MWT MPT CST|6W.A 70 60 60 60 60|012121212121212121212121341212121212121212121212121215|-2AD51.o uHe1.o 1in0 s2L0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 66N0 1cL0 1cN0 19X0 1fB0 1cL0 1fB0 1cL0 1cN0 1cL0 M30 8x20 ix0 1ip0 1cL0 1ip0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 3NB0 1cL0 1cN0","America/Resolute|zzz CST CDDT CDT EST|0 60 40 50 50|012131313131313131313131313131313131313131313431313131313431313131313131313131313131313131313131313131313131313131313131|-SnA0 GWS0 1fA0 zgO0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Santa_Isabel|LMT MST PST PDT PWT PPT|7D.s 70 80 70 70 70|012123245232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-1UQE0 4PX0 8mM0 8lc0 SN0 1cL0 pHB0 83r0 zI0 5O10 1Rz0 cOP0 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 BUp0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0","America/Santarem|LMT AMT AMST BRT|3C.M 40 30 30|0121212121212121212121212121213|-2glwl.c HdLl.c 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 NBd0","America/Santiago|SMT CLT CLT CLST CLST CLT|4G.K 50 40 40 30 30|01020313131313121242124242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424245|-2q2jh.e fJAh.e 5knG.K 1Vzh.e jRAG.K 1pbh.e 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 nHX0 op0 9Bz0 jb0 1oN0 ko0 Qeo0 WL0 1zd0 On0 1ip0 11z0 1o10 11z0 1qN0 WL0 1ld0 14n0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 1wn0","America/Santo_Domingo|SDMT EST EDT EHDT AST|4E 50 40 4u 40|01213131313131414|-1ttjk 1lJMk Mn0 6sp0 Lbu 1Cou yLu 1RAu wLu 1QMu xzu 1Q0u xXu 1PAu 13jB0 e00","America/Sao_Paulo|LMT BRT BRST|36.s 30 20|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212|-2glwR.w HdKR.w 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 pTd0 PX0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 1C10 Lz0 1Ip0 HX0 1zd0 On0 1HB0 IL0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1C10 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1C10 Lz0 1C10 Lz0 1C10 Lz0 1C10 On0 1zd0 Rb0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0","America/Scoresbysund|LMT CGT CGST EGST EGT|1r.Q 20 10 0 10|0121343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434|-2a5Ww.8 2z5ew.8 1a00 1cK0 1cL0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","America/Sitka|PST PWT PPT PDT YST AKST AKDT|80 70 70 70 90 90 80|01203030303030303030303030303030345656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565|-17T20 8x10 iy0 Vo10 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 co0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/St_Johns|NST NDT NST NDT NWT NPT NDDT|3u.Q 2u.Q 3u 2u 2u 2u 1u|01010101010101010101010101010101010102323232323232324523232323232323232323232323232323232323232323232323232323232323232323232323232323232326232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-28oit.8 14L0 1nB0 1in0 1gm0 Dz0 1JB0 1cL0 1cN0 1cL0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1fB0 1cL0 1cN0 1cL0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1fB0 1cL0 1fB0 19X0 1fB0 19X0 10O0 eKX.8 19X0 1iq0 WL0 1qN0 WL0 1qN0 WL0 1tB0 TX0 1tB0 WL0 1qN0 WL0 1qN0 7UHu itu 1tB0 WL0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1tB0 WL0 1ld0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14n1 1lb0 14p0 1nW0 11C0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zcX Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Swift_Current|LMT MST MDT MWT MPT CST|7b.k 70 60 60 60 60|012134121212121212121215|-2AD4M.E uHdM.E 1in0 UGp0 8x20 ix0 1o10 17b0 1ip0 11z0 1o10 11z0 1o10 11z0 isN0 1cL0 3Cp0 1cL0 1cN0 11z0 1qN0 WL0 pMp0","America/Tegucigalpa|LMT CST CDT|5M.Q 60 50|01212121|-1WGGb.8 2ETcb.8 WL0 1qN0 WL0 GRd0 AL0","America/Thule|LMT AST ADT|4z.8 40 30|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2a5To.Q 31NBo.Q 1cL0 1cN0 1cL0 1fB0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Thunder_Bay|CST EST EWT EPT EDT|60 50 40 40 40|0123141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141|-2q5S0 1iaN0 8x40 iv0 XNB0 1cL0 1cN0 1fz0 1cN0 1cL0 3Cp0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Vancouver|PST PDT PWT PPT|80 70 70 70|0102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-25TO0 1in0 UGp0 8x10 iy0 1o10 17b0 1ip0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Whitehorse|YST YDT YWT YPT YDDT PST PDT|90 80 80 80 70 80 70|0101023040565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565|-25TN0 1in0 1o10 13V0 Ser0 8x00 iz0 LCL0 1fA0 3NA0 vrd0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Winnipeg|CST CDT CWT CPT|60 50 50 50|010101023010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2aIi0 WL0 3ND0 1in0 Jap0 Rb0 aCN0 8x30 iw0 1tB0 11z0 1ip0 11z0 1o10 11z0 1o10 11z0 1rd0 10L0 1op0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 1cL0 1cN0 11z0 6i10 WL0 6i10 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1a00 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1a00 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Yakutat|YST YWT YPT YDT AKST AKDT|90 80 80 80 90 80|01203030303030303030303030303030304545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454|-17T10 8x00 iz0 Vo10 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cn0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","America/Yellowknife|zzz MST MWT MPT MDDT MDT|0 70 60 60 50 60|012314151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151|-1pdA0 hix0 8x20 ix0 LCL0 1fA0 zgO0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","Antarctica/Casey|zzz AWST CAST|0 -80 -b0|012121|-2q00 1DjS0 T90 40P0 KL0","Antarctica/Davis|zzz DAVT DAVT|0 -70 -50|01012121|-vyo0 iXt0 alj0 1D7v0 VB0 3Wn0 KN0","Antarctica/DumontDUrville|zzz PMT DDUT|0 -a0 -a0|0102|-U0o0 cfq0 bFm0","Antarctica/Macquarie|AEST AEDT zzz MIST|-a0 -b0 0 -b0|0102010101010101010101010101010101010101010101010101010101010101010101010101010101010101013|-29E80 19X0 4SL0 1ayy0 Lvs0 1cM0 1o00 Rc0 1wo0 Rc0 1wo0 U00 1wo0 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1qM0 WM0 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1wo0 WM0 1tA0 WM0 1tA0 U00 1tA0 U00 1tA0 11A0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 11A0 1o00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1cM0 1cM0 1cM0","Antarctica/Mawson|zzz MAWT MAWT|0 -60 -50|012|-CEo0 2fyk0","Antarctica/McMurdo|NZMT NZST NZST NZDT|-bu -cu -c0 -d0|01020202020202020202020202023232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323|-1GCVu Lz0 1tB0 11zu 1o0u 11zu 1o0u 11zu 1o0u 14nu 1lcu 14nu 1lcu 1lbu 11Au 1nXu 11Au 1nXu 11Au 1nXu 11Au 1nXu 11Au 1qLu WMu 1qLu 11Au 1n1bu IM0 1C00 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1qM0 14o0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1io0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00","Antarctica/Palmer|zzz ARST ART ART ARST CLT CLST CLT|0 30 40 30 20 40 30 30|012121212123435656565656565656565656565656565656565656565656565656565656565656567|-cao0 nD0 1vd0 SL0 1vd0 17z0 1cN0 1fz0 1cN0 1cL0 1cN0 asn0 Db0 jsN0 14N0 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 1wn0","Antarctica/Rothera|zzz ROTT|0 30|01|gOo0","Antarctica/Syowa|zzz SYOT|0 -30|01|-vs00","Antarctica/Troll|zzz UTC CEST|0 0 -20|01212121212121212121212121212121212121212121212121212121212121212121|1puo0 hd0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Antarctica/Vostok|zzz VOST|0 -60|01|-tjA0","Arctic/Longyearbyen|CET CEST|-10 -20|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2awM0 Qm0 W6o0 5pf0 WM0 1fA0 1cM0 1cM0 1cM0 1cM0 wJc0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1qM0 WM0 zpc0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Asia/Aden|LMT AST|-36.Q -30|01|-TvD6.Q","Asia/Almaty|LMT ALMT ALMT ALMST|-57.M -50 -60 -70|0123232323232323232323232323232323232323232323232|-1Pc57.M eUo7.M 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 3Cl0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0","Asia/Amman|LMT EET EEST|-2n.I -20 -30|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1yW2n.I 1HiMn.I KL0 1oN0 11b0 1oN0 11b0 1pd0 1dz0 1cp0 11b0 1op0 11b0 fO10 1db0 1e10 1cL0 1cN0 1cL0 1cN0 1fz0 1pd0 10n0 1ld0 14n0 1hB0 15b0 1ip0 19X0 1cN0 1cL0 1cN0 17b0 1ld0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1So0 y00 1fc0 1dc0 1co0 1dc0 1cM0 1cM0 1cM0 1o00 11A0 1lc0 17c0 1cM0 1cM0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 4bX0 Dd0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0","Asia/Anadyr|LMT ANAT ANAT ANAST ANAST ANAST ANAT|-bN.U -c0 -d0 -e0 -d0 -c0 -b0|01232414141414141414141561414141414141414141414141414141414141561|-1PcbN.U eUnN.U 23CL0 1db0 1cN0 1dc0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qN0 WM0","Asia/Aqtau|LMT FORT FORT SHET SHET SHEST AQTT AQTST AQTST AQTT|-3l.4 -40 -50 -50 -60 -60 -50 -60 -50 -40|012345353535353535353536767676898989898989898989896|-1Pc3l.4 eUnl.4 1jcL0 JDc0 1cL0 1dc0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2UK0 Fz0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cN0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 RW0","Asia/Aqtobe|LMT AKTT AKTT AKTST AKTT AQTT AQTST|-3M.E -40 -50 -60 -60 -50 -60|01234323232323232323232565656565656565656565656565|-1Pc3M.E eUnM.E 23CL0 1db0 1cM0 1dc0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2UK0 Fz0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0","Asia/Ashgabat|LMT ASHT ASHT ASHST ASHST TMT TMT|-3R.w -40 -50 -60 -50 -40 -50|012323232323232323232324156|-1Pc3R.w eUnR.w 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 ba0 xC0","Asia/Baghdad|BMT AST ADT|-2V.A -30 -40|012121212121212121212121212121212121212121212121212121|-26BeV.A 2ACnV.A 11b0 1cp0 1dz0 1dd0 1db0 1cN0 1cp0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1de0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0","Asia/Bahrain|LMT GST AST|-3q.8 -40 -30|012|-21Jfq.8 27BXq.8","Asia/Baku|LMT BAKT BAKT BAKST BAKST AZST AZT AZT AZST|-3j.o -30 -40 -50 -40 -40 -30 -40 -50|0123232323232323232323245657878787878787878787878787878787878787878787878787878787878787878787878787878787878787|-1Pc3j.o 1jUoj.o WCL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 10K0 c30 1cJ0 1cL0 8wu0 1o00 11z0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Asia/Bangkok|BMT ICT|-6G.4 -70|01|-218SG.4","Asia/Beirut|EET EEST|-20 -30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-21aq0 1on0 1410 1db0 19B0 1in0 1ip0 WL0 1lQp0 11b0 1oN0 11b0 1oN0 11b0 1pd0 11b0 1oN0 11b0 q6N0 En0 1oN0 11b0 1oN0 11b0 1oN0 11b0 1pd0 11b0 1oN0 11b0 1op0 11b0 dA10 17b0 1iN0 17b0 1iN0 17b0 1iN0 17b0 1vB0 SL0 1mp0 13z0 1iN0 17b0 1iN0 17b0 1jd0 12n0 1a10 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0","Asia/Bishkek|LMT FRUT FRUT FRUST FRUST KGT KGST KGT|-4W.o -50 -60 -70 -60 -50 -60 -60|01232323232323232323232456565656565656565656565656567|-1Pc4W.o eUnW.o 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 11c0 1tX0 17b0 1ip0 17b0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1cPu 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 T8u","Asia/Brunei|LMT BNT BNT|-7D.E -7u -80|012|-1KITD.E gDc9.E","Asia/Calcutta|HMT BURT IST IST|-5R.k -6u -5u -6u|01232|-18LFR.k 1unn.k HB0 7zX0","Asia/Chita|LMT YAKT YAKT YAKST YAKST YAKT IRKT|-7x.Q -80 -90 -a0 -90 -a0 -80|012323232323232323232324123232323232323232323232323232323232323256|-21Q7x.Q pAnx.Q 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0","Asia/Choibalsan|LMT ULAT ULAT CHOST CHOT CHOT CHOST|-7C -70 -80 -a0 -90 -80 -90|0123434343434343434343434343434343434343434343456565656565656565656565656565656565656565656565|-2APHC 2UkoC cKn0 1da0 1dd0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 6hD0 11z0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 3Db0 h1f0 1cJ0 1cP0 1cJ0 1cP0 1fx0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1fx0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1fx0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1fx0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0","Asia/Chongqing|CST CDT|-80 -90|01010101010101010|-1c1I0 LX0 16p0 1jz0 1Myp0 Rb0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0","Asia/Colombo|MMT IST IHST IST LKT LKT|-5j.w -5u -60 -6u -6u -60|01231451|-2zOtj.w 1rFbN.w 1zzu 7Apu 23dz0 11zu n3cu","Asia/Dacca|HMT BURT IST DACT BDT BDST|-5R.k -6u -5u -60 -60 -70|01213454|-18LFR.k 1unn.k HB0 m6n0 LqMu 1x6n0 1i00","Asia/Damascus|LMT EET EEST|-2p.c -20 -30|01212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-21Jep.c Hep.c 17b0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1xRB0 11X0 1oN0 10L0 1pB0 11b0 1oN0 10L0 1mp0 13X0 1oN0 11b0 1pd0 11b0 1oN0 11b0 1oN0 11b0 1oN0 11b0 1pd0 11b0 1oN0 11b0 1oN0 11b0 1oN0 11b0 1pd0 11b0 1oN0 Nb0 1AN0 Nb0 bcp0 19X0 1gp0 19X0 3ld0 1xX0 Vd0 1Bz0 Sp0 1vX0 10p0 1dz0 1cN0 1cL0 1db0 1db0 1g10 1an0 1ap0 1db0 1fd0 1db0 1cN0 1db0 1dd0 1db0 1cp0 1dz0 1c10 1dX0 1cN0 1db0 1dd0 1db0 1cN0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1db0 1cN0 1db0 1cN0 19z0 1fB0 1qL0 11B0 1on0 Wp0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0","Asia/Dili|LMT TLT JST TLT WITA|-8m.k -80 -90 -90 -80|012343|-2le8m.k 1dnXm.k 8HA0 1ew00 Xld0","Asia/Dubai|LMT GST|-3F.c -40|01|-21JfF.c","Asia/Dushanbe|LMT DUST DUST DUSST DUSST TJT|-4z.c -50 -60 -70 -60 -50|0123232323232323232323245|-1Pc4z.c eUnz.c 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 14N0","Asia/Gaza|EET EET EEST IST IDT|-20 -30 -30 -20 -30|010101010102020202020202020202023434343434343434343434343430202020202020202020202020202020202020202020202020202020202020202020202020202020202020|-1c2q0 5Rb0 10r0 1px0 10N0 1pz0 16p0 1jB0 16p0 1jx0 pBd0 Vz0 1oN0 11b0 1oO0 10N0 1pz0 10N0 1pb0 10N0 1pb0 10N0 1pb0 10N0 1pz0 10N0 1pb0 10N0 1pb0 11d0 1oL0 dW0 hfB0 Db0 1fB0 Rb0 npB0 11z0 1C10 IL0 1s10 10n0 1o10 WL0 1zd0 On0 1ld0 11z0 1o10 14n0 1o10 14n0 1nd0 12n0 1nd0 Xz0 1q10 12n0 M10 C00 17c0 1io0 17c0 1io0 17c0 1o00 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 17c0 1io0 18N0 1bz0 19z0 1gp0 1610 1iL0 11z0 1o10 14o0 1lA1 SKX 1xd1 MKX 1AN0 1a00 1fA0 1cL0 1cN0 1nX0 1210 1nz0 1210 1nz0 14N0 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 14N0 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 14N0 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 14N0 1nz0 1210 1nz0 1210 1nz0 1210 1nz0","Asia/Hebron|EET EET EEST IST IDT|-20 -30 -30 -20 -30|01010101010202020202020202020202343434343434343434343434343020202020202020202020202020202020202020202020202020202020202020202020202020202020202020|-1c2q0 5Rb0 10r0 1px0 10N0 1pz0 16p0 1jB0 16p0 1jx0 pBd0 Vz0 1oN0 11b0 1oO0 10N0 1pz0 10N0 1pb0 10N0 1pb0 10N0 1pb0 10N0 1pz0 10N0 1pb0 10N0 1pb0 11d0 1oL0 dW0 hfB0 Db0 1fB0 Rb0 npB0 11z0 1C10 IL0 1s10 10n0 1o10 WL0 1zd0 On0 1ld0 11z0 1o10 14n0 1o10 14n0 1nd0 12n0 1nd0 Xz0 1q10 12n0 M10 C00 17c0 1io0 17c0 1io0 17c0 1o00 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 17c0 1io0 18N0 1bz0 19z0 1gp0 1610 1iL0 12L0 1mN0 14o0 1lc0 Tb0 1xd1 MKX bB0 cn0 1cN0 1a00 1fA0 1cL0 1cN0 1nX0 1210 1nz0 1210 1nz0 14N0 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 14N0 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 14N0 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 1210 1nz0 14N0 1nz0 1210 1nz0 1210 1nz0 1210 1nz0","Asia/Ho_Chi_Minh|LMT PLMT ICT IDT JST|-76.E -76.u -70 -80 -90|0123423232|-2yC76.E bK00.a 1h7b6.u 5lz0 18o0 3Oq0 k5b0 aW00 BAM0","Asia/Hong_Kong|LMT HKT HKST JST|-7A.G -80 -90 -90|0121312121212121212121212121212121212121212121212121212121212121212121|-2CFHA.G 1sEP6.G 1cL0 ylu 93X0 1qQu 1tX0 Rd0 1In0 NB0 1cL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1kL0 14N0 1nX0 U10 1tz0 U10 1wn0 Rd0 1wn0 U10 1tz0 U10 1tz0 U10 1tz0 U10 1wn0 Rd0 1wn0 Rd0 1wn0 U10 1tz0 U10 1tz0 17d0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 s10 1Vz0 1cN0 1cL0 1cN0 1cL0 6fd0 14n0","Asia/Hovd|LMT HOVT HOVT HOVST|-66.A -60 -70 -80|012323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-2APG6.A 2Uko6.A cKn0 1db0 1dd0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 6hD0 11z0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 kEp0 1cJ0 1cP0 1cJ0 1cP0 1fx0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1fx0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1fx0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1fx0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0","Asia/Irkutsk|IMT IRKT IRKT IRKST IRKST IRKT|-6V.5 -70 -80 -90 -80 -90|012323232323232323232324123232323232323232323232323232323232323252|-21zGV.5 pjXV.5 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0","Asia/Istanbul|IMT EET EEST TRST TRT|-1U.U -20 -30 -40 -30|012121212121212121212121212121212121212121212121212121234343434342121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2ogNU.U dzzU.U 11b0 8tB0 1on0 1410 1db0 19B0 1in0 3Rd0 Un0 1oN0 11b0 zSp0 CL0 mN0 1Vz0 1gN0 1pz0 5Rd0 1fz0 1yp0 ML0 1kp0 17b0 1ip0 17b0 1fB0 19X0 1jB0 18L0 1ip0 17z0 qdd0 xX0 3S10 Tz0 dA10 11z0 1o10 11z0 1qN0 11z0 1ze0 11B0 WM0 1qO0 WI0 1nX0 1rB0 10L0 11B0 1in0 17d0 1in0 2pX0 19E0 1fU0 16Q0 1iI0 16Q0 1iI0 1Vd0 pb0 3Kp0 14o0 1df0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cL0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WO0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 Xc0 1qo0 WM0 1qM0 11A0 1o00 1200 1nA0 11A0 1tA0 U00 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Asia/Jakarta|BMT JAVT WIB JST WIB WIB|-77.c -7k -7u -90 -80 -70|01232425|-1Q0Tk luM0 mPzO 8vWu 6kpu 4PXu xhcu","Asia/Jayapura|LMT WIT ACST|-9m.M -90 -9u|0121|-1uu9m.M sMMm.M L4nu","Asia/Jerusalem|JMT IST IDT IDDT|-2k.E -20 -30 -40|01212121212132121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-26Bek.E SyMk.E 5Rb0 10r0 1px0 10N0 1pz0 16p0 1jB0 16p0 1jx0 3LB0 Em0 or0 1cn0 1dB0 16n0 10O0 1ja0 1tC0 14o0 1cM0 1a00 11A0 1Na0 An0 1MP0 AJ0 1Kp0 LC0 1oo0 Wl0 EQN0 Db0 1fB0 Rb0 npB0 11z0 1C10 IL0 1s10 10n0 1o10 WL0 1zd0 On0 1ld0 11z0 1o10 14n0 1o10 14n0 1nd0 12n0 1nd0 Xz0 1q10 12n0 1hB0 1dX0 1ep0 1aL0 1eN0 17X0 1nf0 11z0 1tB0 19W0 1e10 17b0 1ep0 1gL0 18N0 1fz0 1eN0 17b0 1gq0 1gn0 19d0 1dz0 1c10 17X0 1hB0 1gn0 19d0 1dz0 1c10 17X0 1kp0 1dz0 1c10 1aL0 1eN0 1oL0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0 10N0 1oL0","Asia/Kabul|AFT AFT|-40 -4u|01|-10Qs0","Asia/Kamchatka|LMT PETT PETT PETST PETST|-ay.A -b0 -c0 -d0 -c0|01232323232323232323232412323232323232323232323232323232323232412|-1SLKy.A ivXy.A 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qN0 WM0","Asia/Karachi|LMT IST IST KART PKT PKST|-4s.c -5u -6u -50 -50 -60|012134545454|-2xoss.c 1qOKW.c 7zX0 eup0 LqMu 1fy01 1cL0 dK0X 11b0 1610 1jX0","Asia/Kashgar|LMT XJT|-5O.k -60|01|-1GgtO.k","Asia/Kathmandu|LMT IST NPT|-5F.g -5u -5J|012|-21JhF.g 2EGMb.g","Asia/Khandyga|LMT YAKT YAKT YAKST YAKST VLAT VLAST VLAT YAKT|-92.d -80 -90 -a0 -90 -a0 -b0 -b0 -a0|01232323232323232323232412323232323232323232323232565656565656565782|-21Q92.d pAp2.d 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 qK0 yN0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 17V0 7zD0","Asia/Krasnoyarsk|LMT KRAT KRAT KRAST KRAST KRAT|-6b.q -60 -70 -80 -70 -80|012323232323232323232324123232323232323232323232323232323232323252|-21Hib.q prAb.q 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0","Asia/Kuala_Lumpur|SMT MALT MALST MALT MALT JST MYT|-6T.p -70 -7k -7k -7u -90 -80|01234546|-2Bg6T.p 17anT.p 7hXE dM00 17bO 8Fyu 1so1u","Asia/Kuching|LMT BORT BORT BORTST JST MYT|-7l.k -7u -80 -8k -90 -80|01232323232323232425|-1KITl.k gDbP.k 6ynu AnE 1O0k AnE 1NAk AnE 1NAk AnE 1NAk AnE 1O0k AnE 1NAk AnE pAk 8Fz0 1so10","Asia/Macao|LMT MOT MOST CST|-7y.k -80 -90 -80|0121212121212121212121212121212121212121213|-2le7y.k 1XO34.k 1wn0 Rd0 1wn0 R9u 1wqu U10 1tz0 TVu 1tz0 17gu 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cJu 1cL0 1cN0 1fz0 1cN0 1cOu 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cJu 1cL0 1cN0 1fz0 1cN0 1cL0 KEp0","Asia/Magadan|LMT MAGT MAGT MAGST MAGST MAGT|-a3.c -a0 -b0 -c0 -b0 -c0|012323232323232323232324123232323232323232323232323232323232323251|-1Pca3.c eUo3.c 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0","Asia/Makassar|LMT MMT WITA JST|-7V.A -7V.A -80 -90|01232|-21JjV.A vfc0 myLV.A 8ML0","Asia/Manila|PHT PHST JST|-80 -90 -90|010201010|-1kJI0 AL0 cK10 65X0 mXB0 vX0 VK10 1db0","Asia/Nicosia|LMT EET EEST|-2d.s -20 -30|01212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1Vc2d.s 2a3cd.s 1cL0 1qp0 Xz0 19B0 19X0 1fB0 1db0 1cp0 1cL0 1fB0 19X0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1o30 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Asia/Novokuznetsk|LMT KRAT KRAT KRAST KRAST NOVST NOVT NOVT|-5M.M -60 -70 -80 -70 -70 -60 -70|012323232323232323232324123232323232323232323232323232323232325672|-1PctM.M eULM.M 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qN0 WM0 8Hz0","Asia/Novosibirsk|LMT NOVT NOVT NOVST NOVST|-5v.E -60 -70 -80 -70|0123232323232323232323241232341414141414141414141414141414141414121|-21Qnv.E pAFv.E 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 ml0 Os0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0","Asia/Omsk|LMT OMST OMST OMSST OMSST OMST|-4R.u -50 -60 -70 -60 -70|012323232323232323232324123232323232323232323232323232323232323252|-224sR.u pMLR.u 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0","Asia/Oral|LMT URAT URAT URAST URAT URAST ORAT ORAST ORAT|-3p.o -40 -50 -60 -60 -50 -40 -50 -50|012343232323232323251516767676767676767676767676768|-1Pc3p.o eUnp.o 23CL0 1db0 1cM0 1dc0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 2UK0 Fz0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 RW0","Asia/Pontianak|LMT PMT WIB JST WIB WITA WIB|-7h.k -7h.k -7u -90 -80 -80 -70|012324256|-2ua7h.k XE00 munL.k 8Rau 6kpu 4PXu xhcu Wqnu","Asia/Pyongyang|LMT KST JCST JST KST|-8n -8u -90 -90 -90|012341|-2um8n 97XR 12FXu jdA0 2Onc0","Asia/Qyzylorda|LMT KIZT KIZT KIZST KIZT QYZT QYZT QYZST|-4l.Q -40 -50 -60 -60 -50 -60 -70|012343232323232323232325676767676767676767676767676|-1Pc4l.Q eUol.Q 23CL0 1db0 1cM0 1dc0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2UK0 dC0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0","Asia/Rangoon|RMT BURT JST MMT|-6o.E -6u -90 -6u|0123|-21Jio.E SmnS.E 7j9u","Asia/Sakhalin|LMT JCST JST SAKT SAKST SAKST SAKT|-9u.M -90 -90 -b0 -c0 -b0 -a0|0123434343434343434343435634343434343565656565656565656565656565636|-2AGVu.M 1iaMu.M je00 1qFa0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o10 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0","Asia/Samarkand|LMT SAMT SAMT SAMST TAST UZST UZT|-4r.R -40 -50 -60 -60 -60 -50|01234323232323232323232356|-1Pc4r.R eUor.R 23CL0 1db0 1cM0 1dc0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 11x0 bf0","Asia/Seoul|LMT KST JCST JST KST KDT KDT|-8r.Q -8u -90 -90 -90 -9u -a0|01234151515151515146464|-2um8r.Q 97XV.Q 12FXu jjA0 kKo0 2I0u OL0 1FB0 Rb0 1qN0 TX0 1tB0 TX0 1tB0 TX0 1tB0 TX0 2ap0 12FBu 11A0 1o00 11A0","Asia/Singapore|SMT MALT MALST MALT MALT JST SGT SGT|-6T.p -70 -7k -7k -7u -90 -7u -80|012345467|-2Bg6T.p 17anT.p 7hXE dM00 17bO 8Fyu Mspu DTA0","Asia/Srednekolymsk|LMT MAGT MAGT MAGST MAGST MAGT SRET|-ae.Q -a0 -b0 -c0 -b0 -c0 -b0|012323232323232323232324123232323232323232323232323232323232323256|-1Pcae.Q eUoe.Q 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0","Asia/Taipei|JWST JST CST CDT|-80 -90 -80 -90|01232323232323232323232323232323232323232|-1iw80 joM0 1yo0 Tz0 1ip0 1jX0 1cN0 11b0 1oN0 11b0 1oN0 11b0 1oN0 11b0 10N0 1BX0 10p0 1pz0 10p0 1pz0 10p0 1db0 1dd0 1db0 1cN0 1db0 1cN0 1db0 1cN0 1db0 1BB0 ML0 1Bd0 ML0 uq10 1db0 1cN0 1db0 97B0 AL0","Asia/Tashkent|LMT TAST TAST TASST TASST UZST UZT|-4B.b -50 -60 -70 -60 -60 -50|01232323232323232323232456|-1Pc4B.b eUnB.b 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 11y0 bf0","Asia/Tbilisi|TBMT TBIT TBIT TBIST TBIST GEST GET GET GEST|-2X.b -30 -40 -50 -40 -40 -30 -40 -50|0123232323232323232323245656565787878787878787878567|-1Pc2X.b 1jUnX.b WCL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 3y0 19f0 1cK0 1cL0 1cN0 1cL0 1cN0 1cL0 1cM0 1cL0 1fB0 3Nz0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 An0 Os0 WM0","Asia/Tehran|LMT TMT IRST IRST IRDT IRDT|-3p.I -3p.I -3u -40 -50 -4u|01234325252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252|-2btDp.I 1d3c0 1huLT.I TXu 1pz0 sN0 vAu 1cL0 1dB0 1en0 pNB0 UL0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 64p0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0","Asia/Thimbu|LMT IST BTT|-5W.A -5u -60|012|-Su5W.A 1BGMs.A","Asia/Tokyo|JCST JST JDT|-90 -90 -a0|0121212121|-1iw90 pKq0 QL0 1lB0 13X0 1zB0 NX0 1zB0 NX0","Asia/Ulaanbaatar|LMT ULAT ULAT ULAST|-77.w -70 -80 -90|012323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-2APH7.w 2Uko7.w cKn0 1db0 1dd0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 6hD0 11z0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 kEp0 1cJ0 1cP0 1cJ0 1cP0 1fx0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1fx0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1fx0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1fx0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0","Asia/Ust-Nera|LMT YAKT YAKT MAGST MAGT MAGST MAGT MAGT VLAT VLAT|-9w.S -80 -90 -c0 -b0 -b0 -a0 -c0 -b0 -a0|0123434343434343434343456434343434343434343434343434343434343434789|-21Q9w.S pApw.S 23CL0 1d90 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 17V0 7zD0","Asia/Vladivostok|LMT VLAT VLAT VLAST VLAST VLAT|-8L.v -90 -a0 -b0 -a0 -b0|012323232323232323232324123232323232323232323232323232323232323252|-1SJIL.v itXL.v 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0","Asia/Yakutsk|LMT YAKT YAKT YAKST YAKST YAKT|-8C.W -80 -90 -a0 -90 -a0|012323232323232323232324123232323232323232323232323232323232323252|-21Q8C.W pAoC.W 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0","Asia/Yekaterinburg|LMT PMT SVET SVET SVEST SVEST YEKT YEKST YEKT|-42.x -3J.5 -40 -50 -60 -50 -50 -60 -60|0123434343434343434343435267676767676767676767676767676767676767686|-2ag42.x 7mQh.s qBvJ.5 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0","Asia/Yerevan|LMT YERT YERT YERST YERST AMST AMT AMT AMST|-2W -30 -40 -50 -40 -40 -30 -40 -50|0123232323232323232323245656565657878787878787878787878787878787|-1Pc2W 1jUnW WCL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1am0 2r0 1cJ0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 3Fb0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0","Atlantic/Azores|HMT AZOT AZOST AZOMT AZOT AZOST WET|1S.w 20 10 0 10 0 0|01212121212121212121212121212121212121212121232123212321232121212121212121212121212121212121212121454545454545454545454545454545456545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454|-2ldW5.s aPX5.s Sp0 LX0 1vc0 Tc0 1uM0 SM0 1vc0 Tc0 1vc0 SM0 1vc0 6600 1co0 3E00 17c0 1fA0 1a00 1io0 1a00 1io0 17c0 3I00 17c0 1cM0 1cM0 3Fc0 1cM0 1a00 1fA0 1io0 17c0 1cM0 1cM0 1a00 1fA0 1io0 1qM0 Dc0 1tA0 1cM0 1dc0 1400 gL0 IM0 s10 U00 dX0 Rc0 pd0 Rc0 gL0 Oo0 pd0 Rc0 gL0 Oo0 pd0 14o0 1cM0 1cP0 1cM0 1cM0 1cM0 1cM0 1cM0 3Co0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 qIl0 1cM0 1fA0 1cM0 1cM0 1cN0 1cL0 1cN0 1cM0 1cM0 1cM0 1cM0 1cN0 1cL0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cL0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Atlantic/Bermuda|LMT AST ADT|4j.i 40 30|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1BnRE.G 1LTbE.G 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","Atlantic/Canary|LMT CANT WET WEST|11.A 10 0 -10|01232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-1UtaW.o XPAW.o 1lAK0 1a10 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Atlantic/Cape_Verde|LMT CVT CVST CVT|1y.4 20 10 10|01213|-2xomp.U 1qOMp.U 7zX0 1djf0","Atlantic/Faeroe|LMT WET WEST|r.4 0 -10|01212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2uSnw.U 2Wgow.U 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Atlantic/Madeira|FMT MADT MADST MADMT WET WEST|17.A 10 0 -10 0 -10|01212121212121212121212121212121212121212121232123212321232121212121212121212121212121212121212121454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454|-2ldWQ.o aPWQ.o Sp0 LX0 1vc0 Tc0 1uM0 SM0 1vc0 Tc0 1vc0 SM0 1vc0 6600 1co0 3E00 17c0 1fA0 1a00 1io0 1a00 1io0 17c0 3I00 17c0 1cM0 1cM0 3Fc0 1cM0 1a00 1fA0 1io0 17c0 1cM0 1cM0 1a00 1fA0 1io0 1qM0 Dc0 1tA0 1cM0 1dc0 1400 gL0 IM0 s10 U00 dX0 Rc0 pd0 Rc0 gL0 Oo0 pd0 Rc0 gL0 Oo0 pd0 14o0 1cM0 1cP0 1cM0 1cM0 1cM0 1cM0 1cM0 3Co0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 qIl0 1cM0 1fA0 1cM0 1cM0 1cN0 1cL0 1cN0 1cM0 1cM0 1cM0 1cM0 1cN0 1cL0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Atlantic/Reykjavik|LMT IST ISST GMT|1s 10 0 0|012121212121212121212121212121212121212121212121212121212121212121213|-2uWmw mfaw 1Bd0 ML0 1LB0 Cn0 1LB0 3fX0 C10 HrX0 1cO0 LB0 1EL0 LA0 1C00 Oo0 1wo0 Rc0 1wo0 Rc0 1wo0 Rc0 1zc0 Oo0 1zc0 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1lc0 14o0 1o00 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1o00 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1o00 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1o00 14o0","Atlantic/South_Georgia|GST|20|0|","Atlantic/Stanley|SMT FKT FKST FKT FKST|3P.o 40 30 30 20|0121212121212134343212121212121212121212121212121212121212121212121212|-2kJw8.A 12bA8.A 19X0 1fB0 19X0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1fB0 Cn0 1Cc10 WL0 1qL0 U10 1tz0 U10 1qM0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1tz0 U10 1tz0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1tz0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qN0 U10 1wn0 Rd0 1wn0 U10 1tz0 U10 1tz0 U10 1tz0 U10 1tz0 U10 1wn0 U10 1tz0 U10 1tz0 U10","Australia/ACT|AEST AEDT|-a0 -b0|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|-293lX xcX 10jd0 yL0 1cN0 1cL0 1fB0 19X0 17c10 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 14o0 1o00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1tA0 WM0 1tA0 U00 1tA0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 11A0 1o00 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0","Australia/Adelaide|ACST ACDT|-9u -au|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|-293lt xcX 10jd0 yL0 1cN0 1cL0 1fB0 19X0 17c10 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1tA0 WM0 1tA0 U00 1tA0 U00 1tA0 Oo0 1zc0 WM0 1qM0 Rc0 1zc0 U00 1tA0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0","Australia/Brisbane|AEST AEDT|-a0 -b0|01010101010101010|-293lX xcX 10jd0 yL0 1cN0 1cL0 1fB0 19X0 17c10 LA0 H1A0 Oo0 1zc0 Oo0 1zc0 Oo0","Australia/Broken_Hill|ACST ACDT|-9u -au|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|-293lt xcX 10jd0 yL0 1cN0 1cL0 1fB0 19X0 17c10 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 14o0 1o00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1tA0 WM0 1tA0 U00 1tA0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0","Australia/Currie|AEST AEDT|-a0 -b0|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|-29E80 19X0 10jd0 yL0 1cN0 1cL0 1fB0 19X0 17c10 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1qM0 WM0 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1wo0 WM0 1tA0 WM0 1tA0 U00 1tA0 U00 1tA0 11A0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 11A0 1o00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0","Australia/Darwin|ACST ACDT|-9u -au|010101010|-293lt xcX 10jd0 yL0 1cN0 1cL0 1fB0 19X0","Australia/Eucla|ACWST ACWDT|-8J -9J|0101010101010101010|-293kI xcX 10jd0 yL0 1cN0 1cL0 1gSp0 Oo0 l5A0 Oo0 iJA0 G00 zU00 IM0 1qM0 11A0 1o00 11A0","Australia/Hobart|AEST AEDT|-a0 -b0|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|-29E80 19X0 10jd0 yL0 1cN0 1cL0 1fB0 19X0 VfB0 1cM0 1o00 Rc0 1wo0 Rc0 1wo0 U00 1wo0 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1qM0 WM0 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1wo0 WM0 1tA0 WM0 1tA0 U00 1tA0 U00 1tA0 11A0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 11A0 1o00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0","Australia/LHI|AEST LHST LHDT LHDT|-a0 -au -bu -b0|0121212121313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313|raC0 1zdu Rb0 1zd0 On0 1zd0 On0 1zd0 On0 1zd0 TXu 1qMu WLu 1tAu WLu 1tAu TXu 1tAu Onu 1zcu Onu 1zcu Onu 1zcu Rbu 1zcu Onu 1zcu Onu 1zcu 11zu 1o0u 11zu 1o0u 11zu 1o0u 11zu 1qMu WLu 11Au 1nXu 1qMu 11zu 1o0u 11zu 1o0u 11zu 1qMu WLu 1qMu 11zu 1o0u WLu 1qMu 14nu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1fzu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu 1cLu 1cMu","Australia/Lindeman|AEST AEDT|-a0 -b0|010101010101010101010|-293lX xcX 10jd0 yL0 1cN0 1cL0 1fB0 19X0 17c10 LA0 H1A0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0","Australia/Melbourne|AEST AEDT|-a0 -b0|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|-293lX xcX 10jd0 yL0 1cN0 1cL0 1fB0 19X0 17c10 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1qM0 11A0 1tA0 U00 1tA0 U00 1tA0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 11A0 1o00 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0","Australia/Perth|AWST AWDT|-80 -90|0101010101010101010|-293jX xcX 10jd0 yL0 1cN0 1cL0 1gSp0 Oo0 l5A0 Oo0 iJA0 G00 zU00 IM0 1qM0 11A0 1o00 11A0","CET|CET CEST|-10 -20|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2aFe0 11d0 1iO0 11A0 1o00 11A0 Qrc0 6i00 WM0 1fA0 1cM0 1cM0 1cM0 16M0 1gMM0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","CST6CDT|CST CDT CWT CPT|60 50 50 50|010102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261s0 1nX0 11B0 1nX0 SgN0 8x30 iw0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","Chile/EasterIsland|EMT EAST EASST EAST EASST EAST|7h.s 70 60 60 50 50|012121212121212121212121212123434343434343434343434343434343434343434343434343434343434343434345|-1uSgG.w 1s4IG.w WL0 1zd0 On0 1ip0 11z0 1o10 11z0 1qN0 WL0 1ld0 14n0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 1wn0","EET|EET EEST|-20 -30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hDB0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","EST|EST|50|0|","EST5EDT|EST EDT EWT EPT|50 40 40 40|010102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261t0 1nX0 11B0 1nX0 SgN0 8x40 iv0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","Eire|DMT IST GMT BST IST|p.l -y.D 0 -10 -10|01232323232324242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242|-2ax9y.D Rc0 1fzy.D 14M0 1fc0 1g00 1co0 1dc0 1co0 1oo0 1400 1dc0 19A0 1io0 1io0 WM0 1o00 14o0 1o00 17c0 1io0 17c0 1fA0 1a00 1lc0 17c0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1cM0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1a00 1io0 1qM0 Dc0 g5X0 14p0 1wn0 17d0 1io0 11A0 1o00 17c0 1fA0 1a00 1fA0 1cM0 1fA0 1a00 17c0 1fA0 1a00 1io0 17c0 1lc0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1a00 1a00 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1tA0 IM0 90o0 U00 1tA0 U00 1tA0 U00 1tA0 U00 1tA0 WM0 1qM0 WM0 1qM0 WM0 1tA0 U00 1tA0 U00 1tA0 11z0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 14o0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Etc/GMT+0|GMT|0|0|","Etc/GMT+1|GMT+1|10|0|","Etc/GMT+10|GMT+10|a0|0|","Etc/GMT+11|GMT+11|b0|0|","Etc/GMT+12|GMT+12|c0|0|","Etc/GMT+2|GMT+2|20|0|","Etc/GMT+3|GMT+3|30|0|","Etc/GMT+4|GMT+4|40|0|","Etc/GMT+5|GMT+5|50|0|","Etc/GMT+6|GMT+6|60|0|","Etc/GMT+7|GMT+7|70|0|","Etc/GMT+8|GMT+8|80|0|","Etc/GMT+9|GMT+9|90|0|","Etc/GMT-1|GMT-1|-10|0|","Etc/GMT-10|GMT-10|-a0|0|","Etc/GMT-11|GMT-11|-b0|0|","Etc/GMT-12|GMT-12|-c0|0|","Etc/GMT-13|GMT-13|-d0|0|","Etc/GMT-14|GMT-14|-e0|0|","Etc/GMT-2|GMT-2|-20|0|","Etc/GMT-3|GMT-3|-30|0|","Etc/GMT-4|GMT-4|-40|0|","Etc/GMT-5|GMT-5|-50|0|","Etc/GMT-6|GMT-6|-60|0|","Etc/GMT-7|GMT-7|-70|0|","Etc/GMT-8|GMT-8|-80|0|","Etc/GMT-9|GMT-9|-90|0|","Etc/UCT|UCT|0|0|","Etc/UTC|UTC|0|0|","Europe/Amsterdam|AMT NST NEST NET CEST CET|-j.w -1j.w -1k -k -20 -10|010101010101010101010101010101010101010101012323234545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545|-2aFcj.w 11b0 1iP0 11A0 1io0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1co0 1io0 1yo0 Pc0 1a00 1fA0 1Bc0 Mo0 1tc0 Uo0 1tA0 U00 1uo0 W00 1s00 VA0 1so0 Vc0 1sM0 UM0 1wo0 Rc0 1u00 Wo0 1rA0 W00 1s00 VA0 1sM0 UM0 1w00 fV0 BCX.w 1tA0 U00 1u00 Wo0 1sm0 601k WM0 1fA0 1cM0 1cM0 1cM0 16M0 1gMM0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Andorra|WET CET CEST|0 -10 -20|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-UBA0 1xIN0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Athens|AMT EET EEST CEST CET|-1y.Q -20 -30 -20 -10|012123434121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2a61x.Q CNbx.Q mn0 kU10 9b0 3Es0 Xa0 1fb0 1dd0 k3X0 Nz0 SCp0 1vc0 SO0 1cM0 1a00 1ao0 1fc0 1a10 1fG0 1cg0 1dX0 1bX0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Belfast|GMT BST BDST|0 -10 -20|0101010101010101010101010101010101010101010101010121212121210101210101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2axa0 Rc0 1fA0 14M0 1fc0 1g00 1co0 1dc0 1co0 1oo0 1400 1dc0 19A0 1io0 1io0 WM0 1o00 14o0 1o00 17c0 1io0 17c0 1fA0 1a00 1lc0 17c0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1cM0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1a00 1io0 1qM0 Dc0 2Rz0 Dc0 1zc0 Oo0 1zc0 Rc0 1wo0 17c0 1iM0 FA0 xB0 1fA0 1a00 14o0 bb0 LA0 xB0 Rc0 1wo0 11A0 1o00 17c0 1fA0 1a00 1fA0 1cM0 1fA0 1a00 17c0 1fA0 1a00 1io0 17c0 1lc0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1a00 1a00 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1tA0 IM0 90o0 U00 1tA0 U00 1tA0 U00 1tA0 U00 1tA0 WM0 1qM0 WM0 1qM0 WM0 1tA0 U00 1tA0 U00 1tA0 11z0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 14o0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Belgrade|CET CEST|-10 -20|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-19RC0 3IP0 WM0 1fA0 1cM0 1cM0 1rc0 Qo0 1vmo0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Berlin|CET CEST CEMT|-10 -20 -30|01010101010101210101210101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2aFe0 11d0 1iO0 11A0 1o00 11A0 Qrc0 6i00 WM0 1fA0 1cM0 1cM0 1cM0 kL0 Nc0 m10 WM0 1ao0 1cp0 dX0 jz0 Dd0 1io0 17c0 1fA0 1a00 1ehA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Bratislava|CET CEST|-10 -20|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2aFe0 11d0 1iO0 11A0 1o00 11A0 Qrc0 6i00 WM0 1fA0 1cM0 16M0 1lc0 1tA0 17A0 11c0 1io0 17c0 1io0 17c0 1fc0 1ao0 1bNc0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Brussels|WET CET CEST WEST|0 -10 -20 -10|0121212103030303030303030303030303030303030303030303212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2ehc0 3zX0 11c0 1iO0 11A0 1o00 11A0 my0 Ic0 1qM0 Rc0 1EM0 UM0 1u00 10o0 1io0 1io0 17c0 1a00 1fA0 1cM0 1cM0 1io0 17c0 1fA0 1a00 1io0 1a30 1io0 17c0 1fA0 1a00 1io0 17c0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1a00 1fA0 1io0 17c0 1cM0 1cM0 1a00 1fA0 1io0 1qM0 Dc0 y00 5Wn0 WM0 1fA0 1cM0 16M0 1iM0 16M0 1C00 Uo0 1eeo0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Bucharest|BMT EET EEST|-1I.o -20 -30|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1xApI.o 20LI.o RA0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1Axc0 On0 1fA0 1a10 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cK0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cL0 1cN0 1cL0 1fB0 1nX0 11E0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Budapest|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2aFe0 11d0 1iO0 11A0 1ip0 17b0 1op0 1tb0 Q2m0 3Ne0 WM0 1fA0 1cM0 1cM0 1oJ0 1dc0 1030 1fA0 1cM0 1cM0 1cM0 1cM0 1fA0 1a00 1iM0 1fA0 8Ha0 Rb0 1wN0 Rb0 1BB0 Lz0 1C20 LB0 SNX0 1a10 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Busingen|CET CEST|-10 -20|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-19Lc0 11A0 1o00 11A0 1xG10 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Chisinau|CMT BMT EET EEST CEST CET MSK MSD|-1T -1I.o -20 -30 -20 -10 -30 -40|0123232323232323232345454676767676767676767623232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-26jdT wGMa.A 20LI.o RA0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 27A0 2en0 39g0 WM0 1fA0 1cM0 V90 1t7z0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1ty0 2bD0 1cM0 1cK0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1nX0 11D0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Copenhagen|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2azC0 Tz0 VuO0 60q0 WM0 1fA0 1cM0 1cM0 1cM0 S00 1HA0 Nc0 1C00 Dc0 1Nc0 Ao0 1h5A0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Gibraltar|GMT BST BDST CET CEST|0 -10 -20 -10 -20|010101010101010101010101010101010101010101010101012121212121010121010101010101010101034343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343|-2axa0 Rc0 1fA0 14M0 1fc0 1g00 1co0 1dc0 1co0 1oo0 1400 1dc0 19A0 1io0 1io0 WM0 1o00 14o0 1o00 17c0 1io0 17c0 1fA0 1a00 1lc0 17c0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1cM0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1a00 1io0 1qM0 Dc0 2Rz0 Dc0 1zc0 Oo0 1zc0 Rc0 1wo0 17c0 1iM0 FA0 xB0 1fA0 1a00 14o0 bb0 LA0 xB0 Rc0 1wo0 11A0 1o00 17c0 1fA0 1a00 1fA0 1cM0 1fA0 1a00 17c0 1fA0 1a00 1io0 17c0 1lc0 17c0 1fA0 10Jz0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Helsinki|HMT EET EEST|-1D.N -20 -30|0121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-1WuND.N OULD.N 1dA0 1xGq0 1cM0 1cM0 1cM0 1cN0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Kaliningrad|CET CEST CET CEST MSK MSD EEST EET FET|-10 -20 -20 -30 -30 -40 -30 -20 -30|0101010101010232454545454545454545454676767676767676767676767676767676767676787|-2aFe0 11d0 1iO0 11A0 1o00 11A0 Qrc0 6i00 WM0 1fA0 1cM0 1cM0 Am0 Lb0 1en0 op0 1pNz0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 1cJ0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0","Europe/Kiev|KMT EET MSK CEST CET MSD EEST|-22.4 -20 -30 -20 -10 -40 -30|0123434252525252525252525256161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161|-1Pc22.4 eUo2.4 rnz0 2Hg0 WM0 1fA0 da0 1v4m0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 Db0 3220 1cK0 1cL0 1cN0 1cL0 1cN0 1cL0 1cQ0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Lisbon|LMT WET WEST WEMT CET CEST|A.J 0 -10 -20 -10 -20|012121212121212121212121212121212121212121212321232123212321212121212121212121212121212121212121214121212121212121212121212121212124545454212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2ldXn.f aPWn.f Sp0 LX0 1vc0 Tc0 1uM0 SM0 1vc0 Tc0 1vc0 SM0 1vc0 6600 1co0 3E00 17c0 1fA0 1a00 1io0 1a00 1io0 17c0 3I00 17c0 1cM0 1cM0 3Fc0 1cM0 1a00 1fA0 1io0 17c0 1cM0 1cM0 1a00 1fA0 1io0 1qM0 Dc0 1tA0 1cM0 1dc0 1400 gL0 IM0 s10 U00 dX0 Rc0 pd0 Rc0 gL0 Oo0 pd0 Rc0 gL0 Oo0 pd0 14o0 1cM0 1cP0 1cM0 1cM0 1cM0 1cM0 1cM0 3Co0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 pvy0 1cM0 1cM0 1fA0 1cM0 1cM0 1cN0 1cL0 1cN0 1cM0 1cM0 1cM0 1cM0 1cN0 1cL0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Luxembourg|LMT CET CEST WET WEST WEST WET|-o.A -10 -20 0 -10 -20 -10|0121212134343434343434343434343434343434343434343434565651212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2DG0o.A t6mo.A TB0 1nX0 Up0 1o20 11A0 rW0 CM0 1qP0 R90 1EO0 UK0 1u20 10m0 1ip0 1in0 17e0 19W0 1fB0 1db0 1cp0 1in0 17d0 1fz0 1a10 1in0 1a10 1in0 17f0 1fA0 1a00 1io0 17c0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1a00 1fA0 1io0 17c0 1cM0 1cM0 1a00 1fA0 1io0 1qM0 Dc0 vA0 60L0 WM0 1fA0 1cM0 17c0 1io0 16M0 1C00 Uo0 1eeo0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Madrid|WET WEST WEMT CET CEST|0 -10 -20 -10 -20|01010101010101010101010121212121234343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343|-28dd0 11A0 1go0 19A0 1co0 1dA0 b1A0 18o0 3I00 17c0 1fA0 1a00 1io0 1a00 1io0 17c0 iyo0 Rc0 18o0 1hc0 1io0 1a00 14o0 5aL0 MM0 1vc0 17A0 1i00 1bc0 1eo0 17d0 1in0 17A0 6hA0 10N0 XIL0 1a10 1in0 17d0 19X0 1cN0 1fz0 1a10 1fX0 1cp0 1cO0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Malta|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2as10 M00 1cM0 1cM0 14o0 1o00 WM0 1qM0 17c0 1cM0 M3A0 5M20 WM0 1fA0 1cM0 1cM0 1cM0 16m0 1de0 1lc0 14m0 1lc0 WO0 1qM0 GTW0 On0 1C10 Lz0 1C10 Lz0 1EN0 Lz0 1C10 Lz0 1zd0 Oo0 1C00 On0 1cp0 1cM0 1lA0 Xc0 1qq0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1iN0 19z0 1fB0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Minsk|MMT EET MSK CEST CET MSD EEST FET|-1O -20 -30 -20 -10 -40 -30 -30|012343432525252525252525252616161616161616161616161616161616161616172|-1Pc1O eUnO qNX0 3gQ0 WM0 1fA0 1cM0 Al0 1tsn0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 3Fc0 1cN0 1cK0 1cM0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hy0","Europe/Monaco|PMT WET WEST WEMT CET CEST|-9.l 0 -10 -20 -10 -20|01212121212121212121212121212121212121212121212121232323232345454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454|-2nco9.l cNb9.l HA0 19A0 1iM0 11c0 1oo0 Wo0 1rc0 QM0 1EM0 UM0 1u00 10o0 1io0 1wo0 Rc0 1a00 1fA0 1cM0 1cM0 1io0 17c0 1fA0 1a00 1io0 1a00 1io0 17c0 1fA0 1a00 1io0 17c0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1a00 1fA0 1io0 17c0 1cM0 1cM0 1a00 1fA0 1io0 1qM0 Df0 2RV0 11z0 11B0 1ze0 WM0 1fA0 1cM0 1fa0 1aq0 16M0 1ekn0 1cL0 1fC0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Moscow|MMT MMT MST MDST MSD MSK MSM EET EEST MSK|-2u.h -2v.j -3v.j -4v.j -40 -30 -50 -20 -30 -40|012132345464575454545454545454545458754545454545454545454545454545454545454595|-2ag2u.h 2pyW.W 1bA0 11X0 GN0 1Hb0 c20 imv.j 3DA0 dz0 15A0 c10 2q10 iM10 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rU0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0","Europe/Paris|PMT WET WEST CEST CET WEMT|-9.l 0 -10 -20 -10 -20|0121212121212121212121212121212121212121212121212123434352543434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434|-2nco8.l cNb8.l HA0 19A0 1iM0 11c0 1oo0 Wo0 1rc0 QM0 1EM0 UM0 1u00 10o0 1io0 1wo0 Rc0 1a00 1fA0 1cM0 1cM0 1io0 17c0 1fA0 1a00 1io0 1a00 1io0 17c0 1fA0 1a00 1io0 17c0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1a00 1fA0 1io0 17c0 1cM0 1cM0 1a00 1fA0 1io0 1qM0 Df0 Ik0 5M30 WM0 1fA0 1cM0 Vx0 hB0 1aq0 16M0 1ekn0 1cL0 1fC0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Riga|RMT LST EET MSK CEST CET MSD EEST|-1A.y -2A.y -20 -30 -20 -10 -40 -30|010102345454536363636363636363727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272|-25TzA.y 11A0 1iM0 ko0 gWm0 yDXA.y 2bX0 3fE0 WM0 1fA0 1cM0 1cM0 4m0 1sLy0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 1o00 11A0 1o00 11A0 1qM0 3oo0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Rome|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2as10 M00 1cM0 1cM0 14o0 1o00 WM0 1qM0 17c0 1cM0 M3A0 5M20 WM0 1fA0 1cM0 16K0 1iO0 16m0 1de0 1lc0 14m0 1lc0 WO0 1qM0 GTW0 On0 1C10 Lz0 1C10 Lz0 1EN0 Lz0 1C10 Lz0 1zd0 Oo0 1C00 On0 1C10 Lz0 1zd0 On0 1C10 LA0 1C00 LA0 1zc0 Oo0 1C00 Oo0 1zc0 Oo0 1fC0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Samara|LMT SAMT SAMT KUYT KUYST MSD MSK EEST KUYT SAMST SAMST|-3k.k -30 -40 -40 -50 -40 -30 -30 -30 -50 -40|012343434343434343435656782929292929292929292929292929292929292a12|-22WNk.k qHak.k bcn0 1Qqo0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 1cN0 8o0 14j0 1cL0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qN0 WM0","Europe/Simferopol|SMT EET MSK CEST CET MSD EEST MSK|-2g -20 -30 -20 -10 -40 -30 -40|012343432525252525252525252161616525252616161616161616161616161616161616172|-1Pc2g eUog rEn0 2qs0 WM0 1fA0 1cM0 3V0 1u0L0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1Q00 4eL0 1cL0 1cN0 1cL0 1cN0 dX0 WL0 1cN0 1cL0 1fB0 1o30 11B0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11z0 1nW0","Europe/Sofia|EET CET CEST EEST|-20 -10 -20 -30|01212103030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030|-168L0 WM0 1fA0 1cM0 1cM0 1cN0 1mKH0 1dd0 1fb0 1ap0 1fb0 1a20 1fy0 1a30 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cK0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1nX0 11E0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Stockholm|CET CEST|-10 -20|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2azC0 TB0 2yDe0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Tallinn|TMT CET CEST EET MSK MSD EEST|-1D -10 -20 -20 -30 -40 -30|012103421212454545454545454546363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363|-26oND teD 11A0 1Ta0 4rXl KSLD 2FX0 2Jg0 WM0 1fA0 1cM0 18J0 1sTX0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o10 11A0 1qM0 5QM0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Tirane|LMT CET CEST|-1j.k -10 -20|01212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2glBj.k 14pcj.k 5LC0 WM0 4M0 1fCK0 10n0 1op0 11z0 1pd0 11z0 1qN0 WL0 1qp0 Xb0 1qp0 Xb0 1qp0 11z0 1lB0 11z0 1qN0 11z0 1iN0 16n0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Uzhgorod|CET CEST MSK MSD EET EEST|-10 -20 -30 -40 -20 -30|010101023232323232323232320454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454|-1cqL0 6i00 WM0 1fA0 1cM0 1ml0 1Cp0 1r3W0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1Q00 1Nf0 2pw0 1cL0 1cN0 1cL0 1cN0 1cL0 1cQ0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Vienna|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2aFe0 11d0 1iO0 11A0 1o00 11A0 3KM0 14o0 LA00 6i00 WM0 1fA0 1cM0 1cM0 1cM0 400 2qM0 1a00 1cM0 1cM0 1io0 17c0 1gHa0 19X0 1cP0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Vilnius|WMT KMT CET EET MSK CEST MSD EEST|-1o -1z.A -10 -20 -30 -20 -40 -30|012324525254646464646464646464647373737373737352537373737373737373737373737373737373737373737373737373737373737373737373|-293do 6ILM.o 1Ooz.A zz0 Mfd0 29W0 3is0 WM0 1fA0 1cM0 LV0 1tgL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11B0 1o00 11A0 1qM0 8io0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Volgograd|LMT TSAT STAT STAT VOLT VOLST VOLST VOLT MSD MSK MSK|-2V.E -30 -30 -40 -40 -50 -40 -30 -40 -30 -40|0123454545454545454546767489898989898989898989898989898989898989a9|-21IqV.E cLXV.E cEM0 1gqn0 Lco0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 2pz0 1cJ0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0","Europe/Warsaw|WMT CET CEST EET EEST|-1o -10 -20 -20 -30|012121234312121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2ctdo 1LXo 11d0 1iO0 11A0 1o00 11A0 1on0 11A0 6zy0 HWP0 5IM0 WM0 1fA0 1cM0 1dz0 1mL0 1en0 15B0 1aq0 1nA0 11A0 1io0 17c0 1fA0 1a00 iDX0 LA0 1cM0 1cM0 1C00 Oo0 1cM0 1cM0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1C00 LA0 uso0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","Europe/Zaporozhye|CUT EET MSK CEST CET MSD EEST|-2k -20 -30 -20 -10 -40 -30|01234342525252525252525252526161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161|-1Pc2k eUok rdb0 2RE0 WM0 1fA0 8m0 1v9a0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cK0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cQ0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","HST|HST|a0|0|","Indian/Chagos|LMT IOT IOT|-4N.E -50 -60|012|-2xosN.E 3AGLN.E","Indian/Christmas|CXT|-70|0|","Indian/Cocos|CCT|-6u|0|","Indian/Kerguelen|zzz TFT|0 -50|01|-MG00","Indian/Mahe|LMT SCT|-3F.M -40|01|-2yO3F.M","Indian/Maldives|MMT MVT|-4S -50|01|-olgS","Indian/Mauritius|LMT MUT MUST|-3O -40 -50|012121|-2xorO 34unO 14L0 12kr0 11z0","Indian/Reunion|LMT RET|-3F.Q -40|01|-2mDDF.Q","Kwajalein|MHT KWAT MHT|-b0 c0 -c0|012|-AX0 W9X0","MET|MET MEST|-10 -20|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2aFe0 11d0 1iO0 11A0 1o00 11A0 Qrc0 6i00 WM0 1fA0 1cM0 1cM0 1cM0 16M0 1gMM0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00","MST|MST|70|0|","MST7MDT|MST MDT MWT MPT|70 60 60 60|010102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261r0 1nX0 11B0 1nX0 SgN0 8x20 ix0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","NZ-CHAT|CHAST CHAST CHADT|-cf -cJ -dJ|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212|-WqAf 1adef IM0 1C00 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1qM0 14o0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1io0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00","PST8PDT|PST PDT PWT PPT|80 70 70 70|010102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261q0 1nX0 11B0 1nX0 SgN0 8x10 iy0 QwN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0","Pacific/Apia|LMT WSST SST SDT WSDT WSST|bq.U bu b0 a0 -e0 -d0|01232345454545454545454545454545454545454545454545454545454|-2nDMx.4 1yW03.4 2rRbu 1ff0 1a00 CI0 AQ0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00","Pacific/Bougainville|PGT JST BST|-a0 -90 -b0|0102|-16Wy0 7CN0 2MQp0","Pacific/Chuuk|CHUT|-a0|0|","Pacific/Efate|LMT VUT VUST|-bd.g -b0 -c0|0121212121212121212121|-2l9nd.g 2Szcd.g 1cL0 1oN0 10L0 1fB0 19X0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 Lz0 1Nd0 An0","Pacific/Enderbury|PHOT PHOT PHOT|c0 b0 -d0|012|nIc0 B8n0","Pacific/Fakaofo|TKT TKT|b0 -d0|01|1Gfn0","Pacific/Fiji|LMT FJT FJST|-bT.I -c0 -d0|0121212121212121212121212121212121212121212121212121212121212121|-2bUzT.I 3m8NT.I LA0 1EM0 IM0 nJc0 LA0 1o00 Rc0 1wo0 Ao0 1Nc0 Ao0 1Q00 xz0 1SN0 uM0 1SM0 uM0 1VA0 s00 1VA0 uM0 1SM0 uM0 1SM0 uM0 1SM0 uM0 1VA0 s00 1VA0 s00 1VA0 uM0 1SM0 uM0 1SM0 uM0 1SM0 uM0 1VA0 s00 1VA0 uM0 1SM0 uM0 1SM0 uM0 1SM0 uM0 1VA0 s00 1VA0 s00 1VA0 uM0 1SM0 uM0 1SM0 uM0 1SM0 uM0","Pacific/Funafuti|TVT|-c0|0|","Pacific/Galapagos|LMT ECT GALT|5W.o 50 60|012|-1yVS1.A 2dTz1.A","Pacific/Gambier|LMT GAMT|8X.M 90|01|-2jof0.c","Pacific/Guadalcanal|LMT SBT|-aD.M -b0|01|-2joyD.M","Pacific/Guam|GST ChST|-a0 -a0|01|1fpq0","Pacific/Honolulu|HST HDT HST|au 9u a0|010102|-1thLu 8x0 lef0 8Pz0 46p0","Pacific/Kiritimati|LINT LINT LINT|aE a0 -e0|012|nIaE B8nk","Pacific/Kosrae|KOST KOST|-b0 -c0|010|-AX0 1bdz0","Pacific/Majuro|MHT MHT|-b0 -c0|01|-AX0","Pacific/Marquesas|LMT MART|9i 9u|01|-2joeG","Pacific/Midway|LMT NST BST SST|bm.M b0 b0 b0|0123|-2nDMB.c 2gVzB.c EyM0","Pacific/Nauru|LMT NRT JST NRT|-b7.E -bu -90 -c0|01213|-1Xdn7.E PvzB.E 5RCu 1ouJu","Pacific/Niue|NUT NUT NUT|bk bu b0|012|-KfME 17y0a","Pacific/Norfolk|NMT NFT NFST NFT|-bc -bu -cu -b0|01213|-Kgbc W01G On0 1COp0","Pacific/Noumea|LMT NCT NCST|-b5.M -b0 -c0|01212121|-2l9n5.M 2EqM5.M xX0 1PB0 yn0 HeP0 Ao0","Pacific/Palau|PWT|-90|0|","Pacific/Pitcairn|PNT PST|8u 80|01|18Vku","Pacific/Pohnpei|PONT|-b0|0|","Pacific/Port_Moresby|PGT|-a0|0|","Pacific/Rarotonga|CKT CKHST CKT|au 9u a0|012121212121212121212121212|lyWu IL0 1zcu Onu 1zcu Onu 1zcu Rbu 1zcu Onu 1zcu Onu 1zcu Onu 1zcu Onu 1zcu Onu 1zcu Rbu 1zcu Onu 1zcu Onu 1zcu Onu","Pacific/Tahiti|LMT TAHT|9W.g a0|01|-2joe1.I","Pacific/Tarawa|GILT|-c0|0|","Pacific/Tongatapu|TOT TOT TOST|-ck -d0 -e0|01212121|-1aB0k 2n5dk 15A0 1wo0 xz0 1Q10 xz0","Pacific/Wake|WAKT|-c0|0|","Pacific/Wallis|WFT|-c0|0|","WET|WET WEST|0 -10|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hDB0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00"],links:["Africa/Abidjan|Africa/Bamako","Africa/Abidjan|Africa/Banjul","Africa/Abidjan|Africa/Conakry","Africa/Abidjan|Africa/Dakar","Africa/Abidjan|Africa/Freetown","Africa/Abidjan|Africa/Lome","Africa/Abidjan|Africa/Nouakchott","Africa/Abidjan|Africa/Ouagadougou","Africa/Abidjan|Africa/Sao_Tome","Africa/Abidjan|Africa/Timbuktu","Africa/Abidjan|Atlantic/St_Helena","Africa/Addis_Ababa|Africa/Asmara","Africa/Addis_Ababa|Africa/Asmera","Africa/Addis_Ababa|Africa/Dar_es_Salaam","Africa/Addis_Ababa|Africa/Djibouti","Africa/Addis_Ababa|Africa/Kampala","Africa/Addis_Ababa|Africa/Mogadishu","Africa/Addis_Ababa|Africa/Nairobi","Africa/Addis_Ababa|Indian/Antananarivo","Africa/Addis_Ababa|Indian/Comoro","Africa/Addis_Ababa|Indian/Mayotte","Africa/Bangui|Africa/Brazzaville","Africa/Bangui|Africa/Douala","Africa/Bangui|Africa/Kinshasa","Africa/Bangui|Africa/Lagos","Africa/Bangui|Africa/Libreville","Africa/Bangui|Africa/Luanda","Africa/Bangui|Africa/Malabo","Africa/Bangui|Africa/Niamey","Africa/Bangui|Africa/Porto-Novo","Africa/Blantyre|Africa/Bujumbura","Africa/Blantyre|Africa/Gaborone","Africa/Blantyre|Africa/Harare","Africa/Blantyre|Africa/Kigali","Africa/Blantyre|Africa/Lubumbashi","Africa/Blantyre|Africa/Lusaka","Africa/Blantyre|Africa/Maputo","Africa/Cairo|Egypt","Africa/Johannesburg|Africa/Maseru","Africa/Johannesburg|Africa/Mbabane","Africa/Juba|Africa/Khartoum","Africa/Tripoli|Libya","America/Adak|America/Atka","America/Adak|US/Aleutian","America/Anchorage|US/Alaska","America/Anguilla|America/Antigua","America/Anguilla|America/Dominica","America/Anguilla|America/Grenada","America/Anguilla|America/Guadeloupe","America/Anguilla|America/Marigot","America/Anguilla|America/Montserrat","America/Anguilla|America/Port_of_Spain","America/Anguilla|America/St_Barthelemy","America/Anguilla|America/St_Kitts","America/Anguilla|America/St_Lucia","America/Anguilla|America/St_Thomas","America/Anguilla|America/St_Vincent","America/Anguilla|America/Tortola","America/Anguilla|America/Virgin","America/Argentina/Buenos_Aires|America/Buenos_Aires","America/Argentina/Catamarca|America/Argentina/ComodRivadavia","America/Argentina/Catamarca|America/Catamarca","America/Argentina/Cordoba|America/Cordoba","America/Argentina/Cordoba|America/Rosario","America/Argentina/Jujuy|America/Jujuy","America/Argentina/Mendoza|America/Mendoza","America/Aruba|America/Curacao","America/Aruba|America/Kralendijk","America/Aruba|America/Lower_Princes","America/Atikokan|America/Coral_Harbour","America/Chicago|US/Central","America/Denver|America/Shiprock","America/Denver|Navajo","America/Denver|US/Mountain","America/Detroit|US/Michigan","America/Edmonton|Canada/Mountain","America/Ensenada|America/Tijuana","America/Ensenada|Mexico/BajaNorte","America/Fort_Wayne|America/Indiana/Indianapolis","America/Fort_Wayne|America/Indianapolis","America/Fort_Wayne|US/East-Indiana","America/Halifax|Canada/Atlantic","America/Havana|Cuba","America/Indiana/Knox|America/Knox_IN","America/Indiana/Knox|US/Indiana-Starke","America/Jamaica|Jamaica","America/Kentucky/Louisville|America/Louisville","America/Los_Angeles|US/Pacific","America/Los_Angeles|US/Pacific-New","America/Manaus|Brazil/West","America/Mazatlan|Mexico/BajaSur","America/Mexico_City|Mexico/General","America/Montreal|America/Toronto","America/Montreal|Canada/Eastern","America/New_York|US/Eastern","America/Noronha|Brazil/DeNoronha","America/Phoenix|US/Arizona","America/Porto_Acre|America/Rio_Branco","America/Porto_Acre|Brazil/Acre","America/Regina|Canada/East-Saskatchewan","America/Regina|Canada/Saskatchewan","America/Santiago|Chile/Continental","America/Sao_Paulo|Brazil/East","America/St_Johns|Canada/Newfoundland","America/Vancouver|Canada/Pacific","America/Whitehorse|Canada/Yukon","America/Winnipeg|Canada/Central","Antarctica/McMurdo|Antarctica/South_Pole","Antarctica/McMurdo|NZ","Antarctica/McMurdo|Pacific/Auckland","Arctic/Longyearbyen|Atlantic/Jan_Mayen","Arctic/Longyearbyen|Europe/Oslo","Asia/Aden|Asia/Kuwait","Asia/Aden|Asia/Riyadh","Asia/Ashgabat|Asia/Ashkhabad","Asia/Bahrain|Asia/Qatar","Asia/Bangkok|Asia/Phnom_Penh","Asia/Bangkok|Asia/Vientiane","Asia/Calcutta|Asia/Kolkata","Asia/Chongqing|Asia/Chungking","Asia/Chongqing|Asia/Harbin","Asia/Chongqing|Asia/Shanghai","Asia/Chongqing|PRC","Asia/Dacca|Asia/Dhaka","Asia/Dubai|Asia/Muscat","Asia/Ho_Chi_Minh|Asia/Saigon","Asia/Hong_Kong|Hongkong","Asia/Istanbul|Europe/Istanbul","Asia/Istanbul|Turkey","Asia/Jerusalem|Asia/Tel_Aviv","Asia/Jerusalem|Israel","Asia/Kashgar|Asia/Urumqi","Asia/Kathmandu|Asia/Katmandu","Asia/Macao|Asia/Macau","Asia/Makassar|Asia/Ujung_Pandang","Asia/Nicosia|Europe/Nicosia","Asia/Seoul|ROK","Asia/Singapore|Singapore","Asia/Taipei|ROC","Asia/Tehran|Iran","Asia/Thimbu|Asia/Thimphu","Asia/Tokyo|Japan","Asia/Ulaanbaatar|Asia/Ulan_Bator","Atlantic/Faeroe|Atlantic/Faroe","Atlantic/Reykjavik|Iceland","Australia/ACT|Australia/Canberra","Australia/ACT|Australia/NSW","Australia/ACT|Australia/Sydney","Australia/Adelaide|Australia/South","Australia/Brisbane|Australia/Queensland","Australia/Broken_Hill|Australia/Yancowinna","Australia/Darwin|Australia/North","Australia/Hobart|Australia/Tasmania","Australia/LHI|Australia/Lord_Howe","Australia/Melbourne|Australia/Victoria","Australia/Perth|Australia/West","Chile/EasterIsland|Pacific/Easter","Eire|Europe/Dublin","Etc/GMT+0|Etc/GMT","Etc/GMT+0|Etc/GMT-0","Etc/GMT+0|Etc/GMT0","Etc/GMT+0|Etc/Greenwich","Etc/GMT+0|GMT","Etc/GMT+0|GMT+0","Etc/GMT+0|GMT-0","Etc/GMT+0|GMT0","Etc/GMT+0|Greenwich","Etc/UCT|UCT","Etc/UTC|Etc/Universal","Etc/UTC|Etc/Zulu","Etc/UTC|UTC","Etc/UTC|Universal","Etc/UTC|Zulu","Europe/Belfast|Europe/Guernsey","Europe/Belfast|Europe/Isle_of_Man","Europe/Belfast|Europe/Jersey","Europe/Belfast|Europe/London","Europe/Belfast|GB","Europe/Belfast|GB-Eire","Europe/Belgrade|Europe/Ljubljana","Europe/Belgrade|Europe/Podgorica","Europe/Belgrade|Europe/Sarajevo","Europe/Belgrade|Europe/Skopje","Europe/Belgrade|Europe/Zagreb","Europe/Bratislava|Europe/Prague","Europe/Busingen|Europe/Vaduz","Europe/Busingen|Europe/Zurich","Europe/Chisinau|Europe/Tiraspol","Europe/Helsinki|Europe/Mariehamn","Europe/Lisbon|Portugal","Europe/Moscow|W-SU","Europe/Rome|Europe/San_Marino","Europe/Rome|Europe/Vatican","Europe/Warsaw|Poland","Kwajalein|Pacific/Kwajalein","NZ-CHAT|Pacific/Chatham","Pacific/Chuuk|Pacific/Truk","Pacific/Chuuk|Pacific/Yap","Pacific/Guam|Pacific/Saipan","Pacific/Honolulu|Pacific/Johnston","Pacific/Honolulu|US/Hawaii","Pacific/Midway|Pacific/Pago_Pago","Pacific/Midway|Pacific/Samoa","Pacific/Midway|US/Samoa","Pacific/Pohnpei|Pacific/Ponape"]}),c});;!function(o){"use strict";var n={CHROME:"chrome",FIREFOX:"firefox",SAFARI:"safari",OPERA:"opera",IE:"ie",MS_EDGE:"ms-edge",FB_MESSENGER:"fb-messenger",CORDOVA:"cordova",UNKNOWN:"unknown"},e={CHROME:[/\bChrome\/([\d\.]+)\b/,/\bCriOS\/([\d\.]+)\b/],FIREFOX:[/\bFirefox\/([\d\.]+)\b/,/\bFxiOS\/([\d\.]+)\b/],SAFARI:/\bVersion\/([\d\.]+)\b/,OPERA:[/\bVersion\/([\d\.]+)\b/,/\bOPR\/([\d\.]+)\b/],IE:[/\bMSIE ([\d\.]+\w?)\b/,/\brv:([\d\.]+\w?)\b/],CORDOVA:/\bCordova\/([\d\.]+)\b/,MS_EDGE:/\bEdge\/([\d\.]+)\b/},O=Object.keys(e).reduce(function(o,O){return o[n[O]]=e[O],o},{});o.module("ng.deviceDetector",["reTree"]).constant("OS_RE",{WINDOWS:{and:[{or:[/\bWindows|(Win\d\d)\b/,/\bWin 9x\b/]},{not:/\bWindows Phone\b/}]},MAC:{and:[/\bMac OS\b/,{not:/Windows Phone/}]},IOS:{and:[{or:[/\biPad\b/,/\biPhone\b/,/\biPod\b/]},{not:/Windows Phone/}]},ANDROID:{and:[/\bAndroid\b/,{not:/Windows Phone/}]},LINUX:/\bLinux\b/,UNIX:/\bUNIX\b/,FIREFOX_OS:{and:[/\bFirefox\b/,/Mobile\b/]},CHROME_OS:/\bCrOS\b/,WINDOWS_PHONE:{or:[/\bIEMobile\b/,/\bWindows Phone\b/]},PS4:/\bMozilla\/5.0 \(PlayStation 4\b/,VITA:/\bMozilla\/5.0 \(Play(S|s)tation Vita\b/}).constant("BROWSERS_RE",{CHROME:{and:[{or:[/\bChrome\b/,/\bCriOS\b/]},{not:{or:[/\bOPR\b/,/\bEdge\b/,/\bCordova\b/]}}]},FIREFOX:{and:[{or:[/\bFirefox\b/,/\bFxiOS\b/]},{not:/\bCordova\b/}]},SAFARI:{and:[/^((?!CriOS).)*\Safari\b.*$/,{not:{or:[/\bOPR\b/,/\bEdge\b/,/Windows Phone/,/\bCordova\b/,/\bChrome\b/]}}]},OPERA:{or:[/Opera\b/,/\bOPR\b/]},IE:{or:[/\bMSIE\b/,/\bTrident\b/,/^Mozilla\/5\.0 \(Windows NT 10\.0; Win64; x64\)$/]},MS_EDGE:{or:[/\bEdge\b/]},PS4:/\bMozilla\/5.0 \(PlayStation 4\b/,VITA:/\bMozilla\/5.0 \(Play(S|s)tation Vita\b/,CORDOVA:/\bCordova\b/,FB_MESSENGER:/\bFBAN\/MessengerForiOS\b/}).constant("DEVICES_RE",{ANDROID:{and:[/\bAndroid\b/,{not:/Windows Phone/}]},I_PAD:/\biPad\b/,IPHONE:{and:[/\biPhone\b/,{not:/Windows Phone/}]},I_POD:/\biPod\b/,BLACKBERRY:/\bblackberry\b/,FIREFOX_OS:{and:[/\bFirefox\b/,/\bMobile\b/]},CHROME_BOOK:/\bCrOS\b/,WINDOWS_PHONE:{or:[/\bIEMobile\b/,/\bWindows Phone\b/]},PS4:/\bMozilla\/5.0 \(PlayStation 4\b/,CHROMECAST:/\bCrKey\b/,APPLE_TV:/^iTunes-AppleTV\/4.1$/,GOOGLE_TV:/\bGoogleTV\b/,VITA:/\bMozilla\/5.0 \(Play(S|s)tation Vita\b/}).constant("OS_VERSIONS_RE",{WINDOWS_3_11:/Win16/,WINDOWS_95:/(Windows 95|Win95|Windows_95)/,WINDOWS_ME:/(Win 9x 4.90|Windows ME)/,WINDOWS_98:/(Windows 98|Win98)/,WINDOWS_CE:/Windows CE/,WINDOWS_2000:/(Windows NT 5.0|Windows 2000)/,WINDOWS_XP:/(Windows NT 5.1|Windows XP)/,WINDOWS_SERVER_2003:/Windows NT 5.2/,WINDOWS_VISTA:/Windows NT 6.0/,WINDOWS_7:/(Windows 7|Windows NT 6.1)/,WINDOWS_8_1:/(Windows 8.1|Windows NT 6.3)/,WINDOWS_8:/(Windows 8|Windows NT 6.2)/,WINDOWS_10:/(Windows NT 10.0)/,WINDOWS_PHONE_7_5:/(Windows Phone OS 7.5)/,WINDOWS_PHONE_8_1:/(Windows Phone 8.1)/,WINDOWS_PHONE_10:/(Windows Phone 10)/,WINDOWS_NT_4_0:{and:[/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/,{not:/Windows NT 10.0/}]},MACOSX:/(MAC OS X\s*[^ 0-9])/,MACOSX_3:/(Darwin 10.3|Mac OS X 10.3)/,MACOSX_4:/(Darwin 10.4|Mac OS X 10.4)/,MACOSX_5:/(Mac OS X 10.5)/,MACOSX_6:/(Mac OS X 10.6)/,MACOSX_7:/(Mac OS X 10.7)/,MACOSX_8:/(Mac OS X 10.8)/,MACOSX_9:/(Mac OS X 10.9)/,MACOSX_10:/(Mac OS X 10.10)/,MACOSX_11:/(Mac OS X 10.11)/,MACOSX_12:/(Mac OS X 10.12)/,MACOSX_13:/(Mac OS X 10.13)/,MACOSX_14:/(Mac OS X 10.14)/,MACOSX_15:/(Mac OS X 10.15)/}).constant("BROWSER_VERSIONS_RE_MAP",e).constant("BROWSER_VERSIONS_RE",O).constant("BROWSERS",n).constant("DEVICES",{ANDROID:"android",I_PAD:"ipad",IPHONE:"iphone",I_POD:"ipod",BLACKBERRY:"blackberry",FIREFOX_OS:"firefox-os",CHROME_BOOK:"chrome-book",WINDOWS_PHONE:"windows-phone",PS4:"ps4",VITA:"vita",CHROMECAST:"chromecast",APPLE_TV:"apple-tv",GOOGLE_TV:"google-tv",UNKNOWN:"unknown"}).constant("OS",{WINDOWS:"windows",MAC:"mac",IOS:"ios",ANDROID:"android",LINUX:"linux",UNIX:"unix",FIREFOX_OS:"firefox-os",CHROME_OS:"chrome-os",WINDOWS_PHONE:"windows-phone",UNKNOWN:"unknown"}).constant("OS_VERSIONS",{WINDOWS_3_11:"windows-3-11",WINDOWS_95:"windows-95",WINDOWS_ME:"windows-me",WINDOWS_98:"windows-98",WINDOWS_CE:"windows-ce",WINDOWS_2000:"windows-2000",WINDOWS_XP:"windows-xp",WINDOWS_SERVER_2003:"windows-server-2003",WINDOWS_VISTA:"windows-vista",WINDOWS_7:"windows-7",WINDOWS_8_1:"windows-8-1",WINDOWS_8:"windows-8",WINDOWS_10:"windows-10",WINDOWS_PHONE_7_5:"windows-phone-7-5",WINDOWS_PHONE_8_1:"windows-phone-8-1",WINDOWS_PHONE_10:"windows-phone-10",WINDOWS_NT_4_0:"windows-nt-4-0",MACOSX_15:"mac-os-x-15",MACOSX_14:"mac-os-x-14",MACOSX_13:"mac-os-x-13",MACOSX_12:"mac-os-x-12",MACOSX_11:"mac-os-x-11",MACOSX_10:"mac-os-x-10",MACOSX_9:"mac-os-x-9",MACOSX_8:"mac-os-x-8",MACOSX_7:"mac-os-x-7",MACOSX_6:"mac-os-x-6",MACOSX_5:"mac-os-x-5",MACOSX_4:"mac-os-x-4",MACOSX_3:"mac-os-x-3",MACOSX_2:"mac-os-x-2",MACOSX:"mac-os-x",UNKNOWN:"unknown"}).service("detectUtils",["deviceDetector","DEVICES","BROWSERS","OS",function(o,n,e,O){var r=o;this.isMobile=function(){return"unknown"!==r.device},this.isAndroid=function(){return r.device===n.ANDROID||r.OS===O.ANDROID},this.isIOS=function(){return r.os===O.IOS||r.device===n.I_POD||r.device===n.IPHONE}}]).provider("deviceDetector",function(){var o=[];this.addCustom=function(n,e){o.push({name:n,re:e})},this.$get=["$window","DEVICES","BROWSERS","OS","OS_VERSIONS","reTree","OS_RE","BROWSERS_RE","DEVICES_RE","OS_VERSIONS_RE","BROWSER_VERSIONS_RE_MAP","BROWSER_VERSIONS_RE",function(n,e,O,r,i,S,t,s,_,W,N,b){var a,d,E,c;Object.keys||(Object.keys=(a=Object.prototype.hasOwnProperty,d=!{toString:null}.propertyIsEnumerable("toString"),c=(E=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(o){if("object"!=typeof o&&("function"!=typeof o||null===o))throw new TypeError("Object.keys called on non-object");var n,e,O=[];for(n in o)a.call(o,n)&&O.push(n);if(d)for(e=0;e<c;e++)a.call(o,E[e])&&O.push(E[e]);return O})),Array.prototype.reduce||(Array.prototype.reduce=function(o){if(null==this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof o)throw new TypeError(o+" is not a function");var n,e=Object(this),O=e.length>>>0,r=0;if(2==arguments.length)n=arguments[1];else{for(;r<O&&!(r in e);)r++;if(r>=O)throw new TypeError("Reduce of empty array with no initial value");n=e[r++]}for(;r<O;r++)r in e&&(n=o(n,e[r],r,e));return n});var I=n.navigator.userAgent,w={raw:{userAgent:I,os:{},browser:{},device:{}}};if(w.raw.os=Object.keys(r).reduce(function(o,n){return o[r[n]]=S.test(I,t[n]),o},{}),w.raw.browser=Object.keys(O).reduce(function(o,n){return o[O[n]]=S.test(I,s[n]),o},{}),w.raw.device=Object.keys(e).reduce(function(o,n){return o[e[n]]=S.test(I,_[n]),o},{}),w.raw.os_version=Object.keys(i).reduce(function(o,n){return o[i[n]]=S.test(I,W[n]),o},{}),w.os=[r.WINDOWS,r.IOS,r.MAC,r.ANDROID,r.LINUX,r.UNIX,r.FIREFOX_OS,r.CHROME_OS,r.WINDOWS_PHONE].reduce(function(o,n){return o===r.UNKNOWN&&w.raw.os[n]?n:o},r.UNKNOWN),w.browser=[O.CHROME,O.FIREFOX,O.SAFARI,O.OPERA,O.IE,O.MS_EDGE,O.CORDOVA,O.FB_MESSENGER].reduce(function(o,n){return o===O.UNKNOWN&&w.raw.browser[n]?n:o},O.UNKNOWN),w.device=[e.ANDROID,e.I_PAD,e.IPHONE,e.I_POD,e.BLACKBERRY,e.FIREFOX_OS,e.CHROME_BOOK,e.WINDOWS_PHONE,e.PS4,e.CHROMECAST,e.APPLE_TV,e.GOOGLE_TV,e.VITA].reduce(function(o,n){return o===e.UNKNOWN&&w.raw.device[n]?n:o},e.UNKNOWN),w.os_version=[i.WINDOWS_3_11,i.WINDOWS_95,i.WINDOWS_ME,i.WINDOWS_98,i.WINDOWS_CE,i.WINDOWS_2000,i.WINDOWS_XP,i.WINDOWS_SERVER_2003,i.WINDOWS_VISTA,i.WINDOWS_7,i.WINDOWS_8_1,i.WINDOWS_8,i.WINDOWS_10,i.WINDOWS_PHONE_7_5,i.WINDOWS_PHONE_8_1,i.WINDOWS_PHONE_10,i.WINDOWS_NT_4_0,i.MACOSX,i.MACOSX_3,i.MACOSX_4,i.MACOSX_5,i.MACOSX_6,i.MACOSX_7,i.MACOSX_8,i.MACOSX_9,i.MACOSX_10,i.MACOSX_11,i.MACOSX_12,i.MACOSX_13,i.MACOSX_14,i.MACOSX_15].reduce(function(o,n){return o===i.UNKNOWN&&w.raw.os_version[n]?n:o},i.UNKNOWN),w.browser_version="0",w.browser!==O.UNKNOWN){var D=b[w.browser],A=S.exec(I,D);A&&(w.browser_version=A[1])}return w.isMobile=function(){return[e.ANDROID,e.I_PAD,e.IPHONE,e.I_POD,e.BLACKBERRY,e.FIREFOX_OS,e.WINDOWS_PHONE,e.VITA].some(function(o){return w.device==o})},w.isTablet=function(){return[e.I_PAD,e.FIREFOX_OS].some(function(o){return w.device==o})},w.isDesktop=function(){return[e.PS4,e.CHROME_BOOK,e.UNKNOWN].some(function(o){return w.device==o})},w.custom=o.reduce(function(o,n){return o[n.name]=S.test(I,n.re),o},{}),w}]}).directive("deviceDetector",["deviceDetector",function(o){return{restrict:"A",link:function(n,e){e.addClass("os-"+o.os),e.addClass("browser-"+o.browser),e.addClass("device-"+o.device),e.toggleClass("is-mobile",o.isMobile()),e.toggleClass("is-tablet",o.isTablet()),e.toggleClass("is-desktop",o.isDesktop()),Object.keys(o.custom).forEach(function(n){e.toggleClass("is-"+n.toLowerCase().replace(/[^0-9a-z]+/g,"-"),o.custom[n])})}}}])}(angular);;!function(e,n,r){"use strict";function t(e,n){return("string"==typeof n||n instanceof String)&&(n=new RegExp(n)),n instanceof RegExp?n.test(e):n&&Array.isArray(n.and)?n.and.every(function(n){return t(e,n)}):n&&Array.isArray(n.or)?n.or.some(function(n){return t(e,n)}):!(!n||!n.not)&&!t(e,n.not)}function o(e,n){return("string"==typeof n||n instanceof String)&&(n=new RegExp(n)),n instanceof RegExp?n.exec(e):n&&Array.isArray(n)?n.reduce(function(n,r){return n||o(e,r)},null):null}r&&r.module("reTree",[]).factory("reTree",[function(){return{test:t,exec:o}}]),n&&(n.reTree={test:t,exec:o}),e&&e.exports&&(e.exports={test:t,exec:o})}("undefined"==typeof module?null:module,"undefined"==typeof window?null:window,"undefined"==typeof angular?null:angular);;angular.module("brantwills.paging",[]).directive("paging",function(){function a(a,e){a.page!=e&&(a.page=e,a.pagingAction({page:a.page,pageSize:a.pageSize,total:a.total}),a.scrollTop)}function e(e,t,i){if(e.showPrevNext&&!(t<1)){var l,n;if("prev"===i){l=e.page-1<=0;var s=e.page-1<=0?1:e.page-1;n={value:e.prevText,title:"Previous Page",page:s,className:"previous"}}else{l=e.page+1>t;var p=e.page+1>=t?t:e.page+1;n={value:e.nextText,title:"Next Page",page:p,className:"next"}}var g={value:n.value,title:n.title,liClass:l?e.disabledClass+" paginate_button "+n.className:" paginate_button "+n.className,action:function(){l||a(e,n.page)}};e.List.push(g)}}function t(e,t,i){var l=0;for(l=e;l<=t;l++){var n={value:l,title:"Page "+l,liClass:i.page==l?i.activeClass+" paginate_button":" paginate_button",action:function(){a(i,this.value)}};i.List.push(n)}}function i(a){a.List.push({value:a.dots})}function l(a,e){t(1,2,a),3!=e&&i(a)}function n(a,e,l){l!=a-2&&i(e),t(a-1,a,e)}function s(a,i){(!a.pageSize||a.pageSize<=0)&&(a.pageSize=1);var s,p,g=Math.ceil(a.total/a.pageSize);!function(a,e){a.List=[],a.Hide=!1,a.dots=a.dots||"...",a.page=parseInt(a.page)||1,a.total=parseInt(a.total)||0,a.ulClass=a.ulClass||"pagination",a.adjacent=parseInt(a.adjacent)||2,a.activeClass=a.activeClass||"active",a.disabledClass=a.disabledClass||"disabled",a.scrollTop=a.$eval(e.scrollTop),a.hideIfEmpty=a.$eval(e.hideIfEmpty),a.showPrevNext=a.$eval(e.showPrevNext)}(a,i),function(a,e){a.page>e&&(a.page=e),a.page<=0&&(a.page=1),a.adjacent<=0&&(a.adjacent=2),e<=1&&(a.Hide=a.hideIfEmpty)}(a,g);var o=2*a.adjacent+2;e(a,g,"prev"),g<=o+2?t(s=1,g,a):a.page-a.adjacent<=2?(t(s=1,p=1+o,a),n(g,a,p)):a.page<g-(a.adjacent+2)?(s=a.page-a.adjacent,p=a.page+a.adjacent,l(a,s),t(s,p,a),n(g,a,p)):(p=g,l(a,s=g-o),t(s,p,a)),e(a,g,"next")}return{restrict:"EA",scope:{page:"=",pageSize:"=",total:"=",dots:"@",hideIfEmpty:"@",ulClass:"@",activeClass:"@",disabledClass:"@",adjacent:"@",scrollTop:"@",showPrevNext:"@",pagingAction:"&",prevText:"@",nextText:"@"},template:'<ul ng-hide="Hide" ng-class="ulClass"> <li title="{{Item.title}}" ng-class="Item.liClass" ng-click="Item.action()" ng-repeat="Item in List"> <a ng-bind="Item.value"></a> </li></ul>',link:function(a,e,t){a.$watchCollection("[page,pageSize,total]",function(){s(a,t)})}}});;!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["powerbi-client"]=t():e["powerbi-client"]=t()}(this,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return r.m=e,r.c=t,r.p="",r(0)}([function(e,t,r){var n=r(1);t.service=n;var i=r(10);t.factories=i;var o=r(5);t.models=o;var s=r(4);t.Report=s.Report;var a=r(9);t.Tile=a.Tile;var c=r(2);t.Embed=c.Embed;var h=r(6);t.Page=h.Page;var u=new n.Service(i.hpmFactory,i.wpmpFactory,i.routerFactory);window.powerbi=u},function(e,t,r){var n=r(2),i=r(4),o=r(7),s=r(8),a=r(9),c=r(6),h=r(3),u=function(){function e(t,r,n,i){var o=this;void 0===i&&(i={}),this.wpmp=r(i.wpmpName,i.logMessages),this.hpm=t(this.wpmp,null,i.version,i.type),this.router=n(this.wpmp),this.router.post("/reports/:uniqueId/events/:eventName",function(e,t){var r={type:"report",id:e.params.uniqueId,name:e.params.eventName,value:e.body};o.handleEvent(r)}),this.router.post("/reports/:uniqueId/pages/:pageName/events/:eventName",function(e,t){var r={type:"report",id:e.params.uniqueId,name:e.params.eventName,value:e.body};o.handleEvent(r)}),this.router.post("/dashboards/:uniqueId/events/:eventName",function(e,t){var r={type:"dashboard",id:e.params.uniqueId,name:e.params.eventName,value:e.body};o.handleEvent(r)}),this.embeds=[],this.config=h.assign({},e.defaultConfig,i),this.config.autoEmbedOnContentLoaded&&this.enableAutoEmbed()}return e.prototype.createReport=function(e,t){t.type="create";var r=e,n=new o.Create(this,r,t);return r.powerBiEmbed=n,this.addOrOverwriteEmbed(n,e),n},e.prototype.init=function(e,t){var r=this;return void 0===t&&(t=void 0),e=e&&e instanceof HTMLElement?e:document.body,Array.prototype.slice.call(e.querySelectorAll("["+n.Embed.embedUrlAttribute+"]")).map(function(e){return r.embed(e,t)})},e.prototype.embed=function(e,t){void 0===t&&(t={});var r=e;return r.powerBiEmbed?this.embedExisting(r,t):this.embedNew(r,t)},e.prototype.embedNew=function(t,r){var o=r.type||t.getAttribute(n.Embed.typeAttribute);if(!o)throw new Error("Attempted to embed using config "+JSON.stringify(r)+" on element "+t.outerHTML+", but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '"+n.Embed.typeAttribute+'="'+i.Report.type.toLowerCase()+"\"'.");r.type=o;var s=h.find(function(e){return o===e.type.toLowerCase()},e.components);if(!s)throw new Error("Attempted to embed component of type: "+o+" but did not find any matching component.  Please verify the type you specified is intended.");var a=new s(this,t,r);return t.powerBiEmbed=a,this.addOrOverwriteEmbed(a,t),a},e.prototype.embedExisting=function(e,t){var r=h.find(function(t){return t.element===e},this.embeds);if(!r)throw new Error("Attempted to embed using config "+JSON.stringify(t)+" on element "+e.outerHTML+" which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.");if("string"==typeof t.type&&t.type!==r.config.type){if("report"===t.type&&"create"===r.config.type){var n=new i.Report(this,e,t,e.powerBiEmbed.iframe);return n.load(t),e.powerBiEmbed=n,this.addOrOverwriteEmbed(r,e),n}throw new Error("Embedding on an existing element with a different type than the previous embed object is not supported.  Attempted to embed using config "+JSON.stringify(t)+" on element "+e.outerHTML+", but the existing element contains an embed of type: "+this.config.type+" which does not match the new type: "+t.type)}return r.load(t),r},e.prototype.enableAutoEmbed=function(){var e=this;window.addEventListener("DOMContentLoaded",function(t){return e.init(document.body)},!1)},e.prototype.get=function(e){var t=e;if(!t.powerBiEmbed)throw new Error("You attempted to get an instance of powerbi component associated with element: "+e.outerHTML+" but there was no associated instance.");return t.powerBiEmbed},e.prototype.find=function(e){return h.find(function(t){return t.config.uniqueId===e},this.embeds)},e.prototype.addOrOverwriteEmbed=function(e,t){this.embeds=this.embeds.filter(function(e){return e.element.id!==t.id}),this.embeds.push(e)},e.prototype.reset=function(e){var t=e;if(t.powerBiEmbed){h.remove(function(e){return e===t.powerBiEmbed},this.embeds),delete t.powerBiEmbed;var r=e.querySelector("iframe");r&&r.remove()}},e.prototype.handleEvent=function(e){var t=h.find(function(t){return t.config.uniqueId===e.id},this.embeds);if(t){var r=e.value;if("pageChanged"===e.name){var n=r.newPage;if(!n)throw new Error("Page model not found at 'event.value.newPage'.");r.newPage=new c.Page(t,n.name,n.displayName)}h.raiseCustomEvent(t.element,e.name,r)}},e.components=[a.Tile,i.Report,s.Dashboard],e.defaultConfig={autoEmbedOnContentLoaded:!1,onError:function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return console.log(e[0],e.slice(1))}},e}();t.Service=u},function(e,t,r){var n=r(3),i=function(){function e(t,r,n,i){this.allowedEvents=[],Array.prototype.push.apply(this.allowedEvents,e.allowedEvents),this.eventHandlers=[],this.service=t,this.element=r,this.iframe=i,this.embeType=n.type.toLowerCase(),this.populateConfig(n),"create"===this.embeType?this.setIframe(!1):this.setIframe(!0)}return e.prototype.createReport=function(e){var t=this.validate(e);if(t)throw t;return this.service.hpm.post("/report/create",e,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body},function(e){throw e.body})},e.prototype.save=function(){return this.service.hpm.post("/report/save",null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body}).catch(function(e){throw e.body})},e.prototype.saveAs=function(e){return this.service.hpm.post("/report/saveAs",e,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body}).catch(function(e){throw e.body})},e.prototype.load=function(e){var t=this,r=this.validate(e);if(r)throw r;return this.service.hpm.post(this.loadPath,e,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(r){return n.assign(t.config,e),r.body},function(e){throw e.body})},e.prototype.off=function(e,t){var r=this,i={name:e,type:null,id:null,value:null};t?(n.remove(function(e){return e.test(i)&&e.handle===t},this.eventHandlers),this.element.removeEventListener(e,t)):this.eventHandlers.filter(function(e){return e.test(i)}).forEach(function(t){n.remove(function(e){return e===t},r.eventHandlers),r.element.removeEventListener(e,t.handle)})},e.prototype.on=function(e,t){if(-1===this.allowedEvents.indexOf(e))throw new Error("eventName is must be one of "+this.allowedEvents+". You passed: "+e);this.eventHandlers.push({test:function(t){return t.name===e},handle:t}),this.element.addEventListener(e,t)},e.prototype.reload=function(){return this.load(this.config)},e.prototype.setAccessToken=function(e){return this.service.hpm.post("/report/token",e,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body}).catch(function(e){throw e.body})},e.prototype.getAccessToken=function(t){var r=this.config.accessToken||this.element.getAttribute(e.accessTokenAttribute)||t;if(!r)throw new Error("No access token was found for element. You must specify an access token directly on the element using attribute '"+e.accessTokenAttribute+"' or specify a global token at: powerbi.accessToken.");return r},e.prototype.populateConfig=function(t){var r=n.assign({},e.defaultSettings,t.settings);this.config=n.assign({settings:r},t),this.config.uniqueId=this.getUniqueId(),this.config.embedUrl=this.getEmbedUrl(),"create"===this.embeType?this.createConfig={datasetId:t.datasetId||this.getId(),accessToken:this.getAccessToken(this.service.accessToken),settings:r}:(this.config.id=this.getId(),this.config.accessToken=this.getAccessToken(this.service.accessToken))},e.prototype.getEmbedUrl=function(){var t=this.config.embedUrl||this.element.getAttribute(e.embedUrlAttribute);if("string"!=typeof t||0===t.length)throw new Error("Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '"+e.embedUrlAttribute+"'.");return t},e.prototype.getUniqueId=function(){return this.config.uniqueId||this.element.getAttribute(e.nameAttribute)||n.createRandomString()},e.prototype.fullscreen=function(){(this.iframe.requestFullscreen||this.iframe.msRequestFullscreen||this.iframe.mozRequestFullScreen||this.iframe.webkitRequestFullscreen).call(this.iframe)},e.prototype.exitFullscreen=function(){this.isFullscreen(this.iframe)&&(document.exitFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.msExitFullscreen).call(document)},e.prototype.isFullscreen=function(e){return["fullscreenElement","webkitFullscreenElement","mozFullscreenScreenElement","msFullscreenElement"].some(function(t){return document[t]===e})},e.prototype.setIframe=function(e){var t=this;if(!this.iframe){var r='<iframe style="width:100%;height:100%;" src="'+this.config.embedUrl+'" scrolling="no" allowfullscreen="true"></iframe>';this.element.innerHTML=r,this.iframe=this.element.childNodes[0]}e?this.iframe.addEventListener("load",function(){return t.load(t.config)},!1):this.iframe.addEventListener("load",function(){return t.createReport(t.createConfig)},!1)},e.allowedEvents=["loaded","saved","rendered","saveAsTriggered","error","dataSelected"],e.accessTokenAttribute="powerbi-access-token",e.embedUrlAttribute="powerbi-embed-url",e.nameAttribute="powerbi-name",e.typeAttribute="powerbi-type",e.defaultSettings={filterPaneEnabled:!0},e}();t.Embed=i},function(e,t){function r(e,t){if(!Array.isArray(t))throw new Error("You attempted to call find with second parameter that was not an array. You passed: "+t);var r;return t.some(function(t,n){if(e(t))return r=n,!0}),r}t.raiseCustomEvent=function(e,t,r){var n;"function"==typeof CustomEvent?n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,r),e.dispatchEvent(n)},t.findIndex=r,t.find=function(e,t){return t[r(e,t)]},t.remove=function(e,t){var n=r(e,t);t.splice(n,1)},t.assign=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];var r=e[0];if(void 0===r||null===r)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(r),i=1;i<arguments.length;i++){var o=arguments[i];if(void 0!==o&&null!==o)for(var s in o)o.hasOwnProperty(s)&&(n[s]=o[s])}return n},t.createRandomString=function(){return(Math.random()+1).toString(36).substring(7)}},function(e,t,r){var n=this&&this.__extends||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=r(2),o=r(5),s=r(3),a=r(6),c=function(e){function t(r,n,i,o){var a=i.settings&&i.settings.filterPaneEnabled||!("false"===n.getAttribute(t.filterPaneEnabledAttribute)),c=i.settings&&i.settings.navContentPaneEnabled||!("false"===n.getAttribute(t.navContentPaneEnabledAttribute)),h=s.assign({filterPaneEnabled:a,navContentPaneEnabled:c},i.settings),u=s.assign({settings:h},i);e.call(this,r,n,u,o),this.loadPath="/report/load",Array.prototype.push.apply(this.allowedEvents,t.allowedEvents)}return n(t,e),t.findIdFromEmbedUrl=function(e){var t,r=e.match(/reportId="?([^&]+)"?/);return r&&(t=r[1]),t},t.prototype.getFilters=function(){return this.service.hpm.get("/report/filters",{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body},function(e){throw e.body})},t.prototype.getId=function(){var e=this.config.id||this.element.getAttribute(t.reportIdAttribute)||t.findIdFromEmbedUrl(this.config.embedUrl);if("string"!=typeof e||0===e.length)throw new Error("Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '"+t.reportIdAttribute+"'.");return e},t.prototype.getPages=function(){var e=this;return this.service.hpm.get("/report/pages",{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(t){return t.body.map(function(t){return new a.Page(e,t.name,t.displayName)})},function(e){throw e.body})},t.prototype.page=function(e,t){return new a.Page(this,e,t)},t.prototype.print=function(){return this.service.hpm.post("/report/print",null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body}).catch(function(e){throw e.body})},t.prototype.removeFilters=function(){return this.setFilters([])},t.prototype.setPage=function(e){var t={name:e,displayName:null};return this.service.hpm.put("/report/pages/active",t,{uid:this.config.uniqueId},this.iframe.contentWindow).catch(function(e){throw e.body})},t.prototype.setFilters=function(e){return this.service.hpm.put("/report/filters",e,{uid:this.config.uniqueId},this.iframe.contentWindow).catch(function(e){throw e.body})},t.prototype.updateSettings=function(e){return this.service.hpm.patch("/report/settings",e,{uid:this.config.uniqueId},this.iframe.contentWindow).catch(function(e){throw e.body})},t.prototype.validate=function(e){return o.validateReportLoad(e)},t.prototype.switchMode=function(e){var t="/report/switchMode/"+e;return this.service.hpm.post(t,null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body}).catch(function(e){throw e.body})},t.prototype.refresh=function(){return this.service.hpm.post("/report/refresh",null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body}).catch(function(e){throw e.body})},t.allowedEvents=["filtersApplied","pageChanged"],t.reportIdAttribute="powerbi-report-id",t.filterPaneEnabledAttribute="powerbi-settings-filter-pane-enabled",t.navContentPaneEnabledAttribute="powerbi-settings-nav-content-pane-enabled",t.typeAttribute="powerbi-type",t.type="Report",t}(i.Embed);t.Report=c},function(e,t,r){var n;n=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return r.m=e,r.c=t,r.p="",r(0)}([function(e,t,r){var n=this&&this.__extends||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)};t.advancedFilterSchema=r(1),t.filterSchema=r(2),t.loadSchema=r(3),t.dashboardLoadSchema=r(4),t.pageSchema=r(5),t.settingsSchema=r(6),t.basicFilterSchema=r(7),t.createReportSchema=r(8),t.saveAsParametersSchema=r(9);var i=r(10);function o(e){var t=e.message;return t||(t=e.path+" is invalid. Not meeting "+e.keyword+" constraint"),{message:t}}function s(e,t){return function(r){var n=i(e,t);return n(r)?void 0:n.errors.map(o)}}t.validateSettings=s(t.settingsSchema,{schemas:{basicFilter:t.basicFilterSchema,advancedFilter:t.advancedFilterSchema}}),t.validateReportLoad=s(t.loadSchema,{schemas:{settings:t.settingsSchema,basicFilter:t.basicFilterSchema,advancedFilter:t.advancedFilterSchema}}),t.validateCreateReport=s(t.createReportSchema),t.validateDashboardLoad=s(t.dashboardLoadSchema),t.validatePage=s(t.pageSchema),t.validateFilter=s(t.filterSchema,{schemas:{basicFilter:t.basicFilterSchema,advancedFilter:t.advancedFilterSchema}}),function(e){e[e.Advanced=0]="Advanced",e[e.Basic=1]="Basic",e[e.Unknown=2]="Unknown"}(t.FilterType||(t.FilterType={}));var a=t.FilterType;function c(e){var t=e,r=e;return"string"==typeof t.operator&&Array.isArray(t.values)?a.Basic:"string"==typeof r.logicalOperator&&Array.isArray(r.conditions)?a.Advanced:a.Unknown}function h(e){return void 0!==e.table&&void 0!==e.column}t.isFilterKeyColumnsTarget=function(e){return h(e)&&!!e.keys},t.isBasicFilterWithKeys=function(e){return c(e)===a.Basic&&!!e.keyValues},t.getFilterType=c,t.isMeasure=function(e){return void 0!==e.table&&void 0!==e.measure},t.isColumn=h,t.isHierarchy=function(e){return void 0!==e.table&&void 0!==e.hierarchy&&void 0!==e.hierarchyLevel};var u=function(){function e(e){this.target=e}return e.prototype.toJSON=function(){return{$schema:this.schemaUrl,target:this.target}},e}();t.Filter=u;var d=function(e){function t(r,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];if(e.call(this,r),this.operator=n,this.schemaUrl=t.schemaUrl,0===i.length&&"All"!==n)throw new Error('values must be a non-empty array unless your operator is "All".');Array.isArray(i[0])?this.values=i[0]:this.values=i}return n(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.operator=this.operator,t.values=this.values,t},t.schemaUrl="http://powerbi.com/product/schema#basic",t}(u);t.BasicFilter=d;var p=function(e){function t(t,r,n,i){e.call(this,t,r,n),this.keyValues=i,this.target=t;var o=t.keys?t.keys.length:0;if(o>0&&!i)throw new Error("You shold pass the values to be filtered for each key. You passed: no values and "+o+" keys");if(0===o&&i&&i.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var s=0;s<this.keyValues.length;s++)if(this.keyValues[s]){var a=this.keyValues[s].length;if(a!==o)throw new Error("Each tuple of key values should contain a value for each of the keys. You passed: "+a+" values and "+o+" keys")}}return n(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.keyValues=this.keyValues,t},t}(d);t.BasicFilterWithKeys=p;var f=function(e){function t(r,n){for(var i,o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];if(e.call(this,r),this.schemaUrl=t.schemaUrl,"string"!=typeof n||0===n.length)throw new Error("logicalOperator must be a valid operator, You passed: "+n);if(this.logicalOperator=n,0===(i=Array.isArray(o[0])?o[0]:o).length)throw new Error("conditions must be a non-empty array. You passed: "+o);if(i.length>2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+o.length);if(1===i.length&&"And"!==n)throw new Error('Logical Operator must be "And" when there is only one condition provided');this.conditions=i}return n(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.logicalOperator=this.logicalOperator,t.conditions=this.conditions,t},t.schemaUrl="http://powerbi.com/product/schema#advanced",t}(u);t.AdvancedFilter=f,function(e){e[e.Read=0]="Read",e[e.ReadWrite=1]="ReadWrite",e[e.Copy=2]="Copy",e[e.Create=4]="Create",e[e.All=7]="All"}(t.Permissions||(t.Permissions={}));t.Permissions;!function(e){e[e.View=0]="View",e[e.Edit=1]="Edit"}(t.ViewMode||(t.ViewMode={}));t.ViewMode;t.validateSaveAsParameters=s(t.saveAsParametersSchema)},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{oneOf:[{type:"object",properties:{table:{type:"string"},column:{type:"string"}},required:["table","column"]},{type:"object",properties:{table:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"}},required:["table","hierarchy","hierarchyLevel"]},{type:"object",properties:{table:{type:"string"},measure:{type:"string"}},required:["table","measure"]}]},logicalOperator:{type:"string"},conditions:{type:"array",items:{type:"object",properties:{value:{type:["string","boolean","number"]},operator:{type:"string"}},required:["value","operator"]}}},required:["target","logicalOperator","conditions"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}],invalidMessage:"filter is invalid"}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},settings:{$ref:"#settings"},pageName:{type:"string",messages:{type:"pageName must be a string"}},filters:{type:"array",items:{type:"object",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}]},invalidMessage:"filters property is invalid"},permissions:{type:"number",enum:[0,1,2,4,7],default:0,invalidMessage:"permissions property is invalid"},viewMode:{type:"number",enum:[0,1],default:0,invalidMessage:"viewMode property is invalid"}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},pageView:{type:"string",messages:{type:'pageView must be a string with one of the following values: "actualSize", "fitToWidth", "oneColumn"'}}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{filterPaneEnabled:{type:"boolean",messages:{type:"filterPaneEnabled must be a boolean"}},navContentPaneEnabled:{type:"boolean",messages:{type:"navContentPaneEnabled must be a boolean"}},useCustomSaveAsDialog:{type:"boolean",messages:{type:"useCustomSaveAsDialog must be a boolean"}}}}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{type:"object",properties:{table:{type:"string"},column:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"},measure:{type:"string"}},required:["table"]},operator:{type:"string"},values:{type:"array",items:{type:["string","boolean","number"]}}},required:["target","operator","values"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},datasetId:{type:"string",messages:{type:"datasetId must be a string",required:"datasetId is required"}}},required:["accessToken","datasetId"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t,r){e.exports=r(11)},function(e,t,r){"use strict";var n=/[\/]/g,i=/(")/gim,o=/^[a-z_$][0-9a-z]*$/gi,s="jsen: invalid schema object",a="object"==typeof window&&!!window.navigator,c="/"!==new RegExp("/").source,h=r(12),u=r(13),d=r(14),p=r(15),f=r(24),l=r(25),m={},g={};function y(e){return e=e instanceof RegExp?e:new RegExp(e),c?e.toString():"/"+e.source.replace(n,"\\$&")+"/"}function v(e){return'"'+e.replace(i,"\\$1")+'"'}function b(e,t){return o.lastIndex=0,o.test(t)?e+"."+t:e+"["+v(t)+"]"}function w(e){if(void 0===e)return"undefined";var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function x(e){return(0|e)===e}function A(e,t){g[t].type=e,g[t].keyword=t}function E(e,t){var r,n,i=e.substr(4),o=i.length,s=[],a="",c=!1;for(n=0;n<o;n++)switch(r=i[n]){case".":a&&(a+=r);break;case"[":isNaN(+i[n+1])?(c=!0,a&&(s.push('"'+a+'"'),a="")):(c=!1,a&&(a+="."));break;case"]":s.push(c?a:'"'+a+'"'),a="";break;default:a+=r}return a&&s.push('"'+a+'"'),t&&s.push('"'+t+'"'),1===s.length&&c?'"" + '+s[0]+' + ""':s.join(' + "." + ')||'""'}function O(e){var t,r,n,i,o=e,s=w(e);if("object"===s)for(o={},i=0,r=(t=Object.keys(e)).length;i<r;i++)o[n=t[i]]=O(e[n]);else if("array"===s)for(o=[],i=0,r=e.length;i<r;i++)o[i]=O(e[i]);else{if("regexp"===s)return new RegExp(e);if("date"===s)return new Date(e.toJSON())}return o}function P(e,t){for(var r=0,n=t.length;r<n;r++)if(u(e,t[r]))return!0;return!1}function j(){this.objects=[],this.properties=[]}function I(e){this.path="data",this.schema=e.schema,this.formats=e.formats,this.greedy=e.greedy,this.resolver=e.resolver,this.id=e.id,this.funcache=e.funcache||{},this.scope=e.scope||{equalAny:P,unique:d,ucs2length:l,refs:{}}}function C(e,t){if("object"!==w(e))throw new Error(s);var r=0,n=new p(e,(t=t||{}).schemas,t.missing$Ref||!1),i=new I({schema:e,resolver:n,id:function(){return"i"+r++},schemas:t.schemas,formats:t.formats,greedy:t.greedy||!1}),o=h("validate","data")("validate.errors = []")('gen(data, "", validate.errors)')("return validate.errors.length === 0").compile({gen:i.compile()});return i.dispose(),i=null,o.errors=[],o.build=function(t,r){return function e(t,r,n,i,o){var s,a,c,h,u,d,p;if("object"!==w(t))return r;if(t=i.resolve(t),void 0===r&&t.hasOwnProperty("default")&&(r=O(t.default)),"object"===(s=w(r))&&"object"===w(t.properties)){for(d=Object.keys(t.properties),h=0;h<d.length;h++)c=d[h],void 0!==(a=e(t.properties[c],r[c],n,i))&&(r[c]=a);if("always"!==n)for(p=Object.keys(r),h=0;h<p.length;h++)c=p[h],d.indexOf(c)<0&&(!1===t.additionalProperties||!1===n&&!t.additionalProperties)&&(o?o.mark(r,c):delete r[c])}else if("array"===s&&t.items){if("array"===w(t.items))for(h=0;h<t.items.length;h++)(void 0!==(a=e(t.items[h],r[h],n,i))||h<r.length)&&(r[h]=a);else if(r.length)for(h=0;h<r.length;h++)r[h]=e(t.items,r[h],n,i)}else if("array"===w(t.allOf)&&t.allOf.length){for(u=new j,h=0;h<t.allOf.length;h++)r=e(t.allOf[h],r,n,i,u);u.deleteDuplicates(),u.dispose()}return r}(e,r&&!1===r.copy?t:O(t),r&&r.additionalProperties,n)},o}m.null=function(e){return e+" === null"},m.boolean=function(e){return"typeof "+e+' === "boolean"'},m.string=function(e){return"typeof "+e+' === "string"'},m.number=function(e){return"typeof "+e+' === "number"'},m.integer=function(e){return"typeof "+e+' === "number" && !('+e+" % 1)"},m.array=function(e){return"Array.isArray("+e+")"},m.object=function(e){return"typeof "+e+' === "object" && '+e+" !== null && !Array.isArray("+e+")"},m.date=function(e){return e+" instanceof Date"},g.enum=function(e){var t=e.schema.enum;e.code("if (!equalAny("+e.path+", "+JSON.stringify(t)+")) {"),e.error("enum"),e.code("}")},g.minimum=function(e){"number"==typeof e.schema.minimum&&(e.code("if ("+e.path+" < "+e.schema.minimum+") {"),e.error("minimum"),e.code("}"))},g.exclusiveMinimum=function(e){!0===e.schema.exclusiveMinimum&&"number"==typeof e.schema.minimum&&(e.code("if ("+e.path+" === "+e.schema.minimum+") {"),e.error("exclusiveMinimum"),e.code("}"))},g.maximum=function(e){"number"==typeof e.schema.maximum&&(e.code("if ("+e.path+" > "+e.schema.maximum+") {"),e.error("maximum"),e.code("}"))},g.exclusiveMaximum=function(e){!0===e.schema.exclusiveMaximum&&"number"==typeof e.schema.maximum&&(e.code("if ("+e.path+" === "+e.schema.maximum+") {"),e.error("exclusiveMaximum"),e.code("}"))},g.multipleOf=function(e){if("number"==typeof e.schema.multipleOf){var t=e.schema.multipleOf,r=t.toString().length-t.toFixed(0).length-1,n=r>0?Math.pow(10,r):1,i=e.path;r>0?e.code("if (+(Math.round(("+i+" * "+n+') + "e+" + '+r+') + "e-" + '+r+") % "+t*n+" !== 0) {"):e.code("if ((("+i+" * "+n+") % "+t*n+") !== 0) {"),e.error("multipleOf"),e.code("}")}},g.minLength=function(e){x(e.schema.minLength)&&(e.code("if (ucs2length("+e.path+") < "+e.schema.minLength+") {"),e.error("minLength"),e.code("}"))},g.maxLength=function(e){x(e.schema.maxLength)&&(e.code("if (ucs2length("+e.path+") > "+e.schema.maxLength+") {"),e.error("maxLength"),e.code("}"))},g.pattern=function(e){var t=e.schema.pattern;("string"==typeof t||t instanceof RegExp)&&(e.code("if (!("+y(t)+").test("+e.path+")) {"),e.error("pattern"),e.code("}"))},g.format=function(e){"string"==typeof e.schema.format&&f[e.schema.format]&&(e.code("if (!("+f[e.schema.format]+").test("+e.path+")) {"),e.error("format"),e.code("}"))},g.minItems=function(e){x(e.schema.minItems)&&(e.code("if ("+e.path+".length < "+e.schema.minItems+") {"),e.error("minItems"),e.code("}"))},g.maxItems=function(e){x(e.schema.maxItems)&&(e.code("if ("+e.path+".length > "+e.schema.maxItems+") {"),e.error("maxItems"),e.code("}"))},g.additionalItems=function(e){!1===e.schema.additionalItems&&Array.isArray(e.schema.items)&&(e.code("if ("+e.path+".length > "+e.schema.items.length+") {"),e.error("additionalItems"),e.code("}"))},g.uniqueItems=function(e){e.schema.uniqueItems&&(e.code("if (unique("+e.path+").length !== "+e.path+".length) {"),e.error("uniqueItems"),e.code("}"))},g.items=function(e){var t=e.declare(0),r=0;if("object"===w(e.schema.items))e.code("for ("+t+" = 0; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.items),e.code("}");else if(Array.isArray(e.schema.items)){for(;r<e.schema.items.length;r++)e.code("if ("+e.path+".length - 1 >= "+r+") {"),e.descend(e.path+"["+r+"]",e.schema.items[r]),e.code("}");"object"===w(e.schema.additionalItems)&&(e.code("for ("+t+" = "+r+"; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.additionalItems),e.code("}"))}},g.maxProperties=function(e){x(e.schema.maxProperties)&&(e.code("if (Object.keys("+e.path+").length > "+e.schema.maxProperties+") {"),e.error("maxProperties"),e.code("}"))},g.minProperties=function(e){x(e.schema.minProperties)&&(e.code("if (Object.keys("+e.path+").length < "+e.schema.minProperties+") {"),e.error("minProperties"),e.code("}"))},g.required=function(e){if(Array.isArray(e.schema.required))for(var t=0;t<e.schema.required.length;t++)e.code("if ("+b(e.path,e.schema.required[t])+" === undefined) {"),e.error("required",e.schema.required[t]),e.code("}")},g.properties=function(e){var t,r,n,i=e.schema.properties,o="object"===w(i)?Object.keys(i):[],s=Array.isArray(e.schema.required)?e.schema.required:[];if(o.length)for(r=0;r<o.length;r++)t=o[r],n=b(e.path,t),e.code("if ("+n+" !== undefined) {"),e.descend(n,i[t]),e.code("}"),s.indexOf(t)>-1&&(e.code("else {"),e.error("required",t),e.code("}"))},g.patternProperties=g.additionalProperties=function(e){var t,r,n,i,o,s,a,c="object"===w(e.schema.properties)?Object.keys(e.schema.properties):[],h=e.schema.patternProperties,u="object"===w(h)?Object.keys(h):[],d=e.schema.additionalProperties,p=!1===d||"object"===w(d);if(u.length||p){for(r=e.declare("[]"),n=e.declare('""'),i=e.declare(0),p&&(o=e.declare(!1)),e.code(r+" = Object.keys("+e.path+")"),e.code("for ("+i+" = 0; "+i+" < "+r+".length; "+i+"++) {")(n+" = "+r+"["+i+"]")("if ("+e.path+"["+n+"] === undefined) {")("continue")("}"),p&&e.code(o+" = false"),a=0;a<u.length;a++)s=u[a],e.code("if (("+y(s)+").test("+n+")) {"),e.descend(e.path+"["+n+"]",h[s]),p&&e.code(o+" = true"),e.code("}");p&&(c.length&&(t=e.declare(JSON.stringify(c)),e.code("if ("+t+".indexOf("+n+") > -1) {")("continue")("}")),e.code("if (!"+o+") {"),!1===d?e.error("additionalProperties",void 0,n):e.descend(e.path+"["+n+"]",d),e.code("}")),e.code("}")}},g.dependencies=function(e){if("object"===w(e.schema.dependencies))for(var t,r,n=Object.keys(e.schema.dependencies),i=n.length,o=0,s=0;s<i;s++){if(t=n[s],r=e.schema.dependencies[t],e.code("if ("+b(e.path,t)+" !== undefined) {"),"object"===w(r))e.descend(e.path,r);else for(;o<r.length;o++)e.code("if ("+b(e.path,r[o])+" === undefined) {"),e.error("dependencies",r[o]),e.code("}");e.code("}")}},g.allOf=function(e){if(Array.isArray(e.schema.allOf))for(var t=0;t<e.schema.allOf.length;t++)e.descend(e.path,e.schema.allOf[t])},g.anyOf=function(e){if(Array.isArray(e.schema.anyOf)){var t=e.greedy,r=e.declare(0),n=e.declare(0),i=e.declare(!1),o=0;for(e.code(n+" = errors.length");o<e.schema.anyOf.length;o++)e.code("if (!"+i+") {"),e.code(r+" = errors.length"),e.greedy=!0,e.descend(e.path,e.schema.anyOf[o]),e.code(i+" = errors.length === "+r)("}");e.greedy=t,e.code("if (!"+i+") {"),e.error("anyOf"),e.code("} else {")("errors.length = "+n)("}")}},g.oneOf=function(e){if(Array.isArray(e.schema.oneOf)){var t=e.greedy,r=e.declare(0),n=e.declare(0),i=e.declare(0),o=0;for(e.code(n+" = errors.length"),e.code(r+" = 0");o<e.schema.oneOf.length;o++)e.code(i+" = errors.length"),e.greedy=!0,e.descend(e.path,e.schema.oneOf[o]),e.code("if (errors.length === "+i+") {")(r+"++")("}");e.greedy=t,e.code("if ("+r+" !== 1) {"),e.error("oneOf"),e.code("} else {")("errors.length = "+n)("}")}},g.not=function(e){if("object"===w(e.schema.not)){var t=e.greedy,r=e.declare(0);e.code(r+" = errors.length"),e.greedy=!0,e.descend(e.path,e.schema.not),e.greedy=t,e.code("if (errors.length === "+r+") {"),e.error("not"),e.code("} else {")("errors.length = "+r)("}")}},["minimum","exclusiveMinimum","maximum","exclusiveMaximum","multipleOf"].forEach(A.bind(null,"number")),["minLength","maxLength","pattern","format"].forEach(A.bind(null,"string")),["minItems","maxItems","additionalItems","uniqueItems","items"].forEach(A.bind(null,"array")),["maxProperties","minProperties","required","properties","patternProperties","additionalProperties","dependencies"].forEach(A.bind(null,"object")),["enum","allOf","anyOf","oneOf","not"].forEach(A.bind(null,null)),j.prototype.mark=function(e,t){var r,n=this.objects.indexOf(e);if(n<0)return this.objects.push(e),(r={})[t]=1,void this.properties.push(r);(r=this.properties[n])[t]=r[t]?r[t]+1:1},j.prototype.deleteDuplicates=function(){var e,t,r,n,i;for(n=0;n<this.properties.length;n++)for(e=this.properties[n],t=Object.keys(e),i=0;i<t.length;i++)e[r=t[i]]>1&&delete this.objects[n][r]},j.prototype.dispose=function(){this.objects.length=0,this.properties.length=0},I.prototype.clone=function(e){return new I({schema:e,formats:this.formats,greedy:this.greedy,resolver:this.resolver,id:this.id,funcache:this.funcache,scope:this.scope})},I.prototype.declare=function(e){var t=this.id();return this.code.def(t,e),t},I.prototype.cache=function(e,t){var r,n=this.funcache[e];return n||(n=this.funcache[e]={key:this.id()},r=this.clone(t),n.func=r.compile(n.key),this.scope.refs[n.key]=n.func,r.dispose()),"refs."+n.key},I.prototype.error=function(e,t,r){var n=this.schema,i=this.path,o="data"!==i||t?'(path ? path + "." : "") + '+E(i,t)+",":"path,",s=t&&n.properties&&n.properties[t]?this.resolver.resolve(n.properties[t]):null,a=s?s.requiredMessage:n.invalidMessage;a||(a=s&&s.messages&&s.messages[e]||n.messages&&n.messages[e]),this.code("errors.push({"),a&&this.code("message: "+v(a)+","),r&&this.code("additionalProperties: "+r+","),this.code("path: "+o)("keyword: "+v(e))("})"),this.greedy||this.code("return")},I.prototype.refactor=function(e,t,r){var n="data"!==e?'(path ? path + "." : "") + '+E(e):"path",i=this.cache(r,t),o=this.declare();this.code(o+" = "+i+"("+e+", "+n+", errors)"),this.greedy||this.code("if (errors.length) { return }")},I.prototype.descend=function(e,t){var r=this.path,n=this.schema;this.path=e,this.schema=t,this.generate(),this.path=r,this.schema=n},I.prototype.generate=function(){var e,t,r,n,i,o,s,a=this.path,c=this.schema,h=this,u=this.scope;if("object"===w(c)){if(void 0!==c.$ref){if(c=this.resolver.resolve(c),this.resolver.hasRef(c))return void this.refactor(a,c,this.resolver.getNormalizedRef(this.schema)||this.schema.$ref);this.schema=c}if((r=function(e){var t,r,n,i=Object.keys(e),o=i.indexOf("properties"),s=i.indexOf("patternProperties"),a={enum:Array.isArray(e.enum)&&e.enum.length>0,type:null,allType:[],perType:{}};for(e.type&&("string"==typeof e.type?a.type=[e.type]:Array.isArray(e.type)&&e.type.length&&(a.type=e.type.slice(0))),n=0;n<i.length;n++)"enum"!==(t=i[n])&&"type"!==t&&(r=g[t])&&(r.type?(a.perType[r.type]||(a.perType[r.type]=[]),o>-1&&"required"===t||s>-1&&"additionalProperties"===t||a.perType[r.type].push(t)):a.allType.push(t));return a}(c)).enum)g.enum(h);else{for(n=Object.keys(r.perType),s=0;s<n.length;s++)o=n[s],this.code((s?"else ":"")+"if ("+m[o](a)+") {"),r.perType[o].forEach(d),this.code("}"),r.type&&(i=r.type.indexOf(o))>-1&&r.type.splice(i,1);r.type&&(r.type.length?(this.code((n.length?"else ":"")+"if (!("+r.type.map(function(e){return m[e]?m[e](a):"true"}).join(" || ")+")) {"),this.error("type"),this.code("}")):(this.code("else {"),this.error("type"),this.code("}"))),r.allType.forEach(function(e){g[e](h)}),c.format&&this.formats&&(t=this.formats[c.format])&&("string"==typeof t||t instanceof RegExp?(this.code("if (!("+y(t)+").test("+a+")) {"),this.error("format"),this.code("}")):"function"==typeof t&&((u.formats||(u.formats={}))[c.format]=t,(u.schemas||(u.schemas={}))[c.format]=c,e=v(c.format),this.code("if (!formats["+e+"]("+a+", schemas["+e+"])) {"),this.error("format"),this.code("}")))}}function d(e){g[e](h)}},I.prototype.compile=function(e){return this.code=h("jsen_compiled"+(e?"_"+e:""),"data","path","errors"),this.generate(),this.code.compile(this.scope)},I.prototype.dispose=function(){for(var e in this)this[e]=void 0},C.browser=a,C.clone=O,C.equal=u,C.unique=d,C.ucs2length=l,C.SchemaResolver=p,C.resolve=p.resolvePointer,e.exports=C},function(e,t){"use strict";e.exports=function(){var e=Array.apply(null,arguments),t=e.shift(),r="",n="",i=1,o=function(e){r+=function(){for(var e="  ",t=0;t++<i-1;)e+="  ";return e}()+e+"\n"},s=function(e){var t=e[0],r=e[e.length-1];return"}]".indexOf(t)>-1&&"{[".indexOf(r)>-1?(i--,o(e),i++):"{[".indexOf(r)>-1?(o(e),i++):"}]".indexOf(t)>-1?(i--,o(e)):o(e),s};return s.def=function(e,t){return n+=(n?",\n      ":"")+e+(void 0!==t?" = "+t:""),s},s.toSource=function(){return"function "+t+"("+e.join(", ")+') {\n  "use strict"\n'+(n?"  var "+n+";\n":"")+r+"}"},s.compile=function(e){var t="return ("+s.toSource()+")",r=e||{},n=Object.keys(r),i=n.map(function(e){return r[e]});return Function.apply(null,n.concat(t)).apply(null,i)},s}},function(e,t){"use strict";function r(e){var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function n(e,t){var i,o=typeof e,s=typeof t;if("object"===o&&(o=r(e)),"object"===s&&(s=r(t)),o!==s)return!1;if("object"===o)return function(e,t){var r,i,o=Object.keys(e).sort();if(!n(o,Object.keys(t).sort()))return!1;for(r=0;r<o.length;r++)if(!n(e[i=o[r]],t[i]))return!1;return!0}(e,t);if("regexp"===o)return e.toString()===t.toString();if("array"===o){if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}return e===t}e.exports=n},function(e,t,r){"use strict";var n=r(13);function i(e,t,r){for(var n=0,i=e.length;n<i;n++)if(r(e[n],t))return n;return-1}e.exports=function(e){return e.filter(function(e,t,r){return i(r,e,n)===t})},e.exports.findIndex=i},function(e,t,r){"use strict";var n=r(16),i=r(23);function o(e,t){if(!t.length)return e;var r,n=t.shift();return e&&"object"==typeof e&&e.hasOwnProperty(n)&&(r=e[n]),t.length?r&&"object"==typeof r?o(r,t):void 0:r}function s(e){var t=e.indexOf("#"),r={base:e.substr(0,t),path:[]};return t<0?(r.base=e,r):(e=e.substr(t+1))?(r.path=e.split("/").map(function(e){return decodeURIComponent(e).replace(/~1/g,"/").replace(/~0/g,"~")}),"/"===e[0]&&r.path.shift(),r):r}function a(e,t,r,n){this.rootSchema=e,this.resolvers=null,this.resolvedRootSchema=null,this.cache={},this.idCache={},this.refCache={refs:[],schemas:[]},this.missing$Ref=r,this.refStack=[],n=n||"",this._buildIdCache(e,n),n=this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)]||n,this._buildResolvers(t,n)}a.prototype._cacheId=function(e,t,r){if(this.idCache[e])throw new Error("jsen: duplicate schema id "+e);this.idCache[e]={resolver:r,schema:t}},a.prototype._buildIdCache=function(e,t){var r,i,o,s=t;if(e&&"object"==typeof e)for("string"==typeof e.id&&e.id?(s=n.resolve(t,e.id),this._cacheId(s,e,this)):e===this.rootSchema&&t&&this._cacheId(t,e,this),e.$ref&&"string"==typeof e.$ref&&(r=n.resolve(s,e.$ref),this.refCache.schemas.push(e),this.refCache.refs.push(r)),i=Object.keys(e),o=0;o<i.length;o++)this._buildIdCache(e[i[o]],s)},a.prototype._buildResolvers=function(e,t){if(e&&"object"==typeof e){var r=this,i={};Object.keys(e).forEach(function(o){var s=n.resolve(t,o),c=new a(e[o],null,r.missing$Ref,s);r._cacheId(s,c.rootSchema,c),Object.keys(c.idCache).forEach(function(e){r.idCache[e]=c.idCache[e]}),i[o]=c}),this.resolvers=i}},a.prototype.getNormalizedRef=function(e){var t=this.refCache.schemas.indexOf(e);return this.refCache.refs[t]},a.prototype._resolveRef=function(e){var t,r,n,a,c,h=new Error("jsen: invalid schema reference "+e),u=this.idCache;if(!e||"string"!=typeof e)throw h;if(e===i.id&&(c=i),(r=u[e])&&(c=r.resolver.resolve(r.schema)),void 0===c&&(a=(n=s(e)).path,n.base&&((r=u[n.base]||u[n.base+"#"])?c=r.resolver.resolve(o(r.schema,a.slice(0))):a.unshift(n.base))),void 0===c&&this.resolvedRootSchema&&(c=o(this.resolvedRootSchema,a.slice(0))),void 0===c&&(c=o(this.rootSchema,a.slice(0))),void 0===c&&a.length&&this.resolvers&&(t=o(this.resolvers,a))&&(c=t.resolve(t.rootSchema)),void 0===c||"object"!=typeof c){if(!this.missing$Ref)throw h;c={}}return this.cache[e]===c?c:(this.cache[e]=c,void 0!==c.$ref&&(c=this.resolve(c)),c)},a.prototype.resolve=function(e){if(!e||"object"!=typeof e||void 0===e.$ref)return e;var t=this.getNormalizedRef(e)||e.$ref,r=this.cache[t];if(void 0!==r)return r;if(this.refStack.indexOf(t)>-1)throw new Error("jsen: circular schema reference "+t);return this.refStack.push(t),r=this._resolveRef(t),this.refStack.pop(),e===this.rootSchema&&(this.resolvedRootSchema=r),r},a.prototype.hasRef=function(e){var t,r,n,i=Object.keys(e);if(i.indexOf("$ref")>-1)return!0;for(n=0,t=i.length;n<t;n++)if(e[r=i[n]]&&"object"==typeof e[r]&&!Array.isArray(e[r])&&this.hasRef(e[r]))return!0;return!1},a.resolvePointer=function(e,t){var r=s(t),n=r.path;return r.base&&(n=[r.base].concat(n)),o(e,n)},e.exports=a},function(e,t,r){"use strict";var n=r(17),i=r(19);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){i.isString(e)&&(e=b(e));return e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,h=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(h),d=["%","/","?",";","#"].concat(u),p=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,l=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=r(20);function b(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),a=-1!==o&&o<e.indexOf("#")?"?":"#",h=e.split(a);h[0]=h[0].replace(/\\/g,"/");var b=e=h.join(a);if(b=b.trim(),!r&&1===e.split("#").length){var w=c.exec(b);if(w)return this.path=b,this.href=b,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var x=s.exec(b);if(x){var A=(x=x[0]).toLowerCase();this.protocol=A,b=b.substr(x.length)}if(r||x||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===b.substr(0,2);!E||x&&g[x]||(b=b.substr(2),this.slashes=!0)}if(!g[x]&&(E||x&&!y[x])){for(var O,P,j=-1,I=0;I<p.length;I++){-1!==(C=b.indexOf(p[I]))&&(-1===j||C<j)&&(j=C)}-1!==(P=-1===j?b.lastIndexOf("@"):b.lastIndexOf("@",j))&&(O=b.slice(0,P),b=b.slice(P+1),this.auth=decodeURIComponent(O)),j=-1;for(I=0;I<d.length;I++){var C;-1!==(C=b.indexOf(d[I]))&&(-1===j||C<j)&&(j=C)}-1===j&&(j=b.length),this.host=b.slice(0,j),b=b.slice(j),this.parseHost(),this.hostname=this.hostname||"";var S="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!S)for(var k=this.hostname.split(/\./),q=(I=0,k.length);I<q;I++){var T=k[I];if(T&&!T.match(f)){for(var R="",F=0,M=T.length;F<M;F++)T.charCodeAt(F)>127?R+="x":R+=T[F];if(!R.match(f)){var $=k.slice(0,I),N=k.slice(I+1),U=T.match(l);U&&($.push(U[1]),N.unshift(U[2])),N.length&&(b="/"+N.join(".")+b),this.hostname=$.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),S||(this.hostname=n.toASCII(this.hostname));var L=this.port?":"+this.port:"",W=this.hostname||"";this.host=W+L,this.href+=this.host,S&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[A])for(I=0,q=u.length;I<q;I++){var z=u[I];if(-1!==b.indexOf(z)){var H=encodeURIComponent(z);H===z&&(H=escape(z)),b=b.split(z).join(H)}}var _=b.indexOf("#");-1!==_&&(this.hash=b.substr(_),b=b.slice(0,_));var D=b.indexOf("?");if(-1!==D?(this.search=b.substr(D),this.query=b.substr(D+1),t&&(this.query=v.parse(this.query)),b=b.slice(0,D)):t&&(this.search="",this.query={}),b&&(this.pathname=b),y[A]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){L=this.pathname||"";var J=this.search||"";this.path=L+J}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,s="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(s=v.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),t+o+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(a=a.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),s=0;s<n.length;s++){var a=n[s];r[a]=this[a]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var c=Object.keys(e),h=0;h<c.length;h++){var u=c[h];"protocol"!==u&&(r[u]=e[u])}return y[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!y[e.protocol]){for(var d=Object.keys(e),p=0;p<d.length;p++){var f=d[p];r[f]=e[f]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||g[e.protocol])r.pathname=e.pathname;else{for(var l=(e.pathname||"").split("/");l.length&&!(e.host=l.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==l[0]&&l.unshift(""),l.length<2&&l.unshift(""),r.pathname=l.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var m=r.pathname||"",v=r.search||"";r.path=m+v}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),x=w||b||r.host&&e.pathname,A=x,E=r.pathname&&r.pathname.split("/")||[],O=(l=e.pathname&&e.pathname.split("/")||[],r.protocol&&!y[r.protocol]);if(O&&(r.hostname="",r.port=null,r.host&&(""===E[0]?E[0]=r.host:E.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===l[0]?l[0]=e.host:l.unshift(e.host)),e.host=null),x=x&&(""===l[0]||""===E[0])),w)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,E=l;else if(l.length)E||(E=[]),E.pop(),E=E.concat(l),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(O)r.hostname=r.host=E.shift(),(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var P=E.slice(-1)[0],j=(r.host||e.host||E.length>1)&&("."===P||".."===P)||""===P,I=0,C=E.length;C>=0;C--)"."===(P=E[C])?E.splice(C,1):".."===P?(E.splice(C,1),I++):I&&(E.splice(C,1),I--);if(!x&&!A)for(;I--;I)E.unshift("..");!x||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),j&&"/"!==E.join("/").substr(-1)&&E.push("");var S,k=""===E[0]||E[0]&&"/"===E[0].charAt(0);O&&(r.hostname=r.host=k?"":E.length?E.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(x=x||r.host&&E.length)&&!k&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){var n;(function(e,i){!function(o){"object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType;var s="object"==typeof i&&i;s.global!==s&&s.window!==s&&s.self;var a,c=2147483647,h=36,u=1,d=26,p=38,f=700,l=72,m=128,g="-",y=/^xn--/,v=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=h-u,A=Math.floor,E=String.fromCharCode;function O(e){throw RangeError(w[e])}function P(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function j(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+P((e=e.replace(b,".")).split("."),t).join(".")}function I(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function C(e){return P(e,function(e){var t="";return e>65535&&(t+=E((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=E(e)}).join("")}function S(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function k(e,t,r){var n=0;for(e=r?A(e/f):e>>1,e+=A(e/t);e>x*d>>1;n+=h)e=A(e/x);return A(n+(x+1)*e/(e+p))}function q(e){var t,r,n,i,o,s,a,p,f,y,v,b=[],w=e.length,x=0,E=m,P=l;for((r=e.lastIndexOf(g))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&O("not-basic"),b.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<w;){for(o=x,s=1,a=h;i>=w&&O("invalid-input"),((p=(v=e.charCodeAt(i++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:h)>=h||p>A((c-x)/s))&&O("overflow"),x+=p*s,!(p<(f=a<=P?u:a>=P+d?d:a-P));a+=h)s>A(c/(y=h-f))&&O("overflow"),s*=y;P=k(x-o,t=b.length+1,0==o),A(x/t)>c-E&&O("overflow"),E+=A(x/t),x%=t,b.splice(x++,0,E)}return C(b)}function T(e){var t,r,n,i,o,s,a,p,f,y,v,b,w,x,P,j=[];for(b=(e=I(e)).length,t=m,r=0,o=l,s=0;s<b;++s)(v=e[s])<128&&j.push(E(v));for(n=i=j.length,i&&j.push(g);n<b;){for(a=c,s=0;s<b;++s)(v=e[s])>=t&&v<a&&(a=v);for(a-t>A((c-r)/(w=n+1))&&O("overflow"),r+=(a-t)*w,t=a,s=0;s<b;++s)if((v=e[s])<t&&++r>c&&O("overflow"),v==t){for(p=r,f=h;!(p<(y=f<=o?u:f>=o+d?d:f-o));f+=h)P=p-y,x=h-y,j.push(E(S(y+P%x,0))),p=A(P/x);j.push(E(S(p,0))),o=k(r,w,n==i),r=0,++n}++r,++t}return j.join("")}a={version:"1.3.2",ucs2:{decode:I,encode:C},decode:q,encode:T,toASCII:function(e){return j(e,function(e){return v.test(e)?"xn--"+T(e):e})},toUnicode:function(e){return j(e,function(e){return y.test(e)?q(e.slice(4).toLowerCase()):e})}},void 0===(n=function(){return a}.call(t,r,t,e))||(e.exports=n)}()}).call(t,r(18)(e),function(){return this}())},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(21),t.encode=t.stringify=r(22)},function(e,t){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,i){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var h=0;h<c;++h){var u,d,p,f,l=e[h].replace(s,"%20"),m=l.indexOf(n);m>=0?(u=l.substr(0,m),d=l.substr(m+1)):(u=l,d=""),p=decodeURIComponent(u),f=decodeURIComponent(d),r(o,p)?Array.isArray(o[p])?o[p].push(f):o[p]=[o[p],f]:o[p]=f}return o}},function(e,t){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,i){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(i){var o=encodeURIComponent(r(i))+n;return Array.isArray(e[i])?e[i].map(function(e){return o+encodeURIComponent(r(e))}).join(t):o+encodeURIComponent(r(e[i]))}).join(t):i?encodeURIComponent(r(i))+n+encodeURIComponent(r(e)):""}},function(e,t){e.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}}},function(e,t){"use strict";var r={"date-time":/(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/,uri:/^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\/\/[^\s]*$/,email:/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,hostname:/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/};e.exports=r},function(e,t){"use strict";e.exports=function(e){for(var t,r=0,n=0,i=e.length;n<i;)r++,(t=e.charCodeAt(n++))>=55296&&t<=56319&&n<i&&56320!=(64512&e.charCodeAt(n++))&&n--;return r}}])},e.exports=n()},function(e,t){var r=function(){function e(e,t,r){this.report=e,this.name=t,this.displayName=r}return e.prototype.getFilters=function(){return this.report.service.hpm.get("/report/pages/"+this.name+"/filters",{uid:this.report.config.uniqueId},this.report.iframe.contentWindow).then(function(e){return e.body},function(e){throw e.body})},e.prototype.removeFilters=function(){return this.setFilters([])},e.prototype.setActive=function(){var e={name:this.name,displayName:null};return this.report.service.hpm.put("/report/pages/active",e,{uid:this.report.config.uniqueId},this.report.iframe.contentWindow).catch(function(e){throw e.body})},e.prototype.setFilters=function(e){return this.report.service.hpm.put("/report/pages/"+this.name+"/filters",e,{uid:this.report.config.uniqueId},this.report.iframe.contentWindow).catch(function(e){throw e.body})},e}();t.Page=r},function(e,t,r){var n=this&&this.__extends||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=r(5),o=function(e){function t(t,r,n){e.call(this,t,r,n)}return n(t,e),t.prototype.getId=function(){var e=this.createConfig&&this.createConfig.datasetId?this.createConfig.datasetId:t.findIdFromEmbedUrl(this.config.embedUrl);if("string"!=typeof e||0===e.length)throw new Error("Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.");return e},t.prototype.validate=function(e){return i.validateCreateReport(e)},t.findIdFromEmbedUrl=function(e){var t,r=e.match(/datasetId="?([^&]+)"?/);return r&&(t=r[1]),t},t}(r(2).Embed);t.Create=o},function(e,t,r){var n=this&&this.__extends||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=r(2),o=r(5),s=function(e){function t(r,n,i){e.call(this,r,n,i),this.loadPath="/dashboard/load",Array.prototype.push.apply(this.allowedEvents,t.allowedEvents)}return n(t,e),t.findIdFromEmbedUrl=function(e){var t,r=e.match(/dashboardId="?([^&]+)"?/);return r&&(t=r[1]),t},t.prototype.getId=function(){var e=this.config.id||this.element.getAttribute(t.dashboardIdAttribute)||t.findIdFromEmbedUrl(this.config.embedUrl);if("string"!=typeof e||0===e.length)throw new Error("Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '"+t.dashboardIdAttribute+"'.");return e},t.prototype.validate=function(e){var t=o.validateDashboardLoad(e);return t||this.ValidatePageView(e.pageView)},t.prototype.ValidatePageView=function(e){if(e&&"fitToWidth"!==e&&"oneColumn"!==e&&"actualSize"!==e)return[{message:"pageView must be one of the followings: fitToWidth, oneColumn, actualSize"}]},t.allowedEvents=["tileClicked","error"],t.dashboardIdAttribute="powerbi-dashboard-id",t.typeAttribute="powerbi-type",t.type="Dashboard",t}(i.Embed);t.Dashboard=s},function(e,t,r){var n=this&&this.__extends||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=function(e){function t(){e.apply(this,arguments)}return n(t,e),t.prototype.getId=function(){throw new Error("Not implemented. Embedding tiles is not supported yet.")},t.prototype.validate=function(e){throw new Error("Not implemented. Embedding tiles is not supported yet.")},t.type="Tile",t}(r(2).Embed);t.Tile=i},function(e,t,r){var n=r(11),i=r(12),o=r(13),s=r(14);t.hpmFactory=function(e,t,r,i){return void 0===r&&(r=n.default.version),void 0===i&&(i=n.default.type),new o.HttpPostMessage(e,{"x-sdk-type":i,"x-sdk-version":r},t)},t.wpmpFactory=function(e,t,r){return new i.WindowPostMessageProxy({processTrackingProperties:{addTrackingProperties:o.HttpPostMessage.addTrackingProperties,getTrackingProperties:o.HttpPostMessage.getTrackingProperties},isErrorMessage:o.HttpPostMessage.isErrorMessage,name:e,logMessages:t,eventSourceOverrideWindow:r})},t.routerFactory=function(e){return new s.Router(e)}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={version:"2.3.0",type:"js"}},function(e,t,r){var n;n=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return r.m=e,r.c=t,r.p="",r(0)}([function(e,t){"use strict";var r=function(){function e(t){var r=this;void 0===t&&(t={processTrackingProperties:{addTrackingProperties:e.defaultAddTrackingProperties,getTrackingProperties:e.defaultGetTrackingProperties},isErrorMessage:e.defaultIsErrorMessage,receiveWindow:window,name:e.createRandomString()}),this.pendingRequestPromises={},this.addTrackingProperties=t.processTrackingProperties&&t.processTrackingProperties.addTrackingProperties||e.defaultAddTrackingProperties,this.getTrackingProperties=t.processTrackingProperties&&t.processTrackingProperties.getTrackingProperties||e.defaultGetTrackingProperties,this.isErrorMessage=t.isErrorMessage||e.defaultIsErrorMessage,this.receiveWindow=t.receiveWindow||window,this.name=t.name||e.createRandomString(),this.logMessages=t.logMessages||!1,this.eventSourceOverrideWindow=t.eventSourceOverrideWindow,this.suppressWarnings=t.suppressWarnings||!1,this.logMessages&&console.log("new WindowPostMessageProxy created with name: "+this.name+" receiving on window: "+this.receiveWindow.document.title),this.handlers=[],this.windowMessageHandler=function(e){return r.onMessageReceived(e)},this.start()}return e.defaultAddTrackingProperties=function(t,r){return t[e.messagePropertyName]=r,t},e.defaultGetTrackingProperties=function(t){return t[e.messagePropertyName]},e.defaultIsErrorMessage=function(e){return!!e.error},e.createDeferred=function(){var e={resolve:null,reject:null,promise:null},t=new Promise(function(t,r){e.resolve=t,e.reject=r});return e.promise=t,e},e.createRandomString=function(){return(Math.random()+1).toString(36).substring(7)},e.prototype.addHandler=function(e){this.handlers.push(e)},e.prototype.removeHandler=function(e){var t=this.handlers.indexOf(e);if(-1===t)throw new Error("You attempted to remove a handler but no matching handler was found.");this.handlers.splice(t,1)},e.prototype.start=function(){this.receiveWindow.addEventListener("message",this.windowMessageHandler)},e.prototype.stop=function(){this.receiveWindow.removeEventListener("message",this.windowMessageHandler)},e.prototype.postMessage=function(t,r){var n={id:e.createRandomString()};this.addTrackingProperties(r,n),this.logMessages&&(console.log(this.name+" Posting message:"),console.log(JSON.stringify(r,null,"  "))),t.postMessage(r,"*");var i=e.createDeferred();return this.pendingRequestPromises[n.id]=i,i.promise},e.prototype.sendResponse=function(e,t,r){this.addTrackingProperties(t,r),this.logMessages&&(console.log(this.name+" Sending response:"),console.log(JSON.stringify(t,null,"  "))),e.postMessage(t,"*")},e.prototype.onMessageReceived=function(e){var t=this;this.logMessages&&(console.log(this.name+" Received message:"),console.log("type: "+e.type),console.log(JSON.stringify(e.data,null,"  ")));var r=this.eventSourceOverrideWindow||e.source,n=e.data;if("object"==typeof n){var i,o;try{i=this.getTrackingProperties(n)}catch(e){this.suppressWarnings||console.warn("Proxy("+this.name+"): Error occurred when attempting to get tracking properties from incoming message:",JSON.stringify(n,null,"  "),"Error: ",e)}if(i&&(o=this.pendingRequestPromises[i.id]),o){var s=!0;try{s=this.isErrorMessage(n)}catch(e){console.warn("Proxy("+this.name+") Error occurred when trying to determine if message is consider an error response. Message: ",JSON.stringify(n,null,""),"Error: ",e)}s?o.reject(n):o.resolve(n),delete this.pendingRequestPromises[i.id]}else{this.handlers.some(function(e){var o=!1;try{o=e.test(n)}catch(e){t.suppressWarnings||console.warn("Proxy("+t.name+"): Error occurred when handler was testing incoming message:",JSON.stringify(n,null,"  "),"Error: ",e)}if(o){var s=void 0;try{s=Promise.resolve(e.handle(n))}catch(e){t.suppressWarnings||console.warn("Proxy("+t.name+"): Error occurred when handler was processing incoming message:",JSON.stringify(n,null,"  "),"Error: ",e),s=Promise.resolve()}return s.then(function(e){if(!e){var o="Handler for message: "+JSON.stringify(n,null,"  ")+" did not return a response message. The default response message will be returned instead.";t.suppressWarnings||console.warn("Proxy("+t.name+"): "+o),e={warning:o}}t.sendResponse(r,e,i)}),!0}})||this.suppressWarnings||console.warn("Proxy("+this.name+") did not handle message. Handlers: "+this.handlers.length+"  Message: "+JSON.stringify(n,null,"")+".")}}else this.suppressWarnings||console.warn("Proxy("+this.name+"): Received message that was not an object. Discarding message")},e.messagePropertyName="windowPostMessageProxy",e}();t.WindowPostMessageProxy=r}])},e.exports=n()},function(e,t,r){var n;n=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return r.m=e,r.c=t,r.p="",r(0)}([function(e,t){"use strict";var r=function(){function e(e,t,r){void 0===t&&(t={}),this.defaultHeaders=t,this.defaultTargetWindow=r,this.windowPostMessageProxy=e}return e.addTrackingProperties=function(e,t){return e.headers=e.headers||{},t&&t.id&&(e.headers.id=t.id),e},e.getTrackingProperties=function(e){return{id:e.headers&&e.headers.id}},e.isErrorMessage=function(e){return"number"==typeof(e&&e.statusCode)&&!(200<=e.statusCode&&e.statusCode<300)},e.prototype.get=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r=this.defaultTargetWindow),this.send({method:"GET",url:e,headers:t},r)},e.prototype.post=function(e,t,r,n){return void 0===r&&(r={}),void 0===n&&(n=this.defaultTargetWindow),this.send({method:"POST",url:e,headers:r,body:t},n)},e.prototype.put=function(e,t,r,n){return void 0===r&&(r={}),void 0===n&&(n=this.defaultTargetWindow),this.send({method:"PUT",url:e,headers:r,body:t},n)},e.prototype.patch=function(e,t,r,n){return void 0===r&&(r={}),void 0===n&&(n=this.defaultTargetWindow),this.send({method:"PATCH",url:e,headers:r,body:t},n)},e.prototype.delete=function(e,t,r,n){return void 0===t&&(t=null),void 0===r&&(r={}),void 0===n&&(n=this.defaultTargetWindow),this.send({method:"DELETE",url:e,headers:r,body:t},n)},e.prototype.send=function(e,t){if(void 0===t&&(t=this.defaultTargetWindow),e.headers=this.assign({},this.defaultHeaders,e.headers),!t)throw new Error("target window is not provided.  You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.");return this.windowPostMessageProxy.postMessage(t,e)},e.prototype.assign=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");var n=Object(e);return t.forEach(function(e){if(void 0!==e&&null!==e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}),n},e}();t.HttpPostMessage=r}])},e.exports=n()},function(e,t,r){var n;n=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return r.m=e,r.c=t,r.p="",r(0)}([function(e,t,r){"use strict";var n=r(1),i=function(){function e(e){this.handlers=e,this.getRouteRecognizer=new n,this.patchRouteRecognizer=new n,this.postRouteRecognizer=new n,this.putRouteRecognizer=new n,this.deleteRouteRecognizer=new n}return e.prototype.get=function(e,t){return this.registerHandler(this.getRouteRecognizer,"GET",e,t),this},e.prototype.patch=function(e,t){return this.registerHandler(this.patchRouteRecognizer,"PATCH",e,t),this},e.prototype.post=function(e,t){return this.registerHandler(this.postRouteRecognizer,"POST",e,t),this},e.prototype.put=function(e,t){return this.registerHandler(this.putRouteRecognizer,"PUT",e,t),this},e.prototype.delete=function(e,t){return this.registerHandler(this.deleteRouteRecognizer,"DELETE",e,t),this},e.prototype.registerHandler=function(e,t,r,n){e.add([{path:r,handler:function(e){var t=new o;return Promise.resolve(n(e,t)).then(function(e){return t})}}]);var i={test:function(r){if(r.method!==t)return!1;var n=e.recognize(r.url);if(void 0===n)return!1;var i=n[0];return r.params=i.params,r.queryParams=n.queryParams,r.handler=i.handler,!0},handle:function(e){return e.handler(e)}};this.handlers.addHandler(i)},e}();t.Router=i;var o=function(){function e(){this.statusCode=200,this.headers={},this.body=null}return e.prototype.send=function(e,t){this.statusCode=e,this.body=t},e}();t.Response=o},function(e,t,r){var n;(function(e){(function(){"use strict";function i(e,t,r){this.path=e,this.matcher=t,this.delegate=r}function o(e){this.routes={},this.children={},this.target=e}function s(e,t,r){return function(n,o){var a=e+n;if(!o)return new i(e+n,t,r);o(s(a,t,r))}}function a(e,t,r){for(var n=0,i=0;i<e.length;i++)n+=e[i].path.length;var o={path:t=t.substr(n),handler:r};e.push(o)}i.prototype={to:function(e,t){var r=this.delegate;if(r&&r.willAddRoute&&(e=r.willAddRoute(this.matcher.target,e)),this.matcher.add(this.path,e),t){if(0===t.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,e,t,this.delegate)}return this}},o.prototype={add:function(e,t){this.routes[e]=t},addChild:function(e,t,r,n){var i=new o(t);this.children[e]=i;var a=s(e,i,n);n&&n.contextEntered&&n.contextEntered(t,a),r(a)}};var c=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\"].join("|\\")+")","g");function h(e){this.string=e}function u(e){this.name=e}function d(e){this.name=e}function p(){}function f(e,t,r){"/"===e.charAt(0)&&(e=e.substr(1));var n=e.split("/"),i=new Array(n.length);r.val="";for(var o=0;o<n.length;o++){var s,a=n[o];(s=a.match(/^:([^\/]+)$/))?(i[o]=new u(s[1]),t.push(s[1]),r.val+="3"):(s=a.match(/^\*([^\/]+)$/))?(i[o]=new d(s[1]),r.val+="1",t.push(s[1])):""===a?(i[o]=new p,r.val+="2"):(i[o]=new h(a),r.val+="4")}return r.val=+r.val,i}function l(e){this.charSpec=e,this.nextStates=[],this.charSpecs={},this.regex=void 0,this.handlers=void 0,this.specificity=void 0}function m(e,t){for(var r=[],n=0,i=e.length;n<i;n++){var o=e[n];r=r.concat(o.match(t))}return r}h.prototype={eachChar:function(e){for(var t,r=this.string,n=0;n<r.length;n++)t=r.charAt(n),e=e.put({invalidChars:void 0,repeat:!1,validChars:t});return e},regex:function(){return this.string.replace(c,"\\$1")},generate:function(){return this.string}},u.prototype={eachChar:function(e){return e.put({invalidChars:"/",repeat:!0,validChars:void 0})},regex:function(){return"([^/]+)"},generate:function(e){return e[this.name]}},d.prototype={eachChar:function(e){return e.put({invalidChars:"",repeat:!0,validChars:void 0})},regex:function(){return"(.+)"},generate:function(e){return e[this.name]}},p.prototype={eachChar:function(e){return e},regex:function(){return""},generate:function(){return""}},l.prototype={get:function(e){if(this.charSpecs[e.validChars])return this.charSpecs[e.validChars];for(var t=this.nextStates,r=0;r<t.length;r++){var n=t[r],i=n.charSpec.validChars===e.validChars;if(i=i&&n.charSpec.invalidChars===e.invalidChars)return this.charSpecs[e.validChars]=n,n}},put:function(e){var t;return(t=this.get(e))?t:(t=new l(e),this.nextStates.push(t),e.repeat&&t.nextStates.push(t),t)},match:function(e){for(var t,r,n,i=this.nextStates,o=[],s=0;s<i.length;s++)void 0!==(n=(r=(t=i[s]).charSpec).validChars)?-1!==n.indexOf(e)&&o.push(t):void 0!==(n=r.invalidChars)&&-1===n.indexOf(e)&&o.push(t);return o}};var g=Object.create||function(e){function t(){}return t.prototype=e,new t};function y(e){this.queryParams=e||{}}function v(e){var t;e=e.replace(/\+/gm,"%20");try{t=decodeURIComponent(e)}catch(e){t=""}return t}y.prototype=g({splice:Array.prototype.splice,slice:Array.prototype.slice,push:Array.prototype.push,length:0,queryParams:null});var b=function(){this.rootState=new l,this.names={}};(b.prototype={add:function(e,t){for(var r,n=this.rootState,i="^",o={},s=new Array(e.length),a=[],c=!0,h=0;h<e.length;h++){var u=e[h],d=[],l=f(u.path,d,o);a=a.concat(l);for(var m=0;m<l.length;m++){var g=l[m];g instanceof p||(c=!1,n=n.put({invalidChars:void 0,repeat:!1,validChars:"/"}),i+="/",n=g.eachChar(n),i+=g.regex())}var y={handler:u.handler,names:d};s[h]=y}c&&(n=n.put({invalidChars:void 0,repeat:!1,validChars:"/"}),i+="/"),n.handlers=s,n.regex=new RegExp(i+"$"),n.specificity=o,(r=t&&t.as)&&(this.names[r]={segments:a,handlers:s})},handlersFor:function(e){var t=this.names[e];if(!t)throw new Error("There is no route named "+e);for(var r=new Array(t.handlers.length),n=0;n<t.handlers.length;n++)r[n]=t.handlers[n];return r},hasRoute:function(e){return!!this.names[e]},generate:function(e,t){var r=this.names[e],n="";if(!r)throw new Error("There is no route named "+e);for(var i=r.segments,o=0;o<i.length;o++){var s=i[o];s instanceof p||(n+="/",n+=s.generate(t))}return"/"!==n.charAt(0)&&(n="/"+n),t&&t.queryParams&&(n+=this.generateQueryString(t.queryParams,r.handlers)),n},generateQueryString:function(e,t){var r,n=[],i=[];for(var o in e)e.hasOwnProperty(o)&&i.push(o);i.sort();for(var s=0;s<i.length;s++){var a=e[o=i[s]];if(null!=a){var c=encodeURIComponent(o);if(r=a,"[object Array]"===Object.prototype.toString.call(r))for(var h=0;h<a.length;h++){var u=o+"[]="+encodeURIComponent(a[h]);n.push(u)}else c+="="+encodeURIComponent(a),n.push(c)}}return 0===n.length?"":"?"+n.join("&")},parseQueryString:function(e){for(var t=e.split("&"),r={},n=0;n<t.length;n++){var i,o=t[n].split("="),s=v(o[0]),a=s.length,c=!1;1===o.length?i="true":(a>2&&"[]"===s.slice(a-2)&&(c=!0,r[s=s.slice(0,a-2)]||(r[s]=[])),i=o[1]?v(o[1]):""),c?r[s].push(i):r[s]=i}return r},recognize:function(e){var t,r,n,i=[this.rootState],o={},s=!1;if(-1!==(n=e.indexOf("?"))){var a=e.substr(n+1,e.length);e=e.substr(0,n),o=this.parseQueryString(a)}for("/"!==(e=decodeURI(e)).charAt(0)&&(e="/"+e),(t=e.length)>1&&"/"===e.charAt(t-1)&&(e=e.substr(0,t-1),s=!0),r=0;r<e.length&&(i=m(i,e.charAt(r))).length;r++);var c=[];for(r=0;r<i.length;r++)i[r].handlers&&c.push(i[r]);i=function(e){return e.sort(function(e,t){return t.specificity.val-e.specificity.val})}(c);var h=c[0];if(h&&h.handlers)return s&&"(.+)$"===h.regex.source.slice(-5)&&(e+="/"),function(e,t,r){var n=e.handlers,i=e.regex,o=t.match(i),s=1,a=new y(r);a.length=n.length;for(var c=0;c<n.length;c++){for(var h=n[c],u=h.names,d={},p=0;p<u.length;p++)d[u[p]]=o[s++];a[c]={handler:h.handler,params:d,isDynamic:!!u.length}}return a}(h,e,o)}}).map=function(e,t){var r=new o;e(s("",r,this.delegate)),function e(t,r,n,i){var o=r.routes;for(var s in o)if(o.hasOwnProperty(s)){var c=t.slice();a(c,s,o[s]),r.children[s]?e(c,r.children[s],n,i):n.call(i,c)}}([],r,function(e){t?t(this,e):this.add(e)},this)},b.VERSION="0.1.11";var w=b;r(3).amd?void 0===(n=function(){return w}.call(t,r,t,e))||(e.exports=n):void 0!==e&&e.exports?e.exports=w:void 0!==this&&(this.RouteRecognizer=w)}).call(this)}).call(t,r(2)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}}])},e.exports=n()}])});;!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["powerbi-client"]=t():e["powerbi-client"]=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){var n=r(1);t.service=n;var i=r(10);t.factories=i;var o=r(5);t.models=o;var s=r(4);t.Report=s.Report;var a=r(9);t.Tile=a.Tile;var c=r(2);t.Embed=c.Embed;var h=r(6);t.Page=h.Page;var u=new n.Service(i.hpmFactory,i.wpmpFactory,i.routerFactory);window.powerbi=u},function(e,t,r){var n=r(2),i=r(4),o=r(7),s=r(8),a=r(9),c=r(6),h=r(3),u=function(){function e(t,r,n,i){var o=this;void 0===i&&(i={}),this.wpmp=r(i.wpmpName,i.logMessages),this.hpm=t(this.wpmp,null,i.version,i.type),this.router=n(this.wpmp),this.router.post("/reports/:uniqueId/events/:eventName",function(e,t){var r={type:"report",id:e.params.uniqueId,name:e.params.eventName,value:e.body};o.handleEvent(r)}),this.router.post("/reports/:uniqueId/pages/:pageName/events/:eventName",function(e,t){var r={type:"report",id:e.params.uniqueId,name:e.params.eventName,value:e.body};o.handleEvent(r)}),this.router.post("/dashboards/:uniqueId/events/:eventName",function(e,t){var r={type:"dashboard",id:e.params.uniqueId,name:e.params.eventName,value:e.body};o.handleEvent(r)}),this.embeds=[],this.config=h.assign({},e.defaultConfig,i),this.config.autoEmbedOnContentLoaded&&this.enableAutoEmbed()}return e.prototype.createReport=function(e,t){t.type="create";var r=e,n=new o.Create(this,r,t);return r.powerBiEmbed=n,this.addOrOverwriteEmbed(n,e),n},e.prototype.init=function(e,t){var r=this;return void 0===t&&(t=void 0),e=e&&e instanceof HTMLElement?e:document.body,Array.prototype.slice.call(e.querySelectorAll("["+n.Embed.embedUrlAttribute+"]")).map(function(e){return r.embed(e,t)})},e.prototype.embed=function(e,t){void 0===t&&(t={});var r=e;return r.powerBiEmbed?this.embedExisting(r,t):this.embedNew(r,t)},e.prototype.embedNew=function(t,r){var o=r.type||t.getAttribute(n.Embed.typeAttribute);if(!o)throw new Error("Attempted to embed using config "+JSON.stringify(r)+" on element "+t.outerHTML+", but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '"+n.Embed.typeAttribute+'="'+i.Report.type.toLowerCase()+"\"'.");r.type=o;var s=h.find(function(e){return o===e.type.toLowerCase()},e.components);if(!s)throw new Error("Attempted to embed component of type: "+o+" but did not find any matching component.  Please verify the type you specified is intended.");var a=new s(this,t,r);return t.powerBiEmbed=a,this.addOrOverwriteEmbed(a,t),a},e.prototype.embedExisting=function(e,t){var r=h.find(function(t){return t.element===e},this.embeds);if(!r)throw new Error("Attempted to embed using config "+JSON.stringify(t)+" on element "+e.outerHTML+" which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.");if("string"==typeof t.type&&t.type!==r.config.type){if("report"===t.type&&"create"===r.config.type){var n=new i.Report(this,e,t,e.powerBiEmbed.iframe);return n.load(t),e.powerBiEmbed=n,this.addOrOverwriteEmbed(r,e),n}throw new Error("Embedding on an existing element with a different type than the previous embed object is not supported.  Attempted to embed using config "+JSON.stringify(t)+" on element "+e.outerHTML+", but the existing element contains an embed of type: "+this.config.type+" which does not match the new type: "+t.type)}return r.load(t),r},e.prototype.enableAutoEmbed=function(){var e=this;window.addEventListener("DOMContentLoaded",function(t){return e.init(document.body)},!1)},e.prototype.get=function(e){var t=e;if(!t.powerBiEmbed)throw new Error("You attempted to get an instance of powerbi component associated with element: "+e.outerHTML+" but there was no associated instance.");return t.powerBiEmbed},e.prototype.find=function(e){return h.find(function(t){return t.config.uniqueId===e},this.embeds)},e.prototype.addOrOverwriteEmbed=function(e,t){this.embeds=this.embeds.filter(function(e){return e.element.id!==t.id}),this.embeds.push(e)},e.prototype.reset=function(e){var t=e;if(t.powerBiEmbed){h.remove(function(e){return e===t.powerBiEmbed},this.embeds),delete t.powerBiEmbed;var r=e.querySelector("iframe");r&&r.remove()}},e.prototype.handleEvent=function(e){var t=h.find(function(t){return t.config.uniqueId===e.id},this.embeds);if(t){var r=e.value;if("pageChanged"===e.name){var n="newPage",i=r[n];if(!i)throw new Error("Page model not found at 'event.value."+n+"'.");r[n]=new c.Page(t,i.name,i.displayName)}h.raiseCustomEvent(t.element,e.name,r)}},e.components=[a.Tile,i.Report,s.Dashboard],e.defaultConfig={autoEmbedOnContentLoaded:!1,onError:function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return console.log(e[0],e.slice(1))}},e}();t.Service=u},function(e,t,r){var n=r(3),i=function(){function e(t,r,n,i){this.allowedEvents=[],Array.prototype.push.apply(this.allowedEvents,e.allowedEvents),this.eventHandlers=[],this.service=t,this.element=r,this.iframe=i,this.embeType=n.type.toLowerCase(),this.populateConfig(n),"create"===this.embeType?this.setIframe(!1):this.setIframe(!0)}return e.prototype.createReport=function(e){var t=this.validate(e);if(t)throw t;return this.service.hpm.post("/report/create",e,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body},function(e){throw e.body})},e.prototype.save=function(){return this.service.hpm.post("/report/save",null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body}).catch(function(e){throw e.body})},e.prototype.saveAs=function(e){return this.service.hpm.post("/report/saveAs",e,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body}).catch(function(e){throw e.body})},e.prototype.load=function(e){var t=this,r=this.validate(e);if(r)throw r;return this.service.hpm.post(this.loadPath,e,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(r){return n.assign(t.config,e),r.body},function(e){throw e.body})},e.prototype.off=function(e,t){var r=this,i={name:e,type:null,id:null,value:null};t?(n.remove(function(e){return e.test(i)&&e.handle===t},this.eventHandlers),this.element.removeEventListener(e,t)):this.eventHandlers.filter(function(e){return e.test(i)}).forEach(function(t){n.remove(function(e){return e===t},r.eventHandlers),r.element.removeEventListener(e,t.handle)})},e.prototype.on=function(e,t){if(-1===this.allowedEvents.indexOf(e))throw new Error("eventName is must be one of "+this.allowedEvents+". You passed: "+e);this.eventHandlers.push({test:function(t){return t.name===e},handle:t}),this.element.addEventListener(e,t)},e.prototype.reload=function(){return this.load(this.config)},e.prototype.setAccessToken=function(e){return this.service.hpm.post("/report/token",e,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body}).catch(function(e){throw e.body})},e.prototype.getAccessToken=function(t){var r=this.config.accessToken||this.element.getAttribute(e.accessTokenAttribute)||t;if(!r)throw new Error("No access token was found for element. You must specify an access token directly on the element using attribute '"+e.accessTokenAttribute+"' or specify a global token at: powerbi.accessToken.");return r},e.prototype.populateConfig=function(t){var r=n.assign({},e.defaultSettings,t.settings);this.config=n.assign({settings:r},t),this.config.uniqueId=this.getUniqueId(),this.config.embedUrl=this.getEmbedUrl(),"create"===this.embeType?this.createConfig={datasetId:t.datasetId||this.getId(),accessToken:this.getAccessToken(this.service.accessToken),settings:r}:(this.config.id=this.getId(),this.config.accessToken=this.getAccessToken(this.service.accessToken))},e.prototype.getEmbedUrl=function(){var t=this.config.embedUrl||this.element.getAttribute(e.embedUrlAttribute);if("string"!=typeof t||0===t.length)throw new Error("Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '"+e.embedUrlAttribute+"'.");return t},e.prototype.getUniqueId=function(){return this.config.uniqueId||this.element.getAttribute(e.nameAttribute)||n.createRandomString()},e.prototype.fullscreen=function(){(this.iframe.requestFullscreen||this.iframe.msRequestFullscreen||this.iframe.mozRequestFullScreen||this.iframe.webkitRequestFullscreen).call(this.iframe)},e.prototype.exitFullscreen=function(){this.isFullscreen(this.iframe)&&(document.exitFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.msExitFullscreen).call(document)},e.prototype.isFullscreen=function(e){return["fullscreenElement","webkitFullscreenElement","mozFullscreenScreenElement","msFullscreenElement"].some(function(t){return document[t]===e})},e.prototype.setIframe=function(e){var t=this;if(!this.iframe){var r='<iframe style="width:100%;height:100%;" src="'+this.config.embedUrl+'" scrolling="no" allowfullscreen="true"></iframe>';this.element.innerHTML=r,this.iframe=this.element.childNodes[0]}e?this.iframe.addEventListener("load",function(){return t.load(t.config)},!1):this.iframe.addEventListener("load",function(){return t.createReport(t.createConfig)},!1)},e.allowedEvents=["loaded","saved","rendered","saveAsTriggered","error","dataSelected"],e.accessTokenAttribute="powerbi-access-token",e.embedUrlAttribute="powerbi-embed-url",e.nameAttribute="powerbi-name",e.typeAttribute="powerbi-type",e.defaultSettings={filterPaneEnabled:!0},e}();t.Embed=i},function(e,t){function r(e,t){if(!Array.isArray(t))throw new Error("You attempted to call find with second parameter that was not an array. You passed: "+t);var r;return t.some(function(t,n){if(e(t))return r=n,!0}),r}t.raiseCustomEvent=function(e,t,r){var n;"function"==typeof CustomEvent?n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,r),e.dispatchEvent(n)},t.findIndex=r,t.find=function(e,t){return t[r(e,t)]},t.remove=function(e,t){var n=r(e,t);t.splice(n,1)},t.assign=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];var r=e[0];if(void 0===r||null===r)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(r),i=1;i<arguments.length;i++){var o=arguments[i];if(void 0!==o&&null!==o)for(var s in o)o.hasOwnProperty(s)&&(n[s]=o[s])}return n},t.createRandomString=function(){return(Math.random()+1).toString(36).substring(7)}},function(e,t,r){var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=r(2),o=r(5),s=r(3),a=r(6),c=function(e){function t(r,n,i,o){var a=i.settings&&i.settings.filterPaneEnabled||!("false"===n.getAttribute(t.filterPaneEnabledAttribute)),c=i.settings&&i.settings.navContentPaneEnabled||!("false"===n.getAttribute(t.navContentPaneEnabledAttribute)),h=s.assign({filterPaneEnabled:a,navContentPaneEnabled:c},i.settings),u=s.assign({settings:h},i);e.call(this,r,n,u,o),this.loadPath="/report/load",Array.prototype.push.apply(this.allowedEvents,t.allowedEvents)}return n(t,e),t.findIdFromEmbedUrl=function(e){var t,r=e.match(/reportId="?([^&]+)"?/);return r&&(t=r[1]),t},t.prototype.getFilters=function(){return this.service.hpm.get("/report/filters",{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body},function(e){throw e.body})},t.prototype.getId=function(){var e=this.config.id||this.element.getAttribute(t.reportIdAttribute)||t.findIdFromEmbedUrl(this.config.embedUrl);if("string"!=typeof e||0===e.length)throw new Error("Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '"+t.reportIdAttribute+"'.");return e},t.prototype.getPages=function(){var e=this;return this.service.hpm.get("/report/pages",{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(t){return t.body.map(function(t){return new a.Page(e,t.name,t.displayName)})},function(e){throw e.body})},t.prototype.page=function(e,t){return new a.Page(this,e,t)},t.prototype.print=function(){return this.service.hpm.post("/report/print",null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body}).catch(function(e){throw e.body})},t.prototype.removeFilters=function(){return this.setFilters([])},t.prototype.setPage=function(e){var t={name:e,displayName:null};return this.service.hpm.put("/report/pages/active",t,{uid:this.config.uniqueId},this.iframe.contentWindow).catch(function(e){throw e.body})},t.prototype.setFilters=function(e){return this.service.hpm.put("/report/filters",e,{uid:this.config.uniqueId},this.iframe.contentWindow).catch(function(e){throw e.body})},t.prototype.updateSettings=function(e){return this.service.hpm.patch("/report/settings",e,{uid:this.config.uniqueId},this.iframe.contentWindow).catch(function(e){throw e.body})},t.prototype.validate=function(e){return o.validateReportLoad(e)},t.prototype.switchMode=function(e){var t="/report/switchMode/"+e;return this.service.hpm.post(t,null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body}).catch(function(e){throw e.body})},t.prototype.refresh=function(){return this.service.hpm.post("/report/refresh",null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body}).catch(function(e){throw e.body})},t.allowedEvents=["filtersApplied","pageChanged"],t.reportIdAttribute="powerbi-report-id",t.filterPaneEnabledAttribute="powerbi-settings-filter-pane-enabled",t.navContentPaneEnabledAttribute="powerbi-settings-nav-content-pane-enabled",t.typeAttribute="powerbi-type",t.type="Report",t}(i.Embed);t.Report=c},function(e,t,r){e.exports=function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){function n(e){var t=e.message;return t||(t=e.path+" is invalid. Not meeting "+e.keyword+" constraint"),{message:t}}function i(e,t){return function(r){var i=c(e,t),o=i(r);return o?void 0:i.errors.map(n)}}function o(e){var t=e,r=e;return"string"==typeof t.operator&&Array.isArray(t.values)?h.Basic:"string"==typeof r.logicalOperator&&Array.isArray(r.conditions)?h.Advanced:h.Unknown}function s(e){return void 0!==e.table&&void 0!==e.column}var a=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};t.advancedFilterSchema=r(1),t.filterSchema=r(2),t.loadSchema=r(3),t.dashboardLoadSchema=r(4),t.pageSchema=r(5),t.settingsSchema=r(6),t.basicFilterSchema=r(7),t.createReportSchema=r(8),t.saveAsParametersSchema=r(9);var c=r(10);t.validateSettings=i(t.settingsSchema,{schemas:{basicFilter:t.basicFilterSchema,advancedFilter:t.advancedFilterSchema}}),t.validateReportLoad=i(t.loadSchema,{schemas:{settings:t.settingsSchema,basicFilter:t.basicFilterSchema,advancedFilter:t.advancedFilterSchema}}),t.validateCreateReport=i(t.createReportSchema),t.validateDashboardLoad=i(t.dashboardLoadSchema),t.validatePage=i(t.pageSchema),t.validateFilter=i(t.filterSchema,{schemas:{basicFilter:t.basicFilterSchema,advancedFilter:t.advancedFilterSchema}}),function(e){e[e.Advanced=0]="Advanced",e[e.Basic=1]="Basic",e[e.Unknown=2]="Unknown"}(t.FilterType||(t.FilterType={}));var h=t.FilterType;t.isFilterKeyColumnsTarget=function(e){return s(e)&&!!e.keys},t.isBasicFilterWithKeys=function(e){return o(e)===h.Basic&&!!e.keyValues},t.getFilterType=o,t.isMeasure=function(e){return void 0!==e.table&&void 0!==e.measure},t.isColumn=s,t.isHierarchy=function(e){return void 0!==e.table&&void 0!==e.hierarchy&&void 0!==e.hierarchyLevel};var u=function(){function e(e){this.target=e}return e.prototype.toJSON=function(){return{$schema:this.schemaUrl,target:this.target}},e}();t.Filter=u;var d=function(e){function t(r,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];if(e.call(this,r),this.operator=n,this.schemaUrl=t.schemaUrl,0===i.length&&"All"!==n)throw new Error('values must be a non-empty array unless your operator is "All".');Array.isArray(i[0])?this.values=i[0]:this.values=i}return a(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.operator=this.operator,t.values=this.values,t},t.schemaUrl="http://powerbi.com/product/schema#basic",t}(u);t.BasicFilter=d;var p=function(e){function t(t,r,n,i){e.call(this,t,r,n),this.keyValues=i,this.target=t;var o=t.keys?t.keys.length:0;if(o>0&&!i)throw new Error("You shold pass the values to be filtered for each key. You passed: no values and "+o+" keys");if(0===o&&i&&i.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var s=0;s<this.keyValues.length;s++)if(this.keyValues[s]){var a=this.keyValues[s].length;if(a!==o)throw new Error("Each tuple of key values should contain a value for each of the keys. You passed: "+a+" values and "+o+" keys")}}return a(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.keyValues=this.keyValues,t},t}(d);t.BasicFilterWithKeys=p;var f=function(e){function t(r,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];if(e.call(this,r),this.schemaUrl=t.schemaUrl,"string"!=typeof n||0===n.length)throw new Error("logicalOperator must be a valid operator, You passed: "+n);var s;if(this.logicalOperator=n,0===(s=Array.isArray(i[0])?i[0]:i).length)throw new Error("conditions must be a non-empty array. You passed: "+i);if(s.length>2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+i.length);if(1===s.length&&"And"!==n)throw new Error('Logical Operator must be "And" when there is only one condition provided');this.conditions=s}return a(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.logicalOperator=this.logicalOperator,t.conditions=this.conditions,t},t.schemaUrl="http://powerbi.com/product/schema#advanced",t}(u);t.AdvancedFilter=f,function(e){e[e.Read=0]="Read",e[e.ReadWrite=1]="ReadWrite",e[e.Copy=2]="Copy",e[e.Create=4]="Create",e[e.All=7]="All"}(t.Permissions||(t.Permissions={})),t.Permissions,function(e){e[e.View=0]="View",e[e.Edit=1]="Edit"}(t.ViewMode||(t.ViewMode={})),t.ViewMode,t.validateSaveAsParameters=i(t.saveAsParametersSchema)},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{oneOf:[{type:"object",properties:{table:{type:"string"},column:{type:"string"}},required:["table","column"]},{type:"object",properties:{table:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"}},required:["table","hierarchy","hierarchyLevel"]},{type:"object",properties:{table:{type:"string"},measure:{type:"string"}},required:["table","measure"]}]},logicalOperator:{type:"string"},conditions:{type:"array",items:{type:"object",properties:{value:{type:["string","boolean","number"]},operator:{type:"string"}},required:["value","operator"]}}},required:["target","logicalOperator","conditions"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}],invalidMessage:"filter is invalid"}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},settings:{$ref:"#settings"},pageName:{type:"string",messages:{type:"pageName must be a string"}},filters:{type:"array",items:{type:"object",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}]},invalidMessage:"filters property is invalid"},permissions:{type:"number",enum:[0,1,2,4,7],default:0,invalidMessage:"permissions property is invalid"},viewMode:{type:"number",enum:[0,1],default:0,invalidMessage:"viewMode property is invalid"}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},pageView:{type:"string",messages:{type:'pageView must be a string with one of the following values: "actualSize", "fitToWidth", "oneColumn"'}}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{filterPaneEnabled:{type:"boolean",messages:{type:"filterPaneEnabled must be a boolean"}},navContentPaneEnabled:{type:"boolean",messages:{type:"navContentPaneEnabled must be a boolean"}},useCustomSaveAsDialog:{type:"boolean",messages:{type:"useCustomSaveAsDialog must be a boolean"}}}}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{type:"object",properties:{table:{type:"string"},column:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"},measure:{type:"string"}},required:["table"]},operator:{type:"string"},values:{type:"array",items:{type:["string","boolean","number"]}}},required:["target","operator","values"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},datasetId:{type:"string",messages:{type:"datasetId must be a string",required:"datasetId is required"}}},required:["accessToken","datasetId"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t,r){e.exports=r(11)},function(e,t,r){"use strict";function n(e){return e=e instanceof RegExp?e:new RegExp(e),w?e.toString():"/"+e.source.replace(m,"\\$&")+"/"}function i(e){return'"'+e.replace(g,"\\$1")+'"'}function o(e,t){return y.lastIndex=0,y.test(t)?e+"."+t:e+"["+i(t)+"]"}function s(e){if(void 0===e)return"undefined";var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function a(e){return(0|e)===e}function c(e,t){C[t].type=e,C[t].keyword=t}function h(e,t){var r,n,i=e.substr(4),o=i.length,s=[],a="",c=!1;for(n=0;n<o;n++)switch(r=i[n]){case".":a&&(a+=r);break;case"[":isNaN(+i[n+1])?(c=!0,a&&(s.push('"'+a+'"'),a="")):(c=!1,a&&(a+="."));break;case"]":s.push(c?a:'"'+a+'"'),a="";break;default:a+=r}return a&&s.push('"'+a+'"'),t&&s.push('"'+t+'"'),1===s.length&&c?'"" + '+s[0]+' + ""':s.join(' + "." + ')||'""'}function u(e){var t,r,n,i,o=e,a=s(e);if("object"===a)for(o={},t=Object.keys(e),i=0,r=t.length;i<r;i++)n=t[i],o[n]=u(e[n]);else if("array"===a)for(o=[],i=0,r=e.length;i<r;i++)o[i]=u(e[i]);else{if("regexp"===a)return new RegExp(e);if("date"===a)return new Date(e.toJSON())}return o}function d(e,t){for(var r=0,n=t.length;r<n;r++)if(A(e,t[r]))return!0;return!1}function p(){this.objects=[],this.properties=[]}function f(e){this.path="data",this.schema=e.schema,this.formats=e.formats,this.greedy=e.greedy,this.resolver=e.resolver,this.id=e.id,this.funcache=e.funcache||{},this.scope=e.scope||{equalAny:d,unique:E,ucs2length:j,refs:{}}}function l(e,t){if("object"!==s(e))throw new Error(v);var r=0,n=new O(e,(t=t||{}).schemas,t.missing$Ref||!1),i=new f({schema:e,resolver:n,id:function(){return"i"+r++},schemas:t.schemas,formats:t.formats,greedy:t.greedy||!1}),o=x("validate","data")("validate.errors = []")('gen(data, "", validate.errors)')("return validate.errors.length === 0").compile({gen:i.compile()});return i.dispose(),i=null,o.errors=[],o.build=function(t,r){return function e(t,r,n,i,o){var a,c,h,d,f,l,m;if("object"!==s(t))return r;if(t=i.resolve(t),void 0===r&&t.hasOwnProperty("default")&&(r=u(t.default)),"object"===(a=s(r))&&"object"===s(t.properties)){for(l=Object.keys(t.properties),d=0;d<l.length;d++)h=l[d],void 0!==(c=e(t.properties[h],r[h],n,i))&&(r[h]=c);if("always"!==n)for(m=Object.keys(r),d=0;d<m.length;d++)h=m[d],l.indexOf(h)<0&&(!1===t.additionalProperties||!1===n&&!t.additionalProperties)&&(o?o.mark(r,h):delete r[h])}else if("array"===a&&t.items){if("array"===s(t.items))for(d=0;d<t.items.length;d++)(void 0!==(c=e(t.items[d],r[d],n,i))||d<r.length)&&(r[d]=c);else if(r.length)for(d=0;d<r.length;d++)r[d]=e(t.items,r[d],n,i)}else if("array"===s(t.allOf)&&t.allOf.length){for(f=new p,d=0;d<t.allOf.length;d++)r=e(t.allOf[d],r,n,i,f);f.deleteDuplicates(),f.dispose()}return r}(e,r&&!1===r.copy?t:u(t),r&&r.additionalProperties,n)},o}var m=/[\/]/g,g=/(")/gim,y=/^[a-z_$][0-9a-z]*$/gi,v="jsen: invalid schema object",b="object"==typeof window&&!!window.navigator,w="/"!==new RegExp("/").source,x=r(12),A=r(13),E=r(14),O=r(15),P=r(24),j=r(25),I={},C={};I.null=function(e){return e+" === null"},I.boolean=function(e){return"typeof "+e+' === "boolean"'},I.string=function(e){return"typeof "+e+' === "string"'},I.number=function(e){return"typeof "+e+' === "number"'},I.integer=function(e){return"typeof "+e+' === "number" && !('+e+" % 1)"},I.array=function(e){return"Array.isArray("+e+")"},I.object=function(e){return"typeof "+e+' === "object" && '+e+" !== null && !Array.isArray("+e+")"},I.date=function(e){return e+" instanceof Date"},C.enum=function(e){var t=e.schema.enum;e.code("if (!equalAny("+e.path+", "+JSON.stringify(t)+")) {"),e.error("enum"),e.code("}")},C.minimum=function(e){"number"==typeof e.schema.minimum&&(e.code("if ("+e.path+" < "+e.schema.minimum+") {"),e.error("minimum"),e.code("}"))},C.exclusiveMinimum=function(e){!0===e.schema.exclusiveMinimum&&"number"==typeof e.schema.minimum&&(e.code("if ("+e.path+" === "+e.schema.minimum+") {"),e.error("exclusiveMinimum"),e.code("}"))},C.maximum=function(e){"number"==typeof e.schema.maximum&&(e.code("if ("+e.path+" > "+e.schema.maximum+") {"),e.error("maximum"),e.code("}"))},C.exclusiveMaximum=function(e){!0===e.schema.exclusiveMaximum&&"number"==typeof e.schema.maximum&&(e.code("if ("+e.path+" === "+e.schema.maximum+") {"),e.error("exclusiveMaximum"),e.code("}"))},C.multipleOf=function(e){if("number"==typeof e.schema.multipleOf){var t=e.schema.multipleOf,r=t.toString().length-t.toFixed(0).length-1,n=r>0?Math.pow(10,r):1,i=e.path;r>0?e.code("if (+(Math.round(("+i+" * "+n+') + "e+" + '+r+') + "e-" + '+r+") % "+t*n+" !== 0) {"):e.code("if ((("+i+" * "+n+") % "+t*n+") !== 0) {"),e.error("multipleOf"),e.code("}")}},C.minLength=function(e){a(e.schema.minLength)&&(e.code("if (ucs2length("+e.path+") < "+e.schema.minLength+") {"),e.error("minLength"),e.code("}"))},C.maxLength=function(e){a(e.schema.maxLength)&&(e.code("if (ucs2length("+e.path+") > "+e.schema.maxLength+") {"),e.error("maxLength"),e.code("}"))},C.pattern=function(e){var t=e.schema.pattern;("string"==typeof t||t instanceof RegExp)&&(e.code("if (!("+n(t)+").test("+e.path+")) {"),e.error("pattern"),e.code("}"))},C.format=function(e){"string"==typeof e.schema.format&&P[e.schema.format]&&(e.code("if (!("+P[e.schema.format]+").test("+e.path+")) {"),e.error("format"),e.code("}"))},C.minItems=function(e){a(e.schema.minItems)&&(e.code("if ("+e.path+".length < "+e.schema.minItems+") {"),e.error("minItems"),e.code("}"))},C.maxItems=function(e){a(e.schema.maxItems)&&(e.code("if ("+e.path+".length > "+e.schema.maxItems+") {"),e.error("maxItems"),e.code("}"))},C.additionalItems=function(e){!1===e.schema.additionalItems&&Array.isArray(e.schema.items)&&(e.code("if ("+e.path+".length > "+e.schema.items.length+") {"),e.error("additionalItems"),e.code("}"))},C.uniqueItems=function(e){e.schema.uniqueItems&&(e.code("if (unique("+e.path+").length !== "+e.path+".length) {"),e.error("uniqueItems"),e.code("}"))},C.items=function(e){var t=e.declare(0),r=0;if("object"===s(e.schema.items))e.code("for ("+t+" = 0; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.items),e.code("}");else if(Array.isArray(e.schema.items)){for(;r<e.schema.items.length;r++)e.code("if ("+e.path+".length - 1 >= "+r+") {"),e.descend(e.path+"["+r+"]",e.schema.items[r]),e.code("}");"object"===s(e.schema.additionalItems)&&(e.code("for ("+t+" = "+r+"; "+t+" < "+e.path+".length; "+t+"++) {"),e.descend(e.path+"["+t+"]",e.schema.additionalItems),e.code("}"))}},C.maxProperties=function(e){a(e.schema.maxProperties)&&(e.code("if (Object.keys("+e.path+").length > "+e.schema.maxProperties+") {"),e.error("maxProperties"),e.code("}"))},C.minProperties=function(e){a(e.schema.minProperties)&&(e.code("if (Object.keys("+e.path+").length < "+e.schema.minProperties+") {"),e.error("minProperties"),e.code("}"))},C.required=function(e){if(Array.isArray(e.schema.required))for(var t=0;t<e.schema.required.length;t++)e.code("if ("+o(e.path,e.schema.required[t])+" === undefined) {"),e.error("required",e.schema.required[t]),e.code("}")},C.properties=function(e){var t,r,n,i=e.schema.properties,a="object"===s(i)?Object.keys(i):[],c=Array.isArray(e.schema.required)?e.schema.required:[];if(a.length)for(r=0;r<a.length;r++)t=a[r],n=o(e.path,t),e.code("if ("+n+" !== undefined) {"),e.descend(n,i[t]),e.code("}"),c.indexOf(t)>-1&&(e.code("else {"),e.error("required",t),e.code("}"))},C.patternProperties=C.additionalProperties=function(e){var t,r,i,o,a,c,h,u="object"===s(e.schema.properties)?Object.keys(e.schema.properties):[],d=e.schema.patternProperties,p="object"===s(d)?Object.keys(d):[],f=e.schema.additionalProperties,l=!1===f||"object"===s(f);if(p.length||l){for(r=e.declare("[]"),i=e.declare('""'),o=e.declare(0),l&&(a=e.declare(!1)),e.code(r+" = Object.keys("+e.path+")"),e.code("for ("+o+" = 0; "+o+" < "+r+".length; "+o+"++) {")(i+" = "+r+"["+o+"]")("if ("+e.path+"["+i+"] === undefined) {")("continue")("}"),l&&e.code(a+" = false"),h=0;h<p.length;h++)c=p[h],e.code("if (("+n(c)+").test("+i+")) {"),e.descend(e.path+"["+i+"]",d[c]),l&&e.code(a+" = true"),e.code("}");l&&(u.length&&(t=e.declare(JSON.stringify(u)),e.code("if ("+t+".indexOf("+i+") > -1) {")("continue")("}")),e.code("if (!"+a+") {"),!1===f?e.error("additionalProperties",void 0,i):e.descend(e.path+"["+i+"]",f),e.code("}")),e.code("}")}},C.dependencies=function(e){if("object"===s(e.schema.dependencies))for(var t,r,n=Object.keys(e.schema.dependencies),i=n.length,a=0,c=0;c<i;c++){if(t=n[c],r=e.schema.dependencies[t],e.code("if ("+o(e.path,t)+" !== undefined) {"),"object"===s(r))e.descend(e.path,r);else for(;a<r.length;a++)e.code("if ("+o(e.path,r[a])+" === undefined) {"),e.error("dependencies",r[a]),e.code("}");e.code("}")}},C.allOf=function(e){if(Array.isArray(e.schema.allOf))for(var t=0;t<e.schema.allOf.length;t++)e.descend(e.path,e.schema.allOf[t])},C.anyOf=function(e){if(Array.isArray(e.schema.anyOf)){var t=e.greedy,r=e.declare(0),n=e.declare(0),i=e.declare(!1),o=0;for(e.code(n+" = errors.length");o<e.schema.anyOf.length;o++)e.code("if (!"+i+") {"),e.code(r+" = errors.length"),e.greedy=!0,e.descend(e.path,e.schema.anyOf[o]),e.code(i+" = errors.length === "+r)("}");e.greedy=t,e.code("if (!"+i+") {"),e.error("anyOf"),e.code("} else {")("errors.length = "+n)("}")}},C.oneOf=function(e){if(Array.isArray(e.schema.oneOf)){var t=e.greedy,r=e.declare(0),n=e.declare(0),i=e.declare(0),o=0;for(e.code(n+" = errors.length"),e.code(r+" = 0");o<e.schema.oneOf.length;o++)e.code(i+" = errors.length"),e.greedy=!0,e.descend(e.path,e.schema.oneOf[o]),e.code("if (errors.length === "+i+") {")(r+"++")("}");e.greedy=t,e.code("if ("+r+" !== 1) {"),e.error("oneOf"),e.code("} else {")("errors.length = "+n)("}")}},C.not=function(e){if("object"===s(e.schema.not)){var t=e.greedy,r=e.declare(0);e.code(r+" = errors.length"),e.greedy=!0,e.descend(e.path,e.schema.not),e.greedy=t,e.code("if (errors.length === "+r+") {"),e.error("not"),e.code("} else {")("errors.length = "+r)("}")}},["minimum","exclusiveMinimum","maximum","exclusiveMaximum","multipleOf"].forEach(c.bind(null,"number")),["minLength","maxLength","pattern","format"].forEach(c.bind(null,"string")),["minItems","maxItems","additionalItems","uniqueItems","items"].forEach(c.bind(null,"array")),["maxProperties","minProperties","required","properties","patternProperties","additionalProperties","dependencies"].forEach(c.bind(null,"object")),["enum","allOf","anyOf","oneOf","not"].forEach(c.bind(null,null)),p.prototype.mark=function(e,t){var r,n=this.objects.indexOf(e);return n<0?(this.objects.push(e),(r={})[t]=1,void this.properties.push(r)):void((r=this.properties[n])[t]=r[t]?r[t]+1:1)},p.prototype.deleteDuplicates=function(){var e,t,r,n,i;for(n=0;n<this.properties.length;n++)for(e=this.properties[n],t=Object.keys(e),i=0;i<t.length;i++)r=t[i],e[r]>1&&delete this.objects[n][r]},p.prototype.dispose=function(){this.objects.length=0,this.properties.length=0},f.prototype.clone=function(e){var t=new f({schema:e,formats:this.formats,greedy:this.greedy,resolver:this.resolver,id:this.id,funcache:this.funcache,scope:this.scope});return t},f.prototype.declare=function(e){var t=this.id();return this.code.def(t,e),t},f.prototype.cache=function(e,t){var r,n=this.funcache[e];return n||(n=this.funcache[e]={key:this.id()},r=this.clone(t),n.func=r.compile(n.key),this.scope.refs[n.key]=n.func,r.dispose()),"refs."+n.key},f.prototype.error=function(e,t,r){var n=this.schema,o=this.path,s="data"!==o||t?'(path ? path + "." : "") + '+h(o,t)+",":"path,",a=t&&n.properties&&n.properties[t]?this.resolver.resolve(n.properties[t]):null,c=a?a.requiredMessage:n.invalidMessage;c||(c=a&&a.messages&&a.messages[e]||n.messages&&n.messages[e]),this.code("errors.push({"),c&&this.code("message: "+i(c)+","),r&&this.code("additionalProperties: "+r+","),this.code("path: "+s)("keyword: "+i(e))("})"),this.greedy||this.code("return")},f.prototype.refactor=function(e,t,r){var n="data"!==e?'(path ? path + "." : "") + '+h(e):"path",i=this.cache(r,t),o=this.declare();this.code(o+" = "+i+"("+e+", "+n+", errors)"),this.greedy||this.code("if (errors.length) { return }")},f.prototype.descend=function(e,t){var r=this.path,n=this.schema;this.path=e,this.schema=t,this.generate(),this.path=r,this.schema=n},f.prototype.generate=function(){function e(e){C[e](f)}var t,r,o,a,c,h,u,d=this.path,p=this.schema,f=this,l=this.scope;if("object"===s(p)){if(void 0!==p.$ref){if(p=this.resolver.resolve(p),this.resolver.hasRef(p))return void this.refactor(d,p,this.resolver.getNormalizedRef(this.schema)||this.schema.$ref);this.schema=p}if((o=function(e){var t,r,n,i=Object.keys(e),o=i.indexOf("properties"),s=i.indexOf("patternProperties"),a={enum:Array.isArray(e.enum)&&e.enum.length>0,type:null,allType:[],perType:{}};for(e.type&&("string"==typeof e.type?a.type=[e.type]:Array.isArray(e.type)&&e.type.length&&(a.type=e.type.slice(0))),n=0;n<i.length;n++)"enum"!==(t=i[n])&&"type"!==t&&(r=C[t])&&(r.type?(a.perType[r.type]||(a.perType[r.type]=[]),o>-1&&"required"===t||s>-1&&"additionalProperties"===t||a.perType[r.type].push(t)):a.allType.push(t));return a}(p)).enum)return void C.enum(f);for(a=Object.keys(o.perType),u=0;u<a.length;u++)h=a[u],this.code((u?"else ":"")+"if ("+I[h](d)+") {"),o.perType[h].forEach(e),this.code("}"),o.type&&(c=o.type.indexOf(h))>-1&&o.type.splice(c,1);o.type&&(o.type.length?(this.code((a.length?"else ":"")+"if (!("+o.type.map(function(e){return I[e]?I[e](d):"true"}).join(" || ")+")) {"),this.error("type"),this.code("}")):(this.code("else {"),this.error("type"),this.code("}"))),o.allType.forEach(function(e){C[e](f)}),p.format&&this.formats&&(r=this.formats[p.format])&&("string"==typeof r||r instanceof RegExp?(this.code("if (!("+n(r)+").test("+d+")) {"),this.error("format"),this.code("}")):"function"==typeof r&&((l.formats||(l.formats={}))[p.format]=r,(l.schemas||(l.schemas={}))[p.format]=p,t=i(p.format),this.code("if (!formats["+t+"]("+d+", schemas["+t+"])) {"),this.error("format"),this.code("}")))}},f.prototype.compile=function(e){return this.code=x("jsen_compiled"+(e?"_"+e:""),"data","path","errors"),this.generate(),this.code.compile(this.scope)},f.prototype.dispose=function(){for(var e in this)this[e]=void 0},l.browser=b,l.clone=u,l.equal=A,l.unique=E,l.ucs2length=j,l.SchemaResolver=O,l.resolve=O.resolvePointer,e.exports=l},function(e,t){"use strict";e.exports=function(){var e=Array.apply(null,arguments),t=e.shift(),r="  ",n="",i="",o=1,s=function(e){n+=function(){for(var e=r,t=0;t++<o-1;)e+=r;return e}()+e+"\n"},a=function(e){var t=e[0],r=e[e.length-1];return"}]".indexOf(t)>-1&&"{[".indexOf(r)>-1?(o--,s(e),o++):"{[".indexOf(r)>-1?(s(e),o++):"}]".indexOf(t)>-1?(o--,s(e)):s(e),a};return a.def=function(e,t){return i+=(i?",\n      ":"")+e+(void 0!==t?" = "+t:""),a},a.toSource=function(){return"function "+t+"("+e.join(", ")+") {\n"+r+'"use strict"\n'+(i?"  var "+i+";\n":"")+n+"}"},a.compile=function(e){var t="return ("+a.toSource()+")",r=e||{},n=Object.keys(r),i=n.map(function(e){return r[e]});return Function.apply(null,n.concat(t)).apply(null,i)},a}},function(e,t){"use strict";function r(e){var t=Object.prototype.toString.call(e);return t.substr(8,t.length-9).toLowerCase()}function n(e,t){var i,o=typeof e,s=typeof t;if("object"===o&&(o=r(e)),"object"===s&&(s=r(t)),o!==s)return!1;if("object"===o)return function(e,t){var r,i,o=Object.keys(e).sort(),s=Object.keys(t).sort();if(!n(o,s))return!1;for(r=0;r<o.length;r++)if(i=o[r],!n(e[i],t[i]))return!1;return!0}(e,t);if("regexp"===o)return e.toString()===t.toString();if("array"===o){if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}return e===t}e.exports=n},function(e,t,r){"use strict";function n(e,t,r){for(var n=0,i=e.length;n<i;n++)if(r(e[n],t))return n;return-1}var i=r(13);e.exports=function(e){return e.filter(function(e,t,r){return n(r,e,i)===t})},e.exports.findIndex=n},function(e,t,r){"use strict";function n(e,t){if(!t.length)return e;var r,i=t.shift();return e&&"object"==typeof e&&e.hasOwnProperty(i)&&(r=e[i]),t.length?r&&"object"==typeof r?n(r,t):void 0:r}function i(e){var t=e.indexOf("#"),r={base:e.substr(0,t),path:[]};return t<0?(r.base=e,r):(e=e.substr(t+1))?(r.path=e.split("/").map(function(e){return decodeURIComponent(e).replace(/~1/g,"/").replace(/~0/g,"~")}),"/"===e[0]&&r.path.shift(),r):r}function o(e,t,r,n){this.rootSchema=e,this.resolvers=null,this.resolvedRootSchema=null,this.cache={},this.idCache={},this.refCache={refs:[],schemas:[]},this.missing$Ref=r,this.refStack=[],n=n||"",this._buildIdCache(e,n),n=this.refCache.refs[this.refCache.schemas.indexOf(this.rootSchema)]||n,this._buildResolvers(t,n)}var s=r(16),a=r(23);o.prototype._cacheId=function(e,t,r){if(this.idCache[e])throw new Error("jsen: duplicate schema id "+e);this.idCache[e]={resolver:r,schema:t}},o.prototype._buildIdCache=function(e,t){var r,n,i,o=t;if(e&&"object"==typeof e)for("string"==typeof e.id&&e.id?(o=s.resolve(t,e.id),this._cacheId(o,e,this)):e===this.rootSchema&&t&&this._cacheId(t,e,this),e.$ref&&"string"==typeof e.$ref&&(r=s.resolve(o,e.$ref),this.refCache.schemas.push(e),this.refCache.refs.push(r)),n=Object.keys(e),i=0;i<n.length;i++)this._buildIdCache(e[n[i]],o)},o.prototype._buildResolvers=function(e,t){if(e&&"object"==typeof e){var r=this,n={};Object.keys(e).forEach(function(i){var a=s.resolve(t,i),c=new o(e[i],null,r.missing$Ref,a);r._cacheId(a,c.rootSchema,c),Object.keys(c.idCache).forEach(function(e){r.idCache[e]=c.idCache[e]}),n[i]=c}),this.resolvers=n}},o.prototype.getNormalizedRef=function(e){var t=this.refCache.schemas.indexOf(e);return this.refCache.refs[t]},o.prototype._resolveRef=function(e){var t,r,o,s,c,h=new Error("jsen: invalid schema reference "+e),u=this.idCache;if(!e||"string"!=typeof e)throw h;if(e===a.id&&(c=a),(r=u[e])&&(c=r.resolver.resolve(r.schema)),void 0===c&&(o=i(e),s=o.path,o.base&&((r=u[o.base]||u[o.base+"#"])?c=r.resolver.resolve(n(r.schema,s.slice(0))):s.unshift(o.base))),void 0===c&&this.resolvedRootSchema&&(c=n(this.resolvedRootSchema,s.slice(0))),void 0===c&&(c=n(this.rootSchema,s.slice(0))),void 0===c&&s.length&&this.resolvers&&(t=n(this.resolvers,s))&&(c=t.resolve(t.rootSchema)),void 0===c||"object"!=typeof c){if(!this.missing$Ref)throw h;c={}}return this.cache[e]===c?c:(this.cache[e]=c,void 0!==c.$ref&&(c=this.resolve(c)),c)},o.prototype.resolve=function(e){if(!e||"object"!=typeof e||void 0===e.$ref)return e;var t=this.getNormalizedRef(e)||e.$ref,r=this.cache[t];if(void 0!==r)return r;if(this.refStack.indexOf(t)>-1)throw new Error("jsen: circular schema reference "+t);return this.refStack.push(t),r=this._resolveRef(t),this.refStack.pop(),e===this.rootSchema&&(this.resolvedRootSchema=r),r},o.prototype.hasRef=function(e){var t,r,n,i=Object.keys(e);if(i.indexOf("$ref")>-1)return!0;for(n=0,t=i.length;n<t;n++)if(r=i[n],e[r]&&"object"==typeof e[r]&&!Array.isArray(e[r])&&this.hasRef(e[r]))return!0;return!1},o.resolvePointer=function(e,t){var r=i(t),o=r.path;return r.base&&(o=[r.base].concat(o)),n(e,o)},e.exports=o},function(e,t,r){"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(e,t,r){if(e&&s.isObject(e)&&e instanceof n)return e;var i=new n;return i.parse(e,t,r),i}var o=r(17),s=r(19);t.parse=i,t.resolve=function(e,t){return i(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?i(e,!1,!0).resolveObject(t):t},t.format=function(e){return s.isString(e)&&(e=i(e)),e instanceof n?e.format():n.prototype.format.call(e)},t.Url=n;var a=/^([a-z0-9.+-]+:)/i,c=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),d=["'"].concat(u),p=["%","/","?",";","#"].concat(d),f=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=r(20);n.prototype.parse=function(e,t,r){if(!s.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),i=-1!==n&&n<e.indexOf("#")?"?":"#",c=e.split(i);c[0]=c[0].replace(/\\/g,"/");var u=e=c.join(i);if(u=u.trim(),!r&&1===e.split("#").length){var w=h.exec(u);if(w)return this.path=u,this.href=u,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?b.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var x=a.exec(u);if(x){var A=(x=x[0]).toLowerCase();this.protocol=A,u=u.substr(x.length)}if(r||x||u.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===u.substr(0,2);!E||x&&y[x]||(u=u.substr(2),this.slashes=!0)}if(!y[x]&&(E||x&&!v[x])){for(var O=-1,P=0;P<f.length;P++){var j=u.indexOf(f[P]);-1!==j&&(-1===O||j<O)&&(O=j)}var I,C;-1!==(C=-1===O?u.lastIndexOf("@"):u.lastIndexOf("@",O))&&(I=u.slice(0,C),u=u.slice(C+1),this.auth=decodeURIComponent(I)),O=-1;for(var P=0;P<p.length;P++){var j=u.indexOf(p[P]);-1!==j&&(-1===O||j<O)&&(O=j)}-1===O&&(O=u.length),this.host=u.slice(0,O),u=u.slice(O),this.parseHost(),this.hostname=this.hostname||"";var S="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!S)for(var k=this.hostname.split(/\./),P=0,q=k.length;P<q;P++){var T=k[P];if(T&&!T.match(l)){for(var R="",F=0,M=T.length;F<M;F++)R+=T.charCodeAt(F)>127?"x":T[F];if(!R.match(l)){var $=k.slice(0,P),N=k.slice(P+1),U=T.match(m);U&&($.push(U[1]),N.unshift(U[2])),N.length&&(u="/"+N.join(".")+u),this.hostname=$.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),S||(this.hostname=o.toASCII(this.hostname));var L=this.port?":"+this.port:"",W=this.hostname||"";this.host=W+L,this.href+=this.host,S&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==u[0]&&(u="/"+u))}if(!g[A])for(var P=0,q=d.length;P<q;P++){var z=d[P];if(-1!==u.indexOf(z)){var H=encodeURIComponent(z);H===z&&(H=escape(z)),u=u.split(z).join(H)}}var _=u.indexOf("#");-1!==_&&(this.hash=u.substr(_),u=u.slice(0,_));var D=u.indexOf("?");if(-1!==D?(this.search=u.substr(D),this.query=u.substr(D+1),t&&(this.query=b.parse(this.query)),u=u.slice(0,D)):t&&(this.search="",this.query={}),u&&(this.pathname=u),v[A]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var L=this.pathname||"",J=this.search||"";this.path=L+J}return this.href=this.format(),this},n.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&s.isObject(this.query)&&Object.keys(this.query).length&&(o=b.stringify(this.query));var a=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||v[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),a=a.replace("#","%23"),t+i+r+a+n},n.prototype.resolve=function(e){return this.resolveObject(i(e,!1,!0)).format()},n.prototype.resolveObject=function(e){if(s.isString(e)){var t=new n;t.parse(e,!1,!0),e=t}for(var r=new n,i=Object.keys(this),o=0;o<i.length;o++){var a=i[o];r[a]=this[a]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var c=Object.keys(e),h=0;h<c.length;h++){var u=c[h];"protocol"!==u&&(r[u]=e[u])}return v[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!v[e.protocol]){for(var d=Object.keys(e),p=0;p<d.length;p++){var f=d[p];r[f]=e[f]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||y[e.protocol])r.pathname=e.pathname;else{for(var l=(e.pathname||"").split("/");l.length&&!(e.host=l.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==l[0]&&l.unshift(""),l.length<2&&l.unshift(""),r.pathname=l.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var m=r.pathname||"",g=r.search||"";r.path=m+g}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),x=w||b||r.host&&e.pathname,A=x,E=r.pathname&&r.pathname.split("/")||[],l=e.pathname&&e.pathname.split("/")||[],O=r.protocol&&!v[r.protocol];if(O&&(r.hostname="",r.port=null,r.host&&(""===E[0]?E[0]=r.host:E.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===l[0]?l[0]=e.host:l.unshift(e.host)),e.host=null),x=x&&(""===l[0]||""===E[0])),w)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,E=l;else if(l.length)E||(E=[]),E.pop(),E=E.concat(l),r.search=e.search,r.query=e.query;else if(!s.isNullOrUndefined(e.search)){if(O){r.hostname=r.host=E.shift();var P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return r.search=e.search,r.query=e.query,s.isNull(r.pathname)&&s.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var j=E.slice(-1)[0],I=(r.host||e.host||E.length>1)&&("."===j||".."===j)||""===j,C=0,S=E.length;S>=0;S--)"."===(j=E[S])?E.splice(S,1):".."===j?(E.splice(S,1),C++):C&&(E.splice(S,1),C--);if(!x&&!A)for(;C--;C)E.unshift("..");!x||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),I&&"/"!==E.join("/").substr(-1)&&E.push("");var k=""===E[0]||E[0]&&"/"===E[0].charAt(0);if(O){r.hostname=r.host=k?"":E.length?E.shift():"";var P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return(x=x||r.host&&E.length)&&!k&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),s.isNull(r.pathname)&&s.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=c.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){var n;(function(e,i){!function(o){function s(e){throw RangeError(k[e])}function a(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function c(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);var i=(e=e.replace(S,".")).split("."),o=a(i,t).join(".");return n+o}function h(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function u(e){return a(e,function(e){var t="";return e>65535&&(t+=R((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=R(e)}).join("")}function d(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:b}function p(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function f(e,t,r){var n=0;for(e=r?T(e/E):e>>1,e+=T(e/t);e>q*x>>1;n+=b)e=T(e/q);return T(n+(q+1)*e/(e+A))}function l(e){var t,r,n,i,o,a,c,h,p,l,m=[],g=e.length,y=0,A=P,E=O;for((r=e.lastIndexOf(j))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&s("not-basic"),m.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<g;){for(o=y,a=1,c=b;i>=g&&s("invalid-input"),((h=d(e.charCodeAt(i++)))>=b||h>T((v-y)/a))&&s("overflow"),y+=h*a,!(h<(p=c<=E?w:c>=E+x?x:c-E));c+=b)a>T(v/(l=b-p))&&s("overflow"),a*=l;t=m.length+1,E=f(y-o,t,0==o),T(y/t)>v-A&&s("overflow"),A+=T(y/t),y%=t,m.splice(y++,0,A)}return u(m)}function m(e){var t,r,n,i,o,a,c,u,d,l,m,g,y,A,E,I=[];for(e=h(e),g=e.length,t=P,r=0,o=O,a=0;a<g;++a)(m=e[a])<128&&I.push(R(m));for(n=i=I.length,i&&I.push(j);n<g;){for(c=v,a=0;a<g;++a)(m=e[a])>=t&&m<c&&(c=m);for(c-t>T((v-r)/(y=n+1))&&s("overflow"),r+=(c-t)*y,t=c,a=0;a<g;++a)if((m=e[a])<t&&++r>v&&s("overflow"),m==t){for(u=r,d=b;!(u<(l=d<=o?w:d>=o+x?x:d-o));d+=b)E=u-l,A=b-l,I.push(R(p(l+E%A,0))),u=T(E/A);I.push(R(p(u,0))),o=f(r,y,n==i),r=0,++n}++r,++t}return I.join("")}var g=("object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType,"object"==typeof i&&i);g.global!==g&&g.window!==g&&g.self;var y,v=2147483647,b=36,w=1,x=26,A=38,E=700,O=72,P=128,j="-",I=/^xn--/,C=/[^\x20-\x7E]/,S=/[\x2E\u3002\uFF0E\uFF61]/g,k={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},q=b-w,T=Math.floor,R=String.fromCharCode;y={version:"1.3.2",ucs2:{decode:h,encode:u},decode:l,encode:m,toASCII:function(e){return c(e,function(e){return C.test(e)?"xn--"+m(e):e})},toUnicode:function(e){return c(e,function(e){return I.test(e)?l(e.slice(4).toLowerCase()):e})}},void 0===(n=function(){return y}.call(t,r,t,e))||(e.exports=n)}()}).call(t,r(18)(e),function(){return this}())},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(21),t.encode=t.stringify=r(22)},function(e,t){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,i){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var h=0;h<c;++h){var u,d,p,f,l=e[h].replace(s,"%20"),m=l.indexOf(n);m>=0?(u=l.substr(0,m),d=l.substr(m+1)):(u=l,d=""),p=decodeURIComponent(u),f=decodeURIComponent(d),r(o,p)?Array.isArray(o[p])?o[p].push(f):o[p]=[o[p],f]:o[p]=f}return o}},function(e,t){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,i){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(i){var o=encodeURIComponent(r(i))+n;return Array.isArray(e[i])?e[i].map(function(e){return o+encodeURIComponent(r(e))}).join(t):o+encodeURIComponent(r(e[i]))}).join(t):i?encodeURIComponent(r(i))+n+encodeURIComponent(r(e)):""}},function(e,t){e.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}}},function(e,t){"use strict";var r={"date-time":/(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/,uri:/^([a-zA-Z][a-zA-Z0-9+-.]*:){0,1}\/\/[^\s]*$/,email:/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,hostname:/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$/};e.exports=r},function(e,t){"use strict";e.exports=function(e){for(var t,r=0,n=0,i=e.length;n<i;)r++,(t=e.charCodeAt(n++))>=55296&&t<=56319&&n<i&&56320!=(64512&e.charCodeAt(n++))&&n--;return r}}])},function(e,t){var r=function(){function e(e,t,r){this.report=e,this.name=t,this.displayName=r}return e.prototype.getFilters=function(){return this.report.service.hpm.get("/report/pages/"+this.name+"/filters",{uid:this.report.config.uniqueId},this.report.iframe.contentWindow).then(function(e){return e.body},function(e){throw e.body})},e.prototype.removeFilters=function(){return this.setFilters([])},e.prototype.setActive=function(){var e={name:this.name,displayName:null};return this.report.service.hpm.put("/report/pages/active",e,{uid:this.report.config.uniqueId},this.report.iframe.contentWindow).catch(function(e){throw e.body})},e.prototype.setFilters=function(e){return this.report.service.hpm.put("/report/pages/"+this.name+"/filters",e,{uid:this.report.config.uniqueId},this.report.iframe.contentWindow).catch(function(e){throw e.body})},e}();t.Page=r},function(e,t,r){var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=r(5),o=function(e){function t(t,r,n){e.call(this,t,r,n)}return n(t,e),t.prototype.getId=function(){var e=this.createConfig&&this.createConfig.datasetId?this.createConfig.datasetId:t.findIdFromEmbedUrl(this.config.embedUrl);if("string"!=typeof e||0===e.length)throw new Error("Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.");return e},t.prototype.validate=function(e){return i.validateCreateReport(e)},t.findIdFromEmbedUrl=function(e){var t,r=e.match(/datasetId="?([^&]+)"?/);return r&&(t=r[1]),t},t}(r(2).Embed);t.Create=o},function(e,t,r){var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=r(2),o=r(5),s=function(e){function t(r,n,i){e.call(this,r,n,i),this.loadPath="/dashboard/load",Array.prototype.push.apply(this.allowedEvents,t.allowedEvents)}return n(t,e),t.findIdFromEmbedUrl=function(e){var t,r=e.match(/dashboardId="?([^&]+)"?/);return r&&(t=r[1]),t},t.prototype.getId=function(){var e=this.config.id||this.element.getAttribute(t.dashboardIdAttribute)||t.findIdFromEmbedUrl(this.config.embedUrl);if("string"!=typeof e||0===e.length)throw new Error("Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '"+t.dashboardIdAttribute+"'.");return e},t.prototype.validate=function(e){var t=o.validateDashboardLoad(e);return t||this.ValidatePageView(e.pageView)},t.prototype.ValidatePageView=function(e){if(e&&"fitToWidth"!==e&&"oneColumn"!==e&&"actualSize"!==e)return[{message:"pageView must be one of the followings: fitToWidth, oneColumn, actualSize"}]},t.allowedEvents=["tileClicked","error"],t.dashboardIdAttribute="powerbi-dashboard-id",t.typeAttribute="powerbi-type",t.type="Dashboard",t}(i.Embed);t.Dashboard=s},function(e,t,r){var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=function(e){function t(){e.apply(this,arguments)}return n(t,e),t.prototype.getId=function(){throw new Error("Not implemented. Embedding tiles is not supported yet.")},t.prototype.validate=function(e){throw new Error("Not implemented. Embedding tiles is not supported yet.")},t.type="Tile",t}(r(2).Embed);t.Tile=i},function(e,t,r){var n=r(11),i=r(12),o=r(13),s=r(14);t.hpmFactory=function(e,t,r,i){return void 0===r&&(r=n.default.version),void 0===i&&(i=n.default.type),new o.HttpPostMessage(e,{"x-sdk-type":i,"x-sdk-version":r},t)},t.wpmpFactory=function(e,t,r){return new i.WindowPostMessageProxy({processTrackingProperties:{addTrackingProperties:o.HttpPostMessage.addTrackingProperties,getTrackingProperties:o.HttpPostMessage.getTrackingProperties},isErrorMessage:o.HttpPostMessage.isErrorMessage,name:e,logMessages:t,eventSourceOverrideWindow:r})},t.routerFactory=function(e){return new s.Router(e)}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={version:"2.3.0",type:"js"}},function(e,t,r){e.exports=function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t){"use strict";var r=function(){function e(t){var r=this;void 0===t&&(t={processTrackingProperties:{addTrackingProperties:e.defaultAddTrackingProperties,getTrackingProperties:e.defaultGetTrackingProperties},isErrorMessage:e.defaultIsErrorMessage,receiveWindow:window,name:e.createRandomString()}),this.pendingRequestPromises={},this.addTrackingProperties=t.processTrackingProperties&&t.processTrackingProperties.addTrackingProperties||e.defaultAddTrackingProperties,this.getTrackingProperties=t.processTrackingProperties&&t.processTrackingProperties.getTrackingProperties||e.defaultGetTrackingProperties,this.isErrorMessage=t.isErrorMessage||e.defaultIsErrorMessage,this.receiveWindow=t.receiveWindow||window,this.name=t.name||e.createRandomString(),this.logMessages=t.logMessages||!1,this.eventSourceOverrideWindow=t.eventSourceOverrideWindow,this.suppressWarnings=t.suppressWarnings||!1,this.logMessages&&console.log("new WindowPostMessageProxy created with name: "+this.name+" receiving on window: "+this.receiveWindow.document.title),this.handlers=[],this.windowMessageHandler=function(e){return r.onMessageReceived(e)},this.start()}return e.defaultAddTrackingProperties=function(t,r){return t[e.messagePropertyName]=r,t},e.defaultGetTrackingProperties=function(t){return t[e.messagePropertyName]},e.defaultIsErrorMessage=function(e){return!!e.error},e.createDeferred=function(){var e={resolve:null,reject:null,promise:null},t=new Promise(function(t,r){e.resolve=t,e.reject=r});return e.promise=t,e},e.createRandomString=function(){return(Math.random()+1).toString(36).substring(7)},e.prototype.addHandler=function(e){this.handlers.push(e)},e.prototype.removeHandler=function(e){var t=this.handlers.indexOf(e);if(-1===t)throw new Error("You attempted to remove a handler but no matching handler was found.");this.handlers.splice(t,1)},e.prototype.start=function(){this.receiveWindow.addEventListener("message",this.windowMessageHandler)},e.prototype.stop=function(){this.receiveWindow.removeEventListener("message",this.windowMessageHandler)},e.prototype.postMessage=function(t,r){var n={id:e.createRandomString()};this.addTrackingProperties(r,n),this.logMessages&&(console.log(this.name+" Posting message:"),console.log(JSON.stringify(r,null,"  "))),t.postMessage(r,"*");var i=e.createDeferred();return this.pendingRequestPromises[n.id]=i,i.promise},e.prototype.sendResponse=function(e,t,r){this.addTrackingProperties(t,r),this.logMessages&&(console.log(this.name+" Sending response:"),console.log(JSON.stringify(t,null,"  "))),e.postMessage(t,"*")},e.prototype.onMessageReceived=function(e){var t=this;this.logMessages&&(console.log(this.name+" Received message:"),console.log("type: "+e.type),console.log(JSON.stringify(e.data,null,"  ")));var r=this.eventSourceOverrideWindow||e.source,n=e.data;if("object"==typeof n){var i,o;try{i=this.getTrackingProperties(n)}catch(e){this.suppressWarnings||console.warn("Proxy("+this.name+"): Error occurred when attempting to get tracking properties from incoming message:",JSON.stringify(n,null,"  "),"Error: ",e)}if(i&&(o=this.pendingRequestPromises[i.id]),o){var s=!0;try{s=this.isErrorMessage(n)}catch(e){console.warn("Proxy("+this.name+") Error occurred when trying to determine if message is consider an error response. Message: ",JSON.stringify(n,null,""),"Error: ",e)}s?o.reject(n):o.resolve(n),delete this.pendingRequestPromises[i.id]}else{var a=this.handlers.some(function(e){var o=!1;try{o=e.test(n)}catch(e){t.suppressWarnings||console.warn("Proxy("+t.name+"): Error occurred when handler was testing incoming message:",JSON.stringify(n,null,"  "),"Error: ",e)}if(o){var s=void 0;try{s=Promise.resolve(e.handle(n))}catch(e){t.suppressWarnings||console.warn("Proxy("+t.name+"): Error occurred when handler was processing incoming message:",JSON.stringify(n,null,"  "),"Error: ",e),s=Promise.resolve()}return s.then(function(e){if(!e){var o="Handler for message: "+JSON.stringify(n,null,"  ")+" did not return a response message. The default response message will be returned instead.";t.suppressWarnings||console.warn("Proxy("+t.name+"): "+o),e={warning:o}}t.sendResponse(r,e,i)}),!0}});a||this.suppressWarnings||console.warn("Proxy("+this.name+") did not handle message. Handlers: "+this.handlers.length+"  Message: "+JSON.stringify(n,null,"")+".")}}else this.suppressWarnings||console.warn("Proxy("+this.name+"): Received message that was not an object. Discarding message")},e.messagePropertyName="windowPostMessageProxy",e}();t.WindowPostMessageProxy=r}])},function(e,t,r){e.exports=function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t){"use strict";var r=function(){function e(e,t,r){void 0===t&&(t={}),this.defaultHeaders=t,this.defaultTargetWindow=r,this.windowPostMessageProxy=e}return e.addTrackingProperties=function(e,t){return e.headers=e.headers||{},t&&t.id&&(e.headers.id=t.id),e},e.getTrackingProperties=function(e){return{id:e.headers&&e.headers.id}},e.isErrorMessage=function(e){return"number"==typeof(e&&e.statusCode)&&!(200<=e.statusCode&&e.statusCode<300)},e.prototype.get=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r=this.defaultTargetWindow),this.send({method:"GET",url:e,headers:t},r)},e.prototype.post=function(e,t,r,n){return void 0===r&&(r={}),void 0===n&&(n=this.defaultTargetWindow),this.send({method:"POST",url:e,headers:r,body:t},n)},e.prototype.put=function(e,t,r,n){return void 0===r&&(r={}),void 0===n&&(n=this.defaultTargetWindow),this.send({method:"PUT",url:e,headers:r,body:t},n)},e.prototype.patch=function(e,t,r,n){return void 0===r&&(r={}),void 0===n&&(n=this.defaultTargetWindow),this.send({method:"PATCH",url:e,headers:r,body:t},n)},e.prototype.delete=function(e,t,r,n){return void 0===t&&(t=null),void 0===r&&(r={}),void 0===n&&(n=this.defaultTargetWindow),this.send({method:"DELETE",url:e,headers:r,body:t},n)},e.prototype.send=function(e,t){if(void 0===t&&(t=this.defaultTargetWindow),e.headers=this.assign({},this.defaultHeaders,e.headers),!t)throw new Error("target window is not provided.  You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.");return this.windowPostMessageProxy.postMessage(t,e)},e.prototype.assign=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");var n=Object(e);return t.forEach(function(e){if(void 0!==e&&null!==e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}),n},e}();t.HttpPostMessage=r}])},function(e,t,r){e.exports=function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";var n=r(1),i=function(){function e(e){this.handlers=e,this.getRouteRecognizer=new n,this.patchRouteRecognizer=new n,this.postRouteRecognizer=new n,this.putRouteRecognizer=new n,this.deleteRouteRecognizer=new n}return e.prototype.get=function(e,t){return this.registerHandler(this.getRouteRecognizer,"GET",e,t),this},e.prototype.patch=function(e,t){return this.registerHandler(this.patchRouteRecognizer,"PATCH",e,t),this},e.prototype.post=function(e,t){return this.registerHandler(this.postRouteRecognizer,"POST",e,t),this},e.prototype.put=function(e,t){return this.registerHandler(this.putRouteRecognizer,"PUT",e,t),this},e.prototype.delete=function(e,t){return this.registerHandler(this.deleteRouteRecognizer,"DELETE",e,t),this},e.prototype.registerHandler=function(e,t,r,n){e.add([{path:r,handler:function(e){var t=new o;return Promise.resolve(n(e,t)).then(function(e){return t})}}]);var i={test:function(r){if(r.method!==t)return!1;var n=e.recognize(r.url);if(void 0===n)return!1;var i=n[0];return r.params=i.params,r.queryParams=n.queryParams,r.handler=i.handler,!0},handle:function(e){return e.handler(e)}};this.handlers.addHandler(i)},e}();t.Router=i;var o=function(){function e(){this.statusCode=200,this.headers={},this.body=null}return e.prototype.send=function(e,t){this.statusCode=e,this.body=t},e}();t.Response=o},function(e,t,r){var n;(function(e){(function(){"use strict";function i(e,t,r){this.path=e,this.matcher=t,this.delegate=r}function o(e){this.routes={},this.children={},this.target=e}function s(e,t,r){return function(n,o){var a=e+n;return o?void o(s(a,t,r)):new i(e+n,t,r)}}function a(e,t,r){for(var n=0,i=0;i<e.length;i++)n+=e[i].path.length;var o={path:t=t.substr(n),handler:r};e.push(o)}function c(e){return"[object Array]"===Object.prototype.toString.call(e)}function h(e){this.string=e}function u(e){this.name=e}function d(e){this.name=e}function p(){}function f(e,t,r){"/"===e.charAt(0)&&(e=e.substr(1));var n=e.split("/"),i=new Array(n.length);r.val="";for(var o=0;o<n.length;o++){var s,a=n[o];(s=a.match(/^:([^\/]+)$/))?(i[o]=new u(s[1]),t.push(s[1]),r.val+="3"):(s=a.match(/^\*([^\/]+)$/))?(i[o]=new d(s[1]),r.val+="1",t.push(s[1])):""===a?(i[o]=new p,r.val+="2"):(i[o]=new h(a),r.val+="4")}return r.val=+r.val,i}function l(e){this.charSpec=e,this.nextStates=[],this.charSpecs={},this.regex=void 0,this.handlers=void 0,this.specificity=void 0}function m(e,t){for(var r=[],n=0,i=e.length;n<i;n++){var o=e[n];r=r.concat(o.match(t))}return r}function g(e){this.queryParams=e||{}}function y(e){var t;e=e.replace(/\+/gm,"%20");try{t=decodeURIComponent(e)}catch(e){t=""}return t}i.prototype={to:function(e,t){var r=this.delegate;if(r&&r.willAddRoute&&(e=r.willAddRoute(this.matcher.target,e)),this.matcher.add(this.path,e),t){if(0===t.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,e,t,this.delegate)}return this}},o.prototype={add:function(e,t){this.routes[e]=t},addChild:function(e,t,r,n){var i=new o(t);this.children[e]=i;var a=s(e,i,n);n&&n.contextEntered&&n.contextEntered(t,a),r(a)}};var v=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\"].join("|\\")+")","g");h.prototype={eachChar:function(e){for(var t,r=this.string,n=0;n<r.length;n++)t=r.charAt(n),e=e.put({invalidChars:void 0,repeat:!1,validChars:t});return e},regex:function(){return this.string.replace(v,"\\$1")},generate:function(){return this.string}},u.prototype={eachChar:function(e){return e.put({invalidChars:"/",repeat:!0,validChars:void 0})},regex:function(){return"([^/]+)"},generate:function(e){return e[this.name]}},d.prototype={eachChar:function(e){return e.put({invalidChars:"",repeat:!0,validChars:void 0})},regex:function(){return"(.+)"},generate:function(e){return e[this.name]}},p.prototype={eachChar:function(e){return e},regex:function(){return""},generate:function(){return""}},l.prototype={get:function(e){if(this.charSpecs[e.validChars])return this.charSpecs[e.validChars];for(var t=this.nextStates,r=0;r<t.length;r++){var n=t[r],i=n.charSpec.validChars===e.validChars;if(i=i&&n.charSpec.invalidChars===e.invalidChars)return this.charSpecs[e.validChars]=n,n}},put:function(e){var t;return(t=this.get(e))?t:(t=new l(e),this.nextStates.push(t),e.repeat&&t.nextStates.push(t),t)},match:function(e){for(var t,r,n,i=this.nextStates,o=[],s=0;s<i.length;s++)t=i[s],r=t.charSpec,void 0!==(n=r.validChars)?-1!==n.indexOf(e)&&o.push(t):void 0!==(n=r.invalidChars)&&-1===n.indexOf(e)&&o.push(t);return o}};var b=Object.create||function(e){function t(){}return t.prototype=e,new t};g.prototype=b({splice:Array.prototype.splice,slice:Array.prototype.slice,push:Array.prototype.push,length:0,queryParams:null});var w=function(){this.rootState=new l,this.names={}};(w.prototype={add:function(e,t){for(var r,n=this.rootState,i="^",o={},s=new Array(e.length),a=[],c=!0,h=0;h<e.length;h++){var u=e[h],d=[],l=f(u.path,d,o);a=a.concat(l);for(var m=0;m<l.length;m++){var g=l[m];g instanceof p||(c=!1,n=n.put({invalidChars:void 0,repeat:!1,validChars:"/"}),i+="/",n=g.eachChar(n),i+=g.regex())}var y={handler:u.handler,names:d};s[h]=y}c&&(n=n.put({invalidChars:void 0,repeat:!1,validChars:"/"}),i+="/"),n.handlers=s,n.regex=new RegExp(i+"$"),n.specificity=o,(r=t&&t.as)&&(this.names[r]={segments:a,handlers:s})},handlersFor:function(e){var t=this.names[e];if(!t)throw new Error("There is no route named "+e);for(var r=new Array(t.handlers.length),n=0;n<t.handlers.length;n++)r[n]=t.handlers[n];return r},hasRoute:function(e){return!!this.names[e]},generate:function(e,t){var r=this.names[e],n="";if(!r)throw new Error("There is no route named "+e);for(var i=r.segments,o=0;o<i.length;o++){var s=i[o];s instanceof p||(n+="/",n+=s.generate(t))}return"/"!==n.charAt(0)&&(n="/"+n),t&&t.queryParams&&(n+=this.generateQueryString(t.queryParams,r.handlers)),n},generateQueryString:function(e,t){var r=[],n=[];for(var i in e)e.hasOwnProperty(i)&&n.push(i);n.sort();for(var o=0;o<n.length;o++){i=n[o];var s=e[i];if(null!=s){var a=encodeURIComponent(i);if(c(s))for(var h=0;h<s.length;h++){var u=i+"[]="+encodeURIComponent(s[h]);r.push(u)}else a+="="+encodeURIComponent(s),r.push(a)}}return 0===r.length?"":"?"+r.join("&")},parseQueryString:function(e){for(var t=e.split("&"),r={},n=0;n<t.length;n++){var i,o=t[n].split("="),s=y(o[0]),a=s.length,c=!1;1===o.length?i="true":(a>2&&"[]"===s.slice(a-2)&&(c=!0,s=s.slice(0,a-2),r[s]||(r[s]=[])),i=o[1]?y(o[1]):""),c?r[s].push(i):r[s]=i}return r},recognize:function(e){var t,r,n,i=[this.rootState],o={},s=!1;if(-1!==(n=e.indexOf("?"))){var a=e.substr(n+1,e.length);e=e.substr(0,n),o=this.parseQueryString(a)}for("/"!==(e=decodeURI(e)).charAt(0)&&(e="/"+e),(t=e.length)>1&&"/"===e.charAt(t-1)&&(e=e.substr(0,t-1),s=!0),r=0;r<e.length&&(i=m(i,e.charAt(r))).length;r++);var c=[];for(r=0;r<i.length;r++)i[r].handlers&&c.push(i[r]);i=function(e){return e.sort(function(e,t){return t.specificity.val-e.specificity.val})}(c);var h=c[0];if(h&&h.handlers)return s&&"(.+)$"===h.regex.source.slice(-5)&&(e+="/"),function(e,t,r){var n=e.handlers,i=e.regex,o=t.match(i),s=1,a=new g(r);a.length=n.length;for(var c=0;c<n.length;c++){for(var h=n[c],u=h.names,d={},p=0;p<u.length;p++)d[u[p]]=o[s++];a[c]={handler:h.handler,params:d,isDynamic:!!u.length}}return a}(h,e,o)}}).map=function(e,t){var r=new o;e(s("",r,this.delegate)),function e(t,r,n,i){var o=r.routes;for(var s in o)if(o.hasOwnProperty(s)){var c=t.slice();a(c,s,o[s]),r.children[s]?e(c,r.children[s],n,i):n.call(i,c)}}([],r,function(e){t?t(this,e):this.add(e)},this)},w.VERSION="0.1.11";var x=w;r(3).amd?void 0===(n=function(){return x}.call(t,r,t,e))||(e.exports=n):void 0!==e&&e.exports?e.exports=x:void 0!==this&&(this.RouteRecognizer=x)}).call(this)}).call(t,r(2)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}}])}])});;!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(e.toString()).default:"object"==typeof exports?exports.Quagga=e(e.toString()).default:t.Quagga=e(e.toString()).default}(this,function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=166)}([function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){"use strict";var r=n(3);function o(t,e){return this._row=[],this.config=t||{},this.supplements=e,this}o.prototype._nextUnset=function(t,e){var n;for(void 0===e&&(e=0),n=e;n<t.length;n++)if(!t[n])return n;return t.length},o.prototype._matchPattern=function(t,e,n){var r,o,i,a,u=0,s=0,c=0,f=0;for(n=n||this.SINGLE_CODE_ERROR||1,r=0;r<t.length;r++)c+=t[r],f+=e[r];if(c<f)return Number.MAX_VALUE;for(n*=o=c/f,r=0;r<t.length;r++){if(i=t[r],a=e[r]*o,(s=Math.abs(i-a)/a)>n)return Number.MAX_VALUE;u+=s}return u/f},o.prototype._nextSet=function(t,e){var n;for(n=e=e||0;n<t.length;n++)if(t[n])return n;return t.length},o.prototype._correctBars=function(t,e,n){for(var r=n.length,o=0;r--;)(o=t[n[r]]*(1-(1-e)/2))>1&&(t[n[r]]=o)},o.prototype._matchTrace=function(t,e){var n,r=[],o=this._nextSet(this._row),i=!this._row[o],a=0,u={error:Number.MAX_VALUE,code:-1,start:0};if(t){for(n=0;n<t.length;n++)r.push(0);for(n=o;n<this._row.length;n++)if(this._row[n]^i)r[a]++;else{if(a===r.length-1)return this._matchPattern(r,t)<e?(u.start=n-o,u.end=n,u.counter=r,u):null;r[++a]=1,i=!i}}else for(r.push(0),n=o;n<this._row.length;n++)this._row[n]^i?r[a]++:(a++,r.push(0),r[a]=1,i=!i);return u.start=o,u.end=this._row.length-1,u.counter=r,u},o.prototype.decodePattern=function(t){var e;return this._row=t,null===(e=this._decode())?(this._row.reverse(),(e=this._decode())&&(e.direction=o.DIRECTION.REVERSE,e.start=this._row.length-e.start,e.end=this._row.length-e.end)):e.direction=o.DIRECTION.FORWARD,e&&(e.format=this.FORMAT),e},o.prototype._matchRange=function(t,e,n){var r;for(r=t=t<0?0:t;r<e;r++)if(this._row[r]!==n)return!1;return!0},o.prototype._fillCounters=function(t,e,n){var r,o=0,i=[];for(n=void 0===n||n,t=void 0!==t?t:this._nextUnset(this._row),e=e||this._row.length,i[o]=0,r=t;r<e;r++)this._row[r]^n?i[o]++:(i[++o]=1,n=!n);return i},o.prototype._toCounters=function(t,e){var n,o=e.length,i=this._row.length,a=!this._row[t],u=0;for(r.a.init(e,0),n=t;n<i;n++)if(this._row[n]^a)e[u]++;else{if(++u===o)break;e[u]=1,a=!a}return e},Object.defineProperty(o.prototype,"FORMAT",{value:"unknown",writeable:!1}),o.DIRECTION={FORWARD:1,REVERSE:-1},o.Exception={StartNotFoundException:"Start-Info was not found!",CodeNotFoundException:"Code could not be found!",PatternNotFoundException:"Pattern could not be found!"},o.CONFIG_KEYS={},e.a=o},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){"use strict";e.a={init:function(t,e){for(var n=t.length;n--;)t[n]=e},shuffle:function(t){for(var e,n,r=t.length-1;r>=0;r--)e=Math.floor(Math.random()*r),n=t[r],t[r]=t[e],t[e]=n;return t},toPointList:function(t){var e,n,r=[],o=[];for(e=0;e<t.length;e++){for(r=[],n=0;n<t[e].length;n++)r[n]=t[e][n];o[e]="["+r.join(",")+"]"}return"["+o.join(",\r\n")+"]"},threshold:function(t,e,n){var r,o=[];for(r=0;r<t.length;r++)n.apply(t,[t[r]])>=e&&o.push(t[r]);return o},maxIndex:function(t){var e,n=0;for(e=0;e<t.length;e++)t[e]>t[n]&&(n=e);return n},max:function(t){var e,n=0;for(e=0;e<t.length;e++)t[e]>n&&(n=t[e]);return n},sum:function(t){for(var e=t.length,n=0;e--;)n+=t[e];return n}}},function(t,e,n){"use strict";var r=n(28),o=n.n(r),i=n(1),a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};function u(t,e){var n;t=o()((n={},Object.keys(u.CONFIG_KEYS).forEach(function(t){n[t]=u.CONFIG_KEYS[t].default}),n),t),i.a.call(this,t,e)}u.prototype=Object.create(i.a.prototype,{CODE_L_START:{value:0},CODE_G_START:{value:10},START_PATTERN:{value:[1,1,1]},STOP_PATTERN:{value:[1,1,1]},MIDDLE_PATTERN:{value:[1,1,1,1,1]},EXTENSION_START_PATTERN:{value:[1,1,2]},CODE_PATTERN:{value:[[3,2,1,1],[2,2,2,1],[2,1,2,2],[1,4,1,1],[1,1,3,2],[1,2,3,1],[1,1,1,4],[1,3,1,2],[1,2,1,3],[3,1,1,2],[1,1,2,3],[1,2,2,2],[2,2,1,2],[1,1,4,1],[2,3,1,1],[1,3,2,1],[4,1,1,1],[2,1,3,1],[3,1,2,1],[2,1,1,3]]},CODE_FREQUENCY:{value:[0,11,13,14,19,25,28,21,22,26]},SINGLE_CODE_ERROR:{value:.7},AVG_CODE_ERROR:{value:.48},FORMAT:{value:"ean_13",writeable:!1}}),u.prototype.constructor=u,u.prototype._decodeCode=function(t,e){var n,r,o,i=[0,0,0,0],a=t,u=!this._row[a],s=0,c={error:Number.MAX_VALUE,code:-1,start:t,end:t};for(e||(e=this.CODE_PATTERN.length),n=a;n<this._row.length;n++)if(this._row[n]^u)i[s]++;else{if(s===i.length-1){for(r=0;r<e;r++)(o=this._matchPattern(i,this.CODE_PATTERN[r]))<c.error&&(c.code=r,c.error=o);return c.end=n,c.error>this.AVG_CODE_ERROR?null:c}i[++s]=1,u=!u}return null},u.prototype._findPattern=function(t,e,n,r,o){var i,a,u,s,c=[],f=0,l={error:Number.MAX_VALUE,code:-1,start:0,end:0};for(e||(e=this._nextSet(this._row)),void 0===n&&(n=!1),void 0===r&&(r=!0),void 0===o&&(o=this.AVG_CODE_ERROR),i=0;i<t.length;i++)c[i]=0;for(i=e;i<this._row.length;i++)if(this._row[i]^n)c[f]++;else{if(f===c.length-1){for(s=0,u=0;u<c.length;u++)s+=c[u];if((a=this._matchPattern(c,t))<o)return l.error=a,l.start=i-s,l.end=i,l;if(!r)return null;for(u=0;u<c.length-2;u++)c[u]=c[u+2];c[c.length-2]=0,c[c.length-1]=0,f--}else f++;c[f]=1,n=!n}return null},u.prototype._findStart=function(){for(var t,e,n=this._nextSet(this._row);!e;){if(!(e=this._findPattern(this.START_PATTERN,n)))return null;if((t=e.start-(e.end-e.start))>=0&&this._matchRange(t,e.start,0))return e;n=e.end,e=null}},u.prototype._verifyTrailingWhitespace=function(t){var e;return(e=t.end+(t.end-t.start))<this._row.length&&this._matchRange(t.end,e,0)?t:null},u.prototype._findEnd=function(t,e){var n=this._findPattern(this.STOP_PATTERN,t,e,!1);return null!==n?this._verifyTrailingWhitespace(n):null},u.prototype._calculateFirstDigit=function(t){var e;for(e=0;e<this.CODE_FREQUENCY.length;e++)if(t===this.CODE_FREQUENCY[e])return e;return null},u.prototype._decodePayload=function(t,e,n){var r,o,i=0;for(r=0;r<6;r++){if(!(t=this._decodeCode(t.end)))return null;t.code>=this.CODE_G_START?(t.code=t.code-this.CODE_G_START,i|=1<<5-r):i|=0<<5-r,e.push(t.code),n.push(t)}if(null===(o=this._calculateFirstDigit(i)))return null;if(e.unshift(o),null===(t=this._findPattern(this.MIDDLE_PATTERN,t.end,!0,!1)))return null;for(n.push(t),r=0;r<6;r++){if(!(t=this._decodeCode(t.end,this.CODE_G_START)))return null;n.push(t),e.push(t.code)}return t},u.prototype._decode=function(){var t,e,n=[],r=[],o={};if(!(t=this._findStart()))return null;if(e={code:t.code,start:t.start,end:t.end},r.push(e),!(e=this._decodePayload(e,n,r)))return null;if(!(e=this._findEnd(e.end,!1)))return null;if(r.push(e),!this._checksum(n))return null;if(this.supplements.length>0){var i=this._decodeExtensions(e.end);if(!i)return null;var u=i.decodedCodes[i.decodedCodes.length-1],s={start:u.start+((u.end-u.start)/2|0),end:u.end};if(!this._verifyTrailingWhitespace(s))return null;o={supplement:i,code:n.join("")+i.code}}return a({code:n.join(""),start:t.start,end:e.end,codeset:"",startInfo:t,decodedCodes:r},o)},u.prototype._decodeExtensions=function(t){var e,n,r=this._nextSet(this._row,t),o=this._findPattern(this.EXTENSION_START_PATTERN,r,!1,!1);if(null===o)return null;for(e=0;e<this.supplements.length;e++)if(null!==(n=this.supplements[e].decode(this._row,o.end)))return{code:n.code,start:r,startInfo:o,end:n.end,codeset:"",decodedCodes:n.decodedCodes};return null},u.prototype._checksum=function(t){var e,n=0;for(e=t.length-2;e>=0;e-=2)n+=t[e];for(n*=3,e=t.length-1;e>=0;e-=2)n+=t[e];return n%10==0},u.CONFIG_KEYS={supplements:{type:"arrayOf(string)",default:[],description:"Allowed extensions to be decoded (2 and/or 5)"}},e.a=u},function(t,e,n){var r=n(38),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(t){var e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e}},function(t,e,n){var r=n(11),o=n(119),i=n(146),a="[object Null]",u="[object Undefined]",s=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?u:a:s&&s in Object(t)?o(t):i(t)}},function(t,e,n){"use strict";e.a={drawRect:function(t,e,n,r){n.strokeStyle=r.color,n.fillStyle=r.color,n.lineWidth=1,n.beginPath(),n.strokeRect(t.x,t.y,e.x,e.y)},drawPath:function(t,e,n,r){n.strokeStyle=r.color,n.fillStyle=r.color,n.lineWidth=r.lineWidth,n.beginPath(),n.moveTo(t[0][e.x],t[0][e.y]);for(var o=1;o<t.length;o++)n.lineTo(t[o][e.x],t[o][e.y]);n.closePath(),n.stroke()},drawImage:function(t,e,n){var r,o=n.getImageData(0,0,e.x,e.y),i=o.data,a=t.length,u=i.length;if(u/a!=4)return!1;for(;a--;)r=t[a],i[--u]=255,i[--u]=r,i[--u]=r,i[--u]=r;return n.putImageData(o,0,0),!0}}},function(t,e,n){var r=n(133),o=n(134),i=n(135),a=n(136),u=n(137);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=u,t.exports=s},function(t,e,n){var r=n(5).Symbol;t.exports=r},function(t,e,n){var r=n(17);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e,n){var r=n(2),o=n(130),i=n(154),a=n(165);t.exports=function(t,e){return r(t)?t:o(t,e)?[t]:i(a(t))}},function(t,e,n){var r=n(131);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){return!!(e=null==e?n:e)&&("number"==typeof t||r.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e,n){var r=n(22)(Object,"create");t.exports=r},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(96),o=n(6),i=Object.prototype,a=i.hasOwnProperty,u=i.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(t){return o(t)&&a.call(t,"callee")&&!u.call(t,"callee")};t.exports=s},function(t,e,n){"use strict";var r=n(50),o=n(3);e.b=function(t,e){return{x:t,y:e,toVec2:function(){return i.clone([this.x,this.y])},toVec3:function(){return a.clone([this.x,this.y,1])},round:function(){return this.x=this.x>0?Math.floor(this.x+.5):Math.floor(this.x-.5),this.y=this.y>0?Math.floor(this.y+.5):Math.floor(this.y-.5),this}}},e.f=function(t,e){var n=function(t,e){e||(e=8);var n,r=8-e;function i(t,e){var r,o=0;for(r=t;r<=e;r++)o+=n[r];return o}function a(t,e){var r,o=0;for(r=t;r<=e;r++)o+=r*n[r];return o}return function(){var r,u,s,c,f,l,h,d=[0],p=(1<<e)-1;for(n=function(t,e){e||(e=8);for(var n=t.data,r=n.length,o=8-e,i=new Int32Array(1<<e);r--;)i[n[r]>>o]++;return i}(t,e),c=1;c<p;c++)r=i(0,c),u=i(c+1,p),0==(s=r*u)&&(s=1),f=a(0,c)*u,l=a(c+1,p)*r,h=f-l,d[c]=h*h/s;return o.a.maxIndex(d)}()<<r}(t);return function(t,e,n){n||(n=t);for(var r=t.data,o=r.length,i=n.data;o--;)i[o]=r[o]<e?1:0}(t,n,e),n},e.g=function(t,e,n){var o,i,a,u,s=[];n||(n="rad");function c(t){var e=!1;for(i=0;i<s.length;i++)(a=s[i]).fits(t)&&(a.add(t),e=!0);return e}for(o=0;o<t.length;o++)c(u=r.a.createPoint(t[o],o,n))||s.push(r.a.create(u,e));return s},e.h=function(t,e,n){var r,o,i,a,u=0,s=0,c=[];for(r=0;r<e;r++)c[r]={score:0,item:null};for(r=0;r<t.length;r++)if((o=n.apply(this,[t[r]]))>s)for((i=c[u]).score=o,i.item=t[r],s=Number.MAX_VALUE,a=0;a<e;a++)c[a].score<s&&(s=c[a].score,u=a);return c},e.c=function(t,e,n){var r,o=0,i=e.x,a=Math.floor(t.length/4),u=e.x/2,s=0,c=e.x;for(;i<a;){for(r=0;r<u;r++)n[s]=(.299*t[4*o+0]+.587*t[4*o+1]+.114*t[4*o+2]+(.299*t[4*(o+1)+0]+.587*t[4*(o+1)+1]+.114*t[4*(o+1)+2])+(.299*t[4*i+0]+.587*t[4*i+1]+.114*t[4*i+2])+(.299*t[4*(i+1)+0]+.587*t[4*(i+1)+1]+.114*t[4*(i+1)+2]))/4,s++,o+=2,i+=2;o+=c,i+=c}},e.d=u,e.i=function(t,e){var n=t.data,r=t.size.x,o=e.data,i=0,a=r,u=n.length,s=r/2,c=0;for(;a<u;){for(var f=0;f<s;f++)o[c]=Math.floor((n[i]+n[i+1]+n[a]+n[a+1])/4),c++,i+=2,a+=2;i+=r,a+=r}},e.a=function(t,e){var n=t[0],r=t[1],o=t[2],i=o*r,a=i*(1-Math.abs(n/60%2-1)),u=o-i,s=0,c=0,f=0;e=e||[0,0,0],n<60?(s=i,c=a):n<120?(s=a,c=i):n<180?(c=i,f=a):n<240?(c=a,f=i):n<300?(s=a,f=i):n<360&&(s=i,f=a);return e[0]=255*(s+u)|0,e[1]=255*(c+u)|0,e[2]=255*(f+u)|0,e},e.e=function(t,e){var n,r=s(e.x),o=s(e.y),i=Math.max(e.x,e.y),a=function(t,e){var n=0,r=0,o=[];for(;n<t.length&&r<e.length;)t[n]===e[r]?(o.push(t[n]),n++,r++):t[n]>e[r]?r++:n++;return o}(r,o),u=[8,10,15,20,32,60,80],c={"x-small":5,small:4,medium:3,large:2,"x-large":1},f=c[t]||c.medium,l=u[f],h=Math.floor(i/l);function d(t){for(var e=0,n=t[Math.floor(t.length/2)];e<t.length-1&&t[e]<h;)e++;return e>0&&(n=Math.abs(t[e]-h)>Math.abs(t[e-1]-h)?t[e-1]:t[e]),h/n<u[f+1]/u[f]&&h/n>u[f-1]/u[f]?{x:n,y:n}:null}(n=d(a))||(n=d(s(i)))||(n=d(s(h*l)));return n},e.j=function(t,e,n){var r={width:t,height:e},o=Object.keys(n).reduce(function(t,e){var o=n[e],i=function(t){return{value:parseFloat(t),unit:(t.indexOf("%"),t.length,"%")}}(o),a=c[e](i,r);return t[e]=a,t},{});return{sx:o.left,sy:o.top,sw:o.right-o.left,sh:o.bottom-o.top}};var i={clone:n(7)},a={clone:n(83)};function u(t,e,n){var r,o=t.length/4|0;if(n&&!0===n.singleChannel)for(r=0;r<o;r++)e[r]=t[4*r+0];else for(r=0;r<o;r++)e[r]=.299*t[4*r+0]+.587*t[4*r+1]+.114*t[4*r+2]}function s(t){var e,n=[],r=[];for(e=1;e<Math.sqrt(t)+1;e++)t%e==0&&(r.push(e),e!==t/e&&n.unshift(Math.floor(t/e)));return r.concat(n)}var c={top:function(t,e){if("%"===t.unit)return Math.floor(e.height*(t.value/100))},right:function(t,e){if("%"===t.unit)return Math.floor(e.width-e.width*(t.value/100))},bottom:function(t,e){if("%"===t.unit)return Math.floor(e.height-e.height*(t.value/100))},left:function(t,e){if("%"===t.unit)return Math.floor(e.width*(t.value/100))}}},function(t,e,n){"use strict";var r=n(53),o=n(19),i=n(3),a={clone:n(7)};function u(t,e,n,r){e?this.data=e:n?(this.data=new n(t.x*t.y),n===Array&&r&&i.a.init(this.data,0)):(this.data=new Uint8Array(t.x*t.y),Uint8Array===Array&&r&&i.a.init(this.data,0)),this.size=t}u.prototype.inImageWithBorder=function(t,e){return t.x>=e&&t.y>=e&&t.x<this.size.x-e&&t.y<this.size.y-e},u.sample=function(t,e,n){var r=Math.floor(e),o=Math.floor(n),i=t.size.x,a=o*t.size.x+r,u=t.data[a+0],s=t.data[a+1],c=t.data[a+i],f=t.data[a+i+1],l=u-s;return e-=r,n-=o,Math.floor(e*(n*(l-c+f)-l)+n*(c-u)+u)},u.clearArray=function(t){for(var e=t.length;e--;)t[e]=0},u.prototype.subImage=function(t,e){return new r.a(t,e,this)},u.prototype.subImageAsCopy=function(t,e){var n,r,o=t.size.y,i=t.size.x;for(n=0;n<i;n++)for(r=0;r<o;r++)t.data[r*i+n]=this.data[(e.y+r)*this.size.x+e.x+n]},u.prototype.copyTo=function(t){for(var e=this.data.length,n=this.data,r=t.data;e--;)r[e]=n[e]},u.prototype.get=function(t,e){return this.data[e*this.size.x+t]},u.prototype.getSafe=function(t,e){var n;if(!this.indexMapping){for(this.indexMapping={x:[],y:[]},n=0;n<this.size.x;n++)this.indexMapping.x[n]=n,this.indexMapping.x[n+this.size.x]=n;for(n=0;n<this.size.y;n++)this.indexMapping.y[n]=n,this.indexMapping.y[n+this.size.y]=n}return this.data[this.indexMapping.y[e+this.size.y]*this.size.x+this.indexMapping.x[t+this.size.x]]},u.prototype.set=function(t,e,n){return this.data[e*this.size.x+t]=n,this},u.prototype.zeroBorder=function(){var t,e=this.size.x,n=this.size.y,r=this.data;for(t=0;t<e;t++)r[t]=r[(n-1)*e+t]=0;for(t=1;t<n-1;t++)r[t*e]=r[t*e+(e-1)]=0},u.prototype.invert=function(){for(var t=this.data,e=t.length;e--;)t[e]=t[e]?0:1},u.prototype.convolve=function(t){var e,n,r,o,i=t.length/2|0,a=0;for(n=0;n<this.size.y;n++)for(e=0;e<this.size.x;e++){for(a=0,o=-i;o<=i;o++)for(r=-i;r<=i;r++)a+=t[o+i][r+i]*this.getSafe(e+r,n+o);this.data[n*this.size.x+e]=a}},u.prototype.moments=function(t){var e,n,r,o,i,u,s,c,f,l,h=this.data,d=this.size.y,p=this.size.x,v=[],g=[],_=Math.PI,y=_/4;if(t<=0)return g;for(i=0;i<t;i++)v[i]={m00:0,m01:0,m10:0,m11:0,m02:0,m20:0,theta:0,rad:0};for(n=0;n<d;n++)for(o=n*n,e=0;e<p;e++)(r=h[n*p+e])>0&&((u=v[r-1]).m00+=1,u.m01+=n,u.m10+=e,u.m11+=e*n,u.m02+=o,u.m20+=e*e);for(i=0;i<t;i++)u=v[i],isNaN(u.m00)||0===u.m00||(c=u.m10/u.m00,f=u.m01/u.m00,s=u.m11/u.m00-c*f,l=(u.m02/u.m00-f*f-(u.m20/u.m00-c*c))/(2*s),l=.5*Math.atan(l)+(s>=0?y:-y)+_,u.theta=(180*l/_+90)%180-90,u.theta<0&&(u.theta+=180),u.rad=l>_?l-_:l,u.vec=a.clone([Math.cos(l),Math.sin(l)]),g.push(u));return g},u.prototype.show=function(t,e){var n,r,o,i,a,u,s;for(e||(e=1),n=t.getContext("2d"),t.width=this.size.x,t.height=this.size.y,o=(r=n.getImageData(0,0,t.width,t.height)).data,i=0,s=0;s<this.size.y;s++)for(u=0;u<this.size.x;u++)a=s*this.size.x+u,i=this.get(u,s)*e,o[4*a+0]=i,o[4*a+1]=i,o[4*a+2]=i,o[4*a+3]=255;n.putImageData(r,0,0)},u.prototype.overlay=function(t,e,r){(!e||e<0||e>360)&&(e=360);for(var i=[0,1,1],a=[0,0,0],u=[255,255,255],s=[0,0,0],c=[],f=t.getContext("2d"),l=f.getImageData(r.x,r.y,this.size.x,this.size.y),h=l.data,d=this.data.length;d--;)i[0]=this.data[d]*e,c=i[0]<=0?u:i[0]>=360?s:n.i(o.a)(i,a),h[4*d+0]=c[0],h[4*d+1]=c[1],h[4*d+2]=c[2],h[4*d+3]=255;f.putImageData(l,r.x,r.y)},e.a=u},function(t,e,n){var r=n(37);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},function(t,e,n){var r=n(97),o=n(120);t.exports=function(t,e){var n=o(t,e);return r(n)?n:void 0}},function(t,e,n){var r=n(27),o=1/0;t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-o?"-0":e}},function(t,e,n){var r=n(25),o=n(26);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)}},function(t,e,n){var r=n(8),o=n(0),i="[object AsyncFunction]",a="[object Function]",u="[object GeneratorFunction]",s="[object Proxy]";t.exports=function(t){if(!o(t))return!1;var e=r(t);return e==a||e==u||e==i||e==s}},function(t,e){var n=9007199254740991;t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}},function(t,e,n){var r=n(8),o=n(6),i="[object Symbol]";t.exports=function(t){return"symbol"==typeof t||o(t)&&r(t)==i}},function(t,e,n){var r=n(100),o=n(116)(function(t,e,n){r(t,e,n)});t.exports=o},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";e.a={searchDirections:[[0,1],[1,1],[1,0],[1,-1],[0,-1],[-1,-1],[-1,0],[-1,1]],create:function(t,e){var n,r=t.data,o=e.data,i=this.searchDirections,a=t.size.x;function u(t,e,u,s){var c,f,l;for(c=0;c<7;c++){if(f=t.cy+i[t.dir][0],l=t.cx+i[t.dir][1],r[n=f*a+l]===e&&(0===o[n]||o[n]===u))return o[n]=u,t.cy=f,t.cx=l,!0;0===o[n]&&(o[n]=s),t.dir=(t.dir+1)%8}return!1}function s(t,e,n){return{dir:n,x:t,y:e,next:null,prev:null}}return{trace:function(t,e,n,r){return u(t,e,n,r)},contourTracing:function(t,e,n,r,o){return function(t,e,n,r,o){var i,a,c,f=null,l={cx:e,cy:t,dir:0};if(u(l,r,n,o)){i=f=s(e,t,l.dir),c=l.dir,(a=s(l.cx,l.cy,0)).prev=i,i.next=a,a.next=null,i=a;do{l.dir=(l.dir+6)%8,u(l,r,n,o),c!==l.dir?(i.dir=l.dir,(a=s(l.cx,l.cy,0)).prev=i,i.next=a,a.next=null,i=a):(i.dir=c,i.x=l.cx,i.y=l.cy),c=l.dir}while(l.cx!==e||l.cy!==t);f.prev=i.prev,i.prev.next=f}return f}(t,e,n,r,o)}}}}},function(t,e,n){"use strict";var r=n(1),o=n(3);function i(){r.a.call(this)}i.prototype=Object.create(r.a.prototype,{ALPHABETH_STRING:{value:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%"},ALPHABET:{value:[48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,45,46,32,42,36,47,43,37]},CHARACTER_ENCODINGS:{value:[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,148,168,162,138,42]},ASTERISK:{value:148},FORMAT:{value:"code_39",writeable:!1}}),i.prototype.constructor=i,i.prototype._decode=function(){var t,e,n,r,i=[0,0,0,0,0,0,0,0,0],a=[],u=this._findStart();if(!u)return null;r=this._nextSet(this._row,u.end);do{if(i=this._toCounters(r,i),(n=this._toPattern(i))<0)return null;if((t=this._patternToChar(n))<0)return null;a.push(t),e=r,r+=o.a.sum(i),r=this._nextSet(this._row,r)}while("*"!==t);return a.pop(),a.length&&this._verifyTrailingWhitespace(e,r,i)?{code:a.join(""),start:u.start,end:r,startInfo:u,decodedCodes:a}:null},i.prototype._verifyTrailingWhitespace=function(t,e,n){var r=o.a.sum(n);return 3*(e-t-r)>=r},i.prototype._patternToChar=function(t){var e;for(e=0;e<this.CHARACTER_ENCODINGS.length;e++)if(this.CHARACTER_ENCODINGS[e]===t)return String.fromCharCode(this.ALPHABET[e]);return-1},i.prototype._findNextWidth=function(t,e){var n,r=Number.MAX_VALUE;for(n=0;n<t.length;n++)t[n]<r&&t[n]>e&&(r=t[n]);return r},i.prototype._toPattern=function(t){for(var e,n,r=t.length,o=0,i=r,a=0;i>3;){for(o=this._findNextWidth(t,o),i=0,e=0,n=0;n<r;n++)t[n]>o&&(e|=1<<r-1-n,i++,a+=t[n]);if(3===i){for(n=0;n<r&&i>0;n++)if(t[n]>o&&(i--,2*t[n]>=a))return-1;return e}}return-1},i.prototype._findStart=function(){var t,e,n,r=this._nextSet(this._row),o=r,i=[0,0,0,0,0,0,0,0,0],a=0,u=!1;for(t=r;t<this._row.length;t++)if(this._row[t]^u)i[a]++;else{if(a===i.length-1){if(this._toPattern(i)===this.ASTERISK&&(n=Math.floor(Math.max(0,o-(t-o)/4)),this._matchRange(n,o,0)))return{start:o,end:t};for(o+=i[0]+i[1],e=0;e<7;e++)i[e]=i[e+2];i[7]=0,i[8]=0,a--}else a++;i[a]=1,u=!u}return null},e.a=i},function(t,e){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]}},function(t,e,n){var r=n(22)(n(5),"Map");t.exports=r},function(t,e,n){var r=n(138),o=n(139),i=n(140),a=n(141),u=n(142);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=u,t.exports=s},function(t,e,n){var r=n(21),o=n(17);t.exports=function(t,e,n){(void 0===n||o(t[e],n))&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(21),o=n(17),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];i.call(t,e)&&o(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(22),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(e,n(47))},function(t,e,n){var r=n(147)(Object.getPrototypeOf,Object);t.exports=r},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){var r=n(87),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,u=o(i.length-e,0),s=Array(u);++a<u;)s[a]=i[e+a];a=-1;for(var c=Array(e+1);++a<e;)c[a]=i[a];return c[e]=n(s),r(t,this,c)}}},function(t,e,n){var r=n(106),o=n(148)(r);t.exports=o},function(t,e){t.exports=function(t){return t}},function(t,e,n){(function(t){var r=n(5),o=n(163),i="object"==typeof e&&e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,u=a&&a.exports===i?r.Buffer:void 0,s=(u?u.isBuffer:void 0)||o;t.exports=s}).call(e,n(29)(t))},function(t,e,n){var r=n(98),o=n(109),i=n(145),a=i&&i.isTypedArray,u=a?o(a):r;t.exports=u},function(t,e,n){var r=n(88),o=n(99),i=n(24);t.exports=function(t){return i(t)?r(t,!0):o(t)}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o,i,a,u,s,c,f,l=r(28),h=r.n(l),d=r(54),p=(r.n(d),r(20)),v=r(64),g=r(57),_=r(51),y=r(59),m=r(9),x=r(49),b=r(56),C=r(63),E=r(61),w=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},R={clone:r(7)},O={ctx:{image:null,overlay:null},dom:{image:null,overlay:null}},A=[],T=!0,S={};function D(t){!function(t){u=t||new p.a({x:o.getWidth(),y:o.getHeight()});console.log(u.size);s=[R.clone([0,0]),R.clone([0,u.size.y]),R.clone([u.size.x,u.size.y]),R.clone([u.size.x,0])],v.a.init(u,S.locator)}(t),c=g.a.create(S.decoder,u)}function P(t){var e;if("VideoStream"===S.inputStream.type)e=document.createElement("video"),o=C.a.createVideoStream(e);else if("ImageStream"===S.inputStream.type)o=C.a.createImageStream();else if("LiveStream"===S.inputStream.type){var n=M();n&&((e=n.querySelector("video"))||(e=document.createElement("video"),n.appendChild(e))),o=C.a.createLiveStream(e),y.a.request(e,S.inputStream.constraints).then(function(){o.trigger("canrecord")}).catch(function(e){return t(e)})}o.setAttribute("preload","auto"),o.setInputStream(S.inputStream),o.addEventListener("canrecord",function(t){v.a.checkImageConstraints(o,S.locator),function(){if("undefined"!=typeof document){var t=M();if(O.dom.image=document.querySelector("canvas.imgBuffer"),O.dom.image||(O.dom.image=document.createElement("canvas"),O.dom.image.className="imgBuffer",t&&"ImageStream"===S.inputStream.type&&t.appendChild(O.dom.image)),O.ctx.image=O.dom.image.getContext("2d"),O.dom.image.width=o.getCanvasSize().x,O.dom.image.height=o.getCanvasSize().y,O.dom.overlay=document.querySelector("canvas.drawingBuffer"),!O.dom.overlay){O.dom.overlay=document.createElement("canvas"),O.dom.overlay.className="drawingBuffer",t&&t.appendChild(O.dom.overlay);var e=document.createElement("br");e.setAttribute("clear","all"),t&&t.appendChild(e)}O.ctx.overlay=O.dom.overlay.getContext("2d"),O.dom.overlay.width=o.getCanvasSize().x,O.dom.overlay.height=o.getCanvasSize().y}}(),i=E.a.create(o,O.dom.image),L(S.numOfWorkers,function(){0===S.numOfWorkers&&D(),function(t){o.play(),t()}(t)})}.bind(void 0,t))}function M(){var t=S.inputStream.target;if(t&&t.nodeName&&1===t.nodeType)return t;var e="string"==typeof t?t:"#interactive.viewport";return document.querySelector(e)}function I(t,e){var n=t;t&&T&&(!function t(e){var n,r=o.getTopRight(),i=r.x,a=r.y;if(0!==i||0!==a){if(e.barcodes)for(n=0;n<e.barcodes.length;n++)t(e.barcodes[n]);var u;if(e.line&&2===e.line.length&&((u=e.line)[0].x+=i,u[0].y+=a,u[1].x+=i,u[1].y+=a),e.box&&s(e.box),e.boxes&&e.boxes.length>0)for(n=0;n<e.boxes.length;n++)s(e.boxes[n])}function s(t){for(var e=t.length;e--;)t[e][0]+=i,t[e][1]+=a}}(t),function t(e,n){n&&f&&(e.barcodes?e.barcodes.filter(function(t){return t.codeResult}).forEach(function(e){return t(e,n)}):e.codeResult&&f.addResult(n,o.getCanvasSize(),e.codeResult))}(t,e),n=t.barcodes||t),_.a.publish("processed",n),function(t){return t&&(t.barcodes?t.barcodes.some(function(t){return t.codeResult}):t.codeResult)}(t)&&_.a.publish("detected",n)}function N(){var t,e;(e=S.locate?v.a.locate():[[R.clone(s[0]),R.clone(s[1]),R.clone(s[2]),R.clone(s[3])]])?((t=(t=c.decodeFromBoundingBoxes(e))||{}).boxes=e,I(t,u.data)):I()}function z(){var t;if(T){if(A.length>0){if(!(t=A.filter(function(t){return!t.busy})[0]))return;i.attachData(t.imageData)}else i.attachData(u.data);i.grab()&&(t?(t.busy=!0,t.worker.postMessage({cmd:"process",imageData:t.imageData},[t.imageData.buffer])):N())}else N()}function j(){var t,e;T&&"LiveStream"===S.inputStream.type?(t=null,e=1e3/(S.frequency||60),a=!1,function n(r){t=t||r,a||(r>=t&&(t+=e,z()),window.requestAnimFrame(n))}(performance.now())):z()}function U(e){var n,r,i={worker:void 0,imageData:new Uint8Array(o.getWidth()*o.getHeight()),busy:!0};n=function(){var e,n;void 0!==t&&(n=t);return e=new Blob(["("+function(t){if(t){var e=t().default;if(!e)return void self.postMessage({event:"error",message:"Quagga could not be created"})}var n;function r(t){self.postMessage({event:"processed",imageData:n.data,result:t},[n.data.buffer])}function o(){self.postMessage({event:"initialized",imageData:n.data},[n.data.buffer])}self.onmessage=function(t){if("init"===t.data.cmd){var i=t.data.config;i.numOfWorkers=0,n=new e.ImageWrapper({x:t.data.size.x,y:t.data.size.y},new Uint8Array(t.data.imageData)),e.init(i,o,n),e.onProcessed(r)}else"process"===t.data.cmd?(n.data=new Uint8Array(t.data.imageData),e.start()):"setReaders"===t.data.cmd&&e.setReaders(t.data.readers)}}.toString()+")("+n+");"],{type:"text/javascript"}),window.URL.createObjectURL(e)}(),i.worker=new Worker(n),i.worker.onmessage=function(t){if("initialized"===t.data.event)return URL.revokeObjectURL(n),i.busy=!1,i.imageData=new Uint8Array(t.data.imageData),console.log("Worker initialized"),e(i);"processed"===t.data.event?(i.imageData=new Uint8Array(t.data.imageData),i.busy=!1,I(t.data.result,i.imageData)):"error"===t.data.event&&console.log("Worker error: "+t.data.message)},i.worker.postMessage({cmd:"init",size:{x:o.getWidth(),y:o.getHeight()},imageData:i.imageData,config:(r=S,w({},r,{inputStream:w({},r.inputStream,{target:null})}))},[i.imageData.buffer])}function L(t,e){var n=t-A.length;if(0===n)return e&&e();if(n<0)return A.slice(n).forEach(function(t){t.worker.terminate(),console.log("Worker terminated!")}),A=A.slice(0,n),e&&e();for(var r=function(n){A.push(n),A.length>=t&&e&&e()},o=0;o<n;o++)U(r)}n.default={init:function(t,e,n){if(S=h()({},b.a,t),n)return T=!1,D(n),e();P(e)},start:function(){j()},stop:function(){a=!0,L(0),"LiveStream"===S.inputStream.type&&(y.a.release(),o.clearEventHandlers())},pause:function(){a=!0},onDetected:function(t){_.a.subscribe("detected",t)},offDetected:function(t){_.a.unsubscribe("detected",t)},onProcessed:function(t){_.a.subscribe("processed",t)},offProcessed:function(t){_.a.unsubscribe("processed",t)},setReaders:function(t){!function(t){c?c.setReaders(t):T&&A.length>0&&A.forEach(function(e){e.worker.postMessage({cmd:"setReaders",readers:t})})}(t)},registerResultCollector:function(t){t&&"function"==typeof t.addResult&&(f=t)},canvas:O,decodeSingle:function(t,e){var n=this;t=h()({inputStream:{type:"ImageStream",sequence:!1,size:800,src:t.src},numOfWorkers:t.debug?0:1,locator:{halfSample:!1}},t),this.init(t,function(){_.a.once("processed",function(t){n.stop(),e.call(null,t)},!0),j()})},ImageWrapper:p.a,ImageDebug:m.a,ResultCollector:x.a,CameraAccess:y.a}},function(t,e,n){"use strict";var r=n(9);e.a={create:function(t){var e=document.createElement("canvas"),n=e.getContext("2d"),o=[],i=t.capacity||20,a=!0===t.capture;function u(e){return i&&e&&!function(t,e){return!!e&&e.some(function(e){return Object.keys(e).every(function(n){return e[n]===t[n]})})}(e,t.blacklist)&&function(t,e){return"function"!=typeof e||e(t)}(e,t.filter)}return{addResult:function(t,s,c){var f={};u(c)&&(i--,f.codeResult=c,a&&(e.width=s.x,e.height=s.y,r.a.drawImage(t,s,n),f.frame=e.toDataURL()),o.push(f))},getResults:function(){return o}}}}},function(t,e,n){"use strict";var r={clone:n(7),dot:n(32)};e.a={create:function(t,e){var n=[],o={rad:0,vec:r.clone([0,0])},i={};function a(t){i[t.id]=t,n.push(t)}function u(){var t,e=0;for(t=0;t<n.length;t++)e+=n[t].rad;o.rad=e/n.length,o.vec=r.clone([Math.cos(o.rad),Math.sin(o.rad)])}return a(t),u(),{add:function(t){i[t.id]||(a(t),u())},fits:function(t){return Math.abs(r.dot(t.point.vec,o.vec))>e},getPoints:function(){return n},getCenter:function(){return o}}},createPoint:function(t,e,n){return{rad:t[n],point:t,id:e}}}},function(t,e,n){"use strict";e.a=function(){var t={};function e(e){return t[e]||(t[e]={subscribers:[]}),t[e]}function n(t,e){t.async?setTimeout(function(){t.callback(e)},4):t.callback(e)}function r(t,n,r){var o;if("function"==typeof n)o={callback:n,async:r};else if(!(o=n).callback)throw"Callback was not specified on options";e(t).subscribers.push(o)}return{subscribe:function(t,e,n){return r(t,e,n)},publish:function(t,r){var o=e(t),i=o.subscribers;i.filter(function(t){return!!t.once}).forEach(function(t){n(t,r)}),o.subscribers=i.filter(function(t){return!t.once}),o.subscribers.forEach(function(t){n(t,r)})},once:function(t,e,n){r(t,{callback:e,async:n,once:!0})},unsubscribe:function(n,r){var o;n?(o=e(n)).subscribers=o&&r?o.subscribers.filter(function(t){return t.callback!==r}):[]:t={}}}}()},function(t,e,n){"use strict";e.b=function(){if(navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.enumerateDevices)return navigator.mediaDevices.enumerateDevices();return Promise.reject(new Error("enumerateDevices is not defined"))},e.a=function(t){if(navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getUserMedia)return navigator.mediaDevices.getUserMedia(t);return Promise.reject(new Error("getUserMedia is not defined"))}},function(t,e,n){"use strict";function r(t,e,n){n||(n={data:null,size:e}),this.data=n.data,this.originalSize=n.size,this.I=n,this.from=t,this.size=e}r.prototype.show=function(t,e){var n,r,o,i,a,u,s;for(e||(e=1),n=t.getContext("2d"),t.width=this.size.x,t.height=this.size.y,o=(r=n.getImageData(0,0,t.width,t.height)).data,i=0,a=0;a<this.size.y;a++)for(u=0;u<this.size.x;u++)s=a*this.size.x+u,i=this.get(u,a)*e,o[4*s+0]=i,o[4*s+1]=i,o[4*s+2]=i,o[4*s+3]=255;r.data=o,n.putImageData(r,0,0)},r.prototype.get=function(t,e){return this.data[(this.from.y+e)*this.originalSize.x+this.from.x+t]},r.prototype.updateData=function(t){this.originalSize=t.size,this.data=t.data},r.prototype.updateFrom=function(t){return this.from=t,this},e.a=r},function(t,e){"undefined"!=typeof window&&(window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}),Math.imul=Math.imul||function(t,e){var n=65535&t,r=65535&e;return n*r+((t>>>16&65535)*r+n*(e>>>16&65535)<<16>>>0)|0},"function"!=typeof Object.assign&&(Object.assign=function(t){"use strict";if(null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(null!==r)for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e})},function(t,e){t.exports={inputStream:{name:"Live",type:"LiveStream",constraints:{width:640,height:480,facingMode:"environment"},area:{top:"0%",right:"0%",left:"0%",bottom:"0%"},singleChannel:!1},locate:!0,numOfWorkers:0,decoder:{readers:["code_128_reader"],debug:{drawBoundingBox:!1,showFrequency:!1,drawScanline:!1,showPattern:!1}},locator:{halfSample:!0,patchSize:"medium",debug:{showCanvas:!1,showPatches:!1,showFoundPatches:!1,showSkeleton:!1,showLabels:!1,showPatchLabels:!1,showRemainingPatchLabels:!1,boxFromPatches:{showTransformed:!1,showTransformedBox:!1,showBB:!1}}}}},function(t,e,n){"use strict";var r=void 0;r=n(55),e.a=r},function(t,e,n){"use strict";var r=n(58),o=n(9),i=n(69),a=n(4),u=n(31),s=n(70),c=n(68),f=n(77),l=n(74),h=n(72),d=n(73),p=n(76),v=n(75),g=n(67),_=n(71),y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m={code_128_reader:i.a,ean_reader:a.a,ean_5_reader:d.a,ean_2_reader:h.a,ean_8_reader:l.a,code_39_reader:u.a,code_39_vin_reader:s.a,codabar_reader:c.a,upc_reader:f.a,upc_e_reader:p.a,i2of5_reader:v.a,"2of5_reader":g.a,code_93_reader:_.a};e.a={create:function(t,e){var n={ctx:{frequency:null,pattern:null,overlay:null},dom:{frequency:null,pattern:null,overlay:null}},i=[];function a(){t.readers.forEach(function(t){var e,n={},r=[];"object"===(void 0===t?"undefined":y(t))?(e=t.format,n=t.config):"string"==typeof t&&(e=t),console.log("Before registering reader: ",e),n.supplements&&(r=n.supplements.map(function(t){return new m[t]})),i.push(new m[e](n,r))}),console.log("Registered Readers: "+i.map(function(t){return JSON.stringify({format:t.FORMAT,config:t.config})}).join(", "))}function u(a){var u,s=null,c=r.a.getBarcodeLine(e,a[0],a[1]);for(t.debug.showFrequency&&(o.a.drawPath(a,{x:"x",y:"y"},n.ctx.overlay,{color:"red",lineWidth:3}),r.a.debug.printFrequency(c.line,n.dom.frequency)),r.a.toBinaryLine(c),t.debug.showPattern&&r.a.debug.printPattern(c.line,n.dom.pattern),u=0;u<i.length&&null===s;u++)s=i[u].decodePattern(c.line);return null===s?null:{codeResult:s,barcodeLine:c}}function s(r){var i,a,s,c,f=n.ctx.overlay;return t.debug.drawBoundingBox&&f&&o.a.drawPath(r,{x:0,y:1},f,{color:"blue",lineWidth:2}),c=function(t){return Math.sqrt(Math.pow(Math.abs(t[1].y-t[0].y),2)+Math.pow(Math.abs(t[1].x-t[0].x),2))}(i=function(t){return[{x:(t[1][0]-t[0][0])/2+t[0][0],y:(t[1][1]-t[0][1])/2+t[0][1]},{x:(t[3][0]-t[2][0])/2+t[2][0],y:(t[3][1]-t[2][1])/2+t[2][1]}]}(r)),null===(i=function(t,n,r){function o(e){var r=e*Math.sin(n),o=e*Math.cos(n);t[0].y-=r,t[0].x-=o,t[1].y+=r,t[1].x+=o}for(o(r);r>1&&(!e.inImageWithBorder(t[0],0)||!e.inImageWithBorder(t[1],0));)o(-(r-=Math.ceil(r/2)));return t}(i,a=Math.atan2(i[1].y-i[0].y,i[1].x-i[0].x),Math.floor(.1*c)))?null:(null===(s=u(i))&&(s=function(t,e,n){var r,o,i,a=Math.sqrt(Math.pow(t[1][0]-t[0][0],2)+Math.pow(t[1][1]-t[0][1],2)),s=null,c=Math.sin(n),f=Math.cos(n);for(r=1;r<16&&null===s;r++)i={y:(o=a/16*r*(r%2==0?-1:1))*c,x:o*f},e[0].y+=i.x,e[0].x-=i.y,e[1].y+=i.x,e[1].x-=i.y,s=u(e);return s}(r,i,a)),null===s?null:(s&&t.debug.drawScanline&&f&&o.a.drawPath(i,{x:"x",y:"y"},f,{color:"red",lineWidth:3}),{codeResult:s.codeResult,line:i,angle:a,pattern:s.barcodeLine.line,threshold:s.barcodeLine.threshold}))}return function(){if("undefined"!=typeof document){var t=document.querySelector("#debug.detection");n.dom.frequency=document.querySelector("canvas.frequency"),n.dom.frequency||(n.dom.frequency=document.createElement("canvas"),n.dom.frequency.className="frequency",t&&t.appendChild(n.dom.frequency)),n.ctx.frequency=n.dom.frequency.getContext("2d"),n.dom.pattern=document.querySelector("canvas.patternBuffer"),n.dom.pattern||(n.dom.pattern=document.createElement("canvas"),n.dom.pattern.className="patternBuffer",t&&t.appendChild(n.dom.pattern)),n.ctx.pattern=n.dom.pattern.getContext("2d"),n.dom.overlay=document.querySelector("canvas.drawingBuffer"),n.dom.overlay&&(n.ctx.overlay=n.dom.overlay.getContext("2d"))}}(),a(),function(){if("undefined"!=typeof document){var e,r=[{node:n.dom.frequency,prop:t.debug.showFrequency},{node:n.dom.pattern,prop:t.debug.showPattern}];for(e=0;e<r.length;e++)!0===r[e].prop?r[e].node.style.display="block":r[e].node.style.display="none"}}(),{decodeFromBoundingBox:function(t){return s(t)},decodeFromBoundingBoxes:function(e){var n,r,o=[],i=t.multiple;for(n=0;n<e.length;n++){var a=e[n];if((r=s(a)||{}).box=a,i)o.push(r);else if(r.codeResult)return r}if(i)return{barcodes:o}},setReaders:function(e){t.readers=e,i.length=0,a()}}}}},function(t,e,n){"use strict";n(20);var r={},o={UP:1,DOWN:-1};r.getBarcodeLine=function(t,e,n){var r,o,i,a,u,s,c,f,l=0|e.x,h=0|e.y,d=0|n.x,p=0|n.y,v=Math.abs(p-h)>Math.abs(d-l),g=[],_=t.data,y=t.size.x,m=255,x=0;function b(t,e){f=_[e*y+t],f,m=f<m?f:m,x=f>x?f:x,g.push(f)}for(v&&(s=l,l=h,h=s,s=d,d=p,p=s),l>d&&(s=l,l=d,d=s,s=h,h=p,p=s),r=d-l,o=Math.abs(p-h),i=r/2|0,u=h,a=h<p?1:-1,c=l;c<d;c++)v?b(u,c):b(c,u),(i-=o)<0&&(u+=a,i+=r);return{line:g,min:m,max:x}},r.toBinaryLine=function(t){var e,n,r,i,a,u,s=t.min,c=t.max,f=t.line,l=s+(c-s)/2,h=[],d=(c-s)/12,p=-d;for(r=f[0]>l?o.UP:o.DOWN,h.push({pos:0,val:f[0]}),a=0;a<f.length-2;a++)r!==(i=(e=f[a+1]-f[a])+(n=f[a+2]-f[a+1])<p&&f[a+1]<1.5*l?o.DOWN:e+n>d&&f[a+1]>.5*l?o.UP:r)&&(h.push({pos:a,val:f[a]}),r=i);for(h.push({pos:f.length,val:f[f.length-1]}),u=h[0].pos;u<h[1].pos;u++)f[u]=f[u]>l?0:1;for(a=1;a<h.length-1;a++)for(d=h[a+1].val>h[a].val?h[a].val+(h[a+1].val-h[a].val)/3*2|0:h[a+1].val+(h[a].val-h[a+1].val)/3|0,u=h[a].pos;u<h[a+1].pos;u++)f[u]=f[u]>d?0:1;return{line:f,threshold:d}},r.debug={printFrequency:function(t,e){var n,r=e.getContext("2d");for(e.width=t.length,e.height=256,r.beginPath(),r.strokeStyle="blue",n=0;n<t.length;n++)r.moveTo(n,255),r.lineTo(n,255-t[n]);r.stroke(),r.closePath()},printPattern:function(t,e){var n,r=e.getContext("2d");for(e.width=t.length,r.fillColor="black",n=0;n<t.length;n++)1===t[n]&&r.fillRect(n,0,1,100)}},e.a=r},function(t,e,n){"use strict";var r,o=n(162),i=n.n(o),a=n(52);function u(t,e){return n.i(a.a)(e).then(function(e){return new Promise(function(n){r=e,t.setAttribute("autoplay",!0),t.setAttribute("muted",!0),t.setAttribute("playsinline",!0),t.srcObject=e,t.addEventListener("loadedmetadata",function(){t.play(),n()})})}).then(function(t){return new Promise(function(e,n){var r=10;!function o(){r>0?t.videoWidth>10&&t.videoHeight>10?(console.log(t.videoWidth+"px x "+t.videoHeight+"px"),e()):window.setTimeout(o,500):n("Unable to play video stream. Is webcam working?"),r--}()})}.bind(null,t))}function s(t){var e={audio:!1,video:function(t){var e=i()(t,["width","height","facingMode","aspectRatio","deviceId"]);return void 0!==t.minAspectRatio&&t.minAspectRatio>0&&(e.aspectRatio=t.minAspectRatio,console.log("WARNING: Constraint 'minAspectRatio' is deprecated; Use 'aspectRatio' instead")),void 0!==t.facing&&(e.facingMode=t.facing,console.log("WARNING: Constraint 'facing' is deprecated. Use 'facingMode' instead'")),e}(t)};return e.video.deviceId&&e.video.facingMode&&delete e.video.facingMode,Promise.resolve(e)}function c(){if(r){var t=r.getVideoTracks();if(t&&t.length)return t[0]}}e.a={request:function(t,e){return s(e).then(u.bind(null,t))},release:function(){var t=r&&r.getVideoTracks();t&&t.length&&t[0].stop(),r=null},enumerateVideoDevices:function(){return n.i(a.b)().then(function(t){return t.filter(function(t){return"videoinput"===t.kind})})},getActiveStreamLabel:function(){var t=c();return t?t.label:""},getActiveTrack:c}},function(t,e,n){"use strict";e.a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;if(/^blob\:/i.test(t))return(n=t,new Promise(function(t,e){var r=new XMLHttpRequest;r.open("GET",n,!0),r.responseType="blob",r.onreadystatechange=function(){r.readyState!==XMLHttpRequest.DONE||200!==r.status&&0!==r.status||t(this.response)},r.onerror=e,r.send()})).then(i).then(function(t){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,n=new DataView(t),i=t.byteLength,u=e.reduce(function(t,e){var n=Object.keys(r).filter(function(t){return r[t]===e})[0];return n&&(t[n]=e),t},{}),s=2;if(255!==n.getUint8(0)||216!==n.getUint8(1))return!1;for(;s<i;){if(255!==n.getUint8(s))return!1;if(225===n.getUint8(s+1))return a(n,s+4,u);s+=2+n.getUint16(s+2)}}(t,e)});var n;return Promise.resolve(null)};var r={274:"orientation"},o=Object.keys(r).map(function(t){return r[t]});function i(t){return new Promise(function(e){var n=new FileReader;n.onload=function(t){return e(t.target.result)},n.readAsArrayBuffer(t)})}function a(t,e,n){if("Exif"!==function(t,e,n){for(var r="",o=e;o<e+n;o++)r+=String.fromCharCode(t.getUint8(o));return r}(t,e,4))return!1;var r=e+6,o=void 0;if(18761===t.getUint16(r))o=!1;else{if(19789!==t.getUint16(r))return!1;o=!0}if(42!==t.getUint16(r+2,!o))return!1;var i=t.getUint32(r+4,!o);return!(i<8)&&function(t,e,n,r,o){for(var i=t.getUint16(n,!o),a={},s=0;s<i;s++){var c=n+12*s+2,f=r[t.getUint16(c,!o)];f&&(a[f]=u(t,c,e,n,o))}return a}(t,r,r+i,n,o)}function u(t,e,n,r,o){var i=t.getUint16(e+2,!o),a=t.getUint32(e+4,!o);switch(i){case 3:if(1===a)return t.getUint16(e+8,!o)}}},function(t,e,n){"use strict";var r=n(19),o=Math.PI/180;var i={};i.create=function(t,e){var i,a={},u=t.getConfig(),s=n.i(r.b)(t.getRealWidth(),t.getRealHeight()),c=t.getCanvasSize(),f=n.i(r.b)(t.getWidth(),t.getHeight()),l=t.getTopRight(),h=l.x,d=l.y,p=null,v=null;return(i=e||document.createElement("canvas")).width=c.x,i.height=c.y,p=i.getContext("2d"),v=new Uint8Array(f.x*f.y),console.log("FrameGrabber",JSON.stringify({size:f,topRight:l,videoSize:s,canvasSize:c})),a.attachData=function(t){v=t},a.getData=function(){return v},a.grab=function(){var e,a,s,l=u.halfSample,g=t.getFrame(),_=g,y=0;if(_){if(s=c,(a=i).width!==s.x&&(console.log("WARNING: canvas-size needs to be adjusted"),a.width=s.x),a.height!==s.y&&(console.log("WARNING: canvas-size needs to be adjusted"),a.height=s.y),"ImageStream"===u.type&&(_=g.img,g.tags&&g.tags.orientation))switch(g.tags.orientation){case 6:y=90*o;break;case 8:y=-90*o}return 0!==y?(p.translate(c.x/2,c.y/2),p.rotate(y),p.drawImage(_,-c.y/2,-c.x/2,c.y,c.x),p.rotate(-y),p.translate(-c.x/2,-c.y/2)):p.drawImage(_,0,0,c.x,c.y),e=p.getImageData(h,d,f.x,f.y).data,l?n.i(r.c)(e,f,v):n.i(r.d)(e,v,u),!0}return!1},a.getSize=function(){return f},a},e.a=i},function(t,e,n){"use strict";var r=n(60),o={};function i(t,e){t.onload=function(){e.loaded(this)}}o.load=function(t,e,o,a,u){var s,c,f,l=new Array(a),h=new Array(l.length);if(!1===u)l[0]=t;else for(s=0;s<l.length;s++)f=o+s,l[s]=t+"image-"+("00"+f).slice(-3)+".jpg";for(h.notLoaded=[],h.addImage=function(t){h.notLoaded.push(t)},h.loaded=function(o){for(var i=h.notLoaded,a=0;a<i.length;a++)if(i[a]===o){i.splice(a,1);for(var s=0;s<l.length;s++){var c=l[s].substr(l[s].lastIndexOf("/"));if(-1!==o.src.lastIndexOf(c)){h[s]={img:o};break}}break}0===i.length&&(console.log("Images loaded"),!1===u?n.i(r.a)(t,["orientation"]).then(function(t){h[0].tags=t,e(h)}).catch(function(t){console.log(t),e(h)}):e(h))},s=0;s<l.length;s++)c=new Image,h.addImage(c),i(c,h),c.src=l[s]},e.a=o},function(t,e,n){"use strict";var r=n(62),o={};o.createVideoStream=function(t){var e,n,r={},o=null,i=["canrecord","ended"],a={},u={x:0,y:0},s={x:0,y:0};return r.getRealWidth=function(){return t.videoWidth},r.getRealHeight=function(){return t.videoHeight},r.getWidth=function(){return e},r.getHeight=function(){return n},r.setWidth=function(t){e=t},r.setHeight=function(t){n=t},r.setInputStream=function(e){o=e,t.src=void 0!==e.src?e.src:""},r.ended=function(){return t.ended},r.getConfig=function(){return o},r.setAttribute=function(e,n){t.setAttribute(e,n)},r.pause=function(){t.pause()},r.play=function(){t.play()},r.setCurrentTime=function(e){"LiveStream"!==o.type&&(t.currentTime=e)},r.addEventListener=function(e,n,r){-1!==i.indexOf(e)?(a[e]||(a[e]=[]),a[e].push(n)):t.addEventListener(e,n,r)},r.clearEventHandlers=function(){i.forEach(function(e){var n=a[e];n&&n.length>0&&n.forEach(function(n){t.removeEventListener(e,n)})})},r.trigger=function(i,u){var c,f,l,h=a[i];if("canrecord"===i&&(f=t.videoWidth,l=t.videoHeight,e=o.size?f/l>1?o.size:Math.floor(f/l*o.size):f,n=o.size?f/l>1?Math.floor(l/f*o.size):o.size:l,s.x=e,s.y=n),h&&h.length>0)for(c=0;c<h.length;c++)h[c].apply(r,u)},r.setTopRight=function(t){u.x=t.x,u.y=t.y},r.getTopRight=function(){return u},r.setCanvasSize=function(t){s.x=t.x,s.y=t.y},r.getCanvasSize=function(){return s},r.getFrame=function(){return t},r},o.createLiveStream=function(t){t.setAttribute("autoplay",!0);var e=o.createVideoStream(t);return e.ended=function(){return!1},e},o.createImageStream=function(){var t,e,n={},o=null,i=0,a=0,u=0,s=!0,c=!1,f=null,l=0,h=1,d=null,p=!1,v=["canrecord","ended"],g={},_={x:0,y:0},y={x:0,y:0};function m(t,e){var r,o=g[t];if(o&&o.length>0)for(r=0;r<o.length;r++)o[r].apply(n,e)}return n.trigger=m,n.getWidth=function(){return t},n.getHeight=function(){return e},n.setWidth=function(e){t=e},n.setHeight=function(t){e=t},n.getRealWidth=function(){return i},n.getRealHeight=function(){return a},n.setInputStream=function(n){o=n,!1===n.sequence?(d=n.src,l=1):(d=n.src,l=n.length),c=!1,r.a.load(d,function(n){if(f=n,n[0].tags&&n[0].tags.orientation)switch(n[0].tags.orientation){case 6:case 8:i=n[0].img.height,a=n[0].img.width;break;default:i=n[0].img.width,a=n[0].img.height}else i=n[0].img.width,a=n[0].img.height;t=o.size?i/a>1?o.size:Math.floor(i/a*o.size):i,e=o.size?i/a>1?Math.floor(a/i*o.size):o.size:a,y.x=t,y.y=e,c=!0,u=0,setTimeout(function(){m("canrecord",[])},0)},h,l,o.sequence)},n.ended=function(){return p},n.setAttribute=function(){},n.getConfig=function(){return o},n.pause=function(){s=!0},n.play=function(){s=!1},n.setCurrentTime=function(t){u=t},n.addEventListener=function(t,e){-1!==v.indexOf(t)&&(g[t]||(g[t]=[]),g[t].push(e))},n.setTopRight=function(t){_.x=t.x,_.y=t.y},n.getTopRight=function(){return _},n.setCanvasSize=function(t){y.x=t.x,y.y=t.y},n.getCanvasSize=function(){return y},n.getFrame=function(){var t;return c?(s||(t=f[u],u<l-1?u++:setTimeout(function(){p=!0,m("ended",[])},0)),t):null},n},e.a=o},function(t,e,n){"use strict";(function(t){var r,o,i,a,u,s,c,f,l,h,d,p,v=n(20),g=n(19),_=n(3),y=n(9),m=n(65),x=n(30),b=n(66),C={clone:n(7),dot:n(32),scale:n(81),transformMat2:n(82)},E={copy:n(78),create:n(79),invert:n(80)},w={ctx:{binary:null},dom:{binary:null}},R={x:0,y:0};function O(t){var e,n,o,i,u,s,c,f=l.size.x,h=l.size.y,d=-l.size.x,p=-l.size.y;for(e=0,n=0;n<t.length;n++)e+=(i=t[n]).rad,r.debug.showPatches&&y.a.drawRect(i.pos,a.size,w.ctx.binary,{color:"red"});for((e=(180*(e/=t.length)/Math.PI+90)%180-90)<0&&(e+=180),e=(180-e)*Math.PI/180,u=E.copy(E.create(),[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e)]),n=0;n<t.length;n++){for(i=t[n],o=0;o<4;o++)C.transformMat2(i.box[o],i.box[o],u);r.debug.boxFromPatches.showTransformed&&y.a.drawPath(i.box,{x:0,y:1},w.ctx.binary,{color:"#99ff00",lineWidth:2})}for(n=0;n<t.length;n++)for(i=t[n],o=0;o<4;o++)i.box[o][0]<f&&(f=i.box[o][0]),i.box[o][0]>d&&(d=i.box[o][0]),i.box[o][1]<h&&(h=i.box[o][1]),i.box[o][1]>p&&(p=i.box[o][1]);for(s=[[f,h],[d,h],[d,p],[f,p]],r.debug.boxFromPatches.showTransformedBox&&y.a.drawPath(s,{x:0,y:1},w.ctx.binary,{color:"#ff0000",lineWidth:2}),c=r.halfSample?2:1,u=E.invert(u,u),o=0;o<4;o++)C.transformMat2(s[o],s[o],u);for(r.debug.boxFromPatches.showBB&&y.a.drawPath(s,{x:0,y:1},w.ctx.binary,{color:"#ff0000",lineWidth:2}),o=0;o<4;o++)C.scale(s[o],s[o],c);return s}function A(t,e){l.subImageAsCopy(a,n.i(g.b)(t,e)),p.skeletonize(),r.debug.showSkeleton&&i.overlay(w.dom.binary,360,n.i(g.b)(t,e))}function T(t,e,r,o){var i,u,s,c,f=[],l=[],d=Math.ceil(h.x/3);if(t.length>=2){for(i=0;i<t.length;i++)t[i].m00>d&&f.push(t[i]);if(f.length>=2){for(s=function(t){var e=n.i(g.g)(t,.9),r=n.i(g.h)(e,1,function(t){return t.getPoints().length}),o=[],i=[];if(1===r.length){o=r[0].item.getPoints();for(var a=0;a<o.length;a++)i.push(o[a].point)}return i}(f),u=0,i=0;i<s.length;i++)u+=s[i].rad;s.length>1&&s.length>=f.length/4*3&&s.length>t.length/4&&(u/=s.length,c={index:e[1]*R.x+e[0],pos:{x:r,y:o},box:[C.clone([r,o]),C.clone([r+a.size.x,o]),C.clone([r+a.size.x,o+a.size.y]),C.clone([r,o+a.size.y])],moments:s,rad:u,vec:C.clone([Math.cos(u),Math.sin(u)])},l.push(c))}}return l}e.a={init:function(e,_){var y;d=e,o=(r=_).halfSample?new v.a({x:d.size.x/2|0,y:d.size.y/2|0}):d,h=n.i(g.e)(r.patchSize,o.size),R.x=o.size.x/h.x|0,R.y=o.size.y/h.y|0,l=new v.a(o.size,void 0,Uint8Array,!1),u=new v.a(h,void 0,Array,!0),y=new ArrayBuffer(65536),a=new v.a(h,new Uint8Array(y,0,h.x*h.y)),i=new v.a(h,new Uint8Array(y,h.x*h.y*3,h.x*h.y),void 0,!0),p=n.i(b.a)("undefined"!=typeof window?window:"undefined"!=typeof self?self:t,{size:h.x},y),f=new v.a({x:o.size.x/a.size.x|0,y:o.size.y/a.size.y|0},void 0,Array,!0),s=new v.a(f.size,void 0,void 0,!0),c=new v.a(f.size,void 0,Int32Array,!0),r.useWorker||"undefined"==typeof document||(w.dom.binary=document.createElement("canvas"),w.dom.binary.className="binaryBuffer",!0===r.debug.showCanvas&&document.querySelector("#debug").appendChild(w.dom.binary),w.ctx.binary=w.dom.binary.getContext("2d"),w.dom.binary.width=l.size.x,w.dom.binary.height=l.size.y)},locate:function(){var t,e;if(r.halfSample&&n.i(g.i)(d,o),n.i(g.f)(o,l),l.zeroBorder(),r.debug.showCanvas&&l.show(w.dom.binary,255),(t=function(){var t,e,n,o,s,c,f,l=[];for(t=0;t<R.x;t++)for(e=0;e<R.y;e++)A(n=a.size.x*t,o=a.size.y*e),i.zeroBorder(),_.a.init(u.data,0),c=m.a.create(i,u).rasterize(0),r.debug.showLabels&&u.overlay(w.dom.binary,Math.floor(360/c.count),{x:n,y:o}),s=u.moments(c.count),l=l.concat(T(s,[t,e],n,o));if(r.debug.showFoundPatches)for(t=0;t<l.length;t++)f=l[t],y.a.drawRect(f.pos,a.size,w.ctx.binary,{color:"#99ff00",lineWidth:2});return l}()).length<R.x*R.y*.05)return null;var h=function(t){var e,o,i=0,u=.95,l=0,h=[0,1,1],d=[0,0,0];function p(){var t;for(t=0;t<c.data.length;t++)if(0===c.data[t]&&1===s.data[t])return t;return c.length}function v(t){var e,n,r,o,a,l=t%c.size.x,h=t/c.size.x|0;if(t<c.data.length)for(r=f.data[t],c.data[t]=i,a=0;a<x.a.searchDirections.length;a++)n=h+x.a.searchDirections[a][0],e=l+x.a.searchDirections[a][1],o=n*c.size.x+e,0!==s.data[o]?0===c.data[o]&&Math.abs(C.dot(f.data[o].vec,r.vec))>u&&v(o):c.data[o]=Number.MAX_VALUE}for(_.a.init(s.data,0),_.a.init(c.data,0),_.a.init(f.data,null),e=0;e<t.length;e++)o=t[e],f.data[o.index]=o,s.data[o.index]=1;for(s.zeroBorder();(l=p())<c.data.length;)i++,v(l);if(r.debug.showPatchLabels)for(e=0;e<c.data.length;e++)c.data[e]>0&&c.data[e]<=i&&(o=f.data[e],h[0]=c.data[e]/(i+1)*360,n.i(g.a)(h,d),y.a.drawRect(o.pos,a.size,w.ctx.binary,{color:"rgb("+d.join(",")+")",lineWidth:2}));return i}(t);return h<1?null:0===(e=function(t){var e,n,r=[];for(e=0;e<t;e++)r.push(0);for(n=c.data.length;n--;)c.data[n]>0&&r[c.data[n]-1]++;return(r=r.map(function(t,e){return{val:t,label:e+1}})).sort(function(t,e){return e.val-t.val}),r.filter(function(t){return t.val>=5})}(h)).length?null:function(t,e){var o,i,u,s,l,h=[],d=[],p=[0,1,1],v=[0,0,0];for(o=0;o<t.length;o++){for(u=c.data.length,h.length=0;u--;)c.data[u]===t[o].label&&(s=f.data[u],h.push(s));if((l=O(h))&&(d.push(l),r.debug.showRemainingPatchLabels))for(i=0;i<h.length;i++)s=h[i],p[0]=t[o].label/(e+1)*360,n.i(g.a)(p,v),y.a.drawRect(s.pos,a.size,w.ctx.binary,{color:"rgb("+v.join(",")+")",lineWidth:2})}return d}(e,h)},checkImageConstraints:function(t,e){var r,o,i,a=t.getWidth(),u=t.getHeight(),s=e.halfSample?.5:1;if(t.getConfig().area&&(i=n.i(g.j)(a,u,t.getConfig().area),t.setTopRight({x:i.sx,y:i.sy}),t.setCanvasSize({x:a,y:u}),a=i.sw,u=i.sh),o={x:Math.floor(a*s),y:Math.floor(u*s)},r=n.i(g.e)(e.patchSize,o),console.log("Patch-Size: "+JSON.stringify(r)),t.setWidth(Math.floor(Math.floor(o.x/r.x)*(1/s)*r.x)),t.setHeight(Math.floor(Math.floor(o.y/r.y)*(1/s)*r.y)),t.getWidth()%r.x==0&&t.getHeight()%r.y==0)return!0;throw new Error("Image dimensions do not comply with the current settings: Width ("+a+" )and height ("+u+") must a multiple of "+r.x)}}}).call(e,n(47))},function(t,e,n){"use strict";var r=n(30),o={createContour2D:function(){return{dir:null,index:null,firstVertex:null,insideContours:null,nextpeer:null,prevpeer:null}},CONTOUR_DIR:{CW_DIR:0,CCW_DIR:1,UNKNOWN_DIR:2},DIR:{OUTSIDE_EDGE:-32767,INSIDE_EDGE:-32766},create:function(t,e){var n=t.data,i=e.data,a=t.size.x,u=t.size.y,s=r.a.create(t,e);return{rasterize:function(t){var e,r,c,f,l,h,d,p,v,g,_,y,m=[],x=0;for(y=0;y<400;y++)m[y]=0;for(m[0]=n[0],v=null,h=1;h<u-1;h++)for(f=0,r=m[0],l=1;l<a-1;l++)if(0===i[_=h*a+l])if((e=n[_])!==r){if(0===f)m[c=x+1]=e,r=e,null!==(d=s.contourTracing(h,l,c,e,o.DIR.OUTSIDE_EDGE))&&(x++,f=c,(p=o.createContour2D()).dir=o.CONTOUR_DIR.CW_DIR,p.index=f,p.firstVertex=d,p.nextpeer=v,p.insideContours=null,null!==v&&(v.prevpeer=p),v=p);else if(null!==(d=s.contourTracing(h,l,o.DIR.INSIDE_EDGE,e,f))){for((p=o.createContour2D()).firstVertex=d,p.insideContours=null,p.dir=0===t?o.CONTOUR_DIR.CCW_DIR:o.CONTOUR_DIR.CW_DIR,p.index=t,g=v;null!==g&&g.index!==f;)g=g.nextpeer;null!==g&&(p.nextpeer=g.insideContours,null!==g.insideContours&&(g.insideContours.prevpeer=p),g.insideContours=p)}}else i[_]=f;else i[_]===o.DIR.OUTSIDE_EDGE||i[_]===o.DIR.INSIDE_EDGE?(f=0,r=i[_]===o.DIR.INSIDE_EDGE?n[_]:m[0]):r=m[f=i[_]];for(g=v;null!==g;)g.index=t,g=g.nextpeer;return{cc:v,count:x}},debug:{drawContour:function(t,e){var n,r,i,a=t.getContext("2d"),u=e;for(a.strokeStyle="red",a.fillStyle="red",a.lineWidth=1,n=null!==u?u.insideContours:null;null!==u;){switch(null!==n?(r=n,n=n.nextpeer):(r=u,n=null!==(u=u.nextpeer)?u.insideContours:null),r.dir){case o.CONTOUR_DIR.CW_DIR:a.strokeStyle="red";break;case o.CONTOUR_DIR.CCW_DIR:a.strokeStyle="blue";break;case o.CONTOUR_DIR.UNKNOWN_DIR:a.strokeStyle="green"}i=r.firstVertex,a.beginPath(),a.moveTo(i.x,i.y);do{i=i.next,a.lineTo(i.x,i.y)}while(i!==r.firstVertex);a.stroke()}}}}}};e.a=o},function(t,e,n){"use strict";e.a=function(t,e,n){"use asm";var r=new t.Uint8Array(n),o=e.size|0,i=t.Math.imul;function a(t,e){t=t|0;e=e|0;var n=0,i=0,a=0,u=0,s=0,c=0,f=0,l=0;for(n=1;(n|0)<(o-1|0);n=n+1|0){l=l+o|0;for(i=1;(i|0)<(o-1|0);i=i+1|0){u=l-o|0;s=l+o|0;c=i-1|0;f=i+1|0;a=(r[t+u+c|0]|0)+(r[t+u+f|0]|0)+(r[t+l+i|0]|0)+(r[t+s+c|0]|0)+(r[t+s+f|0]|0)|0;if((a|0)==(5|0)){r[e+l+i|0]=1}else{r[e+l+i|0]=0}}}return}function u(t,e,n){t=t|0;e=e|0;n=n|0;var a=0;a=i(o,o)|0;while((a|0)>0){a=a-1|0;r[n+a|0]=(r[t+a|0]|0)-(r[e+a|0]|0)|0}}function s(t,e,n){t=t|0;e=e|0;n=n|0;var a=0;a=i(o,o)|0;while((a|0)>0){a=a-1|0;r[n+a|0]=r[t+a|0]|0|(r[e+a|0]|0)|0}}function c(t){t=t|0;var e=0,n=0;n=i(o,o)|0;while((n|0)>0){n=n-1|0;e=(e|0)+(r[t+n|0]|0)|0}return e|0}function f(t,e){t=t|0;e=e|0;var n=0;n=i(o,o)|0;while((n|0)>0){n=n-1|0;r[t+n|0]=e}}function l(t,e){t=t|0;e=e|0;var n=0,i=0,a=0,u=0,s=0,c=0,f=0,l=0;for(n=1;(n|0)<(o-1|0);n=n+1|0){l=l+o|0;for(i=1;(i|0)<(o-1|0);i=i+1|0){u=l-o|0;s=l+o|0;c=i-1|0;f=i+1|0;a=(r[t+u+c|0]|0)+(r[t+u+f|0]|0)+(r[t+l+i|0]|0)+(r[t+s+c|0]|0)+(r[t+s+f|0]|0)|0;if((a|0)>(0|0)){r[e+l+i|0]=1}else{r[e+l+i|0]=0}}}return}function h(t,e){t=t|0;e=e|0;var n=0;n=i(o,o)|0;while((n|0)>0){n=n-1|0;r[e+n|0]=r[t+n|0]|0}}function d(t){t=t|0;var e=0,n=0;for(e=0;(e|0)<(o-1|0);e=e+1|0){r[t+e|0]=0;r[t+n|0]=0;n=n+o-1|0;r[t+n|0]=0;n=n+1|0}for(e=0;(e|0)<(o|0);e=e+1|0){r[t+n|0]=0;n=n+1|0}}function p(){var t=0,e=0,n=0,r=0,p=0,v=0;e=i(o,o)|0;n=e+e|0;r=n+e|0;f(r,0);d(t);do{a(t,e);l(e,n);u(t,n,n);s(r,n,r);h(e,t);p=c(t)|0;v=(p|0)==0|0}while(!v)}return{skeletonize:p}}},function(t,e,n){"use strict";var r=n(1);function o(t){r.a.call(this,t),this.barSpaceRatio=[1,1]}var i={START_PATTERN:{value:[3,1,3,1,1,1]},STOP_PATTERN:{value:[3,1,1,1,3]},CODE_PATTERN:{value:[[1,1,3,3,1],[3,1,1,1,3],[1,3,1,1,3],[3,3,1,1,1],[1,1,3,1,3],[3,1,3,1,1],[1,3,3,1,1],[1,1,1,3,3],[3,1,1,3,1],[1,3,1,3,1]]},SINGLE_CODE_ERROR:{value:.78,writable:!0},AVG_CODE_ERROR:{value:.3,writable:!0},FORMAT:{value:"2of5"}},a=i.START_PATTERN.value.reduce(function(t,e){return t+e},0);o.prototype=Object.create(r.a.prototype,i),o.prototype.constructor=o,o.prototype._findPattern=function(t,e,n,r){var o,i,a,u,s=[],c=0,f={error:Number.MAX_VALUE,code:-1,start:0,end:0},l=this.AVG_CODE_ERROR;for(n=n||!1,r=r||!1,e||(e=this._nextSet(this._row)),o=0;o<t.length;o++)s[o]=0;for(o=e;o<this._row.length;o++)if(this._row[o]^n)s[c]++;else{if(c===s.length-1){for(u=0,a=0;a<s.length;a++)u+=s[a];if((i=this._matchPattern(s,t))<l)return f.error=i,f.start=o-u,f.end=o,f;if(!r)return null;for(a=0;a<s.length-2;a++)s[a]=s[a+2];s[s.length-2]=0,s[s.length-1]=0,c--}else c++;s[c]=1,n=!n}return null},o.prototype._findStart=function(){for(var t,e,n=this._nextSet(this._row),r=1;!e;){if(!(e=this._findPattern(this.START_PATTERN,n,!1,!0)))return null;if(r=Math.floor((e.end-e.start)/a),(t=e.start-5*r)>=0&&this._matchRange(t,e.start,0))return e;n=e.end,e=null}},o.prototype._verifyTrailingWhitespace=function(t){var e;return(e=t.end+(t.end-t.start)/2)<this._row.length&&this._matchRange(t.end,e,0)?t:null},o.prototype._findEnd=function(){var t,e,n;return this._row.reverse(),n=this._nextSet(this._row),t=this._findPattern(this.STOP_PATTERN,n,!1,!0),this._row.reverse(),null===t?null:(e=t.start,t.start=this._row.length-t.end,t.end=this._row.length-e,null!==t?this._verifyTrailingWhitespace(t):null)},o.prototype._decodeCode=function(t){var e,n,r,o=this.AVG_CODE_ERROR,i={error:Number.MAX_VALUE,code:-1,start:0,end:0};for(e=0;e<t.length;e++)t[e];for(r=0;r<this.CODE_PATTERN.length;r++)(n=this._matchPattern(t,this.CODE_PATTERN[r]))<i.error&&(i.code=r,i.error=n);if(i.error<o)return i},o.prototype._decodePayload=function(t,e,n){for(var r,o,i=0,a=t.length,u=[0,0,0,0,0];i<a;){for(r=0;r<5;r++)u[r]=t[i]*this.barSpaceRatio[0],i+=2;if(!(o=this._decodeCode(u)))return null;e.push(o.code+""),n.push(o)}return o},o.prototype._verifyCounterLength=function(t){return t.length%10==0},o.prototype._decode=function(){var t,e,n,r=[],o=[];return(t=this._findStart())?(o.push(t),(e=this._findEnd())?(n=this._fillCounters(t.end,e.start,!1),this._verifyCounterLength(n)&&this._decodePayload(n,r,o)?r.length<5?null:(o.push(e),{code:r.join(""),start:t.start,end:e.end,startInfo:t,decodedCodes:o}):null):null):null},e.a=o},function(t,e,n){"use strict";var r=n(1);function o(){r.a.call(this),this._counters=[]}o.prototype=Object.create(r.a.prototype,{ALPHABETH_STRING:{value:"0123456789-$:/.+ABCD"},ALPHABET:{value:[48,49,50,51,52,53,54,55,56,57,45,36,58,47,46,43,65,66,67,68]},CHARACTER_ENCODINGS:{value:[3,6,9,96,18,66,33,36,48,72,12,24,69,81,84,21,26,41,11,14]},START_END:{value:[26,41,11,14]},MIN_ENCODED_CHARS:{value:4},MAX_ACCEPTABLE:{value:2},PADDING:{value:1.5},FORMAT:{value:"codabar",writeable:!1}}),o.prototype.constructor=o,o.prototype._decode=function(){var t,e,n,r,o,i=[];if(this._counters=this._fillCounters(),!(t=this._findStart()))return null;r=t.startCounter;do{if((n=this._toPattern(r))<0)return null;if((e=this._patternToChar(n))<0)return null;if(i.push(e),r+=8,i.length>1&&this._isStartEnd(n))break}while(r<this._counters.length);return i.length-2<this.MIN_ENCODED_CHARS||!this._isStartEnd(n)?null:this._verifyWhitespace(t.startCounter,r-8)&&this._validateResult(i,t.startCounter)?(r=r>this._counters.length?this._counters.length:r,o=t.start+this._sumCounters(t.startCounter,r-8),{code:i.join(""),start:t.start,end:o,startInfo:t,decodedCodes:i}):null},o.prototype._verifyWhitespace=function(t,e){return(t-1<=0||this._counters[t-1]>=this._calculatePatternLength(t)/2)&&(e+8>=this._counters.length||this._counters[e+7]>=this._calculatePatternLength(e)/2)},o.prototype._calculatePatternLength=function(t){var e,n=0;for(e=t;e<t+7;e++)n+=this._counters[e];return n},o.prototype._thresholdResultPattern=function(t,e){var n,r,o,i,a,u=this,s={space:{narrow:{size:0,counts:0,min:0,max:Number.MAX_VALUE},wide:{size:0,counts:0,min:0,max:Number.MAX_VALUE}},bar:{narrow:{size:0,counts:0,min:0,max:Number.MAX_VALUE},wide:{size:0,counts:0,min:0,max:Number.MAX_VALUE}}},c=e;for(o=0;o<t.length;o++){for(a=u._charToPattern(t[o]),i=6;i>=0;i--)n=2==(1&i)?s.bar:s.space,(r=1==(1&a)?n.wide:n.narrow).size+=u._counters[c+i],r.counts++,a>>=1;c+=8}return["space","bar"].forEach(function(t){var e=s[t];e.wide.min=Math.floor((e.narrow.size/e.narrow.counts+e.wide.size/e.wide.counts)/2),e.narrow.max=Math.ceil(e.wide.min),e.wide.max=Math.ceil((e.wide.size*u.MAX_ACCEPTABLE+u.PADDING)/e.wide.counts)}),s},o.prototype._charToPattern=function(t){var e,n=t.charCodeAt(0);for(e=0;e<this.ALPHABET.length;e++)if(this.ALPHABET[e]===n)return this.CHARACTER_ENCODINGS[e];return 0},o.prototype._validateResult=function(t,e){var n,r,o,i,a,u,s=this._thresholdResultPattern(t,e),c=e;for(n=0;n<t.length;n++){for(u=this._charToPattern(t[n]),r=6;r>=0;r--){if(o=0==(1&r)?s.bar:s.space,i=1==(1&u)?o.wide:o.narrow,(a=this._counters[c+r])<i.min||a>i.max)return!1;u>>=1}c+=8}return!0},o.prototype._patternToChar=function(t){var e;for(e=0;e<this.CHARACTER_ENCODINGS.length;e++)if(this.CHARACTER_ENCODINGS[e]===t)return String.fromCharCode(this.ALPHABET[e]);return-1},o.prototype._computeAlternatingThreshold=function(t,e){var n,r,o=Number.MAX_VALUE,i=0;for(n=t;n<e;n+=2)(r=this._counters[n])>i&&(i=r),r<o&&(o=r);return(o+i)/2|0},o.prototype._toPattern=function(t){var e,n,r,o,i=t+7,a=64,u=0;if(i>this._counters.length)return-1;for(e=this._computeAlternatingThreshold(t,i),n=this._computeAlternatingThreshold(t+1,i),r=0;r<7;r++)o=0==(1&r)?e:n,this._counters[t+r]>o&&(u|=a),a>>=1;return u},o.prototype._isStartEnd=function(t){var e;for(e=0;e<this.START_END.length;e++)if(this.START_END[e]===t)return!0;return!1},o.prototype._sumCounters=function(t,e){var n,r=0;for(n=t;n<e;n++)r+=this._counters[n];return r},o.prototype._findStart=function(){var t,e,n=this._nextUnset(this._row);for(t=1;t<this._counters.length;t++)if(-1!==(e=this._toPattern(t))&&this._isStartEnd(e))return{start:n+=this._sumCounters(0,t),end:n+this._sumCounters(t,t+8),startCounter:t,endCounter:t+8}},e.a=o},function(t,e,n){"use strict";var r=n(1);function o(){r.a.call(this)}function i(t,e,n){for(var r=n.length,o=0,i=0;r--;)i+=t[n[r]],o+=e[n[r]];return i/o}o.prototype=Object.create(r.a.prototype,{CODE_SHIFT:{value:98},CODE_C:{value:99},CODE_B:{value:100},CODE_A:{value:101},START_CODE_A:{value:103},START_CODE_B:{value:104},START_CODE_C:{value:105},STOP_CODE:{value:106},CODE_PATTERN:{value:[[2,1,2,2,2,2],[2,2,2,1,2,2],[2,2,2,2,2,1],[1,2,1,2,2,3],[1,2,1,3,2,2],[1,3,1,2,2,2],[1,2,2,2,1,3],[1,2,2,3,1,2],[1,3,2,2,1,2],[2,2,1,2,1,3],[2,2,1,3,1,2],[2,3,1,2,1,2],[1,1,2,2,3,2],[1,2,2,1,3,2],[1,2,2,2,3,1],[1,1,3,2,2,2],[1,2,3,1,2,2],[1,2,3,2,2,1],[2,2,3,2,1,1],[2,2,1,1,3,2],[2,2,1,2,3,1],[2,1,3,2,1,2],[2,2,3,1,1,2],[3,1,2,1,3,1],[3,1,1,2,2,2],[3,2,1,1,2,2],[3,2,1,2,2,1],[3,1,2,2,1,2],[3,2,2,1,1,2],[3,2,2,2,1,1],[2,1,2,1,2,3],[2,1,2,3,2,1],[2,3,2,1,2,1],[1,1,1,3,2,3],[1,3,1,1,2,3],[1,3,1,3,2,1],[1,1,2,3,1,3],[1,3,2,1,1,3],[1,3,2,3,1,1],[2,1,1,3,1,3],[2,3,1,1,1,3],[2,3,1,3,1,1],[1,1,2,1,3,3],[1,1,2,3,3,1],[1,3,2,1,3,1],[1,1,3,1,2,3],[1,1,3,3,2,1],[1,3,3,1,2,1],[3,1,3,1,2,1],[2,1,1,3,3,1],[2,3,1,1,3,1],[2,1,3,1,1,3],[2,1,3,3,1,1],[2,1,3,1,3,1],[3,1,1,1,2,3],[3,1,1,3,2,1],[3,3,1,1,2,1],[3,1,2,1,1,3],[3,1,2,3,1,1],[3,3,2,1,1,1],[3,1,4,1,1,1],[2,2,1,4,1,1],[4,3,1,1,1,1],[1,1,1,2,2,4],[1,1,1,4,2,2],[1,2,1,1,2,4],[1,2,1,4,2,1],[1,4,1,1,2,2],[1,4,1,2,2,1],[1,1,2,2,1,4],[1,1,2,4,1,2],[1,2,2,1,1,4],[1,2,2,4,1,1],[1,4,2,1,1,2],[1,4,2,2,1,1],[2,4,1,2,1,1],[2,2,1,1,1,4],[4,1,3,1,1,1],[2,4,1,1,1,2],[1,3,4,1,1,1],[1,1,1,2,4,2],[1,2,1,1,4,2],[1,2,1,2,4,1],[1,1,4,2,1,2],[1,2,4,1,1,2],[1,2,4,2,1,1],[4,1,1,2,1,2],[4,2,1,1,1,2],[4,2,1,2,1,1],[2,1,2,1,4,1],[2,1,4,1,2,1],[4,1,2,1,2,1],[1,1,1,1,4,3],[1,1,1,3,4,1],[1,3,1,1,4,1],[1,1,4,1,1,3],[1,1,4,3,1,1],[4,1,1,1,1,3],[4,1,1,3,1,1],[1,1,3,1,4,1],[1,1,4,1,3,1],[3,1,1,1,4,1],[4,1,1,1,3,1],[2,1,1,4,1,2],[2,1,1,2,1,4],[2,1,1,2,3,2],[2,3,3,1,1,1,2]]},SINGLE_CODE_ERROR:{value:.64},AVG_CODE_ERROR:{value:.3},FORMAT:{value:"code_128",writeable:!1},MODULE_INDICES:{value:{bar:[0,2,4],space:[1,3,5]}}}),o.prototype.constructor=o,o.prototype._decodeCode=function(t,e){var n,r,o,a=[0,0,0,0,0,0],u=t,s=!this._row[u],c=0,f={error:Number.MAX_VALUE,code:-1,start:t,end:t,correction:{bar:1,space:1}};for(n=u;n<this._row.length;n++)if(this._row[n]^s)a[c]++;else{if(c===a.length-1){for(e&&this._correct(a,e),r=0;r<this.CODE_PATTERN.length;r++)(o=this._matchPattern(a,this.CODE_PATTERN[r]))<f.error&&(f.code=r,f.error=o);return f.end=n,-1===f.code||f.error>this.AVG_CODE_ERROR?null:(this.CODE_PATTERN[f.code]&&(f.correction.bar=i(this.CODE_PATTERN[f.code],a,this.MODULE_INDICES.bar),f.correction.space=i(this.CODE_PATTERN[f.code],a,this.MODULE_INDICES.space)),f)}a[++c]=1,s=!s}return null},o.prototype._correct=function(t,e){this._correctBars(t,e.bar,this.MODULE_INDICES.bar),this._correctBars(t,e.space,this.MODULE_INDICES.space)},o.prototype._findStart=function(){var t,e,n,r,o,a=[0,0,0,0,0,0],u=this._nextSet(this._row),s=!1,c=0,f={error:Number.MAX_VALUE,code:-1,start:0,end:0,correction:{bar:1,space:1}};for(t=u;t<this._row.length;t++)if(this._row[t]^s)a[c]++;else{if(c===a.length-1){for(o=0,r=0;r<a.length;r++)o+=a[r];for(e=this.START_CODE_A;e<=this.START_CODE_C;e++)(n=this._matchPattern(a,this.CODE_PATTERN[e]))<f.error&&(f.code=e,f.error=n);if(f.error<this.AVG_CODE_ERROR)return f.start=t-o,f.end=t,f.correction.bar=i(this.CODE_PATTERN[f.code],a,this.MODULE_INDICES.bar),f.correction.space=i(this.CODE_PATTERN[f.code],a,this.MODULE_INDICES.space),f;for(r=0;r<4;r++)a[r]=a[r+2];a[4]=0,a[5]=0,c--}else c++;a[c]=1,s=!s}return null},o.prototype._decode=function(){var t,e,n=this._findStart(),r=null,o=!1,i=[],a=0,u=0,s=[],c=[],f=!1,l=!0;if(null===n)return null;switch(r={code:n.code,start:n.start,end:n.end,correction:{bar:n.correction.bar,space:n.correction.space}},c.push(r),u=r.code,r.code){case this.START_CODE_A:t=this.CODE_A;break;case this.START_CODE_B:t=this.CODE_B;break;case this.START_CODE_C:t=this.CODE_C;break;default:return null}for(;!o;){if(e=f,f=!1,null!==(r=this._decodeCode(r.end,r.correction)))switch(r.code!==this.STOP_CODE&&(l=!0),r.code!==this.STOP_CODE&&(s.push(r.code),u+=++a*r.code),c.push(r),t){case this.CODE_A:if(r.code<64)i.push(String.fromCharCode(32+r.code));else if(r.code<96)i.push(String.fromCharCode(r.code-64));else switch(r.code!==this.STOP_CODE&&(l=!1),r.code){case this.CODE_SHIFT:f=!0,t=this.CODE_B;break;case this.CODE_B:t=this.CODE_B;break;case this.CODE_C:t=this.CODE_C;break;case this.STOP_CODE:o=!0}break;case this.CODE_B:if(r.code<96)i.push(String.fromCharCode(32+r.code));else switch(r.code!==this.STOP_CODE&&(l=!1),r.code){case this.CODE_SHIFT:f=!0,t=this.CODE_A;break;case this.CODE_A:t=this.CODE_A;break;case this.CODE_C:t=this.CODE_C;break;case this.STOP_CODE:o=!0}break;case this.CODE_C:if(r.code<100)i.push(r.code<10?"0"+r.code:r.code);else switch(r.code!==this.STOP_CODE&&(l=!1),r.code){case this.CODE_A:t=this.CODE_A;break;case this.CODE_B:t=this.CODE_B;break;case this.STOP_CODE:o=!0}}else o=!0;e&&(t=t===this.CODE_A?this.CODE_B:this.CODE_A)}return null===r?null:(r.end=this._nextUnset(this._row,r.end),this._verifyTrailingWhitespace(r)?(u-=a*s[s.length-1])%103!==s[s.length-1]?null:i.length?(l&&i.splice(i.length-1,1),{code:i.join(""),start:n.start,end:r.end,codeset:t,startInfo:n,decodedCodes:c,endInfo:r}):null:null)},r.a.prototype._verifyTrailingWhitespace=function(t){var e;return(e=t.end+(t.end-t.start)/2)<this._row.length&&this._matchRange(t.end,e,0)?t:null},e.a=o},function(t,e,n){"use strict";var r=n(31);function o(){r.a.call(this)}var i=/[IOQ]/g,a=/[A-Z0-9]{17}/;o.prototype=Object.create(r.a.prototype),o.prototype.constructor=o,o.prototype._decode=function(){var t=r.a.prototype._decode.apply(this);if(!t)return null;var e=t.code;return e?(e=e.replace(i,"")).match(a)?this._checkChecksum(e)?(t.code=e,t):null:(console.log("Failed AZ09 pattern code:",e),null):null},o.prototype._checkChecksum=function(t){return!!t},e.a=o},function(t,e,n){"use strict";var r=n(1),o=n(3);function i(){r.a.call(this)}var a={ALPHABETH_STRING:{value:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*"},ALPHABET:{value:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*".split("").map(function(t){return t.charCodeAt(0)})},CHARACTER_ENCODINGS:{value:[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350]},ASTERISK:{value:350},FORMAT:{value:"code_93",writeable:!1}};i.prototype=Object.create(r.a.prototype,a),i.prototype.constructor=i,i.prototype._decode=function(){var t,e,n,r,i=[0,0,0,0,0,0],a=[],u=this._findStart();if(!u)return null;r=this._nextSet(this._row,u.end);do{if(i=this._toCounters(r,i),(n=this._toPattern(i))<0)return null;if((t=this._patternToChar(n))<0)return null;a.push(t),e=r,r+=o.a.sum(i),r=this._nextSet(this._row,r)}while("*"!==t);return a.pop(),a.length&&this._verifyEnd(e,r,i)&&this._verifyChecksums(a)?(a=a.slice(0,a.length-2),null===(a=this._decodeExtended(a))?null:{code:a.join(""),start:u.start,end:r,startInfo:u,decodedCodes:a}):null},i.prototype._verifyEnd=function(t,e){return!(t===e||!this._row[e])},i.prototype._patternToChar=function(t){var e;for(e=0;e<this.CHARACTER_ENCODINGS.length;e++)if(this.CHARACTER_ENCODINGS[e]===t)return String.fromCharCode(this.ALPHABET[e]);return-1},i.prototype._toPattern=function(t){for(var e=t.length,n=0,r=0,o=0;o<e;o++)r+=t[o];for(var i=0;i<e;i++){var a=Math.round(9*t[i]/r);if(a<1||a>4)return-1;if(0==(1&i))for(var u=0;u<a;u++)n=n<<1|1;else n<<=a}return n},i.prototype._findStart=function(){var t,e,n,r=this._nextSet(this._row),o=r,i=[0,0,0,0,0,0],a=0,u=!1;for(t=r;t<this._row.length;t++)if(this._row[t]^u)i[a]++;else{if(a===i.length-1){if(this._toPattern(i)===this.ASTERISK&&(n=Math.floor(Math.max(0,o-(t-o)/4)),this._matchRange(n,o,0)))return{start:o,end:t};for(o+=i[0]+i[1],e=0;e<4;e++)i[e]=i[e+2];i[4]=0,i[5]=0,a--}else a++;i[a]=1,u=!u}return null},i.prototype._decodeExtended=function(t){for(var e=t.length,n=[],r=0;r<e;r++){var o=t[r];if(o>="a"&&o<="d"){if(r>e-2)return null;var i=t[++r],a=i.charCodeAt(0),u=void 0;switch(o){case"a":if(!(i>="A"&&i<="Z"))return null;u=String.fromCharCode(a-64);break;case"b":if(i>="A"&&i<="E")u=String.fromCharCode(a-38);else if(i>="F"&&i<="J")u=String.fromCharCode(a-11);else if(i>="K"&&i<="O")u=String.fromCharCode(a+16);else if(i>="P"&&i<="S")u=String.fromCharCode(a+43);else{if(!(i>="T"&&i<="Z"))return null;u=String.fromCharCode(127)}break;case"c":if(i>="A"&&i<="O")u=String.fromCharCode(a-32);else{if("Z"!==i)return null;u=":"}break;case"d":if(!(i>="A"&&i<="Z"))return null;u=String.fromCharCode(a+32)}n.push(u)}else n.push(o)}return n},i.prototype._verifyChecksums=function(t){return this._matchCheckChar(t,t.length-2,20)&&this._matchCheckChar(t,t.length-1,15)},i.prototype._matchCheckChar=function(t,e,n){var r=this,o=t.slice(0,e),i=o.length,a=o.reduce(function(t,e,o){return t+((-1*o+(i-1))%n+1)*r.ALPHABET.indexOf(e.charCodeAt(0))},0);return this.ALPHABET[a%47]===t[e].charCodeAt(0)},e.a=i},function(t,e,n){"use strict";var r=n(4);function o(){r.a.call(this)}o.prototype=Object.create(r.a.prototype,{FORMAT:{value:"ean_2",writeable:!1}}),o.prototype.constructor=o,o.prototype.decode=function(t,e){this._row=t;var n,r=0,o=0,i=e,a=this._row.length,u=[],s=[];for(o=0;o<2&&i<a;o++){if(!(n=this._decodeCode(i)))return null;s.push(n),u.push(n.code%10),n.code>=this.CODE_G_START&&(r|=1<<1-o),1!=o&&(i=this._nextSet(this._row,n.end),i=this._nextUnset(this._row,i))}return 2!=u.length||parseInt(u.join(""))%4!==r?null:{code:u.join(""),decodedCodes:s,end:n.end}},e.a=o},function(t,e,n){"use strict";var r=n(4);function o(){r.a.call(this)}var i=[24,20,18,17,12,6,3,10,9,5];o.prototype=Object.create(r.a.prototype,{FORMAT:{value:"ean_5",writeable:!1}}),o.prototype.constructor=o,o.prototype.decode=function(t,e){this._row=t;var n,r=0,o=0,a=e,u=this._row.length,s=[],c=[];for(o=0;o<5&&a<u;o++){if(!(n=this._decodeCode(a)))return null;c.push(n),s.push(n.code%10),n.code>=this.CODE_G_START&&(r|=1<<4-o),4!=o&&(a=this._nextSet(this._row,n.end),a=this._nextUnset(this._row,a))}return 5!=s.length?null:function(t){var e,n=t.length,r=0;for(e=n-2;e>=0;e-=2)r+=t[e];for(r*=3,e=n-1;e>=0;e-=2)r+=t[e];return(r*=3)%10}(s)!==function(t){var e;for(e=0;e<10;e++)if(t===i[e])return e;return null}(r)?null:{code:s.join(""),decodedCodes:c,end:n.end}},e.a=o},function(t,e,n){"use strict";var r=n(4);function o(t,e){r.a.call(this,t,e)}o.prototype=Object.create(r.a.prototype,{FORMAT:{value:"ean_8",writeable:!1}}),o.prototype.constructor=o,o.prototype._decodePayload=function(t,e,n){var r;for(r=0;r<4;r++){if(!(t=this._decodeCode(t.end,this.CODE_G_START)))return null;e.push(t.code),n.push(t)}if(null===(t=this._findPattern(this.MIDDLE_PATTERN,t.end,!0,!1)))return null;for(n.push(t),r=0;r<4;r++){if(!(t=this._decodeCode(t.end,this.CODE_G_START)))return null;n.push(t),e.push(t.code)}return t},e.a=o},function(t,e,n){"use strict";var r=n(28),o=n.n(r),i=n(1);function a(t){var e;t=o()((e={},Object.keys(a.CONFIG_KEYS).forEach(function(t){e[t]=a.CONFIG_KEYS[t].default}),e),t),i.a.call(this,t),this.barSpaceRatio=[1,1],t.normalizeBarSpaceWidth&&(this.SINGLE_CODE_ERROR=.38,this.AVG_CODE_ERROR=.09)}var u={START_PATTERN:{value:[1,1,1,1]},STOP_PATTERN:{value:[1,1,3]},CODE_PATTERN:{value:[[1,1,3,3,1],[3,1,1,1,3],[1,3,1,1,3],[3,3,1,1,1],[1,1,3,1,3],[3,1,3,1,1],[1,3,3,1,1],[1,1,1,3,3],[3,1,1,3,1],[1,3,1,3,1]]},SINGLE_CODE_ERROR:{value:.78,writable:!0},AVG_CODE_ERROR:{value:.38,writable:!0},MAX_CORRECTION_FACTOR:{value:5},FORMAT:{value:"i2of5"}};a.prototype=Object.create(i.a.prototype,u),a.prototype.constructor=a,a.prototype._matchPattern=function(t,e){if(this.config.normalizeBarSpaceWidth){var n,r=[0,0],o=[0,0],a=[0,0],u=this.MAX_CORRECTION_FACTOR,s=1/u;for(n=0;n<t.length;n++)r[n%2]+=t[n],o[n%2]+=e[n];for(a[0]=o[0]/r[0],a[1]=o[1]/r[1],a[0]=Math.max(Math.min(a[0],u),s),a[1]=Math.max(Math.min(a[1],u),s),this.barSpaceRatio=a,n=0;n<t.length;n++)t[n]*=this.barSpaceRatio[n%2]}return i.a.prototype._matchPattern.call(this,t,e)},a.prototype._findPattern=function(t,e,n,r){var o,i,a,u,s=[],c=0,f={error:Number.MAX_VALUE,code:-1,start:0,end:0},l=this.AVG_CODE_ERROR;for(n=n||!1,r=r||!1,e||(e=this._nextSet(this._row)),o=0;o<t.length;o++)s[o]=0;for(o=e;o<this._row.length;o++)if(this._row[o]^n)s[c]++;else{if(c===s.length-1){for(u=0,a=0;a<s.length;a++)u+=s[a];if((i=this._matchPattern(s,t))<l)return f.error=i,f.start=o-u,f.end=o,f;if(!r)return null;for(a=0;a<s.length-2;a++)s[a]=s[a+2];s[s.length-2]=0,s[s.length-1]=0,c--}else c++;s[c]=1,n=!n}return null},a.prototype._findStart=function(){for(var t,e,n=this._nextSet(this._row),r=1;!e;){if(!(e=this._findPattern(this.START_PATTERN,n,!1,!0)))return null;if(r=Math.floor((e.end-e.start)/4),(t=e.start-10*r)>=0&&this._matchRange(t,e.start,0))return e;n=e.end,e=null}},a.prototype._verifyTrailingWhitespace=function(t){var e;return(e=t.end+(t.end-t.start)/2)<this._row.length&&this._matchRange(t.end,e,0)?t:null},a.prototype._findEnd=function(){var t,e;return this._row.reverse(),t=this._findPattern(this.STOP_PATTERN),this._row.reverse(),null===t?null:(e=t.start,t.start=this._row.length-t.end,t.end=this._row.length-e,null!==t?this._verifyTrailingWhitespace(t):null)},a.prototype._decodePair=function(t){var e,n,r=[];for(e=0;e<t.length;e++){if(!(n=this._decodeCode(t[e])))return null;r.push(n)}return r},a.prototype._decodeCode=function(t){var e,n,r,o=this.AVG_CODE_ERROR,i={error:Number.MAX_VALUE,code:-1,start:0,end:0};for(e=0;e<t.length;e++)t[e];for(r=0;r<this.CODE_PATTERN.length;r++)(n=this._matchPattern(t,this.CODE_PATTERN[r]))<i.error&&(i.code=r,i.error=n);if(i.error<o)return i},a.prototype._decodePayload=function(t,e,n){for(var r,o,i=0,a=t.length,u=[[0,0,0,0,0],[0,0,0,0,0]];i<a;){for(r=0;r<5;r++)u[0][r]=t[i]*this.barSpaceRatio[0],u[1][r]=t[i+1]*this.barSpaceRatio[1],i+=2;if(!(o=this._decodePair(u)))return null;for(r=0;r<o.length;r++)e.push(o[r].code+""),n.push(o[r])}return o},a.prototype._verifyCounterLength=function(t){return t.length%10==0},a.prototype._decode=function(){var t,e,n,r=[],o=[];return(t=this._findStart())?(o.push(t),(e=this._findEnd())?(n=this._fillCounters(t.end,e.start,!1),this._verifyCounterLength(n)&&this._decodePayload(n,r,o)?r.length%2!=0||r.length<6?null:(o.push(e),{code:r.join(""),start:t.start,end:e.end,startInfo:t,decodedCodes:o}):null):null):null},a.CONFIG_KEYS={normalizeBarSpaceWidth:{type:"boolean",default:!1,description:"If true, the reader tries to normalize thewidth-difference between bars and spaces"}},e.a=a},function(t,e,n){"use strict";var r=n(4);function o(t,e){r.a.call(this,t,e)}o.prototype=Object.create(r.a.prototype,{CODE_FREQUENCY:{value:[[56,52,50,49,44,38,35,42,41,37],[7,11,13,14,19,25,28,21,22,26]]},STOP_PATTERN:{value:[1/6*7,1/6*7,1/6*7,1/6*7,1/6*7,1/6*7]},FORMAT:{value:"upc_e",writeable:!1}}),o.prototype.constructor=o,o.prototype._decodePayload=function(t,e,n){var r,o=0;for(r=0;r<6;r++){if(!(t=this._decodeCode(t.end)))return null;t.code>=this.CODE_G_START&&(t.code=t.code-this.CODE_G_START,o|=1<<5-r),e.push(t.code),n.push(t)}return this._determineParity(o,e)?t:null},o.prototype._determineParity=function(t,e){var n,r;for(r=0;r<this.CODE_FREQUENCY.length;r++)for(n=0;n<this.CODE_FREQUENCY[r].length;n++)if(t===this.CODE_FREQUENCY[r][n])return e.unshift(r),e.push(n),!0;return!1},o.prototype._convertToUPCA=function(t){var e=[t[0]],n=t[t.length-2];return(e=n<=2?e.concat(t.slice(1,3)).concat([n,0,0,0,0]).concat(t.slice(3,6)):3===n?e.concat(t.slice(1,4)).concat([0,0,0,0,0]).concat(t.slice(4,6)):4===n?e.concat(t.slice(1,5)).concat([0,0,0,0,0,t[5]]):e.concat(t.slice(1,6)).concat([0,0,0,0,n])).push(t[t.length-1]),e},o.prototype._checksum=function(t){return r.a.prototype._checksum.call(this,this._convertToUPCA(t))},o.prototype._findEnd=function(t,e){return!0,r.a.prototype._findEnd.call(this,t,!0)},o.prototype._verifyTrailingWhitespace=function(t){var e;if((e=t.end+(t.end-t.start)/2)<this._row.length&&this._matchRange(t.end,e,0))return t},e.a=o},function(t,e,n){"use strict";var r=n(4);function o(t,e){r.a.call(this,t,e)}o.prototype=Object.create(r.a.prototype,{FORMAT:{value:"upc_a",writeable:!1}}),o.prototype.constructor=o,o.prototype._decode=function(){var t=r.a.prototype._decode.call(this);return t&&t.code&&13===t.code.length&&"0"===t.code.charAt(0)?(t.code=t.code.substring(1),t):null},e.a=o},function(t,e){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},function(t,e){t.exports=function(){var t=new Float32Array(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}},function(t,e){t.exports=function(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=n*i-o*r;return a?(a=1/a,t[0]=i*a,t[1]=-r*a,t[2]=-o*a,t[3]=n*a,t):null}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}},function(t,e){t.exports=function(t,e,n){var r=e[0],o=e[1];return t[0]=n[0]*r+n[2]*o,t[1]=n[1]*r+n[3]*o,t}},function(t,e){t.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},function(t,e,n){var r=n(122),o=n(123),i=n(124),a=n(125),u=n(126);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=u,t.exports=s},function(t,e,n){var r=n(10),o=n(149),i=n(150),a=n(151),u=n(152),s=n(153);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=u,c.prototype.set=s,t.exports=c},function(t,e,n){var r=n(5).Uint8Array;t.exports=r},function(t,e){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},function(t,e,n){var r=n(107),o=n(18),i=n(2),a=n(44),u=n(15),s=n(45),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=i(t),f=!n&&o(t),l=!n&&!f&&a(t),h=!n&&!f&&!l&&s(t),d=n||f||l||h,p=d?r(t.length,String):[],v=p.length;for(var g in t)!e&&!c.call(t,g)||d&&("length"==g||l&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||u(g,v))||p.push(g);return p}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}},function(t,e,n){var r=n(0),o=Object.create,i=function(){function t(){}return function(e){if(!r(e))return{};if(o)return o(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=i},function(t,e,n){var r=n(90),o=n(128);t.exports=function t(e,n,i,a,u){var s=-1,c=e.length;for(i||(i=o),u||(u=[]);++s<c;){var f=e[s];n>0&&i(f)?n>1?t(f,n-1,i,a,u):r(u,f):a||(u[u.length]=f)}return u}},function(t,e,n){var r=n(117)();t.exports=r},function(t,e,n){var r=n(13),o=n(23);t.exports=function(t,e){for(var n=0,i=(e=r(e,t)).length;null!=t&&n<i;)t=t[o(e[n++])];return n&&n==i?t:void 0}},function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},function(t,e,n){var r=n(8),o=n(6),i="[object Arguments]";t.exports=function(t){return o(t)&&r(t)==i}},function(t,e,n){var r=n(25),o=n(132),i=n(0),a=n(155),u=/^\[object .+?Constructor\]$/,s=Function.prototype,c=Object.prototype,f=s.toString,l=c.hasOwnProperty,h=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(r(t)?h:u).test(a(t))}},function(t,e,n){var r=n(8),o=n(26),i=n(6),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!a[r(t)]}},function(t,e,n){var r=n(0),o=n(40),i=n(144),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=o(t),n=[];for(var u in t)("constructor"!=u||!e&&a.call(t,u))&&n.push(u);return n}},function(t,e,n){var r=n(85),o=n(35),i=n(93),a=n(101),u=n(0),s=n(46);t.exports=function t(e,n,c,f,l){e!==n&&i(n,function(i,s){if(u(i))l||(l=new r),a(e,n,s,c,t,f,l);else{var h=f?f(e[s],i,s+"",e,n,l):void 0;void 0===h&&(h=i),o(e,s,h)}},s)}},function(t,e,n){var r=n(35),o=n(111),i=n(112),a=n(113),u=n(127),s=n(18),c=n(2),f=n(159),l=n(44),h=n(25),d=n(0),p=n(160),v=n(45),g=n(164);t.exports=function(t,e,n,_,y,m,x){var b=t[n],C=e[n],E=x.get(C);if(E)r(t,n,E);else{var w=m?m(b,C,n+"",t,e,x):void 0,R=void 0===w;if(R){var O=c(C),A=!O&&l(C),T=!O&&!A&&v(C);w=C,O||A||T?c(b)?w=b:f(b)?w=a(b):A?(R=!1,w=o(C,!0)):T?(R=!1,w=i(C,!0)):w=[]:p(C)||s(C)?(w=b,s(b)?w=g(b):(!d(b)||_&&h(b))&&(w=u(C))):R=!1}R&&(x.set(C,w),y(w,C,_,m,x),x.delete(C)),r(t,n,w)}}},function(t,e,n){var r=n(103),o=n(158);t.exports=function(t,e){return r(t,e,function(e,n){return o(t,n)})}},function(t,e,n){var r=n(94),o=n(105),i=n(13);t.exports=function(t,e,n){for(var a=-1,u=e.length,s={};++a<u;){var c=e[a],f=r(t,c);n(f,c)&&o(s,i(c,t),f)}return s}},function(t,e,n){var r=n(43),o=n(41),i=n(42);t.exports=function(t,e){return i(o(t,e,r),t+"")}},function(t,e,n){var r=n(36),o=n(13),i=n(15),a=n(0),u=n(23);t.exports=function(t,e,n,s){if(!a(t))return t;for(var c=-1,f=(e=o(e,t)).length,l=f-1,h=t;null!=h&&++c<f;){var d=u(e[c]),p=n;if(c!=l){var v=h[d];void 0===(p=s?s(v,d,h):void 0)&&(p=a(v)?v:i(e[c+1])?[]:{})}r(h,d,p),h=h[d]}return t}},function(t,e,n){var r=n(156),o=n(37),i=n(43),a=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:i;t.exports=a},function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},function(t,e,n){var r=n(11),o=n(89),i=n(2),a=n(27),u=1/0,s=r?r.prototype:void 0,c=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(a(e))return c?c.call(e):"";var n=e+"";return"0"==n&&1/e==-u?"-0":n}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){var r=n(86);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},function(t,e,n){(function(t){var r=n(5),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o?r.Buffer:void 0,u=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=u?u(n):new t.constructor(n);return t.copy(r),r}}).call(e,n(29)(t))},function(t,e,n){var r=n(110);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},function(t,e,n){var r=n(36),o=n(21);t.exports=function(t,e,n,i){var a=!n;n||(n={});for(var u=-1,s=e.length;++u<s;){var c=e[u],f=i?i(n[c],t[c],c,n,t):void 0;void 0===f&&(f=t[c]),a?o(n,c,f):r(n,c,f)}return n}},function(t,e,n){var r=n(5)["__core-js_shared__"];t.exports=r},function(t,e,n){var r=n(104),o=n(129);t.exports=function(t){return r(function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,u=i>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,u&&o(n[0],n[1],u)&&(a=i<3?void 0:a,i=1),e=Object(e);++r<i;){var s=n[r];s&&t(e,s,r,a)}return e})}},function(t,e){t.exports=function(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),u=a.length;u--;){var s=a[t?u:++o];if(!1===n(i[s],s,i))break}return e}}},function(t,e,n){var r=n(157),o=n(41),i=n(42);t.exports=function(t){return i(o(t,void 0,r),t+"")}},function(t,e,n){var r=n(11),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,u),n=t[u];try{t[u]=void 0;var r=!0}catch(t){}var o=a.call(t);return r&&(e?t[u]=n:delete t[u]),o}},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(13),o=n(18),i=n(2),a=n(15),u=n(26),s=n(23);t.exports=function(t,e,n){for(var c=-1,f=(e=r(e,t)).length,l=!1;++c<f;){var h=s(e[c]);if(!(l=null!=t&&n(t,h)))break;t=t[h]}return l||++c!=f?l:!!(f=null==t?0:t.length)&&u(f)&&a(h,f)&&(i(t)||o(t))}},function(t,e,n){var r=n(16);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var r=n(16),o="__lodash_hash_undefined__",i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return n===o?void 0:n}return i.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(16),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:o.call(e,t)}},function(t,e,n){var r=n(16),o="__lodash_hash_undefined__";t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?o:e,this}},function(t,e,n){var r=n(91),o=n(39),i=n(40);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:r(o(t))}},function(t,e,n){var r=n(11),o=n(18),i=n(2),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},function(t,e,n){var r=n(17),o=n(24),i=n(15),a=n(0);t.exports=function(t,e,n){if(!a(n))return!1;var u=typeof e;return!!("number"==u?o(n)&&i(e,n.length):"string"==u&&e in n)&&r(n[e],t)}},function(t,e,n){var r=n(2),o=n(27),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!o(t))||a.test(t)||!i.test(t)||null!=e&&t in Object(e)}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r,o=n(115),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!i&&i in t}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(12),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0||(n==e.length-1?e.pop():o.call(e,n,1),--this.size,0))}},function(t,e,n){var r=n(12);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(12);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(12);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},function(t,e,n){var r=n(84),o=n(10),i=n(33);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(t,e,n){var r=n(14);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e,n){var r=n(14);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(14);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(14);t.exports=function(t,e){var n=r(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}},function(t,e,n){var r=n(161),o=500;t.exports=function(t){var e=r(t,function(t){return n.size===o&&n.clear(),t}),n=e.cache;return e}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},function(t,e,n){(function(t){var r=n(38),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o&&r.process,u=function(){try{return a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=u}).call(e,n(29)(t))},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e){var n=800,r=16,o=Date.now;t.exports=function(t){var e=0,i=0;return function(){var a=o(),u=r-(a-i);if(i=a,u>0){if(++e>=n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(10);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(10),o=n(33),i=n(34),a=200;t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var u=n.__data__;if(!o||u.length<a-1)return u.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(u)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=/^\./,o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=n(143)(function(t){var e=[];return r.test(t)&&e.push(""),t.replace(o,function(t,n,r,o){e.push(r?o.replace(i,"$1"):n||t)}),e});t.exports=a},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e,n){var r=n(92);t.exports=function(t){return null!=t&&t.length?r(t,1):[]}},function(t,e,n){var r=n(95),o=n(121);t.exports=function(t,e){return null!=t&&o(t,e,r)}},function(t,e,n){var r=n(24),o=n(6);t.exports=function(t){return o(t)&&r(t)}},function(t,e,n){var r=n(8),o=n(39),i=n(6),a="[object Object]",u=Function.prototype,s=Object.prototype,c=u.toString,f=s.hasOwnProperty,l=c.call(Object);t.exports=function(t){if(!i(t)||r(t)!=a)return!1;var e=o(t);if(null===e)return!0;var n=f.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==l}},function(t,e,n){var r=n(34),o="Expected a function";function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(o);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(i.Cache||r),n}i.Cache=r,t.exports=i},function(t,e,n){var r=n(102),o=n(118)(function(t,e){return null==t?{}:r(t,e)});t.exports=o},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(114),o=n(46);t.exports=function(t){return r(t,o(t))}},function(t,e,n){var r=n(108);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){t.exports=n(48)}])});;"use strict";!function(e,t){if("function"!=typeof define||!define.amd)return t(e);define(["angular","ckeditor"],function(e){return t(e)})}(angular||null,function(e){var t,n=e.module("ngCkeditor",[]),i=!1;return n.run(["$q","$timeout",function(n,o){if(t=n.defer(),e.isUndefined(CKEDITOR))throw new Error("CKEDITOR not found");function a(){"loaded"===CKEDITOR.status?(i=!0,t.resolve()):a()}CKEDITOR.disableAutoInline=!0,CKEDITOR.config.allowedContent=!0,CKEDITOR.on("loaded",a),o(a,100)}]),n.directive("ckeditor",["$timeout","$q",function(n,o){return{restrict:"AC",require:["ngModel","^?form"],scope:!1,link:function(a,r,l,u){var s=u[0],d=u[1]||null,c="textarea"===r[0].tagName.toLowerCase(),f=[],m=!1;c||r.attr("contenteditable",!0);var C=function(){var t={toolbar:"full",toolbar_full:[{name:"basicstyles",items:["Bold","Italic","Strike","Underline"]},{name:"paragraph",items:["BulletedList","NumberedList","Blockquote"]},{name:"editing",items:["JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock"]},{name:"links",items:["Link","Unlink","Anchor"]},{name:"tools",items:["SpellChecker","Maximize"]},"/",{name:"styles",items:["Format","FontSize","TextColor","BGColor","PasteText","PasteFromWord","RemoveFormat"]},{name:"insert",items:["Image","Table","SpecialChar"]},{name:"forms",items:["Outdent","Indent"]},{name:"clipboard",items:["Undo","Redo"]},{name:"document",items:["PageBreak","Source"]}],disableNativeSpellChecker:!1,uiColor:"#FAFAFA",height:"250px",width:"100%"};t=e.extend(t,a[l.ckeditor]);var i=c?CKEDITOR.replace(r[0],t):CKEDITOR.inline(r[0],t),u=o.defer();r.bind("$destroy",function(){i&&CKEDITOR.instances[i.name]&&CKEDITOR.instances[i.name].destroy()});var C=function(e){var t=i.getData();""===t&&(t=null),n(function(){!0===e&&t===s.$viewValue||s.$setViewValue(t),!0===e&&d&&d.$setPristine()},0)},p=function(e){if(f.length){var t=f.pop()||"<p></p>";m=!1,i.setData(t,function(){C(e),m=!0})}};i.on("pasteState",C),i.on("change",C),i.on("blur",C),i.on("instanceReady",function(){a.$broadcast("ckeditor.ready"),a.$apply(function(){p(!0)}),i.document.on("keyup",C)}),i.on("customConfigLoaded",function(){u.resolve()}),s.$render=function(){f.push(s.$viewValue),m&&p()}};"loaded"===CKEDITOR.status&&(i=!0),i?C():t.promise.then(C)}}}]),n});;!function(){"use strict";angular.module("OfflineMode",["LocalStorageModule"])}();;!function(){"use strict";angular.module("FCUtilsModule",[])}();;!function(){"use strict";angular.module("FieldConnectApp",["ui.router","LocalStorageModule","FCUtilsModule","ngjsColorPicker","brantwills.paging","ui-notification","datePicker","angularModalService","leaflet-directive","ngTouch","ngGeolocation","OfflineMode","checklist-model","mdo-angular-cryptography","infiniteScroll","angular-linq","ng.deviceDetector","ngCkeditor"])}();;!function(){"use strict";function e(e,t,r,o,n,a,d){var s,i,l=this,c=r.getValue("authorizationData");function u(){l.refreshCards=!0,n.loadUserReports().then(function(e){l.cardList=e})}function f(e){e.preventDefault()}function h(e){e.dataTransfer.setData("report",e.currentTarget.innerText),e.dataTransfer.setData("id",e.currentTarget.id)}function p(e){l.model.DashboardReportId=e.dataTransfer.getData("id"),n.addUserReport(l.model).then(function(e){g(e)})}function g(e){d.showModal({templateUrl:"Templates/AdvancedReports/dashboardFiltersModal.html",controller:"dashboardFiltersPopupController",controllerAs:"vm",inputs:{id:e.Id,model:e}}).then(function(e){e.close.then(function(e){null===e.Filters?n.deleteUserReport(e.Id).then(function(){}):e.canceled||u()})})}l.fullName=c.fullName,l.userRoles=(s=c.userRoles,i=[],s.includes(",")?s.split(","):(i.push(s),i)),l.showFilters=g,l.loadCards=u,l.model={},l.reportList={},l.refreshCards=!0,l.updatedCard=null,n.loadReports(l.userRoles).then(function(e){l.reportList=e,function(){const e=document.querySelectorAll(".dashboard-chart-list li"),t=document.getElementById("dashboard-content");for(var r=0;r<e.length;r++)e[r].addEventListener("dragstart",h);t.addEventListener("drop",p),t.addEventListener("dragover",f)}()}),u(),l.showSidebar=function(){$("#dashboard-sidebar").toggleClass("active"),u()},l.expandCard=function(e){var t=e.Id;$("#card-"+t).toggleClass("col-sm-12"),$("#card-"+t+"-expand").find("i").toggleClass("fa-compress fa-expand")},l.Finished=function(){a(function(){!function(){if(l.refreshCards){l.refreshCards=!1;for(var e=0;e<l.cardList.length;e++)n.getChart(l.cardList[e])}}()})},l.getIcon=function(e){return n.getIcon(e)},l.deleteUserReport=function(e){var t=e.Id;bootbox.confirm("Are you sure that you want remove this chart?",function(e){e&&n.deleteUserReport(t).then(function(){u()})})}}angular.module("FieldConnectApp").controller("dashboardController",e),e.$inject=["$scope","Notification","cryptoStorageService","timezoneService","dashboardService","$timeout","ModalService"]}();;!function(){"use strict";function e(e,t,a,o,r,l,d,i){var n=this,u=i.getValue("authorizationData");u.tzDatebaseName;function s(){var t=JSON.parse(e.model.FilterTemplate),a=Object.keys(t);n.attFilters={LastDays:{Type:"dropdown",Label:"Date Range:",Required:!1,ApiMethod:"dashboardFilterDDList/ddlist",ValueProp:"Key",TextProp:"Value",ModelValue:"LastDays",Filter:r.filter("and").eq("Identifier","lastdays")},WoStatus:{Type:"dropdown",Label:"WO Status:",Required:!1,ApiMethod:"wostatuses",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"WoStatus"},AssignStatus:{Type:"dropdown",Label:"Assignment Status:",ApiMethod:"assignmentstatuses",ValueProp:"AssignmentStatusName",TextProp:"AssignmentStatusName",ModelValue:"AssignStatus",Required:!1},WoType:{Type:"dropdown",Label:"WO Type:",Required:!1,ApiMethod:"wotypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"WoType"},WoAssignStatus:{Type:"dropdown",Label:"Type:",Required:!1,ApiMethod:"dashboardFilterDDList/ddlist",ValueProp:"Key",TextProp:"Value",ModelValue:"WoAssignStatus",Filter:r.filter("and").eq("Identifier","woassignstatus")},LaborType:{Type:"dropdown",Label:"Labor Type:",Required:!1,ApiMethod:"dashboardFilterDDList/ddlist",ValueProp:"Key",TextProp:"Value",ModelValue:"LaborType",Filter:r.filter("and").eq("Identifier","labortype")},PayPeriod:{Type:"dropdown",Label:"Pay Period:",ApiMethod:"companypayperiods/getForTimeReports",ValueProp:"Id",TextProp:"Name",ModelValue:"PayPeriod",ConvertToInt:"true",Required:!1},CurrentDates:{Type:"dropdown",Label:"Current Date Range:",Required:!1,ApiMethod:"dashboardFilterDDList/ddlist",ValueProp:"Key",TextProp:"Value",ModelValue:"CurrentDates",ReadOnly:!1,Filter:r.filter("or").eq("Identifier","currentdates").eq("Identifier","lastdates")},LaborGroup:{Type:"dropdown",Label:"Labor Group:",Required:!1,ApiMethod:"laborgroups",ValueProp:"Name",TextProp:"Name",ModelValue:"LaborGroup"},StartDate:{Type:"datepicker",Label:"Start Date:",Required:!1,ModelValue:"StartDate",Format:"MM/dd/yyyy",SubType:"date"},EndDate:{Type:"datepicker",Label:"End Date:",Required:!1,ModelValue:"EndDate",Format:"MM/dd/yyyy",SubType:"date"},WeekDays:{Type:"dropdown",Label:"Start Day:",Required:!1,ApiMethod:"dashboardFilterDDList/ddlist",ValueProp:"Key",TextProp:"Value",ModelValue:"WeekDays",Filter:r.filter("and").eq("Identifier","weekdays")},NumWeeks:{Type:"int",Label:"Number of Weeks:",MaxLength:"5",ModelValue:"NumWeeks",Required:!1},PayRateMulti:{Type:"multiselect",Label:"Pay Rates:",ApiMethod:"payRates",ValueProp:"PayRateName",TextProp:"PayRateName",ModelValue:"PayRateMulti",Required:!1,ConvertToInt:"false"},WoStatusMulti:{Type:"multiselect",Label:"WO Status:",ApiMethod:"wostatuses",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"WoStatusMulti",Required:!1,ConvertToInt:!1},DaysForward:{Type:"int",Label:"Days Forward:",MaxLength:"5",ModelValue:"DaysForward",ReadOnly:!1,Required:!1},DaysBack:{Type:"int",Label:"Days Back:",MaxLength:"5",ModelValue:"DaysBack",ReadOnly:!1,Required:!1},ServiceRequestStatus:{Type:"dropdown",Label:"Request Status:",ApiMethod:"statuses",ReadOnly:!1,ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"ServiceRequestStatus",Filter:r.filter("and").eq("Type","ServiceRequestStatus")},Blank:{Type:"empty",CustomClass:"fc-empty-control col-sm-6",Required:!1},DeficiencyStatusMulti:{Type:"multiselect",Label:"Deficiency Status:",Required:!1,ApiMethod:"deficiencyStatus/ddList",ValueProp:"Id",TextProp:"StatusName",ModelValue:"DeficiencyStatusMulti",ConvertToInt:!0,ReadOnly:!1},DeficiencySeverityMulti:{Type:"multiselect",Label:"Deficiency Severity:",Required:!1,ApiMethod:"deficiencySeverity/ddList",ValueProp:"Id",TextProp:"SeverityName",ModelValue:"DeficiencySeverityMulti",ConvertToInt:!0,ReadOnly:!1},TechByGroupMulti:{Type:"multiselect",Label:"Techs:",ApiMethod:"employees/getTechnicianByLaborGroup",ValueProp:"Id",TextProp:"FullName",ModelValue:"TechByGroupMulti",ConvertToInt:"true",Required:!1,Filter:n.GroupFilter},LaborGroupsMulti:{Type:"multiselect",Label:"Groups:",Required:!1,ApiMethod:"laborgroups",ValueProp:"Id",TextProp:"Name",ModelValue:"LaborGroupsMulti",ConvertToInt:!0,ReadOnly:!1}};for(var o=[{Type:"text",Label:"Alternate Title:",ModelValue:"AltTitle",MaxLength:"250"}],l=0;l<a.length;l++)n.attFilters[a[l]].Required=t[a[l]].Required,o=o.concat(n.attFilters[a[l]]);return o}function p(){for(var t=JSON.parse(e.model.ConfigTemplate),a=Object.keys(t),o={BarOrientation:{Type:"dropdown",Label:"Orientation:",Required:!1,ApiMethod:"dashboardConfigDDList/ddlist",ValueProp:"Key",TextProp:"Value",ModelValue:"BarOrientation",Filter:r.filter("and").eq("Identifier","barorientation")},BarType:{Type:"dropdown",Label:"Chart Type:",Required:!1,ApiMethod:"dashboardConfigDDList/ddlist",ValueProp:"Key",TextProp:"Value",ModelValue:"BarType",Filter:r.filter("and").eq("Identifier","bartype")},PieType:{Type:"dropdown",Label:"Chart Type:",Required:!1,ApiMethod:"dashboardConfigDDList/ddlist",ValueProp:"Key",TextProp:"Value",ModelValue:"PieType",Filter:r.filter("and").eq("Identifier","pietype")}},l=[{Type:"line",CustomClass:"col-sm-12"}],d=0;d<a.length;d++)o[a[d]].Required=t[a[d]].Required,l=l.concat(o[a[d]]);return l=l.concat(o)}function y(){n.dateFilters.forEach(function(t){n.model.hasOwnProperty(t)&&(n.model.Id&&null===n.model[t]&&(n.attributes[n.attributes.findIndex(e=>e.ModelValue==t)].ReadOnly=!0),e.$watch(`vm.model.${t}`,function(e,a){e!==a&&(e?n.dateFilters.forEach(function(e){"DaysForward"===t||"DaysBack"===t?n.model.hasOwnProperty(e)&&"DaysBack"!==e&&"DaysForward"!==e&&(n.attributes[n.attributes.findIndex(t=>t.ModelValue==e)].ReadOnly=!0):"StartDate"===t||"EndDate"===t?n.model.hasOwnProperty(e)&&"StartDate"!==e&&"EndDate"!==e&&(n.attributes[n.attributes.findIndex(t=>t.ModelValue==e)].ReadOnly=!0):n.model.hasOwnProperty(e)&&e!==t&&(n.attributes[n.attributes.findIndex(t=>t.ModelValue==e)].ReadOnly=!0)}):n.dateFilters.forEach(function(e){"DaysForward"===t||"DaysBack"===t?n.model.hasOwnProperty(e)&&"DaysBack"!==e&&"DaysForward"!==e&&null===n.model.DaysBack&&null===n.model.DaysForward&&(n.attributes[n.attributes.findIndex(t=>t.ModelValue==e)].ReadOnly=!1):"StartDate"===t||"EndDate"===t?n.model.hasOwnProperty(e)&&"StartDate"!==e&&"EndDate"!==e&&(null!==n.model.StartDate&&void 0!==n.model.StartDate||null!==n.model.EndDate&&void 0!==n.model.EndDate||(n.attributes[n.attributes.findIndex(t=>t.ModelValue==e)].ReadOnly=!1)):n.model.hasOwnProperty(e)&&e!==t&&(n.attributes[n.attributes.findIndex(t=>t.ModelValue==e)].ReadOnly=!1)}))}))})}function m(e){var t=new Date(e),a=moment.tz.zone(u.tzDatebaseName).offset(t);return d.convertToLocal(t,a)}function c(e,t){var a=e,o=d.convertToUtc(a);return d.buildISOString(o)}function D(t){e.close(n.model,200)}n.$scope=e,n.id=e.id,n.model=e.model,n.model.canceled=!0,n.submit=function(){if(function(){var e=0,t=!1;n.model.hasOwnProperty("CurrentDates")&&null!==n.model.CurrentDates&&void 0!==n.model.CurrentDates&&e++;n.model.hasOwnProperty("StartDate")&&(null!==n.model.StartDate&&void 0!==n.model.StartDate||null!==n.model.EndDate&&void 0!==n.model.EndDate)&&e++;n.model.hasOwnProperty("PayPeriod")&&null!==n.model.PayPeriod&&void 0!==n.model.PayPeriod&&e++;n.model.hasOwnProperty("LastDays")&&null!==n.model.LastDays&&void 0!==n.model.LastDays&&e++;n.model.hasOwnProperty("DaysForward")&&(null===n.model.DaysBack||void 0===n.model.DaysBack||null!==n.model.DaysForward&&void 0!==n.model.DaysForward?null!==n.model.DaysBack&&void 0!==n.model.DaysBack||null===n.model.DaysForward||void 0===n.model.DaysForward?null!==n.model.DaysBack&&void 0!==n.model.DaysBack&&null!==n.model.DaysForward&&void 0!==n.model.DaysForward&&e++:(n.model.DaysBack=0,e++):(n.model.DaysForward=0,e++));0===e?(t=!0,a.error("At least (1) date filter must be set!")):e>1&&(t=!0,a.warning("Only (1) date filter can be used!"));return t}())return;if(!function(){var e=!0;n.model.hasOwnProperty("NumWeeks")&&(n.model.NumWeeks>52&&(a.warning("Number of Weeks cannot exceed 52!"),e=!1),n.model.NumWeeks<=0&&(a.warning("Number of Weeks must be greater than 0!"),e=!1));return e}())return;n.disableSubmit=!0,n.model.Filters=null,n.model.Configuration=null,n.model.Filters=function(){for(var e=JSON.parse(n.model.FilterTemplate),t=Object.keys(e),o={},r=0;r<t.length;r++)void 0===n.model[t[r]]?o[t[r]]=e[t[r]].Default:o[t[r]]=n.model[t[r]];o.hasOwnProperty("PayPeriod")&&null!==o.PayPeriod&&(o.PayPeriodStartDate=c(n.payPeriodDates.StartDate,!0),o.PayPeriodEndDate=c(n.payPeriodDates.EndDate,!1));o.hasOwnProperty("StartDate")&&null!==o.StartDate&&(o.StartDate=c(o.StartDate,!0));o.hasOwnProperty("EndDate")&&null!==o.EndDate&&(o.EndDate=c(o.EndDate,!1));if(n.model.hasOwnProperty("TechByGroupMulti")&&0==o.TechByGroupMulti.length)try{n.attFilters.TechByGroupMulti.CurrentList.forEach(function(e){o.TechByGroupMulti.push(e.Id)})}catch(e){a.error("There was an error retrieving techs from the group")}return JSON.stringify(o)}(),n.model.Configuration=function(){for(var e=JSON.parse(n.model.ConfigTemplate),t=Object.keys(e),a={},o=0;o<t.length;o++)void 0===n.model[t[o]]?a[t[o]]=e[t[o]].Default:a[t[o]]=n.model[t[o]];return JSON.stringify(a)}(),o.updateUserReport(n.model).then(function(e){t(function(){n.model.canceled=!1,D(e)})})},n.close=D,n.show=!1,n.dateFilters=["LastDays","PayPeriod","CurrentDates","StartDate","EndDate","DaysForward","DaysBack"],n.GroupFilter={groupIds:""},n.hideSubmit=!1,n.hideCancel=!1,n.disableSubmit=!1,n.attributes=[],e.$watch("vm.model.Id",function(e,a){null===n.model.Filters?t(function(){!function(){var e=JSON.parse(n.model.FilterTemplate),t=Object.keys(e);n.model=Object.assign(n.model,e);for(var a=0;a<t.length;a++)n.model[t[a]]=e[t[a]].Default}(),function(){var e=JSON.parse(n.model.ConfigTemplate),t=Object.keys(e);n.model=Object.assign(n.model,e);for(var a=0;a<t.length;a++)n.model[t[a]]=e[t[a]].Default}(),n.attributes=s(),n.attributes=n.attributes.concat(p()),y(),n.show=!0}):t(function(){!function(){for(var e=JSON.parse(n.model.FilterTemplate),a=JSON.parse(n.model.Filters),o=Object.keys(e),r=0;r<o.length;r++)a.hasOwnProperty(o[r])?n.model[o[r]]=a[o[r]]:n.model[o[r]]=e[o[r]];if(n.model.hasOwnProperty("WoStatusMulti")){var l=[];a.WoStatusMulti.forEach(function(e){l.push(e)}),n.model.WoStatusMulti=null,t(function(){n.model.WoStatusMulti=l})}if(n.model.hasOwnProperty("PayRateMulti")){var d=[];a.PayRateMulti.forEach(function(e){d.push(e)}),n.model.PayRateMulti=null,t(function(){n.model.PayRateMulti=d})}n.model.hasOwnProperty("StartDate")&&null!==n.model.StartDate&&(n.model.StartDate=m(n.model.StartDate));n.model.hasOwnProperty("EndDate")&&null!==n.model.EndDate&&(n.model.EndDate=m(n.model.EndDate));if(n.model.hasOwnProperty("DeficiencyStatusMulti")){var i=[];a.DeficiencyStatusMulti.forEach(function(e){i.push(e)}),n.model.DeficiencyStatusMulti=null,t(function(){n.model.DeficiencyStatusMulti=i})}if(n.model.hasOwnProperty("DeficiencySeverityMulti")){var u=[];a.DeficiencySeverityMulti.forEach(function(e){u.push(e)}),n.model.DeficiencySeverityMulti=null,t(function(){n.model.DeficiencySeverityMulti=u})}if(n.model.hasOwnProperty("LaborGroupsMulti")){var s=[];a.LaborGroupsMulti.forEach(function(e){s.push(e)}),n.model.LaborGroupsMulti=null,t(function(){n.model.LaborGroupsMulti=s})}if(n.model.hasOwnProperty("TechByGroupMulti")){var p=[];a.TechByGroupMulti.forEach(function(e){p.push(e)}),n.model.TechByGroupMulti=null,t(function(){n.model.TechByGroupMulti=p})}}(),function(){for(var e=JSON.parse(n.model.ConfigTemplate),t=JSON.parse(n.model.Configuration),a=Object.keys(e),o=0;o<a.length;o++)t.hasOwnProperty(a[o])?n.model[a[o]]=t[a[o]]:n.model[a[o]]=e[a[o]]}(),n.attributes=s(),n.attributes=n.attributes.concat(p()),y(),n.show=!0},100)}),e.$watch("vm.model.PayPeriod",function(e,t){e!==t&&null!==e?l.getItem("companypayperiods",e).then(function(e){var t=e.data,a=m(t.EndDate),o=m(t.StartDate);null!==t.GraceDays&&(a=m(a=new Date(moment(t.EndDate,"YYYY-MM-DD").add(t.GraceDays,"days").format("YYYY-MM-DD")))),n.payPeriodDates={StartDate:o,EndDate:a}}):null===e&&(n.payPeriodDates={StartDate:null,EndDate:null})}),e.$watch("vm.model.LaborGroupsMulti",function(){if(n.model.LaborGroupsMulti){n.model.TechByGroupMulti=[];var e="";if(0!=n.model.LaborGroupsMulti.lengh){for(var t=0;t!=n.model.LaborGroupsMulti.length;t++)e+=n.model.LaborGroupsMulti[t]+",";e=e.substring(0,e.length-1)}n.GroupFilter.groupIds=e}})}angular.module("FieldConnectApp").controller("dashboardFiltersPopupController",e),e.$inject=["$scope","$timeout","Notification","dashboardService","qsService","restService","timezoneService","cryptoStorageService"]}();;!function(){"use strict";function e(e,r,t,o){var a=this;if(a.report={id:null,embedUrl:null,accessToken:null,expiresOn:null},null==o.getValue("Report"))s();else{a.report=o.getValue("Report");var n=new Date(a.report.expiresOn),l=new Date;n.getTime()<l.getTime()&&(a.report={},o.removeValue("Report"),s())}function s(){r.getItems("advancedreports/dashboard").then(function(e){200===e.status&&(a.report.id=e.data.Id,a.report.embedUrl=e.data.EmbedUrl,a.report.accessToken=e.data.AccessToken,a.report.expiresOn=e.data.ExpiresOn,o.setValue("Report",a.report)),404===e.status&&t.error({message:"Failed to load dashboard"})})}}angular.module("FieldConnectApp").controller("PowerBiController",e),e.$inject=["$scope","restService","Notification","cryptoStorageService"]}();;!function(){"use strict";function e(e,t,i,r,a,l,s,m){var n=this;n.model={},n.$state=i,n.close=function(){n.modalClass=!1,e.close(null,50)},n.agreementsData=e.agreementsData,n.siteFilter=l.filter("and"),n.id=e.customerId,n.model.AgreementId=null,n.ListServiceableItems=[],n.siteFilter.eq("SiteList",n.agreementsData.ListSites).eq("ServiceableItemList",n.agreementsData.ListServiceableItems),n.attributes=[{Type:"multiselect",Label:"ServiceableItem",ApiMethod:"serviceableitems/getserviceableItemForItemForAgreement",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ListServiceableItemIds",Filter:n.siteFilter}],n.model.AgreementId=parseInt(a.id),n.reloadTable=!0,n.model.AgreementId=parseInt(a.id)}angular.module("FieldConnectApp").controller("AgreementAddServiceableItemController",e),e.$inject=["$scope","$location","$state","ModalService","$stateParams","qsService","stateTransitionService","restService"]}();;!function(){"use strict";function e(e,t,i,l,s,a,r){var o=this;o.model={},o.$state=i,o.close=function(){o.modalClass=!1,e.close(null,50)},o.agreementsData=e.agreementsData,o.siteFilter=a.filter("and"),o.id=e.customerId,o.model.AgreementId=null,null!=o.id&&o.siteFilter.eq("CustomerId",o.id).eq("SiteList",o.agreementsData.ListSites),o.attributesEditSite=[{Type:"multiselect",Label:"Site",ApiMethod:"sites/getSitesForAgreement",ValueProp:"Id",TextProp:"SiteName",ModelValue:"ListSitesIds",Filter:o.siteFilter}],o.reloadTable=!0,o.model.AgreementId=parseInt(s.id)}angular.module("FieldConnectApp").controller("AgreementAddSiteController",e),e.$inject=["$scope","$location","$state","ModalService","$stateParams","qsService","stateTransitionService"]}();;!function(){"use strict";function e(e,t,a,o,n,l,m,d,i,r){var c=this;function u(e){var t=new Date;return e.setHours(t.getHours()),e.setMinutes(t.getMinutes()),e.setSeconds(t.getSeconds()),e}c.model={},c.$state=a,c.id=n.id,c.agreementId=n.agreementId,c.selectPaymentTerm=!0,c.goBack=function(){window.history.back()},c.saveInvoice=function(){var e="agreementInvoices";c.id&&(e+="/"+c.id);var t=new Date,o=new Date,n=new Date(t);c.model.Status="Open",c.model.StatusDate=(new Date).toISOString(),c.model.InvoiceDate=new Date(c.model.InvoiceDate),c.model.InvoiceDate=u(c.model.InvoiceDate),c.model.InterfacedDate&&(c.model.InterfacedDate=new Date(c.model.InterfacedDate),c.model.InterfacedDate=u(c.model.InterfacedDate));void 0!=c.model.InvoiceDate&&(o=c.model.InvoiceDate);if(null!=c.model.PaymentTermId){var l=c.payterm.Days;n.setTime(o.getTime()+864e5*l),c.model.DueDate=n}else c.model.DueDate="";var r=new Date(c.model.InvoiceDate);i.convertToUtc(c.model.InvoiceDate),c.model.InvoiceDate=i.buildISOString(c.model.InvoiceDate),c.model.InterfacedDate&&(c.model.InterfacedDate=i.convertToUtc(c.model.InterfacedDate),c.model.InterfacedDate=i.buildISOString(c.model.InterfacedDate));m.update(e,angular.copy(c.model)).then(function(e){d.success({message:"Invoice successfully saved."}),a.go("invoiceReview")}),c.model.InvoiceDate=r},c.postInvoice=function(){var e="agreementInvoices";c.id&&(e+="/"+c.id);var t=new Date,o=new Date,n=new Date(t);c.model.StatusDate=(new Date).toISOString(),c.model.InvoiceDate=new Date(c.model.InvoiceDate),c.model.InvoiceDate=u(c.model.InvoiceDate),c.model.InterfacedDate&&(c.model.InterfacedDate=new Date(c.model.InterfacedDate),c.model.InterfacedDate=u(c.model.InterfacedDate));void 0!=c.model.InvoiceDate&&(o=c.model.InvoiceDate);if(null!=c.model.PaymentTermId){var l=c.payterm.Days;n.setTime(o.getTime()+864e5*l),c.model.DueDate=n}else c.model.DueDate="";var r=new Date(c.model.InvoiceDate);i.convertToUtc(c.model.InvoiceDate),c.model.InvoiceDate=i.buildISOString(c.model.InvoiceDate),c.model.InterfacedDate&&(c.model.InterfacedDate=i.convertToUtc(c.model.InterfacedDate),c.model.InterfacedDate=i.buildISOString(c.model.InterfacedDate));c.model.Status="Posted",m.update(e,angular.copy(c.model)).then(function(e){d.success({message:"Invoice successfully posted."}),a.go("invoiceReview")}),c.model.InvoiceDate=r},c.voidInvoice=function(){bootbox.confirm("Are you sure that you want to void the invoice?",function(e){e&&m.update("agreementInvoices/cancel/"+c.id).then(function(e){d.success({message:"Invoice successfully voided."}),a.go("invoiceReview")})})},c.agrData=r.getTransitionParam("agreementData"),c.AgreementInvoiceClick="Invoice",c.attributes=[{Type:"text",Label:"InvoiceId:",ModelValue:"AltId",ReadOnly:"true"},{Type:"text",Label:"Status:",ModelValue:"Status",ReadOnly:"true",MaxLength:"15"},{Type:"text",Label:"Customer:",ModelValue:"CustomerName",ReadOnly:"true"},{Type:"datepicker",Label:"Invoice Date:",ModelValue:"InvoiceDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"text",Label:"Agreement:",ModelValue:"AgreementDesc",ReadOnly:"true"},{Type:"datepicker",Label:"Post Date:",ModelValue:"PostDate",Format:"MM/dd/yyyy",SubType:"date",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"dropdown",Label:"Payment Term:",ApiMethod:"paymentTerms",ValueProp:"Id",TextProp:"PaymentTermName",ModelValue:"PaymentTermId",ConvertToInt:"true"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"datepicker",Label:"Due Date:",ModelValue:"DueDate",ReadOnly:"true",Format:"MM/dd/yyyy",SubType:"date"},{Type:"text",Label:"Bill:",ModelValue:"BillNum",ReadOnly:"true",CustomDivClass:"col-sm-offset-1 col-sm-1 col-lg-1"},{Type:"text",Label:"of",ModelValue:"NumBillings",ReadOnly:"true",CustomDivClass:"col-sm-1 col-lg-1"},{Type:"datepicker",Label:"Interfaced Date:",ModelValue:"InterfacedDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"decimal",Label:"Invoice Amount:",ModelValue:"InvoiceAmount",ReadOnly:"true"},{Type:"checkbox",Label:"Interfaced",ModelValue:"Interfaced"},{Type:"textarea",Label:"Note:",ModelValue:"Note",MaxLength:"500"},{Type:"text",Label:"ExternalId:",ModelValue:"ExternalId",MaxLength:"50"}],c.id||m.getItem("agreements/getAgreement",c.agreementId).then(function(){c.agreement=m.state.item,c.model.CustomerId=c.agreement.CustomerId,c.model.AgreementDesc=c.agreement.AltId+" "+c.agreement.Desc,c.model.AgreementId=c.agreement.Id,c.model.CustomerName=c.agreement.CustomerName,c.agreement.NumBillings?c.model.NumBillings=c.agreement.NumBillings:c.model.NumBillings=1,c.model.BillingTypeName=c.agreement.BillingTypeName,"Monthly"==c.agreement.BillingTypeName||"Quarterly"==c.agreement.BillingTypeName?(c.model.InvoiceAmount=Math.round(c.agreement.Price/c.model.NumBillings*100)/100,c.model.InvoiceAmount*(c.model.NumBillings-1)>=c.agreement.Price&&(c.model.InvoiceAmount=Math.floor(c.agreement.Price/c.model.NumBillings*100)/100),c.model.InvoiceDate=new Date((new Date).getFullYear(),(new Date).getMonth(),null==c.agreement.InvoiceDay?(new Date).getDate():c.agreement.InvoiceDay),c.model.PostDate=c.agreement.PostDate):(c.model.NumBillings=1,c.model.InvoiceAmount=c.agreement.Price.toFixed(2),c.model.InvoiceAmount=parseFloat(c.model.InvoiceAmount),c.model.InvoiceDate=new Date((new Date).getFullYear(),(new Date).getMonth(),null==c.agreement.InvoiceDay?(new Date).getDate():c.agreement.InvoiceDay)),c.model.AgreementPrice=c.agreement.Price,c.model.CustomerId&&c.selectPaymentTerm&&(m.getItem("customers/"+c.model.CustomerId).then(function(){c.customerEdit=m.state.item,c.model.PaymentTermId=c.customerEdit.PaymentTermId}),c.selectPaymentTerm=!1)}),e.$watch("vm.model",function(){c.id||(c.model.Status="Open")},!0),e.$watch("vm.model.PaymentTermId",function(){var e;null!=c.model.PaymentTermId?(e=c.model.PaymentTermId,m.getItem("paymentTerms",e).then(function(){c.payterm=m.state.item;var e=new Date,t=new Date;if(void 0!=c.model.InvoiceDate&&(e=c.model.InvoiceDate),null!=c.model.PaymentTermId){var a=c.payterm.Days;t.setTime(e.getTime()+864e5*a),c.model.DueDate=t}else c.model.DueDate=""})):c.model.DueDate=""}),e.$watch("vm.agrData",function(){void 0!=c.agrData?c.AgreementInvoiceClick="Agreement":c.AgreementInvoiceClick="Invoice"})}angular.module("FieldConnectApp").controller("AgreementInvoiceFormController",e),e.$inject=["$scope","$location","$state","ModalService","$stateParams","qsService","restService","Notification","timezoneService","stateTransitionService"]}();;!function(){"use strict";function e(e,o,t,a,d,l,r,i,u,n){var s=this;s.$scope=e,s.attributes=e.attributes,s.id=e.id,s.model=e.model,s.apiMethod=e.apiMethod,s.timezone=e.timezone,s.customFocus=e.customFocus,s.viewName=e.viewName,s.submit=function(){1==s.model.Billable?(s.model.Billable=1,s.model.Hours=s.model.WorkHours):(s.model.Billable=0,s.model.Hours=s.model.WorkHours);s.usingLaborRounding&&(s.model.Hours=s.roundedBillingHours);s.model.Date=(o=s.model.Date,d=o,l=u.convertToUtc(d),u.buildISOString(l)),t.update(s.apiMethod+"/"+s.model.Id,s.model).then(function(o){e.close(null,200),a.success(s.model.LaborCodeName+" time added successfully.")});var o,d,l},s.moduleName=e.moduleName,s.filter=e.filter,s.modalClass=!1,s.customerId=e.customerId;var c;n.getValue("authorizationData").tzDatebaseName;o(function(){s.modalClass=!0}),s.hideSubmit=!1,s.hideCancel=!0,e.hideSubmit&&(s.hideSubmit=e.hideSubmit),e.hideCancel&&(s.hideCancel=e.hideCancel),s.onBack=function(o){if(e.onBack&&!e.onBack(o))return;s.modalClass=!1,e.close(null,200)},s.usingDSLNorthwest=d.usingDSLNorthwest,s.usingLaborRounding=d.usingLaborRounding,function(){s.laborCodes={Type:"dropdown",Label:"Labor Code:",Required:!0,ApiMethod:"laborCodes",ValueProp:"LaborCodeName",TextProp:"LaborCodeName",ModelValue:"LaborCodeName",CustomInputClass:"",Name:"LaborCode"},s.usingDSLNorthwest&&(s.customerFilter=l.filter("and"),s.customerFilter.eq("CustomerId",s.customerId),s.laborCodes={Type:"dropdown",Label:"Labor Code:",Required:!0,ApiMethod:"dslLaborCodeByServiceZoneCode/ddList",Filter:s.customerFilter,ValueProp:"LaborCodeName",TextProp:"LaborCodeName",ModelValue:"LaborCodeName",CustomInputClass:"",Name:"LaborCode"});if(s.attributesEdit=[s.laborCodes,{Type:"decimal",Label:"Work Hours:",ModelValue:"WorkHours",ReadOnly:!0},{Type:"datepicker",Label:"Date:",ModelValue:"Date",Format:"MM/dd/yyyy",SubType:"date",Required:!0},{Type:"dropdown",Label:"Pay Rate:",Required:!0,ApiMethod:"payRates",ValueProp:"Id",TextProp:"PayRateName",ModelValue:"PayRateId",Name:"PayRate"},{Type:"dropdown",Label:"Tech:",ApiMethod:"employees/getTechForLabor",ValueProp:"Id",TextProp:"FullName",ModelValue:"TechId",Required:!0},{Type:"checkbox",Label:"Billable",ModelValue:"Billable"},{Type:"textarea",Label:"Note: (Optional)",MaxLength:"500",ModelValue:"Note",Rows:1},{Type:"hidden",Label:"Standard Note:",ValueProp:"Note",TextProp:"NoteTitle",Autofocus:"true",ModelValue:"NoteTemp"},{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"Viewable"},{Type:"currency",Label:"Rate Hour:",ModelValue:"Rate",ReadOnly:!1,Roles:["Admin","FieldConnect","TransAdmin","Office"]},{Type:"decimal",Label:"Bill Hours:",ModelValue:"Hours",Required:!1,Roles:["Admin","FieldConnect","TransAdmin","SubAdmin","Office"]}],s.usingDSLNorthwest){s.attDSLActionTaken={Type:"dropdown",Label:"Action Taken:",ApiMethod:"dslActionTaken/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extActionTakenId",ConvertToInt:"true"},s.attDSLFaultAreas={Type:"dropdown",Label:"Trouble Found:",ApiMethod:"dslFaultAreas/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extFaultAreasId",ConvertToInt:"true"},s.attDSLApplicableCode={Type:"dropdown",Label:"Applicable Zone:",ApiMethod:"dslApplicableCode/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extApplicableCodeId",ConvertToInt:"true"},s.attDSLInstalledRemoved={Type:"dropdown",Label:"Installed/Removed:",ApiMethod:"dslInstalledRemoved/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extInstalledRemovedId",ConvertToInt:"true"},s.attDSLWhoPays={Type:"dropdown",Label:"Who Pays:",ApiMethod:"dslWhoPays/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extWhoPaysId",ConvertToInt:"true"},s.attDSLIndirectLaborQuantity={Type:"int",Label:"Indirect Labor Qty:",ModelValue:"extIndirectLaborQuantity"},s.attDSLIndirectPartNumber={Type:"text",Label:"Part#/TOF",ModelValue:"extIndirectPartNumber",MaxLength:"250"};var e=[s.attDSLActionTaken,s.attDSLFaultAreas,s.attDSLApplicableCode,s.attDSLInstalledRemoved,s.attDSLWhoPays,s.attDSLIndirectLaborQuantity,s.attDSLIndirectPartNumber];s.attributesEdit=s.attributesEdit.concat(e)}null!==s.attributes&&void 0!==s.attributes||(s.attributes=s.attributesEdit)}(),e.$watch("vm.model.RateSheetId",function(){null!=s.model.RateSheetId&&t.getItem("ratesheets",s.model.RateSheetId).then(function(e){var o=e.data;s.model.LaborRateHour=o.LaborRateHour})}),e.$watch("vm.model.PayRateId",function(){null!=s.model.PayRateId&&t.getItem("payrates",s.model.PayRateId).then(function(e){var o=e.data;null!=o.RateMultiplier&&null==o.RateHour?s.model.Rate=s.model.LaborRateHour*o.RateMultiplier:s.model.Rate=o.RateHour})}),e.$watch("vm.model.LaborCodeName",function(){s.model.LaborCodeName&&o(function(){var e=$.grep(s.attributes,function(e){return"LaborCode"==e.Name})[0].CurrentList;c=$.grep(e,function(e){return e.LaborCodeName==s.model.LaborCodeName}),s.model.PayRateId=c[0].PayRateId})}),s.workHoursWatch=e.$watch("vm.model.WorkHours",function(e,t){s.usingLaborRounding||s.workHoursWatch(),e!==t&&(r.getLaborCostRounded(s.model.rawHours).then(function(e){o(function(){s.model.WorkHours=e,s.workHoursWatch()})}),r.getLaborBillingRounded(s.model.rawHours).then(function(e){s.roundedBillingHours=e}))},!0)}angular.module("FieldConnectApp").controller("AgreementTimePopupController",e),e.$inject=["$scope","$timeout","restService","Notification","featuresFactory","qsService","LaborRoundingService","fcGeoLocationService","timezoneService","cryptoStorageService"]}();;!function(){"use strict";function e(e,t,o,m,r){var a=this;function s(){var e="";if(a.model.CustomerId)e=angular.copy(a.model.CustomerName);else if(a.CustomerNameTemp){e=angular.copy(a.CustomerNameTemp);a.CustomerNameTemp=""}m.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectCustomer.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:a.customer,customerName:e}})}a.viewName="Agreements",a.moduleName="AgreementsGrid",a.model={},a.isLoading=!1,a.edit=function(e){o.go("agreementsEdit",{id:e})},a.$state=o,a.search=function(){a.isLoading=!0;for(;a.filters.filter.length>0;)a.filters.filter.splice(0,1);a.filters.eq("Status",a.model.Status).eq("CustomerName",a.model.CustomerName),setTimeout(function(){a.isLoading=!1,e.$apply()},1e3)},a.customer={customerId:0},a.filters=r.filter("and"),a.selectCustomer=s,a.FilterStatus={filterId:"Agreement"},a.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],a.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}],a.ddgCustomer={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:function(e){a.customer.customerId=e.Id,a.customer.customerName=e.CustomerName,a.customer.customerCode=e.CustomerCode,a.customer.customerCode&&""!=a.customer.customerCode?a.model.CustomerName=a.customer.customerCode+" - "+a.customer.customerName:a.model.CustomerName=a.customer.customerName},SearchTrigger:1,Label:"Customer:",Required:!0,ApiMethod:"customers/active",ModelValue:"CustomerName",Id:"CustomerName",GridAttributes:a.ddlgridattrsCustomer,PageSize:22,SearchCols:a.searchColsCustomer,Autofocus:"true",TabIndex:1},a.attributesFilter=[a.ddgCustomer,{Type:"button",Label:"Search",onClick:s},{Type:"dropdown",Label:"Status:",ApiMethod:"statuses/statusbytype",Filter:a.FilterStatus,ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status"}],a.attributes=[{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Agreement",ValueName:"AltId",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!0,Sortable:!0},{Name:"Agreement Type",ValueName:"AgreementTypeName",Edit:!1,Sortable:!0},{Name:"Start Date",ValueName:"StartDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"End Date",ValueName:"EndDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"SLA",ValueName:"SLAHours",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Invoiced",ValueName:"Invoiced",Edit:!1,Sortable:!0,CellFormat:"checkbox"}],a.isLoading=!0,e.$on("CustomerNameSearching",function(e,t){a.model.CustomerId=null,a.customer.customerId=null}),a.CustomerNameTemp="",a.focusOut=function(e){e&&e.hasOwnProperty("FocusOut")&&e.FocusOut&&"CustomerName"===e.ModelValue&&(a.CustomerNameTemp=angular.copy(a.model.CustomerName),null==a.model.CustomerId&&(a.model.CustomerName=null))},e.$watch("vm.customer.customerId",function(){null!=a.customer.customerId&&a.customer.customerId>0&&(a.model.CustomerId=a.customer.customerId,a.model.CustomerName=a.customer.customerName)}),setTimeout(function(){a.isLoading=!1,e.$apply()},1e3)}angular.module("FieldConnectApp").controller("AgreementsController",e),e.$inject=["$scope","$location","$state","ModalService","qsService"]}();;!function(){"use strict";function e(e,t,a,s,r,i,l,m,n,o,d,u){var c=this;c.FilterStatus={filterId:"Agreement"},c.model={},c.edit=function(e){if(e.SiteId){var t=s.href("sitesEdit",{id:e.SiteId});window.open(t,"_blank")}else if(e.ServiceableItemId){var t=s.href("serviceableItemsEdit",{customerId:c.model.CustomerId,id:e.ServiceableItemId});window.open(t,"_blank")}},c.AgreementSitesSI=!0,c.editSite=p,c.allSitesCovered=!1,c.createInvoice=function(){c.AgreementParam="Agreement",m.selectiveExtend(v,c,["AgreementParam"]),m.setTransitionParam("agreementData",v),s.go("agreementCreateInvoice",{agreementId:c.id})},c.goToPM=function(){c.AgreementId=c.id,c.CustomerId=c.customer.Id,c.CustomerName=c.customer.CustomerName,c.AgreementAltId=c.model.AltId,m.selectiveExtend(A,c,["AgreementId","CustomerId","CustomerName","AgreementAltId"]),m.setTransitionParam("agreementData",A),c.$state.go("PM")},c.editServiceableItem=h,c.reloadSA=b,c.submit=function(){var t=new Date;c.model.StartDate.setHours(t.getHours()),c.model.StartDate.setMinutes(t.getMinutes()),c.model.StartDate.setSeconds(t.getSeconds()),c.model.StartDate=d.convertToUtc(c.model.StartDate),c.model.StartDate=d.buildISOString(c.model.StartDate),c.model.EndDate.setHours(t.getHours()),c.model.EndDate.setMinutes(t.getMinutes()),c.model.EndDate.setSeconds(t.getSeconds()),c.model.EndDate=d.convertToUtc(c.model.EndDate),c.model.EndDate=d.buildISOString(c.model.EndDate),c.id?e.update("agreements",c.model).then(function(e){e&&(i.success({message:"Agreement successfully updated!"}),o(function(){u.location.reload()},1200))}):e.create("agreements",c.model).then(function(e){e&&(i.success({message:"Agreement successfully created!"}),o(function(){s.go("agreementsEdit",{id:e.data.Id}),u.location.reload()},2e3))})},c.numServItem="",c.selectAll={ListServiceableItemIds:[],SiteNames:[],AgreementId:"",Latitude:"",ListSitesIds:[],Longitude:""},c.selectAllSI={ListServiceableItemIds:[],AgreementId:"",Latitude:"",Longitude:""},c.agreementSiteFilter=l.filter("and"),c.agreementType={},c.agreementsData={AgreementId:null,ListSites:[],ListServiceableItems:[]},c.idtmp=null,c.siteNumFilter=l.filter("and"),c.agreementFilter=l.filter("and"),c.$state=s,c.reloadTable=!0,c.$stateParams=r,c.customer={customerId:0},c.selectCustomer=S,c.filterStatus=l.filter("or"),c.filterStatus.eq("Status","Active"),c.AgreementParam="Agreement",c.agrData=m.popTransitionParam("agreementData"),c.pmPlansButtonDisabled=!0;if(c.sla={Type:"int",Label:"SLA:",ModelValue:"SLAHours",ReadOnly:!1},c.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],c.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}],c.ddgCustomer={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:function(e){c.customer.customerId=e.Id,c.customer.customerName=e.CustomerName,c.customer.customerCode=e.CustomerCode,c.customer.customerCode&&""!=c.customer.customerCode?c.model.CustomerName=c.customer.customerCode+" - "+c.customer.customerName:c.model.CustomerName=c.customer.customerName},SearchTrigger:1,Label:"Customer:",Required:!0,ApiMethod:"customers/active",ModelValue:"CustomerName",Id:"CustomerName",GridAttributes:c.ddlgridattrsCustomer,PageSize:22,SearchCols:c.searchColsCustomer,Autofocus:"true",TabIndex:1},c.search={Type:"button",Label:"Search",ReadOnly:!1,onClick:S},c.description={Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc",Required:!0},c.agreementType={Type:"dropdown",Label:"Agreement Type:",ApiMethod:"agreementtypes/getAgreementTypeByStatus",ValueProp:"Id",TextProp:"AgreementTypeName",ModelValue:"AgreementTypeId",Required:!0,Filter:c.filterStatus},c.contactName={Type:"text",Label:"Contact Name:",MaxLength:"50",ModelValue:"ContactName",ReadOnly:!0},c.startDate={Type:"datepicker",Label:"Start Date:",ModelValue:"StartDate",Format:"MM/dd/yy",SubType:"date",Required:!0},c.price={Type:"decimal",Label:"Price",ModelValue:"Price"},c.term={Type:"text",Label:"Term (months):",MaxLength:"20",ModelValue:"Term",ReadOnly:!0},c.billingPeriod={Type:"text",Label:"Billing Period:",MaxLength:"20",ModelValue:"BillingPeriod",ReadOnly:!0,Required:!0},c.percentIncrease={Type:"hidden",Label:"Percent Increase:",ModelValue:"PercentIncrease"},c.endDate={Type:"datepicker",Label:"End Date:",ModelValue:"EndDate",Format:"MM/dd/yy",SubType:"date",Required:!0,ReadOnly:!0},c.note={Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"},c.status={Type:"dropdown",Label:"Status:",ApiMethod:"statuses/statusbytype",Filter:c.FilterStatus,ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",Required:!0},c.externalId={Type:"text",Label:"External Id:",ModelValue:"ExternalId",MaxLength:"50"},c.attributes=[c.ddgCustomer,c.search,c.agreementType,c.description,c.contactName,c.sla,{Type:"text",CustomDivClass:"col-sm-6 col-lg-6 visibilityNone"},{Type:"text",CustomDivClass:"col-sm-6 col-lg-6 visibilityNone"},c.startDate,c.price,c.term,c.billingPeriod,c.percentIncrease,c.endDate,c.note,c.status,{Type:"text",CustomDivClass:"col-sm-6 col-lg-6 visibilityNone"},c.externalId],t.$on("CustomerNameSearching",function(e,t){c.model.CustomerId=null,c.customer.customerId=null}),c.CustomerNameTemp="",c.focusOut=function(e){e&&e.hasOwnProperty("FocusOut")&&e.FocusOut&&"CustomerName"===e.ModelValue&&(c.CustomerNameTemp=angular.copy(c.model.CustomerName),null==c.model.CustomerId&&(c.model.CustomerName=null))},parseInt(r.id))c.sla.ReadOnly=!0;else{c.sla.ReadOnly=!1;var g=t.$watch("vm.model.Status",function(){null===c.model.Status&&(c.model.Status="Pending",g())})}if(""!=r.id?c.id=parseInt(r.id):c.idtmp=0,c.id)var I=t.$watch("vm.model.Id",function(){c.model.Id&&"Active"==c.model.Status&&(c.pmPlansButtonDisabled=!1,I())});function S(){var e="";if(c.model.CustomerId)e=angular.copy(c.model.CustomerName);else if(c.CustomerNameTemp){e=angular.copy(c.CustomerNameTemp);c.CustomerNameTemp=""}n.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectCustomer.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:c.customer,customerName:e}})}function p(t){c.siteFilter=l.filter("and"),c.agreementSiteFilter.eq("AgreementId",c.id),e.getItems("agreementsites",c.agreementSiteFilter).then(function(e){c.items=e.data.Data;for(var a=0;a<c.agreementsData.ListSites.length;a++)c.agreementsData.ListSites.splice(a);for(a=0;a<c.items.length;a++)c.agreementsData.ListSites.push(c.items[a].SiteId);n.showModal({templateUrl:"Templates/Agreements/agreementSiteEdit.html",controller:"AgreementAddSiteController",controllerAs:"vm",inputs:{modalTitle:"Agreement site edit",agreementId:t.Id,customerId:t.CustomerId,agreementsData:c.agreementsData,apiMethod:"agreementsites"}}).then(function(e){e.close.then(function(){c.agreementSiteFilter.Reload++,c.reloadTable=!1,o(function(){c.reloadTable=!0,b()})})})})}function h(t){c.siteFilter=l.filter("and"),c.siteFilter.eq("CustomerId",t.CustomerId),c.serItemFilter=l.filter("and"),c.serItemFilter.eq("AgreementId",t.Id),e.getItems("agreementsites",c.serItemFilter).then(function(a){c.items=a.data.Data;for(var s=0;s<c.agreementsData.ListSites.length;s++)c.agreementsData.ListSites.splice(s);for(s=0;s<c.items.length;s++)c.agreementsData.ListSites.push(c.items[s].SiteId);c.agreementsData.ListSites;e.getItems("agreementserviceableitems",c.serItemFilter).then(function(e){c.items=e.data.Data;for(var a=0;a<c.agreementsData.ListServiceableItems.length;a++)c.agreementsData.ListServiceableItems.splice(a);for(a=0;a<c.items.length;a++)c.agreementsData.ListServiceableItems.push(c.items[a].ServiceableItemId);n.showModal({templateUrl:"Templates/Agreements/agreementServiceableItemEdit.html",controller:"AgreementAddServiceableItemController",controllerAs:"vm",inputs:{modalTitle:"Agreement Serviceable Item edit",agreementId:t.Id,customerId:t.CustomerId,agreementsData:c.agreementsData,apiMethod:"agreementserviceableitems"}}).then(function(e){e.close.then(function(){c.siteNumFilter.Reload++,c.reloadTable=!1,o(function(){c.reloadTable=!0,b()})})})})})}function f(){c.model.CustomerId;c.siteFilter=l.filter("and");c.agreementSiteFilter.eq("AgreementId",c.id),e.getItems("agreementsites",c.agreementSiteFilter).then(function(t){c.items=t.data.Data;for(var a=0;a<c.agreementsData.ListSites.length;a++)c.agreementsData.ListSites.splice(a);for(a=0;a<c.items.length;a++)c.agreementsData.ListSites.push(c.items[a].SiteId);c.siteFilter1=l.filter("and"),c.id1=c.model.CustomerId,c.siteFilter1.eq("CustomerId",c.id1).eq("SiteList",c.agreementsData.ListSites),e.getItems("sites/getSitesForAgreement",c.siteFilter1).then(function(e){c.items1=e.data.Data;for(var t=0;t<c.items1.length;t++)c.selectAll.ListSitesIds.push(c.items1[t].Id);c.agreementsData.ListSites.length>0&&0==c.items1.length?(c.allSitesCovered=!0,c.showAddButton=!1,c.model.agreementAllSites=!0,c.showDeleteButton=!1):(c.allSitesCovered=!1,c.model.agreementAllSites=!1),0==c.items1.length||(c.showAddButton=!0,c.showDeleteButton=!0),c.numSites=c.agreementsData.ListSites.length,c.reloadTable=!0})});var t=c.model;c.siteFilter=l.filter("and"),c.siteFilter.eq("CustomerId",t.CustomerId),c.serItemFilter=l.filter("and"),c.serItemFilter.eq("AgreementId",t.Id),e.getItems("agreementsites",c.serItemFilter).then(function(t){c.items=t.data.Data;for(var a=0;a<c.agreementsData.ListSites.length;a++)c.agreementsData.ListSites.splice(a);for(a=0;a<c.items.length;a++)c.agreementsData.ListSites.push(c.items[a].SiteId);c.agreementsData.ListSites;e.getItems("agreementserviceableitems",c.serItemFilter).then(function(t){c.items=t.data.Data;for(var a=0;a<c.agreementsData.ListServiceableItems.length;a++)c.agreementsData.ListServiceableItems.splice(a);for(a=0;a<c.items.length;a++)c.agreementsData.ListServiceableItems.push(c.items[a].ServiceableItemId);c.siteFilter2=l.filter("and"),c.siteFilter2.eq("SiteList",c.agreementsData.ListSites).eq("ServiceableItemList",c.agreementsData.ListServiceableItems),e.getItems("serviceableitems/getserviceableItemForItemForAgreement",c.siteFilter2).then(function(e){c.items=e.data.Data,c.agreementsData.ListServiceableItems.length>0&&0==c.items.length?(c.allSICovered=!0,c.model.agreementAllSI=!0,c.showSIAddButton=!1,c.showSIDeleteButton=!1):(c.allSICovered=!1,c.model.agreementAllSI=!1,c.showSIAddButton=!0,c.showSIDeleteButton=!0)})})})}function b(){parseInt(r.id)&&(c.siteNumFilter.eq("AgreementId",parseInt(r.id)),e.getItems("agreementsites",c.siteNumFilter).then(function(e){c.items=e.data.Data,c.numSites=c.items.length}),e.getItems("agreementserviceableitems",c.siteNumFilter).then(function(e){c.items=e.data.Data,c.numServItem=c.items.length})),o(function(){f()})}t.$watch("vm.customer.customerId",function(){null!=c.customer.customerId&&c.customer.customerId>0&&(c.model.CustomerId=c.customer.customerId,c.model.CustomerName=c.customer.customerName)}),t.$watch("vm.model.AgreementTypeId",function(){null!=c.model.AgreementTypeId&&(c.filterStatus.eq("Status","Active").eq("Id",c.model.AgreementTypeId),e.getItem("agreementtypes",c.model.AgreementTypeId).then(function(){if(c.agreementType=e.state.item,c.model.SLAHours=c.agreementType.SLAHours,c.model.BillingPeriod=c.agreementType.BillingPeriod,c.model.PercentIncrease=c.agreementType.PercentIncrease,""==r.id&&(c.model.Desc=c.agreementType.AgreementTypeName),""==r.id&&(c.model.Price=c.agreementType.Price),c.model.Term=c.agreementType.Term,c.model.StartDate){var t=new Date(c.model.StartDate);t.setHours(23),t.setMinutes(59),c.model.Term&&t.setMonth(t.getMonth()+c.model.Term),c.model.EndDate=t}}),parseInt(r.id)&&(c.siteNumFilter.eq("AgreementId",parseInt(r.id)),e.getItems("agreementsites",c.siteNumFilter).then(function(e){c.items=e.data.Data,c.numSites=c.items.length}),e.getItems("agreementserviceableitems",c.siteNumFilter).then(function(e){c.items=e.data.Data,c.numServItem=c.items.length,c.siteNumFilter.Reload++})))}),t.$watch("vm.model.CustomerId",function(){void 0!=c.model.CustomerId&&e.getItem("customers",c.model.CustomerId).then(function(){c.customer=e.state.item,c.model.ContactName=c.customer.ContactFirstName?c.customer.ContactFirstName+" ":""+c.customer.ContactLastName?c.customer.ContactLastName:"",c.model.ContactId=c.customer.ContactId,c.model.CustomerName=c.customer.CustomerName,f()})}),c.id&&(c.agreementSiteFilter.eq("AgreementId",c.id),c.agreementFilter.eq("AgreementId",c.id)),c.add=function(e){1==e?p(c.model):2==e&&h(c.model)},c.attributesSite=[{Name:"Site",ValueName:"SiteName",Edit:!0,Sortable:!0}],c.attributesSerItems=[{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!0,Sortable:!0}],c.addAllSites=function(a){a=c.model;var s=document.getElementById("allSitesCB");null!=s&&s.checked?bootbox.confirm("Are you sure you want to add all Sites?",function(s){if(!s)return c.model.agreementAllSites=!1,void t.$apply();c.siteFilter=l.filter("and");c.agreementSiteFilter.eq("AgreementId",c.id),e.getItems("agreementsites",c.agreementSiteFilter).then(function(s){c.items=s.data.Data;for(var r=0;r<c.agreementsData.ListSites.length;r++)c.agreementsData.ListSites.splice(r);for(r=0;r<c.items.length;r++)c.agreementsData.ListSites.push(c.items[r].SiteId);c.siteFilter1=l.filter("and"),c.id1=a.CustomerId,c.siteFilter1.eq("CustomerId",c.id1).eq("SiteList",c.agreementsData.ListSites),e.getItems("sites/getSitesForAgreement",c.siteFilter1).then(function(a){if(c.items1=a.data.Data,c.selectAll.ListSitesIds=[],0==c.items1.length)i.warning("There are no sites for this customer."),o(function(){c.model.agreementAllSites=!1,c.showAddButton=!0,c.reloadTable=!0,b(),t.$apply()});else{for(var s=0;s<c.agreementsData.ListSites.length;s++)c.agreementsData.ListSites.splice(s);for(s=0;s<c.items1.length;s++)c.selectAll.ListSitesIds.push(c.items1[s].Id),c.selectAll.SiteNames.push(c.items1[s].SiteName);c.selectAll.AgreementId=c.id,c.selectAll.Latitude=1.3333,c.selectAll.Longitude=-113.4567,e.create("agreementsites",c.selectAll).then(function(e){c.agreementSiteFilter.Reload++,c.reloadTable=!1,o(function(){c.reloadTable=!0,b()})})}}),c.allSitesCovered=!0,c.model.agreementAllSites=!0,c.showAddButton=!1,c.showDeleteButton=!1})}):bootbox.confirm("Are you sure you want to remove all sites? All associated Serviceable Items will also be deleted from this agreement.",function(a){if(!a)return c.model.agreementAllSites=!0,void t.$apply();c.agreementSiteFilter.eq("AgreementId",c.id),e.getItems("agreementsites",c.agreementSiteFilter).then(function(a){c.items=a.data.Data,c.items.forEach(function(t){e.remove("agreementsites",t.Id)});for(var s=0;s<c.agreementsData.ListSites.length;s++)c.agreementsData.ListSites.splice(s);for(s=0;s<c.selectAll.ListSitesIds.length;s++)c.selectAll.ListSitesIds.splice(s);for(s=0;s<c.selectAllSI.ListServiceableItemIds.length;s++)c.selectAllSI.ListServiceableItemIds.splice(s);for(s=0;s<c.agreementsData.ListServiceableItems.length;s++)c.agreementsData.ListServiceableItems.splice(s);c.model.agreementAllSites=!1,c.AgreementSitesSI=!0,c.agreementSiteFilter.Reload++,c.numSites,c.numServItem,o(function(){c.reloadTable=!0,b(),t.$apply()},500)})})},c.addAllSI=function(a){a=c.model;var s=document.getElementById("allSICB");null!=s&&s.checked?bootbox.confirm("Are you sure you want to add all Serviceable Items?",function(s){if(!s)return c.model.agreementAllSI=!1,void t.$apply();for(var r=0;r<c.agreementsData.ListServiceableItems.length;r++)c.agreementsData.ListServiceableItems.splice(r);for(r=0;r<c.selectAllSI.ListServiceableItemIds.length;r++)c.selectAllSI.ListServiceableItemIds.splice(r);c.siteFilter=l.filter("and"),c.siteFilter.eq("CustomerId",a.CustomerId),c.serItemFilter=l.filter("and");c.serItemFilter.eq("AgreementId",a.Id),e.getItems("agreementsites",c.serItemFilter).then(function(a){if(c.items=a.data.Data,0==c.items.length)return i.warning({message:"You must first select a site before adding Serviceable Items."}),void(c.model.agreementAllSI=!1);for(var s=0;s<c.agreementsData.ListSites.length;s++)c.agreementsData.ListSites.splice(s);for(s=0;s<c.items.length;s++)c.agreementsData.ListSites.push(c.items[s].SiteId);e.getItems("agreementserviceableitems",c.serItemFilter).then(function(a){c.items2=a.data.Data;for(var s=0;s<c.agreementsData.ListServiceableItems.length;s++)c.agreementsData.ListServiceableItems.splice(s);for(s=0;s<c.items2.length;s++)c.agreementsData.ListServiceableItems.push(c.items2[s].ServiceableItemId);c.siteFilter2=l.filter("and"),c.siteFilter2.eq("SiteList",c.agreementsData.ListSites).eq("ServiceableItemList",c.agreementsData.ListServiceableItems),e.getItems("serviceableitems/getserviceableItemForItemForAgreement",c.siteFilter2).then(function(a){if(c.items3=a.data.Data,0==c.items3.length)return i.warning("There are no Serviceable Items for this Site."),void o(function(){c.model.agreementAllSI=!1,c.showAddButton=!0,c.reloadTable=!0,b(),t.$apply()});for(var s=0;s<c.agreementsData.ListServiceableItems.length;s++)c.agreementsData.ListServiceableItems.splice(s);for(s=0;s<c.items3.length;s++)c.selectAllSI.ListServiceableItemIds.push(c.items3[s].Id);c.selectAllSI.AgreementId=c.id,c.selectAllSI.Latitude=1.3333,c.selectAllSI.Longitude=-113.4567,e.create("agreementserviceableitems",c.selectAllSI).then(function(e){c.agreementSiteFilter.Reload++,c.reloadTable=!1,o(function(){c.reloadTable=!0,b(),c.allSICovered=!0,c.model.agreementAllSI=!0,c.showSIAddButton=!1,c.showSIDeleteButton=!1},500)})})})})}):bootbox.confirm("Are you sure you want to remove all Serviceable Items?",function(s){if(!s)return c.model.agreementAllSI=!0,void t.$apply();c.siteFilter=l.filter("and"),c.siteFilter.eq("CustomerId",a.CustomerId),c.serItemFilter=l.filter("and");c.serItemFilter.eq("AgreementId",a.Id),e.getItems("agreementsites",c.serItemFilter).then(function(a){c.items=a.data.Data;for(var s=0;s<c.agreementsData.ListSites.length;s++)c.agreementsData.ListSites.splice(s);for(s=0;s<c.items.length;s++)c.agreementsData.ListSites.push(c.items[s].SiteId);e.getItems("agreementserviceableitems",c.serItemFilter).then(function(a){c.items=a.data.Data,c.items.forEach(function(t){e.remove("agreementserviceableitems",t.Id)});for(var s=0;s<c.agreementsData.ListServiceableItems.length;s++)c.agreementsData.ListServiceableItems.splice(s);for(s=0;s<c.selectAllSI.ListServiceableItemIds.length;s++)c.selectAllSI.ListServiceableItemIds.splice(s);c.model.agreementAllSI=!1,c.reloadTable=!1,c.AgreementSitesSI=!0,o(function(){c.reloadTable=!0,b(),t.$apply()},500)})})})},c.loadingIndicator=!1;var v={};var A={};t.$watch("vm.model.StartDate",function(e){if(e){var t=new Date(c.model.StartDate);t.setHours(23),t.setMinutes(59),c.model.Term&&t.setMonth(t.getMonth()+c.model.Term),c.model.EndDate=t}}),c.reloadTasks=!0,c.attributesTask=[{Name:"Standard Task",ValueName:"TaskCode",Edit:!1,Sortable:!0},{Name:"Task Name",ValueName:"TaskName",Edit:!0,Sortable:!0},{Name:"Description",ValueName:"Description",Edit:!1,Sortable:!0},{Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!1,Sortable:!0}],c.taskAttributeStandardTask={Type:"dropdown",Label:"Standard Task:",Required:!1,ApiMethod:"standardTask/ddlist",ValueProp:"Id",TextProp:"Name",ModelValue:"StandardTaskId",ConvertToInt:"true",ReadOnly:!1},c.taskAttributeServiceableItem={Type:"dropdown",Label:"Serviceable Item:",Silent:!0,ApiMethod:"agreementserviceableitems",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"AgreementServiceableItemId",Filter:c.agreementFilter,ReadOnly:!1},c.newTaskattributes=[c.taskAttributeStandardTask,{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"Task Name:",MaxLength:"50",ModelValue:"TaskName",Required:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Description",Required:!0},{Type:"textarea",Label:"Note:",Required:!1,MaxLength:"500",ModelValue:"Note"},c.taskAttributeServiceableItem],c.editTaskattributes=[{Type:"text",Label:"Standard Task:",MaxLength:"10",ModelValue:"TaskCode",Required:!1,ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Task Name:",MaxLength:"50",ModelValue:"TaskName",Required:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Description"},{Type:"textarea",Label:"Note:",Required:!1,MaxLength:"500",ModelValue:"Note"},c.taskAttributeServiceableItem],c.editTask=function(a){c.taskModel={},a?c.taskattributes=c.editTaskattributes:(c.taskModel.AgreementId=c.id,c.taskattributes=c.newTaskattributes,t.$watch("vm.taskModel.StandardTaskId",function(){c.taskModel.StandardTaskId?e.getItem("standardTask",c.taskModel.StandardTaskId).then(function(e){var t=e.data;o(function(){c.taskModel.TaskName=t.Name,c.taskModel.Description=t.Description,c.taskModel.TaskCode=t.TaskCode,c.taskModel.Note=t.Note})}):o(function(){c.taskModel.TaskName=null,c.taskModel.Description=null,c.taskModel.TaskCode=null,c.taskModel.Note=null})})),n.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Task",id:a,model:c.taskModel,attributes:c.taskattributes,apiMethod:"agreementtasks"}}).then(function(e){e.close.then(function(){c.reloadTasks=!1,o(function(){c.reloadTasks=!0})})})}}angular.module("FieldConnectApp").controller("AgreementsEditController",e),e.$inject=["restService","$scope","$location","$state","$stateParams","Notification","qsService","stateTransitionService","ModalService","$timeout","timezoneService","$window"]}();;!function(){"use strict";function e(e,t,a,o,l,r){var d=this;d.edit=!1,d.customers=[],d.model={},d.$scope=e,d.close=function(){d.modalClass=!1,e.close(null,50)},d.customerId=0,d.customerName="",d.creditHold=!1,d.search=function(){""!=d.customerFilter.search&&d.autoFilterCustomer.like("CustomerName","%"+d.customerFilter.search+"%")},d.autoFilterCustomer=o.filter("and"),d.autoFilterCustomer.eq("Status","Active"),d.FilterStatusCustomer={filterId:"Customer"},e.$watch("vm.model.IsDifferentBillingInfo",function(){d.model.IsDifferentBillingInfo?(d.attributesEdit[20].Type="line",d.attributesEdit[21].Type="text",d.attributesEdit[22].Type="text",d.attributesEdit[23].Type="text",d.attributesEdit[24].Type="text",d.attributesEdit[25].Type="text",d.attributesEdit[26].Type="text",d.attributesEdit[27].Type="text",d.attributesEdit[28].Type="dropdown",d.attributesEdit[29].Type="text",d.attributesEdit[30].Type="dropdown",d.attributesEdit[31].Type="text",d.attributesEdit[32].Type="text"):(d.attributesEdit[20].Type="empty",d.attributesEdit[21].Type="empty",d.attributesEdit[22].Type="empty",d.attributesEdit[23].Type="empty",d.attributesEdit[24].Type="empty",d.attributesEdit[25].Type="empty",d.attributesEdit[26].Type="empty",d.attributesEdit[27].Type="empty",d.attributesEdit[28].Type="empty",d.attributesEdit[29].Type="empty",d.attributesEdit[30].Type="empty",d.attributesEdit[31].Type="empty",d.attributesEdit[32].Type="empty")}),d.attributes=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0},{Name:"Address",ValueName:"ContactAddress",Sortable:!0},{Name:"Contact",ValueName:"ContactName",Sortable:!0},{Name:"Phone",ValueName:"Phone",Sortable:!0},{Name:"Email",ValueName:"Email",Sortable:!0},{Name:"Bill To",ValueName:"BillContactName",Sortable:!0},{Name:"Bill Address",ValueName:"BillAddress",Sortable:!0}],d.attributesEdit=[{Type:"text",Label:"Customer Code:",MaxLength:"50",ModelValue:"CustomerCode",Required:!0,Autofocus:"true"},{Type:"dropdown",Label:"Service Area:",ApiMethod:"serviceAreas",ValueProp:"ServiceAreaName",TextProp:"ServiceAreaName",ModelValue:"ServiceArea",Required:!0},{Type:"dropdown",Label:"Office:",Required:!0,ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true"},{Type:"text",Label:"Customer Name:",MaxLength:"50",ModelValue:"CustomerName",Required:!0},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"Contact Title:",MaxLength:"50",ModelValue:"ContactTitle",Requried:!0},{Type:"text",Label:"Address:",MaxLength:"100",ModelValue:"Address1"},{Type:"text",Label:"First Name:",MaxLength:"50",ModelValue:"ContactFirstName"},{Type:"text",Label:"",MaxLength:"100",ModelValue:"Address2"},{Type:"text",Label:"Last Name:",MaxLength:"50",ModelValue:"ContactLastName"},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"City"},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"ContactPhone"},{Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"StateCode"},{Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"ContactFax"},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country"},{Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"ContactCell"},{Type:"text",Label:"Postal Code",MaxLength:"20",ModelValue:"PostalCode"},{Type:"email",Label:"Contact Email:",MaxLength:"50",ModelValue:"ContactEmail"},{Type:"text",Label:"Web site:",MaxLength:"50",ModelValue:"Website"},{Type:"line",CustomClass:"col-sm-12"},{Type:"checkbox",Label:"Is different billing address?",ModelValue:"IsDifferentBillingInfo"},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"First Name:",MaxLength:"50",ModelValue:"BillContactFirstName",Required:!0},{Type:"text",Label:"Address:",MaxLength:"100",ModelValue:"BillAddress1",Required:!0},{Type:"text",Label:"Last Name:",MaxLength:"50",ModelValue:"BillContactLastName",Required:!0},{Type:"text",Label:"",MaxLength:"100",ModelValue:"BillAddress2"},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"BillContactPhone",Required:!0},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"BillCity",Required:!0},{Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"BillContactCell"},{Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"BillStateCode",Required:!0},{Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"BillContactFax"},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"BillCountry",Required:!0},{Type:"email",Label:"Email:",MaxLength:"50",ModelValue:"BillContactEmail",Required:!0},{Type:"text",Label:"Postal Code",MaxLength:"20",ModelValue:"BillPostalCode",Required:!0},{Type:"line",CustomClass:"col-sm-12"},{Type:"dropdown",Label:"Payment Term:",ApiMethod:"paymentTerms",ValueProp:"Id",TextProp:"PaymentTermName",ModelValue:"PaymentTermId",ConvertToInt:"true"},{Type:"dropdown",Label:"Tax Rate:",ApiMethod:"taxrates",ValueProp:"Id",TextProp:"TaxName",ModelValue:"TaxRateId",ConvertToInt:"true"},{Type:"checkbox",Label:"Credit Hold:",ModelValue:"CreditHold"},{Type:"datepicker",Label:"Hold Date:",ModelValue:"HoldDate",Format:"MM/dd/yy",SubType:"date"},{Type:"textarea",Label:"Hold Note",MaxLength:"500",ModelValue:"HoldNote"},{Type:"text",Label:"External ID",MaxLength:"50",ModelValue:"ExternalId"},{Type:"dropdown",Label:"Currency Code:",ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode"},{Type:"dropdown",Label:"Status:",ApiMethod:"statuses/statusbytype",Filter:d.FilterStatusCustomer,ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",Required:!0},{Type:"textarea",Label:"Note",MaxLength:"500",ModelValue:"Note"}],e.$watch("vm.model.OfficeId",function(){d.model.OfficeId?l.getItem("offices/"+d.model.OfficeId).then(function(){d.office=l.state.item,d.model.Country=d.office.Country,d.model.CurrencyCode=d.office.CurrencyCode}):(d.model.Country=null,d.model.CurrencyCode=null)}),e.$watch("vm.edit",function(){var e={};l.getItem("settings/status?type=DefaultOffice").then(function(){(e=l.state.item).Value&&r(function(){d.model.OfficeId=parseInt(e.Value)})})}),e.$watch("vm.customerId",function(){if(d.customerId>0){for(var t=0;t<d.customers.length;t++)if(d.customers[t].Id==d.customerId){d.customerName=d.customers[t].CustomerName,d.creditHold=d.customers[t].CreditHold;break}d.creditHold?bootbox.confirm("The customer "+d.customerName+" is on credit hold!",function(t){t?(e.customer.customerId=d.customerId,e.customer.customerName=d.customerName,e.customer.currencyCode=d.currencyCode,e.customer.paymentTermId=d.paymentTermId,e.$apply(),d.close()):d.customerId=null}):(e.customer.customerId=d.customerId,e.customer.customerName=d.customerName,e.customer.currencyCode=d.currencyCode,e.customer.paymentTermId=d.paymentTermId,d.close())}})}angular.module("FieldConnectApp").controller("SelectCustomerController",e),e.$inject=["$scope","$location","$state","qsService","restService","$timeout"]}();;!function(){"use strict";function e(e,o,a,t,r,s,n,c){var u=this;u.$state=o;u.formData={NewPassword:"",ConfirmNewPassword:"",Token:""},u.submit=function(){if(u.formData.NewPassword!==u.formData.ConfirmNewPassword)return t.error({message:"New password and confirm password values don’t match! Please try again."}),console.log(result.data.Details[i].DeveloperMessage),r.reject();e.update("forgotPassword",u.formData).then(function(){return t.success({message:"Your password has been successfully changed."}),c(function(){l()},2e3),r.reject()})},u.goToLogIn=l,u.currentYear=new Date;var f=s.url().split("/");function l(){s.path("/login"),c(function(){n.location.reload()})}u.formData.Token=f[2],u.status="",e.getItem("forgotPassword/checkucsertoken?token="+u.formData.Token).then(function(e){u.status=e.data.replace(/"/g,"")}),c(function(){u.formData.UserName="",u.formData.NewPassword="",u.formData.ConfirmNewPassword=""},500)}angular.module("FieldConnectApp").controller("ChangePasswordController",e),e.$inject=["restService","$state","$stateParams","Notification","$q","$location","$window","$timeout"]}();;!function(){"use strict";function e(e,t,a,s,r,o,n,i,u,l,d,m,c,p){var b=this;b.$state=a,b.$window=o,b.userDataModel={},b.subscriptionModel={},b.params=n.$$search,b.message=f;var C="",h="",M=n.url().split("/");b.token=M[2],b.submitUserData=function(){b.userDataModel.NewCompanyId=b.newCompanyId,b.userDataModel.Status="Active",b.userDataModel.Password!==b.userDataModel.ConfirmPassword?r.error({message:"Passwords don't match!"}):s.create("users/userfornewcompany",b.userDataModel).then(function(e){200===e.status&&(b.subscriptionModel.UserId=e.data,b.subscriptionModel.Token=void 0,s.update("subscriptions/newCompany",b.subscriptionModel).then(function(e){}),r.success({message:"User has been successfully created."}),b.formData.username=b.userDataModel.UserName,b.formData.password=b.userDataModel.Password,c.login(b.formData).then(function(e){p.setUserAuthData(!0,!0).then(function(){f(),n.path("master-tables/companyInfos/").search({param:"isNewCompany"}),i(function(){o.location.reload()})},function(){c.logOut(!0)})}))})},b.formData={username:"",password:""},b.tokenFilter=l.filter("and"),b.tokenFilter.eq("Token",b.token),s.getItems("subscriptions",b.tokenFilter).then(function(e){b.items=e.data.Data,b.items.length>0&&(b.statusFilter={filterId:"User"},b.subscriptionModel=b.items[0],b.newCompanyName=b.items[0].CompanyName,b.newCompanyId=b.items[0].CompanyId,b.companyFilter=l.filter("and"),b.companyFilter.eq("CompanyId",b.items[0].CompanyId),b.attributes=[{Type:"text",Label:"User Name:",Required:!0,MaxLength:50,ModelValue:"UserName",TabIndex:1},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"password",Label:"Password:",Required:!0,ModelValue:"Password",TabIndex:2},{Type:"password",Label:"Confirm Password:",Required:!0,ModelValue:"ConfirmPassword",TabIndex:3},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"First Name:",Required:!0,MaxLength:50,ModelValue:"FirstName",Autofocus:!0,TabIndex:4},{Type:"text",Label:"Phone:",Required:!1,MaxLength:20,ModelValue:"Phone",TabIndex:7},{Type:"text",Label:"Last Name:",Required:!0,MaxLength:50,ModelValue:"LastName",TabIndex:5},{Type:"dropdown",Label:"Time Zone:",Required:!0,ModelValue:"TimeZoneId",ValueProp:"Id",TextProp:"TimeZoneName",ApiMethod:"timezones",TabIndex:8},{Type:"email",Label:"Email:",Required:!0,MaxLength:50,ModelValue:"Email",TabIndex:6},{Type:"text",Label:"Cell:",Required:!1,MaxLength:20,ModelValue:"Cell",CustomInputClass:"hidden",CustomLabelClass:"hidden"},{Type:"dropdown",Label:"Status:",Required:!0,ModelValue:"Status",ValueProp:"StatusName",TextProp:"StatusName",ApiMethod:"statuses/statusbytype",Filter:b.statusFilter,CurrentList:[],CustomInputClass:"hidden",CustomLabelClass:"hidden"},{Type:"line",CustomClass:"col-sm-12"},{Type:"multiselect",ApiMethod:"roles/withoutfilterbycompany",ValueProp:"Id",TextProp:"RoleName",ModelValue:"RoleIds",Filter:b.companyFilter,CurrentList:[],Required:!0,CustomInputClass:"hidden",CustomLabelClass:"hidden"}]),C=b.items[0].Email,h=b.items[0].Email});var y=e.$watch("vm.userDataModel.Email",function(){void 0!==b.userDataModel.Email&&(b.userDataModel.Email=C,b.userDataModel.UserName=h,null!=b.userDataModel.Email&&y())});function f(){bootbox.alert("Your Company has been successfully created. Now, let's proceed with creating a user account.",function(){})}e.$watch("vm.attributes[13].CurrentList",function(){if(b.attributes&&b.attributes[13].CurrentList.length>0)for(var e=0;e<b.attributes[13].CurrentList.length;e++)"TransAdmin"==b.attributes[13].CurrentList[e].RoleName&&b.userDataModel.RoleIds.push(b.attributes[13].CurrentList[e].Id)},!0),e.$watch("vm.attributes[11].CurrentList",function(){if(b.attributes&&b.attributes[11].CurrentList.length>0)for(var e=0;e<b.attributes[11].CurrentList.length;e++)"Active"==b.attributes[11].CurrentList[e].StatusName&&(b.userDataModel.Status=b.attributes[11].CurrentList[e].StatusName)},!0)}angular.module("FieldConnectApp").controller("NewSubscribedUserController",e),e.$inject=["$scope","$stateParams","$state","restService","Notification","$window","$location","$timeout","timezoneService","qsService","$http","ngAuthSettings","authService","currentUserService"]}();;!function(){"use strict";function e(e,a,t,o,s,r,l,n,u,d,i){var c=this;c.$state=t,c.id=a.id,c.$window=r,c.userDataModel={},c.submitUserData=function(){c.userDataModel.Password!==c.userDataModel.ConfirmPassword?s.error({message:"Passwords don't match!"}):o.create("users/createuserForNewCompany",c.userDataModel).then(function(e){if(e&&200===e.status){s.success({message:"Welcome to FieldConnect. Congratulations you are now a FieldConnect subcontractor."});var a={username:c.userDataModel.UserName,password:c.userDataModel.Password};i.login(a).then(function(e){i.dpsLogin(e.data.access_token),d.setUserAuthData().then(function(){l.path("home"),n(function(){r.location.reload()})})},function(e){p(e)})}else p(e)},function(e){p(e)})};var m=l.url().split("/");function p(e){if(e.data.Details)for(var a=0;a<e.data.Details.length;a++)s.error({message:e.data.Details[a].Message});else s.error({message:"Authentication error. Please, try again later."});n(function(){i.logOut(!0)},2e3)}c.statusFilter={filterId:"User"},c.attributes=[{Type:"text",Label:"User Name:",Required:!0,MaxLength:50,ModelValue:"UserName",Autofocus:!0,TabIndex:1},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"password",Label:"Password:",Required:!0,ModelValue:"Password",TabIndex:2},{Type:"password",Label:"Confirm Password:",Required:!0,ModelValue:"ConfirmPassword",TabIndex:3},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"First Name:",Required:!0,MaxLength:50,ModelValue:"FirstName",TabIndex:4},{Type:"text",Label:"Cell:",Required:!1,MaxLength:20,ModelValue:"Cell",TabIndex:8},{Type:"text",Label:"Last Name:",Required:!0,MaxLength:50,ModelValue:"LastName",TabIndex:5},{Type:"text",Label:"Phone:",Required:!1,MaxLength:20,ModelValue:"Phone",TabIndex:9},{Type:"email",Label:"Email:",Required:!0,MaxLength:50,ModelValue:"Email",TabIndex:6},{Type:"dropdown",Label:"Status:",Required:!0,ModelValue:"Status",ValueProp:"StatusName",TextProp:"StatusName",ApiMethod:"statuses/statusbytype",Filter:c.statusFilter,TabIndex:10},{Type:"dropdown",Label:"Time Zone:",Required:!0,ModelValue:"TimeZoneId",ValueProp:"Id",TextProp:"TimeZoneName",ApiMethod:"timezones",TabIndex:7}],e.$watch("vm.userDataModel.UserName",function(){c.userDataModel.CompanyCollerId=parseInt(m[2]),c.userDataModel.CalledEmail=m[3],c.userDataModel.Token=m[4],c.userDataModel.NewCompanyId=parseInt(m[5])}),e.$watch("vm.userDataModel.Status",function(){void 0==c.userDataModel.Status&&(c.userDataModel.Status="Active")})}angular.module("FieldConnectApp").controller("NewUserController",e),e.$inject=["$scope","$stateParams","$state","restService","Notification","$window","$location","$timeout","timezoneService","currentUserService","authService"]}();;!function(){"use strict";function o(o,e,n,t,r,s,a,i,c,l,g,u,d){var f=this;f.goToLogIn=function(){e.path("/login"),a(function(){s.location.reload()})},f.forgotPassword=function(){f.inProgress=!0,o.getItem("forgotPassword?username="+encodeURIComponent(f.username)).then(function(o){o.data=o.data.substring(1,o.data.length-1),r.success({message:o.data}),console.log(o.data),f.inProgress=!1},function(o){f.inProgress=!1})},f.inProgress=!1;var h=new Date;f.year=h.getFullYear();e.url().split("/");d.$on("$locationChangeSuccess",function(){f.searchText=e.url(),-1!=f.searchText.indexOf("/forgotpassword")&&-1==f.searchText.indexOf("/login")||s.location.reload()})}angular.module("FieldConnectApp").controller("ForgotPasswordController",o),o.$inject=["restService","$location","$http","ngAuthSettings","Notification","$window","$timeout","$q","$geolocation","qsService","currentCompanyService","currentUserService","$scope"]}();;!function(){"use strict";function a(a,e,n,t,o,r,s,i,l,c,u,d,m,p){var g=this;if(g.formData={username:"",password:""},g.currentYear=new Date,g.isLoading=!1,g.params=n.$$search,g.expireSubscription=!1,g.inProgress=!1,g.transaction=function(){n.path("subscriptionType"),i(function(){s.location.reload()})},g.submit=v,g.joinSubcontractor=function(){e.getItem("subcontractorCompanies/token?token="+g.params.token).then(function(a){var t=a.data;null!=t?e.getItems("subcontractorCompanies/checkIfExist",{email:t.Email,companyId:t.CompanyId}).then(function(a){var e=a.data;"null"!=e?(r.error({message:"You are already a subcontractor."}),n.$$search=null,n.path("/login"),i(function(){s.location.reload()},1e3)):(n.$$search=null,n.path("newsubcontractorcompany/"+t.CompanyId+"/"+t.Email+"/"+g.params.token+"/"),i(function(){s.location.reload()}))}):(r.error({message:"Invalid token."}),n.$$search=null,n.path("/login"),i(function(){s.location.reload()},1e3))})},g.forgotPassword=function(){e.getItem("api/v1.0/forgotPassword?username="+g.username).then(function(a){return a.data=a.data.substring(1,a.data.length-1),r.success({message:a.data}),console.log(a.data),l.reject()},function(a){if(a.data.Details)for(var e=0;e!=a.data.Details.length;e++)r.error({message:a.data.Details[e].Message}),console.log(a.data.Details[e].DeveloperMessage);return l.reject()})},g.saveEvent=function(t,o){return c.getCurrentPosition({}).then(function(r){a.setValue("latitude",r.coords.latitude),a.setValue("longitude",r.coords.longitude);var l={Latitude:r.coords.latitude+"",Longitude:r.coords.longitude+"",EventType:t.eventType,SessionId:t.sessionId,TableName:t.tableName,RecordId:t.recordId,Note:t.note,Date:new Date,Username:t.username};e.create("events",l),n.path(o),i(function(){s.location.reload()})},function(l){if(g.isGeolocationRequired)r.error({message:"Geolocation is Required"}),a.removeValue("latitude"),a.removeValue("longitude"),g.inProgress=!1,p.logOut(!0);else{var c={EventType:t.eventType,SessionId:t.sessionId,TableName:t.tableName,RecordId:t.recordId,Note:t.note,Date:new Date,Username:t.username};e.create("events",c),n.path(o),i(function(){s.location.reload()})}})},g.passwordForm=function(){n.path("forgotpassword"),i(function(){s.location.reload()})},g.microsoftSignIn="False",g.microsoftSubmit=function(){e.getItem("microsoft/microsoftUrl").then(function(a){a.data&&(window.location.href=a.data.url)})},null!=g.params.code?(g.microsoftSignIn="True",e.getItem("microsoft/auth?code="+g.params.code).then(function(a){null!=a.data?(r.success({message:"Please wait, logging in..."}),n.search("code",null),n.search("session_state",null),g.formData.password=a.data.Password,g.formData.username=a.data.UserName,v()):(g.microsoftSignIn="False",r.error({message:"Microsoft authentication failed"}))})):void 0!=g.params.error&&void 0!=g.params.error_description&&r.error({message:"Microsoft log in failed. "+g.params.error+" - "+g.params.error_description}),a.removeValue("tmpData"),null!=g.params.isInvitation&&"False"==g.params.isActive&&e.getItem("subcontractorList/joinToken?token="+g.params.token).then(function(a){var t=a.data,o={Id:t.Id,Email:t.Email,CompanyId:t.CompanyId};e.update("subcontractorList/joinDeclined",o).then(function(){n.$$search=null,r.success({message:"Invitation has been declined"})})}),null!=g.params.isPayment&&"true"==g.params.isPayment&&r.success("Your login credentials are sent via email."),g.logo=null,g.companyToken=g.params.isInvitation?null:g.params.token,null!=g.params.isCustomer&&"True"==g.params.isCustomer&&e.getItem("companyinfos/companylogo?token="+g.params.token).then(function(e){g.logo=JSON.parse(e.data),a.removeAll()}),g.params.isRemote&&g.params.key){r.warning("Validating key, please wait..."),g.isLoading=!0;var f={Key:g.params.key};e.create("key/validate",f).then(function(e){g.isLoading=!1,e.data.Key?(a.setValue("remoteKey",g.params.key,!0),n.$$search=null,n.path(`${e.data.Redirect}/${e.data.RecordId}`),i(function(){s.location.reload()})):(r.error("Key has been used or is expired!"),n.url("/login"),i(function(){window.location.reload()},1e4))})}function v(){if(g.inProgress=!0,g.isLoading=!0,""==g.formData.password||""==g.formData.username)return r.error({message:"The user name or password is incorrect."}),g.inProgress=!1,g.isLoading=!1,void(g.microsoftSignIn="False");var t=angular.copy(g.formData);g.companyToken&&(t.username=t.username+" !!! "+g.companyToken),p.login(t).then(function(t){p.dpsLogin(t.data.access_token),m.setUserAuthData().then(function(){var t=a.getValue("authorizationData"),o=t.userRoles.split(",");ga("set","dimension1",o[0]);var l=!1,c=!1,u=!1;1==o.length&&("TransAdmin"==o[0]?l=!0:"SubAdmin"==o[0]?c=!0:"SubContractor"==o[0]&&(u=!0));for(var p=[],f=0;f<t.userRoleTypes.length;f++)p.push(t.userRoleTypes[f].RoleTypeName);p.indexOf("Technician");var v={eventType:"Login",note:"User "+t.fullName+" logged in",username:t.userName};m.getUserSetting("SetDefaultStartPage").then(function(a){var m=a,p="";null!=g.params.isInvitation?(n.$$search=null,null!=g.params.token&&e.getItem("subcontractorCompanies/token?token="+g.params.token).then(function(a){var n=e.state.item;null!=n?("True"==g.params.isInvitation?p="companyInviteInfo/"+n.CompanyId+"/"+n.SubcontractorId+"/"+g.params.isInvitation+"/"+g.params.isActive:"False"==g.params.isInvitation&&(p="companyJoinInfo/"+n.CompanyId+"/"+n.Email+"/"+g.params.isInvitation),g.saveEvent(v,p)):(r.error({message:"Invalid token."}),i(function(){s.location.reload()}))})):null!=g.params.isBid?(n.$$search=null,"True"==g.params.isBid&&(null!=g.params.BidToken?e.getItem("subcontractorBids/bidToken?bidToken="+g.params.BidToken).then(function(a){var n=e.state.item;null!=n?(p="subcontractorAcceptWork/"+n.SubContractorId+"/"+n.WoId,g.saveEvent(v,p)):(r.error({message:"Invalid token."}),i(function(){s.location.reload()}))}):(r.error({message:"Invalid token."}),i(function(){s.location.reload()})))):null!=g.params.isAwarded?(n.$$search=null,"True"==g.params.isAwarded&&(null!=g.params.id?(p="workOrderDetailsSub/"+g.params.id+"/",g.saveEvent(v,p)):(r.error({message:"Invalid id."}),i(function(){s.location.reload()})))):null!=g.params.isMainCompany?(n.$$search=null,"True"==g.params.isMainCompany&&(null!=g.params.id?e.getItem("wodetails/"+g.params.id).then(function(a){var n=null!=e.state.item.SubContractorId?"Awarded":"Accepted";p="subcontractorAwardWork/"+g.params.id+n,g.saveEvent(v,p)}):(r.error({message:"Invalid id."}),i(function(){s.location.reload()})))):null!=g.params.isAssignment?(n.$$search=null,e.getItem("woassignments/"+g.params.id).then(function(a){var e=a.data;e&&d.isContractorCompany(e).then(function(a){p=a?"assignmentDetails/"+e.WoId+"/"+g.params.id:"assignmentSubcontractorDetails/"+e.WoId+"/"+g.params.id,g.saveEvent(v,p)})},function(){i(function(){s.location.reload()})})):-1!=o.indexOf("Admin")&&t.companyStatus?(p="manageWorkOrders",null!==m&&(p=m),g.saveEvent(v,p)):-1!=o.indexOf("Dispatch")&&t.companyStatus?(p="dispatchCalendar",null!==m&&(p=m),g.saveEvent(v,p)):-1!=o.indexOf("Technician")&&t.companyStatus?(p="myAssignments",null!==m&&(p=m),g.saveEvent(v,p)):-1!=o.indexOf("Apprentice")&&t.companyStatus?(p="myAssignments",null!==m&&(p=m),g.saveEvent(v,p)):-1!=o.indexOf("SubAdmin")&&t.companyStatus&&c?(p="manageWorkOrders",null!==m&&(p=m),g.saveEvent(v,p)):-1!=o.indexOf("TransAdmin")&&t.companyStatus&&l?(p="manageWorkOrders",null!==m&&(p=m),g.saveEvent(v,p)):-1!=o.indexOf("SubContractor")&&t.companyStatus&&u?(p="myAssignments",null!==m&&(p=m),g.saveEvent(v,p)):-1!=o.indexOf("Supervisor")&&t.companyStatus?(p="/",null!==m&&(p=m),g.saveEvent(v,p)):-1!=o.indexOf("Office")&&t.companyStatus?(p="/",null!==m&&(p=m),g.saveEvent(v,p)):-1!=o.indexOf("FieldConnect")?(p="/",g.saveEvent(v,p)):-1!=o.indexOf("CustAdmin")||-1!=o.indexOf("Cust")?(p="serviceStatus/",null!==m&&(p=m),n.search({}),g.saveEvent(v,p)):"isNewCompany"==g.params.param?(p="master-tables/companyInfos/",g.saveEvent(v,p)):t.companyStatus?(p="/",g.saveEvent(v,p)):(g.expireSubscription=!0,g.inProgress=!1,g.isLoading=!1,g.microsoftSignIn="False",n.path("/login"))})},function(a){if(a)for(var e=0;e<a.length;e++)a[e].data.error_description&&(r.error({message:a.data.error_description}),console.log(a.data.error_description,a[e].data)),p.logOut(!0)})},function(a){a.data.error?a.data.error_description?r.error({message:a.data.error_description}):r.error({message:"Authentication error. Please, try again later."}):r.error({message:"No connection with identity server."}),g.inProgress=!1,g.isLoading=!1,g.microsoftSignIn="False"})}Object.getOwnPropertyNames(g.params).length>0?p.isAccessTokenValid().then(function(a){a&&(null!=g.params.isInvitation?(n.$$search=null,null!=g.params.token&&e.getItem("subcontractorCompanies/token?token="+g.params.token).then(function(a){var t=e.state.item;null!=t?"True"==g.params.isInvitation&&(n.path("companyInviteInfo/"+t.CompanyId+"/"+t.SubcontractorId+"/"+g.params.isInvitation+"/"+g.params.isActive),i(function(){s.location.reload()})):(r.error({message:"Invalid token."}),i(function(){s.location.reload()}))})):null!=g.params.isBid?(n.$$search=null,"True"==g.params.isBid&&(null!=g.params.BidToken?e.getItem("subcontractorBids/bidToken?bidToken="+g.params.BidToken).then(function(a){var t=e.state.item;null!=t?(n.path("subcontractorAcceptWork/"+t.SubContractorId+"/"+t.WoId),i(function(){s.location.reload()})):(r.error({message:"Invalid token."}),i(function(){s.location.reload()}))}):(r.error({message:"Invalid token."}),i(function(){s.location.reload()})))):null!=g.params.isAwarded?(n.$$search=null,"True"==g.params.isAwarded&&(null!=g.params.id?(n.path("workOrderDetailsSub/"+g.params.id+"/"),i(function(){s.location.reload()})):(r.error({message:"Invalid id."}),i(function(){s.location.reload()})))):null!=g.params.isMainCompany?(n.$$search=null,"True"==g.params.isMainCompany&&(null!=g.params.id?e.getItem("wodetails/"+g.params.id).then(function(a){var t=e.state.item,o="";o=null!=t.SubContractorId?"Awarded":"Accepted",n.path("subcontractorAwardWork/"+g.params.id+o),i(function(){s.location.reload()})}):(r.error({message:"Invalid id."}),i(function(){s.location.reload()})))):null!=g.params.isAssignment&&(n.$$search=null,e.getItem("woassignments/"+g.params.id).then(function(a){var e=a.data;e&&d.isContractorCompany(e).then(function(a){a?n.path("assignmentDetails/"+e.WoId+"/"+g.params.id):n.path("assignmentSubcontractorDetails/"+e.WoId+"/"+g.params.id),i(function(){s.location.reload()})})},function(){n.path("/"),i(function(){s.location.reload()})})))}):a.removeAll(),g.isGeolocationRequired=!1}angular.module("FieldConnectApp").controller("LoginController",a),a.$inject=["cryptoStorageService","restService","$location","$http","ngAuthSettings","Notification","$window","$timeout","$q","$geolocation","qsService","currentCompanyService","currentUserService","authService"]}();;!function(){"use strict";function e(e,t,o,n,a,i,c,r,l,s){var u=this;u.submitCompanyData=function(){c.create("companyinfos",u.model).then(function(e){200===e.status&&(n.path("newsubscribeduser/"+e.data),a(function(){i.location.reload()}))})},u.model={},u.$state=t;var d=n.url().split("/");u.subscriptionId=d[2],u.attributes=[{Type:"text",Label:"Company Name:",MaxLength:"50",ModelValue:"CompanyName",Required:!0}],u.model.ExceptFieldConnectRole=1,u.loadingIndicator=!1}angular.module("FieldConnectApp").controller("NewCompanyController",e),e.$inject=["$scope","$state","$stateParams","$location","$timeout","$window","restService","Notification","cryptoStorageService","timezoneService"]}();;!function(){"use strict";function e(e,t,l,a,o,i,n,r,u,d){var p=this;p.$state=t,p.goBack=function(e){null!=e?(a.$$search=null,a.path("newuser/"+s[2]+"/"+s[3]+"/"+s[4]+"/"+e+"/"),o(function(){i.location.reload()})):(a.$$search=null,a.path("login"),o(function(){i.location.reload()}))};var s=a.url().split("/");n.getItems("subcontractorCompanies/checkIfExist",{email:s[3],companyId:parseInt(s[2])}).then(function(e){var t=e.data;"null"!=t&&(t.Token!=s[4]?(r.error({message:"Invalid token."}),a.$$search=null,a.path("/login"),o(function(){i.location.reload()},1e3)):(r.error({message:"You are already a subcontractor."}),a.$$search=null,a.path("/login"),o(function(){i.location.reload()},1e3)))}),p.filterStatus={filterId:"Company"},e.$watch("vm.model.IsDifferentBillingInfo",function(){null!=p.model.IsDifferentBillingInfo&&(p.model.IsDifferentBillingInfo?(p.attributes[18].Type="line",p.attributes[19].Type="text",p.attributes[20].Type="text",p.attributes[21].Type="text",p.attributes[22].Type="text",p.attributes[23].Type="text",p.attributes[24].Type="text",p.attributes[25].Type="text",p.attributes[26].Type="text",p.attributes[27].Type="text",p.attributes[28].Type="dropdown",p.attributes[29].Type="text",p.attributes[30].Type="dropdown"):(p.attributes[18].Type="empty",p.attributes[19].Type="empty",p.attributes[20].Type="empty",p.attributes[21].Type="empty",p.attributes[22].Type="empty",p.attributes[23].Type="empty",p.attributes[24].Type="empty",p.attributes[25].Type="empty",p.attributes[26].Type="empty",p.attributes[27].Type="empty",p.attributes[28].Type="empty",p.attributes[29].Type="empty",p.attributes[30].Type="empty"))}),p.attributes=[{Type:"text",Label:"Company Name:",MaxLength:"50",ModelValue:"CompanyName",Required:!0},{Type:"multiselect",Label:"Industry:",ApiMethod:"industries",ValueProp:"Id",TextProp:"IndustryName",ModelValue:"ListIndustryIds"},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"Title:",MaxLength:"50",ModelValue:"Title"},{Type:"text",Label:"Address:",MaxLength:"100",ModelValue:"Address1",Required:!0},{Type:"text",Label:"Contact First Name:",MaxLength:"50",ModelValue:"FirstName",Required:!0},{Type:"text",Label:"",MaxLength:"100",ModelValue:"Address2"},{Type:"text",Label:"Contact Last Name:",MaxLength:"50",ModelValue:"LastName",Required:!0},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"City",Required:!0},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"Phone",Required:!0},{Type:"text",Label:"Postal Code",MaxLength:"20",ModelValue:"PostalCode",Required:!0},{Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"Fax"},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country",Required:!0},{Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"Cell"},{Type:"dropdown",Label:"State Code:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"StateCode",Required:!0},{Type:"text",Label:"Email:",MaxLength:"50",ModelValue:"Email",Required:!0},{Type:"line",CustomClass:"col-sm-12"},{Type:"checkbox",Label:"Is different billing address?",ModelValue:"IsDifferentBillingInfo"},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"Billing Contact Title:",MaxLength:"50",ModelValue:"BillingContactTitle"},{Type:"text",Label:"Billing Address:",MaxLength:"100",ModelValue:"BillingAddress",Required:!0},{Type:"text",Label:"Billing Contact First Name:",MaxLength:"50",ModelValue:"BillingContactFirstName",Required:!0},{Type:"text",Label:"",MaxLength:"100",ModelValue:"BillingAddress2"},{Type:"text",Label:"Billing Contact Last Name:",MaxLength:"50",ModelValue:"BillingContactLastName",Required:!0},{Type:"text",Label:"Billing City:",MaxLength:"50",ModelValue:"BillingCity",Required:!0},{Type:"text",Label:"Billing Phone:",MaxLength:"20",ModelValue:"BillingContactPhone",Requried:!0},{Type:"text",Label:"Billing Postal Code",MaxLength:"20",ModelValue:"BillingPostalCode",Required:!0},{Type:"text",Label:"Billing Fax:",MaxLength:"20",ModelValue:"BillingFax"},{Type:"dropdown",Label:"Billing Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"BillingCountry",Required:!0},{Type:"text",Label:"Billing Email:",MaxLength:"50",ModelValue:"BillingEmail",Required:!0},{Type:"dropdown",Label:"Billing State Code:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"BillingStateCode",Required:!0},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"Banner:",MaxLength:"50",ModelValue:"Banner"},{Type:"text",Label:"Logo Url:",MaxLength:"100",ModelValue:"LogoUrl"},{Type:"text",Label:"Web site:",MaxLength:"50",ModelValue:"WebSite",Required:!1},{Type:"dropdown",Label:"Currency:",ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode"},{Type:"hidden",ModelValue:"TaxId"},{Type:"hidden",ModelValue:"Subcontractor"},{Type:"hidden",ModelValue:"Status"},{Type:"text",Label:"External Id:",MaxLength:"50",ModelValue:"ExternalId"}],p.model={},e.$watch("vm.model.Subcontractor",function(){p.model.Subcontractor=!0,p.model.CompanyCollerId=parseInt(s[2]),p.model.CalledEmail=s[3],p.model.Token=s[4]}),e.$watch("vm.model.Status",function(){void 0!=p.model.Status&&null!=p.model.Status||(p.model.Status="Active")})}angular.module("FieldConnectApp").controller("NewSubcontractorCompanyController",e),e.$inject=["$scope","$state","$stateParams","$location","$timeout","$window","restService","Notification","cryptoStorageService","timezoneService"]}();;!function(){"use strict";function e(e,o,t,r,a,l,s,i,d){var n=this,c=t.url().split("/");function m(){if(i.warning({message:"Creating Quote report, please wait..."}),r=$("#signatureCanvas")[0],(a=document.createElement("canvas")).width=r.width,a.height=r.height,r.toDataURL()==a.toDataURL())i.warning({message:"Quote report must be signed."}),$("#signatureCanvas")[0].style.cssText="border: 1px  solid #FF0000";else{n.isLoading=!0,$("#signatureCanvas")[0].style.cssText="border: 1px  solid #000000";var o=new Image;o.src=$("#signatureCanvas")[0].toDataURL();var t=o.src.split(",")[1];n.model.Signature=t,e.create("quotereports/remoteReport",n.model).then(function(e){i.success({message:"Quote report has been successfully created."}),u(e)})}var r,a}function u(e){l.removeAll(),t.$$search=null,t.url("/login"),a(function(){window.location.reload()})}n.$scope=o,n.ok=m,n.id=o.id,n.quoteId=parseInt(c[2]),n.miscTotal=0,n.partTotal=0,n.laborHoursTotal=0,n.laborPriceTotal=0,n.isLoading=!0,n.showForm=!1,n.showError=!1,n.validKey=l.getValue("remoteKey",!0),n.validKey?(n.showForm=!0,e.getItem("quotereports/remoteReport",n.quoteId).then(function(e){n.model=e.data,n.model.Date=new Date,n.model.Date=d.convertToUtc(n.model.Date,n.model.Date.getTimezoneOffset()),n.model.Date=d.convertToLocal(n.model.Date),n.model.FullDateString=moment(n.model.Date).format("M/D/YYYY HH:mm:ss SSS"),n.model.DateString=moment(n.model.Date).format("M/D/YYYY"),n.model.ExpireDate=d.parseISOString(n.model.ExpireDate),n.model.ExpireDate=d.convertToLocal(n.model.ExpireDate),n.model.ExpireDate=moment(n.model.ExpireDate).format("M/D/YYYY");for(var o=0;o<n.model.QuoteReportMiscs.length;o++)n.miscTotal+=n.model.QuoteReportMiscs[o].ExtendedPrice,n.model.QuoteReportMiscs[o].ExtendedPriceDisplay=n.model.QuoteReportMiscs[o].ExtendedPrice.toFixed(2),n.model.QuoteReportMiscs[o].PriceDisplay=n.model.QuoteReportMiscs[o].Price.toFixed(2);for(o=0;o<n.model.QuoteReportParts.length;o++)n.partTotal+=n.model.QuoteReportParts[o].ExtendedPrice,n.model.QuoteReportParts[o].ExtendedPriceDisplay=n.model.QuoteReportParts[o].ExtendedPrice.toFixed(2),n.model.QuoteReportParts[o].PriceDisplay=n.model.QuoteReportParts[o].Price.toFixed(2);for(o=0;o<n.model.QuoteReportLabors.length;o++)n.laborHoursTotal+=n.model.QuoteReportLabors[o].Hours,n.laborPriceTotal+=n.model.QuoteReportLabors[o].Price,n.model.QuoteReportLabors[o].PricePerHourDisplay=n.model.QuoteReportLabors[o].PricePerHour.toFixed(2),n.model.QuoteReportLabors[o].PriceDisplay=n.model.QuoteReportLabors[o].Price.toFixed(2),n.model.QuoteReportLabors[o].HoursDisplay=n.model.QuoteReportLabors[o].Hours.toFixed(2);n.miscTotalDisplay=n.miscTotal.toFixed(2),n.partTotalDisplay=n.partTotal.toFixed(2),n.laborPriceTotalDisplay=n.laborPriceTotal.toFixed(2),n.laborHoursTotalDislpay=n.laborHoursTotal.toFixed(2),n.ReportTolalDisplay=(n.miscTotal+n.partTotal+n.laborPriceTotal).toFixed(2);for(o=0;o<n.model.QuoteReportNotes.length;o++)n.model.QuoteReportNotes[o].SysModifyUTC=d.parseISOString(n.model.QuoteReportNotes[o].SysModifyUTC),n.model.QuoteReportNotes[o].SysModifyUTC=d.convertToLocal(n.model.QuoteReportNotes[o].SysModifyUTC),n.model.QuoteReportNotes[o].SysModifyUTCString=n.model.QuoteReportNotes[o].SysModifyUTC.toLocaleString("en-us").replace(",","");n.isLoading=!1})):(n.isLoading=!1,n.showError=!0,t.url("/login"),a(function(){window.location.reload()},5e3)),n.modalClass=!1,a(function(){n.modalClass=!0}),n.ok=m,n.clear=function(){var e=$("#signatureCanvas")[0];e.width=e.width,n.model.SignedBy="",$("#signatureCanvas")[0].style.cssText="border: 1px  solid #000000"},n.onBack=u,n.$scope.clearVal=0,n.$scope.saveVal=0}angular.module("FieldConnectApp").controller("remoteQuoteReportController",e),e.$inject=["restService","$scope","$location","$state","$timeout","cryptoStorageService","$sce","Notification","timezoneService"]}();;!function(){"use strict";function e(e,o,r,t,a,i,s,n,l){var c=this,d=r.url().split("/");function m(){var o,r;if(n.warning({message:"Creating Work order service report, please wait..."}),null===c.model.SignedBy)n.warning({message:"Work order service report must be SignedBy."});else if(o=$("#signatureCanvas")[0],(r=document.createElement("canvas")).width=o.width,r.height=o.height,o.toDataURL()===r.toDataURL())n.warning({message:"Work order service report must be SignedBy."}),$("#signatureCanvas")[0].style.cssText="border: 1px  solid #FF0000";else{c.isLoading=!0;var t=new Image;t.src=$("#signatureCanvas")[0].toDataURL();var i=t.src.split(",")[1];c.model.Signature=i,e.create("woservicereports/remoteReport",c.model).then(function(e){n.success({message:"Work order service report has been successfully created."}),a(function(){v(e)},5e3)})}}function v(e){i.removeAll(),r.$$search=null,r.url("/login"),a(function(){window.location.reload()})}c.$scope=o,c.ok=m,c.id=o.id,c.woId=parseInt(d[2]),c.showWarning=!1,c.serviceReportAPI="woservicereports",c.isLoading=!0,c.showError=!1,c.showForm=!1,c.validKey=i.getValue("remoteKey",!0),c.validKey?(c.showForm=!0,e.getItem("woservicereports/remoteReport",c.woId).then(function(){console.log(e.state.item),c.model=e.state.item,c.previewHTML=s.trustAsHtml(e.state.item.ReportHTML),c.model.Date=new Date,c.model.Date=l.convertToUtc(c.model.Date,c.model.Date.getTimezoneOffset()),c.model.Date=l.convertToLocal(c.model.Date),c.model.FullDateString=moment(c.model.Date).format("M/D/YYYY HH:mm:ss SSS"),c.model.DateString=moment(c.model.Date).format("M/D/YYYY");for(var o=0;o<c.model.ServiceReportLabors.length;o++)null!==c.model.ServiceReportLabors[o].LaborDate?(c.model.ServiceReportLabors[o].LaborDate=l.parseISOString(c.model.ServiceReportLabors[o].LaborDate),c.model.ServiceReportLabors[o].LaborDate=l.convertToLocal(c.model.ServiceReportLabors[o].LaborDate),c.model.ServiceReportLabors[o].LaborDateString=c.model.ServiceReportLabors[o].LaborDate.toLocaleDateString("en-us").replace(",","")):c.model.ServiceReportLabors[o].LaborDateString="";for(o=0;o<c.model.ServiceReportNotes.length;o++)c.model.ServiceReportNotes[o].SysModifyUTC=l.parseISOString(c.model.ServiceReportNotes[o].SysModifyUTC),c.model.ServiceReportNotes[o].SysModifyUTC=l.convertToLocal(c.model.ServiceReportNotes[o].SysModifyUTC),c.model.ServiceReportNotes[o].SysModifyUTCString=c.model.ServiceReportNotes[o].SysModifyUTC.toLocaleString("en-us").replace(",","");c.companySettings=[],c.isLoading=!1})):(c.isLoading=!1,c.showError=!0,r.url("/login"),a(function(){window.location.reload()},5e3)),c.modalClass=!1,a(function(){c.modalClass=!0}),c.ok=m,c.clear=function(){var e=$("#signatureCanvas")[0];e.width=e.width,c.model.SignedBy="",$("#signatureCanvas")[0].style.cssText="border: 1px  solid #000000"},c.onBack=v,c.$scope.clearVal=0,c.$scope.saveVal=0}angular.module("FieldConnectApp").controller("remoteServiceReportController",e),e.$inject=["restService","$scope","$location","$state","$timeout","cryptoStorageService","$sce","Notification","timezoneService"]}();;!function(){"use strict";function n(n,o,t,i,c,e){var a=this;a.subscriptionTransaction=function(){i.path("newSubscriptionTransactionBased"),c(function(){e.location.reload()})},a.subscriptionUser=function(){i.path("newSubscriptionUserBased"),c(function(){e.location.reload()})},a.model={},a.$state=o,a.goBack=function(){i.url("/login"),c(function(){window.location.reload()})};var s=i.url().split("/");a.subscriptionId=s[2],n.$on("$locationChangeSuccess",function(){a.searchText=i.url(),"/subscriptionType"==a.searchText&&"/login"!=a.searchText||e.location.reload()})}angular.module("FieldConnectApp").controller("SubTypeController",n),n.$inject=["$scope","$state","$stateParams","$location","$timeout","$window"]}();;!function(){"use strict";function e(e,t,r,a,l,o,i,s,d,m,u){var n=this;n.isLoading=!1,n.workOrderMeta={},n.selected={},n.buttonDisabled=!0,n.items=[],n.search=N,n.filterWorkOrderReport=t.filter("and"),n.exportCSV=function(){n.submitSearch=!0,a.generateCSV("basereports/documentcsv",n.filterWorkOrderReport,n.filter.report),n.submitSearch=!1},n.exportPDF=function(){n.submitSearch=!0,a.generatePDF("basereports/documentpdf",n.filterWorkOrderReport,n.filter.report),n.submitSearch=!1},n.deviceDetect=s,n.showForm=!0,n.dateService=d,n.autoFilterClass=t.filter("and"),n.showCSVButton=!0,n.showPDFButton=!0,n.siteFilter={siteId:null},n.filter={page:1,pageSize:50,total:0,sortCol:"AltId",sortDir:"asc",workOrdernumber:0,officeId:0,technicianId:0,projectId:0,byDate:1,report:void 0,customerPONum:""},n.GroupFilter={groupIds:""},n.report="Assignment",n.reportType={report:"Assignment"},n.sortBy=[{SortBy:"Work Order"},{SortBy:"Date"},{SortBy:"Customer"}],n.viewName="BaseReports",n.moduleName=null;var c=m.getValue("authorizationData");function p(){var e="";if(n.filter.customerId)e=angular.copy(n.filter.customerName);else if(n.CustomerNameTemp){e=angular.copy(n.CustomerNameTemp);n.CustomerNameTemp=""}o.showModal({templateUrl:"Templates/Form/selectCustomerForForm.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:n.customer,customerName:e,onSelect:C}}).then(function(e){e.close.then(function(){})})}function f(e){var t="";if(n.filter.siteId)t=angular.copy(n.filter.siteName);else if(n.SiteNameTemp){t=angular.copy(n.SiteNameTemp);n.SiteNameTemp=""}o.showModal({templateUrl:"Templates/Form/selectSiteForForm.html",controller:"SelectSiteController",controllerAs:"vm",inputs:{site:n.site,customerId:n.filter.customerId,siteName:t,onSelect:y}}).then(function(e){e.close.then(function(){})})}c&&(n.userRoles=c.userRoles.split(",")),n.privileges=c.privileges,n.gridPrivileges=[],function(){for(var e=0;e!=n.privileges.length;e++)if(n.privileges[e].Identifier==n.viewName){n.gridPrivileges=n.privileges[e].Modules;break}}(),n.hideCol=function(e){if(null!==n.moduleName)for(var t=0;t!==n.gridPrivileges.length;t++)if(n.gridPrivileges[t].ModuleName===n.moduleName)for(var r=0;r!==n.gridPrivileges[t].Objects.length;r++)if(n.gridPrivileges[t].Objects[r].Identifier===e)return 0!=n.gridPrivileges[t].Objects[r].PrivilegeValue;return!0},n.customer={customerId:0},n.selectCustomer=p,n.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],n.searchColsSite=["Search"],n.siteAutocompleteFilter=t.filter("or"),n.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}],n.ddlgridattrsSite=[{Name:"Customer",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Site Code",ValueName:"SiteCode",Sortable:!0,CellFormat:"label"},{Name:"Site Name",ValueName:"SiteName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"FullAddress",Sortable:!0,CellFormat:"label"}],n.customerAttribute={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:C,SearchTrigger:1,Label:"Customer:",ApiMethod:"customers/active",ModelValue:"customerName",Id:"CustomerName",GridAttributes:n.ddlgridattrsCustomer,PageSize:22,SearchCols:n.searchColsCustomer,Autofocus:"true",TabIndex:1,ObjectName:"btnCustomerSearch"},n.siteAttribute={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:y,SearchTrigger:1,Label:"Site:",Required:!1,ApiMethod:"sites/searchgrid",ModelValue:"siteName",filter:n.siteAutocompleteFilter,Id:"SiteName",GridAttributes:n.ddlgridattrsSite,PageSize:22,SearchCols:n.searchColsSite},n.customerBtn={Type:"button",Label:"Search",onClick:p,ObjectName:"btnCustomerSearch"},n.site={siteId:0},n.selectSite=f,n.siteBtn={Type:"button",Label:"Search",onClick:f,ReadOnly:!1,ObjectName:"btnSiteSearch"},n.sitesForCustomer=[],n.attOffice={Type:"dropdown",Label:"Office:",ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"officeId",ConvertToInt:"true",ObjectName:"ddlWoOffice",TabIndex:7},n.attWorkOrderType={Type:"dropdown",Label:"Work Order Type:",ApiMethod:"wotypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"woTypeName",ObjectName:"ddlWoTypeDropdown",TabIndex:13},n.attWorkOrderStatus={Type:"dropdown",Label:"Work Order Status:",ApiMethod:"wostatuses/getStatusForMangeWorkOrder",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"woStatusName",TabIndex:2},n.attAssignStatus={Type:"dropdown",Label:"Status:",ApiMethod:"assignmentstatuses/ddList",ValueProp:"AssignmentStatusName",TextProp:"AssignmentStatusName",ModelValue:"status"},n.attStartDate={Type:"datepicker",Label:"Start Date:",ModelValue:"startDate",Format:"MM/dd/yyyy",SubType:"date",Required:!1},n.attEndDate={Type:"datepicker",Label:"End Date:",ModelValue:"endDate",Format:"MM/dd/yyyy",SubType:"date",Required:!1},n.attSortBy={Type:"dropdown",Label:"Sort By:",ApiMethod:"lookup/baseReportSortBy",Filter:n.reportType,ValueProp:"Key",TextProp:"Value",ModelValue:"sortCol",SelectFirst:!0},n.attByDate={Type:"dropdown",Label:"By Date:",ApiMethod:"lookup/baseReportByDate",Filter:n.reportType,ValueProp:"Key",TextProp:"Value",ModelValue:"byDate",ConvertToInt:"true",SelectFirst:!0},n.attSortByDir={Type:"dropdown",Label:"Sort By Direction:",ApiMethod:"lookup/baseReportSortDirection",ValueProp:"Key",TextProp:"Value",ModelValue:"sortDir",SelectFirst:!0},n.attReportList={Type:"dropdown",Label:"Report Type:",ApiMethod:"lookup/baseReportList",ValueProp:"Key",TextProp:"Value",ModelValue:"report",SelectFirst:!0},n.attTechnician={Type:"dropdown",Label:"Technician:",ApiMethod:"crewtechs/GetListForCrews",ValueProp:"TechId",TextProp:"UserFirstLastName",ModelValue:"technicianId",CurrentList:"techIds",ConvertToInt:"true",Required:!1},n.attWoCustomerPoNumber={Type:"text",Label:"Customer PO#:",Required:!1,MaxLength:"50",ModelValue:"customerPONum"},n.attTechMulti={Type:"multiselect",Label:"Users:",ApiMethod:"users/ddList",ValueProp:"Id",TextProp:"FullName",ModelValue:"TechIds",ConvertToInt:"true",Required:!1,CustomDivClass:"col-sm-6"},n.attWoStatusMulti={Type:"multiselect",Label:"WO Status:",Required:!1,ApiMethod:"wostatuses",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"WoStatuses"},n.attItemClass={Type:"dropdown",Label:"Item Class:",Required:!1,ApiMethod:"itemClasses",ValueProp:"Id",TextProp:"ClassName",ModelValue:"ClassId",ConvertToInt:"true"},n.attItemType={Type:"dropdown",Label:"Item Type:",Required:!1,ApiMethod:"itemTypes",ValueProp:"Id",TextProp:"TypeName",ModelValue:"TypeId",ConvertToInt:"true",Filter:n.autoFilterClass},n.attDslPostingGroup={Type:"dropdown",Label:"Posting Group:",ApiMethod:"dslInventoryPostingGroup/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"PostingGroupId",ConvertToInt:"true"},n.attDeficiencyStatusMulti={Type:"multiselect",Label:"Status:",Required:!1,ApiMethod:"deficiencyStatus/ddList",ValueProp:"Id",TextProp:"StatusName",ModelValue:"DeficiencyStatusIds",ConvertToInt:!0,ReadOnly:!1},n.attDeficiencySeverityMulti={Type:"multiselect",Label:"Severity:",Required:!1,ApiMethod:"deficiencySeverity/ddList",ValueProp:"Id",TextProp:"SeverityName",ModelValue:"DeficiencySeverityIds",ConvertToInt:!0,ReadOnly:!1},n.attServiceableItemMulti={Type:"multiselect",Label:"Serviceable Item:",Required:!1,ApiMethod:"serviceableitems/dropdownbysite",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemIds",ConvertToInt:!0,ReadOnly:!1,Filter:n.siteFilter},n.attTechByUserList={Type:"dropdown",Label:"Technician:",ApiMethod:"users/ddList",ValueProp:"Id",TextProp:"FullName",ModelValue:"technicianId",ConvertToInt:"true",Required:!1},n.attTechByGroupMulti={Type:"multiselect",Label:"Techs:",ApiMethod:"employees/getTechnicianByLaborGroup",ValueProp:"Id",TextProp:"FullName",ModelValue:"TechIds",ConvertToInt:"true",Required:!1,CustomDivClass:"col-sm-6",Filter:n.GroupFilter},n.attLaborGroupsMulti={Type:"multiselect",Label:"Groups:",Required:!1,ApiMethod:"laborgroups",ValueProp:"Id",TextProp:"Name",ModelValue:"LaborGroupIds",ConvertToInt:!0,ReadOnly:!1},n.attributesReport=[n.attReportList],n.loadingIndicator=!1,n.submitSearch=!1,n.focusOut=function(e){"customer"===e?(n.CustomerNameTemp=angular.copy(n.filter.customerName),null==n.filter.customerId&&(n.filter.customerName=null)):"site"===e&&(n.SiteNameTemp=angular.copy(n.filter.siteName),null==n.filter.siteId&&(n.filter.siteName=null))},e.$on("CustomerNameSearching",function(e,t){n.filter.customerId=null,n.filter.siteId=null,n.filter.siteName=null,n.SiteNameTemp=null,n.siteAutocompleteFilter.reset(),n.siteFilter.siteId=null}),e.$on("SiteNameSearching",function(e,t){n.filter.siteId=null,n.siteFilter.siteId=null});var b=!0;function S(){n.showForm=!1,b=!0,n.items=null,n.workOrderMeta.Paging=null,i(function(){e.$apply(),n.showForm=!0})}function N(){if(void 0!==n.filter.startDate){if(!d.validateDate(n.filter.startDate))return}else n.filter.startDate=null;if(void 0!==n.filter.endDate){if(!d.validateDate(n.filter.endDate))return}else n.filter.endDate=null;if(void 0===n.filter.startDate||void 0===n.filter.endDate||d.validateDateRange(n.filter.startDate,n.filter.endDate)){if(n.isLoading=!0,""!=n.filter.startDate&&null!=n.filter.startDate){n.filter.startDate=new Date(n.filter.startDate),n.filter.startDate.setHours(0,0,0,0);var t=new Date(n.filter.startDate);l.convertToUtc(t),n.selected.startDate=l.buildISOString(t)}else n.selected.startDate=null;if(""!=n.filter.endDate&&null!=n.filter.endDate){n.filter.endDate=new Date(n.filter.endDate),n.filter.endDate.setHours(23,59,59,999),n.filter.localEndDate=n.filter.endDate;var a=new Date(n.filter.endDate);l.convertToUtc(a),n.selected.endDate=l.buildISOString(a)}else n.selected.endDate=null;if(n.filterWorkOrderReport.reset(),"Assignment"===n.filter.report&&n.filterWorkOrderReport.eq("AltId",n.filter.workOrdernumber).eq("TechId",n.filter.technicianId).eq("CustomerId",n.filter.customerId).eq("SiteId",n.filter.siteId).eq("OfficeId",n.filter.officeId).eq("WoType",n.filter.woTypeName).eq("WoStatus",n.filter.woStatusName).eq("StartDate",n.selected.startDate).eq("EndDate",n.selected.endDate).eq("ByDate",n.filter.byDate).eq("Report",n.filter.report).eq("Status",n.filter.status),"TechRevenue"===n.filter.report&&n.filterWorkOrderReport.eq("AltId",n.filter.workOrdernumber).eq("TechId",n.filter.technicianId).eq("CustomerId",n.filter.customerId).eq("SiteId",n.filter.siteId).eq("OfficeId",n.filter.officeId).eq("WoType",n.filter.woTypeName).eq("WoStatus",n.filter.woStatusName).eq("StartDate",n.selected.startDate).eq("EndDate",n.selected.endDate).eq("ByDate",n.filter.byDate).eq("Report",n.filter.report).eq("Status",n.filter.status).eq("CustomerPONum",n.filter.customerPONum),"PartsByTech"===n.filter.report&&(n.filterWorkOrderReport.eq("Report",n.filter.report).eq("TechIds",n.filter.TechIds).eq("WoStatuses",n.filter.WoStatuses).eq("StartDate",n.selected.startDate).eq("EndDate",n.selected.endDate).eq("ItemClassId",n.filter.ClassId).eq("ItemTypeId",n.filter.TypeId).eq("PostingGroupId",n.filter.PostingGroupId),n.filter.sortCol="ModifiedDate",n.filter.sortDir="desc"),"Deficiency"===n.filter.report&&n.filterWorkOrderReport.eq("Report",n.filter.report).eq("StartDate",n.selected.startDate).eq("EndDate",n.selected.endDate).eq("DeficiencyStatusIds",n.filter.DeficiencyStatusIds).eq("DeficiencySeverityIds",n.filter.DeficiencySeverityIds).eq("TechId",n.filter.technicianId).eq("CustomerId",n.filter.customerId).eq("SiteId",n.filter.siteId).eq("ServiceableItemIds",n.filter.ServiceableItemIds),"TechProductivity"===n.filter.report){if(null==n.selected.startDate||null==n.selected.endDate)return u.error("Both Start Date and End Date must be specified!"),void(n.isLoading=!1);0==n.filter.TechIds.length&&""!=n.GroupFilter.groupIds&&function(){try{n.attTechByGroupMulti.CurrentList.forEach(function(e){n.filter.TechIds.push(e.Id)})}catch(e){u.error("There was an error retrieving techs from the group")}}(),n.filterWorkOrderReport.eq("Report",n.filter.report).eq("StartDate",n.selected.startDate).eq("EndDate",n.selected.endDate).eq("TechIds",n.filter.TechIds),n.filter.sortCol="TechnicianName",n.filter.sortDir="desc"}n.filterWorkOrderReport.page=n.filter.page,n.filterWorkOrderReport.pageSize=n.filter.pageSize,n.filterWorkOrderReport.total=n.filter.total,n.filterWorkOrderReport.sortCol=n.filter.sortCol,n.filterWorkOrderReport.sortDir=n.filter.sortDir,r.getItems("basereports/documentfilter",n.filterWorkOrderReport).then(function(){n.workOrderMeta=r.state.itemsMeta,n.items=r.state.items,n.items.length>0?n.buttonDisabled=!1:n.buttonDisabled=!0,setTimeout(function(){n.isLoading=!1,e.$apply()},100)})}}function C(e){n.filter.customerId=e.Id,e.CustomerCode&&""!=e.CustomerCode?n.filter.customerName=e.CustomerCode+" - "+e.CustomerName:n.filter.customerName=e.CustomerName,n.filter.siteName="",n.tmpFilter=t.filter("and"),n.tmpFilter.eq("CustomerId",e.Id),n.siteAutocompleteFilter.reset(),n.siteAutocompleteFilter.eq("CustomerId",n.filter.customerId),r.getItems("sites",n.tmpFilter).then(function(){n.sitesForCustomers=r.state.items;for(var e=0;e<n.sitesForCustomers.length;e++)n.sitesForCustomer.push(n.sitesForCustomers[e].Id)})}function y(t){t.SiteCode&&""!=t.SiteCode?n.filter.siteName=t.SiteCode+" - "+t.SiteName:n.filter.siteName=t.SiteName,n.SiteNameTemp=n.filter.siteName,n.filter.siteId=t.Id,n.siteFilter.siteId=t.Id,(!n.filter.customerId||0===n.filter.customerId&&t.CustomerId)&&r.getItem("customers/",t.CustomerId).then(function(t){var r=t.data;r.CreditHold?bootbox.confirm("The customer "+r.CustomerName+" is on credit hold!",function(t){i(function(){t?(n.filter.customerId=r.Id,n.siteAutocompleteFilter.reset(),n.siteAutocompleteFilter.eq("CustomerId",r.Id),r.CustomerCode&&""!=r.CustomerCode?n.filter.customerName=r.CustomerCode+" - "+r.CustomerName:n.filter.customerName=r.CustomerName,n.CustomerNameTemp=n.filter.siteName):(vvm.filter.siteName=null,n.SiteNameTemp=null,n.filter.siteId=null),e.$apply()})}):(n.filter.customerId=r.Id,n.siteAutocompleteFilter.reset(),n.siteAutocompleteFilter.eq("CustomerId",r.Id),r.CustomerCode&&""!=r.CustomerCode?n.filter.customerName=r.CustomerCode+" - "+r.CustomerName:n.filter.customerName=r.CustomerName,n.CustomerNameTemp=n.filter.siteName)})}e.$watch("vm.workOrderMeta.Paging",function(e,t){null!=n.workOrderMeta.Paging&&(b?b=!1:e.Page!==t.Page&&(n.filter.page=n.workOrderMeta.Paging.Page,n.filter.pageSize=n.workOrderMeta.Paging.PageSize,N()))},!0),e.$watch("vm.filter.report",function(t,r){if(t&&t!==r)switch(t.toLowerCase()){case"assignment":n.reportType.report="Assignment",n.showCSVButton=!0,n.showPDFButton=!0,n.moduleName="Assignment Report",n.attStartDate.Required=!1,n.attEndDate.Required=!1,n.attributesFilter=[n.customerAttribute,n.customerBtn,n.siteAttribute,n.siteBtn,n.attWorkOrderType,n.attOffice,n.attWorkOrderStatus,n.attTechnician,n.attAssignStatus,n.attByDate,n.attSortBy,n.attStartDate,n.attSortByDir,n.attEndDate],n.attributes=[{Name:"Work Order",ValueName:"AltId",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportAltId"},{Name:"Priority",ValueName:"Priority",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportPriority"},{Name:"WO Type",ValueName:"WoType",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportWoType"},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportCustomerName"},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportSiteName"},{Name:"Address",ValueName:"Address1",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportAddress1"},{Name:"City",ValueName:"City",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportCity"},{Name:"State",ValueName:"StateCode",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportStateCode"},{Name:"Zip",ValueName:"PostalCode",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportPostalCode"},{Name:"WO Description",ValueName:"WoDescription",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportWoDescription"},{Name:"Description",ValueName:"Description",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportDescription"},{Name:"Created",ValueName:"CreatedDate",Edit:!1,Sortable:!1,CellFormat:"label",FormatDate:!0,pid:"colAssignReportCreatedDate"},{Name:"Promised",ValueName:"PromiseDate",FormatDate:"date",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportPromiseDate"},{Name:"Start",ValueName:"EstStartDate",Edit:!1,Sortable:!1,CellFormat:"label",FormatDate:!0,pid:"colAssignReportEstStartDate"},{Name:"End",ValueName:"EstEndDate",Edit:!1,Sortable:!1,CellFormat:"label",FormatDate:!0,pid:"colAssignReportEstEndDate"},{Name:"WO Status",ValueName:"WoStatus",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportWoStatus"},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportStatus"},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportOfficeName"},{Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportServiceableItemName"},{Name:"Problem",ValueName:"ProblemCode",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportProblemCode"},{Name:"Cause",ValueName:"Cause",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportCause"},{Name:"Resolution",ValueName:"Resolution",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportResolution"},{Name:"Technician",ValueName:"Technician",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colAssignReportTechnician"}],S();break;case"deficiency":n.reportType.report="Deficiency",n.showCSVButton=!0,n.showPDFButton=!0,n.moduleName="Deficiency Report",n.attStartDate.Required=!1,n.attEndDate.Required=!1,n.attributesFilter=[n.customerAttribute,n.customerBtn,n.siteAttribute,n.siteBtn,n.attTechByUserList,n.attDeficiencyStatusMulti,n.attDeficiencySeverityMulti,n.attServiceableItemMulti,n.attSortBy,n.attStartDate,n.attSortByDir,n.attEndDate],n.attributes=[{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colDeficiencyReportCustomerName"},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colDeficiencyReportSiteName"},{Name:"WO Type",ValueName:"WoType",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colDeficiencyReportWoType"},{Name:"Work Order",ValueName:"AltId",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colDeficiencyReportAltId"},{Name:"WO Description",ValueName:"WoDesc",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colDeficiencyReportWoDesc"},{Name:"Promised",ValueName:"PromiseDate",FormatDate:"date",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colDeficiencyReportPromiseDate"},{Name:"Status",ValueName:"StatusName",Edit:!1,Sortable:!1,CellFormat:"label",pid:"colDeficiencyReportStatusName"}],S();break;case"techrevenue":n.reportType.report="TechRevenue",n.showCSVButton=!0,n.showPDFButton=!0,n.moduleName=null,n.attStartDate.Required=!1,n.attEndDate.Required=!1,n.attributesFilter=[n.customerAttribute,n.customerBtn,n.siteAttribute,n.siteBtn,n.attOffice,n.attByDate,n.attWoCustomerPoNumber,n.attStartDate,n.attSortBy,n.attEndDate,n.attSortByDir],n.attributes=[{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Promised Date",ValueName:"PromiseDate",FormatDate:"date",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"WO #",ValueName:"AltId",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"External ID",ValueName:"ExternalId",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Customer PO#",ValueName:"CustomerPoNum",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Total Extended Price of Misc Item",ValueName:"TotalExtendedPrice",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Hydrovac w/Crew QTY",ValueName:"HydrovacWCrewQTY",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Hydrovac w/Crew OT QTY",ValueName:"HydrovacWCrewOTQTY",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Hydrovac w/Crew DT (Emergency/Sunday/Holiday) QTY",ValueName:"HydrovacWCrewDTQTY",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Dump Fees QTY",ValueName:"DumpFeesQTY",Edit:!1,Sortable:!1,CellFormat:"label"}],S();break;case"partsbytech":n.reportType.report="PartsByTech",n.showCSVButton=!0,n.showPDFButton=!1,n.moduleName=null,n.attStartDate.Required=!1,n.attEndDate.Required=!1,n.attributesFilter=[n.attItemClass,n.attStartDate,n.attItemType,n.attEndDate,n.attDslPostingGroup,{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},n.attWoStatusMulti,n.attTechMulti],n.attributes=[{Name:"Full Name",ValueName:"Technician",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Priority",ValueName:"Priority",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"WO Status",ValueName:"WoStatus",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Work Order",ValueName:"WorkOrder",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Modified Date",ValueName:"ModifiedDate",FormatDate:"date",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Part Number",ValueName:"PartNumber",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Part Name",ValueName:"PartName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Quantity",ValueName:"Quantity",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Unit Price",ValueName:"UnitPrice",Edit:!1,Sortable:!1,CellFormat:"label"}],e.$watch("vm.filter.ClassId",function(){n.filter.ClassId?(n.autoFilterClass.filter=[],n.autoFilterClass.eq("ClassId",n.filter.ClassId)):n.autoFilterClass.reset()}),S();break;case"techproductivity":n.reportType.report="TechProductivity",n.showCSVButton=!0,n.showPDFButton=!0,n.moduleName=null,n.attStartDate.Required=!0,n.attEndDate.Required=!0,n.attributesFilter=[n.attStartDate,n.attEndDate,n.attLaborGroupsMulti,n.attTechByGroupMulti],n.attributes=[{Name:"Technician",ValueName:"TechnicianName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Worked",ValueName:"TotalWorkedHours",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Travel",ValueName:"TotalTravelHours",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Idle",ValueName:"IdleHours",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Schedule",ValueName:"ScheduleHours",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Unavailable",ValueName:"TotalUnavailableHours",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Utilization",ValueName:"Utilization",Edit:!1,Sortable:!1,CellFormat:"percent"},{Name:"WO Quantity",ValueName:"TotalWOs",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Hours per WO",ValueName:"HoursPerWO",Edit:!1,Sortable:!1,CellFormat:"label"}],S()}}),e.$watch("vm.filter.LaborGroupIds",function(){if(n.filter.LaborGroupIds){n.filter.TechIds=[];var e="";if(0!=n.filter.LaborGroupIds.lengh){for(var t=0;t!=n.filter.LaborGroupIds.length;t++)e+=n.filter.LaborGroupIds[t]+",";e=e.substring(0,e.length-1)}n.GroupFilter.groupIds=e}})}angular.module("FieldConnectApp").controller("BaseReportsController",e),e.$inject=["$scope","qsService","restService","baseReportService","timezoneService","ModalService","$timeout","deviceDetector","dateService","cryptoStorageService","Notification"]}();;!function(){"use strict";function e(e,t,r,l,a,i,o,s,m){var u=this;function c(){var e="";if(u.filter.customerId)e=angular.copy(u.filter.customerName);else if(u.CustomerNameTemp){e=angular.copy(u.CustomerNameTemp);u.CustomerNameTemp=""}i.showModal({templateUrl:"Templates/Form/selectCustomerForForm.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:u.customer,customerName:e,onSelect:n}}).then(function(e){e.close.then(function(){})})}function d(e){var t="";if(u.filter.siteId)t=angular.copy(u.filter.siteName);else if(u.SiteNameTemp){t=angular.copy(u.SiteNameTemp);u.SiteNameTemp=""}i.showModal({templateUrl:"Templates/Form/selectSiteForForm.html",controller:"SelectSiteController",controllerAs:"vm",inputs:{site:u.site,customerId:u.filter.customerId,onSelect:f,siteName:t}}).then(function(e){e.close.then(function(){})})}function n(e){u.filter.customerId=e.Id,e.CustomerCode&&""!=e.CustomerCode?u.filter.customerName=e.CustomerCode+" - "+e.CustomerName:u.filter.customerName=e.CustomerName,u.filter.siteName="",u.tmpFilter=t.filter("and"),u.tmpFilter.eq("CustomerId",e.Id),u.siteAutocompleteFilter.reset(),u.siteAutocompleteFilter.eq("CustomerId",u.filter.customerId),r.getItems("sites",u.tmpFilter).then(function(){u.sitesForCustomers=r.state.items;for(var e=0;e<u.sitesForCustomers.length;e++)u.sitesForCustomer.push(u.sitesForCustomers[e].Id)}),u.autoFilterArgeement.reset(),u.autoFilterArgeement.eq("CustomerName",e.CustomerName),u.autoFilterArgeement.eq("Report","ServiceableItemReport"),u.autoFilterServiceableItem.reset(),u.autoFilterServiceableItem.eq("CustomerId",u.filter.customerId)}function f(t){t.SiteCode&&""!=t.SiteCode?u.filter.siteName=t.SiteCode+" - "+t.SiteName:u.filter.siteName=t.SiteName,u.SiteNameTemp=u.filter.siteName,u.filter.siteId=t.Id,(!u.filter.customerId||0===u.filter.customerId&&t.CustomerId)&&r.getItem("customers/",t.CustomerId).then(function(t){var r=t.data;r.CreditHold?bootbox.confirm("The customer "+r.CustomerName+" is on credit hold!",function(t){o(function(){t?(u.filter.customerId=r.Id,u.siteAutocompleteFilter.reset(),u.siteAutocompleteFilter.eq("CustomerId",r.Id),r.CustomerCode&&""!=r.CustomerCode?u.filter.customerName=r.CustomerCode+" - "+r.CustomerName:u.filter.customerName=r.CustomerName,u.CustomerNameTemp=u.filter.siteName):(vvm.filter.siteName=null,u.SiteNameTemp=null,u.filter.siteId=null),e.$apply()})}):(u.filter.customerId=r.Id,u.siteAutocompleteFilter.reset(),u.siteAutocompleteFilter.eq("CustomerId",r.Id),r.CustomerCode&&""!=r.CustomerCode?u.filter.customerName=r.CustomerCode+" - "+r.CustomerName:u.filter.customerName=r.CustomerName,u.CustomerNameTemp=u.filter.siteName)}),u.autoFilterArgeement.reset(),u.autoFilterArgeement.eq("SiteName",t.SiteName),u.autoFilterArgeement.eq("Report","ServiceableItemReport"),u.autoFilterServiceableItem.reset(),u.autoFilterServiceableItem.eq("CustomerId",u.filter.customerId),u.autoFilterServiceableItem.eq("SiteId",u.filter.siteId)}u.serviceableItemMeta={},u.selected={},u.buttonDisabled=!0,u.items=[],u.search=S,u.deviceDetect=s,u.dateService=m,u.filterServiceableItemReport=t.filter("and"),u.autoFilterArgeementType=t.filter("and"),u.autoFilterArgeement=t.filter("and"),u.autoFilterServiceableItemTypes=t.filter("and"),u.exportCSV=function(){u.submitSearch=!0,l.generateCSV("basereports/documentcsv",u.filterServiceableItemReport,u.filter.report),u.submitSearch=!1},u.exportPDF=function(){u.submitSearch=!0,l.generatePDF("basereports/documentpdf",u.filterServiceableItemReport,u.filter.report),u.submitSearch=!1},u.filter={page:1,pageSize:50,total:0,sortCol:"AltId",sortDir:"asc",officeId:0,byDate:1,report:"ServiceableItem"},u.customer={customerId:0},u.selectCustomer=c,u.customerBtn={Label:"Search",onClick:c},u.site={siteId:0},u.selectSite=d,u.siteBtn={Label:"Search",onClick:d},u.autoFilterServiceableItem=t.filter("and"),u.sitesForCustomer=[],u.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],u.searchColsSite=["Search"],u.siteAutocompleteFilter=t.filter("or"),u.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}],u.ddlgridattrsSite=[{Name:"Customer",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Site Code",ValueName:"SiteCode",Sortable:!0,CellFormat:"label"},{Name:"Site Name",ValueName:"SiteName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"FullAddress",Sortable:!0,CellFormat:"label"}],u.customerAttribute={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:n,SearchTrigger:1,Label:"Customer:",Required:!1,ApiMethod:"customers/active",ModelValue:"customerName",Id:"CustomerName",GridAttributes:u.ddlgridattrsCustomer,PageSize:22,SearchCols:u.searchColsCustomer},u.siteAttribute={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:f,SearchTrigger:1,Label:"Site:",Required:!1,ApiMethod:"sites/searchgrid",ModelValue:"siteName",filter:u.siteAutocompleteFilter,Id:"SiteName",GridAttributes:u.ddlgridattrsSite,PageSize:22,SearchCols:u.searchColsSite},u.attributes=[{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"SI Description",ValueName:"ServiceableItemDescription",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"SI Class",ValueName:"ClassName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"SI Type",ValueName:"TypeName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"SI Manufacturer",ValueName:"Mfr",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"SI Model",ValueName:"Model",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Work Order",ValueName:"AltId",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"WO Promised",ValueName:"PromiseDate",FormatDate:"date",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"WO Type",ValueName:"WoType",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"WO Status",ValueName:"Status",Edit:!1,Sortable:!1,CellFormat:"label"}],u.loadingIndicator=!1,u.submitSearch=!1,u.focusOut=function(e){"customer"===e?(u.CustomerNameTemp=angular.copy(u.filter.customerName),null==u.filter.customerId&&(u.filter.customerName=null)):"site"===e&&(u.SiteNameTemp=angular.copy(u.filter.siteName),null==u.filter.siteId&&(u.filter.siteName=null))},e.$on("CustomerNameSearching",function(e,t){u.filter.customerId=null,u.filter.siteId=null,u.filter.siteName=null,u.SiteNameTemp=null,u.siteAutocompleteFilter.reset()}),e.$on("SiteNameSearching",function(e,t){u.filter.siteId=null}),e.$watch("vm.filter.customerId",function(){null==u.filter.customerId&&(u.autoFilterArgeement.reset(),u.siteAutocompleteFilter.reset(),u.autoFilterServiceableItem.reset(),u.autoFilterServiceableItem.eq("CustomerId",0).eq("SiteId",0),u.autoFilterArgeement.reset(),u.autoFilterArgeement.eq("CustomerId",0),u.autoFilterServiceableItemTypes.reset(),u.autoFilterServiceableItemTypes.eq("ServiceableItemClassId",0))}),e.$watch("vm.filter.siteId",function(){null!=u.filter.customerId&&(null!=u.filter.siteId&&void 0!==u.filter.siteId||(u.autoFilterServiceableItem.reset(),u.autoFilterServiceableItem.eq("CustomerId",u.filter.customerId),u.autoFilterArgeement.reset(),u.autoFilterArgeement.eq("CustomerId",u.filter.customerId))),void 0===u.filter.siteId&&void 0===u.filter.customerId&&(console.log("both undefined"),u.autoFilterServiceableItem.reset(),u.autoFilterServiceableItem.eq("CustomerId",0).eq("SiteId",0),u.autoFilterArgeement.reset(),u.autoFilterArgeement.eq("CustomerId",0)),console.log(u.filter.siteId)}),e.$watch("vm.filter.serviceableItemClassId",function(){console.log(u.filter.serviceableItemClassId),null!=u.filter.serviceableItemClassId&&(u.autoFilterServiceableItemTypes.reset(),u.autoFilterServiceableItemTypes.eq("ServiceableItemClassId",u.filter.serviceableItemClassId))});var I=!0;function S(){if(void 0!==u.filter.startDate){if(!m.validateDate(u.filter.startDate))return}else u.filter.startDate=null;if(void 0!==u.filter.endDate){if(!m.validateDate(u.filter.endDate))return}else u.filter.endDate=null;if(void 0===u.filter.startDate||void 0===u.filter.endDate||m.validateDateRange(u.filter.startDate,u.filter.endDate)){if(u.isLoading=!0,""!=u.filter.startDate&&null!=u.filter.startDate){u.filter.startDate=new Date(u.filter.startDate),u.filter.startDate.setHours(0,0,0,0);var t=new Date(u.filter.startDate);a.convertToUtc(t),u.selected.startDate=a.buildISOString(t)}else u.selected.startDate=null;if(""!=u.filter.endDate&&null!=u.filter.endDate){u.filter.endDate=new Date(u.filter.endDate),u.filter.endDate.setHours(23,59,59,999);var l=new Date(u.filter.endDate);a.convertToUtc(l),u.selected.endDate=a.buildISOString(l)}else u.selected.endDate=null;u.filterServiceableItemReport.reset(),u.filterServiceableItemReport.eq("CustomerId",u.filter.customerId).eq("SiteId",u.filter.siteId).eq("OfficeId",u.filter.officeId).eq("ServiceableItemId",u.filter.serviceableItemId).eq("ServiceableItemClassId",u.filter.serviceableItemClassId).eq("ServiceableItemTypeId",u.filter.serviceableItemTypeId).eq("ServiceableItemManufacturer",u.filter.serviceableItemManufacturer).eq("ServiceableItemModel",u.filter.serviceableItemModel).eq("AgreementId",u.filter.agreementId).eq("AgreementTypeId",u.filter.agreementTypeId).eq("WoType",u.filter.woTypeName).eq("Status",u.filter.woStatusName).eq("StartDate",u.selected.startDate).eq("EndDate",u.selected.endDate).eq("ByDate",u.filter.byDate).eq("Report",u.filter.report),u.filterServiceableItemReport.page=u.filter.page,u.filterServiceableItemReport.pageSize=u.filter.pageSize,u.filterServiceableItemReport.total=u.filter.total,u.filterServiceableItemReport.sortCol=u.filter.sortCol,u.filterServiceableItemReport.sortDir=u.filter.sortDir,r.getItems("basereports/documentfilter",u.filterServiceableItemReport).then(function(){u.serviceableItemMeta=r.state.itemsMeta,u.items=r.state.items,u.items.length>0?u.buttonDisabled=!1:u.buttonDisabled=!0}),setTimeout(function(){u.isLoading=!1,e.$apply()},1e3)}}e.$watch("vm.serviceableItemMeta.Paging",function(e,t){null!=u.serviceableItemMeta.Paging&&(I?I=!1:e.Page!==t.Page&&(u.filter.page=u.serviceableItemMeta.Paging.Page,u.filter.pageSize=u.serviceableItemMeta.Paging.PageSize,S()))},!0)}angular.module("FieldConnectApp").controller("ServiceableItemReportController",e),e.$inject=["$scope","qsService","restService","baseReportService","timezoneService","ModalService","$timeout","deviceDetector","dateService"]}();;!function(){"use strict";function e(e,t,a,r,l,i,o){var n=this;n.isLoading=!1,n.timeCardMeta={},n.selected={},n.buttonDisabled=!0,n.items=[],n.technicianIds=[],n.search=s,n.deviceDetect=o,n.filterTimeCardReport=t.filter("and"),n.exportCSV=function(){n.submitSearch=!0,r.generateCSV("basereports/documentcsv",n.filterTimeCardReport,n.filter.report),n.submitSearch=!1},n.exportPDF=function(){n.submitSearch=!0,r.generatePDF("basereports/documentpdf",n.filterTimeCardReport,n.filter.report),n.submitSearch=!1},n.filter={page:1,pageSize:50,total:0,sortCol:"Date",sortDir:"asc",report:"TimeCard"},n.attributes=[{Name:"Date",ValueName:"Date",FormatDate:"date",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Work Order",ValueName:"AltId",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Address",ValueName:"SiteAddress",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Technician",ValueName:"TechName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Labor Code",ValueName:"LaborCode",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Pay Rate",ValueName:"PayRateName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Work Hour",ValueName:"Hours",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"External Id",ValueName:"ExternalId",Edit:!1,Sortable:!1,CellFormat:"label"}],n.loadingIndicator=!1,n.submitSearch=!1,e.$watch("vm.filter.payPeriodId",function(){void 0!=n.filter.payPeriodId&&a.getItem("companypayperiods",n.filter.payPeriodId).then(function(e){var t=e.data,a=new Date(t.StartDate.replace(/\-/g,"/").replace(/[T|Z]/g," "));i.convertToLocal(a);var r=new Date(t.EndDate.replace(/\-/g,"/").replace(/[T|Z]/g," "));i.convertToLocal(r),n.filter.startDate=a,n.filter.endDate=r})});var d=!0;function s(){if(void 0==n.filter.startDate||void 0==n.filter.endDate||0==n.technicianIds.length)l.warning({message:"You must choose Technician, Start Date and End Date"});else{n.isLoading=!0;for(var t="",r=n.technicianIds,o=0;o!=r.length;o++)t+=r[o]+",";if(t=t.substring(0,t.length-1),n.filter.techIds=t,""!=n.filter.startDate&&null!=n.filter.startDate){n.filter.startDate=new Date(n.filter.startDate),n.filter.startDate.setHours(0,0,0,0);var d=new Date(n.filter.startDate);i.convertToUtc(d),n.selected.startDate=i.buildISOString(d)}else n.selected.startDate=null;if(""!=n.filter.endDate&&null!=n.filter.endDate){n.filter.endDate=new Date(n.filter.endDate),n.filter.endDate.setHours(23,59,59,999);var s=new Date(n.filter.endDate);i.convertToUtc(s),n.selected.endDate=i.buildISOString(s)}else n.selected.endDate=null;n.filterTimeCardReport.reset(),n.filterTimeCardReport.eq("TechIds",n.filter.techIds).ge("StartDate",n.selected.startDate).le("EndDate",n.selected.endDate).eq("Report",n.filter.report),n.filterTimeCardReport.page=n.filter.page,n.filterTimeCardReport.pageSize=n.filter.pageSize,n.filterTimeCardReport.total=n.filter.total,n.filterTimeCardReport.sortCol=n.filter.sortCol,n.filterTimeCardReport.sortDir=n.filter.sortDir,a.getItems("basereports/documentfilter",n.filterTimeCardReport).then(function(){n.timeCardMeta=a.state.itemsMeta,n.items=a.state.items,n.items.length>0?n.buttonDisabled=!1:n.buttonDisabled=!0}),setTimeout(function(){n.isLoading=!1,e.$apply()},1e3)}}e.$watch("vm.timeCardMeta.Paging",function(e,t){null!=n.timeCardMeta.Paging&&(d?d=!1:e.Page!==t.Page&&(n.filter.page=n.timeCardMeta.Paging.Page,n.filter.pageSize=n.timeCardMeta.Paging.PageSize,s()))},!0),n.getLocalTime=function(e){if(null!==e||void 0!==e){var t=i.parseISOString(e);return i.convertToLocal(t)}return null}}angular.module("FieldConnectApp").controller("TimeCardReportController",e),e.$inject=["$scope","qsService","restService","baseReportService","Notification","timezoneService","deviceDetector"]}();;!function(){"use strict";function e(e,t,r,l,o,a,i,s,m){var u=this;function d(){var e="";if(u.filter.customerId)e=angular.copy(u.filter.customerName);else if(u.CustomerNameTemp){e=angular.copy(u.CustomerNameTemp);u.CustomerNameTemp=""}a.showModal({templateUrl:"Templates/Form/selectCustomerForForm.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:u.customer,customerName:e,onSelect:C}}).then(function(e){e.close.then(function(){})})}function c(e){var t="";if(u.filter.siteId)t=angular.copy(u.filter.siteName);else if(u.SiteNameTemp){t=angular.copy(u.SiteNameTemp);u.SiteNameTemp=""}a.showModal({templateUrl:"Templates/Form/selectSiteForForm.html",controller:"SelectSiteController",controllerAs:"vm",inputs:{site:u.site,customerId:u.filter.customerId,siteName:t,onSelect:p}}).then(function(e){e.close.then(function(){})})}u.isLoading=!1,u.workOrderMeta={},u.selected={},u.buttonDisabled=!0,u.items=[],u.search=f,u.filterWorkOrderReport=t.filter("and"),u.exportCSV=function(){u.submitSearch=!0,l.generateCSV("basereports/documentcsv",u.filterWorkOrderReport,u.filter.report),u.submitSearch=!1},u.exportPDF=function(){u.submitSearch=!0,l.generatePDF("basereports/documentpdf",u.filterWorkOrderReport,u.filter.report),u.submitSearch=!1},u.deviceDetect=s,u.dateService=m,u.filter={page:1,pageSize:50,total:0,sortCol:"AltId",sortDir:"asc",workOrdernumber:0,officeId:0,technicianId:0,projectId:0,byDate:1,report:"WorkOrder"},u.customer={customerId:0},u.selectCustomer=d,u.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],u.searchColsSite=["Search"],u.siteAutocompleteFilter=t.filter("or"),u.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}],u.ddlgridattrsSite=[{Name:"Customer",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Site Code",ValueName:"SiteCode",Sortable:!0,CellFormat:"label"},{Name:"Site Name",ValueName:"SiteName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"FullAddress",Sortable:!0,CellFormat:"label"}],u.customerAttribute={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:C,SearchTrigger:1,Label:"Customer:",Required:!1,ApiMethod:"customers/active",ModelValue:"customerName",Id:"CustomerName",GridAttributes:u.ddlgridattrsCustomer,PageSize:22,SearchCols:u.searchColsCustomer},u.siteAttribute={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:p,SearchTrigger:1,Label:"Site:",Required:!1,ApiMethod:"sites/searchgrid",ModelValue:"siteName",filter:u.siteAutocompleteFilter,Id:"SiteName",GridAttributes:u.ddlgridattrsSite,PageSize:22,SearchCols:u.searchColsSite},u.customerBtn={Label:"Search",onClick:d},u.site={siteId:0},u.selectSite=c,u.siteBtn={Label:"Search",onClick:c},u.sitesForCustomer=[],u.attributes=[{Name:"Work Order",ValueName:"AltId",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Project",ValueName:"ProjectId",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Requested",ValueName:"RequestDate",FormatDate:"date",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Promised",ValueName:"PromiseDate",FormatDate:"date",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"WO Type",ValueName:"WoType",Edit:!1,Sortable:!1,CellFormat:"label"},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!1,CellFormat:"label"}],u.loadingIndicator=!1,u.submitSearch=!1,u.focusOut=function(e){"customer"===e?(u.CustomerNameTemp=angular.copy(u.filter.customerName),null==u.filter.customerId&&(u.filter.customerName=null)):"site"===e&&(u.SiteNameTemp=angular.copy(u.filter.siteName),null==u.filter.siteId&&(u.filter.siteName=null))},e.$on("CustomerNameSearching",function(e,t){u.filter.customerId=null,u.filter.siteId=null,u.filter.siteName=null,u.SiteNameTemp=null,u.siteAutocompleteFilter.reset()}),e.$on("SiteNameSearching",function(e,t){u.filter.siteId=null});var n=!0;function f(){if(void 0!==u.filter.startDate){if(!m.validateDate(u.filter.startDate))return}else u.filter.startDate=null;if(void 0!==u.filter.endDate){if(!m.validateDate(u.filter.endDate))return}else u.filter.endDate=null;if(void 0===u.filter.startDate||void 0===u.filter.endDate||m.validateDateRange(u.filter.startDate,u.filter.endDate)){if(u.isLoading=!0,""!=u.filter.startDate&&null!=u.filter.startDate){u.filter.startDate=new Date(u.filter.startDate),u.filter.startDate.setHours(0,0,0,0);var t=new Date(u.filter.startDate);o.convertToUtc(t),u.selected.startDate=o.buildISOString(t)}else u.selected.startDate=null;if(""!=u.filter.endDate&&null!=u.filter.endDate){u.filter.endDate=new Date(u.filter.endDate),u.filter.endDate.setHours(23,59,59,999);var l=new Date(u.filter.endDate);o.convertToUtc(l),u.selected.endDate=o.buildISOString(l)}else u.selected.endDate=null;u.filterWorkOrderReport.reset(),u.filterWorkOrderReport.eq("AltId",u.filter.workOrdernumber).eq("ProjectId",u.filter.projectId).eq("TechId",u.filter.technicianId).eq("CustomerId",u.filter.customerId).eq("SiteId",u.filter.siteId).eq("OfficeId",u.filter.officeId).eq("WoType",u.filter.woTypeName).eq("Status",u.filter.woStatusName).eq("StartDate",u.selected.startDate).eq("EndDate",u.selected.endDate).eq("ByDate",u.filter.byDate).eq("Report",u.filter.report),u.filterWorkOrderReport.page=u.filter.page,u.filterWorkOrderReport.pageSize=u.filter.pageSize,u.filterWorkOrderReport.total=u.filter.total,u.filterWorkOrderReport.sortCol=u.filter.sortCol,u.filterWorkOrderReport.sortDir=u.filter.sortDir,r.getItems("basereports/documentfilter",u.filterWorkOrderReport).then(function(){u.workOrderMeta=r.state.itemsMeta,u.items=r.state.items,u.items.length>0?u.buttonDisabled=!1:u.buttonDisabled=!0}),setTimeout(function(){u.isLoading=!1,e.$apply()},1e3)}}function C(e){u.filter.customerId=e.Id,e.CustomerCode&&""!=e.CustomerCode?u.filter.customerName=e.CustomerCode+" - "+e.CustomerName:u.filter.customerName=e.CustomerName,u.filter.siteName="",u.tmpFilter=t.filter("and"),u.tmpFilter.eq("CustomerId",e.Id),u.siteAutocompleteFilter.reset(),u.siteAutocompleteFilter.eq("CustomerId",u.filter.customerId),r.getItems("sites",u.tmpFilter).then(function(){u.sitesForCustomers=r.state.items;for(var e=0;e<u.sitesForCustomers.length;e++)u.sitesForCustomer.push(u.sitesForCustomers[e].Id)})}function p(t){t.SiteCode&&""!=t.SiteCode?u.filter.siteName=t.SiteCode+" - "+t.SiteName:u.filter.siteName=t.SiteName,u.SiteNameTemp=u.filter.siteName,u.filter.siteId=t.Id,(!u.filter.customerId||0===u.filter.customerId&&t.CustomerId)&&r.getItem("customers/",t.CustomerId).then(function(t){var r=t.data;r.CreditHold?bootbox.confirm("The customer "+r.CustomerName+" is on credit hold!",function(t){i(function(){t?(u.filter.customerId=r.Id,u.siteAutocompleteFilter.reset(),u.siteAutocompleteFilter.eq("CustomerId",r.Id),r.CustomerCode&&""!=r.CustomerCode?u.filter.customerName=r.CustomerCode+" - "+r.CustomerName:u.filter.customerName=r.CustomerName,u.CustomerNameTemp=u.filter.siteName):(vvm.filter.siteName=null,u.SiteNameTemp=null,u.filter.siteId=null),e.$apply()})}):(u.filter.customerId=r.Id,u.siteAutocompleteFilter.reset(),u.siteAutocompleteFilter.eq("CustomerId",r.Id),r.CustomerCode&&""!=r.CustomerCode?u.filter.customerName=r.CustomerCode+" - "+r.CustomerName:u.filter.customerName=r.CustomerName,u.CustomerNameTemp=u.filter.siteName)})}e.$watch("vm.workOrderMeta.Paging",function(e,t){null!=u.workOrderMeta.Paging&&(n?n=!1:e.Page!==t.Page&&(u.filter.page=u.workOrderMeta.Paging.Page,u.filter.pageSize=u.workOrderMeta.Paging.PageSize,f()))},!0)}angular.module("FieldConnectApp").controller("WorkOrderReportController",e),e.$inject=["$scope","qsService","restService","baseReportService","timezoneService","ModalService","$timeout","deviceDetector","dateService"]}();;!function(){"use strict";function e(e,a,t,r,o,i,l,n,u,s,m,c,d,p){var y=this;y.goHome=function(){t.go("home")},y.submit=function(e){if(0==e.Id&&1==e.Active)return l.create("companyfeatures",e).then(function(a){return c.success({message:"Feature has been successfully updated."}),e.Id=a.data.Id,y.loadTable=!1,e});if(0!=e.Id&&1==e.Active)return l.update("companyfeatures/"+e.Id,e).then(function(){return c.success({message:"Feature has been successfully updated."}),y.loadTable=!1,e});if(0!=e.Id||null==e.Id&&0==e.Active){var a=p.defer();return bootbox.confirm("Are you sure that you want to disable "+e.FeatureName+" Feature?",function(t){t?l.remove("companyfeatures",e.Id).then(function(){c.success({message:"Feature has been successfully disabled."}),y.loadTable=!1,a.resolve(e),e.Id=0}):a.resolve()}),a.promise}c.warning({message:"First, you must add Feature."})},y.searchCompanies=function(){y.filterCompany.reset();var e="";e="%"+y.searchCompaniesText+"%",y.filterCompany.like("CompanyName",e)},y.filterFeatures=r.filter("and"),y.filterCompany=r.filter("and"),y.childFilter=r.filter("and"),y.childFilter.eq("FeatureId",0),y.companyID=0,y.loadingData=!1,y.reloadTable=!1,y.searchCompaniesText="",y.searchFeaturesText="",y.attributesCompany=[{Name:"Company Name",ValueName:"CompanyName",Edit:!1,Sortable:!0},{Name:"Email",ValueName:"Email",Edit:!1,Sortable:!0},{Name:"Address",ValueName:"Address",Edit:!1,Sortable:!0},{Name:"City",ValueName:"City",Edit:!1,Sortable:!0},{Name:"Country",ValueName:"Country",Edit:!1,Sortable:!0},{Name:"Subcontractor",ValueName:"Subcontractor",Edit:!1,Sortable:!0,CellFormat:"checkbox"}],y.attributesFeature=[{Type:"label",Name:"Feature Name",ValueName:"FeatureName",Sortable:!0},{Type:"editable",Name:"Has Feature",Value:"Active",ValueName:"FeatureName"}],y.attributesParameter=[{Type:"label",Name:"Parameter Name",ValueName:"ParameterName",Sortable:!0},{Type:"label",Name:"Description",ValueName:"Description",Sortable:!0},{Type:"editable",Name:"Value",Value:"Value",ValueName:"ParameterName"}],e.$watch("vm.companyID",function(){if(void 0!=y.companyID&&0!=y.companyID&&null!=y.companyID){if(y.filterFeatures.reset(),y.filterFeatures.eq("companyid",y.companyID),y.searchFeaturesText){var e;e="%"+y.searchCompaniesText+"%",y.filterFeatures.like("search",e)}y.childFilter.reset(),y.childFilter.eq("FeatureId",0),y.childFilter.eq("CompanyId",y.companyID),y.reloadTable=!1,n(function(){y.reloadTable=!0})}})}angular.module("FieldConnectApp").controller("CompanyFeatureController",e),e.$inject=["$scope","$location","$state","qsService","timezoneService","stateTransitionService","restService","$timeout","$http","ngAuthSettings","cryptoStorageService","Notification","$window","$q"]}();;!function(){"use strict";function e(e,t,i,n,c,o,d,l,a){var r=this;function s(){r.reloadTable=!1,t(function(){r.reloadTable=!0})}r.id=d.id,r.$state=l,r.isReadOnly=!1,r.isConverted=!1,r.model={},r.deficiencyService=new c(r.model),r.noteModel={DeficiencyId:r.id},r.attachmentModel={DeficiencyId:r.id},r.isLoading=!0,r.reloadTable=!1,r.deficiencyFilter=i.filter("and"),r.deficiencyFilter.eq("DeficiencyId",r.id),r.onBack=function(e){l.go("manageDeficiency")},r.deficiencyService.getConversionStatusNameId().then(function(e){r.conversionStatusId=e,r.conversionStatusId&&r.deficiencyService.setStatusFilterId(r.conversionStatusId),r.editAttributes=r.deficiencyService.getDeficiencyEditAttributes(),r.noteAttributesGrid=r.deficiencyService.getDeficiencyNotesGridAttributes(),r.attachmentAttributesGrid=r.deficiencyService.getDeficiencyAttachmentsGridAttributes()}),e.$watch("vm.model.Id",function(t,i){t&&(r.model.Converted?(r.deficiencyService.setStatusReadOnlyFlag(!0),r.deficiencyService.setFieldsReadOnlyFlag(!0),r.deficiencyService.setStatusFilterId(null),r.isConverted=r.model.Converted,r.isReadOnly=r.model.Converted):r.conversionStatusId&&r.model.StatusId!==r.conversionStatusId&&(r.deficiencyService.setStatusFilterId(r.conversionStatusId),r.isReadOnly=r.deficiencyService.setStatusAction(r.model.StatusId)),r.siteId?r.isLoading=!1:o.getItem("wodetails",r.model.WoId).then(function(e){r.siteId=e.data.SiteId,r.deficiencyService.setSiteFilterId(r.siteId)}).then(function(){s(),e.$watch("vm.model.StatusId",function(e,t){if(e&&e!==t)r.deficiencyService.performStatusAction(e)}),r.isLoading=!1},function(e){r.isLoading=!1}))}),r.editNote=function(i){r.isConverted||r.isReadOnly?a.error("The Deficiency Note cannot be edited!"):(n.showModal({templateUrl:"Templates/Utils/popupEditMini.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Deficiency Note edit",id:i,model:r.noteModel,attributes:r.deficiencyService.getDeficiencyNotesEditAttributes(),apiMethod:"deficiencyNote",moduleName:r.moduleName,viewName:r.viewName}}).then(function(e){e.close.then(function(){s()})}),e.$watch("vm.noteModel.NoteTemp",function(e,i){t(e?function(){r.noteModel.Note=e}:function(){r.noteModel.Note=null})}))},r.editAttachment=function(e){n.showModal({templateUrl:"Templates/Utils/popupEditMini.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Deficiency Attachment edit",id:e,model:r.attachmentModel,attributes:r.deficiencyService.getDeficiencyAttachmentsEditAttributes(),apiMethod:"deficiencyAttachment",moduleName:r.moduleName,viewName:r.viewName}}).then(function(e){e.close.then(function(){s()})})}}angular.module("FieldConnectApp").controller("DeficiencyEditController",e),e.$inject=["$scope","$timeout","qsService","ModalService","deficiencyService","restService","$stateParams","$state","Notification"]}();;!function(){"use strict";function e(e,t,r,l,a,o,i,m,d,s,u,n,c,S,f){var C=this;function I(e){e.Converted?u.error("The Deficiency has already been converted to a Quote!"):C.quoteStatusSet?t.path("newQuote").search({isDeficiency:"true",DeficiencyId:e.Id}):u.error("Company Setting error: Status used when converting to a Quote is not set! Deficiency cannot be converted.")}function N(){if(void 0!==C.filtermodel.StartDate){if(!S.validateDate(C.filtermodel.StartDate))return}else C.filtermodel.StartDate=null;if(void 0!==C.filtermodel.EndDate){if(!S.validateDate(C.filtermodel.EndDate))return}else C.filtermodel.EndDate=null;if(void 0===C.filtermodel.StartDate||void 0===C.filtermodel.EndDate||S.validateDateRange(C.filtermodel.StartDate,C.filtermodel.EndDate)){if(C.isLoading=!0,C.loadData=!1,""!=C.filtermodel.StartDate&&null!=C.filtermodel.StartDate){C.filtermodel.StartDate=new Date(C.filtermodel.StartDate),C.filtermodel.StartDate.setHours(0,0,0,0);var e=new Date(C.filtermodel.StartDate);m.convertToUtc(e);var t=m.buildISOString(e)}if(""!=C.filtermodel.EndDate&&null!=C.filtermodel.EndDate){C.filtermodel.EndDate=new Date(C.filtermodel.EndDate),C.filtermodel.EndDate.setHours(23,59,59,999);var l=new Date(C.filtermodel.EndDate);m.convertToUtc(l);var a=m.buildISOString(l)}C.filterDeficiencies.reset(),C.filterDeficiencies.ge("SysCreateUTC",t).le("SysCreateUTC",a).eq("CustomerId",C.filtermodel.CustomerId).eq("SiteId",C.filtermodel.SiteId).eq("serviceableItemId",C.filtermodel.ServiceableItemId).eq("StatusId",C.filtermodel.StatusId).eq("SeverityId",C.filtermodel.SeverityId),C.loadData=!0;var o={};C.filtermodel.CustomerId&&(o.CustomerId=C.filtermodel.CustomerId,o.CustomerInfo=C.CustomerInfo),C.filtermodel.SiteId&&(o.SiteId=C.filtermodel.SiteId,o.SiteInfo=C.SiteInfo),C.filtermodel.StartDate&&(o.StartDate=m.buildISOString(C.filtermodel.StartDate)),C.filtermodel.EndDate&&(o.EndDate=m.buildISOString(C.filtermodel.EndDate)),C.filtermodel.ServiceableItemId&&(o.ServiceableItemId=C.filtermodel.ServiceableItemId),C.filtermodel.ServiceRequestStatusId&&(o.ServiceRequestStatusId=C.filtermodel.ServiceRequestStatusId);var i={};d.getValue("lastselection_"+C.UserData.Id)&&(i=d.getValue("lastselection_"+C.UserData.Id)),i.manageDeficiency=o,d.setValue("lastselection_"+C.UserData.Id,i),setTimeout(function(){C.isLoading=!1,r.$apply()},1e3)}}function D(){var e="";C.filtermodel.CustomerId?e=angular.copy(C.filtermodel.CustomerName):C.CustomerNameTemp&&(e=angular.copy(C.CustomerNameTemp),C.CustomerNameTemp=""),n.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectCustomer.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:C.customer,onSelect:p,customerName:e}})}function p(e){C.CustomerInfo=e,e.CustomerCode&&""!=e.CustomerCode?C.filtermodel.CustomerName=e.CustomerCode+" - "+e.CustomerName:C.filtermodel.CustomerName=e.CustomerName,C.filtermodel.CustomerId=e.Id,C.filtermodel.SiteId=null,C.filtermodel.SiteName=null,C.siteAutocompleteFilter.reset(),C.siteAutocompleteFilter.eq("CustomerId",e.Id)}function v(){var e="";C.filtermodel.SiteId?e=angular.copy(C.filtermodel.SiteName):C.SiteNameTemp&&(e=angular.copy(C.SiteNameTemp),C.SiteNameTemp=""),n.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectSite.html",controller:"SelectSiteController",controllerAs:"vm",inputs:{site:C.site,customerId:C.filtermodel.CustomerId,onSelect:b,siteName:e}})}function b(t){C.SiteInfo=t,t.SiteCode&&""!=t.SiteCode?C.filtermodel.SiteName=t.SiteCode+" - "+t.SiteName:C.filtermodel.SiteName=t.SiteName,C.filtermodel.SiteId=t.Id,(!C.filtermodel.CustomerId||0===C.filtermodel.CustomerId&&t.CustomerId)&&e.getItem("customers/",t.CustomerId).then(function(e){var t=e.data;t.CreditHold?bootbox.confirm("The customer "+t.CustomerName+" is on credit hold!",function(e){l(function(){e?(C.filtermodel.CustomerId=t.Id,C.siteAutocompleteFilter.reset(),C.siteAutocompleteFilter.eq("CustomerId",t.Id),t.CustomerCode&&""!=t.CustomerCode?C.filtermodel.CustomerName=t.CustomerCode+" - "+t.CustomerName:C.filtermodel.CustomerName=t.CustomerName,C.CustomerNameTemp=C.model.CustomerName):(C.filtermodel.SiteName=null,C.SiteNameTemp=null,C.filtermodel.SiteId=null),r.$apply()})}):(C.filtermodel.CustomerId=t.Id,t.CustomerCode&&""!=t.CustomerCode?C.filtermodel.CustomerName=t.CustomerCode+" - "+t.CustomerName:C.filtermodel.CustomerName=t.CustomerName,C.CustomerNameTemp=C.model.CustomerName,C.siteAutocompleteFilter.reset(),C.siteAutocompleteFilter.eq("CustomerId",t.Id))})}C.model={},C.filtermodel={},C.$state=a,C.loadData=!1,C.isLoading=!0,C.reloadData=N,C.focusOut=function(e){e&&e.hasOwnProperty("FocusOut")&&e.FocusOut&&("CustomerName"===e.ModelValue&&(C.CustomerNameTemp=angular.copy(C.filtermodel.CustomerName),null==C.filtermodel.CustomerId&&(C.filtermodel.CustomerName=null)),"SiteName"===e.ModelValue&&(C.SiteNameTemp=angular.copy(C.filtermodel.SiteName),null==C.filtermodel.SiteId&&(C.filtermodel.SiteName=null)))},C.customer={customerId:0},C.customers=[],C.site={siteId:0},C.filter={customerId:null,siteId:null,serviceableItemId:null,statusId:null},C.siteAutocompleteFilter=i.filter("or"),C.filterServiseableItems=i.filter("and"),C.filterDeficiencies=i.filter("and"),C.filterSites=i.filter("and"),C.filterBySite=i.filter("and"),C.filterBySite.eq("SiteId",0),C.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],C.searchColsSite=["Search"],C.deficiencyService=new f,C.quoteStatusSet=!1,C.deficiencyService.getConversionStatusNameId().then(function(e){e?C.quoteStatusSet=!0:u.error("Company Setting error: Status used when converting to a Quote is not set!")}),c.getCurrentUserData().then(function(e){C.UserData=e;var t=d.getValue("lastselection_"+C.UserData.Id);if(t&&t.manageDeficiency)t.manageDeficiency.StartDate&&(C.startDate=m.parseISOString(t.manageDeficiency.StartDate)),t.manageDeficiency.EndDate&&(C.endDate=m.parseISOString(t.manageDeficiency.EndDate));else{var l=new Date;l.setDate(l.getDate()-30),C.startDate=new Date(l),C.endDate=new Date}!function(){C.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}],C.ddlgridattrsSite=[{Name:"Customer",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Site Code",ValueName:"SiteCode",Sortable:!0,CellFormat:"label"},{Name:"Site Name",ValueName:"SiteName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"FullAddress",Sortable:!0,CellFormat:"label"}],C.filterCustomer={Type:"dropdowngridbutton",FocusOut:!0,ReadOnly:!1,ShowHeader:!0,onSelect:p,SearchTrigger:1,Label:"Customer:",Required:!1,ApiMethod:"customers/active",ModelValue:"CustomerName",Id:"CustomerName",GridAttributes:C.ddlgridattrsCustomer,PageSize:22,SearchCols:C.searchColsCustomer,Autofocus:"true",TabIndex:1,onClick:D},C.filterSite={Type:"dropdowngridbutton",FocusOut:!0,ReadOnly:!1,ShowHeader:!0,onSelect:b,SearchTrigger:1,Label:"Site:",Required:!1,ApiMethod:"sites/searchgrid",ModelValue:"SiteName",filter:C.siteAutocompleteFilter,Id:"SiteName",GridAttributes:C.ddlgridattrsSite,PageSize:22,SearchCols:C.searchColsSite,TabIndex:2,onClick:v},C.filterStatus={Type:"dropdown",Label:"Status:",ApiMethod:"deficiencyStatus",ValueProp:"Id",TextProp:"StatusName",ModelValue:"StatusId"},C.attributesFilter=[C.filterCustomer,{Type:"datepicker",Label:"Start Date:",ModelValue:"StartDate",Format:"MM/dd/yyyy",SubType:"date",DefaultValue:!0},C.filterSite,{Type:"datepicker",Label:"End Date:",ModelValue:"EndDate",Format:"MM/dd/yyyy",SubType:"date",DefaultValue:!0},{Type:"dropdown",Label:"Serviceable Item:",ApiMethod:"serviceableitems",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",Filter:C.filterBySite},C.filterStatus,{Type:"dropdown",Label:"Severity:",Required:!1,ApiMethod:"deficiencySeverity/ddList",ValueProp:"Id",TextProp:"SeverityName",ModelValue:"SeverityId",ConvertToInt:!0,ReadOnly:!1}],C.attributes=[{Name:"Create Date",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"Work Order",ValueName:"AltId",Edit:!1,Sortable:!0},{Name:"Quote",ValueName:"QuoteAltId",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Description",Edit:!0,Sortable:!0},{Name:"Severity",ValueName:"SeverityName",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"StatusName",Edit:!1,Sortable:!0},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!1,Sortable:!0},{Name:"Created by",ValueName:"SysCreatorName",Edit:!1,Sortable:!0},{Name:"Action",CellFormat:"template",CellFormatData:{TemplateUrl:"cancelDeficiencyView.html",onProcess:I}}];var e=['<button class="btn btn-default" ng-click="attr.CellFormatData.onProcess(item)" ng-if="item.StatusAction == \'OPEN\' && item.Converted == false">Convert</button>'].join("");s.put("cancelDeficiencyView.html",e)}();var a=r.$watch("vm.filtermodel.StartDate",function(){C.filtermodel.StartDate&&(C.filtermodel.StartDate=C.startDate,C.filtermodel.EndDate=C.endDate,N(),a())})}),C.edit=function(e){a.go("deficiencyEdit",{id:e.Id})},r.$watch("vm.filter.customerId",function(){C.filter.siteId=null,C.filter.serviceableItemId=null,C.filterSites.reset(),C.filterServiseableItems.reset(),C.filter.customerId&&(C.filterSites.eq("CustomerId",C.filter.customerId),C.filterServisableItems.eq("CustomerId",C.filter.customerId))}),r.$watch("vm.filter.siteId",function(){C.filter.serviceableItemId=null,C.filterServiseableItems.reset(),C.filter.siteId&&C.filterServiseableItems.eq("CustomerId",C.filter.customerId).eq("SiteId",C.filter.siteId)}),r.$watch("vm.customer.customerId",function(){null!=C.customer.customerId&&C.customer.customerId>0&&C.filtermodel.CustomerId!=C.customer.customerId&&(C.filtermodel.CustomerId=C.customer.customerId,C.siteAutocompleteFilter.reset(),C.siteAutocompleteFilter.eq("CustomerId",C.customer.customerId)),C.filterBySite.eq("SiteId",0)}),r.$watch("vm.filtermodel.SiteId",function(){C.filtermodel.SiteId&&(C.filterBySite.reset(),C.filterBySite.eq("SiteId",C.filtermodel.SiteId))})}angular.module("FieldConnectApp").controller("ManageDeficiencyController",e),e.$inject=["restService","$location","$scope","$timeout","$state","$stateParams","qsService","timezoneService","cryptoStorageService","$templateCache","Notification","ModalService","currentUserService","dateService","deficiencyService"]}();;!function(){"use strict";function e(e,a,t,n,s,r,i,d,o,l,c,u,g,h,m,p,f,D,I,v,C){var w=this,b=245,S=$(window).width(),A=80;function y(){b>30&&(b=245);var e=S-A-b;$("#unassigned-grid-wrapper").css("height",w.unassignedGridHeight),$("#unassignedGridList").css("height",w.unassignedGridHeight),$("#unassignedGrid").css("width",e)}w.unassignedGridHeight="205",w.calendarTimeHeaderCellDuration=60,w.calendarCellDuration=30,$("#unassigned-grid-wrapper").css("height",w.unassignedGridHeight),$("#unassignedGridList").css("height",w.unassignedGridHeight),$(window).resize(function(){S=$(window).width(),y()}),a.$on("sidebar-resize",function(e){b=e.targetScope.sidebarWidth,B(),y()}),w.$state=n,w.calendarDate=new Date,w.calendarInstance=null,w.currentCalendarView="day",w.deviceDetect=h,w.filterTab="Techs",w.filterAssigned={assignmentStatusIds:"",workOrderTypeIds:"",workOrderStatusIds:"",problemCodeIds:"",officeIds:"",technicianIds:""},w.unformatedFilterAssigned={assignmentStatusIds:[],workOrderTypeIds:[],workOrderStatusIds:[],problemCodeIds:[],officeIds:[]},w.techsFilter={groupIds:""},w.calendarTechsFilter={techIds:"",groupIds:""},w.laborGroups=[],w.techs=[],w.technicianIds=[],w.calendarAssignments=[],w.calendarAssignmentEvents=[],w.unassignments=[],w.laborGroupList=[],w.laborGroupsLoaded=!1,w.initialLaborGroupsSelected=!1,w.initialTechsLoaded=!1,w.loadingData=!1,w.getAssignedTech=k,w.clearFilters=function(){w.filterAssigned={assignmentStatusIds:"",workOrderTypeIds:"",workOrderStatusIds:"",problemCodeIds:"",officeIds:""},w.unformatedFilterAssigned={assignmentStatusIds:[],workOrderTypeIds:[],workOrderStatusIds:[],problemCodeIds:[],officeIds:[]},w.technicianIds=[],w.laborGroups=[],k()},w.changeView=H,w.searchDate=W,w.goPrevDay=function(){var e=new Date(w.calendarDate);"month"==w.currentCalendarView?w.calendarDate=e.setMonth(e.getMonth()-1):w.calendarDate=e.setDate(e.getDate()-1);W()},w.goNextDay=function(){var e=new Date(w.calendarDate);"month"==w.currentCalendarView?w.calendarDate=e.setMonth(e.getMonth()+1):w.calendarDate=e.setDate(e.getDate()+1);W()},w.goToday=function(){w.calendarDate=new Date,W()},w.UserData={},w.calendarConfig={businessBeginsHour:8,businessEndsHour:17};var T=i.filter("and");function M(e){if(e)w.calendarInstance=new DayPilot.Month("daypilot-month"),w.calendarInstance.contextMenu=new DayPilot.Menu([{text:"Unassign",onclick:function(){P(this.source.value())}}]),w.calendarInstance.onEventMoved=G,w.calendarInstance.onEventClicked=F,w.calendarInstance.showToolTip=!0,w.calendarInstance.bubble=new DayPilot.Bubble,w.calendarInstance.bubble.zIndex=1e4,w.calendarInstance.onBeforeEventRender=O,w.calendarInstance.cssOnly=!0,w.calendarInstance.theme=w.settings.MonthlyCalendarThemeIdentifier,w.calendarInstance.init();else{if(w.showChart)return w.calendarInstance=new DayPilot.Scheduler("daypilot-calendar"),w.calendarInstance.timeHeaders=[{groupBy:"Month"},{groupBy:"Day",format:"dddd d"},{groupBy:"Hour",format:"h tt"}],w.calendarInstance.cssOnly=!0,w.calendarInstance.viewType="Resources",w.calendarInstance.headerLevels=2,w.calendarInstance.contextMenu=new DayPilot.Menu([{text:"Unassign",onclick:function(){P(this.source.value())}}]),w.calendarInstance.onEventMoved=V,w.calendarInstance.onEventResized=G,w.calendarInstance.onEventClicked=F,w.calendarInstance.cellWidthSpec="Auto",w.calendarInstance.theme=w.settings.ChartThemeIdentifier,w.calendarInstance.heightSpec="Parent100Pct",w.calendarInstance.init(),void t(function(){var e=$(".scheduler_default_event").closest("tr").find("td");e.css("min-width","100px"),$(".scheduler_default_now").closest("tr").find("td").css("min-width","100px")});w.calendarInstance=new DayPilot.Calendar("daypilot-calendar"),w.calendarInstance.cssOnly=!0,w.calendarInstance.viewType="Resources",w.calendarInstance.headerLevels=2,w.calendarInstance.contextMenu=new DayPilot.Menu([{text:"Unassign",onclick:function(){P(this.source.value())}}]),w.calendarInstance.onEventMoved=V,w.calendarInstance.onEventResized=G,w.calendarInstance.onEventClicked=F,w.calendarInstance.columnWidth=100,w.calendarInstance.heightSpec="Parent100Pct",w.calendarInstance.timeHeaderCellDuration=w.calendarTimeHeaderCellDuration,w.calendarInstance.cellDuration=w.calendarCellDuration,w.calendarInstance.businessBeginsHour=w.calendarConfig.businessBeginsHour,w.calendarInstance.businessEndsHour=w.calendarConfig.businessEndsHour,w.calendarInstance.theme=w.settings.CalendarThemeIdentifier,w.calendarInstance.fontSize=8,w.calendarInstance.init(),t(function(){$(".calendar_default_event").closest("tr").find("td").css("min-width","100px"),$(".calendar_default_now").closest("tr").find("td").css("min-width","100px")})}}function P(a){for(var t=0;t!==w.calendarAssignments.length;t++)if(a===w.calendarAssignments[t].Id){w.workOrder=w.calendarAssignments[t];break}"Assigned"===w.workOrder.Status?bootbox.confirm("Are you sure that you want to unassign the Assignment for WO#"+w.workOrder.AltId+"?",function(t){t&&e.update("woassignments/unassign/"+a).then(function(t){U.RecordId=a,U.Note="Assignment for WO#"+w.workOrder.AltId+" has been unassigned",function(a){a.TableName="WoAssignment",a.ParentRecordId=w.workOrder.Id,C.getLocation("WoForm").then(function(t){a.Latitude=t.coords.latitude,a.Longitude=t.coords.longitude,e.create("events",a).then(function(){})})}(U);var n="Assignment for WO#"+w.workOrder.AltId+" has been unassigned";_(),k(),e.getItems("woassignments/unassigned").then(function(e){w.unassignments=e.data.Data}),o.success({message:n})})}):o.warning({message:'Only Assignments with a status of "Assigned" can be unassigned!'})}T.eq("AssignmentStatusName","Assigned"),e.getItems("assignmentstatuscolors",T).then(function(e){w.assignedColor=null,e.data.Data.length>0&&(w.assignedColor=e.data.Data[0].ColorCode)}),w.gridHeader=[{field:"AltId",data:"Work Order",pid:"colDispWorkOrder"},{field:"WoType",data:"WO Type",pid:"colDispWOType"},{field:"Priority",data:"Priority",pid:"colDispPriority"},{field:"Desc",data:"Description",pid:"colDispDesc"},{field:"WoDesc",data:"WO Description",pid:"colDispWoDesc"},{field:"PromiseDate",data:"Promised Date",pid:"colDispPromiseDate",FormatDate:!0},{field:"RequestDate",data:"Requested Date",pid:"colDispRequestDate",FormatDate:!0},{field:"CustomerName",data:"Customer",pid:"colDispCustomer"},{field:"SiteName",data:"Site",pid:"colDispSite"},{field:"Address",data:"Full Address",pid:"colDispAddress"},{field:"Address1",data:"Address",pid:"colDispSiteAddress1"},{field:"Address2",data:"Address2",pid:"colDispSiteAddress2"},{field:"City",data:"City",pid:"colDispSiteCity"},{field:"StateCode",data:"State",pid:"colDispSiteStateCode"},{field:"PostalCode",data:"Postal Code",pid:"colDispSitePostalCode"},{field:"Country",data:"Country",pid:"colDispSiteCountry"},{field:"WOStatus",data:"WO Status",pid:"colDispWOStatus"},{field:"ProblemCode",data:"Problem",pid:"colDispProblem"},{field:"Status",data:"Assign Status",pid:"colDispAssignStatus"},{field:"EstHours",data:"Duration",pid:"colDispDuration"},{field:"TechFullName",data:"Technician",pid:"colDispTechnician"},{field:"Office",data:"Office",pid:"colDispOffice"},{field:"Agreement",data:"Agreement",pid:"colDispAgreement"}],w.viewName="DispatchBoard",w.moduleName="DispatchUnassignedGrid",m.loadObjectPrivileges(w.viewName,w.moduleName),w.hideCol=function(e){return 0!=m.getObjectPrivilege(e)},w.showUnassignedFlag=!0,w.showUnscheduledFlag=!0,w.refreshTable=!1,w.fromDate=null,w.toDate=null,w.sortCol=null,w.showChart=!1,w.expandCalendar=!1,w.showUnassigned=function(){w.showUnassignedFlag=0==w.showUnassignedFlag},w.showUnscheduled=function(){w.showUnscheduledFlag=0==w.showUnscheduledFlag},w.sort=function(e){w.sortCol!=e&&(w.sortCol=e),w.sortKey=e,w.reverse=!w.reverse},w.enableCalDnD=function(e,a){return w.showChart?DayPilotScheduler.dragStart(null,60*e*60,a):DayPilotCalendar.dragStart(null,60*e*60,a)},w.enableCalClick=function(e,a){DayPilotScheduler.dragStop(),w.setTransitionState(),n.go("assignmentDetails",{id:e,assId:a})},a.unassignedFilter=function(e){return!(!w.showUnassignedFlag||!w.showUnscheduledFlag)||(w.showUnassignedFlag?null==e.TechFullName:w.showUnscheduledFlag?null!=e.TechFullName:void 0)},a.dateFilter=function(e){if(!w.fromDate&&!w.toDate)return e;if(w.fromDate&&w.toDate){var a=moment(w.fromDate).subtract(1,"days");if(moment(e.PromiseDate).isBetween(a,w.toDate))return e}else if(w.fromDate){if(moment(e.PromiseDate).isAfter(w.fromDate,"day")||moment(e.PromiseDate).isSame(w.fromDate,"day"))return e}else if(w.toDate&&(moment(e.PromiseDate).isBefore(w.toDate,"day")||moment(e.PromiseDate).isSame(w.toDate,"day")))return e},w.mapVisible=!1,w.tmpMapVisible=!1,w.unassignedListVisible=!0,w.tmpUnassignedListVisible=!0,w.usingGeoCodeFarm=!1,w.usingGoogleMaps=!1,w.markers=[],w.bounds=[],e.getItems("dispatchCalendarSettings").then(function(n){w.settings=n.data.Data[0],w.settings.ShowMap&&($("#daypilot-calendar").css("width","60%").css("float","left"),$("#dispatch-map").removeClass("hidden"),$("#button-map").addClass("active"),w.mapVisible=w.settings.ShowMap),w.settings.HideSidePanel&&a.$broadcast("hide-sidebar",w.settings.HideSidePanel),0!==w.settings.UnassignedGridHeight&&(w.unassignedGridHeight=w.settings.UnassignedGridHeight),null!==w.settings.UnassignedGridSortColumn&&(w.sortCol=w.settings.UnassignedGridSortColumn,w.sortKey=w.settings.UnassignedGridSortColumn),null!==w.settings.UnassignedGridSortDirection&&(w.reverse=!1,"desc"===w.settings.UnassignedGridSortDirection&&(w.reverse=!0)),w.calendarTimeHeaderCellDuration=w.settings.CalendarTimeHeaderCellDuration,w.calendarCellDuration=w.settings.CalendarCellDuration,y(),function(){var a=r.popTransitionParam("workOrdersDetails");a&&(w.fromDate=a.navBackData.fromDate,w.toDate=a.navBackData.toDate,w.showUnassignedFlag=a.navBackData.showUnassignedFlag,w.showUnscheduledFlag=a.navBackData.showUnscheduledFlag);var n=r.popTransitionParam("dispatchCalendar");n&&(r.selectiveExtend(w,n,["calendarDate","currentCalendarView","filterAssigned","filterAssigned","techsFilter","fromDate","toDate","showUnassignedFlag","showUnscheduledFlag"]),w.unformatedFilterAssigned=n.unformatedFilterAssigned,w.laborGroups=n.laborGroups,t(function(){w.filterTab=n.filterTab}));M(),e.getItems("woassignments/unassigned").then(function(e){w.unassignments=e.data.Data})}()}),a.$watch("vm.laborGroupsLoaded",function(){w.laborGroupsLoaded&&u.getCurrentUserData().then(function(e){w.UserData=e;var a=c.getValue("lastselection_"+w.UserData.Id);if(a&&a.dispatch&&a.dispatch.laborGroups.length>0)for(var t=0;t<a.dispatch.laborGroups.length;t++)w.laborGroups.push(a.dispatch.laborGroups[t]);else w.laborGroupList.length>0&&w.laborGroups.push(w.laborGroupList[0].Id);w.techsFilter.groupIds=x(w.laborGroups),w.technicianIds=[],w.initialLaborGroupsSelected=!0})}),a.$watch("vm.initialTechsLoaded",function(){w.initialTechsLoaded&&u.getCurrentUserData().then(function(e){w.UserData=e;var a=c.getValue("lastselection_"+w.UserData.Id);if(a&&a.dispatch){w.unformatedFilterAssigned=a.dispatch.unformatedFilterAssigned,w.calendarDate=a.dispatch.calendarDate,w.currentCalendarView=a.dispatch.currentCalendarView;for(var t=0;t<a.dispatch.technicianIds.length;t++)w.technicianIds.push(a.dispatch.technicianIds[t])}k()})}),a.$watch("vm.laborGroups",function(){w.laborGroups&&(g.checkBrowserAgent()?(w.techsFilter.groupIds="0",t(function(){w.techsFilter.groupIds=x(w.laborGroups),w.technicianIds=[],a.$apply()})):(w.techsFilter.groupIds=x(w.laborGroups),w.technicianIds=[]))}),w.setDateFormat=function(e){var a=new Date(e),t=moment.tz.zone(w.authData.tzDatebaseName).offset(a);return d.convertToLocal(a,t),moment(a).format("MM/DD/YYYY h:mm A")+" "+w.userTimeZone},w.authData=c.getValue("authorizationData"),w.userTimeZone=moment.tz(w.authData.tzDatebaseName).zoneAbbr(),w.sorkKey="";var U={EventType:"UNASSIGNED",RecordId:0};function O(e){e.e.html="<div style='display:inline-block;overflow:hidden;height:100%;background-color:#F8F8F8'>"+e.e.text+"</div>",e.e.backColor=e.e.borderColor}function F(e){for(var a=e.e.id(),t=0;t!=w.calendarAssignments.length;t++)a==w.calendarAssignments[t].Id&&(w.WoId=w.calendarAssignments[t].WoId);w.setTransitionState(),w.WoId?n.go("assignmentDetails",{id:w.WoId,assId:a}):n.go("techUnavailableEdit",{id:a})}function k(){w.loadingData=!0,e.getItems("employees/getTechnicianByLaborGroupForCalendar",{techIds:x(w.technicianIds),groupIds:x(w.laborGroups)}).then(function(a){w.techs=a.data.Data,w.techs.sort(l.sortArray("FullName")),function(){if(w.filterAssigned.assignmentStatusIds=x(w.unformatedFilterAssigned.assignmentStatusIds),w.filterAssigned.workOrderTypeIds=x(w.unformatedFilterAssigned.workOrderTypeIds),w.filterAssigned.workOrderStatusIds=x(w.unformatedFilterAssigned.workOrderStatusIds),w.filterAssigned.problemCodeIds=x(w.unformatedFilterAssigned.problemCodeIds),w.filterAssigned.officeIds=x(w.unformatedFilterAssigned.officeIds),w.technicianIds.length>0)w.filterAssigned.technicianIds=x(w.technicianIds);else{for(var a=[],n=0;n!=w.techs.length;n++)a.push(w.techs[n].Id);w.filterAssigned.technicianIds=x(a)}R();var s=new Date(w.calendarDate);s.setMonth(s.getMonth()-1),d.convertToUtc(s);var r=d.buildISOString(s),o=new Date(w.calendarDate);o.setMonth(o.getMonth()+1),d.convertToUtc(o);var l=d.buildISOString(o);w.assignFilters=i.filter("and"),w.assignFilters.eq("technicianIds",w.filterAssigned.technicianIds).eq("assignmentStatusIds",w.filterAssigned.assignmentStatusIds).eq("workOrderTypeIds",w.filterAssigned.workOrderTypeIds).eq("workOrderStatusIds",w.filterAssigned.workOrderStatusIds).eq("problemCodeIds",w.filterAssigned.problemCodeIds).eq("officeIds",w.filterAssigned.officeIds).eq("fromDate",r).eq("toDate",l),e.getItems("woassignments/assigned",w.assignFilters).then(function(a){w.calendarAssignments=a.data.Data,w.calendarAssignmentEvents=[],w.calendarInstance.events.list=w.calendarAssignmentEvents;for(var n=0;n!=w.calendarAssignments.length;n++)if(null!==w.calendarAssignments[n].EstStartDate&&null!==w.calendarAssignments[n].EstEndDate){var s=new Date(w.calendarAssignments[n].EstStartDate+d.getCurrentTimezoneOffsetString(w.calendarAssignments[n].EstStartDate)),o=new Date(s),c=Math.floor(e.state.items[n].EstHours),u=Math.floor(60*(c-Math.floor(w.calendarAssignments[n].EstHours)));o.setHours(o.getHours()+c),o.setMinutes(o.getMinutes()+u);var g=z(w.calendarAssignments[n]),h=N(w.calendarAssignments[n]),m="#2494f2";""!==e.state.items[n].ColorCode&&(m=w.calendarAssignments[n].ColorCode);var p=moment.tz.zone(w.authData.tzDatebaseName).offset(s);d.convertToLocal(s,p),p=moment.tz.zone(w.authData.tzDatebaseName).offset(o),d.convertToLocal(o,p),s.setMinutes(s.getMinutes()-s.getTimezoneOffset()),o.setMinutes(o.getMinutes()-o.getTimezoneOffset()),w.calendarAssignmentEvents.push({text:h,html:g,bubbleHtml:g,start:new DayPilot.Date(s),end:new DayPilot.Date(o),id:w.calendarAssignments[n].Id,resource:w.calendarAssignments[n].TechId,barColor:m,borderColor:m,CssClass:"custom-calendar-event"})}var f=w.filterAssigned.technicianIds.split(",");""==f[0]&&f.splice(0,1);var D=i.filter("and");f.length>0&&D.eq("TechId",f),D.ge("StartDate",r).le("StartDate",l),e.getItems("techUnavailable/getForCalendar",D).then(function(e){w.techUnavailable=e.data.Data;for(var a=0;a<w.techUnavailable.length;a++){var n=`Unavailable: <br/> Reason: ${w.techUnavailable[a].UnavailableName} <br/> Duration: ${w.techUnavailable[a].Hours} h <br/> Note: ${w.techUnavailable[a].Note}`,s=`Unavailable: \n Reason: ${w.techUnavailable[a].UnavailableName} \n Duration: ${w.techUnavailable[a].Hours} h \n Note: ${w.techUnavailable[a].Note}`,r=new Date(w.techUnavailable[a].StartDate+d.getCurrentTimezoneOffsetString(w.techUnavailable[a].StartDate)),i=new Date(w.techUnavailable[a].EndDate+d.getCurrentTimezoneOffsetString(w.techUnavailable[a].EndDate)),o=moment.tz.zone(w.authData.tzDatebaseName).offset(r);d.convertToLocal(r,o),o=moment.tz.zone(w.authData.tzDatebaseName).offset(i),d.convertToLocal(i,o),r.setMinutes(r.getMinutes()-r.getTimezoneOffset()),i.setMinutes(i.getMinutes()-i.getTimezoneOffset()),w.calendarAssignmentEvents.push({text:s,html:n,bubbleHtml:n,start:new DayPilot.Date(r),end:new DayPilot.Date(i),id:w.techUnavailable[a].Id,resource:w.techUnavailable[a].TechId,barColor:"#000000",borderColor:"#000000",CssClass:"custom-calendar-event"})}w.calendarInstance.update(),t(function(){$(".calendar_default_event").closest("tr").find("td").css("min-width","100px"),$(".calendar_default_now").closest("tr").find("td").css("min-width","100px"),w.loadingData=!1})})})}(),H(w.currentCalendarView)})}function G(a){for(var t=a.e.id(),n=0;n!=w.calendarAssignments.length;n++)if(w.calendarAssignments[n].Id==t){new Date;var s=new Date(a.newStart.value),r=new Date(a.newEnd.value),i=(r-s)/36e5;d.convertToUtc(s),d.convertToUtc(r),w.calendarAssignments[n].EstStartDate=d.buildISOString(s),w.calendarAssignments[n].EstEndDate=d.buildISOString(r),w.calendarAssignments[n].EstHours=i,C.getLocation("WoAssignment").then(function(a){w.calendarAssignments[n].Latitude=a.coords.latitude,w.calendarAssignments[n].Longitude=a.coords.longitude,e.update("woassignments",w.calendarAssignments[n]).then(function(e){E(e,w.calendarAssignments[n])})});break}}function V(e){p.checkInProgressLabor(e.e.data.id).then(function(a){if(a){var t=w.calendarInstance.events.find(e.e.data.id);return w.calendarInstance.events.remove(t).queue(),o.warning({message:"Assignment status or assigned technician cannot be changed while timer is in progress!"}),void W()}if(w.techs.length<=0){t=w.calendarInstance.events.find(e.e.data.id);return w.calendarInstance.events.remove(t).queue(),void o.error({message:"Please select technician to assign work order."})}w.updateEvent(e)})}function E(e,a){if(null==a&&e&&e.data)for(var t=0;t!=w.calendarAssignments.length;t++)if(w.calendarAssignments[t].Id==e.data.Id){a=w.calendarAssignments[t];break}if(e&&e.data&&a&&(a.EventSynchronized=e.data.EventSynchronized,a.GraphOwnerId=e.data.GraphOwnerId,a.GraphObjectId=e.data.GraphObjectId,e.data.ActionResults))for(t=0;t<e.data.ActionResults.length;t++)-1==e.data.ActionResults[t].Result?o.error({message:e.data.ActionResults[t].Message}):0==e.data.ActionResults[t].Result?o.warning({message:e.data.ActionResults[t].Message}):1==e.data.ActionResults[t].Result&&o.success({message:e.data.ActionResults[t].Message})}function L(e){if(w.showChart)!function(e){w.calendarInstance.resources=[];var a=new Date(w.calendarDate);a.setMinutes(a.getMinutes()-a.getTimezoneOffset());var t=new DayPilot.Date(a).getDatePart();w.mapStartDate=t.d;for(var n=0;n!=e;n++){for(var s=[],r=0;r!=w.techs.length;r++)s.push({name:w.techs[r].FullName,id:w.techs[r].Id});w.calendarInstance.resources=s,w.calendarInstance.days=e,t=t.addDays(1)}w.mapEndDate=t.d,w.calendarInstance.startDate=a,w.calendarInstance.events.list=w.calendarAssignmentEvents,w.calendarInstance.cellWidthSpec="none","day"==w.currentCalendarView?w.calendarInstance.cellWidthSpec="Auto":(w.calendarInstance.cellWidthSpec="none",w.calendarInstance.cellWidth=60);w.calendarInstance.update()}(e);else{if(!w.calendarDate){var a={};c.getValue("lastselection_"+w.UserData.Id)&&(a=c.getValue("lastselection_"+w.UserData.Id)),w.calendarDate=a.dispatch.calendarDate}var n=new Date(w.calendarDate);n.setMinutes(n.getMinutes()-n.getTimezoneOffset());var s=new DayPilot.Date(n).getDatePart();w.mapStartDate=s.d,w.calendarInstance.columns=[];for(var r=0;r!=e;r++){for(var i={name:moment(s.d).utc().format("dddd, MMMM DD, YYYY"),children:[]},d=0;d!=w.techs.length;d++)i.children.push({name:w.techs[d].FullName,start:s,id:w.techs[d].Id});w.calendarInstance.columns.push(i),s=s.addDays(1)}w.mapEndDate=s.d,w.calendarInstance.events.list=w.calendarAssignmentEvents,w.calendarInstance.update(),t(function(){$(".calendar_default_event").closest("tr").find("td").css("min-width","100px"),$(".calendar_default_now").closest("tr").find("td").css("min-width","100px");var e=$('[data-id="nav.scroll"] > div > div');e.scrollTop(0),e.scrollTop(240)})}}function H(e){switch(w.currentCalendarView=e,e){case"day":w.calendarInstance.constructor==DayPilot.Month&&(w.calendarInstance.dispose(),M(),w.expandCalendar&&Y()),w.currentView=1;break;case"threedays":w.calendarInstance.constructor==DayPilot.Month&&(w.calendarInstance.dispose(),M(),w.expandCalendar&&Y()),w.currentView=3;break;case"week":w.calendarInstance.constructor==DayPilot.Month&&(w.calendarInstance.dispose(),M(),w.expandCalendar&&Y()),w.currentView=7;break;case"month":w.calendarInstance.constructor!=DayPilot.Month&&(w.calendarInstance.dispose(),M(!0)),w.calendarInstance.viewType="Month",w.calendarInstance.events.list=w.calendarAssignmentEvents;var a=new Date(w.calendarDate);a.setMinutes(a.getMinutes()-a.getTimezoneOffset()),w.calendarInstance.startDate=new DayPilot.Date(a),w.calendarInstance.update()}"month"==e?($("#unassigned-grid-wrapper").addClass("hidden"),$("#daypilot-calendar").css("width","100%").css("clear","both"),$("#dispatch-map").addClass("hidden")):(w.HideUnassignedList(),w.showMap()),R()}function W(){R(),H(w.currentCalendarView),k()}function x(e,a){for(var t="",n=0;n!=e.length;n++)t+=e[n]+",";return t=t.substring(0,t.length-1)}function N(e){var a="Customer: "+e.CustomerName+"\n";return a+="Site: "+e.SiteName+"\n",null!==e.ServiceableItemName&&(a+="Serviceable Item: "+e.ServiceableItemName+"\n"),a+="Problem Code: "+e.ProblemCode+"\n",a+="Work Order: "+e.AltId+"\n",null!==e.WoType&&(a+="Work Order Type: "+e.WoType+"\n"),null!==e.Status&&(a+="Assignment Status: "+e.Status+"\n"),null!==e.WOStatus&&(a+="Work Order Status: "+e.WOStatus+"\n"),null!==e.EstHours&&(a+="Duration: "+e.EstHours+"h\n"),null!==e.Address&&(a+="Address: "+e.Address+"\n"),null!==e.City&&(a+="City: "+e.City+"\n"),null!==e.StateCode&&(a+="State: "+e.StateCode+"\n"),null!==e.PostalCode&&(a+="Postal Code: "+e.PostalCode+"\n"),null!==e.ContactFullName&&(a+="Contact: "+e.ContactFullName+"\n"),null!==e.Phone&&(a+="Phone: "+e.Phone+"\n"),a}function z(e){var a="Customer: "+e.CustomerName+"<br/>";return a+="Site: "+e.SiteName+"<br/>",null!=e.ServiceableItemName?a+="Serviceable Item: "+e.ServiceableItemName+"<br/>":a+="Serviceable Item: <br/>",a+="Problem Code: "+e.ProblemCode+"<br/>",a+="Work Order: "+e.AltId+"<br/>",null!==e.WoType&&(a+="Work Order Type: "+e.WoType+"<br/>"),null!==e.Status&&(a+="Assignment Status: "+e.Status+"<br/>"),null!==e.WOStatus&&(a+="Work Order Status: "+e.WOStatus+"<br/>"),null!==e.EstHours&&(a+="Duration: "+e.EstHours+"h<br/>"),null!=e.Address?a+="Address: "+e.Address+"<br/>":a+="Address: <br />",null!=e.City?a+="City: "+e.City+"<br/>":a+="City: <br />",null!=e.StateCode?a+="State: "+e.StateCode+"<br/>":a+="State: <br />",null!=e.Address?a+="Postal Code: "+e.PostalCode+"<br/>":a+="Postal Code: <br />",null!=e.ContactFullName?a+="Contact: "+e.ContactFullName+"<br />":a+="Contact: <br/>",null!=e.Phone?a+="Phone: "+e.Phone+"<b r/>":a+="Phone: <br />",a}function R(){var e={};c.getValue("lastselection_"+w.UserData.Id)&&(e=c.getValue("lastselection_"+w.UserData.Id)),w.calendarDate||(w.calendarDate=e.dispatch.calendarDate),e.dispatch={unformatedFilterAssigned:w.unformatedFilterAssigned,technicianIds:w.technicianIds,laborGroups:w.laborGroups,calendarDate:w.calendarDate,currentCalendarView:w.currentCalendarView},c.setValue("lastselection_"+w.UserData.Id,e)}function q(e){return e&&(o.success("Settings Saved!"),o.warning("ReLoading Calendar..."),t(function(){n.reload()},1e3)),!0}function _(){if(w.mapVisible){var e={geoFilters:function(){var e=new Date(w.mapStartDate);d.convertToUtc(e);var a=d.buildISOString(e),t=new Date(w.mapEndDate);d.convertToUtc(t);var n=d.buildISOString(t),s=i.filter("and");return s.eq("technicianIds",w.filterAssigned.technicianIds).eq("assignmentStatusIds",w.filterAssigned.assignmentStatusIds).eq("workOrderTypeIds",w.filterAssigned.workOrderTypeIds).eq("workOrderStatusIds",w.filterAssigned.workOrderStatusIds).eq("problemCodeIds",w.filterAssigned.problemCodeIds).eq("officeIds",w.filterAssigned.officeIds).eq("fromDate",a).eq("toDate",n),s}(),TechIds:w.filterAssigned.technicianIds};f.drawMapMarkers(e).then(function(e){t(function(){w.usingGoogleMaps?(w.markers=e.markers,a.googleMarkers=w.markers):(w.markers=e.markers,w.bounds=e.bounds)})})}}function B(){w.mapVisible&&(w.usingGoogleMaps||(w.usingGeoCodeFarm=!w.usingGeoCodeFarm,t(function(){w.usingGeoCodeFarm=!w.usingGeoCodeFarm})))}function Y(){w.expandCalendar?($("#button-resize").addClass("active"),w.calendarInstance.columnWidthSpec="Fixed",w.calendarInstance.columnWidth=100,w.calendarInstance.update()):($("#button-resize").removeClass("active"),w.calendarInstance.dispose(),M(),H(w.currentCalendarView))}w.updateEvent=function(a){if(a.external){for(var n=a.e.value(),s=0;s!=w.unassignments;s++)if(w.unassignments[s].Id==n){new Date;var r=new Date(a.newStart.value),i=new Date(a.newEnd.value);0==(o=Math.floor(w.unassignments[s].EstHours))&&(i.setMinutes(i.getMinutes()+30),a.e.data.end=new DayPilot.Date(i),o=.5),d.convertToUtc(r),d.convertToUtc(i),w.unassignments[s].EstStartDate=d.buildISOString(r),w.unassignments[s].EstEndDate=d.buildISOString(i),w.unassignments[s].EstHours=o,w.unassignments[s].TechId=a.newResource,w.unassignments[s].Status="Assigned",null!==w.assignedColor&&(w.unassignments[s].ColorCode=w.assignedColor),w.calendarAssignments.push(w.unassignments[s]),a.e.data.text=N(w.unassignments[s]),a.e.data.borderColor=w.unassignments[s].ColorCode,a.e.data.barColor=w.unassignments[s].ColorCode,w.calendarInstance.update(),w.showChart||t(function(){$(".calendar_default_event").closest("tr").find("td").css("min-width","100px"),$(".calendar_default_now").closest("tr").find("td").css("min-width","100px")}),C.getLocation("WoAssignment").then(function(a){w.unassignments[s].Latitude=a.coords.latitude,w.unassignments[s].Longitude=a.coords.longitude,e.update("woassignments",w.unassignments[s]).then(function(e){E(e,null),_()}),w.unassignments.splice(s,1)});break}}else for(n=a.e.id(),s=0;s!=w.calendarAssignments.length;s++)if(w.calendarAssignments[s].Id==n){new Date,r=new Date(a.newStart.value);var o=((i=new Date(a.newEnd.value))-r)/36e5;d.convertToUtc(r),d.convertToUtc(i),w.calendarAssignments[s].EstStartDate=d.buildISOString(r),w.calendarAssignments[s].EstEndDate=d.buildISOString(i),w.calendarAssignments[s].EstHours=o,w.calendarAssignments[s].TechId=a.newResource,C.getLocation("WoAssignment").then(function(a){w.calendarAssignments[s].Latitude=a.coords.latitude,w.calendarAssignments[s].Longitude=a.coords.longitude,e.update("woassignments",w.calendarAssignments[s]).then(function(e){E(e,w.calendarAssignments[s])})});break}},w.setTransitionState=function(){var e={navBackData:{}};r.selectiveExtend(e.navBackData,w,["calendarDate","currentCalendarView","filterTab","unformatedFilterAssigned","laborGroups","filterAssigned","techsFilter","fromDate","toDate","showUnassignedFlag","showUnscheduledFlag","showCalendar"]),r.setTransitionParam("workOrdersDetails",e)},w.calendarSettings=function(){var e=angular.copy(w.settings);v.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"DispatchSettingsEditController",controllerAs:"vm",inputs:{modalTitle:"Calendar Settings",apiMethod:"dispatchCalendarSettings",attributes:[{Type:"dropdown",Label:"Calendar Theme:",ApiMethod:"dispatchCalendarThemes/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"CalendarThemeId",Required:"true"},{Type:"dropdown",Label:"Chart Theme:",ApiMethod:"dispatchChartThemes/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"ChartThemeId",Required:"true"},{Type:"dropdown",Label:"Monthly Theme:",ApiMethod:"dispatchMonthlyCalendarThemes/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"MonthlyCalendarThemeId",Required:"true"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"checkbox",Label:"Show Map on Start",ModelValue:"ShowMap"},{Type:"checkbox",Label:"Hide Side Panel on Start",ModelValue:"HideSidePanel"},{Type:"dropdown",Label:"Unassigned Grid Sort Column:",ApiMethod:"dispatchCalendarSettings/unassignedSortColDDList",ValueProp:"Key",TextProp:"Value",ModelValue:"UnassignedGridSortColumn"},{Type:"int",Label:"Calendar Time Cell Duration (min)",ModelValue:"CalendarTimeHeaderCellDuration"},{Type:"dropdown",Label:"Unassigned Grid Sort Direction:",ValueProp:"Key",TextProp:"Value",ModelValue:"UnassignedGridSortDirection",List:[{Value:"Ascending",Key:"asc"},{Value:"Descending",Key:"desc"}]},{Type:"int",Label:"Calendar Cell Duration (min)",ModelValue:"CalendarCellDuration"},{Type:"int",Label:"Unassigned Grid Height (px)",ModelValue:"UnassignedGridHeight"}],id:e.Id,model:e,onBack:q}}).then(function(e){e.close.then(function(e){})})},w.companySettingsFilter=i.filter("or"),w.companySettingsFilter.eq("Name","GeoCodingService"),D.getCompanySettings(w.companySettingsFilter).then(function(){w.geoCodingService=D.GeoCodingService,w.usingGoogleMapsFeature=I.usingGoogleMaps,w.geoCodingService===D.GoogleMaps&&w.usingGoogleMapsFeature?w.usingGoogleMaps=!0:w.usingGeoCodeFarm=!0}),w.setMapSetting=function(){w.settings.ShowMap=!w.settings.ShowMap},w.setSidePanelSetting=function(){w.settings.HideSidePanel=!w.settings.HideSidePanel},w.toggleChart=function(){"month"!==w.currentCalendarView?(w.showChart=!w.showChart,w.displayChart()):o.warning("Chart/Calendar View not available when viewing Month!")},w.displayChart=function(){w.showChart?$("#calendarChart").removeClass("glyphicon-list-alt").addClass("glyphicon-calendar"):$("#calendarChart").removeClass("glyphicon-calendar").addClass("glyphicon-list-alt"),w.showMap(),w.calendarInstance.dispose(),M(),H(w.currentCalendarView),w.expandCalendar&&Y()},w.toggleMap=function(){"month"!==w.currentCalendarView?(w.mapVisible=!w.mapVisible,w.showMap()):o.warning({message:"Map not available when viewing Month!"})},w.showMap=function(){w.mapVisible?($("#daypilot-calendar").css("width","60%").css("float","left"),$("#dispatch-map").removeClass("hidden"),$("#button-map").addClass("active"),_()):($("#daypilot-calendar").css("width","100%").css("clear","both"),$("#dispatch-map").addClass("hidden"),$("#button-map").removeClass("active")),L(w.currentView)},w.toggleUnassignedList=function(){"month"===w.currentCalendarView?o.warning({message:"Unassigned Grid not available when viewing Month!"}):(w.unassignedListVisible=!w.unassignedListVisible,w.HideUnassignedList(),B())},w.HideUnassignedList=function(){w.unassignedListVisible?($("#unassigned-grid-wrapper").removeClass("hidden"),$("#button-unassigned-list").addClass("active"),y()):($("#unassigned-grid-wrapper").addClass("hidden"),$("#button-unassigned-list").removeClass("active")),w.calendarInstance.constructor==DayPilot.Month&&(w.calendarInstance.dispose(),M()),L(w.currentView)},w.expandCalendarToggle=function(){"month"===w.currentCalendarView||w.showChart?o.warning({message:"Cannot expand Calendar when viewing Month or Chart!"}):(w.expandCalendar=!w.expandCalendar,Y())},w.convertToLocal=function(e){var a=new Date(e),t=moment.tz.zone(w.authData.tzDatebaseName).offset(a);return d.convertToLocal(a,t)}}angular.module("FieldConnectApp").controller("DispatchCalendarController",e),e.$inject=["restService","$scope","$timeout","$state","$q","stateTransitionService","qsService","timezoneService","Notification","sortArrayObjectsByAttrService","cryptoStorageService","currentUserService","checkBrowserService","deviceDetector","guiPrivilegeService","trackRealTimeService","dispatchCalendarMapService","currentCompanyService","featuresFactory","ModalService","fcGeoLocationService"]}();;!function(){"use strict";function e(e,t,a,n,s,r,i,o,d,l,c,u,g,m,h,f){var D=this;D.$state=n,D.calendarDate=new Date,D.calendarInstance=null,D.currentCalendarView="day",D.deviceDetect=m,D.filterTab="Techs",D.filterAssigned={assignmentStatusIds:"",workOrderTypeIds:"",workOrderStatusIds:"",problemCodeIds:"",officeIds:"",technicianIds:""},D.unformatedFilterAssigned={assignmentStatusIds:[],workOrderTypeIds:[],workOrderStatusIds:[],problemCodeIds:[],officeIds:[]},D.techsFilter={groupIds:""},D.calendarTechsFilter={techIds:"",groupIds:""},D.laborGroups=[],D.techs=[],D.technicianIds=[],D.calendarAssignments=[],D.calendarAssignmentEvents=[],D.unassignments=[],D.laborGroupList=[],D.laborGroupsLoaded=!1,D.initialLaborGroupsSelected=!1,D.initialTechsLoaded=!1,D.loadingData=!0,D.getAssignedTech=w,D.clearFilters=function(){D.filterAssigned={assignmentStatusIds:"",workOrderTypeIds:"",workOrderStatusIds:"",problemCodeIds:"",officeIds:""},D.unformatedFilterAssigned={assignmentStatusIds:[],workOrderTypeIds:[],workOrderStatusIds:[],problemCodeIds:[],officeIds:[]},D.technicianIds=[],D.laborGroups=[],w()},D.changeView=O,D.searchDate=P,D.goPrevDay=function(){var e=new Date(D.calendarDate);"month"==D.currentCalendarView?D.calendarDate=e.setMonth(e.getMonth()-1):D.calendarDate=e.setDate(e.getDate()-1);P()},D.goNextDay=function(){var e=new Date(D.calendarDate);"month"==D.currentCalendarView?D.calendarDate=e.setMonth(e.getMonth()+1):D.calendarDate=e.setDate(e.getDate()+1);P()},D.goToday=function(){D.calendarDate=new Date,P()},D.UserData={};var p=i.filter("and");function I(e){e?(D.calendarInstance=new DayPilot.Month("daypilot-calendar"),D.calendarInstance.contextMenu=new DayPilot.Menu([{text:"Unassign",onclick:function(){b(this.source.value())}}]),D.calendarInstance.onEventMoved=S,D.calendarInstance.onEventClicked=A,D.calendarInstance.showToolTip=!0,D.calendarInstance.bubble=new DayPilot.Bubble,D.calendarInstance.bubble.zIndex=1e4,D.calendarInstance.onBeforeEventRender=v,D.calendarInstance.init()):(D.calendarInstance=new DayPilot.Scheduler("daypilot-calendar"),D.calendarInstance.timeHeaders=[{groupBy:"Month"},{groupBy:"Day",format:"dddd d"},{groupBy:"Hour",format:"h tt"}],D.calendarInstance.cssOnly=!0,D.calendarInstance.viewType="Resources",D.calendarInstance.headerLevels=2,D.calendarInstance.contextMenu=new DayPilot.Menu([{text:"Unassign",onclick:function(){b(this.source.value())}}]),D.calendarInstance.onEventMoved=C,D.calendarInstance.onEventResized=S,D.calendarInstance.onEventClicked=A,D.calendarInstance.cellWidthSpec="Auto",D.calendarInstance.heightSpec="Parent100Pct",D.calendarInstance.init(),a(function(){$(".scheduler_default_event").closest("tr").find("td").css("min-width","100px"),$(".scheduler_default_now").closest("tr").find("td").css("min-width","100px")}))}function b(t){for(var a=0;a!==D.calendarAssignments.length;a++)if(t===D.calendarAssignments[a].Id){D.workOrder=D.calendarAssignments[a];break}"Assigned"===D.workOrder.Status?bootbox.confirm("Are you sure that you want to unassign the Assignment for WO#"+D.workOrder.AltId+"?",function(a){a&&e.update("woassignments/unassign/"+t).then(function(t){var a="Assignment for WO#"+D.workOrder.AltId+" has been unassigned";w(),e.getItems("woassignments/unassigned").then(function(e){D.unassignments=e.data.Data}),d.success({message:a})})}):d.warning({message:'Only Assignments with a status of "Assigned" can be unassigned!'})}function v(e){e.e.html="<div style='display:inline-block;overflow:hidden;height:100%;background-color:#F8F8F8'>"+e.e.text+"</div>",e.e.backColor=e.e.borderColor}function A(e){for(var t=e.e.id(),a=0;a!=D.calendarAssignments.length;a++)t==D.calendarAssignments[a].Id&&(D.WoId=D.calendarAssignments[a].WoId);D.setTransitionState(),D.WoId?n.go("assignmentDetails",{id:D.WoId,assId:t}):n.go("techUnavailableEdit",{id:t})}function w(){D.loadingData=!0,e.getItems("employees/getTechnicianByLaborGroupForCalendar",{techIds:U(D.technicianIds),groupIds:U(D.laborGroups)}).then(function(t){D.techs=t.data.Data,D.techs.sort(l.sortArray("FullName")),function(){if(D.filterAssigned.assignmentStatusIds=U(D.unformatedFilterAssigned.assignmentStatusIds),D.filterAssigned.workOrderTypeIds=U(D.unformatedFilterAssigned.workOrderTypeIds),D.filterAssigned.workOrderStatusIds=U(D.unformatedFilterAssigned.workOrderStatusIds),D.filterAssigned.problemCodeIds=U(D.unformatedFilterAssigned.problemCodeIds),D.filterAssigned.officeIds=U(D.unformatedFilterAssigned.officeIds),D.technicianIds.length>0)D.filterAssigned.technicianIds=U(D.technicianIds);else{for(var t=[],a=0;a!=D.techs.length;a++)t.push(D.techs[a].Id);D.filterAssigned.technicianIds=U(t)}k();var n=new Date(D.calendarDate);n.setMonth(n.getMonth()-1),o.convertToUtc(n);var s=o.buildISOString(n),r=new Date(D.calendarDate);r.setMonth(r.getMonth()+1),o.convertToUtc(r);var d=o.buildISOString(r),l=i.filter("and");l.eq("technicianIds",D.filterAssigned.technicianIds).eq("assignmentStatusIds",D.filterAssigned.assignmentStatusIds).eq("workOrderTypeIds",D.filterAssigned.workOrderTypeIds).eq("workOrderStatusIds",D.filterAssigned.workOrderStatusIds).eq("problemCodeIds",D.filterAssigned.problemCodeIds).eq("officeIds",D.filterAssigned.officeIds).eq("fromDate",s).eq("toDate",d),e.getItems("woassignments/assigned",l).then(function(t){D.calendarAssignments=t.data.Data,D.calendarAssignmentEvents=[],D.calendarInstance.events.list=D.calendarAssignmentEvents;for(var a=0;a!=D.calendarAssignments.length;a++)if(null!==D.calendarAssignments[a].EstStartDate&&null!==D.calendarAssignments[a].EstEndDate){var n=new Date(D.calendarAssignments[a].EstStartDate+o.getCurrentTimezoneOffsetString(D.calendarAssignments[a].EstStartDate)),r=new Date(n),l=Math.floor(e.state.items[a].EstHours),c=Math.floor(60*(l-Math.floor(D.calendarAssignments[a].EstHours)));r.setHours(r.getHours()+l),r.setMinutes(r.getMinutes()+c);var u=M(D.calendarAssignments[a]),g=F(D.calendarAssignments[a]),m="#2494f2";""!==e.state.items[a].ColorCode&&(m=D.calendarAssignments[a].ColorCode);var h=moment.tz.zone(D.authData.tzDatebaseName).offset(n);o.convertToLocal(n,h),h=moment.tz.zone(D.authData.tzDatebaseName).offset(r),o.convertToLocal(r,h),n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),r.setMinutes(r.getMinutes()-r.getTimezoneOffset()),D.calendarAssignmentEvents.push({text:g,html:u,bubbleHtml:u,start:new DayPilot.Date(n),end:new DayPilot.Date(r),id:D.calendarAssignments[a].Id,resource:D.calendarAssignments[a].TechId,barColor:m,borderColor:m,CssClass:"custom-calendar-event"})}var f=D.filterAssigned.technicianIds.split(",");""==f[0]&&f.splice(0,1);var p=i.filter("and");f.length>0&&p.eq("TechId",f),p.ge("StartDate",s).le("StartDate",d),e.getItems("techUnavailable/getForCalendar",p).then(function(e){D.techUnavailable=e.data.Data;for(var t=0;t<D.techUnavailable.length;t++){var a="Unavailable: <br/>Reason: "+D.techUnavailable[t].UnavailableName+"<br/>Duration: "+D.techUnavailable[t].Hours+"h",n="Unavailable: \nReason: "+D.techUnavailable[t].UnavailableName+"\nDuration: "+D.techUnavailable[t].Hours+"h",s=new Date(D.techUnavailable[t].StartDate+o.getCurrentTimezoneOffsetString(D.techUnavailable[t].StartDate)),r=new Date(D.techUnavailable[t].EndDate+o.getCurrentTimezoneOffsetString(D.techUnavailable[t].EndDate)),i=moment.tz.zone(D.authData.tzDatebaseName).offset(s);o.convertToLocal(s,i),i=moment.tz.zone(D.authData.tzDatebaseName).offset(r),o.convertToLocal(r,i),s.setMinutes(s.getMinutes()-s.getTimezoneOffset()),r.setMinutes(r.getMinutes()-r.getTimezoneOffset()),D.calendarAssignmentEvents.push({text:n,html:a,bubbleHtml:a,start:new DayPilot.Date(s),end:new DayPilot.Date(r),id:D.techUnavailable[t].Id,resource:D.techUnavailable[t].TechId,barColor:"#000000",borderColor:"#000000",CssClass:"custom-calendar-event"})}D.calendarInstance.update(),D.loadingData=!1})})}(),O(D.currentCalendarView)})}function S(t){for(var a=t.e.id(),n=0;n!=D.calendarAssignments.length;n++)if(D.calendarAssignments[n].Id==a){var s=new Date,r=new Date(t.newStart.d),i=new Date(t.newEnd.d),d=(i-r)/36e5;o.convertToUtc(r),o.convertToUtc(i),r.setMinutes(r.getMinutes()+s.getTimezoneOffset()),i.setMinutes(i.getMinutes()+s.getTimezoneOffset()),D.calendarAssignments[n].EstStartDate=o.buildISOString(r),D.calendarAssignments[n].EstEndDate=o.buildISOString(i),D.calendarAssignments[n].EstHours=d,e.update("woassignments",D.calendarAssignments[n]).then(function(e){y(e,D.calendarAssignments[n])});break}}function C(e){f.checkInProgressLabor(e.e.data.id).then(function(t){if(t){var a=D.calendarInstance.events.find(e.e.data.id);return D.calendarInstance.events.remove(a).queue(),d.warning({message:"Assignment status or assigned technician cannot be changed while timer is in progress!"}),void P()}D.updateEvent(e)})}function y(e,t){if(null==t&&e&&e.data)for(var a=0;a!=D.calendarAssignments.length;a++)if(D.calendarAssignments[a].Id==e.data.Id){t=D.calendarAssignments[a];break}if(e&&e.data&&t&&(t.EventSynchronized=e.data.EventSynchronized,t.GraphOwnerId=e.data.GraphOwnerId,t.GraphObjectId=e.data.GraphObjectId,e.data.ActionResults))for(a=0;a<e.data.ActionResults.length;a++)-1==e.data.ActionResults[a].Result?d.error({message:e.data.ActionResults[a].Message}):0==e.data.ActionResults[a].Result?d.warning({message:e.data.ActionResults[a].Message}):1==e.data.ActionResults[a].Result&&d.success({message:e.data.ActionResults[a].Message})}function T(e){D.calendarInstance.resources=[];var t=new Date(D.calendarDate);t.setMinutes(t.getMinutes()-t.getTimezoneOffset());for(var a=new DayPilot.Date(t).getDatePart(),n=0;n!=e;n++){for(var s=[],r=0;r!=D.techs.length;r++)s.push({name:D.techs[r].FullName,id:D.techs[r].Id});D.calendarInstance.resources=s,D.calendarInstance.days=e,a=a.addDays(1)}D.calendarInstance.startDate=t,D.calendarInstance.events.list=D.calendarAssignmentEvents,D.calendarInstance.cellWidthSpec="none","day"==D.currentCalendarView?D.calendarInstance.cellWidthSpec="Auto":(D.calendarInstance.cellWidthSpec="none",D.calendarInstance.cellWidth=60),D.calendarInstance.update()}function O(e){switch(D.currentCalendarView=e,"month"==e?($("#filter_tabs .fc_tab_Unassigned").addClass("hidden"),"Unassigned"==D.filterTab&&(D.filterTab="Techs")):$("#filter_tabs .fc_tab_Unassigned").removeClass("hidden"),e){case"day":D.calendarInstance.constructor==DayPilot.Month&&(D.calendarInstance.dispose(),I()),T(1);break;case"threedays":D.calendarInstance.constructor==DayPilot.Month&&(D.calendarInstance.dispose(),I()),T(3);break;case"week":D.calendarInstance.constructor==DayPilot.Month&&(D.calendarInstance.dispose(),I()),T(7);break;case"month":D.calendarInstance.constructor!=DayPilot.Month&&(D.calendarInstance.dispose(),I(!0)),D.calendarInstance.viewType="Month",D.calendarInstance.events.list=D.calendarAssignmentEvents;var t=new Date(D.calendarDate);t.setMinutes(t.getMinutes()-t.getTimezoneOffset()),D.calendarInstance.startDate=new DayPilot.Date(t),D.calendarInstance.update()}k()}function P(){k(),O(D.currentCalendarView),w()}function U(e,t){for(var a="",n=0;n!=e.length;n++)a+=e[n]+",";return a=a.substring(0,a.length-1)}function F(e){var t="Customer: "+e.CustomerName+"\n";return t+="Site: "+e.SiteName+"\n",null!==e.ServiceableItemName&&(t+="Serviceable Item: "+e.ServiceableItemName+"\n"),t+="Problem Code: "+e.ProblemCode+"\n",t+="Work Order: "+e.AltId+"\n",null!==e.WoType&&(t+="Work Order Type: "+e.WoType+"\n"),null!==e.Status&&(t+="Assignment Status: "+e.Status+"\n"),null!==e.WOStatus&&(t+="Work Order Status: "+e.WOStatus+"\n"),null!==e.EstHours&&(t+="Duration: "+e.EstHours+"h\n"),null!==e.Address&&(t+="Address: "+e.Address+"\n"),null!==e.City&&(t+="City: "+e.City+"\n"),null!==e.StateCode&&(t+="State: "+e.StateCode+"\n"),null!==e.PostalCode&&(t+="Postal Code: "+e.PostalCode+"\n"),null!==e.ContactFullName&&(t+="Contact: "+e.ContactFullName+"\n"),null!==e.Phone&&(t+="Phone: "+e.Phone+"\n"),t}function M(e){var t="Customer: "+e.CustomerName+"<br/>";return t+="Site: "+e.SiteName+"<br/>",null!=e.ServiceableItemName?t+="Serviceable Item: "+e.ServiceableItemName+"<br/>":t+="Serviceable Item: <br/>",t+="Problem Code: "+e.ProblemCode+"<br/>",t+="Work Order: "+e.AltId+"<br/>",null!==e.WoType&&(t+="Work Order Type: "+e.WoType+"<br/>"),null!==e.Status&&(t+="Assignment Status: "+e.Status+"<br/>"),null!==e.WOStatus&&(t+="Work Order Status: "+e.WOStatus+"<br/>"),null!==e.EstHours&&(t+="Duration: "+e.EstHours+"h<br/>"),null!=e.Address?t+="Address: "+e.Address+"<br/>":t+="Address: <br />",null!=e.City?t+="City: "+e.City+"<br/>":t+="City: <br />",null!=e.StateCode?t+="State: "+e.StateCode+"<br/>":t+="State: <br />",null!=e.Address?t+="Postal Code: "+e.PostalCode+"<br/>":t+="Postal Code: <br />",null!=e.ContactFullName?t+="Contact: "+e.ContactFullName+"<br />":t+="Contact: <br/>",null!=e.Phone?t+="Phone: "+e.Phone+"<b r/>":t+="Phone: <br />",t}function k(){var e={};c.getValue("chartlastselection_"+D.UserData.Id)&&(e=c.getValue("chartlastselection_"+D.UserData.Id)),e.dispatch={unformatedFilterAssigned:D.unformatedFilterAssigned,technicianIds:D.technicianIds,laborGroups:D.laborGroups,calendarDate:D.calendarDate,currentCalendarView:D.currentCalendarView},c.setValue("chartlastselection_"+D.UserData.Id,e)}p.eq("AssignmentStatusName","Assigned"),e.getItems("assignmentstatuscolors",p).then(function(e){D.assignedColor=null,e.data.Data.length>0&&(D.assignedColor=e.data.Data[0].ColorCode)}),D.gridHeader=[{field:"AltId",data:"Work Order",pid:"colDispWorkOrder"},{field:"WoType",data:"WO Type",pid:"colDispWOType"},{field:"Priority",data:"Priority",pid:"colDispPriority"},{field:"Desc",data:"Description",pid:"colDispDesc"},{field:"PromiseDate",data:"Promised Date",pid:"colDispPromiseDate"},{field:"RequestDate",data:"Requested Date",pid:"colDispRequestDate"},{field:"CustomerName",data:"Customer",pid:"colDispCustomer"},{field:"SiteName",data:"Site",pid:"colDispSite"},{field:"Address",data:"Full Address",pid:"colDispAddress"},{field:"Address1",data:"Address",pid:"colDispSiteAddress1"},{field:"Address2",data:"Address2",pid:"colDispSiteAddress2"},{field:"City",data:"City",pid:"colDispSiteCity"},{field:"StateCode",data:"State",pid:"colDispSiteStateCode"},{field:"PostalCode",data:"Postal Code",pid:"colDispSitePostalCode"},{field:"Country",data:"Country",pid:"colDispSiteCountry"},{field:"WOStatus",data:"WO Status",pid:"colDispWOStatus"},{field:"ProblemCode",data:"Problem",pid:"colDispProblem"},{field:"Status",data:"Assign Status",pid:"colDispAssignStatus"},{field:"EstHours",data:"Duration",pid:"colDispDuration"},{field:"TechFullName",data:"Technician",pid:"colDispTechnician"},{field:"Office",data:"Office",pid:"colDispOffice"},{field:"Agreement",data:"Agreement",pid:"colDispAgreement"}],D.viewName="DispatchBoard",D.moduleName="DispatchUnassignedGrid",h.loadObjectPrivileges(D.viewName,D.moduleName),D.hideCol=function(e){return 0!=h.getObjectPrivilege(e)},D.showUnassignedFlag=!0,D.showUnscheduledFlag=!0,D.refreshTable=!1,D.fromDate=null,D.toDate=null,D.sortCol=null,D.showCalendar=!1,D.showUnassigned=function(){D.showUnassignedFlag=0==D.showUnassignedFlag},D.showUnscheduled=function(){D.showUnscheduledFlag=0==D.showUnscheduledFlag},D.sort=function(e){D.sortCol!=e&&(D.sortCol=e),D.sortKey=e,D.reverse=!D.reverse},D.enableCalDnD=function(e,t){return DayPilotScheduler.dragStart(null,60*e*60,t)},D.enableCalClick=function(e,t){DayPilotScheduler.dragStop(),D.setTransitionState(),n.go("assignmentDetails",{id:e,assId:t})},t.unassignedFilter=function(e){return!(!D.showUnassignedFlag||!D.showUnscheduledFlag)||(D.showUnassignedFlag?null==e.TechFullName:D.showUnscheduledFlag?null!=e.TechFullName:void 0)},t.dateFilter=function(e){if(!D.fromDate&&!D.toDate)return e;if(D.fromDate&&D.toDate){var t=moment(D.fromDate).subtract(1,"days");if(moment(e.PromiseDate).isBetween(t,D.toDate))return e}else if(D.fromDate){if(moment(e.PromiseDate).isAfter(D.fromDate,"day")||moment(e.PromiseDate).isSame(D.fromDate,"day"))return e}else if(D.toDate&&(moment(e.PromiseDate).isBefore(D.toDate,"day")||moment(e.PromiseDate).isSame(D.toDate,"day")))return e},D.goCalendar=function(){n.go("dispatchCalendar")},function(){var t=r.popTransitionParam("workOrdersDetails");t&&(D.fromDate=t.navBackData.fromDate,D.toDate=t.navBackData.toDate,D.showUnassignedFlag=t.navBackData.showUnassignedFlag,D.showUnscheduledFlag=t.navBackData.showUnscheduledFlag);var n=r.popTransitionParam("dispatchCalendar");n&&(r.selectiveExtend(D,n,["calendarDate","currentCalendarView","filterAssigned","filterAssigned","techsFilter","fromDate","toDate","showUnassignedFlag","showUnscheduledFlag","showCalendar"]),D.unformatedFilterAssigned=n.unformatedFilterAssigned,D.laborGroups=n.laborGroups,a(function(){D.filterTab=n.filterTab}));I(),e.getItems("woassignments/unassigned").then(function(e){D.unassignments=e.data.Data})}(),t.$watch("vm.laborGroupsLoaded",function(){D.laborGroupsLoaded&&u.getCurrentUserData().then(function(e){D.UserData=e;var t=c.getValue("chartlastselection_"+D.UserData.Id);if(t&&t.dispatch&&t.dispatch.laborGroups.length>0)for(var a=0;a<t.dispatch.laborGroups.length;a++)D.laborGroups.push(t.dispatch.laborGroups[a]);else D.laborGroupList.length>0&&D.laborGroups.push(D.laborGroupList[0].Id);D.techsFilter.groupIds=U(D.laborGroups),D.technicianIds=[],D.initialLaborGroupsSelected=!0})}),t.$watch("vm.initialTechsLoaded",function(){D.initialTechsLoaded&&u.getCurrentUserData().then(function(e){D.UserData=e;var t=c.getValue("chartlastselection_"+D.UserData.Id);if(t&&t.dispatch){D.unformatedFilterAssigned=t.dispatch.unformatedFilterAssigned,D.calendarDate=t.dispatch.calendarDate,D.currentCalendarView=t.dispatch.currentCalendarView;for(var a=0;a<t.dispatch.technicianIds.length;a++)D.technicianIds.push(t.dispatch.technicianIds[a])}w()})}),t.$watch("vm.laborGroups",function(){D.laborGroups&&(g.checkBrowserAgent()?(D.techsFilter.groupIds="0",a(function(){D.techsFilter.groupIds=U(D.laborGroups),D.technicianIds=[],t.$apply()})):(D.techsFilter.groupIds=U(D.laborGroups),D.technicianIds=[]))}),D.setDateFormat=function(e){var t=new Date(e),a=moment.tz.zone(D.authData.tzDatebaseName).offset(t);return o.convertToLocal(t,a),moment(t).format("MM/DD/YYYY h:mm A")+" "+D.userTimeZone},D.authData=c.getValue("authorizationData"),D.userTimeZone=moment.tz(D.authData.tzDatebaseName).zoneAbbr(),D.updateEvent=function(t){if(t.external){for(var a=t.e.value(),n=0;n!=D.unassignments;n++)if(D.unassignments[n].Id==a){var s=new Date,r=new Date(t.newStart.d),i=new Date(t.newEnd.d);0==(d=Math.floor(D.unassignments[n].EstHours))&&(i.setMinutes(i.getMinutes()+30),t.e.data.end=new DayPilot.Date(i),d=.5),o.convertToUtc(r),o.convertToUtc(i),r.setMinutes(r.getMinutes()+s.getTimezoneOffset()),i.setMinutes(i.getMinutes()+s.getTimezoneOffset()),D.unassignments[n].EstStartDate=o.buildISOString(r),D.unassignments[n].EstEndDate=o.buildISOString(i),D.unassignments[n].EstHours=d,D.unassignments[n].TechId=t.newResource,D.unassignments[n].Status="Assigned",null!==D.assignedColor&&(D.unassignments[n].ColorCode=D.assignedColor),D.calendarAssignments.push(D.unassignments[n]),t.e.data.text=F(D.unassignments[n]),t.e.data.borderColor=D.unassignments[n].ColorCode,t.e.data.barColor=D.unassignments[n].ColorCode,D.calendarInstance.update(),e.update("woassignments",D.unassignments[n]).then(function(e){y(e,null)}),D.unassignments.splice(n,1);break}}else for(a=t.e.id(),n=0;n!=D.calendarAssignments.length;n++)if(D.calendarAssignments[n].Id==a){s=new Date,r=new Date(t.newStart.d);var d=((i=new Date(t.newEnd.d))-r)/36e5;o.convertToUtc(r),o.convertToUtc(i),r.setMinutes(r.getMinutes()+s.getTimezoneOffset()),i.setMinutes(i.getMinutes()+s.getTimezoneOffset()),D.calendarAssignments[n].EstStartDate=o.buildISOString(r),D.calendarAssignments[n].EstEndDate=o.buildISOString(i),D.calendarAssignments[n].EstHours=d,D.calendarAssignments[n].TechId=t.newResource,e.update("woassignments",D.calendarAssignments[n]).then(function(e){y(e,D.calendarAssignments[n])});break}},D.setTransitionState=function(){var e={navBackData:{}};r.selectiveExtend(e.navBackData,D,["calendarDate","currentCalendarView","filterTab","unformatedFilterAssigned","laborGroups","filterAssigned","techsFilter","fromDate","toDate","showUnassignedFlag","showUnscheduledFlag","showCalendar"]),r.setTransitionParam("workOrdersDetails",e)}}angular.module("FieldConnectApp").controller("DispatchChartController",e),e.$inject=["restService","$scope","$timeout","$state","$q","stateTransitionService","qsService","timezoneService","Notification","sortArrayObjectsByAttrService","cryptoStorageService","currentUserService","checkBrowserService","deviceDetector","guiPrivilegeService","trackRealTimeService"]}();;!function(){"use strict";function e(e,i,d){var t=this;t.$scope=e,t.model=e.model,t.attributes=e.attributes,t.id=e.id,t.apiMethod=e.apiMethod,t.timezone=e.timezone,t.customFocus=e.customFocus,t.viewName=e.viewName,t.moduleName=e.moduleName,t.filter=e.filter,t.modalClass=!1,i(function(){t.modalClass=!0}),t.hideSubmit=!1,e.hideSubmit&&(t.hideSubmit=e.hideSubmit),t.onBack=function(i){if(e.onBack&&!e.onBack(i))return;t.modalClass=!1,e.close(null,200)},e.$watch("vm.id",function(e,a){void 0===t.id&&d.getItems("dispatchCalendarSettings").then(function(e){var d=e.data.Data[0];i(function(){t.model.CalendarThemeId=d.CalendarThemeId,t.model.ChartThemeId=d.ChartThemeId,t.model.MonthlyCalendarThemeId=d.MonthlyCalendarThemeId,t.model.ShowMap=d.ShowMap,t.model.HideSidePanel=d.HideSidePanel,t.model.CalendarTimeHeaderCellDuration=d.CalendarTimeHeaderCellDuration,t.model.CalendarCellDuration=d.CalendarCellDuration,t.model.UnassignedGridHeight=d.UnassignedGridHeight,t.model.UnassignedGridSortColumn=d.UnassignedGridSortColumn,t.model.UnassignedGridSortDirection=d.UnassignedGridSortDirection})})})}angular.module("FieldConnectApp").controller("DispatchSettingsEditController",e),e.$inject=["$scope","$timeout","restService"]}();;!function(){"use strict";function e(e,t,o){this.attributes=[{Type:"checkbox",Label:"Assignment Status",ModelValue:"AssignmentStatus"},{Type:"multiselect",ApiMethod:"assignmentstatuses",ValueProp:"Id",TextProp:"AssignmentStatusName",ModelValue:"ListAssignmentStatusIds"},{Type:"checkbox",Label:"Work Order Type",ModelValue:"WorkOrderType"},{Type:"multiselect",ApiMethod:"wotypes",ValueProp:"Id",TextProp:"WoTypeName",ModelValue:"ListWoTypeIds"},{Type:"checkbox",Label:"Work Order Status",ModelValue:"WorkOrderStatus"},{Type:"multiselect",ApiMethod:"wostatuses",ValueProp:"Id",TextProp:"WoStatusName",ModelValue:"ListWoStatusIds"},{Type:"checkbox",Label:"Work Order Priority",ModelValue:"Priority"},{Type:"multiselect",ApiMethod:"priorities",ValueProp:"Id",TextProp:"PriorityName",ModelValue:"ListPriorityIds"}],this.model={},this.loadingIndicator=!1}angular.module("FieldConnectApp").controller("FiltersController",e),e.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,a,t,r,s,n,o,i,l,d,m,c,p,u,g){var f=this;function E(){f.usingGPSTracking&&f.realtimeTrackingEnabled?L():(f.isLoading=!0,f.filterMapTemp=I(),e.getItems("dispatchmap",f.filterMapTemp).then(function(e){h(e.data.Data),f.isLoading=!1}))}function I(){var e=angular.copy(f.filterMap);if(""!=e.fromDate&&null!=e.fromDate){e.fromDate=new Date(e.fromDate),e.fromDate.setHours(0,0,0,0);var a=new Date(e.fromDate);o.convertToUtc(a),e.fromDate=o.buildISOString(a)}if(""!=e.toDate&&null!=e.toDate){e.toDate=new Date(e.toDate),e.toDate.setHours(23,59,59,999);var t=new Date(e.toDate);o.convertToUtc(t),e.toDate=o.buildISOString(t)}return e}function h(e){f.mapElements=e,f.markers={},f.latAndLngErrorList=[];for(var t=0,r=0,n=0,o=0,i=!1,l=0;l<f.mapElements.length;l++)null!=f.mapElements[l].Latitude&&null!=f.mapElements[l].Longitude?(f.mapElements[l].IsWo?f.markers[l]={lat:parseFloat(f.mapElements[l].Latitude),lng:parseFloat(f.mapElements[l].Longitude),message:"WO: ".link("workOrdersDetails/"+f.mapElements[l].WoId+"/")+f.mapElements[l].AltId+"<br/>"+f.mapElements[l].WoStatusName+"<br/>"+f.mapElements[l].SiteName+"<br/>"+f.mapElements[l].Address+"<br/>"+f.mapElements[l].City+", "+f.mapElements[l].StateCode+", "+f.mapElements[l].PostalCode,focus:!1,draggable:!1,icon:{type:"awesomeMarker",icon:"home",markerColor:"blue"}}:f.mapElements[l].IsTechToday?(f.authData&&f.authData.tzDatebaseName&&(f.userTimeZone=f.authData.tzDatebaseName),f.localTimeFromUTC=moment.utc(f.mapElements[l].LastLoginDate).toDate(),f.markers[l]={lat:parseFloat(f.mapElements[l].Latitude),lng:parseFloat(f.mapElements[l].Longitude),message:f.mapElements[l].FullName.link("messages")+"<br/>Last login date:<br/>"+moment.tz(f.localTimeFromUTC,f.userTimeZone).format("MM/DD/YYYY h:mm A z"),focus:!1,draggable:!1,icon:{type:"awesomeMarker",icon:"user",markerColor:"red"}}):(f.latAndLngError.isWo=!1,f.latAndLngError.fullName=f.mapElements[l].FullName,f.latAndLngErrorList.push(f.latAndLngError),f.latAndLngError={isWo:!0,altId:"",address:"",city:"",stateCode:"",postalCode:"",country:"",fullName:""}),i||!f.mapElements[l].IsWo&&!f.mapElements[l].IsTechToday||(t=parseFloat(f.mapElements[l].Longitude),r=parseFloat(f.mapElements[l].Longitude),n=parseFloat(f.mapElements[l].Latitude),o=parseFloat(f.mapElements[l].Latitude),i=!0),(isNaN(o)||parseFloat(f.mapElements[l].Latitude)<=o)&&(f.mapElements[l].IsWo||f.mapElements[l].IsTechToday)&&i&&(o=parseFloat(f.mapElements[l].Latitude)),(isNaN(n)||parseFloat(f.mapElements[l].Latitude)>=n)&&(f.mapElements[l].IsWo||f.mapElements[l].IsTechToday)&&i&&(n=parseFloat(f.mapElements[l].Latitude)),(isNaN(r)||parseFloat(f.mapElements[l].Longitude)<=r)&&(f.mapElements[l].IsWo||f.mapElements[l].IsTechToday)&&i&&(r=parseFloat(f.mapElements[l].Longitude)),(isNaN(t)||parseFloat(f.mapElements[l].Longitude)>=t)&&(f.mapElements[l].IsWo||f.mapElements[l].IsTechToday)&&i&&(t=parseFloat(f.mapElements[l].Longitude))):(f.mapElements[l].IsWo&&(f.latAndLngError.isWo=!0,f.latAndLngError.altId=f.mapElements[l].AltId,f.latAndLngError.address=f.mapElements[l].Address,f.latAndLngError.city=f.mapElements[l].City,f.latAndLngError.stateCode=f.mapElements[l].StateCode,f.latAndLngError.postalCode=f.mapElements[l].PostalCode,f.latAndLngError.country=f.mapElements[l].Country,f.latAndLngErrorList.push(f.latAndLngError)),f.latAndLngError={isWo:!0,altId:"",address:"",city:"",stateCode:"",postalCode:"",country:"",fullName:""});!isNaN(o)&&0!=o||!isNaN(r)&&0!=r||!isNaN(n)&&0!=n||!isNaN(t)&&0!=t?f.bounds=s.createBoundsFromArray([[o,r],[n,t]]):f.bounds=s.createBoundsFromArray([[28.604551,-125.117236],[47.148621,-61.150809]]),f.usingGoogleMaps&&(a.googleMarkers=f.markers)}function k(e,a){for(var t="",r=0;r!=e.length;r++)t+=e[r]+",";t=t.substring(0,t.length-1),"serviceAreaIds"==a?f.filterMap.serviceAreaIds=t:"workOrderPriorityIds"==a?f.filterMap.workOrderPriorityIds=t:"workOrderStatusIds"==a?f.filterMap.workOrderStatusIds=t:"workOrderTypeIds"==a?f.filterMap.workOrderTypeIds=t:"technicianIds"==a&&(f.filterMap.technicianIds=t)}f.Filter={groupIds:""},f.filterTab="Techs",f.clearTechs=function(){f.laborGroupIds=[],f.technicianIds=[]},f.clearFilters=function(){f.workOrderTypeIds=[],f.workOrderStatusIds=[],f.workOrderPriorityIds=[],f.serviceAreaIds=[],f.filterMap.fromDate="",f.filterMap.toDate="",f.filterMap.omitCompletedWO=!1,f.filterMap.onlyUnassignedWO=!1},f.getTechsAndWoes=E,f.showErrorModal=function(){n.showModal({templateUrl:"Templates/Dispatch/DispatchMap/locationErrors.html",controller:"LocationErrorsController",controllerAs:"vm",inputs:{latAndLngErrorList:f.latAndLngErrorList}})},f.deviceDetect=i,f.bounds=[],f.markers={},f.laborGroupIds=[],f.technicianIds=[],f.workOrderTypeIds=[],f.workOrderStatusIds=[],f.workOrderPriorityIds=[],f.serviceAreaIds=[],f.filterMap={fromDate:new Date,toDate:new Date,technicianIds:"",omitCompletedWO:!1,onlyUnassignedWO:!1,workOrderTypeIds:"",timeZoneId:"",workOrderStatusIds:"",workOrderPriorityIds:"",serviceAreaIds:"",isWo:!0,isTech:!0},f.latAndLngErrorList=[],f.latAndLngError={isWo:!0,altId:"",address:"",city:"",stateCode:"",postalCode:"",country:"",fullName:""},f.authData=l.getValue("authorizationData"),f.usingGeoCodeFarm=!1,f.usingGoogleMaps=!1,f.usingGPSTracking=!1,f.companySettingsFilter=c.filter("or"),f.companySettingsFilter.eq("Name","GeoCodingService"),d.getCompanySettings(f.companySettingsFilter).then(function(){f.geoCodingService=d.GeoCodingService,f.usingGoogleMapsFeature=m.usingGoogleMaps,f.usingGPSTracking=m.usingGPSTracking,f.geoCodingService===d.GoogleMaps&&f.usingGoogleMapsFeature?f.usingGoogleMaps=!0:f.usingGeoCodeFarm=!0,E()}),a.$watch("vm.laborGroupIds",function(){for(var e="",a=0;a!=f.laborGroupIds.length;a++)e+=f.laborGroupIds[a]+",";e=e.substring(0,e.length-1),f.Filter.groupIds=e}),a.$watch("vm.technicianIds",function(){k(f.technicianIds,"technicianIds")}),a.$watch("vm.workOrderTypeIds",function(){k(f.workOrderTypeIds,"workOrderTypeIds")}),a.$watch("vm.workOrderStatusIds",function(){k(f.workOrderStatusIds,"workOrderStatusIds")}),a.$watch("vm.workOrderPriorityIds",function(){k(f.workOrderPriorityIds,"workOrderPriorityIds")}),a.$watch("vm.serviceAreaIds",function(){k(f.serviceAreaIds,"serviceAreaIds")});var T=1e3*d.GPSClientTrackingInterval;function L(){"/dispatchMap"!==g.path()?u.cancel(a.realtimeTrackingTimer):(y("success"),f.filterMapTemp=I(),e.getItems("dispatchmap/getTechRealtime",f.filterMapTemp).then(function(e){t(function(){200===e.status?(h(e.data.Data),y("warning")):y("error")},1e3)}))}function y(e){switch($("#dispatch-map-tracking-icon").removeClass("fa fa-satellite-dish fa fa-clock gps-start gps-idle gps-error"),e){case"success":$("#dispatch-map-tracking-icon").addClass("fa fa-satellite-dish"),$("#dispatch-map-tracking-icon").addClass("gps-start");break;case"warning":$("#dispatch-map-tracking-icon").addClass("fa fa-satellite-dish"),$("#dispatch-map-tracking-icon").addClass("gps-idle");break;case"error":$("#dispatch-map-tracking-icon").addClass("fa fa-satellite-dish"),$("#dispatch-map-tracking-icon").addClass("gps-error");break;default:$("#dispatch-map-tracking-icon").addClass("fa fa-clock")}}f.realtimeTrackingEnabled=!1,a.realtimeTrackingTimer=null,f.getTechsRealtime=function(){f.realtimeTrackingEnabled=!f.realtimeTrackingEnabled,f.realtimeTrackingEnabled?function(){T<=0&&(T=30);p.success("Realtime mapping has been enabled!"),L(),a.realtimeTrackingTimer=u(function(){L()},T)}():(p.warning("Realtime mapping has been disabled!"),y(),u.cancel(a.realtimeTrackingTimer),t(function(){E()}))}}angular.module("FieldConnectApp").controller("DispatchMapController",e),e.$inject=["restService","$scope","$timeout","$state","leafletBoundsHelpers","ModalService","timezoneService","deviceDetector","cryptoStorageService","currentCompanyService","featuresFactory","qsService","Notification","$interval","$location"]}();;!function(){"use strict";function e(e,n,r,a){var o=e;o.initialized=!1,o.loadScript=!0,o.markers=[],o.clearMarkers=[],o.initializeScript=function(){var e=a.defer();return"object"==typeof google&&"object"==typeof google.maps?e.resolve(!0):r.getEncryptedSetting("GoogleMapsAPIKey").then(function(r){var a=r,o=document.createElement("script"),t="https://maps.googleapis.com/maps/api/js?key="+a+"&?>sensor=false&language=en";o.type="text/javascript",o.src=t,document.body.appendChild(o),n(function(){e.resolve(!0)},1e3)}),e.promise},o.initializeMap=function(){var e=a.defer();if(o.initialized)e.resolve(!0);else{o.initialized=!0;var n={zoom:4,center:new google.maps.LatLng(42,-97),options:{gestureHandling:"greedy"}};o.map=new google.maps.Map(document.getElementById("map"),n),o.infoWindow=new google.maps.InfoWindow,e.resolve(!0)}return e.promise},o.createMarkers=function(e){var n="Content/img/building_marker.png";"user"===e.icon.icon&&(n="Content/img/truck_marker.png");var r=new google.maps.Marker({map:o.map,position:new google.maps.LatLng(e.lat,e.lng),icon:n});o.mapBoundary.extend(r.position),google.maps.event.addListener(r,"click",function(){o.infoWindow.setContent(e.message),o.infoWindow.open(o.map,r)}),o.clearMarkers.push(r)},o.loadMarkers=function(){if(o.markerKeys.length>0){o.mapBoundary=new google.maps.LatLngBounds;for(var e=0;e<o.markerKeys.length;e++)o.createMarkers(o.markers[o.markerKeys[e]]);o.map.fitBounds(o.mapBoundary)}},e.$parent.$watch("googleMarkers",function(e,n){if(e!==n&&void 0!==e){for(var r=0;r<o.clearMarkers.length;r++)o.clearMarkers[r].setMap(null);o.markers=[],o.clearMarkers=[],o.markers=o.$parent.vm.markers,o.markerKeys=Object.keys(o.markers),o.initializeScript().then(function(){o.initializeMap().then(function(){o.loadMarkers()})})}})}angular.module("FieldConnectApp").controller("GoogleMapsController",e),e.$inject=["$scope","$timeout","currentCompanyService","$q"]}();;!function(){"use strict";function o(o,t,n,r,e){var l=this;l.$scope=t,l.close=function(){l.modalClass=!1,t.close(null,50)},l.latAndLngErrorList=t.latAndLngErrorList}angular.module("FieldConnectApp").controller("LocationErrorsController",o),o.$inject=["restService","$scope","$timeout","$state","$location"]}();;!function(){"use strict";function e(e,t,o,r,d,s,a,l,u,i){var m=this;m.model={},m.$state=o,m.$window=a,m.selectCustomer=p,m.selectSite=y,m.woNumber="",m.goBack=function(){a.location.reload()},m.checkTotalCount=I,I(),m.model={},m.filter={filterId:0},m.filter1={siteId:null},m.customer={customerId:0},m.customers=[],m.site={siteId:0},m.id=r.id,m.customerSiteFilter=l.filter("and"),m.customerSiteFilter.eq("WoId",m.id),m.companyWoStatus={},m.companyAssignmentStatus={},m.customerFilter=l.filter("or"),m.count=0,m.estHoursTotal=0,m.usingDSLNorthwest=i.usingDSLNorthwest,m.hideAddButton=!1,e.$watch("vd.count",function(e,t){e!==t&&(m.hideAddButton=!1,m.count>0&&m.usingDSLNorthwest&&(m.hideAddButton=!0))});var n={Type:"button",Label:"Search",onClick:p,ReadOnly:!1},c={Type:"button",Label:"Search",onClick:y,ReadOnly:!1};function p(){d.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectCustomer.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:m.customer}})}function y(){d.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectSite.html",controller:"SelectSiteDetailsController",controllerAs:"vm",inputs:{site:m.site,customerId:m.customer.customerId}})}function I(){m.model.Id&&(m.filterWoForTotalCount=l.filter("and"),m.filterWoForTotalCount.eq("WoId",m.model.Id),s.getItems("woassignments",m.filterWoForTotalCount).then(function(e){var t=e.data.Data;m.count=t.length,m.estHoursTotal=0;for(var o=0;o<t.length;o++)m.estHoursTotal=m.estHoursTotal+t[o].EstHours}))}function C(){m.model&&m.model.Id&&s.getItem("wodetails/haschild/",m.model.Id).then(function(e){var t="true"==e.data||null==e.data;n.ReadOnly=t,c.ReadOnly=t})}m.attributes=[{Type:"text",Label:"Work Order:",ReadOnly:!0,ModelValue:"AltId"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Customer:",Required:!0,MaxLength:"50",ModelValue:"CustomerName",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo",ReadOnly:!0},n,{Type:"text",Label:"Site:",Required:!0,MaxLength:"50",ModelValue:"SiteName",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo",ReadOnly:!0},c,{Type:"textarea",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Desc",Autofocus:"true"},{Type:"dropdown",Label:"Subcontractor:",ApiMethod:"subcontractorCompanies",ValueProp:"SubcontractorId",TextProp:"CompanyName",ModelValue:"SubContractorId",ConvertToInt:"true"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Address",Required:!1,MaxLength:"100",ModelValue:"Address",ReadOnly:!0},{Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"wostatuses",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"Status"},{Type:"text",Label:"Requestor:",Required:!1,MaxLength:"100",ModelValue:"ContactName"},{Type:"dropdown",Label:"Work Order Type:",Required:!1,ApiMethod:"wotypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"WoType"},{Type:"text",Label:"Phone:",MaxLength:"50",ModelValue:"ContactPhone"},{Type:"dropdown",Label:"Priority:",Required:!1,ApiMethod:"priorities",ValueProp:"PriorityName",TextProp:"PriorityName",ModelValue:"Priority"},{Type:"dropdown",Label:"Office:",Required:!0,ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true"},{Type:"dropdown",Label:"Agreement:",Required:!1,ApiMethod:"agreements/getAgreementsByCustomer",ValueProp:"Id",TextProp:"Desc",ModelValue:"AgreementId",ConvertToInt:"true",Filter:m.customerFilter},{Type:"dropdown",Label:"Payment Term:",Required:!1,ApiMethod:"paymentTerms",ValueProp:"Id",TextProp:"PaymentTermName",ModelValue:"PaymentTermId",ConvertToInt:"true"},{Type:"dropdown",Label:"Project:",Required:!1,ApiMethod:"projects/getProjectForWo",ValueProp:"Id",TextProp:"ProjectName",ModelValue:"ProjectId",ConvertToInt:"true",Filter:m.customerSiteFilter},{Type:"datepicker",Label:"Request Date:",ModelValue:"RequestDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"dropdown",Label:"Currency Code:",Required:!1,ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode"},{Type:"datepicker",Label:"Entered Date:",ModelValue:"EnteredDate",Format:"MM/dd/yyyy",ReadOnly:!0},{Type:"datepicker",Label:"Promised:",ModelValue:"PromiseDate",Required:!0,Format:"MM/dd/yyyy"},{Type:"datepicker",Label:"Entered Time:",ModelValue:"EnteredDate",Format:"hh:mm:ss a",SubType:"time"},{Type:"text",Label:"Quote Id:",Required:!1,MaxLength:"50",ModelValue:"QuoteId"},{Type:"text",Label:"Created By:",ModelValue:"CreatedBy",ReadOnly:!0},{Type:"text",Label:"External Id:",Required:!1,MaxLength:"50",ModelValue:"ExternalId"}],m.checkCustomerInfoChangeEnabled=C,C(),m.loadingIndicator=!1,e.$watch("vd.model.Id",function(){if(void 0!==m.model.Id){m.customer.customerId=m.model.CustomerId,m.site.siteId=m.model.SiteId,m.site.siteName=m.model.SiteName,m.site.title=m.model.ContactName,m.site.phone=m.model.ContactPhone,m.site.address=m.model.Address,s.getItem("settings/status?type=WOStatus").then(function(){m.companyWoStatus=s.state.item}),s.getItem("settings/status?type=AssignmentStatus").then(function(){m.companyAssignmentStatus=s.state.item,m.model.AssignmentStatus=m.companyAssignmentStatus.Value});var e=new Date(m.model.SysCreateUTC),t=moment.tz.zone(m.model.TzDatabaseName).offset(e);u.convertToLocal(e,t),s.getItem("users",m.model.SysCreatorId).then(function(){var t=s.state.item;m.model.CreatedBy=t.FirstName+" "+t.LastName+" - "+e.toLocaleString()}),I(),C()}}),e.$watch("vd.customer.customerId",function(){null!=m.customer.customerId&&m.customer.customerId>0&&m.model.CustomerId!=m.customer.customerId&&(m.model.CustomerId=m.customer.customerId,m.model.CustomerName=m.customer.customerName,m.model.SiteId=0,m.model.SiteName="",m.model.Address="",m.model.ContactName="",m.model.ContactPhone="")}),e.$watch("vd.model.CustomerId",function(){m.model.CustomerId?(m.customerFilter.reset(),m.customerFilter.eq("Status","Active"),m.customerFilter.eq("Id",m.model.AgreementId),m.customerFilter.customerId=m.model.CustomerId,m.customerSiteFilter.reset(),m.customerSiteFilter.eq("CustomerId",m.model.CustomerId).eq("WoId",m.id)):(m.customerFilter.reset(),m.customerFilter.eq("Status","Active"),m.customerFilter.eq("Id",m.model.AgreementId),m.customerFilter.customerId=0)}),e.$watch("vd.site.siteId",function(){null!=m.site.siteId&&m.site.siteId>0&&(m.model.SiteId=m.site.siteId,m.model.SiteName=m.site.siteName,m.model.ContactName=m.site.title,m.model.ContactPhone=m.site.phone,m.model.Address=m.site.address,m.filter1.siteId=m.site.siteId)}),e.$watch("vd.model.SiteId",function(){m.model.SiteId&&(m.customerSiteFilter.reset(),m.customerSiteFilter.eq("CustomerId",m.model.CustomerId).eq("WoId",m.id).eq("SiteId",m.model.SiteId))}),m.test=function(){m.$state.go("dispatchScheduling")}}angular.module("FieldConnectApp").controller("DispatchDetailsEditController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","restService","$window","qsService","timezoneService","featuresFactory"]}();;!function(){"use strict";function e(e,t,a,l,o,i,r,s,d,m,c,n){var f=this;function T(){if(void 0!==f.filterWoTableTmp.startDate){if(!c.validateDate(f.filterWoTableTmp.startDate))return}else f.filterWoTableTmp.startDate=null;if(void 0!==f.filterWoTableTmp.endDate){if(!c.validateDate(f.filterWoTableTmp.endDate))return}else f.filterWoTableTmp.endDate=null;if(void 0===f.filterWoTableTmp.startDate||void 0===f.filterWoTableTmp.endDate||c.validateDateRange(f.filterWoTableTmp.startDate,f.filterWoTableTmp.endDate)){if(f.isLoading=!0,f.filterWoTable.woTypeName=f.model.WoTypeName,f.filterWoTable.status=f.model.Status,f.filterWoTable.priority=f.model.Priority,f.filterWoTable.office=f.model.Office,f.filterWoTable.unassigned=f.model.Unassigned,f.filterWoTable.omit=f.model.Omit,""!=f.filterWoTableTmp.startDate&&null!=f.filterWoTableTmp.startDate){f.filterWoTableTmp.startDate=new Date(f.filterWoTableTmp.startDate),f.filterWoTableTmp.startDate.setHours(0,0,0,0);var t=new Date(f.filterWoTableTmp.startDate);d.convertToUtc(t),f.filterWoTable.startDate=d.buildISOString(t)}else f.filterWoTable.startDate=null;if(""!=f.filterWoTableTmp.endDate&&null!=f.filterWoTableTmp.endDate){f.filterWoTableTmp.endDate=new Date(f.filterWoTableTmp.endDate),f.filterWoTableTmp.endDate.setHours(23,59,59,999);var a=new Date(f.filterWoTableTmp.endDate);d.convertToUtc(a),f.filterWoTable.endDate=d.buildISOString(a)}else f.filterWoTable.endDate=null;u(),setTimeout(function(){f.isLoading=!1,e.$apply()},1e3)}}function u(){var e=s.filter("and");e.eq("startDate",null==f.filterWoTable.startDate?"":f.filterWoTable.startDate).eq("endDate",null==f.filterWoTable.endDate?"":f.filterWoTable.endDate).eq("woTypeName",null==f.filterWoTable.woTypeName?"":f.filterWoTable.woTypeName).eq("priority",null==f.filterWoTable.priority?"":f.filterWoTable.priority).eq("status",null==f.filterWoTable.status?"":f.filterWoTable.status).eq("office",null==f.filterWoTable.office?"":f.filterWoTable.office).eq("omit",null!=f.filterWoTable.omit&&f.filterWoTable.omit).eq("unassigned",null!=f.filterWoTable.unassigned&&f.filterWoTable.unassigned),e.page=f.filterWoTable.page,e.pageSize=f.filterWoTable.pageSize,e.total=f.filterWoTable.total,e.sortCol=f.filterWoTable.sortCol,e.sortDir=f.filterWoTable.sortDir,o.getItems("wo/filterScheduling",e).then(function(e){f.woDispatch=e.data.Data;for(var t=0;t<f.woDispatch.length;t++)if(null==f.woDispatch[t].PromiseDate)f.woDispatch[t].PromiseDate="";else{var a=d.parseISOString(f.woDispatch[t].PromiseDate);f.woDispatch[t].PromiseDate=d.convertToLocal(a)}f.woDispatchMeta=e.data.Meta,1==f.woDispatchMeta.Paging.PageSize&&(f.woDispatchMeta.Paging.PageSize=10)})}function b(){null!==f.woDispatchMeta.Paging&&(f.filterWoTable.page=f.woDispatchMeta.Paging.Page,f.filterWoTable.pageSize=f.woDispatchMeta.Paging.PageSize,u())}f.goHome=function(){a.go("home")},f.search=function(){T()},f.dateService=c,f.isLoading=!1,f.$state=a,f.deviceDetect=m,f.model={},f.edit=function(e){f.selectedTab="Work Order Details",f.filter.filterId=e,f.filterByWorkOrder={},f.filterByWorkOrder=s.filter("and"),f.filterByWorkOrder.eq("WoId",f.filter.filterId)},f.wos=[],f.getWo=u,f.toggleSort=function(e,t){if(!t)return;f.filterWoTable.sortCol!=e?(f.filterWoTable.sortCol=e,f.filterWoTable.sortDir="asc"):"asc"==f.filterWoTable.sortDir?f.filterWoTable.sortDir="desc":f.filterWoTable.sortDir="asc";u()},f.woDispatch=[],f.woDispatchMeta={},f.editWo=!1,f.selectedTab="Work Order List",f.clear=function(){f.filterWoTableTmp={startDate:null,endDate:null},f.model.WoTypeName=[],f.model.Status=[],f.model.Priority=[],f.model.Office=[],f.model.Omit=!1,f.model.Unassigned=!1},f.id=l.id,f.filter={filterId:null,siteId:null},f.filterWoTableTmp={woTypeName:"",status:"",priority:"",office:"",omit:!1,unassigned:!1,subcontractorId:0,startDate:new Date,endDate:new Date,page:1,pageSize:10,total:0,sortCol:"",sortDir:"asc"},f.filterWoTable={woTypeName:"",status:"",priority:"",office:"",omit:!1,unassigned:!1,subcontractorId:0,startDate:null,endDate:null,page:1,pageSize:10,total:0,sortCol:"",sortDir:"asc"},f.viewName="DispatchBoard",f.moduleName="SchedulingGrid",n.loadObjectPrivileges(f.viewName,f.moduleName),f.hideCol=function(e){return 0!=n.getObjectPrivilege(e)},f.attributes=[{Type:"checkbox",Label:"Omit Completed WO’s:",ModelValue:"Omit"},{Type:"checkbox",Label:"Only Unassigned WO Assignments:",ModelValue:"Unassigned"},{Type:"multiselect",Label:"Wo Type:",ApiMethod:"woTypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"WoTypeName"},{Type:"multiselect",Label:"Status:",Required:!1,ApiMethod:"wostatuses",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"Status"},{Type:"multiselect",Label:"Priority:",ApiMethod:"priorities",ValueProp:"PriorityName",TextProp:"PriorityName",ModelValue:"Priority"},{Type:"multiselect",Label:"Office:",ApiMethod:"offices",ValueProp:"OfficeName",TextProp:"OfficeName",ModelValue:"Office"}],f.attributestab=[{Name:"Work Order",ValueName:"AltId",Edit:!0,Sortable:!0,ObjectName:"colSchedWorkOrder"},{Name:"Wo Type",ValueName:"WoType",Edit:!1,Sortable:!0,ObjectName:"colSchedWoType"},{Name:"Promised Date",ValueName:"PromiseDate",FormatDate:"date",Edit:!1,Sortable:!0,ObjectName:"colSchedPromiseDate"},{Name:"Promised Time",ValueName:"PromiseDate",FormatDate:"time",Edit:!1,Sortable:!0,ObjectName:"colSchedPromiseTime"},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0,ObjectName:"colSchedStatus"},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0,ObjectName:"colSchedCustomerName"},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0,ObjectName:"colSchedSiteName"},{Name:"Full Address",ValueName:"Adress",Edit:!1,Sortable:!0,ObjectName:"colSchedAddress"},{Name:"Address",ValueName:"Address1",Edit:!1,Sortable:!0,ObjectName:"colSchedAddress1"},{Name:"Address2",ValueName:"Address2",Edit:!1,Sortable:!0,ObjectName:"colSchedAddress2"},{Name:"City",ValueName:"City",Edit:!1,Sortable:!0,ObjectName:"colSchedCity"},{Name:"State",ValueName:"StateCode",Edit:!1,Sortable:!0,ObjectName:"colSchedStateCode"},{Name:"Postal Code",ValueName:"PostalCode",Edit:!1,Sortable:!0,ObjectName:"colSchedPostalCode"},{Name:"Country",ValueName:"Country",Edit:!1,Sortable:!0,ObjectName:"colSchedCountry"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0,ObjectName:"colSchedDesc"},{Name:"Subcontractor",ValueName:"CompanyName",Edit:!1,Sortable:!0,ObjectName:"colSchedCompanyName"},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!0,ObjectName:"colSchedOfficeName"},{Name:"Agreement",ValueName:"AgreementDesc",Edit:!1,Sortable:!0,ObjectName:"colSchedAgreementDesc"}],f.loadingIndicator=!1,T(),f.newSearch=function(){f.filterWoTable.page=1,T()},f.nextPage=b,f.changeEntries=function(){f.woDispatchMeta.Paging.Page=1,b()}}angular.module("FieldConnectApp").controller("DispatchSchedulingController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","$window","$anchorScroll","qsService","timezoneService","deviceDetector","dateService","guiPrivilegeService"]}();;!function(){"use strict";function e(e,o,n,t,l,s){var c=this;c.$scope=o,c.close=function(){c.modalClass=!1,o.close(null,50)},c.clear=function(){e.update("messaging/"+o.id,c.model).then(function(){c.modalClass=!1,o.close(null,50)})},c.note=o.note,c.user=o.user,c.date=o.date,c.model={},c.model.OwnerType=o.ownerType}angular.module("FieldConnectApp").controller("MessagePopupController",e),e.$inject=["restService","$scope","$timeout","$state","$location","$window"]}();;!function(){"use strict";function e(e,t,s,l,o,r,a,i,m,n,u,c){var d=this;d.$state=o,d.id=r.id,d.deviceDetect=c,d.Filter={groupIds:""},d.filterCust={customersIds:""};var f=u.getValue("authorizationData").userRoles.split(",");d.clearTechs=function(){d.laborGroupIds=[],d.technicianIds=[]},d.clearCustomers=function(){d.customersIds=[]},d.getTechList=function(){e.getItem("employees/getTechnicianByLaborGroup").then(function(){d.listOfFullName=[],d.listOfSMS=[],d.listOfEmail=[],d.listOfEmployessId=[],d.employees=e.state.item;for(var t=0;t<d.employees.Data.length;t++)for(var s=0;s<d.technicianIds.length;s++)d.employees.Data[t].Id==d.technicianIds[s]&&(d.listOfFullName.push(d.employees.Data[t].FullName),d.listOfSMS.push(d.employees.Data[t].SMS),d.listOfEmail.push(d.employees.Data[t].Email),d.listOfEmployessId.push(d.employees.Data[t].Id));for(var l="",t=0;t<d.listOfFullName.length-1;t++)l+=d.listOfFullName[t]+", ";d.listOfFullName[d.listOfFullName.length-1]&&(l+=d.listOfFullName[d.listOfFullName.length-1]),d.listOfFullName&&(d.modelPortal.FullName=l);for(var o="",t=0;t<d.listOfSMS.length-1;t++)d.listOfSMS[t]&&(o+=d.listOfSMS[t]+"; ");d.listOfSMS[d.listOfSMS.length-1]&&(o+=d.listOfSMS[d.listOfSMS.length-1]),d.listOfSMS&&(d.modelSMS.SMS=o);for(var r="",t=0;t<d.listOfEmail.length-1;t++)d.listOfEmail[t]&&(r+=d.listOfEmail[t]+"; ");d.listOfEmail[d.listOfEmail.length-1]&&(r+=d.listOfEmail[d.listOfEmail.length-1]),d.listOfEmail&&(d.modelEmail.Email=r);for(var a=[],t=0;t<d.listOfEmployessId.length-1;t++)a+=d.listOfEmployessId[t]+",";d.listOfEmployessId[d.listOfEmployessId.length-1]&&(a+=d.listOfEmployessId[d.listOfEmployessId.length-1]),d.modelEmail.EmployeeIdList=a,d.modelSMS.EmployeeIdList=a,d.modelPortal.EmployeeIdList=a})},d.getCustomerList=function(){d.filterCust=n.filter("and"),d.filterCust.eq("Id",d.customersIds),e.getItems("customerusers?filter_op="+d.filterCust.filter_op+"&filter="+d.filterCust.filter.toString()).then(function(e){d.listOfFullName=[],d.listOfSMS=[],d.listOfEmail=[],d.listOfUserId=[],d.customers=e.data.Data;for(var t=0;t<d.customers.length;t++)for(var s=0;s<d.customersIds.length;s++)d.customers[t].Id==d.customersIds[s]&&(d.listOfFullName.push(d.customers[t].FullName),d.listOfSMS.push(d.customers[t].Phone),d.listOfEmail.push(d.customers[t].Email),d.listOfUserId.push(d.customers[t].Id));for(var l="",t=0;t<d.listOfFullName.length-1;t++)l+=d.listOfFullName[t]+", ";d.listOfFullName[d.listOfFullName.length-1]&&(l+=d.listOfFullName[d.listOfFullName.length-1]),d.listOfFullName&&(d.modelCustomerPortal.FullName=l);for(var o="",t=0;t<d.listOfSMS.length-1;t++)d.listOfSMS[t]&&(o+=d.listOfSMS[t]+"; ");d.listOfSMS[d.listOfSMS.length-1]&&(o+=d.listOfSMS[d.listOfSMS.length-1]),d.listOfSMS&&(d.modelCustomerSMS.SMS=o);for(var r="",t=0;t<d.listOfEmail.length-1;t++)d.listOfEmail[t]&&(r+=d.listOfEmail[t]+"; ");d.listOfEmail[d.listOfEmail.length-1]&&(r+=d.listOfEmail[d.listOfEmail.length-1]),d.listOfEmail&&(d.modelCustomerEmail.Email=r);for(var a=[],t=0;t<d.listOfUserId.length-1;t++)a+=d.listOfUserId[t]+",";d.listOfUserId[d.listOfUserId.length-1]&&(a+=d.listOfUserId[d.listOfUserId.length-1]),d.modelCustomerEmail.UserIdList=a,d.modelCustomerSMS.UserIdList=a,d.modelCustomerPortal.UserIdList=a})},d.sendEmail=function(){""==d.modelEmail.Note&&""==d.modelEmail.EmployeeIdList?(a.warning({message:"Please select technician(s) or type email address and message."}),i.scrollTo(0,0)):""==d.modelEmail.Note?(a.warning({message:"Please fill in message!"}),i.scrollTo(0,0)):""==d.modelEmail.EmployeeIdList?(a.warning({message:"Please fill in at least one email address."}),i.scrollTo(0,0)):e.create("messaging/email",d.modelEmail).then(function(e){200===e.status&&(a.success({message:"Email for technician was successfully sent."}),i.scrollTo(0,0))})},d.sendSMS=function(){""==d.modelSMS.Note&&""==d.modelSMS.EmployeeIdList?(a.warning({message:"Please select technician(s) or type text address and message."}),i.scrollTo(0,0)):""==d.modelSMS.Note?(a.warning({message:"Please fill in message."}),i.scrollTo(0,0)):""==d.modelSMS.EmployeeIdList?(a.warning({message:"Please fill in at least one text address."}),i.scrollTo(0,0)):e.create("messaging/sms",d.modelSMS).then(function(e){200===e.status&&(a.success({message:"SMS for technician was successfully sent."}),i.scrollTo(0,0))})},d.sendPortal=function(){""==d.modelPortal.Note&&""==d.modelPortal.EmployeeIdList?(a.warning({message:"Please select technician(s) and type message."}),i.scrollTo(0,0)):""==d.modelPortal.Note?(a.warning({message:"Please fill in message."}),i.scrollTo(0,0)):""==d.modelPortal.EmployeeIdList?(a.warning({message:"Please fill in at least one technician."}),i.scrollTo(0,0)):(d.modelPortal.ExpireDate=angular.copy(d.modelPortal.ShowExpireDate),m.convertToUtc(d.modelPortal.ExpireDate),d.modelPortal.ExpireDate=m.buildISOString(d.modelPortal.ExpireDate),e.create("messaging/portal",d.modelPortal).then(function(e){200===e.status&&(a.success({message:"Message for technician was successfully created."}),i.scrollTo(0,0))}))},d.sendCustomerPortal=function(){""==d.modelCustomerPortal.Note&&""==d.modelCustomerPortal.UserIdList?(a.warning({message:"Please select customer(s) and type message."}),i.scrollTo(0,0)):""==d.modelCustomerPortal.Note?(a.warning({message:"Please fill in message."}),i.scrollTo(0,0)):""==d.modelCustomerPortal.UserIdList?(a.warning({message:"Please fill in at least one customer."}),i.scrollTo(0,0)):(d.modelCustomerPortal.ExpireDate=angular.copy(d.modelCustomerPortal.ShowExpireDate),m.convertToUtc(d.modelCustomerPortal.ExpireDate),d.modelCustomerPortal.ExpireDate=m.buildISOString(d.modelCustomerPortal.ExpireDate),e.create("messaging/portaluser",d.modelCustomerPortal).then(function(e){200===e.status&&(a.success({message:"Message for customer was successfully created."}),i.scrollTo(0,0))}))},d.sendCustomerSMS=function(){""==d.modelCustomerSMS.Note&&""==d.modelCustomerSMS.UserIdList?(a.warning({message:"Please select customer(s) or type text addresses and message."}),i.scrollTo(0,0)):""==d.modelCustomerSMS.Note?(a.warning({message:"Please fill in message."}),i.scrollTo(0,0)):""==d.modelCustomerSMS.UserIdList?(a.warning({message:"Please fill in at least one text address."}),i.scrollTo(0,0)):e.create("messaging/smscustomer",d.modelCustomerSMS).then(function(e){200===e.status&&(a.success({message:"SMS for customer was successfully sent."}),i.scrollTo(0,0))})},d.sendCustomerEmail=function(){""==d.modelCustomerEmail.Note&&""==d.modelCustomerEmail.UserIdList?(a.warning({message:"Please select customer(s) or type email addresses and message."}),i.scrollTo(0,0)):""==d.modelCustomerEmail.Note?(a.warning({message:"Please fill in message."}),i.scrollTo(0,0)):""==d.modelCustomerEmail.UserIdList?(a.warning({message:"Please fill in at least one email address."}),i.scrollTo(0,0)):e.create("messaging/emailcustomer",d.modelCustomerEmail).then(function(e){200===e.status&&(a.success({message:"Email for customer user was successfully sent."}),i.scrollTo(0,0))})},d.tabChange=function(){l(function(){s.$apply()})},d.filterTab="Techs",d.laborGroupIds=[],d.technicianIds=[],d.customersIds=[],d.custIds=[],d.model,d.employees=[],d.currentUser={},d.TechUnavailableFilter={fullname:"",sms:"",email:""},d.companyFeature=!0,e.getItems("companyfeatures/currentCompany").then(function(e){for(var t=e.data.Data,s=0;s<t.length;s++)if("CustomerPortal"===t[s].FeatureName)return void(d.companyFeature=JSON.parse(t[s].Value.toLowerCase()))}),d.testDate=new Date,d.customerRoles=!1;for(var g=0;g<f.length;g++)"CustAdmin"==f[g]||"Cust"==f[g]?(d.customerRoles=!0,d.customerView=!0,"Techs"==d.filterTab&&(d.filterTab="Customers"),l(function(){s.$apply()})):(d.filterTab="Techs",d.customerView=!1,l(function(){s.$apply()}));d.modelPortal={Type:"Portal",From:"",Note:"",EmployeeIdList:"",CustomerIdList:""},d.modelSMS={Type:"SMS",From:"",Note:"",EmployeeIdList:"",CustomerIdList:""},d.modelEmail={Type:"Email",From:"",Note:"",EmployeeIdList:"",CustomerIdList:""},d.modelCustomerPortal={Type:"Portal",From:"",Note:"",EmployeeIdList:"",CustomerIdList:"",UserIdList:""},d.modelCustomerSMS={Type:"SMS",From:"",Note:"",EmployeeIdList:"",CustomerIdList:"",UserIdList:""},d.modelCustomerEmail={Type:"Email",From:"",Note:"",EmployeeIdList:"",CustomerIdList:"",UserIdList:""};var S=new Date;S=m.convertToUtc(S,S.getTimezoneOffset()),m.convertToLocal(S);var p=(S.getHours()+24)%24,h=S.getMinutes(),E=15*Math.floor(h/15);(E+=15)>=60&&(E="00",p+=1),S.setHours(p),S.setMinutes(E),d.loadingIndicator=!1,s.$watch("vm.laborGroupIds",function(){for(var e="",t=0;t!=d.laborGroupIds.length;t++)e+=d.laborGroupIds[t]+",";e=e.substring(0,e.length-1),d.Filter.groupIds=e}),d.filterCustomer=n.filter("or"),s.$watch("vm.custIds",function(){var e="";d.tmpList=[];for(var t=0;t!=d.custIds.length;t++)e+=d.custIds[t]+",";if(e=e.substring(0,e.length-1),d.filterCust.customersIds=e,d.filterCustomer.reset(),""!=d.filterCust.customersIds){d.tmpList=e.split(",");for(t=0;t<d.tmpList.length;t++)d.filterCustomer.eq("CustomerIdList",d.tmpList[t])}}),s.$watch("vm.filterTab",function(){d.filterTab&&("Customers"==d.filterTab?d.customerView=!0:d.customerView=!1)});var I=s.$watch("vm.modelPortal.ShowExpireDate",function(){if(d.modelPortal.ShowExpireDate){var e=angular.copy(d.modelPortal.ShowExpireDate),t=new Date,s=t.getTimezoneOffset();s=((s=s>0?24-s/60:Math.abs(s)/60)+24)%24,m.convertToUtc(t,t.getTimezoneOffset()),m.convertToLocal(t);var l=(t.getHours()+24)%24,o=t.getMinutes(),r=15*Math.floor(o/15);(r+=15)>=60&&(r="00",l+=1);var a=(e.getHours()+24)%24,i=(e.getMinutes(),e.getMinutes());a!=s||0!=i?d.modelPortal.ShowExpireDate.setHours(a):(d.modelPortal.ShowExpireDate.setHours(l),d.modelPortal.ShowExpireDate.setMinutes(r)),I()}});I=s.$watch("vm.modelCustomerPortal.ShowExpireDate",function(){if(d.modelCustomerPortal.ShowExpireDate){var e=angular.copy(d.modelCustomerPortal.ShowExpireDate),t=new Date,s=t.getTimezoneOffset();s=((s=s>0?24-s/60:Math.abs(s)/60)+24)%24,m.convertToUtc(t,t.getTimezoneOffset()),m.convertToLocal(t);var l=(t.getHours()+24)%24,o=t.getMinutes(),r=15*Math.floor(o/15);(r+=15)>=60&&(r="00",l+=1);var a=(e.getHours()+24)%24,i=(e.getMinutes(),e.getMinutes());a!=s||0!=i?d.modelCustomerPortal.ShowExpireDate.setHours(a):(d.modelCustomerPortal.ShowExpireDate.setHours(l),d.modelCustomerPortal.ShowExpireDate.setMinutes(r)),I()}});s.$watch("vm.modelPortal",function(){e.getItem("users/getCurrent").then(function(){d.currentUser=e.state.item,d.modelPortal.From=d.currentUser.FirstName+" "+d.currentUser.LastName,d.modelSMS.From=d.currentUser.FirstName+" "+d.currentUser.LastName,d.modelEmail.From=d.currentUser.FirstName+" "+d.currentUser.LastName})}),l(function(){d.customerRoles?$("#filter_tabs .fc_tab_Techs").addClass("hidden"):$("#filter_tabs .fc_tab_Techs").removeClass("hidden")},10)}angular.module("FieldConnectApp").controller("MessagingController",e),e.$inject=["restService","$location","$scope","$timeout","$state","$stateParams","Notification","$window","timezoneService","qsService","cryptoStorageService","deviceDetector"]}();;!function(){"use strict";function e(e,a,t,l,i,r,o,n,c,d,s,h){var u=this;u.isLoading=!1,u.edit=b,u.$state=i,u.$window=o,u.id=r.id,u.Filter={groupIds:""},u.dateService=h,u.viewName="techunavailable",u.model={},u.deviceDetect=s,u.filterTab="Techs",u.clearTechs=function(){u.laborGroupIds=[],u.technicianIds=[],m()},u.clearFilters=function(){},u.getTechList=m,u.edit=b,u.laborGroupIds=[],u.technicianIds=[],u.selected={selectedId:parseInt(u.id)},u.TechUnavailableFilter={techId:"",fromDate:null,toDate:null};var v={};function b(e){i.go("techUnavailableEdit",{id:e})}function m(){if(void 0!==u.TechUnavailableFilterTmp.fromDate){if(!h.validateDate(u.TechUnavailableFilterTmp.fromDate))return}else u.TechUnavailableFilterTmp.fromDate=null;if(void 0!==u.TechUnavailableFilterTmp.toDate){if(!h.validateDate(u.TechUnavailableFilterTmp.toDate))return}else u.TechUnavailableFilterTmp.toDate=null;if(void 0===u.TechUnavailableFilterTmp.fromDate||void 0===u.TechUnavailableFilterTmp.toDate||h.validateDateRange(u.TechUnavailableFilterTmp.fromDate,u.TechUnavailableFilterTmp.toDate)){if(u.isLoading=!0,u.TechUnavailableFilter.fromDate=u.TechUnavailableFilterTmp.fromDate,u.TechUnavailableFilter.toDate=u.TechUnavailableFilterTmp.toDate,""!=u.TechUnavailableFilter.fromDate&&null!=u.TechUnavailableFilter.fromDate){u.TechUnavailableFilter.fromDate=new Date(u.TechUnavailableFilter.fromDate),u.TechUnavailableFilter.fromDate.setHours(0,0,0,0);var e=new Date(u.TechUnavailableFilter.fromDate);n.convertToUtc(e),u.TechUnavailableFilter.fromDate=n.buildISOString(e)}else u.TechUnavailableFilter.fromDate=null;if(""!=u.TechUnavailableFilter.toDate&&null!=u.TechUnavailableFilter.toDate){u.TechUnavailableFilter.toDate=new Date(u.TechUnavailableFilter.toDate),u.TechUnavailableFilter.toDate.setHours(23,59,59,999);var a=new Date(u.TechUnavailableFilter.toDate);n.convertToUtc(a),u.TechUnavailableFilter.toDate=n.buildISOString(a)}else u.TechUnavailableFilter.toDate=null;for(var l="",i=0;i!=u.technicianIds.length;i++)l+=u.technicianIds[i]+",";l=l.substring(0,l.length-1),u.TechUnavailableFilter.techId=l,u.loadTable=!0;var r={};u.TechUnavailableFilterTmp.fromDate&&(r.fromDate=u.TechUnavailableFilterTmp.fromDate),u.TechUnavailableFilterTmp.toDate&&(r.toDate=u.TechUnavailableFilterTmp.toDate),u.technicianIds&&(r.technicianIds=u.technicianIds),u.laborGroupIds&&(r.laborGroupIds=u.laborGroupIds),d.getValue("lastselection_"+u.UserData.Id)&&(v=d.getValue("lastselection_"+u.UserData.Id)),v.techUnavailable=r,d.setValue("lastselection_"+u.UserData.Id,v),setTimeout(function(){u.isLoading=!1,t.$apply()},1e3)}}u.TechUnavailableFilterTmp={techId:"",fromDate:null,toDate:null},u.attributes=[{Name:"Tech",ValueName:"FullName",Edit:!0,Sortable:!0},{Name:"Starting Date",ValueName:"StartDate",FormatDate:"datetime",Sortable:!0},{Name:"Ending Date",ValueName:"EndDate",FormatDate:"datetime",Sortable:!0},{Name:"Hours",ValueName:"Hours",Sortable:!0},{Name:"Description",ValueName:"UnavailableName",Sortable:!0}],u.id?u.attributesEdit=[{Type:"dropdown",Label:"Tech:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"TechId",ConvertToInt:"true",Required:!0,CustomDivClass:"col-sm-6"},{Type:"dropdown",Label:"Type:",ApiMethod:"unavailables",ValueProp:"UnavailableName",TextProp:"UnavailableName",ModelValue:"UnavailableName",Required:!0,ConvertToInt:"true",CustomDivClass:"col-sm-6"},{Type:"datepicker",Label:"Starting Date/Time:",ModelValue:"StartDate",Format:"MM/dd/yyyy",Required:!0},{Type:"datepicker",Label:"Ending Date/Time:",ModelValue:"EndDate",Format:"MM/dd/yyyy",Required:!0},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note",Required:!0}]:u.attributesEdit=[{Type:"multiselect",Label:"Tech:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"TechId",ConvertToInt:"true",Required:!0,CustomDivClass:"col-sm-6"},{Type:"dropdown",Label:"Type:",ApiMethod:"unavailables",ValueProp:"UnavailableName",TextProp:"UnavailableName",ModelValue:"UnavailableName",Required:!0,ConvertToInt:"true",CustomDivClass:"col-sm-6"},{Type:"datepicker",Label:"Starting Date/Time:",ModelValue:"StartDate",Format:"MM/dd/yyyy",Required:!0},{Type:"datepicker",Label:"Ending Date/Time:",ModelValue:"EndDate",Format:"MM/dd/yyyy",Required:!0},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note",Required:!0}],u.loadingIndicator=!1,t.$watch("vm.technicianIds",function(){e.getItems("employees/getTechnicianByLaborGroup",{groupIds:function(e){var a="";if(e){for(var t=0;t!=e.length;t++)a+=e[t]+",";a=a.substring(0,a.length-1)}return a}(u.laborGroups)}).then(function(e){u.techs=e.data.Data})}),t.$watch("vm.laborGroupIds",function(){for(var e="",a=0;a!=u.laborGroupIds.length;a++)e+=u.laborGroupIds[a]+",";v={},u.technicianIds=[],e=e.substring(0,e.length-1),u.Filter.groupIds=e}),t.$watch("vm.model['TechId']",function(){var e=u.model.TechId;Array.isArray(e)||(u.model.EditTechID=e)}),t.$watch("vm.model.EndDate",function(e,a){e&&(u.model.EndDate.setMilliseconds(0),u.model.StartDate.setMilliseconds(0),u.model.EndDate.getTime()===u.model.StartDate.getTime()&&u.model.EndDate.setMinutes(u.model.EndDate.getMinutes()+15))}),u.UserData={},u.groupsLoaded=!1,u.groupSelected=!1,u.techLoaded=!1,u.loadTable=!1,t.$watch("vm.groupsLoaded",function(){u.groupsLoaded&&c.getCurrentUserData().then(function(e){u.UserData=e;var a=d.getValue("lastselection_"+u.UserData.Id);if(a&&a.techUnavailable){if(a.techUnavailable.fromDate?u.TechUnavailableFilterTmp.fromDate=a.techUnavailable.fromDate:u.TechUnavailableFilterTmp.fromDate=null,a.techUnavailable.toDate?u.TechUnavailableFilterTmp.toDate=a.techUnavailable.toDate:u.TechUnavailableFilterTmp.toDate=null,a.techUnavailable.laborGroupIds&&a.techUnavailable.laborGroupIds.length>0){for(var t=0;t<a.techUnavailable.laborGroupIds.length;t++)u.laborGroupIds.push(a.techUnavailable.laborGroupIds[t]);var l="";for(t=0;t!=u.laborGroupIds.length;t++)l+=u.laborGroupIds[t]+",";l=l.substring(0,l.length-1),u.Filter.groupIds=l}}else u.TechUnavailableFilter.fromDate=new Date,u.TechUnavailableFilter.toDate=new Date,u.TechUnavailableFilterTmp.fromDate=new Date,u.TechUnavailableFilterTmp.toDate=new Date;u.groupSelected=!0})}),t.$watch("vm.techLoaded",function(){u.techLoaded&&c.getCurrentUserData().then(function(e){u.UserData=e;var a=d.getValue("lastselection_"+u.UserData.Id);if(a&&a.techUnavailable&&a.techUnavailable.technicianIds)for(var t=0;t<a.techUnavailable.technicianIds.length;t++)u.technicianIds.push(a.techUnavailable.technicianIds[t]);m()})}),t.$watch("vm.TechUnavailableFilter.toDate",function(){if(u.TechUnavailableFilter.toDate){var e=n.parseISOString(u.TechUnavailableFilter.toDate);n.buildISOString(e),u.TechUnavailableFilterTmp.toDate=n.convertToLocal(e)}}),t.$watch("vm.TechUnavailableFilter.fromDate",function(){if(u.TechUnavailableFilter.fromDate){var e=n.parseISOString(u.TechUnavailableFilter.fromDate);n.buildISOString(e),u.TechUnavailableFilterTmp.fromDate=n.convertToLocal(e)}}),t.dropdownSetting={scrollable:!0,scrollableHeight:"280px",scrollableWidth:"280px",width:"200px"}}angular.module("FieldConnectApp").controller("TechUnavailableController",e),e.$inject=["restService","$location","$scope","$timeout","$state","$stateParams","$window","timezoneService","currentUserService","cryptoStorageService","deviceDetector","dateService"]}();;!function(){"use strict";function e(e,t,a,l){var r=this;r.$state=e,r.viewName="Events",r.moduleName="EventsDebugLog",r.filterBy={UserId:0,StartDate:null,EndDate:null},r.filter=t.filter("and"),r.attributes=[{Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0},{Name:"Message",ValueName:"Message",Edit:!1,Sortable:!0},{Name:"Action",ValueName:"Action",Edit:!1,Sortable:!0,ObjectName:"colEventDebugLogAction"},{Name:"Accuracy",ValueName:"Accuracy",Edit:!1,Sortable:!0,ObjectName:"colEventDebugLogAccuracy"},{Name:"Altitude",ValueName:"Altitude",Edit:!1,Sortable:!0,ObjectName:"colEventDebugLogAltitude"},{Name:"Altitude Accuracy",ValueName:"AltidudeAccuracy",Edit:!1,Sortable:!0,ObjectName:"colEventDebugLogAltitudeAccuracy"},{Name:"Heading",ValueName:"Heading",Edit:!1,Sortable:!0,ObjectName:"colEventDebugLogHeading"},{Name:"Latitude",ValueName:"Latitude",Edit:!1,Sortable:!0,ObjectName:"colEventDebugLogLatitude"},{Name:"Longitude",ValueName:"Longitude",Edit:!1,Sortable:!0,ObjectName:"colEventDebugLogLongitude"},{Name:"Speed",ValueName:"Speed",Edit:!1,Sortable:!0,ObjectName:"colEventDebugLogSpeed"},{Name:"User",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Event Date",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"}],r.filterattributesFilter=[{Type:"dropdown",Label:"User:",ApiMethod:"users/ddList",ValueProp:"Id",TextProp:"FullName",ModelValue:"UserId",ConvertToInt:"true",Required:!1},{Type:"datepicker",Label:"From:",ModelValue:"StartDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"datepicker",Label:"To:",ModelValue:"EndDate",Format:"MM/dd/yyyy",SubType:"date"}],r.search=function(){if(r.filterBy.EndDate<r.filterBy.StartDate)return l.warning({message:"To Date cannot be before From Date!"}),void(r.filterBy.EndDate=null);var e=null,t=null;r.filter.reset(),r.filter.eq("UserId",r.filterBy.UserId),null!==r.filterBy.StartDate&&(e=r.dateToUTC(r.filterBy.StartDate,"from")),r.filter.eq("StartDate",a.buildISOString(e)),null!==r.filterBy.EndDate&&(t=r.dateToUTC(r.filterBy.EndDate,"to")),r.filter.eq("EndDate",a.buildISOString(t))},r.delete=function(){},r.dateToUTC=function(e,t){var l=new Date(e);"from"===t?l.setHours(0,0,0,0):l.setHours(23,59,59,999);var r=new Date(l);return a.convertToUtc(r)}}angular.module("FieldConnectApp").controller("EventDebugLogController",e),e.$inject=["$state","qsService","timezoneService","Notification"]}();;!function(){"use strict";function e(e,t,a,l,r){var o=this;o.$state=e,o.viewName="Events",o.moduleName="EventsLog",o.filterBy={UserId:0,StartDate:null,EndDate:null,EventType:null,TableName:null},o.filter=t.filter("and"),o.attributes=[{Name:"Id",ValueName:"Id",Edit:!0,Sortable:!0,ObjectName:""},{Name:"Event Type",ValueName:"EventType",Edit:!1,Sortable:!0,ObjectName:""},{Name:"Table Name",ValueName:"TableName",Edit:!1,Sortable:!0,ObjectName:""},{Name:"Note",ValueName:"Note",Edit:!1,Sortable:!0,ObjectName:""},{Name:"User",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Event Date",ValueName:"Date",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Latitude",ValueName:"Latitude",Edit:!1,Sortable:!0,ObjectName:""},{Name:"Longitude",ValueName:"Longitude",Edit:!1,Sortable:!0,ObjectName:""}],o.filterattributesFilter=[{Type:"dropdown",Label:"User:",ApiMethod:"users/ddList",ValueProp:"Id",TextProp:"FullName",ModelValue:"UserId",ConvertToInt:"true",Required:!1},{Type:"datepicker",Label:"From:",ModelValue:"StartDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"dropdown",Label:"Event Type:",ApiMethod:"eventLog/eventTypes",ValueProp:"EventType",TextProp:"EventType",ModelValue:"EventType",ConvertToInt:"false",Required:!1},{Type:"datepicker",Label:"To:",ModelValue:"EndDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"dropdown",Label:"Table Name:",ApiMethod:"eventLog/eventTableNames",ValueProp:"TableName",TextProp:"TableName",ModelValue:"TableName",ConvertToInt:"false",Required:!1}],o.search=function(){if(o.filterBy.EndDate<o.filterBy.StartDate&&null!==o.filterBy.EndDate)return l.warning({message:"To Date cannot be before From Date!"}),void(o.filterBy.EndDate=null);var e=null,t=null;null!==o.filterBy.StartDate&&(e=o.dateToUTC(o.filterBy.StartDate,"from")),null!==o.filterBy.EndDate&&(t=o.dateToUTC(o.filterBy.EndDate,"to")),o.filter.reset(),o.filter.eq("UserId",o.filterBy.UserId).eq("EventType",o.filterBy.EventType).eq("TableName",o.filterBy.TableName),o.filter.eq("StartDate",a.buildISOString(e)).eq("EndDate",a.buildISOString(t))},o.dateToUTC=function(e,t){var l=new Date(e);"from"===t?l.setHours(0,0,0,0):l.setHours(23,59,59,999);var r=new Date(l);return a.convertToUtc(r)},o.edit=function(e){r.showModal({templateUrl:"Templates/Events/EventLog/eventLogEdit.html",controller:"EventLogEditController",controllerAs:"event",inputs:{modalTitle:"Event",id:e,onBack:o.onBack,moduleName:o.moduleName,viewName:o.viewName}}).then(function(e){e.close.then(function(){})})},o.onBack=function(e){}}angular.module("FieldConnectApp").controller("EventLogController",e),e.$inject=["$state","qsService","timezoneService","Notification","ModalService"]}();;!function(){"use strict";function e(e,a,t,l,m,o){var i=this;i.$state=a,i.id=e.id,i.model={},i.reload=!1,i.filter=t.filter("and"),i.viewName=null,i.moduleName=null;var r=o.getValue("authorizationData");i.attributes=[{Type:"text",Label:"Event Type:",ModelValue:"EventType",ReadOnly:!0},{Type:"text",Label:"Table Name:",ModelValue:"TableName",ReadOnly:!0},{Type:"text",Label:"Note:",ModelValue:"Note",ReadOnly:!0},{Type:"text",Label:"User:",ModelValue:"FullName",ReadOnly:!0},{Type:"text",Label:"Event Date:",ModelValue:"Date",ReadOnly:!0,Format:"MM/dd/yyyy"},{Type:"text",Label:"Latitude:",ModelValue:"Latitude",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Longitude:",ModelValue:"Longitude",ReadOnly:!0}],i.isLoaded=e.$watch("event.model.Id",function(e,a){if(e!==a){var t=new Date(i.model.Date),m=moment.tz.zone(r.tzDatebaseName).offset(t);l.convertToLocal(t,m),i.model.Date=moment(t).format("MM/DD/YYYY h:mm A")+" "+moment.tz(r.tzDatebaseName).zoneAbbr(),"DELETE"!==i.model.EventType&&i.loadList(),i.isLoaded()}}),i.close=function(a){e.onBack&&e.onBack(a),i.modalClass=!1,e.close(null,50)},i.loadList=function(){switch(i.model.TableName){case"WoLabor":i.filter.reset(),i.filter.eq("Id",i.model.RecordId),i.apiMethod="eventLog/woLabor",i.listAttributes=[{Name:"WO#",ValueName:"AltId",Edit:!1,Sortable:!1},{Name:"Tech",ValueName:"FullName",Edit:!1,Sortable:!1},{Name:"Work Hours",ValueName:"WorkHours",Edit:!1,Sortable:!1},{Name:"Bill Hours",ValueName:"Hours",CompareValueName:"QuoteBillHours",Edit:!1,Sortable:!1,Roles:["Admin","FieldConnect","TransAdmin","SubAdmin","Office"]},{Name:"Date",ValueName:"Date",FormatDate:"date",Edit:!1,Sortable:!1},{Name:"Labor Code",ValueName:"LaborCodeName",Edit:!1,Sortable:!1},{Name:"Pay Rate",ValueName:"PayRateName",Edit:!1,Sortable:!1},{Name:"Rate Hour",ValueName:"Rate",CompareValueName:"QuoteRate",Edit:!1,Sortable:!1,CellFormat:"decimal",Roles:["Admin","FieldConnect","TransAdmin","Office"]},{Name:"Extended Price",ValueName:"ExtendedPrice",CompareValueName:"QuoteExtendedPrice",Edit:!1,Sortable:!1,CellFormat:"decimal",Roles:["Admin","FieldConnect","TransAdmin","Office"]}],i.reload=!0;break;case"WoItem":i.filter.reset(),i.filter.eq("Id",i.model.RecordId),i.model.Note.includes("Part")?(i.apiMethod="eventLog/parts",i.listAttributes=[{Name:"WO#",ValueName:"AltId",Edit:!1,Sortable:!1},{Name:"Part Num",ValueName:"PartNum",Edit:!1,Sortable:!1},{Name:"Item Name",ValueName:"ItemName",Edit:!1,Sortable:!1},{Name:"Qty",ValueName:"Quantity",CompareValueName:"QuoteQuantity",CellFormat:"decimal",Edit:!1,Sortable:!1},{Name:"Unit Price",ValueName:"Price",CompareValueName:"QuotePrice",Edit:!1,Sortable:!1,CellFormat:"decimal",Roles:["Admin","FieldConnect","TransAdmin","Office"]},{Name:"Extended Price",ValueName:"ExtendedPrice",CompareValueName:"QuoteExtendedPrice",Edit:!1,Sortable:!1,CellFormat:"decimal",Roles:["Admin","FieldConnect","TransAdmin","Office"]},{Name:"Unit Cost",ValueName:"Cost",Edit:!1,Sortable:!1,CellFormat:"decimal",Roles:["Admin","FieldConnect","TransAdmin","Office"]},{Name:"Extended Cost",ValueName:"ExtendedCost",Edit:!1,Sortable:!1,CellFormat:"decimal",Roles:["Admin","FieldConnect","TransAdmin","Office"]}]):(i.apiMethod="eventLog/misc",i.listAttributes=[{Name:"WO#",ValueName:"AltId",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"WoItemName",Edit:!1,Sortable:!1},{Name:"Qty",ValueName:"Quantity",CompareValueName:"QuoteQuantity",CellFormat:"decimal",Edit:!1,Sortable:!1},{Name:"Unit Price",ValueName:"Price",CompareValueName:"QuotePrice",Edit:!1,Sortable:!1,CellFormat:"decimal",Roles:["Admin","FieldConnect","TransAdmin","Office"]},{Name:"Extended Price",ValueName:"ExtendedPrice",CompareValueName:"QuoteExtendedPrice",Edit:!1,Sortable:!1,CellFormat:"decimal",Roles:["Admin","FieldConnect","TransAdmin","Office"]},{Name:"Unit Cost",ValueName:"Cost",Edit:!1,Sortable:!1,CellFormat:"decimal",Roles:["Admin","FieldConnect","TransAdmin","SubAdmin","Office"]},{Name:"Extended Cost",ValueName:"ExtendedCost",Edit:!1,Sortable:!1,CellFormat:"decimal",Roles:["Admin","FieldConnect","SubAdmin","TransAdmin","Office"]}]),i.reload=!0;break;case"WoNote":i.filter.reset(),i.filter.eq("Id",i.model.RecordId),i.apiMethod="eventLog/wonotes",i.listAttributes=[{Name:"WO#",ValueName:"AltId",Edit:!1,Sortable:!1},{Name:"Note",ValueName:"Note",CompareValueName:"QuNote",Edit:!1,Sortable:!1},{Name:"Customer Viewable",ValueName:"Viewable",CompareValueName:"QuViewable",Edit:!1,Sortable:!1,CellFormat:"checkbox"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!1},{Name:"Date Time",ValueName:"SysModifyUTC",Edit:!1,Sortable:!1,FormatDate:"datetime"}],i.reload=!0;break;case"WoServiceReport":i.filter.reset(),i.filter.eq("Id",i.model.RecordId),i.apiMethod="eventLog/servicereports",i.listAttributes=[{Name:"WO#",ValueName:"AltId",Edit:!1,Sortable:!1},{Name:"Name",ValueName:"FileName",Sortable:!1},{Name:"Date",ValueName:"Date",FormatDate:"datetime",Sortable:!1},{Name:"Signed By",ValueName:"SignedBy",Sortable:!1}],i.reload=!0;break;case"WoTask":i.filter.reset(),i.filter.eq("Id",i.model.RecordId),i.apiMethod="eventLog/wotasks",i.listAttributes=[{Name:"WO#",ValueName:"AltId",Edit:!1,Sortable:!1},{Name:"Task Name",ValueName:"TaskName",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!1},{Name:"Note",ValueName:"Note",Edit:!1,Sortable:!1},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!1}],i.reload=!0;break;case"WoAttachment":i.filter.reset(),i.filter.eq("Id",i.model.RecordId),i.apiMethod="eventLog/woattachments",i.listAttributes=[{Name:"WO#",ValueName:"AltId",Edit:!1,Sortable:!1},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!1},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!1},{Name:"Attached To",ValueName:"AttachedTo",Edit:!1,Sortable:!1},{Name:"Date",ValueName:"SysCreateUTC",Edit:!1,Sortable:!1,FormatDate:"datetime"}],i.reload=!0;break;case"WoAssignment":i.filter.reset(),i.filter.eq("Id",i.model.RecordId),i.apiMethod="eventLog/woassignments",i.listAttributes=[{Name:"WO#",ValueName:"AltId",Edit:!1,Sortable:!1},{Name:"Problem Code",ValueName:"ProblemCode",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!1},{Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!1,Sortable:!1},{Name:"Technician",ValueName:"FullName",Edit:!1,Sortable:!1},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!1},{Name:"Scheduled Start Date/Time",ValueName:"EstStartDate",FormatDate:"datetime",Edit:!1,Sortable:!1}],i.reload=!0;break;case"WO":i.filter.reset(),i.filter.eq("Id",i.model.RecordId),i.apiMethod="eventLog/wos",i.listAttributes=[{Name:"Work Order",ValueName:"AltId",Edit:!1,Sortable:!1},{Name:"Wo Type",ValueName:"WoType",Edit:!1,Sortable:!1},{Name:"Promised Date",ValueName:"PromiseDate",FormatDate:"datetime",Edit:!1,Sortable:!1},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!1},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!1},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!1},{Name:"Full Address",ValueName:"Address",Edit:!1,Sortable:!1},{Name:"Site Time Zone",ValueName:"TimeZoneName",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!1},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!1},{Name:"Agreement",ValueName:"AgreementDesc",Edit:!1,Sortable:!1}],i.reload=!0;break;case"SiteNote":i.filter.reset(),i.filter.eq("Id",i.model.RecordId),i.apiMethod="eventLog/sitenotes",i.listAttributes=[{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!1},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!1},{Name:"Note",ValueName:"Note",Edit:!1,Sortable:!1},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!1},{Name:"Date Time",ValueName:"SysModifyUTC",Edit:!1,Sortable:!1,FormatDate:"datetime"}],i.reload=!0;break;case"SiteAttachment":i.filter.reset(),i.filter.eq("Id",i.model.RecordId),i.apiMethod="eventLog/siteattachments",i.listAttributes=[{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!1},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!1},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!1},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!1},{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!1}],i.reload=!0;break;case"EquipmentAttachments":i.filter.reset(),i.filter.eq("Id",i.model.RecordId),i.apiMethod="eventLog/equipmentattachments",i.listAttributes=[{Name:"Equipment",ValueName:"EquipmentName",Edit:!1,Sortable:!1},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!1},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!1},{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!1}],i.reload=!0;break;case"QuoteItem":i.filter.reset(),i.filter.eq("Id",i.model.RecordId),i.apiMethod="eventLog/quoteitems",i.listAttributes=[{Name:"Quote#",ValueName:"AltId",Edit:!1,Sortable:!1},{Name:"Part Num",ValueName:"PartNum",Edit:!1,Sortable:!1},{Name:"Item Name",ValueName:"ItemName",Edit:!1,Sortable:!1},{Name:"Qty",ValueName:"Quantity",CellFormat:"decimal",Edit:!1,Sortable:!1},{Name:"Unit Cost",ValueName:"Cost",CellFormat:"decimal",Edit:!1,Sortable:!1},{Name:"Unit Price",ValueName:"Price",CellFormat:"decimal",Edit:!1,Sortable:!1},{Name:"Type",ValueName:"SaleType",Edit:!1,Sortable:!1},{Name:"Location",ValueName:"LocationName",Edit:!1,Sortable:!1}],i.reload=!0;break;case"QuoteNote":i.filter.reset(),i.filter.eq("Id",i.model.RecordId),i.apiMethod="eventLog/quotenotes",i.listAttributes=[{Name:"Quote#",ValueName:"AltId",Edit:!1,Sortable:!1},{Name:"Note",ValueName:"Note",Edit:!1,Sortable:!1},{Name:"Customer Viewable",ValueName:"Viewable",Edit:!1,Sortable:!1,CellFormat:"checkbox"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!1},{Name:"Date Time",ValueName:"SysModifyUTC",Edit:!1,Sortable:!1,FormatDate:"datetime"}],i.reload=!0;break;case"QuoteAttachment":i.filter.reset(),i.filter.eq("Id",i.model.RecordId),i.apiMethod="eventLog/quoteattachments",i.listAttributes=[{Name:"Quote#",ValueName:"AltId",Edit:!1,Sortable:!1},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!1},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!1},{Name:"Attached To",ValueName:"AttachedTo",Edit:!1,Sortable:!1},{Name:"Date",ValueName:"SysCreateUTC",Edit:!1,Sortable:!1,FormatDate:"datetime"}],i.reload=!0;break;case"QuoteApproval":i.filter.reset(),i.filter.eq("Id",i.model.RecordId),i.apiMethod="eventLog/quoteapprovals",i.listAttributes=[{Name:"Quote#",ValueName:"AltId",Edit:!1,Sortable:!1},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!1},{Name:"Assigned To",ValueName:"AssignedTo",Edit:!1,Sortable:!1,CellFormat:"multiline",Separator:"<br>"},{Name:"Completed Date",ValueName:"CompletedDate",FormatDate:"datetime",Edit:!1,Sortable:!1},{Name:"Completed By",ValueName:"CompletedBy",Edit:!1,Sortable:!1}],i.reload=!0}}}angular.module("FieldConnectApp").controller("EventLogEditController",e),e.$inject=["$scope","$state","qsService","timezoneService","Notification","cryptoStorageService"]}();;!function(){"use strict";function t(t,e,a,o,l,n,r,m,i){var s=this;s.autoFilter=o.filter("and"),s.$state=a,s.getDpsUrl=d,s.autoFilterSite=o.filter("and"),s.autoFilterServiceableItem=o.filter("and"),s.filter={filterId:null},s.UsertName="",s.UserData={},s.DPDDocumentName="",s.Date=new Date,s.Date=moment().subtract(10,"days").calendar()+" "+moment().format("h:mm A"),s.reloadFilter=!0,$(window).focus(function(){s.reloadFilter=!1,t.$apply(),s.reloadFilter=!0,t.$apply()}),s.attributes=[{Name:"Name",ValueName:"Name",Sortable:!0},{Name:"",CellFormat:"template",CellFormatData:{TemplateUrl:"Templates/Form/createEditFormTableCell.html",onCreate:function(t){var e=l.open("","_blank"),a=o.filter("and");a.eq("WoId",s.woId),a.eq("FormTemplateId",t.FormTemplateId),r.getItem("forms/hasRecord?filter_op="+a.filter_op+"&filter="+a.filter.toString()).then(function(){"false"==r.state.item?(s.DPDDocumentName=t.Name,e.location.href=t.DPSURL+"/Document/Edit?templateID="+t.DPSTemplateId+"&WorkOrderId="+s.woId+"&DocumentName="+s.DPDDocumentName):(e.close(),l.location.reload())})}}}],s.drilldownSettings={ApiMethod:"forms",FilterFields:{FormTemplateId:"Id"},attributes:[{Name:"Name",ValueName:"Name",Sortable:!0},{Name:"Created By",ValueName:"CreatedBy",Sortable:!0},{Name:"Date",ValueName:"Date",FormatDate:"datetime",Sortable:!0},{Name:"Action",CellFormat:"template",CustomHeaderClass:"form-action",CellFormatData:{TemplateUrl:"openEditView.html",onEdit:function(t){l.open(t.DPSURL+"/Document/Edit/"+t.DPSDocumentId+"?templateID="+t.DPSTemplateId,"_blank")},onView:function(t){l.open(t.DPSURL+"/Document/Print/"+t.DPSDocumentId+"?templateID="+t.DPSTemplateId+"&printOrientation=Portrait","_blank")},onComplete:function(t){s.status={Status:"Completed"},r.update("forms/"+t.Id,s.status).then(function(){t.Status="Completed"})},onReopen:function(t){s.status={Status:"In Progress"},r.update("forms/"+t.Id,s.status).then(function(){t.Status="In Progress"})},onEmail:function(t){var e={URL:t.DPSURL+"/Document/Print/"+t.DPSDocumentId+"?templateID="+t.DPSTemplateId+"&printOrientation=Portrait",Name:t.Name};m.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/formEmail.html",controller:"WoFormSendEmailController",controllerAs:"vm",inputs:{model:e}}).then(function(t){t.close.then(function(){ctrl.reloadTable=!1,$timeout(function(){ctrl.reloadTable=!0})})})}}}]},i.getCurrentUserData().then(function(t){s.UserData=t,s.UserName=s.UserData.FirstName+" "+s.UserData.LastName});var u=['<button class="btn btn-default" ng-click="attr.CellFormatData.onCreate(item)">New</button>'].join("");n.put("Templates/Form/createEditFormTableCell.html",u);var c=['<button class="btn btn-default" ng-click="attr.CellFormatData.onEdit(item)" ng-if="item.Status == \'In Progress\'">Edit</button>','<button class="btn btn-default" ng-click="attr.CellFormatData.onView(item)" ng-if="item.Status == \'Completed\'">View</button>','<button class="btn btn-default" ng-click="attr.CellFormatData.onComplete(item)" ng-if="item.Status == \'In Progress\'">Complete</button>','<button class="btn btn-default" ng-click="attr.CellFormatData.onReopen(item)" ng-if="item.Status == \'Completed\'">Reopen</button>','<button class="btn btn-default" ng-click="attr.CellFormatData.onEmail(item)" ng-if="item.Status == \'Completed\'">Email</button>','<a class="btn btn-delete" ng-click="vm.remove(item.Id)" style="float:right; line-height: 40px;" data-original-title="Remove" data-toggle="tooltip" ng-if="item.Id && item.Id != 0"><i class="fa fa-times-circle"></i></a>'].join("");function d(){}n.put("openEditView.html",c)}angular.module("FieldConnectApp").controller("FormController",t),t.$inject=["$scope","$location","$state","qsService","$window","$templateCache","restService","ModalService","currentUserService"]}();;!function(){"use strict";function t(t,o,e,r,a){var n=this;n.$state=e,n.model={},n.attributes=[{Type:"multiselect",Label:"Subcontractor:",ApiMethod:"subcontractorCompanies",ValueProp:"SubcontractorId",TextProp:"CompanyName",ModelValue:"SubcontractorId",ConvertToInt:"true"}],n.id=r.id,n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("FormEditController",t),t.$inject=["$scope","$location","$state","$stateParams","restService"]}();;!function(){"use strict";function e(e,t,o,m,r,l,a,d,s,i,u,n,c,p){var C=this;C.model={},C.filterFormsTmp={formTemplate:null,status:null,startDate:null,endDate:null},C.dateService=p,C.deviceDetect=c,C.tmpSiteId=0,C.isLoading=!1,C.customer={customerId:0},C.site={siteId:0},C.selectCustomer=N,C.selectSite=T,C.autoFilter=m.filter("and"),C.autoFilterServiceableItem=m.filter("and"),C.autoFilterSite=m.filter("and"),C.$state=o,C.autoFilterType=m.filter("and"),C.sitesForCustomer=[],C.loadFilter=v;var S={Type:"button",Label:"Search",onClick:N},I={Type:"button",Label:"Search",onClick:T};C.siteAutocompleteFilter=m.filter("or"),C.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],C.searchColsSite=["Search"],C.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}],C.ddlgridattrsSite=[{Name:"Customer",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Site Code",ValueName:"SiteCode",Sortable:!0,CellFormat:"label"},{Name:"Site Name",ValueName:"SiteName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"FullAddress",Sortable:!0,CellFormat:"label"}];var F={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:b,SearchTrigger:1,Label:"Customer:",Required:!1,ApiMethod:"customers/active",ModelValue:"CustomerName",Id:"CustomerName",GridAttributes:C.ddlgridattrsCustomer,PageSize:22,SearchCols:C.searchColsCustomer},f={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:function(t){t.SiteCode&&""!=t.SiteCode?C.model.SiteName=t.SiteCode+" - "+t.SiteName:C.model.SiteName=t.SiteName;C.model.SiteId=t.Id,C.SiteNameTemp=C.model.SiteName,(!C.model.CustomerId||0===C.model.CustomerId&&t.CustomerId)&&a.getItem("customers/",t.CustomerId).then(function(t){var o=t.data;o.CreditHold?bootbox.confirm("The customer "+o.CustomerName+" is on credit hold!",function(t){s(function(){t?(C.model.CustomerId=o.Id,C.siteAutocompleteFilter.reset(),C.siteAutocompleteFilter.eq("CustomerId",o.Id),o.CustomerCode&&""!=o.CustomerCode?C.model.CustomerName=o.CustomerCode+" - "+o.CustomerName:C.model.CustomerName=o.CustomerName,C.CustomerNameTemp=C.model.CustomerName):(C.model.SiteName=null,C.SiteNameTemp=null,C.model.SiteId=null),e.$apply()})}):(C.model.CustomerId=o.Id,o.CustomerCode&&""!=o.CustomerCode?C.model.CustomerName=o.CustomerCode+" - "+o.CustomerName:C.model.CustomerName=o.CustomerName,C.CustomerNameTemp=C.model.CustomerName,C.siteAutocompleteFilter.reset(),C.siteAutocompleteFilter.eq("CustomerId",o.Id))})},SearchTrigger:1,Label:"Site:",Required:!1,ApiMethod:"sites/searchgrid",ModelValue:"SiteName",filter:C.siteAutocompleteFilter,Id:"SiteName",GridAttributes:C.ddlgridattrsSite,PageSize:22,SearchCols:C.searchColsSite};function N(){var e="";if(C.model.CustomerId)e=angular.copy(C.model.CustomerName);else if(C.CustomerNameTemp){e=angular.copy(C.CustomerNameTemp);C.CustomerNameTemp=""}i.showModal({templateUrl:"Templates/Form/selectCustomerForForm.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:C.customer,customerName:e,onSelect:b}}).then(function(e){e.close.then(function(){})})}function T(e){var t="";if(C.model.SiteId)t=angular.copy(C.model.SiteName);else if(C.SiteNameTemp){t=angular.copy(C.SiteNameTemp);C.SiteNameTemp=""}i.showModal({templateUrl:"Templates/Form/selectSiteForForm.html",controller:"SelectSiteController",controllerAs:"vm",inputs:{site:C.site,customerId:C.model.CustomerId,siteName:t,onSelect:C.setSiteFromPopup}}).then(function(e){e.close.then(function(){})})}function b(e){e.CustomerCode&&""!=e.CustomerCode?C.model.CustomerName=e.CustomerCode+" - "+e.CustomerName:C.model.CustomerName=e.CustomerName,C.CustomerNameTemp=C.model.CustomerName,C.model.CustomerId=e.Id,C.model.SiteId=null,C.model.SiteName=null,C.SiteNameTemp=null,C.tmpFilter=m.filter("and"),C.tmpFilter.eq("CustomerId",e.Id),C.siteAutocompleteFilter.reset(),C.siteAutocompleteFilter.eq("CustomerId",e.Id),a.getItems("sites",C.tmpFilter).then(function(e){C.sitesForCustomers=e.data.Data;for(var t=0;t<C.sitesForCustomers.length;t++)C.sitesForCustomer.push(C.sitesForCustomers[t].Id);C.autoFilterServiceableItem.reset(),C.autoFilterServiceableItem.eq("SiteId",C.sitesForCustomer)})}C.attributes=[{Type:"dropdown",Label:"Form:",ApiMethod:"formTemplates/gettemplatefordropdown",ValueProp:"Id",TextProp:"Name",ModelValue:"TemplateId"},{Type:"checkbox",Label:"Show completed forms",ModelValue:"Status"},{Type:"dropdown",Label:"Work Order Type:",ApiMethod:"wotypes",ValueProp:"Id",TextProp:"WoTypeName",ModelValue:"WoTypeId",ConvertToInt:"true"},{Type:"dropdown",Label:"Problem Code:",ApiMethod:"problemcodes",ValueProp:"Id",TextProp:"ProblemCodeName",ModelValue:"ProblemCodeId",ConvertToInt:"true"},F,S,f,I,{Type:"dropdown",Label:"Serviceable Item:",ApiMethod:"serviceableitems",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",ConvertToInt:"true",Filter:C.autoFilterServiceableItem}],e.$watch("vm.customer.customerId",function(){null!=C.customer.customerId&&C.customer.customerId>0&&C.model.CustomerId!=C.customer.customerId?(C.tmpFilter=m.filter("and"),C.tmpFilter.eq("CustomerId",C.customer.customerId),C.siteAutocompleteFilter.reset(),C.siteAutocompleteFilter.eq("CustomerId",C.customer.customerId),a.getItems("sites",C.tmpFilter).then(function(e){C.sitesForCustomers=e.data.Data;for(var t=0;t<C.sitesForCustomers.length;t++)C.sitesForCustomer.push(C.sitesForCustomers[t].Id);C.autoFilterServiceableItem.reset(),C.autoFilterServiceableItem.eq("SiteId",C.sitesForCustomer)})):(C.autoFilterServiceableItem.reset(),C.autoFilterServiceableItem.eq("SiteId",C.tmpSiteId))},!0),C.CustomerNameTemp="",C.SiteNameTemp="",e.$on("CustomerNameSearching",function(e,t){C.model.CustomerId=null,C.model.SiteId=null,C.model.SiteName=null,C.SiteNameTemp=null,C.siteAutocompleteFilter.reset()}),e.$on("SiteNameSearching",function(e,t){C.model.SiteId=null}),C.focusOut=function(e){e&&e.hasOwnProperty("FocusOut")&&e.FocusOut&&("CustomerName"===e.ModelValue&&(C.CustomerNameTemp=angular.copy(C.model.CustomerName),null==C.model.CustomerId&&(C.model.CustomerName=null)),"SiteName"===e.ModelValue&&(C.SiteNameTemp=angular.copy(C.model.SiteName),null==C.model.SiteId&&(C.model.SiteName=null)))},C.setSiteFromPopup=function(t){t.SiteCode&&""!=t.SiteCode?C.model.SiteName=t.SiteCode+" - "+t.SiteName:C.model.SiteName=t.SiteName;C.model.SiteId=t.Id,C.SiteNameTemp=C.model.SiteName,(!C.model.CustomerId||0===C.model.CustomerId&&t.CustomerId)&&a.getItem("customers/",t.CustomerId).then(function(t){var o=t.data;o.CreditHold?bootbox.confirm("The customer "+o.CustomerName+" is on credit hold!",function(t){s(function(){t?(C.model.CustomerId=o.Id,C.siteAutocompleteFilter.reset(),C.siteAutocompleteFilter.eq("CustomerId",o.Id),o.CustomerCode&&""!=o.CustomerCode?C.model.CustomerName=o.CustomerCode+" - "+o.CustomerName:C.model.CustomerName=o.CustomerName,C.CustomerNameTemp=C.model.CustomerName):(C.model.SiteName=null,C.SiteNameTemp=null,C.model.SiteId=null),e.$apply()})}):(C.model.CustomerId=o.Id,C.siteAutocompleteFilter.reset(),C.siteAutocompleteFilter.eq("CustomerId",o.Id),o.CustomerCode&&""!=o.CustomerCode?C.model.CustomerName=o.CustomerCode+" - "+o.CustomerName:C.model.CustomerName=o.CustomerName,C.CustomerNameTemp=C.model.CustomerName)})},e.$watch("vm.model.Status",function(){s(function(){for(var e=0;e<C.autoFilterType.filter.length;e++)"Completed"==C.autoFilterType.filter[e].split(":")[0]&&C.autoFilterType.filter.splice(e,1);if(C.model.Status){for(e=0;e<C.autoFilterType.filter.length;e++)"Completed"==C.autoFilterType.filter[e].split(":")[0]&&C.autoFilterType.filter.splice(e,1);C.autoFilterType.eq("Completed","Completed")}else for(e=0;e<C.autoFilterType.filter.length;e++)"Completed"==C.autoFilterType.filter[e].split(":")[0]&&C.autoFilterType.filter.splice(e,1)},100)}),e.$watch("vm.model.TemplateId",function(){for(var e=0;e<C.autoFilterType.filter.length;e++)"FormTemplateId"==C.autoFilterType.filter[e].split(":")[0]&&C.autoFilterType.filter.splice(e,1);C.model.TemplateId&&C.autoFilterType.eq("FormTemplateId",C.model.TemplateId)}),C.attributesGrid=[{Name:"Type",ValueName:"Type",Sortable:!0},{Name:"Date",ValueName:"Date",FormatDate:"date",Sortable:!0},{Name:"Associate",ValueName:"Associate",Sortable:!0},{Name:"Name",ValueName:"Name",Sortable:!0},{Name:"Completed By",ValueName:"CompletedBy",Sortable:!0},{Name:"Customer",ValueName:"Customer",Sortable:!0},{Name:"Site",ValueName:"Site",Sortable:!0},{Name:"Serviceable Item",ValueName:"ServiceableItem",Sortable:!0},{Name:"",CellFormat:"template",CellFormatData:{TemplateUrl:"openEditView.html",onView:function(e){r.open(e.DPSURL+"/Document/Print/"+e.DPSDocumentId+"?templateID="+e.DPSTemplateId+"&printOrientation=Portrait","_blank")}}}];var h=['<button class="btn btn-default" ng-click="attr.CellFormatData.onView(item)">View</button>'].join("");function v(){if(void 0!==C.filterFormsTmp.startDate){if(!p.validateDate(C.filterFormsTmp.startDate))return}else C.filterFormsTmp.startDate=null;if(void 0!==C.filterFormsTmp.endDate){if(!p.validateDate(C.filterFormsTmp.endDate))return}else C.filterFormsTmp.endDate=null;if(void 0===C.filterFormsTmp.startDate||void 0===C.filterFormsTmp.endDate||p.validateDateRange(C.filterFormsTmp.startDate,C.filterFormsTmp.endDate)){if(C.isLoading=!0,C.autoFilter.reset(),C.autoFilterType.reset(),void 0!==C.model.TemplateId&&C.autoFilter.eq("FormTemplateId",C.model.TemplateId),void 0!==C.model.WoTypeId&&C.autoFilter.eq("WoTypeId",C.model.WoTypeId),void 0!==C.model.ProblemCodeId&&C.autoFilter.eq("ProblemCodeId",C.model.ProblemCodeId),void 0!==C.model.CustomerId&&C.autoFilter.eq("CustomerId",C.model.CustomerId),void 0!==C.model.SiteId&&C.autoFilter.eq("SiteId",C.model.SiteId),void 0!==C.model.ServiceableItemId&&C.autoFilter.eq("ServiceableItemId",C.model.ServiceableItemId),C.model.Status&&(C.autoFilter.eq("Completed","Completed"),C.autoFilterType.eq("Completed","Completed")),""!=C.filterFormsTmp.startDate&&null!=C.filterFormsTmp.startDate){C.filterFormsTmp.startDate=new Date(C.filterFormsTmp.startDate),C.filterFormsTmp.startDate.setHours(0,0,0,0);var t=new Date(C.filterFormsTmp.startDate);d.convertToUtc(t),C.autoFilter.eq("StartDate",d.buildISOString(t)),C.autoFilterType.eq("StartDate",d.buildISOString(t))}if(""!=C.filterFormsTmp.endDate&&null!=C.filterFormsTmp.endDate){C.filterFormsTmp.endDate=new Date(C.filterFormsTmp.endDate),C.filterFormsTmp.endDate.setHours(23,59,59,999);var o=new Date(C.filterFormsTmp.endDate);d.convertToUtc(o),C.autoFilter.eq("EndDate",d.buildISOString(o)),C.autoFilterType.eq("EndDate",d.buildISOString(o))}C.loadTable=!0;var m={};void 0!==C.model.TemplateId&&(m.TemplateId=C.model.TemplateId),void 0!==C.model.WoTypeId&&(m.WoTypeId=C.model.WoTypeId),void 0!==C.model.ProblemCodeId&&(m.ProblemCodeId=C.model.ProblemCodeId),void 0!==C.model.CustomerId&&(m.CustomerId=C.model.CustomerId),void 0!==C.model.SiteId&&(m.SiteId=C.model.SiteId),void 0!==C.model.ServiceableItemId&&(m.ServiceableItemId=C.model.ServiceableItemId),(C.model.Status||!1===C.model.Status)&&(m.Status=C.model.Status),C.filterFormsTmp.startDate&&(m.startDate=C.filterFormsTmp.startDate),C.filterFormsTmp.endDate&&(m.endDate=C.filterFormsTmp.endDate),C.model.CustomerName&&(m.CustomerName=C.model.CustomerName),C.model.SiteName&&(m.SiteName=C.model.SiteName);var r={};n.getValue("lastselection_"+C.UserData.Id)&&(r=n.getValue("lastselection_"+C.UserData.Id)),r.formSearch=m,n.setValue("lastselection_"+C.UserData.Id,r),setTimeout(function(){C.isLoading=!1,e.$apply()},1e3)}}l.put("openEditView.html",h),e.$watch("vm.model",function(){s(function(){C.autoFilter.eq("Completed","Completed"),C.autoFilterType.eq("Completed","Completed")},100)}),C.UserData={},C.loadTable=!1,u.getCurrentUserData().then(function(e){C.isLoading=!0,C.UserData=e;var t=n.getValue("lastselection_"+C.UserData.Id);t&&t.formSearch?s(function(){t.formSearch.WoTypeId&&(C.model.WoTypeId=t.formSearch.WoTypeId),t.formSearch.ProblemCodeId&&(C.model.ProblemCodeId=t.formSearch.ProblemCodeId),t.formSearch.CustomerId&&(C.model.CustomerId=t.formSearch.CustomerId),t.formSearch.SiteId&&(C.model.SiteId=t.formSearch.SiteId),t.formSearch.ServiceableItemId&&(C.model.ServiceableItemId=t.formSearch.ServiceableItemId),(t.formSearch.Status||!1===t.formSearch.Status)&&(C.model.Status=t.formSearch.Status),t.formSearch.startDate?C.filterFormsTmp.startDate=t.formSearch.startDate:C.filterFormsTmp.startDate=null,t.formSearch.endDate?C.filterFormsTmp.endDate=t.formSearch.endDate:C.filterFormsTmp.endDate=null,t.formSearch.CustomerName&&(C.model.CustomerName=t.formSearch.CustomerName),t.formSearch.SiteName&&(C.model.SiteName=t.formSearch.SiteName),t.formSearch.TemplateId&&(C.model.TemplateId=t.formSearch.TemplateId),v()}):(C.filterFormsTmp.startDate=new Date,C.filterFormsTmp.endDate=new Date,C.model.Status=!0,v())})}angular.module("FieldConnectApp").controller("FormSearchController",e),e.$inject=["$scope","$location","$state","qsService","$window","$templateCache","restService","timezoneService","$timeout","ModalService","currentUserService","cryptoStorageService","deviceDetector","dateService"]}();;!function(){"use strict";function e(e,t,a,i,o,n,r,l){var u=this;u.isLoading=!0,u.edit=function(e){void 0!=e?a.go("formTemplateEdit",{id:e}):i.open(m+"/Template/Edit","_blank")},u.$state=a,u.getDpsUrl=p,u.getCurrentUserId=d;var m="";function p(){u.autoFilterConfig.reset(),u.autoFilterConfig.eq("appSetting","Dps_Url"),n.getItems("configs",u.autoFilterConfig).then(function(e){for(var t=e.data.Data,a=0;a<t.length;a++)"Dps_Url"==t[a].AppSettingName&&(m=t[a].Value)})}function d(){n.getItems("formtemplates/getcurrentuser").then(function(e){e.data.Data[0].Id})}u.reloadFilter=!0,u.autoFilterConfig=o.filter("and"),$(window).focus(function(){u.reloadFilter=!1,e.$apply(),u.reloadFilter=!0,e.$apply()}),u.attributes=[{Name:"Configured forms",ValueName:"DPSTemplateName",Sortable:!0},{Name:"Published",ValueName:"Published"},{Name:"",ValueName:"EditProperties",Edit:"true"},{Name:"",ValueName:"EditDPSTemplate",CellFormatData:{onClick:function(e){l.getValue("authorizationData")&&i.open(m+"/Template/Edit/"+e.DPSTemplateId,"_blank")},Text:"Edit Template"},CellFormat:"button"}],p(),d(),setTimeout(function(){u.isLoading=!1,e.$apply()},1e3)}angular.module("FieldConnectApp").controller("FormTemplateController",e),e.$inject=["$scope","$location","$state","$window","qsService","restService","currentCompanyService","cryptoStorageService"]}();;!function(){"use strict";function e(e,t,o,l,r,a,i){var m=this;m.workOrder=!0,m.misc=!1,m.site=!1,m.autoFilterCustomer=a.filter("and"),m.autoFilterSite=a.filter("and"),m.autoFilterServiceableItem=a.filter("and"),e.$watch("vm.model.SearchCustomer",function(){m.autoFilterCustomer.reset(),""!=m.model.SearchCustomer&&void 0!=m.model.SearchCustomer&&m.autoFilterCustomer.like("CustomerName","%"+m.model.SearchCustomer+"%")}),e.$watch("vm.model.SearchSite",function(){m.autoFilterSite.reset(),""!=m.model.SearchSite&&void 0!=m.model.SearchSite&&m.autoFilterSite.like("SiteName","%"+m.model.SearchSite+"%"),void 0!==m.model.CustomerIds&&m.model.CustomerIds.length>0&&m.autoFilterSite.eq("CustomerId",m.model.CustomerIds)}),e.$watch("vm.model.CustomerIds",function(e,t){e!==t&&i(function(){void 0!==m.model.CustomerIds&&m.model.CustomerIds.length>0&&(m.autoFilterSite.reset(),""!=m.model.SearchSite&&void 0!=m.model.SearchSite&&m.autoFilterSite.like("SiteName","%"+m.model.SearchSite+"%"),m.autoFilterSite.eq("CustomerId",m.model.CustomerIds))},100)}),e.$watch("vm.type",function(){void 0!==m.type&&("Miscellaneous"==m.type.name?(m.misc=!0,m.workOrder=!1,m.site=!1):"SiteEquipment"==m.type.name?(m.site=!0,m.misc=!1,m.workOrder=!1):"WorkOrder"==m.type.name&&(m.workOrder=!0,m.misc=!1,m.site=!1))},!0),m.$state=o,m.model={},m.attributesMisc=[{Type:"text",Label:"",MaxLength:"20",ModelValue:"TemplateType",CustomDivClass:"hidden"}],m.attributes=[{Type:"multiselect",Label:"Work Order Type:",ApiMethod:"wotypes",ValueProp:"Id",TextProp:"WoTypeName",ModelValue:"WoTypeIds",ConvertToInt:"true",ShowAll:!0},{Type:"multiselect",Label:"Problem Code:",ApiMethod:"problemcodes",ValueProp:"Id",TextProp:"ProblemCodeName",ModelValue:"ProblemCodeIds",ConvertToInt:"true",ShowAll:!0},{Type:"text",Label:"Search Customer:",MaxLength:"50",ModelValue:"SearchCustomer"},{Type:"text",Label:"Search Site:",MaxLength:"50",ModelValue:"SearchSite"},{Type:"multiselect",Label:"Customer:",ApiMethod:"customers/getcustomer",ValueProp:"Id",TextProp:"CustomerName",ModelValue:"CustomerIds",ConvertToInt:"true",Filter:m.autoFilterCustomer,ShowAll:!0},{Type:"multiselect",Label:"Site:",ApiMethod:"sites",ValueProp:"Id",TextProp:"SiteName",ModelValue:"SiteIds",ConvertToInt:"true",Filter:m.autoFilterSite,ShowAll:!0},{Type:"checkbox",Label:"Mandatory",ModelValue:"Mandatory"},{Type:"text",Label:"",MaxLength:"20",ModelValue:"TemplateType",CustomDivClass:"hidden"}],m.attributesSite=[{Type:"multiselect",Label:"Work Order Type:",ApiMethod:"wotypes",ValueProp:"Id",TextProp:"WoTypeName",ModelValue:"WoTypeIds",ConvertToInt:"true",ShowAll:!0},{Type:"multiselect",Label:"Problem Code:",ApiMethod:"problemcodes",ValueProp:"Id",TextProp:"ProblemCodeName",ModelValue:"ProblemCodeIds",ConvertToInt:"true",ShowAll:!0},{Type:"text",Label:"Search Customer:",MaxLength:"50",ModelValue:"SearchCustomer"},{Type:"text",Label:"Search Site:",MaxLength:"50",ModelValue:"SearchSite"},{Type:"multiselect",Label:"Customer:",ApiMethod:"customers",ValueProp:"Id",TextProp:"CustomerName",ModelValue:"CustomerIds",ConvertToInt:"true",Filter:m.autoFilterCustomer,ShowAll:!0},{Type:"multiselect",Label:"Site:",ApiMethod:"sites",ValueProp:"Id",TextProp:"SiteName",ModelValue:"SiteIds",ConvertToInt:"true",Filter:m.autoFilterSite,ShowAll:!0},{Type:"text",Label:"",MaxLength:"20",ModelValue:"TemplateType",CustomDivClass:"hidden"}],m.id=l.id;var d=e.$watch("vm.model.TemplateType",function(){void 0!==m.model.TemplateType&&(null!==m.model.TemplateType?(m.type={name:m.model.TemplateType},d()):m.type={name:"WorkOrder"})});e.$watch("vm.model",function(){void 0!==m.model.TemplateType&&(m.misc?m.model.TemplateType="Miscellaneous":m.site?m.model.TemplateType="SiteEquipment":m.workOrder&&(m.model.TemplateType="WorkOrder"))},!0),m.loadingIndicator=!1}angular.module("FieldConnectApp").controller("FormTemplateEditController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","qsService","$timeout"]}();;!function(){"use strict";function e(e,t,a,o){var l=this;l.edit=!1,l.customers=[],l.model={},l.$scope=e,l.close=function(){l.modalClass=!1,e.close(null,50)},l.customerId=0,l.customerName="",l.currencyCode="",l.paymentTermId="",l.creditHold=!1,l.search=function(){l.autoFilterCustomer.reset(),""!=l.customerFilter.search&&l.autoFilterCustomer.like("CustomerName","%"+l.customerFilter.search+"%")},l.autoFilterCustomer=o.filter("or"),l.autoFilterCustomer.eq("Status","Active"),l.FilterStatusCustomer={filterId:"Customer"},l.customerFilter={search:""},e.customerName&&""!=e.customerName&&(l.customerFilter.search=e.customerName,l.autoFilterCustomer.like("CustomerName","%"+l.customerFilter.search+"%")),e.$watch("vm.model.IsDifferentBillingInfo",function(){l.model.IsDifferentBillingInfo?(l.attributesEdit[20].Type="line",l.attributesEdit[21].Type="text",l.attributesEdit[22].Type="text",l.attributesEdit[23].Type="text",l.attributesEdit[24].Type="text",l.attributesEdit[25].Type="text",l.attributesEdit[26].Type="text",l.attributesEdit[27].Type="text",l.attributesEdit[28].Type="dropdown",l.attributesEdit[29].Type="text",l.attributesEdit[30].Type="dropdown",l.attributesEdit[31].Type="text",l.attributesEdit[32].Type="text"):(l.attributesEdit[20].Type="empty",l.attributesEdit[21].Type="empty",l.attributesEdit[22].Type="empty",l.attributesEdit[23].Type="empty",l.attributesEdit[24].Type="empty",l.attributesEdit[25].Type="empty",l.attributesEdit[26].Type="empty",l.attributesEdit[27].Type="empty",l.attributesEdit[28].Type="empty",l.attributesEdit[29].Type="empty",l.attributesEdit[30].Type="empty",l.attributesEdit[31].Type="empty",l.attributesEdit[32].Type="empty")}),l.attributes=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0},{Name:"Address",ValueName:"ContactAddress",Sortable:!0},{Name:"Contact",ValueName:"ContactName",Sortable:!0},{Name:"Phone",ValueName:"Phone",Sortable:!0},{Name:"Email",ValueName:"Email",Sortable:!0},{Name:"Bill To",ValueName:"BillContactName",Sortable:!0},{Name:"Bill Address",ValueName:"BillAddress",Sortable:!0}],l.attributesEdit=[{Type:"text",Label:"Customer Code:",MaxLength:"50",ModelValue:"CustomerCode",Required:!0,Autofocus:"true"},{Type:"dropdown",Label:"Office:",Required:!0,ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true"},{Type:"text",Label:"Customer Name:",MaxLength:"50",ModelValue:"CustomerName",Required:!0,Autofocus:"true"},{Type:"text",Label:"Contact Title:",MaxLength:"50",ModelValue:"ContactTitle",Requried:!0},{Type:"text",Label:"Address:",MaxLength:"100",ModelValue:"Address1"},{Type:"text",Label:"First Name:",MaxLength:"50",ModelValue:"ContactFirstName"},{Type:"text",Label:"",MaxLength:"100",ModelValue:"Address2"},{Type:"text",Label:"Last Name:",MaxLength:"50",ModelValue:"ContactLastName"},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"City"},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"ContactPhone"},{Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"StateCode"},{Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"ContactFax"},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country"},{Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"ContactCell"},{Type:"text",Label:"Postal Code",MaxLength:"20",ModelValue:"PostalCode"},{Type:"email",Label:"Contact Email:",MaxLength:"50",ModelValue:"ContactEmail"},{Type:"text",Label:"Web site:",MaxLength:"50",ModelValue:"Website"},{Type:"line",CustomClass:"col-sm-12"},{Type:"checkbox",Label:"Is different billing address?",ModelValue:"IsDifferentBillingInfo"},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"First Name:",MaxLength:"50",ModelValue:"BillContactFirstName",Required:!0},{Type:"text",Label:"Address:",MaxLength:"100",ModelValue:"BillAddress1",Required:!0},{Type:"text",Label:"Last Name:",MaxLength:"50",ModelValue:"BillContactLastName",Required:!0},{Type:"text",Label:"",MaxLength:"100",ModelValue:"BillAddress2"},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"BillContactPhone",Required:!0},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"BillCity",Required:!0},{Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"BillContactCell"},{Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"BillStateCode",Required:!0},{Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"BillContactFax"},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"BillCountry",Required:!0},{Type:"email",Label:"Email:",MaxLength:"50",ModelValue:"BillContactEmail"},{Type:"text",Label:"Postal Code",MaxLength:"20",ModelValue:"BillPostalCode",Required:!0},{Type:"line",CustomClass:"col-sm-12"},{Type:"dropdown",Label:"Payment Term:",ApiMethod:"paymentTerms",ValueProp:"Id",TextProp:"PaymentTermName",ModelValue:"PaymentTermId",ConvertToInt:"true"},{Type:"dropdown",Label:"Tax Rate:",ApiMethod:"taxrates",ValueProp:"Id",TextProp:"TaxName",ModelValue:"TaxRateId",ConvertToInt:"true"},{Type:"checkbox",Label:"Credit Hold:",ModelValue:"CreditHold"},{Type:"datepicker",Label:"Hold Date:",ModelValue:"HoldDate",Format:"MM/dd/yy",SubType:"date"},{Type:"textarea",Label:"Hold Note",MaxLength:"500",ModelValue:"HoldNote"},{Type:"text",Label:"External ID",MaxLength:"50",ModelValue:"ExternalId"},{Type:"dropdown",Label:"Currency Code:",ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode"},{Type:"dropdown",Label:"Status:",ApiMethod:"statuses/statusbytype",Filter:l.FilterStatusCustomer,ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",Required:!0},{Type:"textarea",Label:"Note",MaxLength:"500",ModelValue:"Note"}],e.$watch("vm.model.Status",function(){null!=l.model.Status&&void 0!=l.model.Status||(l.model.Status="Active")}),e.$watch("vm.customerId",function(){if(l.customerId>0){for(var t=0;t<l.customers.length;t++)if(l.customers[t].Id==l.customerId){l.customerName=l.customers[t].CustomerName,l.creditHold=l.customers[t].CreditHold;break}l.creditHold?bootbox.confirm("The customer "+l.customerName+" is on credit hold!",function(t){t?(e.customer.customerId=l.customerId,e.customer.customerName=l.customerName,e.customer.currencyCode=l.currencyCode,e.customer.paymentTermId=l.paymentTermId,e.$apply(),l.close()):l.customerId=null}):(e.customer.customerId=l.customerId,e.customer.customerName=l.customerName,e.customer.currencyCode=l.currencyCode,e.customer.paymentTermId=l.paymentTermId,l.close())}})}angular.module("FieldConnectApp").controller("SelectCustomerForFormController",e),e.$inject=["$scope","$location","$state","qsService"]}();;!function(){"use strict";function e(e,a,t,n,r,o,i,s,l,m,c,u,d,f,p,h,g){var N=this;N.goHome=function(){t.go("home")},N.searchCompanies=function(){N.filterCompany.reset();var e="";e="%"+N.searchCompaniesText+"%",N.filterCompany.like("CompanyName",e)},N.searchUsers=function(){N.filterUser.reset();var e="";e="%"+N.searchUsersText+"%",N.filterUser.like("search",e).eq("companyid",N.companyID)},N.filterCompany=n.filter("and"),N.filterUser=n.filter("and"),N.companyID=0,N.loadingData=!1,N.reloadTable=!1,N.searchCompaniesText="",N.searchUsersText="",N.attributesCompany=[{Name:"Company Name",ValueName:"CompanyName",Edit:!1,Sortable:!0},{Name:"Email",ValueName:"Email",Edit:!1,Sortable:!0},{Name:"Address",ValueName:"Address1",Edit:!1,Sortable:!0},{Name:"City",ValueName:"City",Edit:!1,Sortable:!0},{Name:"Country",ValueName:"Country",Edit:!1,Sortable:!0},{Name:"Subcontractor",ValueName:"Subcontractor",Edit:!1,Sortable:!0,CellFormat:"checkbox"}],N.attributesUser=[{Name:"UserName",ValueName:"UserName",Edit:!1,Sortable:!0},{Name:"FirstName",ValueName:"FirstName",Edit:!1,Sortable:!0},{Name:"LastName",ValueName:"LastName",Edit:!1,Sortable:!0},{Name:"Roles",ValueName:"Roles",Edit:!1,Sortable:!0},{CellFormat:"button",CellFormatData:{Text:"Impersonate",onClick:function(e){if(null===e.Roles)return void u.warning({message:"Users without an assigned role cannot be impersonated."});N.loadingData=!0;var t=c.getValue("authorization",!0),n=c.getValue("authorizationData");h.impersonate(e.Id).then(function(r){h.dpsLogin(r.data.access_token),f.setUserAuthData(!1).then(function(){u.success({message:"Impersonation successful. Loading impersonated user."}),s(function(){!function(e){g.getLocation("Impersonation").then(function(t){var n=c.getValue("authorizationData").userRoles,r="";f.getUserSetting("SetDefaultStartPage").then(function(o){var l=o;null!==l?r=l:-1!==n.indexOf("Admin")?r="manageWorkOrders":-1!==n.indexOf("Dispatch")?r="dispatchCalendar":-1!==n.indexOf("Technician")?r="myAssignments":-1!==n.indexOf("Apprentice")?r="myAssignments":-1!==n.indexOf("SubAdmin")?r="manageWorkOrders":-1!==n.indexOf("TransAdmin")?r="manageWorkOrders":-1!==n.indexOf("SubContractor")&&(r="myAssignments");var m={EventType:"Impersonation",UserId:e.Id,Username:y.username},c=t.coords.latitude,u=t.coords.longitude;null!==c&&(m.Latitude=c),null!==u&&(m.Longitude=u),i.create("events",m).then(function(){}),a.path(r),s(function(){d.location.reload()}),N.loadingData=!1})})}(e)},2e3)},function(){c.setValue("authorization",t,!0),c.setValue("authorizationData",n),u.error({message:"Authentication error. Please, try again later."}),N.loadingData=!1})},function(){c.setValue("authorization",t,!0),c.setValue("authorizationData",n),u.error({message:"Authentication error. Please, try again later."}),N.loadingData=!1})}}}],e.$watch("vm.companyID",function(){if(void 0!==N.companyID&&0!==N.companyID&&null!==N.companyID){if(N.filterUser.reset(),N.filterUser.eq("companyid",N.companyID),N.searchUsersText){var e;e="%"+N.searchCompaniesText+"%",N.filterUser.like("search",e)}N.reloadTable=!0}});var y={};f.getCurrentUserData().then(function(e){y=e})}angular.module("FieldConnectApp").controller("ImpersonationController",e),e.$inject=["$scope","$location","$state","qsService","timezoneService","stateTransitionService","restService","$timeout","$http","ngAuthSettings","cryptoStorageService","Notification","$window","currentUserService","$q","authService","fcGeoLocationService"]}();;!function(){"use strict";function e(e,o,t,n,a,s,r,i,u,c,g,l,m,T,f,p,d,h,v){var S=this;S.$state=t,S.UserFirstName="",S.UserData={},c.getCurrentUserData().then(function(e){S.UserData=e,S.UserFirstName=S.UserData.FirstName}),c.getCurrentUserEmployeeData().then(function(e){S.employee=e,S.employee&&(S.isTech=S.employee.Technician)}),S.authUser=i.getValue("authorizationData"),S.isCustomer=!1,S.authUser&&(S.authUser.userRoles.match("Admin")||S.authUser.userRoles.match("TransAdmin")||S.authUser.userRoles.match("Office")||S.authUser.userRoles.match("Dispatch")?S.equipmentAuth=!0:S.equipmentAuth=!1,(S.authUser.userRoles.match("CustomerPortalAdmin")||S.authUser.userRoles.match("CustomerUser"))&&(S.isCustomer=!0)),v.setUsingXOiIntegration().then(function(){}),S.gpsEnableBrowserBasedTracking=!1,p.getCompanySettings().then(function(){i.setValue("EnableEventDebugLog",p.EnableEventDebugLog),i.setValue("UseLastKnownTecGeoLocation",p.UseLastKnownTecGeoLocation),S.isTech&&d.usingGPSTracking&&(S.gpsEnableBrowserBasedTracking=p.GPSEnableBrowserBasedTracking,S.gpsEnableBrowserBasedTracking&&c.getUserSetting("GPSDisableBrowserBasedTracking").then(function(o){"true"===o&&(S.gpsEnableBrowserBasedTracking=!1),S.gpsEnableBrowserBasedTracking&&a(function(){var o;o=1e3*p.GPSClientTrackingInterval,u.saveGPSTracking(),e.gpsTimer=h(function(){u.saveGPSTracking()},o)},5e3)}))}),S.goToReportBuilder=function(){w("ReportBuilder")};var b=[];s.getItems("applicationsettings").then(function(e){if(e&&e.data&&e.data.Data){b=e.data.Data,m.trackUserActivity=null,m.googleAnalyticsTrackingId=null;for(var o=0;o<b.length;o++)"TrackUserActivity"===b[o].Name&&0!==b[o].Id&&null!==b[o].Value?m.trackUserActivity=JSON.parse(b[o].Value.toLowerCase()):"GoogleAnalyticsTrackingId"===b[o].Name&&0!==b[o].Id&&null!==b[o].Value&&(m.googleAnalyticsTrackingId=b[o].Value)}}),e.$on("userChanged",function(e,o){c.getCurrentUserData().then(function(e){S.UserData=e,S.UserFirstName=S.UserData.FirstName})}),S.userRoles="dispatcher",S.userRoleTypes=[],S.userOperationGroups={},S.containsOperationGroup=function(e){for(var o=0;o!==S.userRole.length;o++)if(S.userRole[e]===e)return!0;return!1},S.menuReady=!1,S.isFieldConnect=!1,S.isAdmin=!1,S.isDispatch=!1,S.isCustomer=!1,S.editUser=function(){t.go("userSetting")},S.goToHome=function(){w("home")},S.goToRefTables=function(){w("referenceTables")},S.goToCompanyInfo=function(){w("companyInfosTableEdit")},S.goToTaxRate=function(){w("taxRatesTable")},S.goToSite=function(){w("sites")},S.goToRateSheet=function(){w("rateSheetsTable")},S.goToOffice=function(){w("officesTable")},S.goToCompanyPayPeriod=function(){w("companyPayPeriods")},S.goToCustomer=function(){w("customers")},S.goToEmployees=function(){w("employeeTable")},S.goToItems=function(){w("itemTable")},S.goToServiceableItems=function(){w("serviceableItemsTable")},S.goToPayRates=function(){w("payRates")},S.goToPaymentTypes=function(){w("paymentTypes")},S.goToEquipment=function(){w("equipmentTable")},S.goToAgreementType=function(){w("agreementTypeTable")},S.goToLaborGroupTech=function(){w("laborGroupTech")},S.goToCrew=function(){w("crews")},S.goToSubcontractorCompany=function(){w("subcontractorCompanies")},S.goToSkillTech=function(){w("skillTechs")},S.goToUsers=function(){w("userTable")},S.goToMyWorkOrder=function(){w("myWorkOrders")},S.goToManageWorkOrder=function(){w("manageWorkOrders")},S.goToNewWorkOrder=function(){w("newWorkOrders")},S.goToScheduling=function(){w("dispatchScheduling")},S.goToTechUnavailable=function(){w("techUnavailable")},S.goToMessaging=function(){w("messages")},S.goToSubContractorlist=function(){w("subContractorLists")},S.goToSubcontractorAcceptWork=function(){w("subcontractorAcceptWork")},S.goToSubcontractorAwardWork=function(){w("subcontractorAwardWork")},S.goToUnappliedTime=function(){w("unappliedTime")},S.goToFormTemplates=function(){w("formTemplateTable")},S.goToForms=function(){w("formTable")},S.goToTimeReports=function(){w("timeReports")},S.goToNewCompany=function(){w("newCompany")},S.processUserRoles=C,S.goToPM=function(){w("PM")},S.goToVendor=function(){w("vendors")},S.goToGenerateWOs=function(){w("generateWorkOrdersforPMPlans")},S.goToFormSearchTable=function(){w("formSearchTable")},S.goToBills=function(){w("bills")},S.goToInvoiceReview=function(){w("invoiceReview")},S.goToDispatchCalendar=function(){w("dispatchCalendar")},S.goToDispatchMap=function(){w("dispatchMap")},S.goToSubscriptionPlan=function(){w("subscriptionPlan")},S.goToSubscription=function(){w("subscription")},S.goToCompanySettings=function(){w("companySettings")},S.goToAgreements=function(){w("agreements")},S.goToRolePermission=function(){w("rolePermission")},S.goToProjects=function(){w("projects")},S.goToImpersonation=function(){w("impersonation")},S.goToAppSettings=function(){w("applicationSettings")},S.goToViews=function(){w("views")},S.goToCustomerUsers=function(){w("customerUserTable")},S.goToServiceRequest=function(){w("serviceRequest")},S.goToProcessServiceRequest=function(){w("processServiceRequest")},S.login=function(){a(function(){window.location.reload()})},S.logout=function(){angular.isDefined(e.gpsTimer)&&S.gpsEnableBrowserBasedTracking&&h.cancel(e.gpsTimer);return u.getLocation("Logout").then(function(e){var t={EventType:"Logout",Note:"User "+S.UserData.FirstName+" "+S.UserData.LastName+" logged out",Date:new Date,Username:S.UserData.UserName},n=e.coords.latitude,r=e.coords.longitude;null!==n&&(t.Latitude=n),null!==r&&(t.Longitude=r),s.create("events",t).then(function(){T.dpsLogout(),T.logOut(!0,S.isCustomer,R)},function(){T.dpsLogout(),T.logOut(!0)}),S.isCustomer?o.url("/login?isCustomer=True&token="+R):o.url("/login"),a(function(){window.location.reload()})})},S.goToCompanyFeature=function(){w("companyFeature")},S.goToServiceRequestEdit=function(){S.isCustomer?w("customerServiceRequestNew"):w("serviceRequestEdit")},S.goToCustomerUserSites=function(){w("customerUserSites")},S.goToNewQuote=function(){w("newQuote")},S.goToManageQuotes=function(){w("manageQuote")},S.activate=function(){U();var e=i.getValue("authorizationData");e?(S.isSessionValid=!0,S.userRoles=e.userRoles,S.userRoleTypes=e.userRoleTypes,S.userOperationGroups=e.userOperationGroups,S.subscriptionStatus=e.subscriptionStatus,C(e),S.logo=e.companyLogoUrl,R=e.companyLogInUrl,S.isCustomer&&S.logo?S.welcomeMsg="Customer Portal":S.welcomeMsg="FieldConnect",a(function(){!function(){$("[data-main-menu-item]").hide();for(var e=0;e!==S.userRoleTypes.length;e++)for(var o=S.userRoleTypes[e].MenuItems,t=0;t!==o.length;t++){var n=$("[data-main-menu-item='"+o[t].Name+"']");n.children(0).text(o[t].DisplayName),n.show(),n.parents("[data-main-menu-item]").show()}S.menuReady=!0}()})):T.logOut(!0)},S.initMenuEvents=function(){var e=$(".dropdown, .dropdown-submenu");e.mouseover(function(e){$(this).addClass("hover"),navigator.userAgent.match(/iPad|iPhone|iPod/i)&&$(e.target).trigger("click")}),e.mouseout(function(){$(this).removeClass("hover")})},S.showMessage=function(e,o,t,n,a){r.showModal({templateUrl:"Templates/Dispatch/Messaging/messagePopup.html",controller:"MessagePopupController",controllerAs:"vm",inputs:{id:e,note:o,user:t,date:n,ownerType:a}}).then(function(e){e.close.then(function(){U()})})},S.goToWorkOrderReport=function(){w("workOrderReport")},S.goToServiceableItemReport=function(){w("serviceableItemReport")},S.goToTimeCardReport=function(){w("timeCardReport")},S.goToDashboard=function(){w("dashboard")},S.goToCustomerUserServiceableItems=function(){w("customerUsersServiceableItems")},S.goToBundles=function(){w("bundle")},S.goToBaseReports=function(){w("baseReports")},S.goToLaborRounding=function(){w("laborRoundingTable")},S.goToEventDebugLog=function(){w("eventDebugLog")},S.goToEventLog=function(){w("eventLog")},S.goToDashboardReports=function(){w("dashboardReportsTable")},S.goToDefaultStartPageRole=function(){w("defaultStartPageRole")},S.goToStandardTask=function(){w("standardTask")},S.goToPayment=function(){w("paymentTable")},S.goToSMTPSettings=function(){w("smtpSettings")},S.goToUnavailablePayRates=function(){w("unavailablePayRate")},S.goToManageDeficiencies=function(){w("manageDeficiency")},S.subscriptionStatus=!1,S.messagesCount=0;var R="",y=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;function C(e){if(e){if(e.userRoles&&(S.userRoles=e.userRoles.split(",")),e.userRoleTypes){S.userRoleTypes=e.userRoleTypes;for(var o=[],t=0;t!==S.userRoleTypes.length;t++)o.push(S.userRoleTypes[t].RoleTypeName)}-1!==o.indexOf("Fc")?S.isFieldConnect=!0:-1!==o.indexOf("Admin")?S.isAdmin=!0:-1!==o.indexOf("Dispatch")?S.isDispatch=!0:-1===o.indexOf("CustomerPortalAdmin")&&-1===o.indexOf("CustomerUser")||(S.isCustomer=!0)}}function U(){var e={currentDate:(new Date).toISOString()};s.getItems("messaging",e).then(function(e){if(e.data.Data){S.messages=e.data.Data,S.messagesCount=S.messages.length;for(var o=0;o<S.messagesCount;o++){var t=new Date(S.messages[o].DateSent);y&&(t=g.parseISOString(t.toISOString())),g.convertToLocal(t),S.messages[o].DateSent=t.toLocaleDateString(),S.messages[o].DateSent+=" "+t.toLocaleTimeString()}}})}function w(e){var o;t.go(e),o=e,t.is(o)&&window.location.reload()}e.gpsTimer=null,e.$on("$stateChangeStart",function(e,o,n,a,s){if($(".dropdown").removeClass("hover"),$("#small-screen-menu").removeClass("in"),C(i.getValue("authorizationData")),o.data&&o.data.menuItems){var r=[];angular.copy(o.data.menuItems,r);for(var u=0;u<S.userRoleTypes.length;u++)for(var c=0;c<S.userRoleTypes[u].MenuItems.length;c++){var g=r.indexOf(S.userRoleTypes[u].MenuItems[c].Name);-1!==g&&r.splice(g,1)}r.length&&(e.preventDefault(),t.go("notAuthorized"))}}),C()}angular.module("FieldConnectApp").controller("IndexController",e),e.$inject=["$scope","$location","$state","$rootScope","$timeout","restService","ModalService","cryptoStorageService","fcGeoLocationService","currentUserService","timezoneService","$http","ngAuthSettings","authService","qsService","currentCompanyService","featuresFactory","$interval","xoiService"]}();;!function(){"use strict";function t(t,e,l,i,o,a,s,r,n,f,D){var c=this;function m(){if(void 0!==c.filterBills.fromDate){if(c.filterBills.fromDate=new Date(c.filterBills.fromDate),!D.validateDate(c.filterBills.fromDate))return}else c.filterBills.fromDate=null;if(void 0!==c.filterBills.toDate){if(c.filterBills.toDate=new Date(c.filterBills.toDate),!D.validateDate(c.filterBills.toDate))return}else c.filterBills.toDate=null;if(void 0===c.filterBills.fromDate||void 0===c.filterBills.toDate||D.validateDateRange(c.filterBills.fromDate,c.filterBills.toDate)){c.isLoading=!0,c.filterBills.fromPostDate=null,c.filterBills.toPostDate=null,c.filterBills.fromInvoiceDate=null,c.filterBills.toInvoiceDate=null,"Invoice"==c.postInvoice.date?(c.filterBills.fromInvoiceDate=c.filterBills.fromDate,c.filterBills.toInvoiceDate=c.filterBills.toDate):(c.filterBills.fromPostDate=c.filterBills.fromDate,c.filterBills.toPostDate=c.filterBills.toDate);var e={};if(e=r.filter("and"),""!=c.filterBills.fromPostDate&&null!=c.filterBills.fromPostDate){c.filterBills.fromPostDate=new Date(c.filterBills.fromPostDate),c.filterBills.fromPostDate.setHours(0,0,0,0);var l=new Date(c.filterBills.fromPostDate);n.convertToUtc(l),c.filterBills.fromPostDate=n.buildISOString(l)}if(""!=c.filterBills.toPostDate&&null!=c.filterBills.toPostDate){c.filterBills.toPostDate=new Date(c.filterBills.toPostDate),c.filterBills.toPostDate.setHours(23,59,59,999);var i=new Date(c.filterBills.toPostDate);n.convertToUtc(i),c.filterBills.toPostDate=n.buildISOString(i)}if(""!=c.filterBills.fromInvoiceDate&&null!=c.filterBills.fromInvoiceDate){c.filterBills.fromInvoiceDate=new Date(c.filterBills.fromInvoiceDate),c.filterBills.fromInvoiceDate.setHours(0,0,0,0);var a=new Date(c.filterBills.fromInvoiceDate);n.convertToUtc(a),c.filterBills.fromInvoiceDate=n.buildISOString(a)}if(""!=c.filterBills.toInvoiceDate&&null!=c.filterBills.toInvoiceDate){c.filterBills.toInvoiceDate=new Date(c.filterBills.toInvoiceDate),c.filterBills.toInvoiceDate.setHours(23,59,59,999);var s=new Date(c.filterBills.toInvoiceDate);n.convertToUtc(s),c.filterBills.toInvoiceDate=n.buildISOString(s)}var f=0;return""!=c.filterBills.woAltId&&(f=c.filterBills.woAltId),e.eq("Status",c.filterBills.status).eq("From Post Date",null==c.filterBills.fromPostDate?"":c.filterBills.fromPostDate).eq("To Post Date",null==c.filterBills.toPostDate?"":c.filterBills.toPostDate).eq("From Invoice Date",null==c.filterBills.fromInvoiceDate?"":c.filterBills.fromInvoiceDate).eq("To Invoice Date",null==c.filterBills.toInvoiceDate?"":c.filterBills.toInvoiceDate).eq("Search",c.filterBills.search).eq("WoAltId",f),o.getItems("invoices/getBills",e).then(function(e){c.drilldownOpen=[],c.items=e.data.Data;for(var l=0;l<c.items.length;l++){for(var i=0;i<c.items[l].Parts.length;i++)c.listOfPartMisc.push(c.items[l].Parts[i].Id),c.amount=c.amount+c.items[l].Parts[i].ExtendedCost;for(i=0;i<c.items[l].Miscellaneous.length;i++)c.listOfPartMisc.push(c.items[l].Miscellaneous[i].Id),c.amount=c.amount+c.items[l].Miscellaneous[i].ExtendedCost;for(i=0;i<c.items[l].WoLabors.length;i++)if(c.listOfLabor.push(c.items[l].WoLabors[i].Id),c.amount=c.amount+c.items[l].WoLabors[i].ExtendedCost,null!=c.items[l].WoLabors[i].Date){var o=n.parseISOString(c.items[l].WoLabors[i].Date);c.items[l].WoLabors[i].Date=n.convertToLocal(o)}if(c.subTotal.push(c.amount),c.amount=0,null!=c.items[l].InvoiceDate){o=n.parseISOString(c.items[l].InvoiceDate);c.items[l].InvoiceDate=n.convertToLocal(o)}if(null!=c.items[l].PostDate){o=n.parseISOString(c.items[l].PostDate);c.items[l].PostDate=n.convertToLocal(o)}}setTimeout(function(){c.isLoading=!1,t.$apply()},1e3)})}}c.model={},c.isLoading=!1,c.deviceDetect=f,c.loadPaymantdays=function(t){o.getItem("paymentTerms",t).then(function(){c.payterm=o.state.item;var t=new Date,e=new Date(t),l=c.payterm.Days;e.setDate(t.getDate()+l),c.model.DueDate=e})},c.listOfLabor=[],c.listOfPartMisc=[],c.listOfItem={},c.drilldownOpen=[],c.amount=0,c.reloadData=m,c.subTotal=[],c.toggleDrilldown=function(t){c.drilldownOpen[t]=!c.drilldownOpen[t]},c.goToWo=function(t){l.go("workOrdersDetails",{id:t.WoId})},c.filterBills={search:"",status:"",fromPostDate:new Date,toPostDate:new Date,fromInvoiceDate:new Date,toInvoiceDate:new Date,fromDate:new Date,toDate:new Date,woAltId:""},c.dateService=D,c.postInvoice={date:"Invoice"},c.$state=l,c.attributes=[],m()}angular.module("FieldConnectApp").controller("BillsController",t),t.$inject=["$scope","$location","$state","$stateParams","restService","stateTransitionService","Notification","qsService","timezoneService","deviceDetector","dateService"]}();;!function(){"use strict";function e(e,t,o,a,n,i,l,r){var d=this;d.model={},d.loadPaymantdays=s,d.showDetailsWO=[],d.showDetailsLabor=[],d.showDetailsParts=[],d.showDetailsMisc=[],d.deleteAll=function(t){bootbox.confirm("Are you sure that you want to remove WO from  invoice?",function(o){o&&(d.showDetailsWO[t]=!d.showDetailsWO[t],d.listOfLabor=[],d.listOfPartMisc=[],d.model.InvoiceAmount=parseFloat(d.model.InvoiceAmount),d.model.InvoiceAmount=d.model.InvoiceAmount-d.model.InvoiceAmount[t],d.model.InvoiceAmount=d.model.InvoiceAmount.toFixed(2),d.model.InvoiceAmount=parseFloat(d.model.InvoiceAmount),e.$apply())})},d.deleteParts=function(t,o,a,n,i,l){bootbox.confirm("Are you sure that you want to remove the selected line item from the invoice?",function(r){r&&(d.showDetailsParts[l]=!d.showDetailsParts[l],u(t,o),v(a,n,i),e.$apply())})},d.deleteMisc=function(t,o,a,n,i,l){bootbox.confirm("Are you sure that you want to remove the selected line item from the invoice?",function(r){r&&(d.showDetailsMisc[l]=!d.showDetailsMisc[l],u(t,o),v(a,n,i),e.$apply())})},d.deleteLabor=function(t,o,a,n,i,l,r){bootbox.confirm("Are you sure that you want to remove the selected line item from the invoice?",function(c){c&&(void 0===d.showDetailsLabor[r]&&(d.showDetailsLabor[r]=[]),d.showDetailsLabor[r][l]=!d.showDetailsLabor[r][l],m(t,o),v(a,n,i),e.$apply())})},d.listOfLabor=[],d.listOfPartMisc=[],d.addWorkOrder=function(){var e={};i.selectiveExtend(e,d,["listOfLabor","listOfPartMisc"]),i.setTransitionParam("addWorkOrder",e),o.go("addWoInvoice")},d.woDetailsData={},d.listOfItem={},d.recalculate=v,d.removeLabor=m,d.removeItem=u,d.drilldownOpen=[],d.taxTmp=0,d.tax=[],d.amount=0,d.subTotal=[],d.toggleDrilldown=function(e){d.drilldownOpen[e]=!d.drilldownOpen[e]},d.saveInvoice=function(){if(null==d.AltId||void 0==d.AltId){l.error({message:"You can not create an empty invoice!"});var e={};i.selectiveExtend(e,d,["listOfLabor","listOfPartMisc"]),i.setTransitionParam("addWorkOrder",e),o.go("addWoInvoice")}else d.model.WoItems=d.listOfPartMisc.toString(),d.model.WoLabors=d.listOfLabor.toString(),d.model.InvoiceAmount=parseFloat(d.model.InvoiceAmount),"string"==typeof d.model.InvoiceDate&&(d.model.InvoiceDate=r.parseISOString(d.model.InvoiceDate)),d.model.InvoiceDate=r.convertToUtc(d.model.InvoiceDate),d.model.InvoiceDate=r.buildISOString(d.model.InvoiceDate),"string"==typeof d.model.InterfacedDate&&(d.model.InterfacedDate=r.parseISOString(d.model.InterfacedDate)),n.create("invoices",d.model).then(function(e){201!==e.status&&200!==e.status||(l.success({message:"Invoice successfully saved."}),$window.scrollTo(0,0),o.go("invoiceReview"),$window.location.reload())})},d.postInvoice=function(){if(null==d.model.WoId||void 0==d.model.WoId){l.error({message:"You can not posted an empty invoice!"});var e={};i.selectiveExtend(e,d,["listOfLabor","listOfPartMisc"]),i.setTransitionParam("addWorkOrder",e),o.go("addWoInvoice")}else d.model.WoItems=d.listOfPartMisc.toString(),d.model.WoLabors=d.listOfLabor.toString(),d.model.InvoiceAmount=parseFloat(d.model.InvoiceAmount),"string"==typeof d.model.InvoiceDate&&(d.model.InvoiceDate=r.parseISOString(d.model.InvoiceDate)),d.model.InvoiceDate=r.convertToUtc(d.model.InvoiceDate),d.model.InvoiceDate=r.buildISOString(d.model.InvoiceDate),"string"==typeof d.model.InterfacedDate&&(d.model.InterfacedDate=r.parseISOString(d.model.InterfacedDate)),d.model.InterfacedDate=r.convertToUtc(d.model.InterfacedDate),d.model.InterfacedDate=r.buildISOString(d.model.InterfacedDate),n.update("invoices/postInvoice",d.model).then(function(e){l.success({message:"Invoice successfully posted and pdf has been created."}),$window.scrollTo(0,0),d.listOfItem={},d.woDetailsData={},o.go("invoiceReview")})},d.voidInvoice=function(){bootbox.confirm("Are you sure that you want to void the invoice?",function(e){e&&(d.model.InvoiceId?n.update("invoices/cancelInvoice",d.model).then(function(e){l.success({message:"Invoice successfully voided."}),$window.scrollTo(0,0),o.go("invoiceReview"),d.listOfItem={},d.woDetailsData={}}):(o.go("invoiceReview"),d.listOfItem={},d.woDetailsData={}))})},d.payterm={},d.$state=o,d.attributes=[{Type:"text",Label:"Invoice Id:",ModelValue:"AltId",ReadOnly:"true"},{Type:"text",Label:"Status:",ModelValue:"Status",ReadOnly:"true",MaxLength:"15"},{Type:"text",Label:"Customer:",ModelValue:"CustomerName",ReadOnly:"true"},{Type:"datepicker",Label:"Invoice Date:",ModelValue:"InvoiceDate",ReadOnly:"true",Format:"MM/dd/yyyy",SubType:"date"},{Type:"text",Label:"Site:",ModelValue:"SiteName",ReadOnly:"true"},{Type:"dropdown",Label:"Payment Term:",ApiMethod:"paymentTerms",ValueProp:"Id",TextProp:"PaymentTermName",ModelValue:"PaymentTermId",ConvertToInt:"true"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"datepicker",Label:"Due Date:",ModelValue:"DueDate",ReadOnly:"true",Format:"MM/dd/yyyy",SubType:"date"},{Type:"datepicker",Label:"Interfaced Date:",ModelValue:"InterfacedDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"decimal",Label:"Invoice Amount:",ModelValue:"InvoiceAmount",ReadOnly:"true"},{Type:"checkbox",Label:"Interfaced:",ModelValue:"Interfaced"},{Type:"textarea",Label:"Note:",ModelValue:"Note",MaxLength:"500"},{Type:"text",Label:"External Id:",ModelValue:"ExternalId",MaxLength:"50"}];var c=e.$watch("vm.model.InterfacedDate",function(){if(d.model.InterfacedDate){var e=r.parseISOString(d.model.InterfacedDate);d.model.InterfacedDate=r.convertToLocal(e),c()}});function s(e){n.getItem("paymentTerms",e).then(function(){d.payterm=n.state.item;var e=new Date,t=new Date(e),o=d.payterm.Days;t.setDate(e.getDate()+o),d.model.DueDate=t})}function m(e,t){for(var o,a,n=arguments,i=n.length;i>1&&e.length;)for(o=n[--i];-1!==(a=e.indexOf(o));)e.splice(a,1);return d.listOfLabor=e,d.listOfLabor}function u(e,t){for(var o,a,n=arguments,i=n.length;i>1&&e.length;)for(o=n[--i];-1!==(a=e.indexOf(o));)e.splice(a,1);return d.listOfPartMisc=e,d.listOfPartMisc}function v(e,t,o){d.subTotal[o]=d.subTotal[o]-e,d.tax[o]=d.tax[o]-e*t/100,d.model.InvoiceAmount=parseFloat(d.model.InvoiceAmount),d.model.InvoiceAmount=d.model.InvoiceAmount-e-e*t/100,d.model.InvoiceAmount=d.model.InvoiceAmount.toFixed(2),d.model.InvoiceAmount=parseFloat(d.model.InvoiceAmount)}}angular.module("FieldConnectApp").controller("InvoiceEditController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","stateTransitionService","Notification","timezoneService"]}();;!function(){"use strict";function e(e,t,i,l,a,o,s,r,n,c,m,f,D){var v=this;v.model={},v.isLoading=!1,v.loadPaymantdays=function(e){a.getItem("paymentTerms",e).then(function(){v.payterm=a.state.item;var e=new Date,t=new Date(e),i=v.payterm.Days;t.setDate(e.getDate()+i),v.model.DueDate=t})},v.edit=function(e,t,i){i?v.$state.go("agreementEditInvoice",{id:e,agreementId:i}):t?(o.popTransitionParam("createInvoice"),o.popTransitionParam("addInvoice"),v.$state.go("createInvoiceForSubcontractor",{id:e})):(o.popTransitionParam("createInvoice"),o.popTransitionParam("addInvoice"),v.$state.go("createInvoice",{id:e}))},v.deviceDetect=f,v.listOfLabor=[],v.listOfPartMisc=[],v.listOfItem={},v.drilldownOpen=[],v.createInvoice=function(){o.selectiveExtend({},v,["listOfLabor","listOfPartMisc","invoice","woItems"]),o.popTransitionParam("createInvoice"),o.popTransitionParam("addInvoice"),i.go("createInvoice")},v.amount=0,v.taxTmp=0,v.total=[],v.reloadData=P,v.dateService=D,v.subTotal=[],v.setSelected=function(e){v.selected=e.Id},v.toggleDrilldown=function(e){v.drilldownOpen[e]=!v.drilldownOpen[e]},v.invoiceMeta={},v.toggleSort=function(e,t,i){"CustomerName"==e&&i&&(v.isAdmin||(e="CompanyName"));if(!t)return;v.filterBills.sortCol!=e?(v.filterBills.sortCol=e,v.filterBills.sortDir="asc"):"asc"==v.filterBills.sortDir?v.filterBills.sortDir="desc":v.filterBills.sortDir="asc";P()},v.filterBills={search:"",status:"",fromPostDate:null,toPostDate:null,fromInvoiceDate:null,toInvoiceDate:null,fromDate:null,toDate:null,page:1,pageSize:10,total:0,sortCol:"",sortDir:"asc"},v.postInvoice={date:"Invoice"},v.$state=i;var u={Name:"Invoice Id",ValueName:"AltId",FormatDate:"date",Edit:!1,Sortable:!0},d={Name:"Bill To",ValueName:"CustomerName",Edit:!1,Sortable:!0,Tmp:!0,Tmp1:!0};v.attributes=[d,{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0,Tmp:!1,Tmp1:!1},u,{Name:"Invoice Date",ValueName:"InvoiceDate",Edit:!1,Sortable:!0},{Name:"Post Date",ValueName:"PostDate",Edit:!1,Sortable:!0},{Name:"Invoice Amount",ValueName:"InvoiceAmount",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"InvoiceStatus",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"External Id",ValueName:"ExternalId",Edit:!1,Sortable:!0}];var B=n.getValue("authorizationData").userRoles.split(",");v.isAdmin=!1;for(var I=0;I<B.length;I++)if("Admin"==B[I]||"TransAdmin"==B[I]||"FieldConnect"==B[I]||"Office"==B[I]||"Dispatch"==B[I]){v.isAdmin=!0;break}var p=!0;function P(){if(void 0!==v.filterBills.fromDate){if(v.filterBills.fromDate=new Date(v.filterBills.fromDate),!D.validateDate(v.filterBills.fromDate))return}else v.filterBills.fromDate=null;if(void 0!==v.filterBills.toDate){if(v.filterBills.toDate=new Date(v.filterBills.toDate),!D.validateDate(v.filterBills.toDate))return}else v.filterBills.toDate=null;if((void 0===v.filterBills.fromDate||void 0===v.filterBills.toDate||D.validateDateRange(v.filterBills.fromDate,v.filterBills.toDate))&&(v.isLoading=!0,!p)){v.filterBills.fromPostDate=null,v.filterBills.toPostDate=null,v.filterBills.fromInvoiceDate=null,v.filterBills.toInvoiceDate=null,"Invoice"==v.postInvoice.date?(v.filterBills.fromInvoiceDate=v.filterBills.fromDate,v.filterBills.toInvoiceDate=v.filterBills.toDate):(v.filterBills.fromPostDate=v.filterBills.fromDate,v.filterBills.toPostDate=v.filterBills.toDate);var t={};if(t=r.filter("and"),""!=v.filterBills.fromPostDate&&null!=v.filterBills.fromPostDate){v.filterBills.fromPostDate=new Date(v.filterBills.fromPostDate),v.filterBills.fromPostDate.setHours(0,0,0,0);var i=new Date(v.filterBills.fromPostDate);c.convertToUtc(i),v.filterBills.fromPostDate=c.buildISOString(i)}if(""!=v.filterBills.toPostDate&&null!=v.filterBills.toPostDate){v.filterBills.toPostDate=new Date(v.filterBills.toPostDate),v.filterBills.toPostDate.setHours(23,59,59,999);var l=new Date(v.filterBills.toPostDate);c.convertToUtc(l),v.filterBills.toPostDate=c.buildISOString(l)}if(""!=v.filterBills.fromInvoiceDate&&null!=v.filterBills.fromInvoiceDate){v.filterBills.fromInvoiceDate=new Date(v.filterBills.fromInvoiceDate),v.filterBills.fromInvoiceDate.setHours(0,0,0,0);var o=new Date(v.filterBills.fromInvoiceDate);c.convertToUtc(o),v.filterBills.fromInvoiceDate=c.buildISOString(o)}if(""!=v.filterBills.toInvoiceDate&&null!=v.filterBills.toInvoiceDate){v.filterBills.toInvoiceDate=new Date(v.filterBills.toInvoiceDate),v.filterBills.toInvoiceDate.setHours(23,59,59,999);var s=new Date(v.filterBills.toInvoiceDate);c.convertToUtc(s),v.filterBills.toInvoiceDate=c.buildISOString(s)}var m={};v.postInvoice.date&&(m.date=v.postInvoice.date),v.filterBills.fromDate&&(m.fromDate=v.filterBills.fromDate),v.filterBills.toDate&&(m.toDate=v.filterBills.toDate),v.filterBills.status&&(m.status=v.filterBills.status),v.filterBills.search&&(m.search=v.filterBills.search);var f={};return n.getValue("lastselection_"+v.UserData.Id)&&(f=n.getValue("lastselection_"+v.UserData.Id)),f.invoiceReview=m,n.setValue("lastselection_"+v.UserData.Id,f),t.eq("Status",v.filterBills.status).eq("From Post Date",null==v.filterBills.fromPostDate?"":v.filterBills.fromPostDate).eq("To Post Date",null==v.filterBills.toPostDate?"":v.filterBills.toPostDate).eq("From Invoice Date",null==v.filterBills.fromInvoiceDate?"":v.filterBills.fromInvoiceDate).eq("To Invoice Date",null==v.filterBills.toInvoiceDate?"":v.filterBills.toInvoiceDate).eq("Search",v.filterBills.search),t.page=v.filterBills.page,t.pageSize=v.filterBills.pageSize,t.total=v.filterBills.total,t.sortCol=v.filterBills.sortCol,t.sortDir=v.filterBills.sortDir,a.getItems("invoices/getInvoiceForReview",t).then(function(t){v.drilldownOpen=[],v.items=t.data.Data,v.total=[];for(var i=0;i<v.items.length;i++){for(var l=0;l<v.items[i].Parts.length;l++)v.listOfPartMisc.push(v.items[i].Parts[l].Id),null==v.items[i].SubContractorId?(v.amount=v.amount+v.items[i].Parts[l].ExtendedPrice,v.taxTmp=v.taxTmp+v.items[i].Parts[l].ExtendedPrice*v.items[i].Parts[l].TaxRate/100):(v.amount=v.amount+v.items[i].Parts[l].ExtendedCost,v.taxTmp=v.taxTmp+v.items[i].Parts[l].ExtendedCost*v.items[i].Parts[l].TaxRate/100);for(l=0;l<v.items[i].Miscellaneous.length;l++)v.listOfPartMisc.push(v.items[i].Miscellaneous[l].Id),null==v.items[i].SubContractorId?(v.amount=v.amount+v.items[i].Miscellaneous[l].ExtendedPrice,v.taxTmp=v.taxTmp+v.items[i].Miscellaneous[l].ExtendedPrice*v.items[i].Miscellaneous[l].TaxRate/100):(v.amount=v.amount+v.items[i].Miscellaneous[l].ExtendedCost,v.taxTmp=v.taxTmp+v.items[i].Miscellaneous[l].ExtendedCost*v.items[i].Miscellaneous[l].TaxRate/100);for(l=0;l<v.items[i].WoLabors.length;l++)if(v.listOfLabor.push(v.items[i].WoLabors[l].Id),null==v.items[i].SubContractorId?(v.amount=v.amount+v.items[i].WoLabors[l].ExtendedPrice,v.taxTmp=v.taxTmp+v.items[i].WoLabors[l].ExtendedPrice*v.items[i].WoLabors[l].TaxRate/100):(v.amount=v.amount+v.items[i].WoLabors[l].ExtendedCost,v.taxTmp=v.taxTmp+v.items[i].WoLabors[l].ExtendedCost*v.items[i].WoLabors[l].TaxRate/100),null!=v.items[i].WoLabors[l].Date){var o=c.parseISOString(v.items[i].WoLabors[l].Date);v.items[i].WoLabors[l].Date=c.convertToLocal(o)}if(v.prop={amount:0,id:0,tax:0},v.prop.tax=v.taxTmp,v.prop.id=v.items[i].Id,v.prop.amount=v.amount,v.subTotal.push(v.prop),v.total.push(v.prop),v.taxTmp=0,v.amount=0,null!=v.items[i].InvoiceDate){o=c.parseISOString(v.items[i].InvoiceDate);v.items[i].InvoiceDate=c.convertToLocal(o)}if(null!=v.items[i].PostDate){o=c.parseISOString(v.items[i].PostDate);v.items[i].PostDate=c.convertToLocal(o)}}v.invoiceMeta=a.state.itemsMeta,1==v.invoiceMeta.Paging.PageSize&&(v.invoiceMeta.Paging.PageSize=10),setTimeout(function(){v.isLoading=!1,e.$apply()},1e3)})}}function g(){null!==v.invoiceMeta.Paging&&(v.filterBills.page=v.invoiceMeta.Paging.Page,v.filterBills.pageSize=v.invoiceMeta.Paging.PageSize,v.tax=[],P())}v.UserData={},m.getCurrentUserData().then(function(e){v.isLoading=!0,v.UserData=e;var t=n.getValue("lastselection_"+v.UserData.Id);t&&t.invoiceReview?(t.invoiceReview.date&&(v.postInvoice.date=t.invoiceReview.date),t.invoiceReview.fromDate&&(v.filterBills.fromDate=t.invoiceReview.fromDate),t.invoiceReview.toDate&&(v.filterBills.toDate=t.invoiceReview.toDate),t.invoiceReview.status&&(v.filterBills.status=t.invoiceReview.status),t.invoiceReview.search&&(v.filterBills.search=t.invoiceReview.search)):(v.filterBills.fromPostDate=new Date,v.filterBills.toPostDate=new Date,v.filterBills.fromInvoiceDate=new Date,v.filterBills.toInvoiceDate=new Date,v.filterBills.fromDate=new Date,v.filterBills.toDate=new Date),p=!1,P()}),v.newSearch=function(){v.filterBills.page=1,P()},v.nextPage=g,v.changeEntries=function(){v.invoiceMeta.Paging.Page=1,g()},e.$watch("vm.model.Status",function(){v.isAdmin||"Posted"==v.model.InvoiceStatus?v.isAdmin||"Posted"!=item.InvoiceStatus||(u.Edit=!0):u.Edit=!1}),v.isAdmin||(d.ValueName="CompanyName")}angular.module("FieldConnectApp").controller("InvoiceReviewController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","stateTransitionService","Notification","qsService","cryptoStorageService","timezoneService","currentUserService","deviceDetector","dateService"]}();;!function(){"use strict";function e(e,t,i,o,r,a,l,s){var n=this;n.$state=i,n.id=parseInt(o.id),n.deviceDetect=s,n.toggleDrilldown=function(e){n.drilldownOpen[e]=!n.drilldownOpen[e]},n.addToInvoice=function(){var e={};a.selectiveExtend(e,n,["listOfPartsMisc","listOfLabor","invoice","items"]),a.popTransitionParam("createInvoice"),a.popTransitionParam("addInvoice"),a.popTransitionParam("addWorkOrder"),a.setTransitionParam("addInvoice",e),i.go("createInvoice")},n.loadFilter=m,n.checkAllLabor=f,n.checkAllPart=u,n.checkAllMisc=d,n.checkAllFromWo=function(e){var t=!1;n.items[e].AllWoItems?(n.items[e].AllLabor=!0,n.items[e].AllPart=!0,n.items[e].AllMisc=!0):(n.items[e].AllLabor=!1,n.items[e].AllPart=!1,n.items[e].AllMisc=!1,t=!0);f(e),u(e),d(e),t?(n.items[e].AllLabor=!0,n.items[e].AllPart=!0,n.items[e].AllMisc=!0):(n.items[e].AllLabor=!1,n.items[e].AllPart=!1,n.items[e].AllMisc=!1)},n.tmp={},n.items=[],n.drilldownOpen=[],n.listOfPartsMisc=[],n.listOfLabor=[],n.model={fromDate:new Date,toDate:new Date},n.tmp=a.getTransitionParam("addWorkOrder"),void 0!=n.tmp&&(n.listOfLabor=n.tmp.listOfLabor,n.listOfPartsMisc=n.tmp.listOfPartMisc,n.invoice=n.tmp.invoice,n.items=n.tmp.woItems),n.filterInvoice={status:"",wotype:"",altId:null,leadTech:null,subcontractor:null,fromDate:new Date,toDate:new Date},n.filterInvoicesTmp={status:"",woType:"",altId:null,leadTech:null,subcontractor:null,fromDate:new Date,toDate:new Date},n.filterTmpDate={fromDate:new Date,toDate:new Date},n.goBack=function(){window.history.back()},n.attributes=[{Type:"dropdown",Label:"Customer:",ApiMethod:"customers/getcustomer",ValueProp:"Id",TextProp:"CustomerName",ModelValue:"CustomerId",ReadOnly:!0},{Type:"dropdown",Label:"Wo Type:",ApiMethod:"woTypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"WoTypeName"},{Type:"dropdown",Label:"Status:",ApiMethod:"wostatuses",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"WoStatusName"},{Type:"dropdown",Label:"LeadTech:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"DefaultTechId",ConvertToInt:"true"},{Type:"int",Label:"Work Order:",ModelValue:"AltId"},{Type:"dropdown",Label:"Subcontractor:",ApiMethod:"subcontractorCompanies",ValueProp:"SubcontractorId",TextProp:"CompanyName",ModelValue:"SubcontractorId",ConvertToInt:"true"}];var c=0;function m(){if(n.filterInvoice.woType=n.filterInvoice.WoTypeName,n.filterInvoice.status=n.filterInvoice.WoStatusName,n.filterInvoice.TechId=n.filterInvoice.DefaultTechId,n.filterInvoice.fromDate=n.filterTmpDate.fromDate,n.filterInvoice.toDate=n.filterTmpDate.toDate,""!=n.filterInvoice.fromDate&&null!=n.filterInvoice.fromDate&&void 0!=n.filterInvoice.fromDate){n.filterInvoice.fromDate=new Date(n.filterInvoice.fromDate),n.filterInvoice.fromDate.setHours(0,0,0,0);var e=new Date(n.filterInvoice.fromDate);l.convertToUtc(e),n.filterInvoice.fromDate=l.buildISOString(e),n.filterInvoicesTmp.fromDate=n.filterInvoice.fromDate}else n.filterInvoicesTmp.fromDate=null;if(""!=n.filterInvoice.toDate&&null!=n.filterInvoice.toDate){n.filterInvoice.toDate=new Date(n.filterInvoice.toDate),n.filterInvoice.toDate.setHours(23,59,59,999);var t=new Date(n.filterInvoice.toDate);l.convertToUtc(t),n.filterInvoice.toDate=l.buildISOString(t),n.filterInvoicesTmp.toDate=n.filterInvoice.toDate}else n.filterInvoicesTmp.toDate=null;n.filterInvoicesTmp.subcontractor=n.model.SubcontractorId,n.filterInvoicesTmp.leadTech=n.model.DefaultTechId,n.filterInvoicesTmp.status=n.model.WoStatusName,n.filterInvoicesTmp.woType=n.model.WoTypeName,n.filterInvoicesTmp.altId=n.model.AltId,n.filterInvoicesTmp.customerId=n.model.CustomerId,r.getItems("invoices",n.filterInvoicesTmp).then(function(){n.drilldownOpen=[],n.items=r.state.items;for(var e=0;e<n.items.length;e++){if(null!=n.items[e].InvoiceDate){var t=l.parseISOString(n.items[e].InvoiceDate);n.items[e].InvoiceDate=l.convertToLocal(t)}I(),p()}})}function f(e){if(n.items[e].AllLabor){var t=n.items[e].WoLabors.map(function(e){return e.Id});for(r=0;r<t.length;r++)if(v(t[r],n.listOfLabor)){var i=n.listOfLabor.indexOf(t[r]);n.listOfLabor.splice(i,1)}}else for(var o=n.items[e].WoLabors.map(function(e){return e.Id}),r=0;r<o.length;r++){if(null!=o[r].Date){var a=l.parseISOString(o[r].Date);o[r].Date=l.convertToLocal(a)}v(o[r],n.listOfLabor)||n.listOfLabor.push(o[r])}}function u(e){if(n.items[e].AllPart){var t=n.items[e].Parts.map(function(e){return e.Id});for(r=0;r<t.length;r++)if(v(t[r],n.listOfPartsMisc)){var i=n.listOfPartsMisc.indexOf(t[r]);n.listOfPartsMisc.splice(i,1)}}else for(var o=n.items[e].Parts.map(function(e){return e.Id}),r=0;r<o.length;r++)v(o[r],n.listOfPartsMisc)||n.listOfPartsMisc.push(o[r])}function d(e){if(n.items[e].AllMisc){var t=n.items[e].Miscellaneous.map(function(e){return e.Id});for(r=0;r<t.length;r++)if(v(t[r],n.listOfPartsMisc)){var i=n.listOfPartsMisc.indexOf(t[r]);n.listOfPartsMisc.splice(i,1)}}else for(var o=n.items[e].Miscellaneous.map(function(e){return e.Id}),r=0;r<o.length;r++)v(o[r],n.listOfPartsMisc)||n.listOfPartsMisc.push(o[r])}function v(e,t){return t.indexOf(e)>-1}function I(){if(n.items)for(var e=0;e<n.items.length;e++)for(var t=0;t<n.items[e].WoLabors.length;t++){if(!v(n.items[e].WoLabors[t].Id,n.listOfLabor)){n.items[e].AllLabor=!1,0;break}0}}function p(){if(n.items)for(var e=0;e<n.items.length;e++){for(var t=0;t<n.items[e].Parts.length;t++){if(!v(n.items[e].Parts[t].Id,n.listOfPartsMisc)){n.items[e].AllPart=!1,0;break}0}0;for(t=0;t<n.items[e].Miscellaneous.length;t++){if(!v(n.items[e].Miscellaneous[t].Id,n.listOfPartsMisc)){n.items[e].AllMisc=!1,0;break}0}}}e.$watch("vm.model.CustomerId",function(){0==c&&void 0!==n.model.CustomerId&&(n.model.CustomerId=n.tmp.invoice.CustomerId,c=1,m())}),m(),e.$watch("vm.filterInvoice.toDate",function(){if(n.filterInvoice.toDate){var e=l.parseISOString(n.filterInvoice.toDate);l.buildISOString(e),n.filterTmpDate.toDate=l.convertToLocal(e)}}),e.$watch("vm.filterInvoice.fromDate",function(){if(n.filterInvoice.fromDate){var e=l.parseISOString(n.filterInvoice.fromDate);l.buildISOString(e),n.filterTmpDate.fromDate=l.convertToLocal(e)}}),e.$watch("vm.listOfLabor",function(){I()},!0),e.$watch("vm.listOfPartsMisc",function(){p()},!0),e.$watch("vm.items",function(){if(n.items)for(var e=0;e<n.items.length;e++)n.items[e].AllWoItems=!0,n.items[e].AllLabor||(n.items[e].AllWoItems=!1),n.items[e].AllPart||(n.items[e].AllWoItems=!1),n.items[e].AllMisc||(n.items[e].AllWoItems=!1)},!0)}angular.module("FieldConnectApp").controller("InvoicesWOController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","stateTransitionService","timezoneService","deviceDetector"]}();;!function(){"use strict";function e(e,t,o,a,n,i,l,s,r,m,d,c,u,I,v){var f=this;f.id=a.id,f.model={},f.customer={customerId:0},f.selectCustomer=T,f.loadPaymantdays=O,f.deleteAll=function(t,o,a,n){bootbox.confirm("Are you sure that you want to remove WO from  invoice?",function(o){if(o){f.drilldownOpen[t]=!1,f.showDetailsWO[t]=!f.showDetailsWO[t];for(var i=0;i<f.items[t].WoLabors.length;i++)g(f.listOfLabor,f.items[t].WoLabors[i].Id);for(var i=0;i<f.items[t].Miscellaneous.length;i++)P(f.listOfPartMisc,f.items[t].Miscellaneous[i].Id);for(var i=0;i<f.items[t].Parts.length;i++)P(f.listOfPartMisc,f.items[t].Parts[i].Id);f.model.InvoiceAmount=(f.model.InvoiceAmount-a-n).toFixed(2),f.model.InvoiceAmount=parseFloat(f.model.InvoiceAmount).toFixed(2),e.$apply()}})},f.deleteParts=function(t,o,a,n,i,l){bootbox.confirm("Are you sure that you want to remove the selected line item from the invoice?",function(s){s&&(f.showDetailsParts[l]=!f.showDetailsParts[l],P(t,o),L(a,n,i),e.$apply())})},f.deleteMisc=function(t,o,a,n,i,l){bootbox.confirm("Are you sure that you want to remove the selected line item from the invoice?",function(s){s&&(f.showDetailsMisc[l]=!f.showDetailsMisc[l],P(t,o),L(a,n,i),e.$apply())})},f.deleteLabor=function(t,o,a,n,i,l,s){bootbox.confirm("Are you sure that you want to remove the selected line item from the invoice?",function(r){r&&(void 0===f.showDetailsLabor[s]&&(f.showDetailsLabor[s]=[]),f.showDetailsLabor[s][l]=!f.showDetailsLabor[s][l],g(t,o),L(a,n,i),e.$apply())})},f.addWorkOrder=function(){var e={};i.selectiveExtend(e,f,["listOfLabor","listOfPartMisc","invoice","woItems"]),i.popTransitionParam("createInvoice"),i.popTransitionParam("addInvoice"),i.setTransitionParam("addWorkOrder",e),o.go("addWoInvoice")},f.recalculate=L,f.removeLabor=g,f.removeItem=P,f.toggleDrilldown=function(e){f.drilldownOpen[e]=!f.drilldownOpen[e]},f.saveInvoice=function(){if(null==f.model.WoId||void 0==f.model.WoId)s.error(" You can not create an empty invoice!"),o.go("addWoInvoice");else if(null==f.model.InvoiceDate||void 0==f.model.InvoiceDate||""==f.model.InvoiceDate)s.error("Invoice date cannot be blank!");else{f.model.WoItems=f.listOfPartMisc.toString(),f.model.WoLabors=f.listOfLabor.toString(),f.model.InvoiceAmount=parseFloat(f.model.InvoiceAmount),f.model.InvoiceDate=x(f.model.InvoiceDate),f.model.InterfacedDate=x(f.model.InterfacedDate),f.model.InvoiceDate=m.convertToUtc(f.model.InvoiceDate),f.model.InvoiceDate=m.buildISOString(f.model.InvoiceDate),f.model.InterfacedDate=m.convertToUtc(f.model.InterfacedDate),f.model.InterfacedDate=m.buildISOString(f.model.InterfacedDate);var e=new Date(f.model.DueDate),t=new Date(f.model.InvoiceDate);t>e?s.error("Invoice date should not be greater than Due Date!"):n.create("invoices",f.model).then(function(e){201!==e.status&&200!==e.status||(s.success({message:"Invoice successfully saved."}),r.scrollTo(0,0),o.go("invoiceReview"))})}},f.postInvoice=function(){null==f.model.WoId||void 0==f.model.WoId?bootbox.alert(" You can not create an empty invoice!",function(){o.go("addWoInvoice")}):(f.model.WoItems=f.listOfPartMisc.toString(),f.model.WoLabors=f.listOfLabor.toString(),f.model.InvoiceAmount=parseFloat(f.model.InvoiceAmount),"string"==typeof f.model.InvoiceDate&&(f.model.InvoiceDate=m.parseISOString(f.model.InvoiceDate)),f.model.InvoiceDate=x(f.model.InvoiceDate),f.model.InvoiceDate=m.convertToUtc(f.model.InvoiceDate),f.model.InvoiceDate=m.buildISOString(f.model.InvoiceDate),"string"==typeof f.model.InterfacedDate&&(f.model.InterfacedDate=m.parseISOString(f.model.InterfacedDate)),f.model.InterfacedDate=x(f.model.InterfacedDate),f.model.InterfacedDate=m.convertToUtc(f.model.InterfacedDate),f.model.InterfacedDate=m.buildISOString(f.model.InterfacedDate),n.update("invoices/postInvoice",f.model).then(function(e){s.success({message:"Invoice successfully posted and pdf has been created."}),r.scrollTo(0,0),f.listOfItem={},f.woDetailsData={},o.go("invoiceReview")}))},f.voidInvoice=function(){bootbox.confirm("Are you sure that you want to void the invoice?",function(e){e&&(f.model.InvoiceId?n.update("invoices/cancelInvoice",f.model).then(function(e){s.success({message:"Invoice successfully voided."}),r.scrollTo(0,0),o.go("invoiceReview"),f.listOfItem={},f.woDetailsData={}}):(o.go("invoiceReview"),f.listOfItem={},f.woDetailsData={}))})},f.printInvoice=function(e){n.update("invoices/printInvoice",e).then(function(){s.success({message:"Copy of Invoice successfully created."}),b()})},f.showDetailsWO=[],f.showDetailsLabor=[],f.showDetailsParts=[],f.showDetailsMisc=[],f.listOfLabor=[],f.listOfPartMisc=[],f.listOfItem={},f.woDetailsData={},f.drilldownOpen=[],f.taxTmp=0,f.tax=[],f.amount=0,f.subTotal=[],f.reports=null,f.baseUrl=d.apiServiceBaseUri,f.goBack=function(){window.history.back()},f.listOfItem=i.getTransitionParam("addInvoice"),f.woDetailsData=i.getTransitionParam("createInvoice"),f.selectPaymentTerm=!0,f.filterByCustomer=c.filter("and"),f.listOfItem&&(f.woItems=f.listOfItem.items),void 0!=f.listOfItem?(f.filterInvoicesTmp={status:"",woType:"",workOrder:"",leadTech:null,subcontractor:null,fromDate:new Date,toDate:new Date,listItem:!0,woLaborListIds:f.listOfItem.listOfLabor,woItemListIds:f.listOfItem.listOfPartsMisc},y()):void 0!=f.woDetailsData&&(f.filterInvoicesTmp={status:"",woType:"",workOrder:f.woDetailsData.workorderData.WorkOrderId,leadTech:null,subcontractor:null,fromDate:new Date,toDate:new Date,woLaborListIds:"",woItemListIds:"",listItem:!1},y());var D=l.getValue("authorizationData").userRoles.split(",");f.isAdmin=!1;for(var p=0;p<D.length;p++)if("Admin"==D[p]||"TransAdmin"==D[p]||"FieldConnect"==D[p]){f.isAdmin=!0;break}function y(){return n.getItems("invoices",f.filterInvoicesTmp).then(function(){f.items=n.state.items,h(f.items),f.listOfItem&&(f.invoiceEdit=f.listOfItem.invoice,f.invoiceEdit&&w(f.invoiceEdit))})}function T(){u.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectCustomer.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:f.customer}})}function b(){n.getItem("invoices",f.id).then(function(){f.item=n.state.item,f.items=f.item.WorkOrders,h(f.items),w(f.item.Invoice),f.reports=f.item.InvoiceReports})}function h(e){f.drilldownOpen=[];for(var t=0;t<e.length;t++){for(var o=0;o<e[t].Parts.length;o++)f.listOfPartMisc.push(e[t].Parts[o].Id),f.amount=f.amount+e[t].Parts[o].ExtendedPrice,f.taxTmp=f.taxTmp+e[t].Parts[o].ExtendedPrice*e[t].Parts[o].TaxRate/100;for(o=0;o<e[t].Miscellaneous.length;o++)f.listOfPartMisc.push(e[t].Miscellaneous[o].Id),f.amount=f.amount+e[t].Miscellaneous[o].ExtendedPrice,f.taxTmp=f.taxTmp+e[t].Miscellaneous[o].ExtendedPrice*e[t].Miscellaneous[o].TaxRate/100;for(o=0;o<e[t].WoLabors.length;o++)if(f.listOfLabor.push(e[t].WoLabors[o].Id),f.amount=f.amount+e[t].WoLabors[o].ExtendedPrice,f.taxTmp=f.taxTmp+e[t].WoLabors[o].ExtendedPrice*e[t].WoLabors[o].TaxRate/100,null!=f.items[t].WoLabors[o].Date){var a=m.parseISOString(f.items[t].WoLabors[o].Date);f.items[t].WoLabors[o].Date=m.convertToLocal(a)}if(f.subTotal.push(f.amount),f.tax.push(f.taxTmp),f.taxTmp=0,f.amount=0,null!=f.items[t].InvoiceDate){a=m.parseISOString(f.items[t].InvoiceDate);f.items[t].InvoiceDate=m.convertToLocal(a)}}e.length>0&&(f.model.Status=e[0].Status,f.model.PaymentTermId=e[0].PaymentTermId,f.invoice&&f.invoice.CustomerId||(f.model.CustomerName=e[0].CustomerName,f.model.CustomerId=e[0].CustomerId),f.model.WoId=e[0].Id,f.model.CompanyId=e[0].CompanyId),f.model.InvoiceDate=new Date,f.model.InvoiceDate.setMinutes(f.model.InvoiceDate.getMinutes()+f.model.InvoiceDate.getTimezoneOffset()),f.model.InvoiceDate=m.convertToLocal(f.model.InvoiceDate),f.model.InvoiceAmount=0;for(t=0;t<e.length;t++)f.model.InvoiceAmount+=f.subTotal[t]+f.tax[t];f.model.InvoiceAmount=f.model.InvoiceAmount.toFixed(2),f.model.InvoiceAmount=parseFloat(f.model.InvoiceAmount).toFixed(2)}function w(e){f.model.InvoiceId=e.Id,f.model.InvoiceId||(f.model.InvoiceId=e.InvoiceId),f.model.AltId=e.AltId,f.model.Status=e.InvoiceStatus,f.model.InvoiceDate=e.InvoiceDate,f.model.InvoiceDate=m.parseISOString(f.model.InvoiceDate),f.model.InvoiceDate=m.convertToLocal(f.model.InvoiceDate),f.model.PaymentTermId=e.PaymentTermId,f.model.InterfacedDate=e.InterfacedDate,f.model.Interfaced=e.Interfaced,f.model.ExternalId=e.ExternalId,f.model.Note=e.Note,f.model.PostDate=e.PostDate,f.model.CustomerId=e.CustomerId,f.model.CustomerName=e.CustomerName,f.invoice=e}function O(e){n.getItem("paymentTerms",e).then(function(){f.payterm=n.state.item;var e=new Date,t=new Date(e),o=f.payterm.Days;t.setDate(e.getDate()+o),f.model.DueDate=t})}function g(e,t){for(var o,a,n=arguments,i=n.length;i>1&&e.length;)for(o=n[--i];-1!==(a=e.indexOf(o));)e.splice(a,1);return f.listOfLabor=e,f.listOfLabor}function P(e,t){for(var o,a,n=arguments,i=n.length;i>1&&e.length;)for(o=n[--i];-1!==(a=e.indexOf(o));)e.splice(a,1);return f.listOfPartMisc=e,f.listOfPartMisc}function L(e,t,o){f.subTotal[o]=f.subTotal[o]-e,f.tax[o]=f.tax[o]-e*t/100,f.model.InvoiceAmount=parseFloat(f.model.InvoiceAmount),f.model.InvoiceAmount=f.model.InvoiceAmount-e-e*t/100,f.model.InvoiceAmount=f.model.InvoiceAmount.toFixed(2),f.model.InvoiceAmount=parseFloat(f.model.InvoiceAmount).toFixed(2)}function x(e){if(null!==e){var t=new Date;e.setHours(t.getHours()),e.setMinutes(t.getMinutes()),e.setSeconds(t.getSeconds())}return e}f.payterm={},f.$state=o,f.attributes=[{Type:"text",Label:"Invoice Id:",ModelValue:"AltId",ReadOnly:"true"},{Type:"text",Label:"Status:",ModelValue:"Status",ReadOnly:"true",MaxLength:"15"},{Type:"text",Label:"Customer:",Required:!0,MaxLength:"50",ModelValue:"CustomerName",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo",ReadOnly:!0},{Type:"button",Label:"Search",onClick:T},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"datepicker",Label:"Invoice Date:",ModelValue:"InvoiceDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"datepicker",Label:"Interfaced Date:",ModelValue:"InterfacedDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"datepicker",Label:"Post Date:",ModelValue:"PostDate",Format:"MM/dd/yyyy",SubType:"date",ReadOnly:!0},{Type:"checkbox",Label:"Interfaced",ModelValue:"Interfaced"},{Type:"dropdown",Label:"Payment Term:",ApiMethod:"paymentTerms",ValueProp:"Id",TextProp:"PaymentTermName",ModelValue:"PaymentTermId",ConvertToInt:"true"},{Type:"text",Label:"External Id:",ModelValue:"ExternalId",MaxLength:"50"},{Type:"datepicker",Label:"Due Date:",ModelValue:"DueDate",ReadOnly:"true",Format:"MM/dd/yyyy",SubType:"date"},{Type:"textarea",Label:"Note:",ModelValue:"Note",MaxLength:"500"},{Type:"text",Label:"Invoice Amount:",ModelValue:"InvoiceAmount",ReadOnly:"true"}],f.id&&0!=f.id&&(b(),f.selectPaymentTerm=!1),e.$watch("vm.model",function(){f.id?f.invoice=f.model:(f.model.Status="Open",f.listOfItem&&f.listOfItem.invoice?(f.invoice=f.listOfItem.invoice,f.model.CustomerId||(f.model.CustomerId=f.listOfItem.invoice.CustomerId,f.model.CustomerName=f.listOfItem.invoice.CustomerName),f.model.PaymentTermId||(f.model.PaymentTermId=f.listOfItem.invoice.PaymentTermId)):f.invoice=f.model)},!0),e.$watch("vm.model.CustomerId",function(){f.model.CustomerId&&(f.filterByCustomer.reset(),f.filterByCustomer.eq("CustomerId",f.model.CustomerId),f.invoice.CustomerId=f.model.CustomerId,f.invoice.PaymentTermId=f.model.PaymentTermId,f.selectPaymentTerm&&(n.getItem("customers/"+f.model.CustomerId).then(function(){f.customerEdit=n.state.item,f.model.PaymentTermId=f.customerEdit.PaymentTermId}),f.selectPaymentTerm=!0),f.attributes[3].CustomInputClass="disabled"),0==f.model.CustomerId&&f.id}),e.$watch("vm.customer.customerId",function(){f.model.CustomerId=f.customer.customerId,f.model.CustomerName=f.customer.customerName}),e.$watch("vm.model.PaymentTermId",function(){null!=f.model.PaymentTermId?O(f.model.PaymentTermId):f.model.DueDate=""}),e.$watch("vm.model.Status",function(){if("Posted"==f.model.Status&&!f.isAdmin)for(var e=0;e<f.attributes.length;e++)f.attributes[e].ReadOnly="true"}),f.download=function(e){return I.get(e).then(function(t){200===t.status&&window.open(e,"_blank")},function(e){if(e.data.Details)for(var t=0;t!=e.data.Details.length;t++)s.error({message:e.data.Details[t].Message}),console.log(e.data.Details[t].DeveloperMessage);else 404!==e.status&&400!==e.status||s.error({message:e.statusText});return v.reject()})}}angular.module("FieldConnectApp").controller("InvoicesController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","stateTransitionService","cryptoStorageService","Notification","$window","timezoneService","ngAuthSettings","qsService","ModalService","$http","$q"]}();;!function(){"use strict";function e(e,t,o,a,n,d,i,m,l,r){var c=this;function s(){n.getItem("invoices",c.id).then(function(){c.item=n.state.item,c.items=c.item.WorkOrders,I(c.items),function(e){c.model.InvoiceId=e.Id,c.model.InvoiceId||(c.model.InvoiceId=e.InvoiceId);c.model.AltId=e.AltId,c.model.Status=e.InvoiceStatus,c.model.InvoiceDate=e.InvoiceDate,c.model.InvoiceDate=m.parseISOString(c.model.InvoiceDate),c.model.InvoiceDate=m.convertToLocal(c.model.InvoiceDate),c.model.PaymentTermId=e.PaymentTermId,c.model.InterfacedDate=e.InterfacedDate,c.model.Interfaced=e.Interfaced,c.model.ExternalId=e.ExternalId,c.model.Note=e.Note,c.model.SubContractorId=e.SubContractorId,c.model.CompanyId=c.items[0].CompanyId,c.model.PostDate=e.PostDate,c.filterByMainCompany.eq("CompanyId",c.model.CompanyId)}(c.item.Invoice),c.reports=c.item.InvoiceReports})}function I(e){c.drilldownOpen=[];for(var t=0;t<c.items.length;t++){for(var o=0;o<c.items[t].Parts.length;o++)c.listOfPartMisc.push(c.items[t].Parts[o].Id),c.amount=c.amount+c.items[t].Parts[o].ExtendedCost;for(o=0;o<c.items[t].Miscellaneous.length;o++)c.listOfPartMisc.push(c.items[t].Miscellaneous[o].Id),c.amount=c.amount+c.items[t].Miscellaneous[o].ExtendedCost;for(o=0;o<c.items[t].WoLabors.length;o++)if(c.listOfLabor.push(c.items[t].WoLabors[o].Id),c.amount=c.amount+c.items[t].WoLabors[o].ExtendedCost,null!=c.items[t].WoLabors[o].Date){var a=m.parseISOString(c.items[t].WoLabors[o].Date);c.items[t].WoLabors[o].Date=m.convertToLocal(a)}if(c.subTotal.push(c.amount),c.amount=0,null!=c.items[t].InvoiceDate){a=m.parseISOString(c.items[t].InvoiceDate);c.items[t].InvoiceDate=m.convertToLocal(a)}}c.model.CustomerName=c.items[0].CustomerName,c.model.SiteName=c.items[0].SiteName,c.model.Status=c.items[0].Status,c.model.PaymentTermId=null,c.model.CustomerId=c.items[0].CustomerId,c.model.SiteId=c.items[0].SiteId,c.model.WoId=c.items[0].Id,c.model.SubContractorId=c.items[0].SubContractorId,c.model.CompanyId=c.items[0].CompanyId,c.model.InvoiceDate=new Date,c.model.InvoiceDate.setMinutes(c.model.InvoiceDate.getMinutes()+c.model.InvoiceDate.getTimezoneOffset()),c.model.InvoiceDate=m.convertToLocal(c.model.InvoiceDate),c.model.InvoiceAmount=0,c.model.CompanyId=c.items[0].CompanyId,void 0!=c.model.WoId&&n.getItem("wodetails",c.model.WoId).then(function(){var e=n.state.item;c.model.TimeZoneName=e.TimeZoneName,c.model.PromiseDate=m.parseISOString(e.PromiseDate);var t=moment.tz.zone(e.TzDatabaseName).offset(c.model.PromiseDate);c.model.PromiseDate=m.convertToLocal(c.model.PromiseDate,t)});for(t=0;t<c.items.length;t++)c.model.InvoiceAmount+=c.subTotal[t];c.model.InvoiceAmount=c.model.InvoiceAmount.toFixed(2),c.model.InvoiceAmount=parseFloat(c.model.InvoiceAmount).toFixed(2),c.filterByMainCompany.eq("CompanyId",c.model.CompanyId)}function u(e){n.getItem("paymentTerms",e).then(function(){c.payterm=n.state.item;var e=new Date,t=new Date(e),o=c.payterm.Days;t.setDate(e.getDate()+o),c.model.DueDate=t})}function v(e){var t=new Date;return e.setHours(t.getHours()),e.setMinutes(t.getMinutes()),e.setSeconds(t.getSeconds()),e}c.id=a.id,c.model={SubcontractorId:null},c.$state=o,c.loadPaymantdays=u,c.saveInvoice=function(){null==c.model.WoId||void 0==c.model.WoId?i.error({message:"You can not create an empty invoice."}):(c.model.InvoiceId||(c.model.InvoiceId=0),c.model.WoItems=c.listOfPartMisc.toString(),c.model.WoLabors=c.listOfLabor.toString(),c.model.InvoiceAmount=parseFloat(c.model.InvoiceAmount),c.model.InvoiceDate=v(c.model.InvoiceDate),c.model.InterfacedDate=v(c.model.InterfacedDate),c.model.InvoiceDate=m.convertToUtc(c.model.InvoiceDate),c.model.InvoiceDate=m.buildISOString(c.model.InvoiceDate),c.model.InterfacedDate=m.convertToUtc(c.model.InterfacedDate),c.model.InterfacedDate=m.buildISOString(c.model.InterfacedDate),n.create("invoices",c.model).then(function(e){i.success({message:"Invoice successfully saved."}),o.go("createInvoiceForSubcontractor",{id:e.data.Id}),r.location.reload()}))},c.postInvoice=function(){null==c.model.WoId||void 0==c.model.WoId?i.error({message:"You can not create an empty invoice."}):(c.model.InvoiceId||(c.model.InvoiceId=0),c.model.WoItems=c.listOfPartMisc.toString(),c.model.WoLabors=c.listOfLabor.toString(),c.model.InvoiceAmount=parseFloat(c.model.InvoiceAmount),c.model.InvoiceDate=v(c.model.InvoiceDate),c.model.InterfacedDate=v(c.model.InterfacedDate),c.model.InvoiceDate=m.convertToUtc(c.model.InvoiceDate),c.model.InvoiceDate=m.buildISOString(c.model.InvoiceDate),c.model.InterfacedDate=m.convertToUtc(c.model.InterfacedDate),c.model.InterfacedDate=m.buildISOString(c.model.InterfacedDate),n.update("invoices/postInvoice",c.model).then(function(e){i.success({message:"Successfully saved and created pdf invoice."}),o.go("invoiceReview")}))},c.voidInvoice=function(){bootbox.confirm("Are you sure that you want to void the invoice?",function(e){e&&(c.model.InvoiceId?n.update("invoices/cancelInvoice",c.model).then(function(e){i.success({message:"Invoice successfully voided."}),o.go("invoiceReview")}):o.go("invoiceReview"))})},c.toggleDrilldown=function(e){c.drilldownOpen[e]=!c.drilldownOpen[e]},c.printInvoice=function(e){n.update("invoices/printInvoice",e).then(function(){i.success({message:"Copy of Invoice successfully created."}),s()})},c.goBack=function(){window.history.back()},c.listOfLabor=[],c.listOfPartMisc=[],c.woDetailsData={},c.listOfItem={},c.drilldownOpen=[],c.amount=0,c.subTotal=[],c.payterm={},c.woDetailsData=d.getTransitionParam("createInvoice"),c.woDetailsData&&(c.filterInvoicesTmp={status:"",woType:"",workOrder:c.woDetailsData.workorderData.WorkOrderId,leadTech:null,subcontractor:c.woDetailsData.workorderData.SubcontractorId,fromDate:new Date,toDate:new Date,woLaborListIds:"",woItemListIds:"",listItem:!1}),c.filterByMainCompany=l.filter("and"),c.attributes=[{Type:"text",Label:"Invoice Id:",ModelValue:"AltId",ReadOnly:"true"},{Type:"text",Label:"Status:",ModelValue:"Status",ReadOnly:"true",MaxLength:"15"},{Type:"text",Label:"Customer:",ModelValue:"CustomerName",ReadOnly:"true"},{Type:"datepicker",Label:"Invoice Date:",ModelValue:"InvoiceDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"text",Label:"Site:",ModelValue:"SiteName",ReadOnly:"true"},{Type:"datepicker",Label:"Post Date:",ModelValue:"PostDate",Format:"MM/dd/yyyy",SubType:"date",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"dropdown",Label:"Payment Term:",ApiMethod:"paymentTerms",ValueProp:"Id",TextProp:"PaymentTermName",ModelValue:"PaymentTermId",ConvertToInt:"true"},{Type:"datepicker",Label:"Interfaced Date:",ModelValue:"InterfacedDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"datepicker",Label:"Due Date:",ModelValue:"DueDate",ReadOnly:"true",Format:"MM/dd/yyyy",SubType:"date"},{Type:"checkbox",Label:"Interfaced",ModelValue:"Interfaced"},{Type:"text",Label:"Invoice Amount:",ModelValue:"InvoiceAmount",ReadOnly:"true"},{Type:"text",Label:"External Id:",ModelValue:"ExternalId",MaxLength:"50"},{Type:"textarea",Label:"Note:",ModelValue:"Note",MaxLength:"500"}],e.$watch("vm.model",function(){c.id?c.invoice=c.model:c.model.Status="Open"},!0),c.id?s():n.getItems("invoices",c.filterInvoicesTmp).then(function(){c.items=n.state.items,I(c.items)}),e.$watch("vm.model.PaymentTermId",function(){null!=c.model.PaymentTermId?u(c.model.PaymentTermId):c.model.DueDate=""}),c.woDetailsData&&(c.model.SubcontractorId=c.woDetailsData.workorderData.SubcontractorId)}angular.module("FieldConnectApp").controller("InvoicesSubcontractorController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","stateTransitionService","Notification","timezoneService","qsService","$window"]}();;!function(){"use strict";function e(e,t,a,o,r,i,l,d,n,s,u,m,p,c){var T=this;T.rateSheetHourlyRate=null,T.$state=r,T.isLoading=!1,T.items=[],T.itemsMeta={},T.getWoUnappliedLabor=P,T.getTotal=function(e){var t=0;if(void 0==e)for(var a=0;a<T.items.length;a++)isNaN(T.items[a].Hours)||(t+=T.items[a].Hours);else for(var a=0;a<T.items.length;a++)T.items[a].Date==e&&(t+=T.items[a].Hours);return isNaN(t)||!t&&0!==t?"":t.toFixed(2)},T.getTotalByPayRate=function(e){for(var t=0,a=0;a<T.items.length;a++)T.items[a].PayRate==e&&(t+=T.items[a].Hours);return isNaN(t)||!t&&0!==t?"":t.toFixed(2)},T.addWoLabor=W,T.addUnappliedLabor=N,T.approveTech=function(e){(null==b.UserId||b.UserId!=M.Id)&&1!=e.Approved?bootbox.confirm("You are approving Time for "+b.FullName+", are you sure?",function(t){t&&A(e),a.$apply()}):A(e)},T.ApproveAll=function(){if(null==b.UserId||b.UserId!=M.Id)if(1!=T.approveAllDates)bootbox.confirm("You are approving Time for "+b.FullName+", are you sure?",function(e){if(e){T.approveAllDates=!0;for(var t=0;t<T.items.length;t++)w(T.items[t])||(T.items[t].Approved=T.approveAllDates)}else T.approveAllDates=!1;a.$apply()});else{T.approveAllDates=!1;for(var e=0;e<T.items.length;e++)w(T.items[e])||(T.items[e].Approved=T.approveAllDates)}else{1!=T.approveAllDates?T.approveAllDates=!0:T.approveAllDates=!1;for(var e=0;e<T.items.length;e++)w(T.items[e])||(T.items[e].Approved=T.approveAllDates)}},T.submitApprovals=function(){T.submittingApprovals=!0;for(var t=[],a=0;a<T.items.length;a++)T.items[a].Approved&&(T.checkIfApproved(T.items[a])||t.push(T.items[a]));if(0==t.length)s.warning({message:"First you must approve time"}),T.submittingApprovals=!1;else{for(var o=[],a=0;a<t.length;a++){var r={TimeRecordId:0,TimeType:"",Hours:0};r.TimeRecordId=t[a].Id,r.TimeType=t[a].TableName,r.Hours=t[a].Hours,o.push(r)}e.create("timeApprovals",o).then(function(){P(),s.success({message:"Time for selected technician successfuly added"}),T.submittingApprovals=!1},function(e){s.error({message:e.statusText}),T.submittingApprovals=!1})}},T.deleteTime=function(t){var a="Are you sure that you want to delete "+t.TableName+" record?";bootbox.confirm(a,function(a){if(a){var o=!1,r=0;"WoLabor"==t.TableName?e.remove(T.apiMethod,t.Id).then(function(){v.RecordId=t.Id,v.TableName="WoLabor",v.ParentRecordId=t.WoId,v.Note="WoLabor Created By: "+t.CreatedBy+", Labor Code: "+t.Description+", Work Hours: "+t.Hours,U(v);for(var a=0;a<D.length;a++)if(D[a].TimeRecordId==t.Id&&D[a].TimeType==t.TableName){r=a,o=!0;break}o?e.remove("timeApprovals",D[r].Id).then(function(){P()}):P()}):"Unapplied"==t.TableName&&e.remove("unappliedTime",+t.Id).then(function(){v.RecordId=t.Id,v.TableName="Unapplied",v.ParentRecordId=t.WoId,v.Note="WoLabor Created By: "+t.CreatedBy+", Labor Code: Unapplied, Work Hours: "+t.Hours,U(v);for(var a=0;a<D.length;a++)if(D[a].TimeRecordId==t.Id&&D[a].TimeType==t.TableName){r=a,o=!0;break}o?e.remove("timeApprovals",D[r].Id).then(function(){P()}):P()})}})},T.clearSignature=function(){var e=$("#signatureCanvas")[0];e.width=e.width,T.modelMail.SignedBy="",$("#signatureCanvas")[0].style.cssText="border: 1px  solid #000000"},T.checkIfApproved=w,T.sendMail=function(){if(function(){T.modelMail.ApprovedTimeList=[];for(var e=0;e<T.items.length;e++){var t={Date:"",AltId:0,SiteName:"",Description:"",Hours:0,OriginalHours:null,PayRate:"",CreatedBy:"",ModifiedBy:"",Approved:!1,DiffUser:!1,StartDate:null,EndDate:null};t.Date=T.items[e].Date,t.AltId=T.items[e].AltId,t.SiteName=T.items[e].SiteName,t.Description=T.items[e].Description,t.Hours=T.items[e].Hours,t.PayRate=T.items[e].PayRate,t.Approved=T.items[e].Approved,t.StartDate=T.items[e].StartDate,t.EndDate=T.items[e].EndDate,null!=T.items[e].OriginalHours&&(t.OriginalHours=T.items[e].OriginalHours),null!=b.UserId&&b.UserId!=T.items[e].SysCreatorId&&(t.DiffUser=!0),t.CreatedBy=T.items[e].CreatedBy,t.ModifiedBy=T.items[e].ModifiedBy,T.modelMail.ApprovedTimeList.push(t)}}(),0==T.modelMail.ApprovedTimeList.length)s.warning({message:"First you must approve time"});else{T.isLoading=!0;var t=new Image;t.src=$("#signatureCanvas")[0].toDataURL();var a=t.src.split(",")[1];T.modelMail.Signature=a,T.modelMail.UniqueDatesList=T.uniqueDates,T.modelMail.UniquePayRateList=[];for(var o=0;o<T.modelMail.ApprovedTimeList;o++)-1==T.modelMail.UniquePayRateList.indexOf(T.modelMail.ApprovedTimeList[o].PayRate)&&T.modelMail.UniquePayRateList.push(T.modelMail.ApprovedTimeList[o].PayRate);T.modelMail.UniquePayRateList=T.uniquePayRates,e.getItem("employees",T.model.Techid).then(function(t){T.modelMail.Technician=t.data.FullName,e.create("timeApprovals/mail",T.modelMail).then(function(e){T.isLoading=!1,e&&s.success({message:"Successfuly sent email message"})})})}},T.editRecord=function(e){"WoLabor"==e.TableName?(T.modelWo.AltId=e.AltId,T.modelWo.IsTimeReport=!0,W(e.Id)):"Unapplied"==e.TableName&&(T.modelUnapplied.IsTimeReport=!0,N(e.Id))},T.disableEditRemoveButton=function(e){var t=!1;if("Unavailable"===e.TableName)return!0;for(var a=0;a<D.length;a++)if(D[a].TimeRecordId==e.Id&&D[a].TimeType==e.TableName&&!I&&!y){t=!0;break}return t},T.isEditable=function(e){for(var t,a=0;a<S.length;a++)if(S[a].Id==e.Id&&S[a].TableName==e.TableName){t=S[a].Editable;break}return t},T.backgroundColor=function(e){var t="#FFFFFF";null!=e.OriginalHours&&e.OriginalHours!=e.Hours&&(t="#F46D6D");return t},T.editData=function(e){void 0!=e&&T.getWoUnappliedLabor();return!0},T.checkValidationForField=V,T.formValidation={},T.diffUserBackgroundcolor=function(e){var t="#FFFFFF";null!=b.UserId&&b.UserId!=e.SysCreatorId&&(t="#F3F781");return t},T.model={},T.modelUnapplied={},T.modelWo={},T.modelMail={MailTo:"",Comment:"",SignedBy:"",ApprovedTimeList:[],UniqueDatesList:[],UniquePayRateList:[]};var v={EventType:"DELETE",RecordId:0};T.getLocalTime=function(e){if(null!==e||void 0!==e){var t=u.parseISOString(e);return u.convertToLocal(t)}return null};for(var h=d.getValue("authorizationData").userRoles.split(","),D=[],b={},y=!1,I=!1,f=!1,g=!1,L=0;L<h.length;L++){if("Supervisor"==h[L]){y=!0;break}if("Admin"==h[L]||"FieldConnect"==h[L]){I=!0;break}if("Apprentice"===h[L]){g=!0,f=!0;break}}e.getItem("employees/getCurrent").then(function(e){var t=e.data;t&&t.Data.length>0&&(T.currentTechId=t.Data[0].Id)});var M={};m.getCurrentUserData().then(function(e){T.isLoading=!0,M=e,setTimeout(function(){T.isLoading=!1,a.$apply()},1e3)}),T.woFilter={date:null},T.woDropDownFilter=l.filter("and"),T.timeReportFilter=l.filter("and"),T.usingDSLNorthwest=p.usingDSLNorthwest,T.laborCodes={Type:"dropdown",Label:"Labor Code:",Required:!0,ApiMethod:"laborCodes",ValueProp:"LaborCodeName",TextProp:"LaborCodeName",ModelValue:"LaborCodeName",Name:"LaborCode"},T.usingDSLNorthwest&&(T.customerFilter=l.filter("and"),T.customerFilter.eq("CustomerId",0),T.laborCodes.ApiMethod="dslLaborCodeByServiceZoneCode/ddList",T.laborCodes.Filter=T.customerFilter);var S=[];if(T.approveAllDates=!1,T.uniqueDates=[],T.uniquePayRates=[],T.listWoes=[],T.attributes=[{Type:"dropdown",Label:"Pay Period:",ApiMethod:"companypayperiods/getForTimeReports",ValueProp:"Id",TextProp:"Name",ModelValue:"PayPeriodId",ConvertToInt:"true",Required:!1,CustomDivClass:"col-sm-6",NoSort:!0,SortCol:"StartDate"},{Type:"dropdown",Label:"Technician:",ApiMethod:"crewtechs/GetListForCrews",ValueProp:"TechId",TextProp:"UserFirstLastName",ModelValue:"Techid",CurrentList:"techIds",ConvertToInt:"true",Required:!1,ReadOnly:f,CustomDivClass:"col-sm-6"},{Type:"datepicker",Label:"From:",ModelValue:"StartDate",Format:"MM/dd/yyyy",SubType:"date",ReadOnly:!0},{Type:"datepicker",Label:"To:",ModelValue:"EndDate",Format:"MM/dd/yyyy",SubType:"date",ReadOnly:!0}],T.attributesTab=[{Name:"Date",ValueName:"Date",CellFormat:"label",Sortable:!1,FormatDate:!0},{Name:"Start Time",ValueName:"StartDate",CellFormat:"time",Sortable:!1},{Name:"End Time",ValueName:"EndDate",CellFormat:"time",Sortable:!1},{Name:"Work Order",ValueName:"AltId",CellFormat:"label",Sortable:!1},{Name:"Customer/Site",ValueName:"SiteName",CellFormat:"label",Sortable:!1},{Name:"Description",ValueName:"Description",CellFormat:"label",Sortable:!1},{Name:"Work Hours",ValueName:"HoursLabel",CellFormat:"editable",Sortable:!1},{Name:"PayRate",ValueName:"PayRate",CellFormat:"label",Sortable:!1},{Name:"Created By",ValueName:"CreatedBy",CellFormat:"labelColor",Sortable:!1},{Name:"Modified By",ValueName:"ModifiedBy",CellFormat:"label",Sortable:!1},{Name:"Approve",ValueName:"Approved",CellFormat:"checkbox",Sortable:!1}],T.attributesUnappliedModal=[{Type:"dropdown",Label:"Technician:",ApiMethod:"crewtechs/GetListForCrews",CurrentList:"technicianUnappliedIds",ValueProp:"TechId",TextProp:"UserFirstLastName",ModelValue:"Techid",ConvertToInt:"true",Required:!0,ReadOnly:f,CustomDivClass:"col-sm-6"},{Type:"datepicker",Label:"Date:",ModelValue:"Date",Format:"MM/dd/yyyy",SubType:"date",Required:!0},{Type:"decimal",Label:"Hours",ModelValue:"Hours",Required:!0},{Type:"dropdown",Label:"PayRate :",ApiMethod:"payRates",ValueProp:"Id",TextProp:"PayRateName",ModelValue:"PayRateId",ConvertToInt:"true",Required:!0,CustomDivClass:"col-sm-6"},{Type:"text",Label:"Note",ModelValue:"Note",MaxLength:"500"}],T.attributesWoModal=[{Type:"dropdown",Label:"Technician:",ApiMethod:"crewtechs/GetListForCrews",CurrentList:"technicianWoIds",ValueProp:"TechId",TextProp:"UserFirstLastName",ModelValue:"TechId",ConvertToInt:"true",Required:!0,ReadOnly:f,CustomDivClass:"col-sm-6"},{Type:"datepicker",Label:"Date:",ModelValue:"Date",Required:!0,Format:"MM/dd/yyyy",SubType:"date"},{Type:"dropdown",Label:"Work Order:",ApiMethod:"techWoes",ValueProp:"Id",TextProp:"AltId",ModelValue:"WoId",ConvertToInt:"true",Filter:T.woDropDownFilter,Required:!0,CustomDivClass:"col-sm-6"},T.laborCodes,{Type:"decimal",Label:"Work Hours",ModelValue:"WorkHours",Required:!0},{Type:"dropdown",Label:"PayRate :",ApiMethod:"payRates",ValueProp:"Id",TextProp:"PayRateName",ModelValue:"PayRateId",ConvertToInt:"true",CustomDivClass:"col-sm-6",Required:!0},{Type:"hidden",Label:"Rate Hour:",ModelValue:"Rate",ReadOnly:!0,Roles:["Admin","FieldConnect","Dispatch","Office","Supervisor"]},{Type:"checkbox",Label:"Taxable",Required:!1,ModelValue:"Taxable"}],T.apiMethod="woLabors",T.usingDSLNorthwest){T.attDSLActionTaken={Type:"dropdown",Label:"Action Taken:",ApiMethod:"dslActionTaken/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extActionTakenId",ConvertToInt:"true"},T.attDSLFaultAreas={Type:"dropdown",Label:"Trouble Found:",ApiMethod:"dslFaultAreas/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extFaultAreasId",ConvertToInt:"true"},T.attDSLApplicableCode={Type:"dropdown",Label:"Applicable Zone:",ApiMethod:"dslApplicableCode/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extApplicableCodeId",ConvertToInt:"true"},T.attDSLInstalledRemoved={Type:"dropdown",Label:"Installed/Removed:",ApiMethod:"dslInstalledRemoved/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extInstalledRemovedId",ConvertToInt:"true"},T.attDSLWhoPays={Type:"dropdown",Label:"Who Pays:",ApiMethod:"dslWhoPays/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extWhoPaysId",ConvertToInt:"true"},T.attDSLIndirectLaborQuantity={Type:"int",Label:"Indirect Labor Qty:",ModelValue:"extIndirectLaborQuantity"},T.attDSLIndirectPartNumber={Type:"text",Label:"Part#/TOF",ModelValue:"extIndirectPartNumber",MaxLength:"250"};var C=[T.attDSLActionTaken,T.attDSLFaultAreas,T.attDSLApplicableCode,T.attDSLInstalledRemoved,T.attDSLWhoPays,T.attDSLIndirectLaborQuantity,T.attDSLIndirectPartNumber];T.apiMethod="dslWoLabors",T.attributesWoModal=T.attributesWoModal.concat(C)}T.test=function(){console.log("test")},T.loadingIndicator=!1,T.args={page:1,pageSize:10,total:0,sortCol:"",sortDir:"asc",Techid:0,StartDate:null,EndDate:null};var R=[];e.getItems("companysettings").then(function(e){R=e.data.Data;for(var t=0;t<R.length;t++){if("TimeReportEmail"==R[t].Name){T.modelMail.MailTo=R[t].Value;break}o(function(){V()})}}),T.submittingApprovals=!1;var F={};function A(e){for(var t=0;t<T.items.length;t++)if(T.items[t].Id==e.Id&&T.items[t].TableName==e.TableName){1==T.items[t].Approved?T.items[t].Approved=!1:T.items[t].Approved=!0;break}}function w(e){for(var t=!1,a=0;a<D.length;a++)if(D[a].TimeRecordId==e.Id&&D[a].TimeType==e.TableName){t=!0,e.Approved=!0;break}return t}function P(){!function(){if(""!=T.model.StartDate&&null!=T.model.StartDate){var e=new Date(T.model.StartDate);e.setHours(0,0,0,0);var t=new Date(e),a=u.convertToUtc(t);T.args.StartDate=u.buildISOString(a)}else T.args.StartDate=null;if(""!=T.model.EndDate&&null!=T.model.EndDate){var o=new Date(T.model.EndDate);o.setHours(23,59,59,999);var r=new Date(o),i=u.convertToUtc(r);T.args.EndDate=u.buildISOString(i)}else T.args.EndDate=null}(),function(){T.timeReportFilter.reset(),T.timeReportFilter.eq("Techid",T.args.Techid),null!=T.args.StartDate&&T.timeReportFilter.ge("Date",T.args.StartDate);null!=T.args.EndDate&&T.timeReportFilter.le("Date",T.args.EndDate);T.timeReportFilter.sortCol="Date",T.timeReportFilter.sortDir="asc"}(),null!=T.args.StartDate&&null!=T.args.EndDate&&0!=T.args.Techid?(T.isLoading=!0,e.getItem("employees/",T.args.Techid).then(function(t){b=t.data,D=[],e.getItems("timeApprovals",T.timeReportFilter).then(function(t){D=t.data.Data,e.getItems("unappliedWoLabors",T.timeReportFilter).then(function(e){T.items=e.data.Data,T.itemsMeta=e.data.Meta,T.uniquePayRates=[];for(var t=!1,a=0;a<T.items.length;a++){var o=u.parseISOString(T.items[a].Date);(o=u.convertToLocal(o)).setHours(0,0,0,0),T.items[a].Date=o.toLocaleDateString("en-US"),-1==T.uniquePayRates.indexOf(T.items[a].PayRate)&&T.uniquePayRates.push(T.items[a].PayRate),null!=T.items[a].OriginalHours&&(t=!0),null!=T.items[a].Hours?T.items[a].HoursLabel=T.items[a].Hours.toFixed(2):T.items[a].HoursLabel="0.00"}t&&s.warning({message:"There are 1 or more entries that were previously approved but the hours were changed."});(function(e,t){T.uniqueDates=[];var a=new Date(e),o=new Date(t);o.setHours(0,0,0,0);var r=a;r.setHours(0,0,0,0);for(;r<=o;)T.uniqueDates.push(r.toLocaleDateString("en-US")),r.setDate(r.getDate()+1)})(""==T.model.StartDate||null==T.model.StartDate?T.items[0].Date:T.model.StartDate,""==T.model.EndDate||null==T.model.EndDate?T.items[T.items.length-1].Date:T.model.EndDate),function(){S=[];for(var e=0;e<T.items.length;e++){var t={Id:0,TableName:"",Editable:!1};t.Id=T.items[e].Id,t.TableName=T.items[e].TableName,S.push(t)}}()})})})):(s.warning({message:"First you must choose pay period and technician"}),T.items=[],T.uniqueDates=[]),setTimeout(function(){T.isLoading=!1,a.$apply()},1e3)}function W(e){if(void 0!=e){T.attributesWoModal[0]={Type:"dropdown",Label:"Technician:",ApiMethod:"crewtechs/GetListForCrews",CurrentList:"technicianWoIds",ValueProp:"TechId",TextProp:"UserFirstLastName",ModelValue:"TechId",ConvertToInt:"true",Required:!0,CustomDivClass:"col-sm-6",ReadOnly:!0},T.attributesWoModal[2]={Type:"text",Label:"Work Order",ModelValue:"AltId",ReadOnly:!0},T.attributesWoModal.push({Type:"hidden",Label:"Work Order",ModelValue:"WoId",ReadOnly:!0})}else{T.modelWo.Hours=null;var t={Type:"dropdown",Label:"Technician:",ApiMethod:"crewtechs/GetListForCrews",CurrentList:"technicianWoIds",ValueProp:"TechId",TextProp:"UserFirstLastName",ModelValue:"TechId",ConvertToInt:"true",Required:!0,CustomDivClass:"col-sm-6",ReadOnly:f},a={Type:"dropdown",Label:"Work Order:",ApiMethod:"techWoes",CurrentList:"vm.listWoes",ValueProp:"Id",TextProp:"AltId",ModelValue:"WoId",ConvertToInt:"true",Required:!0,CustomDivClass:"col-sm-6",Filter:T.woDropDownFilter,ReadOnly:!1};T.attributesWoModal[0]=t,T.attributesWoModal[2]=a}T.modelWo.Billable=!0,n.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"woTimeEditController",controllerAs:"vm",inputs:{modalTitle:"Labor Time",id:e,model:T.modelWo,attributes:T.attributesWoModal,apiMethod:T.apiMethod,moduleName:"timeReportsLabor",onBack:T.editData}}).then(function(e){e.close.then(function(){o(function(){T.modelWo={}})})})}function N(e){n.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Unapplied Time",id:e,model:T.modelUnapplied,attributes:T.attributesUnappliedModal,apiMethod:"unappliedTime",onBack:T.editData}}).then(function(e){e.close.then(function(){o(function(){})})})}function V(){if(T.formValidation.MailTo||(T.formValidation.MailTo={}),void 0===T.modelMail.MailTo||""===T.modelMail.MailTo||null===T.modelMail.MailTo)T.formValidation.MailTo.Error=!1,T.formValidation.MailTo.Email=!0;else{/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i.test([T.modelMail.MailTo])?(T.formValidation.MailTo.Error=!1,T.formValidation.MailTo.Email=!1):(T.formValidation.MailTo.Error=!0,T.formValidation.MailTo.Email=!0)}}function U(t){c.getLocation("WoForm").then(function(a){t.Latitude=a.coords.latitude,t.Longitude=a.coords.longitude,e.create("events",t).then(function(){})})}a.$watch("vm.model.PayPeriodId",function(){void 0!=T.model.PayPeriodId?e.getItem("companypayperiods",T.model.PayPeriodId).then(function(e){F=e.data;var t=new Date(F.StartDate.replace(/\-/g,"/").replace(/[T|Z]/g," "));u.convertToLocal(t);var a=new Date(F.EndDate.replace(/\-/g,"/").replace(/[T|Z]/g," "));u.convertToLocal(a),T.model.StartDate=t,T.model.EndDate=a}):(T.model.StartDate="",T.model.EndDate="")}),a.$watch("vm.modelWo.WorkHours",function(){T.modelWo.Hours=T.modelWo.WorkHours}),a.$watch("vm.modelWo.PayRateId",function(){void 0!=T.modelWo.PayRateId&&e.getItem("payRates",T.modelWo.PayRateId).then(function(e){e.data&&(null==e.data.RateHour?T.modelWo.Rate=T.rateSheetHourlyRate*e.data.RateMultiplier:T.modelWo.Rate=e.data.RateHour)})}),a.$watch("vm.modelWo.WoId",function(){void 0!=T.modelWo.WoId&&e.getItem("wo",T.modelWo.WoId).then(function(t){if(t.data){T.agreementFilter=l.filter("and"),T.agreementFilter.eq("Id",t.data.AgreementId),e.getItems("woagreements",T.agreementFilter).then(function(e){var t=e.data.Data,a=new Array(7);a[0]="Sunday",a[1]="Monday",a[2]="Tuesday",a[3]="Wednesday",a[4]="Thursday",a[5]="Friday",a[6]="Saturday";var o=new Date;o=u.parseISOString(o.toISOString());for(var r=u.convertToLocal(o),i=r.getDay(),l=r.getHours(),d=r.getMinutes(),n="",s=0;s<t.length;s++){n=6==i||0==i?"Weekend":"Weekday";var m=u.parseISOString(t[s].StartTime),p=u.parseISOString(t[s].EndTime),c=m.getHours(),v=p.getHours(),h=m.getMinutes(),D=p.getMinutes(),b=u.parseISOString(t[s].StartDate);b=u.convertToLocal(b);var y=u.parseISOString(t[s].EndDate);y=u.convertToLocal(y);var I=!1,f=!1;c<=l?c+1<=l?I=!0:h<=d&&(I=!0):I=!1,v>=l?v-1>=l?f=!0:D>=d&&(f=!0):f=!1,"Active"==t[s].Status&&(t[s].Day==a[i]||t[s].Day==n||"All Days"==t[s].Day)&&b<=r&&y>r&&f&&I&&(0==t[s].LaborCovered?T.modelWo.Billable=!0:1==t[s].LaborCovered&&(T.modelWo.Billable=!1))}});var a=t.data.RateSheetId;e.getItem("ratesheets",a).then(function(e){T.rateSheetHourlyRate=e.data.LaborRateHour}),T.CustomerId=t.data.CustomerId,T.usingDSLNorthwest&&(T.customerFilter.reset(),T.customerFilter.eq("CustomerId",T.CustomerId))}})}),a.$watch("vm.model.Techid",function(){void 0!=T.model.Techid?T.args.Techid=T.model.Techid:T.args.Techid=0,null===T.model.Techid&&g&&(T.model.Techid=T.currentTechId)}),a.$watch("vm.model.techIds",function(){void 0==T.model.techIds&&e.getItems("crewtechs/GetListForCrews").then(function(e){var t;1==(t=e.data.Data).length&&(T.model.Techid=t[0].TechId,f=!0,T.attributes[1].ReadOnly=f,T.attributesUnappliedModal[0].ReadOnly=f)})},!0),a.$watch("vm.modelWo.TechId",function(){void 0==T.modelWo.TechId?T.modelWo.TechId=T.model.Techid:T.woFilter.techId=T.modelWo.TechId}),a.$watch("vm.modelWo.Date",function(){void 0!=T.modelWo.Date&&T.modelWo.Date instanceof Date&&T.modelWo.Date.getFullYear()>1900&&T.modelWo.Date.getFullYear()<2100?T.woFilter.date=T.modelWo.Date:T.woFilter.date=null}),a.$watch("vm.woFilter.date",function(){if(null!=T.woFilter.date&&""!=T.woFilter.date){var t=new Date(T.woFilter.date);t.setHours(0,0,0,0);var a=new Date(t),o=u.convertToUtc(a),r=new Date(T.woFilter.date);r.setHours(23,59,59,999);var i=new Date(r),l=u.convertToUtc(i);T.woDropDownFilter.reset(),T.woDropDownFilter.ge("PromiseDate",u.buildISOString(o)).le("PromiseDate",u.buildISOString(l)),e.getItems("techWoes",T.woDropDownFilter).then(function(e){T.listWoes=e.data.Data})}}),a.$watch("vm.modelUnapplied.Techid",function(){void 0==T.modelUnapplied.Techid&&(T.modelUnapplied.Techid=T.model.Techid)})}angular.module("FieldConnectApp").controller("TimeReportsController",e),e.$inject=["restService","$location","$scope","$timeout","$state","$stateParams","qsService","cryptoStorageService","ModalService","Notification","timezoneService","currentUserService","featuresFactory","fcGeoLocationService"]}();;!function(){"use strict";function e(e,o,t,i){var a,n=this;n.$scope=e,n.attributes=e.attributes,n.id=e.id,n.apiMethod=e.apiMethod,n.timezone=e.timezone,n.customFocus=e.customFocus,n.viewName=e.viewName,n.moduleName=e.moduleName,n.filter=e.filter,n.modalClass=!1,n.model=e.model,o(function(){n.modalClass=!0}),n.hideSubmit=!1,e.hideSubmit&&(n.hideSubmit=e.hideSubmit),n.onBack=function(o){if(e.onBack){if(void 0!==e.model.Id&&null!==e.model.Id){var t={TimeRecordId:e.model.Id,TimeType:"WoLabor",Hours:e.model.Hours};i.update("timeApprovals/"+t.TimeRecordId,t).then(function(e){}).then(function(e){})}if(!e.onBack(o))return}n.modalClass=!1,e.close(null,200)},e.$watch("vm.model.LaborCodeName",function(){n.model.LaborCodeName&&o(function(){var e=$.grep(n.attributes,function(e){return"LaborCode"===e.Name})[0].CurrentList;a=$.grep(e,function(e){return e.LaborCodeName===n.model.LaborCodeName}),n.model.PayRateId=a[0].PayRateId})}),e.$watch("vm.model.EndDate",function(e){null!==e&&void 0!==e&&(t.warning({message:"Changes affect the labor hours, but not the start and stop times."}),t.warning({message:"This line has been generated using Track-Realtime."}))})}angular.module("FieldConnectApp").controller("woTimeEditController",e),e.$inject=["$scope","$timeout","Notification","restService"]}();;!function(){"use strict";function e(e,t,a,i,r,l,n,o,s,c,d,f){var m=this;m.edit=p,m.isLoading=!1,m.$state=r,m.deviceDetect=d,m.filter1={techIds:[],fromDate:null,toDate:null},m.filter1Tmp={fromDate:null,toDate:null},m.id=l.id,m.Filter={crewIds:""},m.clearUnappliedTime=function(){m.crewIds=[],m.technicianIds=[],m.filter1.fromDate="",m.filter1.toDate="",u(),T()},m.getUnappliedTimeList=T,m.edit=p,m.crewIds=[],m.technicianIds=[],m.crewsList=[],m.techList=[],a.onlyTech=!1,m.selected={selectedId:parseInt(m.id)},m.attributes=[{Name:"Tech",ValueName:"FullName",Edit:!0,Sortable:!0},{Name:"Date",ValueName:"Date",FormatDate:"date",Sortable:!0},{Name:"Hours",ValueName:"Hours",Sortable:!0},{Name:"Payrate",ValueName:"PayRateName",Sortable:!0},{Name:"Note",ValueName:"Note",Sortable:!0}],m.loadingIndicator=!1,a.$watch("vm.crewIds",function(){for(var e="",t=0;t!=m.crewIds.length;t++)e+=m.crewIds[t]+",";e=e.substring(0,e.length-1),m.Filter.crewIds=e});var D=[];function p(e){r.go("unappliedTimeEdit",{id:e})}function u(){m.filter1.fromDate=new Date,m.filter1.toDate=new Date,m.filter1Tmp.fromDate=new Date,m.filter1Tmp.toDate=new Date}function T(){if(void 0!==m.filter1Tmp.fromDate){if(m.filter1Tmp.fromDate=new Date(m.filter1Tmp.fromDate),!f.validateDate(m.filter1Tmp.fromDate))return}else m.filter1Tmp.fromDate=null;if(void 0!==m.filter1Tmp.toDate){if(m.filter1Tmp.toDate=new Date(m.filter1Tmp.toDate),!f.validateDate(m.filter1Tmp.toDate))return}else m.filter1Tmp.toDate=null;if(void 0===m.filter1Tmp.fromDate||void 0===m.filter1Tmp.toDate||f.validateDateRange(m.filter1Tmp.fromDate,m.filter1Tmp.toDate)){if(m.isLoading=!0,m.filter1.fromDate=m.filter1Tmp.fromDate,m.filter1.toDate=m.filter1Tmp.toDate,""!=m.filter1.fromDate&&null!=m.filter1.fromDate){m.filter1.fromDate=new Date(m.filter1.fromDate),m.filter1.fromDate.setHours(0,0,0,0);var t=new Date(m.filter1.fromDate);o.convertToUtc(t),m.filter1.fromDate=o.buildISOString(t)}if(""!=m.filter1.toDate&&null!=m.filter1.toDate){m.filter1.toDate=new Date(m.filter1.toDate),m.filter1.toDate.setHours(23,59,59,999);var i=new Date(m.filter1.toDate);o.convertToUtc(i),m.filter1.toDate=o.buildISOString(i)}var r="",l=[];if(void 0==m.technicianIds||0==m.technicianIds.length){var n="";if(void 0!=m.crewIds||m.crewIds.length>0){for(var s=0;s!=m.crewIds.length;s++)n+=m.crewIds[s]+",";n=n.substring(0,n.length-1)}e.getItems("crewtechs/GetListForCrews",{crewIds:n}).then(function(){l=e.state.items;for(var t=0;t!=l.length;t++)r+=l[t].TechId+",";r=r.substring(0,r.length-1),m.filter1.techIds=r,0==l.length&&(m.filter1.techIds="-1"),h()})}else{l=m.technicianIds;for(s=0;s!=l.length;s++)r+=l[s]+",";r=r.substring(0,r.length-1),0==D.length&&(r="-1"),m.filter1.techIds=r,h()}var d={};m.filter1Tmp.fromDate&&(d.fromDate=m.filter1Tmp.fromDate),m.filter1Tmp.toDate&&(d.toDate=m.filter1Tmp.toDate),m.technicianIds&&(d.technicianIds=m.technicianIds),m.crewIds&&(d.crewIds=m.crewIds);var p={};c.getValue("lastselection_"+m.UserData.Id)&&(p=c.getValue("lastselection_"+m.UserData.Id)),p.unappliedTime=d,c.setValue("lastselection_"+m.UserData.Id,p),setTimeout(function(){m.isLoading=!1,a.$apply()},1e3)}}function h(){m.reloadTable=!0,m.UnappliedTimeFilter=n.filter("and"),m.UnappliedTimeFilter.reset(),m.UnappliedTimeFilter.ge("StartDate",m.filter1.fromDate).ge("EndDate",m.filter1.toDate).ge("TechIds",m.filter1.techIds)}a.$watch("vm.crewsList",function(){e.getItems("crewtechs/GetListForCrews").then(function(){1==(D=e.state.items).length?a.onlyTech=!0:a.onlyTech=!1})},!0),m.reloadTable=!1,m.UserData={},m.crewsLoaded=!1,m.crewSelected=!1,m.techLoaded=!1,a.$watch("vm.crewsLoaded",function(){m.isLoading=!0,m.crewsLoaded&&s.getCurrentUserData().then(function(e){m.UserData=e;var t=c.getValue("lastselection_"+m.UserData.Id);if(t&&t.unappliedTime){if(t.unappliedTime.fromDate?m.filter1Tmp.fromDate=t.unappliedTime.fromDate:m.filter1Tmp.fromDate=null,t.unappliedTime.toDate?m.filter1Tmp.toDate=t.unappliedTime.toDate:m.filter1Tmp.toDate=null,t.unappliedTime.crewIds&&t.unappliedTime.crewIds.length>0){for(var i=0;i<t.unappliedTime.crewIds.length;i++)m.crewIds.push(t.unappliedTime.crewIds[i]);var r="";for(i=0;i!=m.crewIds.length;i++)r+=m.crewIds[i]+",";r=r.substring(0,r.length-1),m.Filter.crewIds=r}}else u();setTimeout(function(){m.isLoading=!1,a.$apply()},1e3),m.crewSelected=!0})}),a.$watch("vm.techLoaded",function(){m.techLoaded&&s.getCurrentUserData().then(function(e){m.UserData=e;var t=c.getValue("lastselection_"+m.UserData.Id);if(t&&t.unappliedTime&&t.unappliedTime.technicianIds)for(var a=0;a<t.unappliedTime.technicianIds.length;a++)m.technicianIds.push(t.unappliedTime.technicianIds[a]);T()})})}angular.module("FieldConnectApp").controller("UnappliedTimeController",e),e.$inject=["restService","$location","$scope","$timeout","$state","$stateParams","qsService","timezoneService","currentUserService","cryptoStorageService","deviceDetector","dateService"]}();;!function(){"use strict";function e(e,t,a,o,r,i){var s=this;s.$state=r,s.id=i.id,s.model={},s.crewsList=[];var d=[];s.attributesEdit=[{Type:"dropdown",Label:"Tech:",ApiMethod:"crewtechs/GetListForCrews",CurrentList:"crewsList",ValueProp:"TechId",TextProp:"UserFirstLastName",ModelValue:"Techid",ConvertToInt:"true",Required:!0,CustomDivClass:"col-sm-6"},{Type:"datepicker",Label:"Date:",ModelValue:"Date",Format:"MM/dd/yyyy",SubType:"date",Required:!0},{Type:"decimal",Label:"Hours",ModelValue:"Hours",Required:!0},{Type:"dropdown",Label:"PayRate :",ApiMethod:"payRates",ValueProp:"Id",TextProp:"PayRateName",ModelValue:"PayRateId",ConvertToInt:"true",Required:!0,CustomDivClass:"col-sm-6"},{Type:"text",Label:"Note",ModelValue:"Note",MaxLength:"500"}],s.loadingIndicator=!1,a.$watch("vm.crewsList",function(){e.getItems("crewtechs/GetListForCrews").then(function(){1==(d=e.state.items).length&&(s.model.Techid=d[0].TechId)})},!0)}angular.module("FieldConnectApp").controller("UnappliedTimeEditController",e),e.$inject=["restService","$location","$scope","$timeout","$state","$stateParams"]}();;!function(){"use strict";function e(e,t,i,n){var r=this;r.$state=i,r.filterTab="Agreement Type",r.filterTabWindow=!1,"window"==n.tab&&(r.filterTab="Agreement Windows",e.vm.primaryGrid=!0,r.filterTabWindow=!0),e.$watch("va.filterTab",function(){"Agreement Type"==r.filterTab&&(r.filterTabWindow=!1)}),r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("AgreementController",e),e.$inject=["$scope","$location","$state","$stateParams"]}();;!function(){"use strict";function e(e,a,t,m,r,l){var o=this;o.viewName="AgreementTypes",o.moduleName="AgreementTypesGrid",o.edit=function(e){t.go("agreementTypeEdit",{id:e})},o.filter={filterId:r.id},o.id=r.id,o.attributes=[{Name:"Agreement Type Name",ValueName:"AgreementTypeName",Edit:!0,Sortable:!0},{Name:"Billing Period",ValueName:"BillingPeriod",Edit:!1,Sortable:!1},{Name:"Num Billings",ValueName:"NumBillings",Edit:!1,Sortable:!0},{Name:"Term",ValueName:"Term",Edit:!1,Sortable:!0},{Name:"Price",ValueName:"Price",Edit:!1,Sortable:!1},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0}],o.drilldownSettings={ApiMethod:"agreementtypesubs",FilterFields:{AgreementTypeId:"Id"},Timezone:{TzDatabaseName:"%TzDatabaseName%"},attributes:[{Name:"Agreement Window",ValueName:"Day"},{Name:"Start Time",CellFormat:"template",CellFormatData:{TemplateUrl:"startTime.html"},IsUtc:!1},{Name:"End Time",CellFormat:"template",CellFormatData:{TemplateUrl:"endTime.html"},IsUtc:!1},{Name:"Start Time",ValueName:"StartTime",Edit:!1,Sortable:!0,FormatDate:"time",Format:"h:mm a",CustomHeaderClass:"hidden",CustomCellClass:"hidden",IsUtc:!1},{Name:"End Time",ValueName:"EndTime",Edit:!1,Sortable:!0,FormatDate:"time",Format:"h:mm a",CustomHeaderClass:"hidden",CustomCellClass:"hidden",IsUtc:!1},{Name:"Parts Covered",ValueName:"PartsCovered",CellFormat:"checkbox"},{Name:"Misc Covered",ValueName:"MiscCovered",CellFormat:"checkbox"},{Name:"Labor Covered",ValueName:"LaborCovered",CellFormat:"checkbox"},{Name:"Labor Markup%",ValueName:"LaborMarkup",CellFormat:"percent"}],Edit:{ModalTitle:"",attributes:[{Type:"dropdown",Label:"Agreement Type:",Required:!0,ApiMethod:"agreementtypes",ValueProp:"Id",TextProp:"AgreementTypeName",ModelValue:"AgreementTypeId"},{Type:"dropdown",Label:"Agreement Window:",Required:!0,ApiMethod:"agreementWindows/dropdown",ValueProp:"Id",TextProp:"DisplayValue",ModelValue:"AgreementWindowId",ConvertToInt:"true"},{Type:"checkbox",Label:"Parts Covered:",ModelValue:"PartsCovered"},{Type:"checkbox",Label:"Misc Covered:",ModelValue:"MiscCovered"},{Type:"checkbox",Label:"Labor Covered:",ModelValue:"LaborCovered"},{Type:"empty"},{Type:"decimal",Label:"Labor Markup:",ModelValue:"LaborMarkup"}]}};var i=['<span>{{item.WholeDay ? "Whole Day" : item.StartTime |  date: &#39 hh:mm a &#39}}</span>'].join("");l.put("startTime.html",i);var d=['<span>{{item.WholeDay ? "Whole Day" : item.EndTime |  date: &#39 hh:mm a &#39}}</span>'].join("");l.put("endTime.html",d)}angular.module("FieldConnectApp").controller("AgreementTypeController",e),e.$inject=["$scope","$location","$state","ModalService","$stateParams","$templateCache"]}();;!function(){"use strict";function e(e,t,a,l,o,r,d,i,m,n){var s=this;s.showBtn=!0,s.$state=a,s.goBack=function(){window.history.back()},s.submit=function(){s.id?r.update("agreementtypes",s.model).then(function(e){e&&(d.success({message:"Agreement Type successfully updated!"}),i(function(){a.go("agreementTypeEdit",{id:e.config.data.Id})},1200))}):r.create("agreementtypes",s.model).then(function(e){e&&(d.success({message:"Agreement Type successfully created!"}),i(function(){a.go("agreementTypeEdit",{id:e.data.Id})},2e3))})},s.model={},s.modelSub={},s.filterStatus={filterId:"AgreementType"},s.filterAgreementId={AgreementTypeId:l.id},s.AgreementTypeId={Id:null},s.attributes=[{Type:"text",Label:"Agreement Type:",Required:!0,MaxLength:"50",ModelValue:"AgreementTypeName",Autofocus:"true"},{Type:"int",Label:"SLA Hours:",Required:!0,ModelValue:"SLAHours"},{Type:"int",Label:"Term:",Required:!0,ModelValue:"Term"},{Type:"dropdown",Label:"Rate Sheet:",ApiMethod:"ratesheets",ValueProp:"Id",TextProp:"RateSheetName",ModelValue:"RateSheetId",ConvertToInt:"true",Required:!0},{Type:"dropdown",Label:"Billing Period:",ApiMethod:"billingperiods",ValueProp:"BillingPeriodName",TextProp:"BillingPeriodName",ModelValue:"BillingPeriod",Required:!0},{Type:"hidden",Label:"Percent Increase:",Required:!1,ModelValue:"PercentIncrease"},{Type:"decimal",Label:"Price:",Required:!1,ModelValue:"Price"},{Type:"dropdown",Label:"Status:",ApiMethod:"statuses/statusbytype",Filter:s.filterStatus,ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",Required:!0}],s.id=l.id,parseInt(l.id)>0&&(s.showBtn=!1),s.subattributes=[{Name:"Agreement Window",ValueName:"Day",Edit:!0,Sortable:!0},{Name:"Start Time",CellFormat:"template",CellFormatData:{TemplateUrl:"startTime.html"},IsUtc:!1},{Name:"End Time",CellFormat:"template",CellFormatData:{TemplateUrl:"endTime.html"},IsUtc:!1},{Name:"Start Time",ValueName:"StartTime",Edit:!1,Sortable:!0,FormatDate:"time",Format:"h:mm a",CustomHeaderClass:"hidden",CustomCellClass:"hidden",IsUtc:!1},{Name:"End Time",ValueName:"EndTime",Edit:!1,Sortable:!0,FormatDate:"time",Format:"h:mm a",CustomHeaderClass:"hidden",CustomCellClass:"hidden",IsUtc:!1},{Name:"Parts Covered",ValueName:"PartsCovered",Edit:!1,Sortable:!0,CellFormat:"checkbox"},{Name:"Misc Covered",ValueName:"MiscCovered",Edit:!1,Sortable:!0,CellFormat:"checkbox"},{Name:"Labor Covered",ValueName:"LaborCovered",Edit:!1,Sortable:!0,CellFormat:"checkbox"},{Name:"Labor Markup%",ValueName:"LaborMarkup",Edit:!1,Sortable:!0,CellFormat:"percent"}],s.agreementsTypeWindowTimezone={TzDatabaseName:"%TzDatabaseName%"},s.edit=function(e){s.$state.go("agreementTypeSub",{id:e}),s.AgreementTypeId.Id=parseInt(l.id),o.selectiveExtend(c,s,["AgreementTypeId"]),o.setTransitionParam("agreementType",c)};var u=['<span>{{item.WholeDay ? "Whole Day" : item.StartTime |  date: &#39 hh:mm a &#39}}</span>'].join("");n.put("startTime.html",u);var p=['<span>{{item.WholeDay ? "Whole Day" : item.EndTime |  date: &#39 hh:mm a &#39}}</span>'].join("");n.put("endTime.html",p),s.model.Billable=!0;var c={};e.$watch("vm.model.Status",function(){null!=s.model.Status&&void 0!=s.model.Status||(s.model.Status="Active")}),e.$watch("vm.model.Id",function(){null!=s.model.Id&&void 0!=s.model.Id?s.modelSub.AgreementTypeId=s.model.Id:s.modelSub.AgreementTypeId=null}),s.loadingIndicator=!1}angular.module("FieldConnectApp").controller("AgreementTypeEditController",e),e.$inject=["$scope","$location","$state","$stateParams","stateTransitionService","restService","Notification","$timeout","$window","$templateCache"]}();;!function(){"use strict";function e(e,o,t,r,a){var d=this;d.model={},d.$state=t,d.goBack=function(){t.go("agreementTypeEdit",{id:d.model.AgreementTypeId})},d.agrData=a.getTransitionParam("agreementType"),d.subeditattributes=[{Type:"dropdown",Label:"Agreement Type:",Required:!0,ApiMethod:"agreementtypes",ValueProp:"Id",TextProp:"AgreementTypeName",ModelValue:"AgreementTypeId",Autofocus:"true",ReadOnly:!0},{Type:"dropdown",Label:"Agreement Window:",Required:!0,ApiMethod:"agreementWindows/dropdown",ValueProp:"Id",TextProp:"DisplayValue",ModelValue:"AgreementWindowId",ConvertToInt:"true"},{Type:"checkbox",Label:"Parts Covered",ModelValue:"PartsCovered"},{Type:"checkbox",Label:"Misc Covered",ModelValue:"MiscCovered"},{Type:"checkbox",Label:"Labor Covered",ModelValue:"LaborCovered"},{Type:"Empty"},{Type:"percent",Label:"Labor Markup %:",ModelValue:"LaborMarkup"}],d.id=r.id,d.loadingIndicator=!1,e.$watch("vm.model.AgreementTypeId",function(){null!=d.model.AgreementTypeId&&void 0!=d.model.AgreementTypeId||(d.model.AgreementTypeId=d.agrData.AgreementTypeId.Id)})}angular.module("FieldConnectApp").controller("AgreementTypeSubEditController",e),e.$inject=["$scope","$location","$state","$stateParams","stateTransitionService"]}();;!function(){"use strict";function e(e,t,a,m,l,i){this.edit=function(e){a.go("agreementTypeWindowEdit",{id:e})},this.attributes=[{Name:"Day",ValueName:"Day",Edit:!0,Sortable:!0},{Name:"Start Time",CellFormat:"template",CellFormatData:{TemplateUrl:"startTime.html"},IsUtc:!1},{Name:"End Time",CellFormat:"template",CellFormatData:{TemplateUrl:"endTime.html"},IsUtc:!1},{Name:"Start Time",ValueName:"StartTime",Edit:!1,Sortable:!0,FormatDate:"time",Format:"h:mm a",IsUtc:!1,CustomHeaderClass:"hidden",CustomCellClass:"hidden"},{Name:"End Time",ValueName:"EndTime",Edit:!1,Sortable:!0,FormatDate:"time",Format:"h:mm a",IsUtc:!1,CustomHeaderClass:"hidden",CustomCellClass:"hidden"}];var o=['<span>{{item.WholeDay ? "Whole Day" : item.StartTime |  date: &#39 hh:mm a &#39}}</span>'].join("");i.put("startTime.html",o);var r=['<span>{{item.WholeDay ? "Whole Day" : item.EndTime |  date: &#39 hh:mm a &#39}}</span>'].join("");i.put("endTime.html",r)}angular.module("FieldConnectApp").controller("AgreementTypeWindowController",e),e.$inject=["$scope","$location","$state","ModalService","restService","$templateCache"]}();;!function(){"use strict";function e(e,t,o,a,i,d,m){var n=this;n.model={},n.$state=o,n.goBackToWindowTab=function(){n.$state.go("agreementTypeWindow",{tab:"window"})},n.timeZone={},n.timezoneList=[],n.st={Type:"datepicker",Label:"Start Time:",Required:!0,ModelValue:"StartTime",SubType:"time",Format:"h:mm a",ReadOnly:!1,IsUtc:!0},n.et={Type:"datepicker",Label:"End Time:",Required:!0,ModelValue:"EndTime",SubType:"time",Format:"h:mm a",ReadOnly:!1,CustomEnd:"true",CustomDivClass:"",IsUtc:!0},n.attributes=[{Type:"dropdown",Label:"Day:",Required:!0,ApiMethod:"lookup/days",ValueProp:"Name",TextProp:"Name",ModelValue:"Day",ConvertToInt:"true",Autofocus:"true",NoSort:"true"},{Type:"checkbox",Label:"Whole Day",ModelValue:"WholeDay"},n.st,n.et],n.id=a.id,e.$watch("vm.model.WholeDay",function(e,t){n.model.WholeDay?(n.model.StartTime=moment().startOf("day").format(),n.model.EndTime=moment().endOf("day").format(),n.st.CustomDivClass="hidden",n.et.CustomDivClass="hidden"):(1==t&&0==e&&(n.model.EndTime="",n.model.StartTime="",n.et.CustomeEnd=""),n.st.CustomDivClass="",n.et.CustomDivClass="")}),n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("AgreementTypeWindowEditController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","currentUserService","timezoneService"]}();;!function(){"use strict";function e(e,t,a,s,i,n,c,l,u){var o=this;o.model={},o.settings={},o.$state=a,o.goBack=function(){window.history.back()},o.submitSetting=function(t){var a={};a.SettingId=t.SettingId,a.Value=t.Value,0==t.Id?null==a.Value||""==a.Value?!1===a.Value&&i.create("applicationsettings",a).then(function(){n.success({message:"Application settings has been successfully updated."}),o.loadTable=!1,u(function(){e.$broadcast("itemSubmited")})}):i.create("applicationsettings",a).then(function(){n.success({message:"Application settings has been successfully updated."}),o.loadTable=!1,u(function(){e.$broadcast("itemSubmited")})}):null==a.Value||""==a.Value?!1===a.Value?i.update("applicationsettings/"+t.Id,a).then(function(){n.success({message:"Application settings has been successfully updated."}),o.loadTable=!1,u(function(){e.$broadcast("itemSubmited")})}):i.remove("applicationsettings",t.Id).then(function(){n.success({message:"Application settings has been successfully updated."}),o.loadTable=!1,u(function(){e.$broadcast("itemSubmited")})}):i.update("applicationsettings/"+t.Id,a).then(function(){n.success({message:"Application settings has been successfully updated."}),o.loadTable=!1,u(function(){e.$broadcast("itemSubmited")})})},o.attributes=[{Type:"label",Name:"Name",ValueName:"Name",Sortable:!0},{Type:"label",Name:"Description",ValueName:"Desc",Sortable:!0},{Type:"editable",Name:"Value",Value:"Value"}],o.loadingIndicator=!1}angular.module("FieldConnectApp").controller("ApplicationSettingsController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","Notification","qsService","ModalService","$timeout"]}();;!function(){"use strict";function e(e,t,i){this.edit=function(e){i.go("bundleEdit",{id:e})},this.$state=i,this.attributes=[{Name:"Bundle Name",ValueName:"BundleName",Edit:!0,Sortable:!0},{Name:"Description",ValueName:"Description",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("BundleController",e),e.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,o,l,a,t,d,r,i){var u=this;u.$state=l,u.model={},u.laborModel={},u.problemCodeModel={},u.laborEdit=function(e){d.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Bundle Labor Edit",id:e,model:u.laborModel,attributes:u.laborEditAttributes,apiMethod:"bundleDetail/labor",onBack:u.onBackLabor,moduleName:u.moduleName,viewName:u.viewName}}).then(function(e){e.close.then(function(){})})},u.itemEdit=function(e,o,l){u.isItemPart=!0,"Misc"==o&&(u.isItemPart=!1);d.showModal({templateUrl:"Templates/MasterTables/Bundle/bundleItemModal.html",controller:"BundleItemEditController",controllerAs:"vm",inputs:{modalTitle:"Bundle Items (Parts/Misc)",id:e,model:u.model,apiMethod:"bundleDetail/items",moduleName:u.moduleName,viewName:u.viewName,filterType:o,onBack:u.onBackItem,bundleId:l}}).then(function(e){e.close.then(function(){})})},u.problemCodeEdit=function(e){d.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Bundle Problem Codes",id:e,model:u.problemCodeModel,attributes:u.problemCodeEditAttributes,apiMethod:"bundle/problemCodes",onBack:u.onBackProblemCodes,moduleName:u.moduleName,viewName:u.viewName}}).then(function(e){e.close.then(function(){})})},u.id=a.id,u.laborModel.BundleId=u.id,u.problemCodeModel.BundleId=u.id,u.loadingIndicator=!1,u.reloadLaborTable=!0,u.reloadPartsTable=!0,u.reloadMiscTable=!0,u.reloadProblemCodeTable=!0,u.onBackLabor=function(){return u.reloadLaborTable=!1,i(function(){u.reloadLaborTable=!0}),!0},u.onBackItem=function(){u.isItemPart?(u.reloadPartsTable=!1,i(function(){u.reloadPartsTable=!0})):(u.reloadMiscTable=!1,i(function(){u.reloadMiscTable=!0}));return!0},u.onBackProblemCodes=function(){return u.reloadProblemCodeTable=!1,i(function(){u.reloadProblemCodeTable=!0}),!0},u.isItemPart=!0,u.newBundle=!0,u.hideProblemCodes=!1,u.id&&(u.newBundle=!1),u.filterByBundle=t.filter("and"),u.filterByBundle.eq("BundleId",u.id),u.filterParts=t.filter("and"),u.filterParts.eq("Type","Parts").eq("BundleId",u.id),u.filterMisc=t.filter("and"),u.filterMisc.eq("Type","Misc").eq("BundleId",u.id),u.newBundle?u.attributes=[{Type:"text",Label:"Bundle Name:",Required:!0,MaxLength:"50",ModelValue:"BundleName",Autofocus:"true"},{Type:"textarea",Label:"Description:",ModelValue:"Description",MaxLength:"250"}]:u.attributes=[{Type:"text",Label:"Bundle Name:",Required:!0,MaxLength:"50",ModelValue:"BundleName",Autofocus:"true"},{Type:"textarea",Label:"Description:",ModelValue:"Description",MaxLength:"250"},{Type:"blank",CustomClass:"col-sm-12"},{Type:"checkbox",Label:"Assign to All Problem Codes",ModelValue:"AllProblemCodes"},{Type:"checkbox",Label:"Auto Apply to Assignment",ModelValue:"AutoApply"}],u.bbattributes=[{Name:"Bundle Name",ValueName:"BundleName",Edit:!0,Sortable:!0},{Name:"Description",ValueName:"Description",Edit:!1,Sortable:!0}],u.laborGridAttributes=[{Name:"Labor Code",ValueName:"LaborCodeName",Edit:!0,Sortable:!0},{Name:"Pay Rate",ValueName:"PayRateName",Edit:!1,Sortable:!0},{Name:"Work Hours",ValueName:"WorkHours",Edit:!1,Sortable:!0},{Name:"Bill Hours",ValueName:"BillHours",Edit:!1,Sortable:!0}],u.partsGridAttributes=[{Name:"Part Num",ValueName:"PartNum",Edit:!0,Sortable:!0},{Name:"Part Name",ValueName:"ItemName",Edit:!1,Sortable:!0},{Name:"Quantity",ValueName:"Quantity",Edit:!1,Sortable:!0}],u.miscGridAttributes=[{Name:"Part Num",ValueName:"PartNum",Edit:!0,Sortable:!0},{Name:"Part Name",ValueName:"ItemName",Edit:!1,Sortable:!0},{Name:"Quantity",ValueName:"Quantity",Edit:!1,Sortable:!0}],u.problemCodeGridAttributes=[{Name:"Problem Code",ValueName:"ProblemCodeName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Decs",Edit:!1,Sortable:!0},{Name:"Default Hours",ValueName:"DefaultHours",Edit:!1,Sortable:!0}],u.laborEditAttributes=[{Type:"dropdown",Label:"Labor Code:",ApiMethod:"laborCodes",ReadOnly:!1,ValueProp:"Id",TextProp:"LaborCodeName",ModelValue:"LaborCodeId",Name:"LaborCode",Required:!0},{Type:"dropdown",Label:"Pay Rate:",ReadOnly:!1,ApiMethod:"payRates",ValueProp:"Id",TextProp:"PayRateName",ModelValue:"PayRateId",Name:"PayRate",Required:!0},{Type:"decimal",Label:"Work Hours:",ModelValue:"WorkHours",ReadOnly:!1,Required:!0},{Type:"decimal",Label:"Bill Hours:",ModelValue:"BillHours",ReadOnly:!1,Required:!0},{Type:"line",CustomClass:"col-sm-12"},{Type:"checkbox",Label:"Billable",ModelValue:"Billable"}],u.problemCodeEditAttributes=[{Type:"dropdown",Label:"Problem Code:",ApiMethod:"problemCodes",ReadOnly:!1,ValueProp:"Id",TextProp:"ProblemCodeName",ModelValue:"ProblemCodeId",Name:"ProblemCode",Required:!0}],e.$watch("vm.model.AllProblemCodes",function(){u.hideProblemCodes=!u.model.AllProblemCodes}),e.$watch("vm.laborModel.LaborCodeId",function(){void 0!=u.laborModel.LaborCodeId&&i(function(){var e=$.grep(u.laborEditAttributes,function(e){return"LaborCode"==e.Name})[0].CurrentList,o=$.grep(e,function(e){return e.Id==u.laborModel.LaborCodeId});u.laborModel.PayRateId=o[0].PayRateId})}),e.$watch("vm.laborModel.WorkHours",function(){void 0!=u.laborModel.WorkHours&&(u.laborModel.BillHours=u.laborModel.WorkHours)}),u.bundleOnBack=function(e){e&&void 0!=e.Id?u.$state.go("bundleEdit",{id:e.Id}):u.$state.go("bundle")}}angular.module("FieldConnectApp").controller("BundleEditController",e),e.$inject=["$scope","$location","$state","$stateParams","qsService","ModalService","restService","$timeout"]}();;!function(){"use strict";function e(e,t,a,i,m,l,o,r){var d=this;d.$scope=e,d.id=e.id,d.tableName=d.$scope.filterType,d.itemId=null,d.newItem=!0,d.close=function(t){e.onBack&&e.onBack(t);d.modalClass=!1,e.close(null,50)},d.filterItems=m.filter("and"),d.filterItems.eq("SaleType",d.$scope.filterType),d.filterItems.pageSize=5,d.model={Type:d.$scope.filterType,BundleId:d.$scope.bundleId},d.searchItems=function(){d.filterItems.reset(),d.filterItems.like("ItemName","%"+d.itemSearchText+"%"),d.filterItems.pageSize=5},d.itemAttributes=[{Type:"text",Label:"Item:",Required:!0,MaxLength:"50",ModelValue:"ItemName",Autofocus:"true",ReadOnly:!0},{Type:"decimal",Label:"Qty:",Required:!0,ModelValue:"Quantity",Autofocus:"true",MaxLength:"10"}],d.itemGridAttributes=[{Name:"Item Number",ValueName:"PartNum",Edit:!0,Sortable:!0},{Name:"Item Name",ValueName:"ItemName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Manufacturer",ValueName:"Mfr",Edit:!1,Sortable:!0},{Name:"Sale Type",ValueName:"SaleType",Edit:!1,Sortable:!0},{Name:"Unit Of Measure",ValueName:"UOM",Edit:!1,Sortable:!0}],d.id&&(d.newItem=!1,o.getItem("bundleDetail/items",d.$scope.id).then(function(e){d.model.Quantity=e.data.Quantity,d.itemId=e.data.ItemId})),e.$watch("vm.itemId",function(){d.itemId&&o.getItem("items",d.itemId).then(function(e){d.model.ItemName=e.data.ItemName,d.model.ItemId=d.itemId})})}angular.module("FieldConnectApp").controller("BundleItemEditController",e),e.$inject=["$scope","$location","$state","$stateParams","qsService","ModalService","restService","$timeout"]}();;!function(){"use strict";function e(e,t,l,a,i,n,o,s,r,u){var d=this;d.params=o.$$search,d.message=C,d.$state=t,d.isloading=!1,d.apiClientModel={},d.activateApiClient=function(){m(),d.showApiClient=!0},d.submitApiClient=function(){if(d.apiClientModel){var e="";d.apiClientModel.Id?i.update("companyinfos/apiclient/"+d.apiClientModel.Id,d.apiClientModel).then(function(t){d.apiClientModel.ClientSecret=t.data.Description,e="Successfully updated API Client.",m(),n.success({message:e})}):i.create("companyinfos/apiclient",d.apiClientModel).then(function(t){d.apiClientModel.Id=t.data,d.model.Client_Id=d.apiClientModel.Id,e="Successfully created API Client.",m(),n.success({message:e})})}},d.resetClientSecret=c,d.cancelApiClient=function(){d.showApiClient=!1,d.showRevokeClient=!1},d.showApiClient=!1,d.submitApiBtnText="Create API Client",d.revoke=function(){i.update("companyinfos/revokeapiclient/"+d.apiClientModel.Id).then(function(e){n.success({message:"Client is revoked."}),d.apiClientModel=e.data,d.model.Client_Id=null,m()})},d.showRevokeClient=!1;s.getValue("authorizationData").userRoles.split(",");d.filterStatus={filterId:"Company"},d.model={},d.editCompany=function(e){void 0!=e&&n.success({message:"Company info has been successfully updated."});r(function(){d.$state.go("home")})};var p={Type:"text",Label:"Customer Portal URL:",MaxLength:"100",ModelValue:"CompanyURL",ReadOnly:!0};u.onMobile()&&(p={Type:"text",Label:"Customer Portal URL:",MaxLength:"100",ModelValue:"CompanyURL",ReadOnly:!1}),d.attributes=[{Type:"text",Label:"Company Name:",MaxLength:"50",ModelValue:"CompanyName",Required:!0},{Type:"multiselect",Label:"Industry:",ApiMethod:"industries",ValueProp:"Id",TextProp:"IndustryName",ModelValue:"ListIndustryIds"},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"Title:",MaxLength:"50",ModelValue:"Title"},{Type:"text",Label:"Address:",MaxLength:"100",ModelValue:"Address1",Required:!0},{Type:"text",Label:"First Name:",MaxLength:"50",ModelValue:"FirstName",Required:!0},{Type:"text",Label:"",MaxLength:"100",ModelValue:"Address2"},{Type:"text",Label:"Last Name:",MaxLength:"50",ModelValue:"LastName",Required:!0},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"City",Required:!0},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"Phone",Required:!0},{Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"StateCode",Required:!0},{Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"Fax"},{Type:"text",Label:"Postal Code",MaxLength:"20",ModelValue:"PostalCode",Required:!0},{Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"Cell"},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country",Required:!0},{Type:"email",Label:"Email:",MaxLength:"50",ModelValue:"Email",Required:!0},{Type:"line",CustomClass:"col-sm-12"},{Type:"checkbox",Label:"Is different billing address?",ModelValue:"IsDifferentBillingInfo"},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"Billing Contact Title:",MaxLength:"50",ModelValue:"BillingContactTitle"},{Type:"text",Label:"Billing Address:",MaxLength:"100",ModelValue:"BillingAddress",Required:!0},{Type:"text",Label:"Billing Contact First Name:",MaxLength:"50",ModelValue:"BillingContactFirstName",Required:!0},{Type:"text",Label:"",MaxLength:"100",ModelValue:"BillingAddress2"},{Type:"text",Label:"Billing Contact Last Name:",MaxLength:"50",ModelValue:"BillingContactLastName",Required:!0},{Type:"text",Label:"Billing City:",MaxLength:"50",ModelValue:"BillingCity",Required:!0},{Type:"text",Label:"Billing Phone:",MaxLength:"20",ModelValue:"BillingContactPhone",Required:!0},{Type:"dropdown",Label:"Billing State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"BillingStateCode",Required:!0},{Type:"text",Label:"Billing Fax:",MaxLength:"20",ModelValue:"BillingFax"},{Type:"text",Label:"Billing Postal Code",MaxLength:"20",ModelValue:"BillingPostalCode",Required:!0},{Type:"email",Label:"Billing Email:",MaxLength:"50",ModelValue:"BillingEmail",Required:!0},{Type:"dropdown",Label:"Billing Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"BillingCountry",Required:!0},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"Banner:",MaxLength:"50",ModelValue:"Banner",CustomDivClass:"hidden"},{Type:"byteimage",ModelValue:"CompanyLogo",BindTo:"LogoUrl"},{Type:"text",Label:"Company Logo:",MaxLength:"100",ModelValue:"LogoUrl"},p,{Type:"text",Label:"Website:",MaxLength:"50",ModelValue:"WebSite"},{Type:"dropdown",Label:"Currency:",ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode",CurrentList:[]},{Type:"checkbox",Label:"Subcontractor",ModelValue:"Subcontractor",Roles:["FieldConnect"]},{Type:"dropdown",Label:"Status:",ApiMethod:"statuses/statusbytype",Filter:d.filterStatus,ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",Required:!0,Roles:["FieldConnect"]},{Type:"text",Label:"External ID:",MaxLength:"50",ModelValue:"ExternalId",CustomDivClass:"hidden"},{Type:"hidden",ModelValue:"Client_Id"}];var y={Type:"button",Label:"Reset Client Id & Secret",onClick:c,CustomDivClass:"col-sm-3 hidden"};function C(){"isNewCompany"==d.params.param&&n.success("You have been successfully logged in and your login credentials were sent via email. Now, let's proceed with updating the remaining information for your company.",function(){})}function c(){i.getItem("companyinfos/apiclient/0").then(function(){var e=i.state.item;d.apiClientModel.ClientId=e.ClientId,d.apiClientModel.ClientSecret=e.ClientSecret})}function m(){d.apiClientModel&&d.apiClientModel.Id&&0!=d.apiClientModel.Id?(d.submitApiBtnText="Reset Client Secret",d.showRevokeClient=!0):(d.submitApiBtnText="Create API Client",d.showRevokeClient=!1)}d.apiClientAttributes=[{Type:"line",CustomClass:"col-sm-12"},{Type:"subheader",Label:"API Client"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"ClientId:",ModelValue:"ClientId",ReadOnly:!0},{Type:"text",Label:"Client Secret:",ModelValue:"ClientSecret",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-9"},y,{Type:"hidden",ModelValue:"ClientName"},{Type:"hidden",ModelValue:"Id"}],d.isloading=!0,i.getItem("companyinfos/getCurrentCompany").then(function(){d.currentCompany=i.state.item,d.id=d.currentCompany.Id}),i.getItem("companyinfos/apiclient").then(function(){d.apiClientModel=i.state.item}),i.getItems("companyfeatures/currentCompany").then(function(e){for(var t=e.data.Data,l=0;l<t.length;l++)if("CustomerPortal"===t[l].FeatureName&&!JSON.parse(t[l].Value.toLowerCase()))return void(p.Type="hidden")}),e.$watch("vm.attributes[37].CurrentList",function(){if(d.attributes&&d.attributes[37].CurrentList.length>0)for(var e=0;e<d.attributes[37].CurrentList.length;e++)d.model.CurrencyCode||"USD"==d.attributes[37].CurrentList[e].CurrencyCode&&(d.model.CurrencyCode=d.attributes[37].CurrentList[e].CurrencyCode)},!0),e.$watch("vm.model.IsDifferentBillingInfo",function(){void 0!=d.model.IsDifferentBillingInfo&&(d.model.IsDifferentBillingInfo?(d.attributes[18].Type="line",d.attributes[19].Type="text",d.attributes[20].Type="text",d.attributes[21].Type="text",d.attributes[22].Type="text",d.attributes[23].Type="text",d.attributes[24].Type="text",d.attributes[25].Type="text",d.attributes[26].Type="dropdown",d.attributes[27].Type="text",d.attributes[28].Type="text",d.attributes[29].Type="email",d.attributes[30].Type="dropdown"):(d.attributes[18].Type="empty",d.attributes[19].Type="empty",d.attributes[20].Type="empty",d.attributes[21].Type="empty",d.attributes[22].Type="empty",d.attributes[23].Type="empty",d.attributes[24].Type="empty",d.attributes[25].Type="empty",d.attributes[26].Type="empty",d.attributes[27].Type="empty",d.attributes[28].Type="empty",d.attributes[29].Type="empty",d.attributes[30].Type="empty"))}),C(),setTimeout(function(){d.isLoading=!1,e.$apply()},1e3),d.loadingIndicator=!1}angular.module("FieldConnectApp").controller("CompanyInfoEditController",e),e.$inject=["$scope","$state","$stateParams","companyInfoService","restService","Notification","$location","cryptoStorageService","$timeout","mobileDetectService"]}();;!function(){"use strict";function e(e,t,a,n){var o=this;o.submitCompanyData=function(){n.create("companyinfos/regular",o.model).then(function(e){200===e.status&&t.go("userForNewCompanyEdit",{newCompanyId:e.data})})},o.model={},o.$state=t,o.attributes=[{Type:"text",Label:"Company Name:",MaxLength:"50",ModelValue:"CompanyName",Required:!0}],o.loadingIndicator=!1}angular.module("FieldConnectApp").controller("NewCompanyEditController",e),e.$inject=["$scope","$state","$stateParams","restService"]}();;!function(){"use strict";function t(t,e,a,r,l){var i=this;function n(){if(void 0!==i.filter1.startDate){if(!l.validateDate(i.filter1.startDate))return}else i.filter1.startDate=null;if(void 0!==i.filter1.endDate){if(!l.validateDate(i.filter1.endDate))return}else i.filter1.endDate=null;if(void 0===i.filter1.startDate||void 0===i.filter1.endDate||l.validateDateRange(i.filter1.startDate,i.filter1.endDate)){if(""!=i.filter1.startDate&&null!=i.filter1.startDate){i.filter1.startDate=new Date(i.filter1.startDate),i.filter1.startDate.setHours(0,0,0,0);var t=new Date(i.filter1.startDate);r.convertToUtc(t),i.filter2.startDate=r.buildISOString(t)}else i.filter2.startDate=null;if(""!=i.filter1.endDate&&null!=i.filter1.endDate){i.filter1.endDate=new Date(i.filter1.endDate),i.filter1.endDate.setHours(23,59,59,999);var e=new Date(i.filter1.endDate);r.convertToUtc(e),i.filter2.endDate=r.buildISOString(e)}else i.filter2.endDate=null}}i.dofilter=n,i.edit=function(t){a.go("companyPayPeriodsEdit",{id:t})},i.$state=a,i.filter={filterId:null},i.dateService=l,i.filter1={startDate:new Date,endDate:new Date},i.filter2={startDate:null,endDate:null},n(),i.attributes=[{Name:"Name",ValueName:"Name",Edit:!0,Sortable:!0},{Name:"Start Date From",ValueName:"StartDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"Start Date To",ValueName:"EndDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"Grace Days",ValueName:"GraceDays",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0}],t.$watch("startDate",function(t,e){i.filter1.endDate<i.filter1.startDate&&(i.filter1.endDate="")}),t.$watch("endDate",function(t,e){i.filter1.endDate<i.filter1.startDate&&(i.filter1.endDate="")})}angular.module("FieldConnectApp").controller("CompanyPayPeriodController",t),t.$inject=["$scope","$location","$state","timezoneService","dateService"]}();;!function(){"use strict";function e(e,t,a,d,o){var r=this;r.$state=a,r.Filter={filterId:"CompanyPayPeriod"},r.model={},r.attributes=[{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"Name",Autofocus:"true"},{Type:"int",Label:"Grace Days:",ModelValue:"GraceDays"},{Type:"datepicker",Label:"Start Date:",ModelValue:"StartDate",Format:"MM/dd/yyyy",SubType:"date",Required:!0},{Type:"datepicker",Label:"End Date:",ModelValue:"EndDate",Format:"MM/dd/yyyy",SubType:"date",Required:!0},{Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"statuses/statusbytype",ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",Filter:r.Filter}],r.id=d.id,r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("CompanyPayPeriodEditController",e),e.$inject=["$scope","$location","$state","$stateParams","timezoneService"]}();;!function(){"use strict";function e(e,t,a,s,n,i,c,o,l){var u=this;u.model={},u.settings={},u.$state=a,u.goBack=function(){window.history.back()},u.submitSetting=function(e){var t={};t.SettingId=e.SettingId,t.Value=e.Value,0==e.Id?null==t.Value||""==t.Value?!1===t.Value&&n.create("companysettings",t).then(function(t){i.success({message:"Company settings has been successfully updated."}),e.Id=t.data.Id}):n.create("companysettings",t).then(function(t){i.success({message:"Company settings has been successfully updated."}),e.Id=t.data.Id}):null==t.Value||""==t.Value?!1===t.Value?n.update("companysettings/"+e.Id,t).then(function(){i.success({message:"Company settings has been successfully updated."})}):n.remove("companysettings",e.Id).then(function(){i.success({message:"Company settings has been successfully updated."}),e.Id=0}):n.update("companysettings/"+e.Id,t).then(function(){i.success({message:"Company settings has been successfully updated."})})},u.filters=[{ShowRptAfterCompleteFilter:{filterId:"ShowRptAfterComplete"}}],u.category="1",u.tab="1",u.filter=c.filter("and"),u.filter=u.filter.eq("category",u.category),u.setCategory=function(e){u.filter.reset(),u.filter=c.filter("and"),u.filter=u.filter.eq("category",e),u.tab=e},n.getItems("companysettings/getcategories").then(function(e){u.data=e.data.Data;for(var t=0;t!=u.data.length;t++)"1"==u.data[t].SortOrder&&(u.category=u.data[t].Id,u.tab=u.data[t].Id)}),u.attributes=[{Type:"label",Name:"Description",ValueName:"Desc",Sortable:!0},{Type:"editable",Name:"Value",Value:"Value"}],u.loadingIndicator=!1}angular.module("FieldConnectApp").controller("CompanySettingsController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","Notification","qsService","ModalService","$timeout"]}();;!function(){"use strict";function e(e,t,a,m){var i=this;i.edit=!1,i.items=[],i.model={},i.$scope=e,i.close=function(){i.modalClass=!1,e.close(null,50)},i.itemId=0,i.itemName="",i.search=function(){i.autoFilterItem.reset(),""!=i.itemFilter.search&&i.autoFilterItem.like("ItemName","%"+i.itemFilter.search+"%")},i.autoFilterItem=m.filter("and"),i.autoFilterItem.eq("Status","Active"),i.attributes=[{Name:"Item Name",ValueName:"ItemName",Edit:!0,Sortable:!0},{Name:"Item Part Number",ValueName:"PartNum",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Class",ValueName:"ClassName",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"TypeName",Edit:!1,Sortable:!0},{Name:"Manufacturer",ValueName:"Mfr",Edit:!1,Sortable:!0},{Name:"Sale Type",ValueName:"SaleType",Edit:!1,Sortable:!0},{Name:"Unit Of Measure",ValueName:"UOM",Edit:!1,Sortable:!0}],e.$watch("vm.itemId",function(){if(i.itemId>0){for(var t=0;t<i.items.length;t++)if(i.items[t].Id==i.itemId){i.itemName=i.items[t].ItemName;break}e.item.itemId=i.itemId,e.item.itemName=i.itemName,i.close()}})}angular.module("FieldConnectApp").controller("SelectItemController",e),e.$inject=["$scope","$location","$state","qsService"]}();;!function(){"use strict";function e(e,t,i){this.edit=function(e){i.go("crewEdit",{id:e})},this.filter={filterId:null},this.attributes=[{Name:"Crew Name",ValueName:"CrewName",Edit:!0,Sortable:!0},{Name:"Lead Name",ValueName:"LeadFullName",Edit:!1,Sortable:!0}],this.drilldownSettings={ApiMethod:"crewtechs",FilterFields:{CrewId:"Id"},attributes:[{Name:"Technicians",ValueName:"UserFirstLastName"}]}}angular.module("FieldConnectApp").controller("CrewController",e),e.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,t,o,i,n,a,d){var l=this;l.model={},l.id=i.id,l.loadingIndicator=!0,l.goHome=function(){o.go("home")},l.memberList=[],l.techList=[],l.masterList=[];l.id;n.getItems("employees/getTechnician").then(function(e){l.masterList=angular.copy(e.data.Data),l.techList=angular.copy(e.data.Data),a(function(){l.attributes=[{Type:"text",Label:"Crew Name:",ModelValue:"CrewName",Required:!0},{Type:"dropdown",Label:"Lead Name:",Required:!0,ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"CrewLeadId",ConvertToInt:"true"},{Type:"multiselect",Label:"Members:",List:l.memberList,ValueProp:"Id",TextProp:"FullName",ModelValue:"MemberEmployeeIds"},{Type:"multiselect",Label:"Available:",List:l.techList,ValueProp:"Id",TextProp:"FullName",ModelValue:"AvailableEmployeeIds"},{Type:"buttonandlabel",ButtonLabel:"Remove",SuffixIcon:"fa  fa-chevron-circle-right",onClick:r},{Type:"buttonandlabel",ButtonLabel:"Add",PrefixIcon:"fa  fa-chevron-circle-left",onClick:c}],l.loadingIndicator=!1})}),l.$state=o;var m=e.$watch("vm.model.Id",function(e,t){e&&(l.model.ListEmployeeIds.forEach(function(e){l.techList.splice(l.techList.findIndex(t=>t.Id===e),1),l.memberList.push(l.masterList[l.masterList.findIndex(t=>t.Id===e)])}),m())});function c(){l.model.AvailableEmployeeIds.length>0&&(l.model.AvailableEmployeeIds.forEach(function(e){e===l.model.CrewLeadId?d.warning("Crew Lead cannot be a member of a crew!"):(l.memberList.push(l.techList[l.techList.findIndex(t=>t.Id===e)]),l.techList.splice(l.techList.findIndex(t=>t.Id===e),1))}),s())}function r(){l.model.MemberEmployeeIds.length>0&&(l.model.MemberEmployeeIds.forEach(function(e){l.techList.push(l.memberList[l.memberList.findIndex(t=>t.Id===e)]),l.memberList.splice(l.memberList.findIndex(t=>t.Id===e),1)}),s())}function s(){l.model.ListEmployeeIds=[],l.memberList.forEach(function(e){l.model.ListEmployeeIds.push(e.Id)}),a(function(){l.model.MemberEmployeeIds=[],l.model.AvailableEmployeeIds=[]})}e.$watch("vm.model.CrewLeadId",function(e,t){if(e){-1!==l.memberList.findIndex(t=>t.Id===e)&&(d.warning("Crew Lead cannot be a member of a crew!"),a(function(){l.model.CrewLeadId=t}))}}),l.submit=function(){l.loadingIndicator=!0;var e=angular.copy(l.model);delete e.MemberEmployeeIds,delete e.AvailableEmployeeIds,n.update("crewtechs",e).then(function(e){d.success("Crew has been updated!")}).then(function(){l.loadingIndicator=!1,l.$state.go("crews")},function(e){l.loadingIndicator=!1})}}angular.module("FieldConnectApp").controller("CrewEditController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","$timeout","Notification"]}();;!function(){"use strict";function e(e,t,a,r,i,l,o,s,u,m){var n=this;n.viewName="Customers",n.moduleName="CustomersGrid",n.$state=a,n.isLoading=!1,n.edit=function(e){a.go("customersEdit",{id:e})},n.editAttachments=function(e){var t={CustomerId:n.filter.filterId};i.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Customer Attachment Edit",id:e,model:t,attributes:n.editAttributesAttachments,apiMethod:"customerattachments"}}).then(function(e){e.close.then(function(){n.filterByCustomer.Reload++})})},n.customerService=r,n.search=function(){null!=n.filter.filterId&&n.filter.filterId>0&&(n.isLoading=!0,n.filterByCustomer.reset(),n.filterByCustomer.eq("CustomerId",n.filter.filterId),n.filterByCustomer.eq("Search",n.searchText));setTimeout(function(){n.isLoading=!1,e.$apply()},1e3)},n.guiViewName="CustomerModule",n.guiModuleName="CustomerDetails",n.isReadOnly=!1,c(n.guiViewName,n.guiModuleName)===m.permissions.ReadOnly&&(n.isReadOnly=!0);o.getValue("authorizationData");function d(){n.isLoading=!0,n.autoFilter=l.filter("and"),n.autoFilter.reset(),0==n.filter1.status.length&&(n.filter1.status=["Active"]),n.autoFilter.eq("Search",n.filter1.search),n.autoFilter.eq("Status",n.filter1.status);var t={};n.filter1.status&&(t.status=n.filter1.status),n.filter1.search&&(t.search=n.filter1.search);var a={};o.getValue("lastselection_"+n.UserData.Id)&&(a=o.getValue("lastselection_"+n.UserData.Id)),a.customerFilter=t,o.setValue("lastselection_"+n.UserData.Id,a),setTimeout(function(){n.isLoading=!1,e.$apply()},1e3)}function c(e,t){return m.getModulePrivilege(e,t)}n.filter1={status:["Active"],search:null},n.loadFilter=d,n.FilterStatus={filterId:"Customer"},n.filter={filterId:null,Reload:0},n.filterByCustomer=l.filter("and"),n.attributes=[{Name:"Customer Code",ValueName:"CustomerCode",Edit:!1,Sortable:!0},{Name:"Customer Name",ValueName:"CustomerName",Edit:!0,Sortable:!0},{Name:"Address",ValueName:"ContactAddress",Edit:!1,Sortable:!0},{Name:"Contact",ValueName:"ContactName",Edit:!1,Sortable:!0},{Name:"Phone",ValueName:"Phone",Edit:!1,Sortable:!0},{Name:"Email",ValueName:"Email",Edit:!1,Sortable:!0},{Name:"Bill To",ValueName:"BillContactName",Edit:!1,Sortable:!0},{Name:"Bill Address",ValueName:"BillAddress",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0}],s.getCurrentUserData().then(function(e){n.isLoading=!0,n.UserData=e;var t=o.getValue("lastselection_"+n.UserData.Id);t&&t.customerFilter?u(function(){t.customerFilter.status&&(n.filter1.status=t.customerFilter.status),t.customerFilter.search&&(n.filter1.search=t.customerFilter.search),d()}):d()}),n.attributesAttachments=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"AttachementType",Edit:!1,Sortable:!0}],n.editAttributesAttachments=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachementType",Filter:l.filter("and").eq("attachmentCategory","WO")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description:",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"customerattachments/file"}],e.$watch("vm.filter.filterId",function(){n.isLoading=!0,null!=n.filter.filterId&&n.filter.filterId>0&&(n.filterByCustomer.reset(),n.filterByCustomer.eq("CustomerId",n.filter.filterId),n.searchText=""),setTimeout(function(){n.isLoading=!1,e.$apply()},1e3)}),n.getModulePrivilege=c}angular.module("FieldConnectApp").controller("CustomerController",e),e.$inject=["$scope","$location","$state","CustomerService","ModalService","qsService","cryptoStorageService","currentUserService","$timeout","guiPrivilegeService"]}();;!function(){"use strict";function e(e,t,l,a,o,d,n,i,r){var s=this,y=!1;if(s.$state=l,s.id=a.id,s.model={},s.usingDSLNorthwest=i.usingDSLNorthwest,s.usingGroundBreakers=i.usingGroundBreakers,s.guiViewName="CustomerModule",s.guiModuleName="CustomerDetails",s.isReadOnly=!1,u(s.guiViewName,s.guiModuleName)===r.permissions.ReadOnly&&(s.isReadOnly=!0),e.$watch("vm.model.IsDifferentBillingInfo",function(){s.model.IsDifferentBillingInfo?(s.Line3,s.BillContactTitle,s.BillAddress1,s.BillContactFirstName,s.BillAddress2,s.BillContactLastName,s.BillCity,s.BillContactPhone,s.BillStateCode,s.BillContactFax,s.BillCountry,s.BillContactCell,s.BillPostalCode,s.BillContactEmail,s.Line3.Type="line",s.BillContactTitle.Type="text",s.BillAddress1.Type="text",s.BillContactFirstName.Type="text",s.BillAddress2.Type="text",s.BillContactLastName.Type="text",s.BillCity.Type="text",s.BillContactPhone.Type="text",s.BillStateCode.Type="dropdown",s.BillContactFax.Type="text",s.BillCountry.Type="dropdown",s.BillContactCell.Type="text",s.BillPostalCode.Type="text",s.BillContactEmail.Type="email"):(s.Line3.Type="empty",s.BillContactTitle.Type="empty",s.BillAddress1.Type="empty",s.BillContactFirstName.Type="empty",s.BillAddress2.Type="empty",s.BillContactLastName.Type="empty",s.BillCity.Type="empty",s.BillContactPhone.Type="empty",s.BillStateCode.Type="empty",s.BillContactFax.Type="empty",s.BillCountry.Type="empty",s.BillContactCell.Type="empty",s.BillPostalCode.Type="empty",s.BillContactEmail.Type="empty",s.Line3.Required=!1,s.BillContactTitle.Required=!1,s.BillAddress1.Required=!1,s.BillContactFirstName.Required=!1,s.BillAddress2.Required=!1,s.BillContactLastName.Required=!1,s.BillCity.Required=!1,s.BillContactPhone.Required=!1,s.BillStateCode.Required=!1,s.BillContactFax.Required=!1,s.BillCountry.Required=!1,s.BillContactCell.Required=!1,s.BillPostalCode.Required=!1,s.BillContactEmail.Required=!1)}),s.FilterStatus={filterId:"Customer"},s.CustomerCode={Type:"text",Label:"Customer Code:",MaxLength:"50",ModelValue:"CustomerCode",Required:!0,Autofocus:"true",TabIndex:1,ReadOnly:s.isReadOnly},s.OfficeId={Type:"dropdown",Label:"Office:",Required:!0,ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true",TabIndex:3,ReadOnly:s.isReadOnly},s.CustomerName={Type:"text",Label:"Customer Name:",MaxLength:"50",ModelValue:"CustomerName",Required:!0,TabIndex:2,ReadOnly:s.isReadOnly},s.invisibleField={Type:"text",CustomDivClass:"col-sm-6 col-lg-6 visibilityNone"},s.Line1={Type:"line",CustomClass:"col-sm-12"},s.ContactTitle={Type:"text",Label:"Contact Title:",MaxLength:"50",ModelValue:"ContactTitle",TabIndex:4,ReadOnly:s.isReadOnly},s.Address1={Type:"text",Label:"Address:",MaxLength:"100",ModelValue:"Address1",TabIndex:11,ReadOnly:s.isReadOnly},s.ContactFirstName={Type:"text",Label:"First Name:",MaxLength:"50",ModelValue:"ContactFirstName",TabIndex:5,ReadOnly:s.isReadOnly},s.Address2={Type:"text",Label:"",MaxLength:"100",ModelValue:"Address2",TabIndex:12,ReadOnly:s.isReadOnly},s.ContactLastName={Type:"text",Label:"Last Name:",MaxLength:"50",ModelValue:"ContactLastName",TabIndex:6,ReadOnly:s.isReadOnly},s.City={Type:"text",Label:"City:",MaxLength:"50",ModelValue:"City",TabIndex:13,ReadOnly:s.isReadOnly},s.ContactPhone={Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"ContactPhone",TabIndex:7,ReadOnly:s.isReadOnly},s.StateCode={Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"StateCode",TabIndex:14,ReadOnly:s.isReadOnly},s.ContactFax={Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"ContactFax",TabIndex:8,ReadOnly:s.isReadOnly},s.Country={Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country",TabIndex:15,ReadOnly:s.isReadOnly},s.ContactCell={Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"ContactCell",TabIndex:9,ReadOnly:s.isReadOnly},s.PostalCode={Type:"text",Label:"Postal Code:",MaxLength:"20",ModelValue:"PostalCode",TabIndex:16,ReadOnly:s.isReadOnly},s.ContactEmail={Type:"email",Label:"Contact Email:",MaxLength:"50",ModelValue:"ContactEmail",TabIndex:10,ReadOnly:s.isReadOnly},s.Website={Type:"text",Label:"Web site:",MaxLength:"50",ModelValue:"Website",TabIndex:17,ReadOnly:s.isReadOnly},s.Line2={Type:"line",CustomClass:"col-sm-12"},s.IsDifferentBillingInfo={Type:"checkbox",Label:"Is different billing address?",ModelValue:"IsDifferentBillingInfo",TabIndex:18,ReadOnly:s.isReadOnly},s.Line3={Type:"line",CustomClass:"col-sm-12"},s.BillContactTitle={Type:"text",Label:"Bill Contact Title:",MaxLength:"50",ModelValue:"BillContactTitle",Requried:!0,TabIndex:19,ReadOnly:s.isReadOnly},s.BillAddress1={Type:"text",Label:"Address:",MaxLength:"100",ModelValue:"BillAddress1",TabIndex:26,ReadOnly:s.isReadOnly},s.BillContactFirstName={Type:"text",Label:"First Name:",MaxLength:"50",ModelValue:"BillContactFirstName",TabIndex:20,ReadOnly:s.isReadOnly},s.BillAddress2={Type:"text",Label:"",MaxLength:"100",ModelValue:"BillAddress2",TabIndex:27,ReadOnly:s.isReadOnly},s.BillContactLastName={Type:"text",Label:"Last Name:",MaxLength:"50",ModelValue:"BillContactLastName",TabIndex:21,ReadOnly:s.isReadOnly},s.BillCity={Type:"text",Label:"City:",MaxLength:"50",ModelValue:"BillCity",TabIndex:28,ReadOnly:s.isReadOnly},s.BillContactPhone={Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"BillContactPhone",TabIndex:22,ReadOnly:s.isReadOnly},s.BillStateCode={Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"BillStateCode",TabIndex:29,ReadOnly:s.isReadOnly},s.BillContactFax={Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"BillContactFax",TabIndex:23,ReadOnly:s.isReadOnly},s.BillCountry={Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"BillCountry",TabIndex:30,ReadOnly:s.isReadOnly},s.BillContactCell={Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"BillContactCell",TabIndex:24,ReadOnly:s.isReadOnly},s.BillPostalCode={Type:"text",Label:"Postal Code",MaxLength:"20",ModelValue:"BillPostalCode",TabIndex:31,ReadOnly:s.isReadOnly},s.BillContactEmail={Type:"email",Label:"Billing Email:",MaxLength:"50",ModelValue:"BillContactEmail",TabIndex:25,ReadOnly:s.isReadOnly},s.Line4={Type:"line",CustomClass:"col-sm-12"},s.PaymentTermId={Type:"dropdown",Label:"Payment Term:",ApiMethod:"paymentTerms",ValueProp:"Id",TextProp:"PaymentTermName",ModelValue:"PaymentTermId",ConvertToInt:"true",TabIndex:32,ReadOnly:s.isReadOnly},s.TaxRateId={Type:"dropdown",Label:"Tax Rate:",ApiMethod:"taxrates",ValueProp:"Id",TextProp:"TaxName",ModelValue:"TaxRateId",ConvertToInt:"true",TabIndex:37,ReadOnly:s.isReadOnly},s.CreditHold={Type:"checkbox",Label:"Credit Hold",ModelValue:"CreditHold",TabIndex:33,ReadOnly:s.isReadOnly},s.HoldDate={Type:"datepicker",Label:"Hold Date:",ModelValue:"HoldDate",Format:"MM/dd/yy",SubType:"date",TabIndex:38,ReadOnly:s.isReadOnly},s.HoldNote={Type:"textarea",Label:"Hold Note:",MaxLength:"500",ModelValue:"HoldNote",TabIndex:34,ReadOnly:s.isReadOnly},s.ExternalId={Type:"text",Label:"External ID:",MaxLength:"50",ModelValue:"ExternalId",TabIndex:39,ReadOnly:s.isReadOnly},s.CurrencyCode={Type:"dropdown",Label:"Currency Code:",ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode",TabIndex:35,ReadOnly:s.isReadOnly},s.Status={Type:"dropdown",Label:"Status:",ApiMethod:"statuses/statusbytype",Filter:s.FilterStatus,ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",Required:!0,TabIndex:40,ReadOnly:s.isReadOnly},s.Note={Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note",TabIndex:36,ReadOnly:s.isReadOnly},s.attributes=[s.CustomerCode,s.OfficeId,s.CustomerName,s.invisibleField,s.Line1,s.ContactTitle,s.Address1,s.ContactFirstName,s.Address2,s.ContactLastName,s.City,s.ContactPhone,s.StateCode,s.ContactFax,s.Country,s.ContactCell,s.PostalCode,s.ContactEmail,s.Website,s.Line2,s.IsDifferentBillingInfo,s.Line3,s.BillContactTitle,s.BillAddress1,s.BillContactFirstName,s.BillAddress2,s.BillContactLastName,s.BillCity,s.BillContactPhone,s.BillStateCode,s.BillContactFax,s.BillCountry,s.BillContactCell,s.BillPostalCode,s.BillContactEmail,s.Line4,s.PaymentTermId,s.TaxRateId,s.CreditHold,s.HoldDate,s.HoldNote,s.ExternalId,s.CurrencyCode,s.Status,s.Note],s.DSLServiceZoneCode={Type:"dropdown",Label:"Service Zone Code:",ApiMethod:"dslServiceZoneCode/ddList",ValueProp:"Id",TextProp:"Code",ModelValue:"User8",ConvertToInt:"true",TabIndex:41,ReadOnly:s.isReadOnly},s.GBEditServiceReport={Type:"checkbox",Label:"Edit Service Report",ModelValue:"User4",ReadOnly:s.isReadOnly},s.DSLLayout=[s.DSLServiceZoneCode],s.GBLayout=[s.GBEditServiceReport],s.showForm=!1,s.usingDSLNorthwest?(s.DSLServiceZoneCode={Type:"dropdown",Label:"Service Zone Code:",ApiMethod:"dslServiceZoneCode/ddList",ValueProp:"Id",TextProp:"Code",ModelValue:"User8",ConvertToInt:"true",TabIndex:41},s.DSLLayout=[s.DSLServiceZoneCode],s.attributes=s.attributes.concat(s.DSLLayout)):s.usingGroundBreakers&&(s.GBEditServiceReport={Type:"checkbox",Label:"Edit Service Report",ModelValue:"User4"},s.GBLayout=[s.GBEditServiceReport],s.attributes=s.attributes.concat(s.GBLayout)),s.showForm=!0,e.$watch("vm.model.Status",function(){null!=s.model.Status&&void 0!=s.model.Status||(s.model.Status="Active")}),s.id&&(y=!0),e.$watch("vm.model.OfficeId",function(){s.model.OfficeId?y?y=!1:o.getItem("offices/"+s.model.OfficeId).then(function(){s.office=o.state.item,s.model.Country=s.office.Country,s.model.CurrencyCode=s.office.CurrencyCode}):(s.model.Country=null,s.model.CurrencyCode=null)}),s.usingGroundBreakers&&e.$watch("vm.model.User4",function(e,t){e===t||s.id||(s.model.User4=!0,s.GBEditServiceReport.Disabled="true")}),s.id=a.id,!s.id){var C={};s.model.User4=!0,o.getItem("settings/status?type=DefaultOffice").then(function(){(C=o.state.item).Value&&d(function(){s.model.OfficeId=parseInt(C.Value)})})}function u(e,t){return r.getModulePrivilege(e,t)}s.getModulePrivilege=u,s.loadingIndicator=!1}angular.module("FieldConnectApp").controller("CustomerEditController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","$timeout","cryptoStorageService","featuresFactory","guiPrivilegeService"]}();;!function(){"use strict";function e(e,t,a,r,l,i,o,m,s,d){var u=this;u.$state=a,u.edit=function(e){a.go("customerServiceableItemsDetail",{customerId:u.filter1.customerId,id:e})},u.loadTable=!1,u.selected=null,u.customerId="",u.showTabs=!0,u.loadWoesFilter=c,u.goToWo=function(e,t){a.go("serviceRequestWODetails",{id:e})},u.search=function(){u.filter1.customerId&&(u.siCustomerFilter.reset(),u.siCustomerFilter=i.filter("and"),u.siCustomerFilter.eq("CustomerId",u.filter1.customerId),u.siCustomerFilter.eq("Search",u.searchText));u.siteFilter.siteId&&(u.saSiteFilter.reset(),u.saSiteFilter=i.filter("and"),u.saSiteFilter.eq("SiteId",u.siteFilter.siteId),u.saSiteFilter.eq("Search",u.searchText))},u.filter={filterId:null,Reload:0},u.filter1={customerId:null},u.siteFilter={siteId:parseInt(m.id)},u.saSiteFilter=i.filter("and"),u.saSiteFilter.eq("SiteId",u.siteFilter.siteId),u.serviceableItemIdFilter=i.filter("and"),u.serviceableItemIdFilter.eq("ServiceableItemId",0);var n=new Date;function c(){if(u.filter.filterId){if(u.showTabs=!0,u.woesFilter=i.filter("and"),u.woesFilter.eq("CustomerId",u.filter1.customerId),u.woesFilter.eq("ServiceableItemId",u.filter.filterId),u.serviceableItemIdFilter.reset(),u.serviceableItemIdFilter=i.filter("and"),u.serviceableItemIdFilter.eq("ServiceableItemId",u.filter.filterId),""!=u.woesFilter1.startDate&&null!=u.woesFilter1.startDate){u.woesFilter1.startDate=new Date(u.woesFilter1.startDate),u.woesFilter1.startDate.setHours(0,0,0,0);var e=new Date(u.woesFilter1.startDate);o.convertToUtc(e),u.woesFilter.eq("startDate",o.buildISOString(e))}if(""!=u.woesFilter1.endDate&&null!=u.woesFilter1.endDate){u.woesFilter1.endDate=new Date(u.woesFilter1.endDate),u.woesFilter1.endDate.setHours(23,59,59,999);var t=new Date(u.woesFilter1.endDate);o.convertToUtc(t),u.woesFilter.eq("endDate",o.buildISOString(t))}u.loadTable=!1,s(function(){u.loadTable=!0})}else u.showTabs=!1,u.loadTable=!1}n.setDate(n.getDate()-90),u.woesFilter1={startDate:n,endDate:new Date},u.modelAttachment={},u.modelNote={},l.getItem("sites").then(function(){u.site=l.state.item,u.filter1.customerId=u.site.Data[0].CustomerId,u.siCustomerFilter=i.filter("and"),u.siCustomerFilter.eq("CustomerId",u.site.CustomerId)}),u.attributes=[{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Serviceable Item Name",ValueName:"ServiceableItemName",Edit:!0,Sortable:!0},{Name:"Class",ValueName:"ClassName",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"TypeName",Edit:!1,Sortable:!0},{Name:"Serial Number",ValueName:"SerialNum",Edit:!1,Sortable:!0},{Name:"Manufacturer",ValueName:"Mfr",Edit:!1,Sortable:!0},{Name:"Model",ValueName:"Model",Edit:!1,Sortable:!0},{Name:"Location",ValueName:"Location",Edit:!1,Sortable:!0}],u.attributesAttachment=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0}],u.attributesNote=[{Name:"Date Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Note",ValueName:"Note",Edit:!0,Sortable:!0}],u.editAttributesAttachment=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType",Filter:i.filter("and").eq("attachmentCategory","WO")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description :",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"serviceableitemattachments/file"}],u.editAttributesNote=[{Type:"text",Label:"Note:",Required:!0,MaxLength:"500",ModelValue:"Note"},{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"CustomerViewable"}],u.attributesWoes=[{Name:"Work Order",ValueName:"AltId",Edit:!0,Sortable:!0},{Name:"Wo Type",ValueName:"WoType",Edit:!1,Sortable:!0},{Name:"Promised Date",ValueName:"PromiseDate",FormatDate:"datetime",Edit:!1,Sortable:!0},{Name:"Time Zone",ValueName:"TimeZoneName",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!0},{Name:"Agreement",ValueName:"AgreementDesc",Edit:!1,Sortable:!0},{Name:"Subcontractor",ValueName:"CompanyName",Edit:!1,Sortable:!0},{Name:"Sub Bill",ValueName:"SubInvoiceAltId",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"InvoiceReportUrl"}],e.$watch("vm.filter1.customerId",function(){u.filter1.customerId&&(u.filter.filterId=0,u.serviceableItemIdFilter.reset(),u.serviceableItemIdFilter.eq("ServiceableItemId",0),u.siCustomerFilter=i.filter("and"),u.siCustomerFilter.eq("CustomerId",u.filter1.customerId),u.loadTable=!0,c())}),e.$watch("vm.filter.filterId",function(){u.filter.filterId&&(u.loadTable=!0,c()),u.loadTable=!1})}angular.module("FieldConnectApp").controller("CustomerServiceableItemController",e),e.$inject=["$scope","$location","$state","ModalService","restService","qsService","timezoneService","$stateParams","$timeout","sortArrayObjectsByAttrService"]}();;!function(){"use strict";function e(e,t,a,l,r,o,i,d,m){var s=this;s.$state=a,s.goBack=function(){window.history.back()},s.loadTable=!1,s.model={},s.filter={filterId:null,searchText:""},s.loadWoesFilter=u,s.id=l.id,s.filterCustomer={customerId:null},s.goToWo=function(e,t){a.go("serviceRequestWODetails",{id:e})},s.filterCustomer.customerId=l.customerId,s.filter.filterId=s.id,s.autoFilterCustomer=o.filter("and"),s.autoFilterCustomer.filter=[],s.autoFilterCustomer.eq("CustomerId",l.customerId),s.woesFilter=o.filter("and"),s.woesFilter.eq("CustomerId",l.customerId),s.woesFilter.eq("ServiceableItemId",s.id),s.serviceableItemIdFilter=o.filter("and"),s.serviceableItemIdFilter.eq("ServiceableItemId",s.id),s.attributes=[{Type:"text",Label:"Serviceable Item Name:",ReadOnly:!0,MaxLength:"50",ModelValue:"ServiceableItemName"},{Type:"text",Label:"Customer:",ReadOnly:!0,MaxLength:"50",ModelValue:"CustomerName"},{Type:"text",Label:"Class:",ReadOnly:!0,MaxLength:"50",ModelValue:"ClassName"},{Type:"text",Label:"Site:",ReadOnly:!0,MaxLength:"50",ModelValue:"SiteName"},{Type:"text",Label:"Type:",ReadOnly:!0,MaxLength:"50",ModelValue:"TypeName"},{Type:"text",Label:"Location:",ReadOnly:!0,MaxLength:"50",ModelValue:"Location"},{Type:"text",Label:"Model:",ReadOnly:!0,MaxLength:"50",ModelValue:"Model"},{Type:"text",Label:"Asset tag:",ReadOnly:!0,MaxLength:"100",ModelValue:"AssetTag"},{Type:"text",Label:"Manufacturer:",ReadOnly:!0,MaxLength:"50",ModelValue:"Mfr"},{Type:"datepicker",Label:"Install Date:",ReadOnly:!0,ModelValue:"InstallDate",Format:"MM/dd/yy",SubType:"date"},{Type:"text",Label:"Year Manufactured:",ReadOnly:!0,ModelValue:"YearMfr"},{Type:"datepicker",Label:"Warranty Effective Date:",ReadOnly:!0,ModelValue:"WarrantyEffectiveDate",Format:"MM/dd/yy",SubType:"date"},{Type:"text",Label:"Serial Number:",ReadOnly:!0,MaxLength:"100",ModelValue:"SerialNum"},{Type:"datepicker",Label:"Warranty Expire Date:",ReadOnly:!0,ModelValue:"WarrantyExpireDate",Format:"MM/dd/yy",SubType:"date"}],s.attributesAttachment=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0}],s.attributesNote=[{Name:"Date Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Note",ValueName:"Note",Edit:!0,Sortable:!0}],s.editAttributesAttachment=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType"},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description :",Required:!1,MaxLength:"50",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"serviceableitemattachments/file"}],s.editAttributesNote=[{Type:"text",Label:"Note:",Required:!0,MaxLength:"500",ModelValue:"Note"},{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"CustomerViewable"}],s.attributesWoes=[{Name:"Work Order",ValueName:"AltId",Edit:!0,Sortable:!0},{Name:"Wo Type",ValueName:"WoType",Edit:!1,Sortable:!0},{Name:"Promised Date",ValueName:"PromiseDate",FormatDate:"datetime",Edit:!1,Sortable:!0},{Name:"Time Zone",ValueName:"TimeZoneName",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!0}];var n=new Date;function u(){if(s.woesFilter.reset(),s.woesFilter.eq("CustomerId",s.filterCustomer.customerId),s.woesFilter.eq("ServiceableItemId",s.woesFilter1.ServiceableItemId),""!=s.woesFilter1.startDate&&null!=s.woesFilter1.startDate){s.woesFilter1.startDate=new Date(s.woesFilter1.startDate),s.woesFilter1.startDate.setHours(0,0,0,0);var e=new Date(s.woesFilter1.startDate);i.convertToUtc(e),s.woesFilter.eq("startDate",i.buildISOString(e))}if(""!=s.woesFilter1.endDate&&null!=s.woesFilter1.endDate){s.woesFilter1.endDate=new Date(s.woesFilter1.endDate),s.woesFilter1.endDate.setHours(23,59,59,999);var t=new Date(s.woesFilter1.endDate);i.convertToUtc(t),s.woesFilter.eq("endDate",i.buildISOString(t))}}n.setDate(n.getDate()-90),s.woesFilter1={startDate:n,endDate:new Date,ServiceableItemId:s.id},s.id&&(u(),s.loadTable=!0),s.modelAttachment={},s.modelNote={},s.loadingIndicator=!1}angular.module("FieldConnectApp").controller("CustomerServiceableItemsReadOnlyController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","qsService","timezoneService","ModalService","$timeout"]}();;!function(){"use strict";function e(e,t,a,l,i,r,o,d,s,u){var m=this;function c(e,t){return s.getModulePrivilege(e,t)}m.searchServiceRequests=function(){if(m.filterServiceReuests.reset(),""!=m.filterServiceRequestsModel.RequestDateFrom&&null!=m.filterServiceRequestsModel.RequestDateFrom){m.filterServiceRequestsModel.RequestDateFrom=new Date(m.filterServiceRequestsModel.RequestDateFrom),m.filterServiceRequestsModel.RequestDateFrom.setHours(0,0,0,0);var e=new Date(m.filterServiceRequestsModel.RequestDateFrom);o.convertToUtc(e);var t=o.buildISOString(e)}if(""!=m.filterServiceRequestsModel.RequestDateTo&&null!=m.filterServiceRequestsModel.RequestDateTo){m.filterServiceRequestsModel.RequestDateTo=new Date(m.filterServiceRequestsModel.RequestDateTo),m.filterServiceRequestsModel.RequestDateTo.setHours(23,59,59,999);var a=new Date(m.filterServiceRequestsModel.RequestDateTo);o.convertToUtc(a);var l=o.buildISOString(a)}m.filterServiceRequestsModel.isWOchecked=!0;var i=angular.element(document.querySelector("#woStatusFilter"));i.count()>0&&(m.filterServiceRequestsModel.isWOchecked=i[0].checked);m.filterServiceReuests.eq("StatusName",m.filterServiceRequestsModel.Name).eq("WorkOrder",m.filterServiceRequestsModel.AltId?m.filterServiceRequestsModel.AltId:null).eq("SiteId",m.filterServiceRequestsModel.SiteId).eq("ServiceableItemId",m.filterServiceRequestsModel.ServiceableItemId).eq("RequestDateFrom",t).eq("RequestDateTo",l).eq("WoType",m.filterServiceRequestsModel.WoTypeName).eq("OnlySR",!m.filterServiceRequestsModel.isWOchecked)},m.editServiceRequest=function(e,t){u.setTransitionParam("customerSite",{});null!=t&&"Pending"!=t.WorkOrder?a.go("serviceRequestCustomerReadOnly",{id:e}):a.go("customerServiceRequestEdit",{id:e})},m.editAgreements=function(e){a.go("customerUserSitesAgreementReadOnly",{id:e})},m.search=function(){m.filter.SiteId&&(m.filterBySite.reset(),m.filterBySite.eq("SiteId",m.filter.SiteId),m.filterBySite.eq("Search",m.searchText))},m.editNotes=function(e){m.modelNotes.NoteTemp="",m.modelNotes.SiteId=m.filter.SiteId,l.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Site Note Edit",id:e,model:m.modelNotes,attributes:m.editAttributesNotes,apiMethod:"sitenotes",viewName:m.viewName,moduleName:m.moduleNameSiteNoteGrid}}).then(function(e){e.close.then(function(){m.filterBySite.Reload++})})},m.model={},m.secondedit=function(e,t){null!=t&&"Pending"!=t.WorkOrder&&"Cancelled"!=t.WorkOrder&&a.go("serviceRequestWODetails",{id:t.WoId})},m.viewName="CustomerUserSites",m.moduleName="SitesGrid",m.moduleNameServiceRequestGrid="ServiceRequestGrid",m.moduleNameSiteNoteGrid="SiteNoteGrid",m.moduleNameSiteAgreementGrid="SiteAgreementGrid",m.filter={SiteId:null,AgreementId:null,Reload:0},m.filterBySite=r.filter("and"),m.filterServiceReuests=r.filter("and"),m.attributes=[{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0,ObjectName:"colCustomer"},{Name:"Site Code",ValueName:"SiteCode",Edit:!1,Sortable:!0,ObjectName:"colSiteCode"},{Name:"Site Name",ValueName:"SiteName",Edit:!1,Sortable:!0,ObjectName:"colSiteName"},{Name:"Address",ValueName:"FullAddress",Edit:!1,Sortable:!0,ObjectName:"colAddress"},{Name:"Contact",ValueName:"ContactName",Edit:!1,Sortable:!1,ObjectName:"colContact"},{Name:"Phone",ValueName:"Phone",Edit:!1,Sortable:!1,ObjectName:"colPhone"},{Name:"Email",ValueName:"Email",Edit:!1,Sortable:!1,ObjectName:"colEmail"}],m.attributesServiceRequests=[{Name:"Request Date",ValueName:"RequestDate",Edit:!1,Sortable:!0,FormatDate:"date",ObjectName:"colRequestDate"},{Name:"Work Order",ValueName:"WorkOrder",Edit:!1,Sortable:!0,ObjectName:"colWorkOrder",SecondEdit:!0,BindedTo:"WoId",BindValue:0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0,ObjectName:"colSiteName"},{Name:"Requested by",ValueName:"RequestedBy",Edit:!1,Sortable:!0,ObjectName:"colRequestedBy"},{Name:"Need By Date",ValueName:"NeedByDate",Edit:!1,Sortable:!0,FormatDate:"date",ObjectName:"colNeedByDate"},{Name:"Work Order Type",ValueName:"WoType",Edit:!1,Sortable:!0,ObjectName:"colWoType"},{Name:"Description",ValueName:"Description",Edit:!1,ConditionalEdit:!0,BindedTo:"Id",BindValue:0,Sortable:!0,ObjectName:"colDescription"},{Name:"Serviceable Item",ValueName:"ServiceableItems",Edit:!1,Sortable:!0,ObjectName:"colServiceableItems"},{Name:"Status",ValueName:"StatusName",Edit:!1,Sortable:!0,ObjectName:"colStatus"}],m.attributesServiceRequestsFilter=[{Type:"text",Label:"Work Order number:",ModelValue:"AltId"},{Type:"dropdown",Label:"Serviceable Item:",Required:!1,ApiMethod:"serviceableitems",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",Filter:m.filterBySite,TabIndex:4},{Type:"dropdown",Label:"Work Order Type:",Required:!1,ApiMethod:"wotypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"WoTypeName",TabIndex:5}],m.attributesNotes=[{Name:"Date Time",ValueName:"SysModifyUTC",Edit:!1,Sortable:!0,FormatDate:"datetime",ObjectName:"colDateTime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0,ObjectName:"colCreatedBy"},{Name:"Note",ValueName:"Note",Edit:!0,Sortable:!0,ObjectName:"colNote"}],m.attributesAgreement=[{Name:"Description",ValueName:"Desc",Edit:!0,Sortable:!0,ObjectName:"colDesc"},{Name:"Agreement Type",ValueName:"AgreementTypeName",Edit:!1,Sortable:!0,ObjectName:"colAgreementTypeName"},{Name:"Start Date",ValueName:"StartDate",Edit:!1,Sortable:!0,FormatDate:"date",ObjectName:"colStartDate"},{Name:"End Date",ValueName:"EndDate",Edit:!1,Sortable:!0,FormatDate:"date",ObjectName:"colEndDate"}],m.editAttributesAgreements=[{Type:"text",Label:"Agreement Type:",ModelValue:"AgreementTypeName",ReadOnly:!0},{Type:"text",Label:"Contact Name:",ModelValue:"FullName",ReadOnly:!0},{Type:"textarea",Label:"Description:",ModelValue:"Desc",MaxLength:"500",ReadOnly:!0},{Type:"datepicker",Label:"Start Date:",ModelValue:"StartDate",ReadOnly:!0,Format:"MM/dd/yyyy",SubType:"date"},{Type:"text",Label:"BilingPeriod:",ModelValue:"BillingPeriod",ReadOnly:!0},{Type:"datepicker",Label:"End Date:",ModelValue:"EndDate",ReadOnly:!0,Format:"MM/dd/yyyy",SubType:"date"},{Type:"text",Label:"SLA:",ModelValue:"SLAHours",ReadOnly:!0},{Type:"text",Label:"Term:",ModelValue:"Term",ReadOnly:!0},{Type:"text",Label:"Status:",ModelValue:"Status",ReadOnly:!0},{Type:"textarea",Label:"Note:",ModelValue:"Note",MaxLength:"500",ReadOnly:!0}],m.siteNoteFilter=r.filter("and"),m.siteNoteFilter.eq("NoteType","Site"),m.editAttributesNotes=[{Type:"dropdown",Label:"Standard Notes:",ApiMethod:"notelibs",ValueProp:"Note",TextProp:"NoteTitle",ModelValue:"NoteTemp",Filter:m.siteNoteFilter},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note",Required:!0}],m.FilterStatus=r.filter("and"),m.FilterStatus.eq("Type","ServiceRequestStatus").neq("StatusName","WOCreated"),m.filterServiceRequestsModel={RequestDateFrom:new Date(Date.now()+-2592e6),RequestDateTo:new Date,AltId:null,SiteId:null,ServiceableItemId:null,WoTypeName:null,Name:null,isWOchecked:!0},m.hideNotes="hidden",m.tmpNotes=c(m.viewName,m.moduleNameSiteNoteGrid),e.$watch("vm.tmpNotes",function(){m.tmpNotes&&d(function(){m.hideNotes="",e.$apply()})}),m.hideAgreement="hidden",m.tmpAgreement=c(m.viewName,m.moduleNameSiteAgreementGrid),e.$watch("vm.tmpAgreement",function(){m.tmpAgreement&&d(function(){m.hideAgreement="",e.$apply()})}),e.$watch("vm.filter.SiteId",function(){m.filter.SiteId&&(m.showAgreementTab=!1,m.filterServiceRequestsModel.SiteId=m.filter.SiteId,function(){if(m.filter.SiteId){if(m.filterBySite.reset(),m.filterBySite.eq("SiteId",m.filter.SiteId),m.filterServiceReuests.reset(),""!=m.filterServiceRequestsModel.RequestDateFrom&&null!=m.filterServiceRequestsModel.RequestDateFrom){m.filterServiceRequestsModel.RequestDateFrom=new Date(m.filterServiceRequestsModel.RequestDateFrom),m.filterServiceRequestsModel.RequestDateFrom.setHours(0,0,0,0);var e=new Date(m.filterServiceRequestsModel.RequestDateFrom);o.convertToUtc(e);var t=o.buildISOString(e)}if(""!=m.filterServiceRequestsModel.RequestDateTo&&null!=m.filterServiceRequestsModel.RequestDateTo){m.filterServiceRequestsModel.RequestDateTo=new Date(m.filterServiceRequestsModel.RequestDateTo),m.filterServiceRequestsModel.RequestDateTo.setHours(23,59,59,999);var a=new Date(m.filterServiceRequestsModel.RequestDateTo);o.convertToUtc(a);var l=o.buildISOString(a)}m.filterServiceRequestsModel.isWOchecked=!0;var i=angular.element(document.querySelector("#woStatusFilter"));i[0]&&(m.filterServiceRequestsModel.isWOchecked=i[0].checked),m.filterServiceReuests.eq("StatusName",m.filterServiceRequestsModel.Name).eq("WorkOrder",m.filterServiceRequestsModel.AltId?m.filterServiceRequestsModel.AltId:null).eq("SiteId",m.filterServiceRequestsModel.SiteId).eq("ServiceableItemId",m.filterServiceRequestsModel.ServiceableItemId).eq("RequestDateFrom",t).eq("RequestDateTo",l).eq("WoType",m.filterServiceRequestsModel.WoTypeName).eq("OnlySR",!m.filterServiceRequestsModel.isWOchecked),m.loadTable=!1,d(function(){m.loadTable=!0})}else m.loadTable=!1}())}),e.$watch("vm.filter.AgreementId",function(){m.filter.AgreementId&&(m.showAgreementTab=!0,d(function(){e.$apply()}))}),m.modelNotes={SiteId:m.filter.SiteId,NoteTemp:""},e.$watch("vm.modelNotes.NoteTemp",function(){m.modelNotes.Note=m.modelNotes.NoteTemp}),m.modelAgreements={SiteId:m.filter.SiteId},m.loadAgreement=!1,m.loadNotes=!1,m.tabChange=function(e){},e.$on("tabsChanges",function(t,a){"Site Agreements"===a?m.loadAgreement=!0:"Site Notes"===a&&(m.loadNotes=!0),d(function(){e.$apply()})}),m.getModulePrivilege=c}angular.module("FieldConnectApp").controller("CustomerSiteController",e),e.$inject=["$scope","$location","$state","ModalService","$stateParams","qsService","timezoneService","$timeout","guiPrivilegeService","stateTransitionService"]}();;!function(){"use strict";function e(e,t,a,l,r,n){var i=this;i.$state=l,""!=r.id&&(i.id=parseInt(r.id),i.filterById=n.filter("and"),i.filterById.eq("Id",i.id),e.getItems("agreementsites/getcustomeragreementsite",i.filterById).then(function(t){i.items=t.data.Data,i.AgreementId=i.items[0].AgreementId,i.filterByAgreement=n.filter("and"),i.filterByAgreement.eq("AgreementId",i.AgreementId),e.getItems("agreementsites",i.filterByAgreement).then(function(e){i.items=e.data.Data,i.numSites=i.items.length}),e.getItems("agreementserviceableitems",i.filterByAgreement).then(function(e){i.items=e.data.Data,i.numServItem=i.items.length})})),i.attributesAgreementSite=[{Name:"Site Name",ValueName:"SiteName",Edit:!1,Sortable:!0}],i.attributesAgreementServiceableItem=[{Name:"Serviceable Item Name",ValueName:"ServiceableItemName",Edit:!1,Sortable:!0}],i.attributes=[{Type:"text",FocusOut:!0,Label:"Agreement Type:",ModelValue:"AgreementTypeName",ReadOnly:!0},{Type:"text",Label:"Contact Name:",ModelValue:"CustomerName",ReadOnly:!0},{Type:"textarea",Label:"Description:",ModelValue:"Desc",MaxLength:"500",ReadOnly:!0},{Type:"datepicker",Label:"Start Date:",ModelValue:"StartDate",ReadOnly:!0,Format:"MM/dd/yyyy",SubType:"date"},{Type:"text",Label:"BilingPeriod:",ModelValue:"BillingPeriod",ReadOnly:!0},{Type:"datepicker",Label:"End Date:",ModelValue:"EndDate",ReadOnly:!0,Format:"MM/dd/yyyy",SubType:"date"},{Type:"text",Label:"SLA:",ModelValue:"SLAHours",ReadOnly:!0},{Type:"text",Label:"Term:",ModelValue:"Term",ReadOnly:!0},{Type:"text",Label:"Status:",ModelValue:"Status",ReadOnly:!0},{Type:"textarea",Label:"Note:",ModelValue:"Note",MaxLength:"500",ReadOnly:!0}]}angular.module("FieldConnectApp").controller("CustomerSiteAgreementController",e),e.$inject=["restService","$scope","$location","$state","$stateParams","qsService"]}();;!function(){"use strict";function e(e,t,a,r,o,i,l,s){var n=this;function m(){n.isLoading=!0,n.reloadTable=!0,n.roleFilter.reset(),n.roleFilter.eq("RoleId",n.searchFilter.RoleId).eq("Search",n.searchFilter.Search),setTimeout(function(){n.isLoading=!1,e.$apply()},1e3)}n.viewName="CustomerUsers",n.moduleName="CustomerUsersGrid",n.$window=o,n.edit=function(e){e?a.go("customerUserEdit",{id:e}):l.getItems("customerusers/getAvailableForFeature").then(function(t){if(!JSON.parse(t.data))return s.error({message:"There are no available customer users to add based on Customer Portal Feature Parameter configuration. Please contact your Administrator."}),!1;a.go("customerUserEdit",{id:e})})},n.getUsers=m,n.reloadTable=!0,n.isLoading=!1,n.attributes=[{Name:"Name",ValueName:"FullName",Edit:!1,Sortable:!0,ObjectName:"colFullName"},{Name:"User Name",ValueName:"UserName",Edit:!0,Sortable:!0,ObjectName:"colUserName"},{Name:"Phone Number",ValueName:"Phone",Edit:!1,Sortable:!0,ObjectName:"colPhone"},{Name:"Last Login Date/Time",ValueName:"LastLoginDate",Edit:!1,Sortable:!0,ObjectName:"colLastLoginDate",FormatDate:"datetime"}],n.model={},r(function(){$("#search-info").css("display","inline-block"),$("#search-info").attr("title","Search by user name or first/last name of user.")}),n.filter={UserId:null},n.searchFilter={RoleId:null,Search:""},n.roleFilter=i.filter("and"),m()}angular.module("FieldConnectApp").controller("CustomerUserController",e),e.$inject=["$scope","$location","$state","$timeout","$window","qsService","restService","Notification"]}();;!function(){"use strict";function e(e,s,t,a,o,r,d,l,i){var u=this;u.$state=t,u.id=s.id,u.$window=d,u.userDataModel={},u.resetPasswordModel={},u.submitUserData=function(){if(u.showMissingCustomer=0==u.selectedCustomers.length,u.showMissingCustomer)return void a(function(){e.$apply()});u.userDataModel.CustomerIds=[];for(var s=0;s<u.selectedCustomers.length;s++)u.userDataModel.CustomerIds.push(u.selectedCustomers[s].Id);u.userDataModel.SiteIds=[];for(var s=0;s<u.selectedSites.length;s++)u.userDataModel.SiteIds.push(u.selectedSites[s].Id);if(u.id)"Active"==u.userDataModel.Status?o.update("customerusers/"+u.id,u.userDataModel).then(function(e){200===e.status&&(r.success({message:"User has been successfully updated."}),t.go("customerUserTable"))}):o.getItems("customerusers/getAvailableForFeature").then(function(e){"Inactive"==u.userDataModel.Status||JSON.parse(e.data)?o.update("customerusers/"+u.id,u.userDataModel).then(function(e){200===e.status&&(r.success({message:"User has been successfully updated."}),t.go("customerUserTable"))}):r.error({message:"There are no available customer users to add based on Customer Portal Feature Parameter configuration. Please contact your Administrator."})});else{if(u.userDataModel.Password!==u.userDataModel.ConfirmPassword)return void r.error({message:"Passwords don't match!"});o.getItems("customerusers/getAvailableForFeature").then(function(e){JSON.parse(e.data)?o.create("customerusers",u.userDataModel).then(function(e){201===e.status&&(r.success({message:"User has been successfully created."}),t.go("customerUserTable"))}):r.error({message:"There are no available customer users to add based on Customer Portal Feature Parameter configuration. Please contact your Administrator."})})}},u.cancelSubmit=function(){u.$state.go("customerUserTable")},u.activateReset=function(){u.showResetPasword=!0},u.submitResetPassword=function(){if(u.resetPasswordModel.NewPassword!==u.resetPasswordModel.ConfirmNewPassword)return void r.error({message:"Passwords don't match!"});if(null==u.resetPasswordModel.NewPassword||0==u.resetPasswordModel.NewPassword.length||null==u.resetPasswordModel.ConfirmNewPassword||0==u.resetPasswordModel.ConfirmNewPassword.length)return void r.error({message:"Please choose a password."});u.resetPasswordModel.UserId=parseInt(u.id),u.resetPasswordModel.Id=parseInt(u.id),o.update("users/updatepassword",u.resetPasswordModel).then(function(e){u.showResetPasword=!1,u.resetPasswordModel.NewPassword=null,u.resetPasswordModel.ConfirmNewPassword=null,r.success({message:"Password has been successfully changed."})})},u.cancelResetPasword=function(){u.showResetPasword=!1,u.resetPasswordModel.NewPassword=null,u.resetPasswordModel.ConfirmNewPassword=null},u.addSelectedCustomers=function(){if(u.customerIds){for(var e=0;e<u.customerIds.length;e++)C(u.customerIds[e]);u.customerIds=[],h()}},u.removeSelectedCustomers=function(){if(u.selectedCustomerIds){for(var e=0;e<u.selectedCustomerIds.length;e++)b(u.selectedCustomerIds[e]);u.selectedCustomerIds=[],h()}},u.addSelectedSites=function(){if(u.siteIds){for(var e=0;e<u.siteIds.length;e++)S(u.siteIds[e]);u.siteIds=[]}},u.removeSelectedSites=function(){if(u.selectedSiteIds){for(var e=0;e<u.selectedSiteIds.length;e++)I(u.selectedSiteIds[e]);u.selectedSiteIds=[]}},u.showResetPasword=!1,u.showMissingCustomer=!1;for(var n=i.getValue("authorizationData").userRoles.split(","),c=0;c<n.length;c++)"FieldConnect"==n[c]&&!0,"Admin"==n[c]&&!0,"CustAdmin"==n[c]&&!0;function m(){if(u.userDataModel.Customers&&u.customers){for(var e=0;e<u.userDataModel.Customers.length;e++)C(u.userDataModel.Customers[e].Id);h()}}function f(){if(u.userDataModel.Sites&&u.sites){u.sitesLoaded=!0;for(var e=0;e<u.userDataModel.Sites.length;e++)S(u.userDataModel.Sites[e].Id)}}function h(){if(u.selectedCustomers)if(0==u.selectedCustomers.length)u.availableSites=[],p();else{u.filterSites.reset();for(var e=0;e<u.selectedCustomers.length;e++)u.filterSites.eq("CustomerId",u.selectedCustomers[e].Id);o.getItems("sites",u.filterSites).then(function(e){e.data&&e.data.Data&&(u.availableSites=e.data.Data,u.availableSitesCopy=angular.copy(u.availableSites)),p()})}}function p(){u.siteIds=[],u.selectedSiteIds=[],w(u.availableSites,u.sites),w(u.availableSites,u.selectedSites),w(u.sites,u.availableSites,!0,u.selectedSites),u.sitesLoaded||f()}function w(e,s,t,a){for(var o=0;o<s.length;){for(var r=!1,d=0;d<e.length;d++)if(s[o].Id==e[d].Id){r=!0;break}if(!r&&a)for(d=0;d<a.length;d++)if(s[o].Id==a[d].Id){r=!0;break}r?o++:t?(e.push(s[o]),o++):s.splice(o,1)}}function C(e){for(var s=0;s<u.customers.length;s++)if(e==u.customers[s].Id){u.selectedCustomers.push(u.customers[s]),u.customers.splice(s,1);break}}function b(e){for(var s=0;s<u.selectedCustomers.length;s++)if(e==u.selectedCustomers[s].Id){u.customers.push(u.selectedCustomers[s]),u.selectedCustomers.splice(s,1),u.customerIds=[];break}}function S(e){for(var s=0;s<u.sites.length;s++)if(e==u.sites[s].Id){u.selectedSites.push(u.sites[s]),u.sites.splice(s,1);break}}function I(e){for(var s=0;s<u.selectedSites.length;s++)if(e==u.selectedSites[s].Id){u.sites.push(u.selectedSites[s]),u.selectedSites.splice(s,1);break}}u.statusFilter={filterId:"User"},u.filterSites=l.filter("or"),u.customers=[],u.sites=[],u.selectedCustomers=[],u.selectedSites=[],u.customerIds=[],u.siteIds=[],u.selectedCustomerIds=[],u.selectedSiteIds=[],u.availableSites=[],u.sitesLoaded=!1,u.attributes=[{Type:"text",Label:"User Name:",Required:!0,MaxLength:50,ModelValue:"UserName",TabIndex:1},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:u.id?"empty":"password",Label:"Password:",Required:!0,ModelValue:"Password",TabIndex:2},{Type:u.id?"empty":"password",Label:"Confirm Password:",Required:!0,ModelValue:"ConfirmPassword",TabIndex:3},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"First Name:",Required:!0,MaxLength:50,ModelValue:"FirstName",Autofocus:!0,TabIndex:4},{Type:"text",Label:"Cell:",Required:!1,MaxLength:20,ModelValue:"Cell",TabIndex:8},{Type:"text",Label:"Last Name:",Required:!0,MaxLength:50,ModelValue:"LastName",TabIndex:5},{Type:"text",Label:"Phone:",Required:!1,MaxLength:20,ModelValue:"Phone",TabIndex:9},{Type:"email",Label:"Email:",Required:!0,MaxLength:50,ModelValue:"Email",TabIndex:6},{Type:"dropdown",Label:"Time Zone:",Required:!0,ModelValue:"TimeZoneId",ValueProp:"Id",TextProp:"TimeZoneName",ApiMethod:"timezones",TabIndex:10},{Type:"dropdown",Label:"Role:",Required:!0,ModelValue:"RoleId",ValueProp:"Id",TextProp:"RoleName",ApiMethod:"roles/customer",TabIndex:7},{Type:"dropdown",Label:"Status:",Required:!0,ModelValue:"Status",ValueProp:"StatusName",TextProp:"StatusName",ApiMethod:"statuses/statusbytype",CurrentList:[],Filter:u.statusFilter,TabIndex:11},{Type:"line",CustomClass:"col-sm-12"}],u.resetPasswordAttributes=[{Type:"line",CustomClass:"col-sm-12"},{Type:"subheader",Label:"Reset Password"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"password",Label:"New Password:",ModelValue:"NewPassword",TabIndex:16},{Type:"password",Label:"Confirm New Password:",ModelValue:"ConfirmNewPassword",TabIndex:17}],o.getItems("customers?sort=CustomerName").then(function(e){e.data&&e.data.Data&&(u.customers=e.data.Data,u.customerCopy=angular.copy(u.customers),m(),f())}),e.$watch("vm.userDataModel.Customers",function(){m()}),e.$watch("vm.model.SearchCustomer",function(){if(u.customerCopy&&(u.model.SearchCustomer.length>2||0==u.model.SearchCustomer.length)){u.customerTmp=[],u.customers=u.customerCopy;for(var e=0;e<u.customers.length;e++)-1!=u.customers[e].CustomerName.toLowerCase().indexOf(u.model.SearchCustomer.toLowerCase())&&u.customerTmp.push(u.customers[e]);u.customers=u.customerTmp}}),e.$watch("vm.model.SearchSite",function(){if(u.availableSitesCopy&&(u.model.SearchSite.length>2||0==u.model.SearchSite.length)){u.availableSitesTmp=[],u.availableSites=u.availableSitesCopy;for(var e=0;e<u.availableSites.length;e++)-1!=u.availableSites[e].SiteName.toLowerCase().indexOf(u.model.SearchSite.toLowerCase())&&u.availableSitesTmp.push(u.availableSites[e]);u.sites=u.availableSitesTmp}}),u.existCustomer=!1,e.$watch("vm.customerIds",function(){u.showMissingCustomer=!1,u.selectedCustomers.length>0||u.customerIds.length>1?u.existCustomer=!0:u.existCustomer=!1}),e.$watch("vm.selectedCustomerIds",function(){0==u.selectedCustomers.length&&(u.existCustomer=!0)}),u.tmpSubmit=function(){a(function(){$("#customerEdit .table-edit-submit-btn")[0].click()})}}angular.module("FieldConnectApp").controller("CustomerUserEditController",e),e.$inject=["$scope","$stateParams","$state","$timeout","restService","Notification","$window","qsService","cryptoStorageService"]}();;!function(){"use strict";function e(e,t,a){this.edit=function(e){a.go("dashboardReportsTableEdit",{id:e})},this.attributes=[{Size:25,Name:"Report",ValueName:"ReportTypeDescription",Edit:!0,Sortable:!0},{Size:50,Name:"Chart Type",ValueName:"ChartType",Edit:!1,Sortable:!0},{Size:25,Name:"Role",ValueName:"RoleName",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("dashboardReportsController",e),e.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,t,o,r,a,d,i){var l=this;l.$state=r,l.model={},l.filter=d.filter("and"),l.attributes=[{Type:"dropdown",Label:"Report Type:",ApiMethod:"dashboardReportType/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"DashboardReportTypeId",ConvertToInt:"true",Required:!0},{Type:"dropdown",Label:"Role:",ApiMethod:"roles",ValueProp:"Id",TextProp:"RoleName",ModelValue:"RoleId",ConvertToInt:"true",Required:!0},{Type:"text",Label:"Chart Type:",Required:!1,MaxLength:"50",ModelValue:"ChartDescription",ReadOnly:!0}],l.id=o.id,l.loadingIndicator=!1,e.$watch("vm.model.DashboardReportTypeId",function(e,t){e!==t&&void 0!==e&&null!==e&&(l.filter.reset(),l.filter.eq("Id",e),a.getItems("dashboardReportType",l.filter).then(function(e){var t=e.data.Data[0];i(function(){l.model.ChartDescription=t.ChartDescription})}))})}angular.module("FieldConnectApp").controller("dashboardReportsEditController",e),e.$inject=["$scope","$location","$stateParams","$state","restService","qsService","$timeout"]}();;!function(){"use strict";function e(e,t,a){this.edit=function(e){a.go("defaultStartPageRoleEdit",{id:e})},this.filter={filterId:null},this.attributes=[{Name:"Page Name",ValueName:"PageName",Edit:!0,Sortable:!0}],this.drilldownSettings={ApiMethod:"defaultStartPageRole",ShowDeleteColumn:!1,FilterFields:{DefaultStartPageId:"Id"},attributes:[{Name:"Roles",ValueName:"RoleName"}]}}angular.module("FieldConnectApp").controller("DefaultStartPageRoleController",e),e.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,t,o,a){var l=this;l.goHome=function(){o.go("home")},l.$state=o,l.attributes=[{Type:"text",Label:"Page Name:",ModelValue:"PageName",ReadOnly:!0},{Type:"multiselect",Label:"Roles:",ApiMethod:"roles",ValueProp:"Id",TextProp:"RoleName",ModelValue:"ListRoleIds"}],l.model={},l.id=a.id,l.loadingIndicator=!1}angular.module("FieldConnectApp").controller("DefaultStartPageRoleEditController",e),e.$inject=["$scope","$location","$state","$stateParams"]}();;!function(){"use strict";function e(e,a,t){var l=this;l.viewName="Employees",l.moduleName="EmployeesGrid",l.isLoading=!0,l.$state=t,l.edit=function(e){t.go("employeeEdit",{id:e})},l.filter={filterId:null},l.attributes=[{Name:"Name",ValueName:"FullName",Edit:!0,Sortable:!0},{Name:"Phone",ValueName:"Phone",Edit:!1,Sortable:!0},{Name:"Email",ValueName:"Email",Edit:!1,Sortable:!0},{Name:"Cost Hour",ValueName:"CostHour",Edit:!1,Sortable:!0,CellFormat:"decimal"},{Name:"Technician",ValueName:"Technician",Edit:!1,Sortable:!0,CellFormat:"checkbox"}],setTimeout(function(){l.isLoading=!1,e.$apply()},1e3)}angular.module("FieldConnectApp").controller("EmployeeController",e),e.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,t,o,l,a,s,d){var r=this;function i(){a.showModal({templateUrl:"Templates/MasterTables/Employee/importUser.html",controller:"ImportUserController",controllerAs:"vm",inputs:{user:r.user}})}r.$state=o,r.importFromUser=i,r.model={},r.checkLatLong=function(e){if(void 0!=e){var t=e.latLng;void 0!=t&&(null!=t.Lat&&null!=t.Lng||d.warning({message:"Wrong address or city name. Can't generate latitude and longitude for this address!"}))}r.$state.go("employeeTable")},r.employeeId=l.id,r.user={userId:0},r.id=l.id,r.filterStatus={filterId:"Employee"},s.getItem("companyInfos/getCurrentCompany").then(function(e){var t={Type:"dropdown",Label:"Inventory Location:",Required:!1,ApiMethod:"locations/dropdown",ValueProp:"Id",TextProp:"LocationName",ModelValue:"InvLocId",ConvertToInt:"true"};e.data.Subcontractor&&(t={Type:"text",CustomDivClass:"col-sm-6 col-lg-6 visibilityNone"}),r.attributes=[{Type:"text",Label:"First name:",Required:!0,MaxLength:"50",ModelValue:"FirstName",Autofocus:"true"},{Type:"text",Label:"Cell:",Required:!1,MaxLength:"20",ModelValue:"Cell"},{Type:"text",Label:"Last name:",Required:!0,MaxLength:"50",ModelValue:"LastName"},{Type:"text",Label:"Phone:",Required:!1,MaxLength:"20",ModelValue:"Phone"},{Type:"email",Label:"Email:",Required:!0,MaxLength:"50",ModelValue:"Email"},{Type:"text",Label:"SMS:",Required:!1,MaxLength:"50",ModelValue:"SMS"},{Type:"dropdown",Label:"Office:",ApiMethod:"offices/dropdown",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true"},{Type:"text",CustomDivClass:"col-sm-6 col-lg-6 visibilityNone"},{Type:"checkbox",Label:"Technician:",ModelValue:"Technician"},{Type:"text",CustomDivClass:"col-sm-6 col-lg-6 visibilityNone"},{Type:"checkbox",Label:"Salesperson:",ModelValue:"SalesPerson"},{Type:"text",Label:"Address:",Required:!1,MaxLength:"100",ModelValue:"Address1"},{Type:"text",Label:"Title:",Required:!1,MaxLength:"50",ModelValue:"Title"},{Type:"text",Label:"",MaxLength:"100",ModelValue:"Address2"},{Type:"text",Label:"Employee Number:",Required:!1,MaxLength:"20",ModelValue:"EmployeeNum"},{Type:"text",Label:"City:",Required:!1,MaxLength:"50",ModelValue:"City"},{Type:"currency",Label:"Cost Hour:",Required:!1,ModelValue:"CostHour"},{Type:"dropdown",Label:"State:",Required:!1,ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateName",ModelValue:"StateCode"},{Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"statuses/statusbytype",ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",Filter:r.filterStatus},{Type:"text",Label:"Postal Code:",Required:!1,MaxLength:"20",ModelValue:"PostalCode"},t,{Type:"dropdown",Label:"Country:",Required:!1,ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country"},{Type:"text",ReadOnly:!0,Label:"User",ModelValue:"UserFullName",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo"},{Type:"button",Label:"Select User",onClick:i,CustomDivClass:""==r.employeeId?"hidden":""}]}),e.$watch("vm.model.Status",function(){null!=r.model.Status&&void 0!=r.model.Status||(r.model.Status="Active")}),r.loadingIndicator=!1,e.$watch("vm.user.userId",function(){null!=r.user.userId&&r.user.userId>0&&s.getItem("users",r.user.userId).then(function(){var e=s.state.item;""==r.employeeId&&(r.model.FirstName=e.FirstName,r.model.LastName=e.LastName,r.model.Email=e.Email,r.model.Phone=e.Phone,r.model.Cell=e.Cell,e.OfficeId&&(r.model.OfficeId=e.OfficeId),e.InvLocId&&(r.model.InvLocId=e.InvLocId),(e.RoleNames.includes("Technician")||e.RoleNames.includes("Apprentice"))&&(r.model.Technician=!0)),r.model.UserId=e.Id,r.model.UserFullName=e.FirstName+" "+e.LastName})})}angular.module("FieldConnectApp").controller("EmployeeEditController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","restService","Notification"]}();;!function(){"use strict";function e(e,l,a,r){var t=this;t.$scope=e,t.close=function(){t.modalClass=!1,e.close(null,50)},t.userId=0,t.filterAvailableUsers=r.filter("and"),t.filterAvailableUsers.eq("EmployeeUserId",null),t.attributes=[{Name:"Username",ValueName:"UserName",Edit:!1,Sortable:!0},{Name:"Name",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Phone Number",ValueName:"Phone",Edit:!1,Sortable:!0}],e.$watch("vm.userId",function(){t.userId>0&&(e.user.userId=t.userId,t.close())})}angular.module("FieldConnectApp").controller("ImportUserController",e),e.$inject=["$scope","$location","$state","qsService"]}();;!function(){"use strict";function e(e,t,a,i,r,l,o,d,n,m){var s=this;s.viewName="Equipment",s.moduleName="EquipmentGrid",s.isLoading=!1,s.$state=a,s.edit=function(e){a.go("equipmentEdit",{id:e})},s.editAttachment=function(e){var t={EquipmentId:s.filter.filterId};i.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Equipment Attachments Edit Form",id:e,model:t,attributes:s.editAttributesAttachment,apiMethod:"equipmentattachments",filter:s.serviceableItemIdFilter1}}).then(function(e){e.close.then(function(){s.serviceableItemIdFilter1.Reload++})})},s.editNote=function(e){var t={EquipmentId:s.filter.filterId};i.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Equipment Note Edit Form",id:e,model:t,attributes:s.editAttributesNote,apiMethod:"equipmentnotes"}}).then(function(e){e.close.then(function(){s.serviceableItemIdFilter.Reload++})})},s.loadTable=!1,s.selected=null,s.customerId="",s.showTabs=!0,s.filterBySI=l.filter("and"),s.loadWoesFilter=u,s.goToWo=function(e,t){a.go("workOrdersDetails",{id:e})},s.search=function(){s.companyIdFilter&&(s.companyIdFilter.reset(),s.companyIdFilter=l.filter("and"),s.companyIdFilter.eq("CompanyId",s.currentCompanyId),s.companyIdFilter.eq("Search",s.searchText));s.siteFilter.siteId&&(s.saSiteFilter.reset(),s.saSiteFilter=l.filter("and"),s.saSiteFilter.eq("SiteId",s.siteFilter.siteId),s.saSiteFilter.eq("Search",s.searchText))},s.searchNotes=function(){s.serviceableItemIdFilter.reset(),s.serviceableItemIdFilter.eq("EquipmentId",s.filter.filterId).like("Note","%"+s.notesSearchText+"%")},s.searchAttachments=function(){s.serviceableItemIdFilter1.reset(),s.serviceableItemIdFilter1.eq("EquipmentId",s.filter.filterId).like("AttachmentName","%"+s.attachmentSearchText+"%")},s.filter={filterId:null,Reload:0},s.filter1={customerId:null},s.siteFilter={siteId:parseInt(d.id)},r.getItem("companyinfos/getCurrentCompany").then(function(){s.currentCompany=r.state.item,s.currentCompanyId=s.currentCompany.Id}),s.saSiteFilter=l.filter("and"),s.saSiteFilter.eq("SiteId",s.siteFilter.siteId),s.serviceableItemIdFilter=l.filter("and"),s.serviceableItemIdFilter.eq("EquipmentId",0),s.serviceableItemIdFilter1=l.filter("and"),s.serviceableItemIdFilter1.eq("EquipmentId",s.filter.filterId),s.companyIdFilter=l.filter("and"),s.companyIdFilter.eq("CompanyId",s.currentCompanyId);var c=new Date;function u(){if(s.filter.filterId){if(s.showTabs=!0,s.woesFilter=l.filter("and"),s.woesFilter.eq("CustomerId",s.filter1.customerId),s.woesFilter.eq("EquipmentId",s.filter.filterId),s.serviceableItemIdFilter.reset(),s.serviceableItemIdFilter=l.filter("and"),s.serviceableItemIdFilter.eq("EquipmentId",s.filter.filterId),s.serviceableItemIdFilter1=l.filter("and"),s.serviceableItemIdFilter1.eq("EquipmentId",s.filter.filterId),""!=s.woesFilter1.startDate&&null!=s.woesFilter1.startDate){s.woesFilter1.startDate=new Date(s.woesFilter1.startDate),s.woesFilter1.startDate.setHours(0,0,0,0);var e=new Date(s.woesFilter1.startDate);o.convertToUtc(e),s.woesFilter.eq("startDate",o.buildISOString(e))}if(""!=s.woesFilter1.endDate&&null!=s.woesFilter1.endDate){s.woesFilter1.endDate=new Date(s.woesFilter1.endDate),s.woesFilter1.endDate.setHours(23,59,59,999);var t=new Date(s.woesFilter1.endDate);o.convertToUtc(t),s.woesFilter.eq("endDate",o.buildISOString(t))}s.loadTable=!1,n(function(){s.loadTable=!0})}else s.showTabs=!1,s.loadTable=!1}c.setDate(c.getDate()-90),s.woesFilter1={startDate:c,endDate:new Date},s.modelAttachment={},s.modelNote={},s.attributes=[{Name:"Equipment Name",ValueName:"EquipmentName",Edit:!0,Sortable:!0},{Name:"Class",ValueName:"ClassName",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"TypeName",Edit:!1,Sortable:!0},{Name:"Asset tag",ValueName:"AssetTag",Edit:!1,Sortable:!0},{Name:"Serial Number",ValueName:"SerialNum",Edit:!1,Sortable:!0},{Name:"Manufacturer",ValueName:"Mfr",Edit:!1,Sortable:!0},{Name:"Model",ValueName:"Model",Edit:!1,Sortable:!0},{Name:"Cost",ValueName:"Cost",Edit:!1,Sortable:!0},{Name:"Price",ValueName:"Price",Edit:!1,Sortable:!0}],s.attributesAttachment=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0}],s.attributesNote=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Note",ValueName:"Note",Edit:!0,Sortable:!0}],s.editAttributesAttachment=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType",Filter:l.filter("and").eq("attachmentCategory","WO")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description :",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"equipmentattachments/file"}],s.editAttributesNote=[{Type:"textarea",Label:"Note:",MaxLength:"500",Required:!0,ModelValue:"Note",Sortable:!0}],e.$watch("vm.filter1.customerId",function(){s.filter1.customerId&&(s.filter.filterId=0,s.serviceableItemIdFilter.reset(),s.serviceableItemIdFilter.eq("EquipmentId",0),s.siCustomerFilter=l.filter("and"),s.siCustomerFilter.eq("CustomerId",s.filter1.customerId),s.filterNotes=l.filter("and"),s.filterNotes.eq("EquipmentId",s.filter.filterId),s.loadTable=!0,u())}),e.$watch("vm.filter.filterId",function(){s.filter.filterId&&(s.loadTable=!0,u()),s.loadTable=!1})}angular.module("FieldConnectApp").controller("EquipmentController",e),e.$inject=["$scope","$location","$state","ModalService","restService","qsService","timezoneService","$stateParams","$timeout","sortArrayObjectsByAttrService"]}();;!function(){"use strict";function e(e,t,a,l,r,i,o,d,s){var m=this;m.id=l.id,m.model={},m.$state=a,m.goBack=function(){m.$state.go("equipmentTableSelected")},m.editAttachment=function(e){var t={EquipmentId:m.filter.filterId};d.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Equipment Attachments Edit Form",id:e,model:t,attributes:m.editAttributesAttachment,apiMethod:"equipmentattachments",filter:m.serviceableItemIdFilter}}).then(function(e){e.close.then(function(){m.loadTable=!1,s(function(){m.loadTable=!0})})})},m.editNote=function(e){var t={EquipmentId:m.filter.filterId};d.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Equipment Note Edit Form",id:e,model:t,attributes:m.editAttributesNote,apiMethod:"equipmentnotes"}}).then(function(e){e.close.then(function(){m.loadTable=!1,s(function(){m.loadTable=!0})})})},m.loadWoesFilter=u,m.filterNotes=i.filter("and"),m.setTypeIntial=!1,m.loadTable=!1,m.searchNotes=function(){m.serviceableItemIdFilter.reset(),m.serviceableItemIdFilter.eq("EquipmentId",m.woesFilter1.ServiceableItemId).like("Note","%"+m.notesSearchText+"%")},m.searchAttachments=function(){m.serviceableItemIdFilter1.reset(),m.serviceableItemIdFilter1.eq("EquipmentId",m.woesFilter1.ServiceableItemId).like("AttachmentName","%"+m.attachmentSearchText+"%")},m.woesFilter=i.filter("and"),m.filter={filterId:m.id},m.filterCustomer={customerId:l.customerId},m.autoFilterClass=i.filter("and"),m.autoFilterClass.eq("EquipmentClassId",0),m.autoFilterCustomer=i.filter("and"),m.autoFilterCustomer.filter=[],m.autoFilterCustomer.eq("CustomerId",l.customerId),m.serviceableItemIdFilter=i.filter("and"),m.serviceableItemIdFilter.eq("ServiceableItemId",m.id),m.serviceableItemIdFilter1=i.filter("and"),m.serviceableItemIdFilter1.eq("ServiceableItemId",m.id),m.woesFilter=i.filter("and"),m.woesFilter.eq("CustomerId",m.filterCustomer.customerId),m.woesFilter.eq("EquipmentId",m.filter.ServiceableItemId),m.attributes=[{Type:"text",Label:"Equipment Name:",Required:!0,MaxLength:"50",ModelValue:"EquipmentName"},{Type:"dropdown",Label:"Class:",ApiMethod:"equipmentClass",ValueProp:"Id",TextProp:"ClassName",ModelValue:"ClassId",ConvertToInt:"true"},{Type:"text",Label:"Asset tag:",Required:!0,MaxLength:"100",ModelValue:"AssetTag"},{Type:"dropdown",Label:"Type:",ApiMethod:"equipmentType",ValueProp:"Id",TextProp:"TypeName",ModelValue:"TypeId",ConvertToInt:"true",Filter:m.autoFilterClass},{Type:"text",Label:"Manufacturer:",Required:!1,MaxLength:"50",ModelValue:"Mfr"},{Type:"text",Label:"Model:",Required:!1,MaxLength:"50",ModelValue:"Model"},{Type:"datepicker",Label:"Purchase Date:",ModelValue:"PurchaseDate",Format:"MM/dd/yy",SubType:"date"},{Type:"int",Label:"Year Manufactured:",Required:!1,ModelValue:"YearMfr"},{Type:"datepicker",Label:"Warranty Effective Date:",ModelValue:"WarrantyEffectiveDate",Format:"MM/dd/yy",SubType:"date"},{Type:"text",Label:"Serial Number:",Required:!1,MaxLength:"100",ModelValue:"SerialNum"},{Type:"datepicker",Label:"Warranty Expire Date:",ModelValue:"WarrantyExpireDate",Format:"MM/dd/yy",SubType:"date"},{Type:"decimal",Label:"Cost:",Required:!1,MaxLength:"50",ModelValue:"Cost"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"decimal",Label:"Price:",Required:!1,MaxLength:"50",ModelValue:"Price"}],m.attributesAttachment=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0}],m.attributesNote=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Note",ValueName:"Note",Edit:!0,Sortable:!0}],m.editAttributesAttachment=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType",Filter:i.filter("and").eq("attachmentCategory","WO")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description :",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"equipmentattachments/file"}],m.editAttributesNote=[{Type:"textarea",Label:"Note:",Required:!0,MaxLength:"500",ModelValue:"Note"}],m.woesFilter=i.filter("and"),m.woesFilter.eq("CustomerId",m.filterCustomer.customerId),m.woesFilter.eq("ServiceableItemId",m.filter.ServiceableItemId),r.getItem("customers",m.filterCustomer.customerId).then(function(){var e=r.state.item;m.model.CustomerName=e.CustomerName}),e.$watch("vm.model.ClassId",function(e,t){if(e||t){m.autoFilterClass.reset();var a=0;m.model.ClassId&&(a=m.model.ClassId),m.id&&m.setTypeIntial?m.model.TypeId=null:m.setTypeIntial=!0,m.autoFilterClass.eq("EquipmentClassId",a)}});var n=new Date;function u(){if(m.woesFilter.reset(),m.woesFilter.eq("CustomerId",m.filterCustomer.customerId),m.woesFilter.eq("EquipmentId",m.woesFilter1.ServiceableItemId),m.serviceableItemIdFilter.reset(),m.serviceableItemIdFilter=i.filter("and"),m.serviceableItemIdFilter.eq("EquipmentId",m.woesFilter1.ServiceableItemId),m.serviceableItemIdFilter1.reset(),m.serviceableItemIdFilter1=i.filter("and"),m.serviceableItemIdFilter1.eq("EquipmentId",m.woesFilter1.ServiceableItemId),""!=m.woesFilter1.startDate&&null!=m.woesFilter1.startDate){m.woesFilter1.startDate=new Date(m.woesFilter1.startDate),m.woesFilter1.startDate.setHours(0,0,0,0);var e=new Date(m.woesFilter1.startDate);o.convertToUtc(e),m.woesFilter.eq("startDate",o.buildISOString(e))}if(""!=m.woesFilter1.endDate&&null!=m.woesFilter1.endDate){m.woesFilter1.endDate=new Date(m.woesFilter1.endDate),m.woesFilter1.endDate.setHours(23,59,59,999);var t=new Date(m.woesFilter1.endDate);o.convertToUtc(t),m.woesFilter.eq("endDate",o.buildISOString(t))}}n.setDate(n.getDate()-90),m.woesFilter1={startDate:n,endDate:new Date,ServiceableItemId:m.id},m.id&&(u(),m.loadTable=!0),m.modelAttachment={},m.modelNote={},m.loadingIndicator=!1}angular.module("FieldConnectApp").controller("EquipmentEditController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","qsService","timezoneService","ModalService","$timeout"]}();;!function(){"use strict";function e(e,t,a,l,r,i,o,d,n){var m=this;m.$state=a,m.goBack=function(){window.history.back()},m.loadTable=!1,m.model={},m.filter={filterId:null,searchText:""},m.loadWoesFilter=u,m.id=l.id,m.filterCustomer={customerId:null},m.searchNotes=function(){m.serviceableItemIdFilter.reset(),m.serviceableItemIdFilter.eq("EquipmentId",m.woesFilter1.ServiceableItemId).like("Note","%"+m.notesSearchText+"%")},m.searchAttachments=function(){m.serviceableItemIdFilter1.reset(),m.serviceableItemIdFilter1.eq("EquipmentId",m.woesFilter1.ServiceableItemId).like("AttachmentName","%"+m.attachmentSearchText+"%")},m.editAttachment=function(e){var t={ServiceableItemId:m.filter.filterId};d.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Equipment Attachments Edit Form",id:e,model:t,attributes:m.editAttributesAttachment,apiMethod:"equipmentattachments",filter:m.serviceableItemIdFilter}}).then(function(e){e.close.then(function(){m.loadTable=!1,n(function(){m.loadTable=!0,m.serviceableItemIdFilter.Reload++})})})},m.editNote=function(e){var t={ServiceableItemId:m.filter.filterId};d.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Equipment Note Edit Form",id:e,model:t,attributes:m.editAttributesNote,apiMethod:"equipmentnotes"}}).then(function(e){e.close.then(function(){m.loadTable=!1,n(function(){m.loadTable=!0,m.serviceableItemIdFilter.Reload++})})})},m.goToWo=function(e,t){d.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/reportReadOnly.html",controller:"ReportReadOnlyController",controllerAs:"vm",inputs:{modalTitle:"Serviceable Item Attachments Edit Form",id:t.Id}}).then(function(e){e.close.then(function(){})})},m.filterCustomer.customerId=l.customerId,m.filter.filterId=m.id,m.autoFilterCustomer=i.filter("and"),m.autoFilterCustomer.filter=[],m.autoFilterCustomer.eq("CustomerId",l.customerId),m.woesFilter=i.filter("and"),m.woesFilter.eq("CustomerId",l.customerId),m.woesFilter.eq("EquipmentId",m.id),m.serviceableItemIdFilter=i.filter("and"),m.serviceableItemIdFilter.eq("EquipmentId",m.id),m.attributes=[{Type:"text",Label:"Equipment Name:",ReadOnly:!0,MaxLength:"50",ModelValue:"EquipmentName"},{Type:"text",Label:"Class:",ReadOnly:!0,MaxLength:"50",ModelValue:"ClassName"},{Type:"text",Label:"Site:",ReadOnly:!0,MaxLength:"50",ModelValue:"SiteName"},{Type:"text",Label:"Type:",ReadOnly:!0,MaxLength:"50",ModelValue:"TypeName"},{Type:"text",Label:"Model:",ReadOnly:!0,MaxLength:"50",ModelValue:"Model"},{Type:"text",Label:"Asset tag:",ReadOnly:!0,MaxLength:"100",ModelValue:"AssetTag"},{Type:"text",Label:"Manufacturer:",ReadOnly:!0,MaxLength:"50",ModelValue:"Mfr"},{Type:"datepicker",Label:"Install Date:",ReadOnly:!0,ModelValue:"InstallDate",Format:"MM/dd/yy",SubType:"date"},{Type:"int",Label:"Year Manufactured:",ReadOnly:!0,ModelValue:"YearMfr"},{Type:"datepicker",Label:"Warranty Effective Date:",ReadOnly:!0,ModelValue:"WarrantyEffectiveDate",Format:"MM/dd/yy",SubType:"date"},{Type:"text",Label:"Serial Number:",ReadOnly:!0,MaxLength:"100",ModelValue:"SerialNum"},{Type:"datepicker",Label:"Warranty Expire Date:",ReadOnly:!0,ModelValue:"WarrantyExpireDate",Format:"MM/dd/yy",SubType:"date"}],m.attributesAttachment=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0}],m.attributesNote=[{Name:"Date Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Note",ValueName:"Note",Edit:!0,Sortable:!0}],m.editAttributesAttachment=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType"},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description :",Required:!1,MaxLength:"50",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"equipmentattachments/file"}],m.editAttributesNote=[{Type:"textarea",Label:"Note:",Required:!0,MaxLength:"500",ModelValue:"Note"}],m.attributesWoes=[{Name:"Work Order",ValueName:"AltId",Edit:!0,Sortable:!0},{Name:"Wo Type",ValueName:"WoType",Edit:!1,Sortable:!0},{Name:"Promised Date",ValueName:"PromiseDate",FormatDate:"datetime",Edit:!1,Sortable:!0},{Name:"Time Zone",ValueName:"TimeZoneName",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!0}];var s=new Date;function u(){if(m.woesFilter.reset(),m.woesFilter.eq("CustomerId",m.filterCustomer.customerId),m.woesFilter.eq("EquipmentId",m.woesFilter1.ServiceableItemId),m.serviceableItemIdFilter1=i.filter("and"),m.serviceableItemIdFilter1.eq("EquipmentId",m.woesFilter1.ServiceableItemId),""!=m.woesFilter1.startDate&&null!=m.woesFilter1.startDate){m.woesFilter1.startDate=new Date(m.woesFilter1.startDate),m.woesFilter1.startDate.setHours(0,0,0,0);var e=new Date(m.woesFilter1.startDate);o.convertToUtc(e),m.woesFilter.eq("startDate",o.buildISOString(e))}if(""!=m.woesFilter1.endDate&&null!=m.woesFilter1.endDate){m.woesFilter1.endDate=new Date(m.woesFilter1.endDate),m.woesFilter1.endDate.setHours(23,59,59,999);var t=new Date(m.woesFilter1.endDate);o.convertToUtc(t),m.woesFilter.eq("endDate",o.buildISOString(t))}}s.setDate(s.getDate()-90),m.woesFilter1={startDate:s,endDate:new Date,ServiceableItemId:m.id},m.id&&(u(),m.loadTable=!0),m.modelAttachment={},m.modelNote={},m.loadingIndicator=!1}angular.module("FieldConnectApp").controller("EquipmentReadOnlyController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","qsService","timezoneService","ModalService","$timeout"]}();;!function(){"use strict";function e(e,a,t,i){var m=this;m.viewName="Items",m.moduleName="ItemsGrid",m.$state=t,m.edit=function(e){t.go("itemEdit",{id:e})},m.isLoading=!1,m.itemService=i,m.filter={filterId:null},m.isLoading=!0,m.attributes=[{Name:"Item Number",ValueName:"PartNum",Edit:!0,Sortable:!0},{Name:"Item Name",ValueName:"ItemName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Class",ValueName:"ClassName",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"TypeName",Edit:!1,Sortable:!0},{Name:"Manufacturer",ValueName:"Mfr",Edit:!1,Sortable:!0},{Name:"Sale Type",ValueName:"SaleType",Edit:!1,Sortable:!0},{Name:"Unit Of Measure",ValueName:"UOM",Edit:!1,Sortable:!0}],setTimeout(function(){m.isLoading=!1,e.$apply()},1e3)}angular.module("FieldConnectApp").controller("ItemController",e),e.$inject=["$scope","$location","$state","itemService"]}();;!function(){"use strict";function e(e,t,a,o,l,i,r,d,n,u,s,c){var m=this;m.$state=a,m.itemState=l.state,m.editItemPrice=function(e){0===m.filterPrices.Reload&&(m.filterPrices.Reload++,i.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Rate Sheet Price Edit",id:e,model:m.editModel,attributes:m.attributesItemPriceEdit,apiMethod:"itemPrices"}}).then(function(e){e.close.then(function(){m.filterPrices.Reload--})}))},m.editItemcount=function(e){var t=null;t=void 0==e?m.attributesInventoryCountAdd:m.attributesInventoryCountEdit;0===m.filtercount.Reload&&(m.filtercount.Reload++,i.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Location Inventory count Edit",id:e,model:m.editModel1,attributes:t,apiMethod:"locations/itemCount"}}).then(function(e){e.close.then(function(){m.filtercount.Reload--})}))},m.model={},m.initialLoad=!0,m.filter={filterId:0,searchText:""},m.autoFilterClass=n.filter("and"),m.filterPrices=n.filter("and"),m.filter1={filterId:o.id,Reload:0},m.filtercount=n.filter("and"),m.filter2={filterId:o.id,Reload:0},m.filterStatus={filterId:"Item"},m.usingDSLNorthwest=c.usingDSLNorthwest;var p={Type:"checkbox",Label:"Serialized",ModelValue:"Serialized"};m.locationItemdropdown={Type:"dropdown",Label:"Location:",Required:!1,ApiMethod:"locations/dropdown",ValueProp:"Id",TextProp:"LocationName",ModelValue:"LocationId",ConvertToInt:"true"},m.locationItemquantities={Type:"decimal",Label:"Quantity:",Required:!1,ModelValue:"Itemquantities"},o.id&&(m.locationItemdropdown.CustomDivClass="hidden",m.locationItemquantities.CustomDivClass="hidden"),m.attItemNumber={Type:"text",Label:"Item Number:",Required:!0,MaxLength:"50",ModelValue:"PartNum",Autofocus:"true"},m.attItemClass={Type:"dropdown",Label:"Item Class:",Required:!1,ApiMethod:"itemClasses",ValueProp:"Id",TextProp:"ClassName",ModelValue:"ClassId",ConvertToInt:"true"},m.attItemName={Type:"text",Label:"Item Name:",Required:!0,MaxLength:"50",ModelValue:"ItemName"},m.attItemType={Type:"dropdown",Label:"Item Type:",Required:!1,ApiMethod:"itemTypes",ValueProp:"Id",TextProp:"TypeName",ModelValue:"TypeId",ConvertToInt:"true",Filter:m.autoFilterClass},m.attItemDescription={Type:"text",Label:"Item Description:",Required:!1,MaxLength:"50",ModelValue:"Desc"},m.attSaleType={Type:"dropdown",Label:"Sale Type:",Required:!0,ValueProp:"SaleType",TextProp:"SaleType",ModelValue:"SaleType",List:[{SaleType:"Misc"},{SaleType:"Parts"}]},m.attManufacturer={Type:"text",Label:"Manufacturer:",Required:!1,MaxLength:"20",ModelValue:"Mfr"},m.attBarCode={Type:"barcode",Label:"Bar Code:",Required:!1,MaxLength:"100",ModelValue:"BarCode",onClick:function(){i.showModal({templateUrl:"Templates/Utils/barcodeScan.html",controller:"BarcodeScanController",controllerAs:"vm",inputs:{modalTitle:"Scan Barcode"}}).then(function(e){e.close.then(function(){var t;t=e.scope.vm.barcode,m.model.BarCode=t})})}},m.attUOM={Type:"dropdown",Label:"Unit Of Measure:",Required:!0,ApiMethod:"uoms",ValueProp:"UOMName",TextProp:"UOMName",ModelValue:"UOM"},m.attCost={Type:"decimal",Label:"Cost",Required:!0,ModelValue:"Cost"},m.attManufacturerPartNumber={Type:"text",Label:"Manufacturer Part Number",MaxLength:"50",Required:!1,ModelValue:"MfrPartNum"},m.attTaxable={Type:"checkbox",Label:"Taxable",ModelValue:"Taxable"},m.attStatus={Type:"dropdown",Label:"Status:",ApiMethod:"statuses/statusbytype",ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",Filter:m.filterStatus},m.attDSLPostingGroup={Type:"dropdown",Label:"Posting Group:",ApiMethod:"dslInventoryPostingGroup/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"User8",ConvertToInt:"true"};var I=[m.attItemNumber,m.attItemClass,m.attItemName,m.attItemType,m.attItemDescription,m.attSaleType,m.attManufacturer,m.attBarCode,m.attUOM,m.attCost,m.attManufacturerPartNumber,m.attStatus,m.locationItemdropdown,m.locationItemquantities,m.attTaxable,p],M=[m.attItemNumber,m.attItemClass,m.attItemName,m.attItemType,m.attItemDescription,m.attSaleType,m.attManufacturer,m.attBarCode,m.attUOM,m.attCost,m.attManufacturerPartNumber,m.attDSLPostingGroup,m.locationItemdropdown,m.locationItemquantities,m.attTaxable,m.attStatus,p];m.showForm=!1,m.usingDSLNorthwest?m.attributes=M:m.attributes=I,m.showForm=!0,m.attributesPrices=[{Name:"Rate Sheet",ValueName:"RateSheetName",Edit:!0,Sortable:!0},{Name:"Price",ValueName:"Price",Edit:!1,Sortable:!0,CellFormat:"decimal"},{Name:"Markup %",ValueName:"Markup",Edit:!1,Sortable:!0,CellFormat:"percent"}],m.attributesItemPriceEdit=[{Type:"dropdown",Label:"Rate Sheet:",Required:!0,ApiMethod:"ratesheets",ValueProp:"Id",TextProp:"RateSheetName",ModelValue:"RateSheetId",ConvertToInt:"true"},{Type:"decimal",Label:"Price:",Required:!1,ModelValue:"Price"},{Type:"percent",Label:"Markup %:",Required:!1,ModelValue:"Markup"}],m.attributesInventoryCount=[{Name:"Location",ValueName:"LocationName",Edit:!0,Sortable:!0},{Name:"Total Quantity",ValueName:"quantities",Edit:!0,Sortable:!0},{Name:"Item Name",ValueName:"ItemName",Edit:!1,Sortable:!0}],m.attributesInventoryCountEdit=[{Type:"dropdown",Label:"Location:",ReadOnly:!0,Edit:!1,Required:!0,ApiMethod:"locations",ValueProp:"Id",TextProp:"LocationName",ModelValue:"LocationId",ConvertToInt:"true"},{Type:"decimal",Label:"Quantity:",Required:!0,ModelValue:"quantities"}],m.attributesInventoryCountAdd=[{Type:"dropdown",Label:"Location:",Required:!0,ApiMethod:"locations",ValueProp:"Id",TextProp:"LocationName",ModelValue:"LocationId",ConvertToInt:"true"},{Type:"decimal",Label:"Quantity:",Required:!0,ModelValue:"quantities"}],m.filtercount.eq("ItemId",o.id),m.id=o.id,m.filterPrices.eq("ItemId",m.id),m.searchLocation=function(){m.filtercount.reset(),m.filtercount.eq("ItemId",m.id).like("LocationName","%"+m.LocationSearchText+"%")},m.searchRateSheets=function(){m.filterPrices.reset(),m.filterPrices.eq("ItemId",m.id).like("RateSheetName","%"+m.rateSheetSearchText+"%")},e.$watch("vm.model.ClassId",function(){m.model.ClassId&&(m.autoFilterClass.filter=[],m.autoFilterClass.eq("ClassId",m.model.ClassId),m.initialLoad?m.initialLoad=!1:r.getItem("itemClasses",m.model.ClassId).then(function(){var e=r.state.item;m.model.Taxable=e.Taxable}))}),e.$watch("vm.editModel.Price",function(){null!=m.editModel.Markup&&null!=m.editModel.Markup&&null!=m.editModel.Price&&(d.warning({message:"Only Price or Markup is allowed for item price!"}),m.editModel.Price=null)}),e.$watch("vm.editModel.Markup",function(){null!=m.editModel.Price&&null!=m.editModel.Price&&null!=m.editModel.Markup&&(d.warning({message:"Only Price or Markup is allowed for item price!"}),m.editModel.Markup=null)}),e.$watch("vm.model.Status",function(){null!=m.model.Status&&void 0!=m.model.Status||(m.model.Status="Active")}),e.$watch("vm.model.SaleType",function(){"Parts"==m.model.SaleType?p.Type="checkbox":(p.Type="empty",m.model.Serialized=null)}),m.editModel={ItemId:parseInt(m.filter1.filterId)},m.editModel1={ItemId:parseInt(m.filter2.filterId)}}angular.module("FieldConnectApp").controller("ItemEditController",e),e.$inject=["$scope","$location","$state","$stateParams","itemService","ModalService","restService","Notification","qsService","$window","cryptoStorageService","featuresFactory"]}();;!function(){"use strict";function t(t,e,i){this.edit=function(t){i.go("laborGroupTechEdit",{id:t})},this.filter={filterId:null},this.attributes=[{Name:"Group Name",ValueName:"Name",Edit:!0,Sortable:!0}],this.drilldownSettings={ApiMethod:"labortechgroups",FilterFields:{LaborGroupId:"Id"},attributes:[{Name:"Technicians",ValueName:"UserFirsLastName"}]}}angular.module("FieldConnectApp").controller("LaborGroupTechController",t),t.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,t,o,a){var l=this;l.goHome=function(){o.go("home")},l.$state=o,l.attributes=[{Type:"text",Label:"Group Name:",ModelValue:"Name",ReadOnly:!0},{Type:"multiselect",Label:"Technicians:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"ListEmployeeIds"}],l.model={},l.id=a.id,l.loadingIndicator=!1}angular.module("FieldConnectApp").controller("LaborGroupTechEditController",e),e.$inject=["$scope","$location","$state","$stateParams"]}();;!function(){"use strict";function t(t,e,i){this.$state=i,this.edit=function(t){i.go("laborRoundingTableEdit",{id:t})},this.attributes=[{Size:15,Name:"Name",ValueName:"Name",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("LaborRoundingController",t),t.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,a,t,l,n,o,i,s,r,u){var d=this;d.$state=l,d.model={},d.readOnly=!0,r.getCurrentUserData().then(function(e){o(function(){d.model.UserName=e.FullName})}),d.laborType={Type:"dropdown",Label:"Type:",ApiMethod:"lookup/laborRoundingLaborTypes",ReadOnly:d.readOnly,Required:!0,ValueProp:"Key",TextProp:"Value",ModelValue:"LaborType",ConvertToInt:"false",CustomDivClass:"col-sm-4"},d.name={Type:"text",Label:"Name:",ReadOnly:d.readOnly,Required:!0,MaxLength:"15",ModelValue:"Name",CustomDivClass:"col-sm-4"},d.fromMinutes1={Type:"int",Label:"From Min:",Required:!1,MaxLength:"2",ModelValue:"FromMinutes1",ReadOnly:d.readOnly,CustomDivClass:"col-sm-4"},d.toMinutes1={Type:"int",Label:"To Min:",Required:!1,MaxLength:"2",ModelValue:"ToMinutes1",ReadOnly:d.readOnly,CustomDivClass:"col-sm-4"},d.interval1={Type:"dropdown",Label:"Interval:",ApiMethod:"lookup/laborRoundingInterval",ReadOnly:d.readOnly,ValueProp:"Id",TextProp:"Name",ModelValue:"Interval1",ConvertToInt:"true",CustomDivClass:"col-sm-4",OnChange:function(e){}},d.fromMinutes2={Type:"int",Label:"From Min:",Required:!1,MaxLength:"2",ModelValue:"FromMinutes2",ReadOnly:d.readOnly,CustomDivClass:"col-sm-4"},d.toMinutes2={Type:"int",Label:"To Min:",Required:!1,MaxLength:"2",ModelValue:"ToMinutes2",ReadOnly:d.readOnly,CustomDivClass:"col-sm-4"},d.interval2={Type:"dropdown",Label:"Interval:",ApiMethod:"lookup/laborRoundingInterval",ReadOnly:d.readOnly,ValueProp:"Id",TextProp:"Name",ModelValue:"Interval2",ConvertToInt:"true",CustomDivClass:"col-sm-4"},d.fromMinutes3={Type:"int",Label:"From Min:",Required:!1,MaxLength:"2",ModelValue:"FromMinutes3",ReadOnly:d.readOnly,CustomDivClass:"col-sm-4"},d.toMinutes3={Type:"int",Label:"To Min:",Required:!1,MaxLength:"2",ModelValue:"ToMinutes3",ReadOnly:d.readOnly,CustomDivClass:"col-sm-4"},d.interval3={Type:"dropdown",Label:"Interval:",ApiMethod:"lookup/laborRoundingInterval",ReadOnly:d.readOnly,ValueProp:"Id",TextProp:"Name",ModelValue:"Interval3",ConvertToInt:"true",CustomDivClass:"col-sm-4"},d.fromMinutes4={Type:"int",Label:"From Min:",Required:!1,MaxLength:"2",ModelValue:"FromMinutes4",ReadOnly:d.readOnly,CustomDivClass:"col-sm-4"},d.toMinutes4={Type:"int",Label:"To Min:",Required:!1,MaxLength:"2",ModelValue:"ToMinutes4",ReadOnly:d.readOnly,CustomDivClass:"col-sm-4"},d.interval4={Type:"dropdown",Label:"Interval:",ApiMethod:"lookup/laborRoundingInterval",ReadOnly:d.readOnly,ValueProp:"Id",TextProp:"Name",ModelValue:"Interval4",ConvertToInt:"true",CustomDivClass:"col-sm-4"},d.fromMinutes5={Type:"int",Label:"From Min:",Required:!1,MaxLength:"2",ModelValue:"FromMinutes5",ReadOnly:d.readOnly,CustomDivClass:"col-sm-4"},d.toMinutes5={Type:"int",Label:"To Min:",Required:!1,MaxLength:"2",ModelValue:"ToMinutes5",ReadOnly:d.readOnly,CustomDivClass:"col-sm-4"},d.interval5={Type:"dropdown",Label:"Interval:",ApiMethod:"lookup/laborRoundingInterval",ReadOnly:d.readOnly,ValueProp:"Id",TextProp:"Name",ModelValue:"Interval5",ConvertToInt:"true",CustomDivClass:"col-sm-4"},d.attDescription=[d.name,{Type:"empty",CustomClass:"fc-empty-control col-sm-8"}],d.descriptionGroup={Type:"group",Attributes:d.attDescription},d.attTimeInterval=[d.fromMinutes1,d.toMinutes1,d.interval1,d.fromMinutes2,d.toMinutes2,d.interval2,d.fromMinutes3,d.toMinutes3,d.interval3,d.fromMinutes4,d.toMinutes4,d.interval4,d.fromMinutes5,d.toMinutes5,d.interval5,{Type:"line",CustomClass:"col-sm-12"}],d.timeIntervalGroup={Type:"group",Attributes:d.attTimeInterval},d.attDisclaimer=[{Type:"line",CustomClass:"col-sm-12"},{Type:"checkbox",Label:"Accept Advisory",ModelValue:"Disclaimer",CustomDivClass:"col-sm-4"},{Type:"empty",CustomClass:"col-sm-12"},{Type:"text",Label:"User:",ReadOnly:d.readOnly,Required:!1,MaxLength:"15",ModelValue:"UserName",CustomDivClass:"col-sm-4"},{Type:"signature",Label:"Signature:",ModelValue:"Signature",CustomDivClass:"col-sm-3",CustomLabelClass:"col-sm-4",onClick:function(){var e=$("#signatureCanvas")[0];e.width=e.width,d.model.Signature="",$("#signatureCanvas")[0].style.cssText="border: 1px  solid #000000"}},{Type:"line",CustomClass:"col-sm-12"}],d.disclaimerGroup={Type:"group",Attributes:d.attDisclaimer},d.attributes=[d.disclaimerGroup,d.descriptionGroup,d.timeIntervalGroup],d.id=t.id,d.loadingIndicator=!1,e.$watch("vm.model.Disclaimer",function(e,a){e!==a&&(d.model.Disclaimer?d.readOnly=!1:(i.warning({message:"Advisory must be accepted to save changes!"}),d.readOnly=!0),o(function(){d.name.ReadOnly=d.readOnly;for(var e=0;e<d.attTimeInterval.length;e++)d.attTimeInterval[e].ReadOnly=d.readOnly}))}),d.submit=function(){d.validateFields()&&(d.model.Id?s.update(d.model):s.create(d.model))},d.validateFields=function(){var e=!0;if(0==d.model.Disclaimer&&(i.warning({message:"Disclaimer must be accepted to save changes!"}),e=!1),d.isCanvasBlank($("#signatureCanvas")[0]))i.warning({message:"Signature must not be blank!"}),$("#signatureCanvas")[0].style.cssText="border: 1px  solid #FF0000",e=!1;else{var a=new Image;a.src=$("#signatureCanvas")[0].toDataURL();var t=a.src.split(",")[1];d.model.Signature=t}return s.checkValidation(d.attDescription,d.model,!0)||(i.warning({message:"Please fill in required fields!"}),e=!1),d.validateFromToMinutes(d.model.FromMinutes1,d.model.ToMinutes1,d.model.Interval1)||(e=!1),d.validateFromToMinutes(d.model.FromMinutes2,d.model.ToMinutes2,d.model.Interval2)||(e=!1),d.validateFromToMinutes(d.model.FromMinutes3,d.model.ToMinutes3,d.model.Interval3)||(e=!1),d.validateFromToMinutes(d.model.FromMinutes4,d.model.ToMinutes4,d.model.Interval4)||(e=!1),d.validateFromToMinutes(d.model.FromMinutes5,d.model.ToMinutes5,d.model.Interval5)||(e=!1),d.sumFields()||(e=!1),e},d.sumFields=function(){var e=0;return e+=d.validateFieldValues(d.model.FromMinutes1,d.model.ToMinutes1),e+=d.validateFieldValues(d.model.FromMinutes2,d.model.ToMinutes2),e+=d.validateFieldValues(d.model.FromMinutes3,d.model.ToMinutes3),e+=d.validateFieldValues(d.model.FromMinutes4,d.model.ToMinutes4),59===(e+=d.validateFieldValues(d.model.FromMinutes5,d.model.ToMinutes5))||(i.warning({message:"The Total From/To Minutes must equal 59 minutes!"}),!1)},d.validateFieldValues=function(e,a){var t=0;return null!==e&&null!==a&&(t=0===e&&0===a?0:0===e&&a>0?a:a-e+1),t},d.validateFromToMinutes=function(e,a,t){var l=!0;return null!==e&&null!==a?((e>=60||a>=60)&&(i.warning({message:"From/To Minute values must be between 0 and 59!"}),l=!1),e>a&&(i.warning({message:"From Minutes cannot be greater than To Minutes!"}),l=!1),null===t&&(i.warning({message:"Interval cannot be blank!"}),l=!1)):null!==t&&(i.warning({message:"From/To Minutes cannot be blank if interval is seleted!"}),l=!1),l},d.isCanvasBlank=function(e){var a=document.createElement("canvas");return a.width=e.width,a.height=e.height,e.toDataURL()===a.toDataURL()}}angular.module("FieldConnectApp").controller("LaborRoundingEditController",e),e.$inject=["$scope","$location","$stateParams","$state","restService","$timeout","Notification","LaborRoundingService","currentUserService","currentCompanyService"]}();;!function(){"use strict";function t(t,e,i){this.edit=function(t){i.go("officesTableEdit",{id:t})},this.$state=i,this.attributes=[{Name:"Office",ValueName:"OfficeName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("OfficeController",t),t.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,o,a,t,d){var l=this;l.$state=a,l.model={},l.originalCity="",l.originalAddress1="",l.originalStateCode="",l.originalAddress2="",l.originalPostalCode="",l.originalCountry="",l.originalLatitude="",l.originalLongitude="",l.originalTitle="",l.originalFirstName="",l.originalLastName="",l.originalPhone="",l.originalCell="",l.originalFax="",l.originalEmail="",l.model={},l.companyContactAddress={},d.getItem("companyinfos/companycontactaddress").then(function(){l.companyContactAddress=d.state.item}),e.$watch("vm.model.Id",function(){l.originalCity=l.model.City,l.originalAddress1=l.model.Address1,l.originalStateCode=l.model.StateCode,l.originalAddress2=l.model.Address2,l.originalPostalCode=l.model.PostalCode,l.originalCountry=l.model.Country,l.originalLatitude=l.model.Latitude,l.originalLongitude=l.model.Longitude,l.originalTitle=l.model.Title,l.originalFirstName=l.model.FirstName,l.originalLastName=l.model.LastName,l.originalPhone=l.model.Phone,l.originalCell=l.model.Cell,l.originalFax=l.model.Fax,l.originalEmail=l.model.Email}),e.$watch("vm.model.SameAddress",function(){l.model.SameAddress?(l.model.City=l.companyContactAddress.City,l.model.Address1=l.companyContactAddress.Address1,l.model.StateCode=l.companyContactAddress.StateCode,l.model.Address2=l.companyContactAddress.Address2,l.model.PostalCode=l.companyContactAddress.PostalCode,l.model.Country=l.companyContactAddress.Country,l.model.Latitude=l.companyContactAddress.Latitude,l.model.Longitude=l.companyContactAddress.Longitude):(l.model.City=l.originalCity,l.model.Address1=l.originalAddress1,l.model.StateCode=l.originalStateCode,l.model.Address2=l.originalAddress2,l.model.PostalCode=l.originalPostalCode,l.model.Country=l.originalCountry,l.model.Latitude=l.originalLatitude,l.model.Longitude=l.originalLongitude)}),e.$watch("vm.model.SameContact",function(){l.model.SameContact?(l.model.Title=l.companyContactAddress.Title,l.model.FirstName=l.companyContactAddress.FirstName,l.model.LastName=l.companyContactAddress.LastName,l.model.Phone=l.companyContactAddress.Phone,l.model.Cell=l.companyContactAddress.Cell,l.model.Fax=l.companyContactAddress.Fax,l.model.Email=l.companyContactAddress.Email):(l.model.Title=l.originalTitle,l.model.FirstName=l.originalFirstName,l.model.LastName=l.originalLastName,l.model.Phone=l.originalPhone,l.model.Cell=l.originalCell,l.model.Fax=l.originalFax,l.model.Email=l.originalEmail)}),l.attributes=[{Type:"text",Label:"Office Name:",Required:!0,MaxLength:"50",ModelValue:"OfficeName",Autofocus:"true",TabIndex:1},{Type:"dropdown",Label:"Time Zone:",ApiMethod:"timezones",ValueProp:"Id",TextProp:"TimeZoneName",ModelValue:"TimeZoneId",ConvertToInt:"true",TabIndex:2},{Type:"line",CustomClass:"col-sm-12"},{Type:"checkbox",Label:"Copy Contact From Company:",ModelValue:"SameContact",TabIndex:3},{Type:"checkbox",Label:"Copy Address From Company:",ModelValue:"SameAddress",TabIndex:11},{Type:"text",Label:"Title:",MaxLength:"50",ModelValue:"Title",TabIndex:4},{Type:"text",Label:"Address:",MaxLength:"100",ModelValue:"Address1",TabIndex:12},{Type:"text",Label:"First Name:",MaxLength:"50",ModelValue:"FirstName",TabIndex:5},{Type:"text",Label:"",MaxLength:"100",ModelValue:"Address2",TabIndex:13},{Type:"text",Label:"Last Name:",MaxLength:"50",ModelValue:"LastName",TabIndex:6},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"City",TabIndex:14},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"Phone",TabIndex:7},{Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"StateCode",TabIndex:15},{Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"Fax",TabIndex:8},{Type:"text",Label:"Postal Code:",MaxLength:"20",ModelValue:"PostalCode",TabIndex:16},{Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"Cell",TabIndex:9},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country",TabIndex:17},{Type:"email",Label:"Email:",MaxLength:"50",ModelValue:"Email",TabIndex:10},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"Logo URL:",MaxLength:"100",ModelValue:"LogoUrl",TabIndex:18},{Type:"text",Label:"Latitude:",MaxLength:"20",ModelValue:"Latitude",TabIndex:20},{Type:"dropdown",Label:"Currency:",Required:!0,ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode",TabIndex:19},{Type:"text",Label:"Longitude:",MaxLength:"20",ModelValue:"Longitude",TabIndex:21}],l.id=t.id,l.loadingIndicator=!1}angular.module("FieldConnectApp").controller("OfficeEditController",e),e.$inject=["$scope","$location","$state","$stateParams","restService"]}();;!function(){"use strict";function e(e,a,t,l){var i=this;i.isLoading=!1,i.edit=function(e){t.go("payRatesEdit",{id:e})},i.$state=t,i.isLoading=!0,i.attributes=[{Name:"Name",ValueName:"PayRateName",Edit:!0,Sortable:!0},{Name:"Cost Multiplier",ValueName:"CostMultiplier",Edit:!1,Sortable:!0,CellFormat:"decimal"},{Name:"Hourly Cost",ValueName:"CostHour",Edit:!1,Sortable:!0,CellFormat:"decimal"},{Name:"Rate Multiplier",ValueName:"RateMultiplier",Edit:!1,Sortable:!0,CellFormat:"decimal"},{Name:"Hourly Rate",ValueName:"RateHour",Edit:!1,Sortable:!0,CellFormat:"decimal"}],setTimeout(function(){i.isLoading=!1,e.$apply()},1e3)}angular.module("FieldConnectApp").controller("PayRateController",e),e.$inject=["$scope","$location","$state","ModalService"]}();;!function(){"use strict";function e(e,l,t,o,i,a){var u=this;function n(){u.loadingIndicator=!0,u.id?e.update("payRates",u.model).then(function(e){u.$state.go("payRates")}):e.create("payRates",u.model).then(function(e){e.data&&(u.insertData=e.data),u.$state.go("payRates")})}u.$state=o,u.onSubmit=function(){if(!function(){if(""===u.model.PayRateName||null===u.model.PayRateName||void 0===u.model.PayRateName)return a.warning({message:"Please fill in required fields!"}),!1;return!0}())return!1;var e=[];!function(e){""!==u.model.CostHour&&null!==u.model.CostHour&&void 0!==u.model.CostHour||""!==u.model.CostMultiplier&&null!==u.model.CostMultiplier&&void 0!==u.model.CostMultiplier||e.push("'Hourly Cost' or 'Hourly Multiplier'");""!==u.model.RateHour&&null!==u.model.RateHour&&void 0!==u.model.RateHour||""!==u.model.RateMultiplier&&null!==u.model.RateMultiplier&&void 0!==u.model.RateMultiplier||e.push("'Hourly Rate' or 'Rate Multiplier'");return e.length>0}(e)?n():(l="Warning: "+e.join(" and ")+" should be set before saving. Do you want to continue?",bootbox.confirm(l,function(e){e&&n()}));var l},u.attributes=[{Type:"text",Label:"Name:",MaxLength:"50",ModelValue:"PayRateName",Autofocus:"true",Required:!0},{Type:"text",CustomDivClass:"col-sm-6 col-lg-6 visibilityNone"},{Type:"decimal",Label:"Hourly Cost:",ModelValue:"CostHour"},{Type:"decimal",Label:"Cost Multiplier:",ModelValue:"CostMultiplier"},{Type:"decimal",Label:"Hourly Rate:",ModelValue:"RateHour"},{Type:"decimal",Label:"Rate Multiplier:",ModelValue:"RateMultiplier"}],u.id=i.id,u.loadingIndicator=!1,u.model={},l.$watch("vm.model.CostHour",function(){u.model.CostHour&&(u.model.CostMultiplier=null)}),l.$watch("vm.model.CostMultiplier",function(){null!=u.model.CostMultiplier&&(u.model.CostHour=null)}),l.$watch("vm.model.RateHour",function(){null!=u.model.RateHour&&(u.model.RateMultiplier=null)}),l.$watch("vm.model.RateMultiplier",function(){null!=u.model.RateMultiplier&&(u.model.RateHour=null)})}angular.module("FieldConnectApp").controller("PayRateEditController",e),e.$inject=["restService","$scope","$location","$state","$stateParams","Notification"]}();;!function(){"use strict";function t(t,e,n){this.edit=function(t){n.go("paymentsTypeEdit",{id:t})},this.$state=n,this.attributes=[{Name:"Payment Type Name",ValueName:"PaymentTypeName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("PaymentTypeController",t),t.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,t,o,n){var a=this;a.$state=o,a.goBack=function(){o.go("paymentTypes")},a.goHome=function(){o.go("home")},a.attributes=[{Type:"text",Label:"Payment Type:",Required:!0,MaxLength:"20",ModelValue:"PaymentTypeName",Autofocus:"true"}],a.id=n.id,a.loadingIndicator=!1}angular.module("FieldConnectApp").controller("PaymentTypeEditController",e),e.$inject=["$scope","$location","$state","$stateParams"]}();;!function(){"use strict";function e(e,t,a,r){var i=this;i.viewName="RateSheets",i.moduleName="RateSheetsGrid",i.isLoading=!1,i.edit=function(e){a.go("rateSheetsTableEdit",{id:e})},i.$state=a,i.isLoading=!0,i.rateSheetService=r,i.attributes=[{Name:"Rate Sheet",ValueName:"RateSheetName",Edit:!0,Sortable:!0},{Name:"Labor Hourly Rate",ValueName:"LaborRateHour",Edit:!1,Sortable:!0},{Name:"Part Markup %",ValueName:"PartMarkupPercent",Edit:!1,Sortable:!0,CellFormat:"percent"},{Name:"Misc Markup %",ValueName:"MiscMarkupPercent",Edit:!1,Sortable:!0,CellFormat:"percent"}],setTimeout(function(){i.isLoading=!1,e.$apply()},1e3)}angular.module("FieldConnectApp").controller("RateSheetController",e),e.$inject=["$scope","$location","$state","rateSheetService"]}();;!function(){"use strict";function e(e,t,a,r,o){var u=this;u.$state=a,u.goBack=function(){a.go("rateSheetsTable")},u.goHome=function(){a.go("home")},u.rateSheetState=o.state,u.attributes=[{Type:"text",Label:"Rate Sheet:",Required:!0,MaxLength:"50",ModelValue:"RateSheetName",Autofocus:"true"},{Type:"decimal",Label:"Labor Hourly Rate:",Required:!0,ModelValue:"LaborRateHour"},{Type:"percent",Label:"Part Markup %:",Required:!0,ModelValue:"PartMarkupPercent"},{Type:"percent",Label:"Misc Markup %:",Required:!0,ModelValue:"MiscMarkupPercent"}],u.id=r.id,u.loadingIndicator=!1}angular.module("FieldConnectApp").controller("RateSheetEditController",e),e.$inject=["$scope","$location","$state","$stateParams","rateSheetService"]}();;!function(){"use strict";function e(e,t,o,u,a,s,n){var r=this;r.$state=o,r.show=!0,r.model={},r.editSMTP=function(e){void 0!=e&&n.success({message:"SMTP Settings have been successfully updated."});s(function(){r.$state.go("home")})},r.attributes=[{Type:"text",Label:"SMTP Name:",Required:!0,MaxLength:"50",ModelValue:"SMTPName",Autofocus:"true"},{Type:"text",Label:"SMTP Server:",Required:!0,MaxLength:"50",ModelValue:"SMTPServer",Autofocus:"true"},{Type:"text",Label:"Username:",Required:!0,MaxLength:"50",ModelValue:"Username",Autofocus:"true"},{Type:"int",Label:"Port:",Required:!0,MaxLength:"5",ModelValue:"Port",Autofocus:"true"},{Type:"password",Label:"Password:",Required:!0,MaxLength:"50",ModelValue:"Password",Autofocus:"true"},{Type:"checkbox",Label:"Enable SSL:",Required:!1,ModelValue:"SSL",Autofocus:"true"}],r.isLoading=!0,a.getItem("smtp/getCurrentCompany").then(function(e){s(function(){r.id=e.data.Id,r.isLoading=!1})})}angular.module("FieldConnectApp").controller("SMTPSettingsController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","$timeout","Notification"]}();;!function(){"use strict";function e(e,t,a,r,l,i,o,s,m,d,u){var c=this;c.viewName="ServiceableItems",c.moduleName="ServiceableItems",c.isLoading=!1,c.$state=a,c.edit=function(e){a.go("serviceableItemsEdit",{customerId:c.filter1.customerId,id:e})},c.editAttachment=function(e){var t={ServiceableItemId:c.filter.filterId};r.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Serviceable Item Attachments Edit Form",id:e,model:t,attributes:c.editAttributesAttachment,apiMethod:"serviceableitemattachments",filter:c.serviceableItemIdFilter}}).then(function(e){e.close.then(function(){c.serviceableItemIdFilter1.Reload++})})},c.editNote=function(e){var t={ServiceableItemId:c.filter.filterId};r.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Serviceable Item Note Edit Form",id:e,model:t,attributes:c.editAttributesNote,apiMethod:"serviceableitemnotes"}}).then(function(e){e.close.then(function(){c.serviceableItemIdFilter.Reload++})})},c.loadTable=!1,c.selected=null,c.customerId="",c.showTabs=!0,c.filterBySI=i.filter("and"),c.loadWoesFilter=N,c.goToWo=function(e,t){a.go("workOrdersDetails",{id:e})},c.search=function(){c.siteFilter.siteId?(c.saSiteFilter.reset(),c.saSiteFilter=i.filter("and"),c.saSiteFilter.eq("SiteId",c.siteFilter.siteId),c.saSiteFilter.eq("Search",c.searchText)):(c.siCustomerFilter.reset(),c.siCustomerFilter=i.filter("and"),c.siCustomerFilter.eq("CustomerId",c.filter1.customerId),c.siCustomerFilter.eq("Search",c.searchText))},c.searchNotes=function(){c.serviceableItemIdFilter.reset(),c.serviceableItemIdFilter.eq("ServiceableItemId",c.filter.filterId).like("Note","%"+c.notesSearchText+"%")},c.searchAttachments=function(){c.serviceableItemIdFilter1.reset(),c.serviceableItemIdFilter1.eq("ServiceableItemId",c.filter.filterId).like("AttachmentName","%"+c.attachmentSearchText+"%")},c.filter={filterId:null,Reload:0},c.filter1={customerId:null},c.siteFilter={siteId:parseInt(s.id)},c.saSiteFilter=i.filter("and"),c.saSiteFilter.eq("SiteId",c.siteFilter.siteId),c.serviceableItemIdFilter=i.filter("and"),c.serviceableItemIdFilter.eq("ServiceableItemId",0),c.siCustomerFilter=i.filter("and"),c.serviceableItemIdFilter1=i.filter("and"),c.serviceableItemIdFilter1.eq("ServiceableItemId",c.filter.filterId);var n=new Date;if(n.setDate(n.getDate()-90),c.woesFilter1={startDate:n,endDate:new Date},c.modelAttachment={},c.modelNote={},c.siteFilter.siteId)c.isLoading=!0,l.getItem("sites",c.siteFilter.siteId).then(function(){c.site=l.state.item,c.filter1.customerId=c.site.CustomerId,c.siCustomerFilter=i.filter("and"),c.siCustomerFilter.eq("CustomerId",c.site.CustomerId),setTimeout(function(){c.isLoading=!1,e.$apply()},1e3)});else{l.getItems("customers/getcustomer",{pageSize:1,sortCol:"CustomerName",sortDir:"asc"}).then(function(){c.isLoading=!0,c.customers=l.state.items,c.customers.length>0&&(c.customers.sort(d.sortArray("CustomerName")),c.model.CustomerName=c.customers[0].CustomerName,c.filter1.customerId=c.customers[0].Id,c.siCustomerFilter=i.filter("and"),c.siCustomerFilter.eq("CustomerId",c.customers[0].Id)),null!=s.customerId&&(c.filter1.customerId=parseInt(s.customerId),c.siCustomerFilter=i.filter("and"),c.siCustomerFilter.eq("CustomerId",parseInt(s.customerId))),setTimeout(function(){c.isLoading=!1,e.$apply()},1e3)})}c.model={},c.customerFilter=i.filter("and"),c.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],c.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}];var I={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:function(e){e.Id&&(c.filter.filterId=0,c.serviceableItemIdFilter.reset(),c.serviceableItemIdFilter.eq("ServiceableItemId",0),c.siCustomerFilter=i.filter("and"),c.siCustomerFilter.eq("CustomerId",e.Id),c.filterNotes=i.filter("and"),c.filterNotes.eq("ServiceableItemId",e.Id),c.loadTable=!0,c.model.CustomerName=e.CustomerName,c.filter1.customerId=e.Id,c.searchText=null,N())},SearchTrigger:1,Label:"Customer:",Required:!1,ApiMethod:"customers/active",ModelValue:"CustomerName",Id:"CustomerName",GridAttributes:c.ddlgridattrsCustomer,PageSize:22,SearchCols:c.searchColsCustomer,Autofocus:"true",TabIndex:1,ObjectName:"btnCustomerSearch"},b={Type:"button",Label:"Clear",onClick:function(e){c.model.CustomerName=null},ObjectName:"btnCustomerSearch"};function N(){if(c.filter.filterId){if(c.showTabs=!0,c.woesFilter=i.filter("and"),c.woesFilter.eq("CustomerId",c.filter1.customerId),c.woesFilter.eq("ServiceableItemId",c.filter.filterId),c.serviceableItemIdFilter.reset(),c.serviceableItemIdFilter=i.filter("and"),c.serviceableItemIdFilter.eq("ServiceableItemId",c.filter.filterId),c.serviceableItemIdFilter1=i.filter("and"),c.serviceableItemIdFilter1.eq("ServiceableItemId",c.filter.filterId),""!=c.woesFilter1.startDate&&null!=c.woesFilter1.startDate){c.woesFilter1.startDate=new Date(c.woesFilter1.startDate),c.woesFilter1.startDate.setHours(0,0,0,0);var e=new Date(c.woesFilter1.startDate);o.convertToUtc(e),c.woesFilter.eq("startDate",o.buildISOString(e))}if(""!=c.woesFilter1.endDate&&null!=c.woesFilter1.endDate){c.woesFilter1.endDate=new Date(c.woesFilter1.endDate),c.woesFilter1.endDate.setHours(23,59,59,999);var t=new Date(c.woesFilter1.endDate);o.convertToUtc(t),c.woesFilter.eq("endDate",o.buildISOString(t))}c.loadTable=!1,m(function(){c.loadTable=!0})}else c.showTabs=!1,c.loadTable=!1}c.custAttributes=[I,b],c.attributes=[{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Serviceable Item Name",ValueName:"ServiceableItemName",Edit:!0,Sortable:!0},{Name:"Class",ValueName:"ClassName",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"TypeName",Edit:!1,Sortable:!0},{Name:"Asset tag",ValueName:"AssetTag",Edit:!1,Sortable:!0},{Name:"Serial Number",ValueName:"SerialNum",Edit:!1,Sortable:!0},{Name:"Manufacturer",ValueName:"Mfr",Edit:!1,Sortable:!0},{Name:"Model",ValueName:"Model",Edit:!1,Sortable:!0},{Name:"Location",ValueName:"Location",Edit:!1,Sortable:!0}],c.attributesAttachment=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0}],c.attributesNote=[{Name:"Date Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Customer Viewable ",ValueName:"CustomerViewable",Edit:!1,Sortable:!1,CellFormat:"checkbox"},{Name:"Note",ValueName:"Note",Edit:!0,Sortable:!0}],c.editAttributesAttachment=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType",Filter:i.filter("and").eq("attachmentCategory","WO")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description :",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"serviceableitemattachments/file"}],c.editAttributesNote=[{Type:"text",Label:"Note:",Required:!0,MaxLength:"500",ModelValue:"Note",Sortable:!0},{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"CustomerViewable"}],c.attributesWoes=[{Name:"Work Order",ValueName:"AltId",Edit:!0,Sortable:!0},{Name:"Wo Type",ValueName:"WoType",Edit:!1,Sortable:!0},{Name:"Promised Date",ValueName:"PromiseDate",FormatDate:"datetime",Edit:!1,Sortable:!0},{Name:"Time Zone",ValueName:"TimeZoneName",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!0},{Name:"Agreement",ValueName:"AgreementDesc",Edit:!1,Sortable:!0},{Name:"Subcontractor",ValueName:"CompanyName",Edit:!1,Sortable:!0},{Name:"Sub Bill",ValueName:"SubInvoiceAltId",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"InvoiceReportUrl"}],e.$watch("vm.filter1.customerId",function(){c.filter1.customerId&&(c.filter.filterId=0,c.serviceableItemIdFilter.reset(),c.serviceableItemIdFilter.eq("ServiceableItemId",0),c.siCustomerFilter=i.filter("and"),c.siCustomerFilter.eq("CustomerId",c.filter1.customerId),c.filterNotes=i.filter("and"),c.filterNotes.eq("ServiceableItemId",c.filter.filterId),c.loadTable=!0,N())}),e.$watch("vm.filter.filterId",function(){c.filter.filterId&&(c.loadTable=!0,N()),c.loadTable=!1}),c.getModulePrivilege=function(e,t){return u.getModulePrivilege(e,t)}}angular.module("FieldConnectApp").controller("ServiceableItemController",e),e.$inject=["$scope","$location","$state","ModalService","restService","qsService","timezoneService","$stateParams","$timeout","sortArrayObjectsByAttrService","guiPrivilegeService"]}();;!function(){"use strict";function e(e,t,a,r,l,i,o,d,s,m,n){var u=this;u.id=r.id,u.model={},u.$state=a,u.goBack=function(){u.$state.go("serviceableItemsTableSelected",{customerId:u.filterCustomer.customerId})},u.goToWo=function(e,t){a.go("workOrdersDetails",{id:e})},u.editAttachment=function(e){var t={ServiceableItemId:u.filter.filterId};d.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Serviceable Item Attachments Edit Form",id:e,model:t,attributes:u.editAttributesAttachment,apiMethod:"serviceableitemattachments",filter:u.serviceableItemIdFilter}}).then(function(e){e.close.then(function(){u.loadTable=!1,s(function(){u.loadTable=!0})})})},u.editNote=function(e){var t={ServiceableItemId:u.filter.filterId};d.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Serviceable Item Note Edit Form",id:e,model:t,attributes:u.editAttributesNote,apiMethod:"serviceableitemnotes"}}).then(function(e){e.close.then(function(){u.loadTable=!1,s(function(){u.loadTable=!0})})})},u.loadWoesFilter=p,u.filterNotes=i.filter("and"),u.setTypeIntial=!1,u.loadTable=!1,u.searchNotes=function(){u.serviceableItemIdFilter.reset(),u.serviceableItemIdFilter.eq("ServiceableItemId",u.woesFilter1.ServiceableItemId).like("Note","%"+u.notesSearchText+"%")},u.searchAttachments=function(){u.serviceableItemIdFilter1.reset(),u.serviceableItemIdFilter1.eq("ServiceableItemId",u.woesFilter1.ServiceableItemId).like("AttachmentName","%"+u.attachmentSearchText+"%")},u.woesFilter=i.filter("and"),u.filter={filterId:u.id},u.filterCustomer={customerId:r.customerId},u.usingDSLNorthwest=n.usingDSLNorthwest,u.autoFilterClass=i.filter("and"),u.autoFilterClass.eq("ServiceableItemClassId",0),u.autoFilterCustomer=i.filter("and"),u.autoFilterCustomer.filter=[],u.autoFilterCustomer.eq("CustomerId",r.customerId),u.serviceableItemIdFilter=i.filter("and"),u.serviceableItemIdFilter.eq("ServiceableItemId",u.id),u.serviceableItemIdFilter1=i.filter("and"),u.serviceableItemIdFilter1.eq("ServiceableItemId",u.id),u.woesFilter=i.filter("and"),u.woesFilter.eq("CustomerId",u.filterCustomer.customerId),u.woesFilter.eq("ServiceableItemId",u.filter.ServiceableItemId),u.ServiceableItemName={Type:"text",Label:"Serviceable Item Name:",Required:!0,MaxLength:"50",ModelValue:"ServiceableItemName"},u.Customer={Type:"text",Label:"Customer:",Required:!1,MaxLength:"50",ModelValue:"CustomerName",ReadOnly:!0},u.Class={Type:"dropdown",Label:"Class:",ApiMethod:"serviceableItemClasses",ValueProp:"Id",TextProp:"ClassName",ModelValue:"ClassId",ConvertToInt:"true"},u.Site={Type:"dropdown",Label:"Site:",Required:!0,ApiMethod:"sites",ValueProp:"Id",TextProp:"SiteName",ModelValue:"SiteId",ConvertToInt:"true",Filter:u.autoFilterCustomer,Autofocus:"true"},u.Type={Type:"dropdown",Label:"Type:",ApiMethod:"serviceableItemTypes",ValueProp:"Id",TextProp:"TypeName",ModelValue:"TypeId",ConvertToInt:"true",Filter:u.autoFilterClass},u.Location={Type:"text",Label:"Location:",Required:!1,MaxLength:"50",ModelValue:"Location"},u.Model={Type:"text",Label:"Model:",Required:!1,MaxLength:"50",ModelValue:"Model"},u.AssetTag={Type:"text",Label:"Asset tag:",Required:!1,MaxLength:"100",ModelValue:"AssetTag"},u.Manufacturer={Type:"text",Label:"Manufacturer:",Required:!1,MaxLength:"50",ModelValue:"Mfr"},u.InstallDate={Type:"datepicker",Label:"Install Date:",ModelValue:"InstallDate",Format:"MM/dd/yy",SubType:"date"},u.YearManufactured={Type:"int",Label:"Year Manufactured:",Required:!1,ModelValue:"YearMfr"},u.WarrantyEffectiveDate={Type:"datepicker",Label:"Warranty Effective Date:",ModelValue:"WarrantyEffectiveDate",Format:"MM/dd/yy",SubType:"date"},u.SerialNumber={Type:"text",Label:"Serial Number:",Required:!1,MaxLength:"100",ModelValue:"SerialNum"},u.WarrantyExpireDate={Type:"datepicker",Label:"Warranty Expire Date:",ModelValue:"WarrantyExpireDate",Format:"MM/dd/yy",SubType:"date"},u.DSLProductCode={Type:"text",Label:"Item No:",Required:!1,MaxLength:"100",ModelValue:"User0"},u.attDSLItemInvPostingGroup={Type:"dropdown",Label:"Posting Group:",ApiMethod:"dslInventoryPostingGroup/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"User8",ConvertToInt:"true"},u.DSLWarrantyPctParts={Type:"decimal",Label:"Warranty % (Parts):",Required:!1,ModelValue:"User2"},u.DSLWarrantyStartingDateLabor={Type:"datepicker",Label:"Warranty Starting Date (Labor):",ModelValue:"User6",Format:"MM/dd/yy",SubType:"date"},u.DSLWarrantyEndingDateLabor={Type:"datepicker",Label:"Warranty Ending Date (Labor):",ModelValue:"User7",Format:"MM/dd/yy",SubType:"date"},u.DSLWarrantyPctLabor={Type:"decimal",Label:"Warranty % (Labor):",Required:!1,ModelValue:"User3"},u.Line1={Type:"line",CustomClass:"col-sm-12"},u.Description={Type:"textarea",Label:"Description:",Required:!1,MaxLength:"250",ModelValue:"Description",Id:"Description"},u.DSLDescription2={Type:"textarea",Label:"Description 2:",Required:!1,MaxLength:"250",ModelValue:"User1",Id:"User1"};var c=[u.ServiceableItemName,u.Customer,u.Description,u.Site,u.Class,u.Location,u.Type,u.AssetTag,u.Model,u.InstallDate,u.Manufacturer,u.WarrantyEffectiveDate,u.YearManufactured,u.WarrantyExpireDate,u.SerialNumber],b=[u.ServiceableItemName,u.Customer,u.Description,u.DSLDescription2,u.Class,u.Site,u.Type,u.Location,u.Model,u.AssetTag,u.Manufacturer,u.InstallDate,u.YearManufactured,u.SerialNumber,u.DSLProductCode,u.attDSLItemInvPostingGroup,u.Line1,u.WarrantyEffectiveDate,u.DSLWarrantyStartingDateLabor,u.WarrantyExpireDate,u.DSLWarrantyEndingDateLabor,u.DSLWarrantyPctParts,u.DSLWarrantyPctLabor];u.loadTable=!1,u.usingDSLNorthwest?(u.WarrantyEffectiveDate.Label="Warranty Starting Date (Parts):",u.WarrantyExpireDate.Label="Warranty Ending Date (Parts):",u.attributes=b):u.attributes=c,u.loadTable=!0,u.attributesAttachment=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0}],u.attributesNote=[{Name:"Date Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Customer Viewable ",ValueName:"CustomerViewable",Edit:!1,Sortable:!1,CellFormat:"checkbox"},{Name:"Note",ValueName:"Note",Edit:!0,Sortable:!0}],u.editAttributesAttachment=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType",Filter:i.filter("and").eq("attachmentCategory","WO")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description :",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"serviceableitemattachments/file"}],u.editAttributesNote=[{Type:"text",Label:"Note:",Required:!0,MaxLength:"500",ModelValue:"Note"},{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"CustomerViewable"}],u.attributesWoes=[{Name:"Work Order",ValueName:"AltId",Edit:!0,Sortable:!0},{Name:"Wo Type",ValueName:"WoType",Edit:!1,Sortable:!0},{Name:"Promised Date",ValueName:"PromiseDate",FormatDate:"datetime",Edit:!1,Sortable:!0},{Name:"Time Zone",ValueName:"TimeZoneName",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!0},{Name:"Agreement",ValueName:"AgreementDesc",Edit:!1,Sortable:!0},{Name:"Subcontractor",ValueName:"CompanyName",Edit:!1,Sortable:!0},{Name:"Sub Bill",ValueName:"SubInvoiceAltId",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"InvoiceReportUrl"}],u.woesFilter=i.filter("and"),u.woesFilter.eq("CustomerId",u.filterCustomer.customerId),u.woesFilter.eq("ServiceableItemId",u.filter.ServiceableItemId),l.getItem("customers",u.filterCustomer.customerId).then(function(){var e=l.state.item;u.model.CustomerName=e.CustomerName}),e.$watch("vm.model.ClassId",function(e,t){if(e||t){u.autoFilterClass.reset();var a=0;u.model.ClassId&&(a=u.model.ClassId),u.id&&u.setTypeIntial?u.model.TypeId=null:u.setTypeIntial=!0,u.autoFilterClass.eq("ServiceableItemClassId",a)}});var I=new Date;function p(){if(u.woesFilter.reset(),u.woesFilter.eq("CustomerId",u.filterCustomer.customerId),u.woesFilter.eq("ServiceableItemId",u.woesFilter1.ServiceableItemId),u.serviceableItemIdFilter.reset(),u.serviceableItemIdFilter=i.filter("and"),u.serviceableItemIdFilter.eq("ServiceableItemId",u.woesFilter1.ServiceableItemId),u.serviceableItemIdFilter1.reset(),u.serviceableItemIdFilter1=i.filter("and"),u.serviceableItemIdFilter1.eq("ServiceableItemId",u.woesFilter1.ServiceableItemId),""!=u.woesFilter1.startDate&&null!=u.woesFilter1.startDate){u.woesFilter1.startDate=new Date(u.woesFilter1.startDate),u.woesFilter1.startDate.setHours(0,0,0,0);var e=new Date(u.woesFilter1.startDate);o.convertToUtc(e),u.woesFilter.eq("startDate",o.buildISOString(e))}if(""!=u.woesFilter1.endDate&&null!=u.woesFilter1.endDate){u.woesFilter1.endDate=new Date(u.woesFilter1.endDate),u.woesFilter1.endDate.setHours(23,59,59,999);var t=new Date(u.woesFilter1.endDate);o.convertToUtc(t),u.woesFilter.eq("endDate",o.buildISOString(t))}}I.setDate(I.getDate()-90),u.woesFilter1={startDate:I,endDate:new Date,ServiceableItemId:u.id},u.id&&(p(),u.loadTable=!0),u.modelAttachment={},u.modelNote={},u.loadingIndicator=!1}angular.module("FieldConnectApp").controller("ServiceableItemEditController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","qsService","timezoneService","ModalService","$timeout","cryptoStorageService","featuresFactory"]}();;!function(){"use strict";function e(e,t,a,r,l,i,o,d,n,s,m){var u=this;u.$state=a,u.goBack=function(){window.history.back()},u.loadTable=!1,u.model={},u.filter={filterId:null,searchText:""},u.loadWoesFilter=p,u.id=r.id,u.filterCustomer={customerId:null},u.searchNotes=function(){u.serviceableItemIdFilter.reset(),u.serviceableItemIdFilter.eq("ServiceableItemId",u.woesFilter1.ServiceableItemId).like("Note","%"+u.notesSearchText+"%")},u.searchAttachments=function(){u.serviceableItemIdFilter1.reset(),u.serviceableItemIdFilter1.eq("ServiceableItemId",u.woesFilter1.ServiceableItemId).like("AttachmentName","%"+u.attachmentSearchText+"%")},u.editAttachment=function(e){var t={ServiceableItemId:u.filter.filterId};d.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Serviceable Item Attachments Edit Form",id:e,model:t,attributes:u.editAttributesAttachment,apiMethod:"serviceableitemattachments",filter:u.serviceableItemIdFilter}}).then(function(e){e.close.then(function(){u.loadTable=!1,n(function(){u.loadTable=!0,u.serviceableItemIdFilter.Reload++})})})},u.editNote=function(e){var t={ServiceableItemId:u.filter.filterId};d.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Serviceable Item Note Edit Form",id:e,model:t,attributes:u.editAttributesNote,apiMethod:"serviceableitemnotes"}}).then(function(e){e.close.then(function(){u.loadTable=!1,n(function(){u.loadTable=!0,u.serviceableItemIdFilter.Reload++})})})},u.goToWo=function(e,t){d.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/reportReadOnly.html",controller:"ReportReadOnlyController",controllerAs:"vm",inputs:{modalTitle:"Serviceable Item Attachments Edit Form",id:t.Id}}).then(function(e){e.close.then(function(){})})},u.filterCustomer.customerId=r.customerId,u.filter.filterId=u.id,u.autoFilterCustomer=i.filter("and"),u.autoFilterCustomer.filter=[],u.autoFilterCustomer.eq("CustomerId",r.customerId),u.woesFilter=i.filter("and"),u.woesFilter.eq("CustomerId",r.customerId),u.woesFilter.eq("ServiceableItemId",u.id),u.serviceableItemIdFilter=i.filter("and"),u.serviceableItemIdFilter.eq("ServiceableItemId",u.id),u.usingDSLNorthwest=m.usingDSLNorthwest,u.ServiceableItemName={Type:"text",Label:"Serviceable Item Name:",ReadOnly:!0,Required:!1,MaxLength:"50",ModelValue:"ServiceableItemName"},u.Customer={Type:"text",Label:"Customer:",ReadOnly:!0,Required:!1,MaxLength:"50",ModelValue:"CustomerName",ReadOnly:!0},u.Class={Type:"text",Label:"Class:",ReadOnly:!0,MaxLength:"50",ModelValue:"ClassName"},u.Site={Type:"text",Label:"Site:",ReadOnly:!0,MaxLength:"50",ModelValue:"SiteName"},u.Type={Type:"text",Label:"Type:",ReadOnly:!0,MaxLength:"50",ModelValue:"TypeName"},u.Location={Type:"text",Label:"Location:",ReadOnly:!0,Required:!1,MaxLength:"50",ModelValue:"Location"},u.Model={Type:"text",Label:"Model:",ReadOnly:!0,Required:!1,MaxLength:"50",ModelValue:"Model"},u.AssetTag={Type:"text",Label:"Asset tag:",ReadOnly:!0,Required:!1,MaxLength:"100",ModelValue:"AssetTag"},u.Manufacturer={Type:"text",Label:"Manufacturer:",ReadOnly:!0,Required:!1,MaxLength:"50",ModelValue:"Mfr"},u.InstallDate={Type:"datepicker",Label:"Install Date:",ReadOnly:!0,ModelValue:"InstallDate",Format:"MM/dd/yy",SubType:"date"},u.YearManufactured={Type:"int",Label:"Year Manufactured:",ReadOnly:!0,Required:!1,ModelValue:"YearMfr"},u.WarrantyEffectiveDate={Type:"datepicker",Label:"Warranty Effective Date:",ReadOnly:!0,ModelValue:"WarrantyEffectiveDate",Format:"MM/dd/yy",SubType:"date"},u.SerialNumber={Type:"text",Label:"Serial Number:",ReadOnly:!0,Required:!1,MaxLength:"100",ModelValue:"SerialNum"},u.WarrantyExpireDate={Type:"datepicker",Label:"Warranty Expire Date:",ReadOnly:!0,ModelValue:"WarrantyExpireDate",Format:"MM/dd/yy",SubType:"date"},u.DSLProductCode={Type:"text",Label:"Item No:",ReadOnly:!0,Required:!1,MaxLength:"100",ModelValue:"User0"},u.attDSLItemInvPostingGroup={Type:"dropdown",Label:"Posting Group:",ApiMethod:"dslInventoryPostingGroup/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"User8",ConvertToInt:"true",ReadOnly:!0},u.DSLWarrantyPctParts={Type:"decimal",Label:"Warranty % (Parts):",ReadOnly:!0,Required:!1,ModelValue:"User2"},u.DSLWarrantyStartingDateLabor={Type:"datepicker",Label:"Warranty Starting Date (Labor):",ReadOnly:!0,ModelValue:"User6",Format:"MM/dd/yy",SubType:"date"},u.DSLWarrantyEndingDateLabor={Type:"datepicker",Label:"Warranty Ending Date (Labor):",ReadOnly:!0,ModelValue:"User7",Format:"MM/dd/yy",SubType:"date"},u.DSLWarrantyPctLabor={Type:"decimal",Label:"Warranty % (Labor):",ReadOnly:!0,Required:!1,ModelValue:"User3"},u.Line1={Type:"line",CustomClass:"col-sm-12"},u.Description={Type:"textarea",Label:"Description:",Required:!1,MaxLength:"250",ModelValue:"Description",Id:"Description",ReadOnly:!0},u.DSLDescription2={Type:"textarea",Label:"Description 2:",Required:!1,MaxLength:"250",ModelValue:"User1",Id:"User1",ReadOnly:!0};var c=[u.ServiceableItemName,u.Customer,u.Description,u.Site,u.Class,u.Location,u.Type,u.AssetTag,u.Model,u.InstallDate,u.Manufacturer,u.WarrantyEffectiveDate,u.YearManufactured,u.WarrantyExpireDate,u.SerialNumber],b=[u.ServiceableItemName,u.Customer,u.Description,u.DSLDescription2,u.Class,u.Site,u.Type,u.Location,u.Model,u.AssetTag,u.Manufacturer,u.InstallDate,u.YearManufactured,u.SerialNumber,u.DSLProductCode,u.attDSLItemInvPostingGroup,u.Line1,u.WarrantyEffectiveDate,u.DSLWarrantyStartingDateLabor,u.WarrantyExpireDate,u.DSLWarrantyEndingDateLabor,u.DSLWarrantyPctParts,u.DSLWarrantyPctLabor];u.showForm=!1,u.usingDSLNorthwest?(u.WarrantyEffectiveDate.Label="Warranty Starting Date (Parts):",u.WarrantyExpireDate.Label="Warranty Ending Date (Parts):",u.attributes=b):u.attributes=c,u.showForm=!0,u.attributesAttachment=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0}],u.attributesNote=[{Name:"Date Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Customer Viewable ",ValueName:"CustomerViewable",Edit:!1,Sortable:!1,CellFormat:"checkbox"},{Name:"Note",ValueName:"Note",Edit:!0,Sortable:!0}],u.editAttributesAttachment=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType"},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description :",Required:!1,MaxLength:"50",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"serviceableitemattachments/file"}],u.editAttributesNote=[{Type:"text",Label:"Note:",Required:!0,MaxLength:"500",ModelValue:"Note"},{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"CustomerViewable"}],u.attributesWoes=[{Name:"Work Order",ValueName:"AltId",Edit:!0,Sortable:!0},{Name:"Wo Type",ValueName:"WoType",Edit:!1,Sortable:!0},{Name:"Promised Date",ValueName:"PromiseDate",FormatDate:"datetime",Edit:!1,Sortable:!0},{Name:"Time Zone",ValueName:"TimeZoneName",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!0}];var y=new Date;function p(){if(u.woesFilter.reset(),u.woesFilter.eq("CustomerId",u.filterCustomer.customerId),u.woesFilter.eq("ServiceableItemId",u.woesFilter1.ServiceableItemId),u.serviceableItemIdFilter1=i.filter("and"),u.serviceableItemIdFilter1.eq("ServiceableItemId",u.woesFilter1.ServiceableItemId),""!=u.woesFilter1.startDate&&null!=u.woesFilter1.startDate){u.woesFilter1.startDate=new Date(u.woesFilter1.startDate),u.woesFilter1.startDate.setHours(0,0,0,0);var e=new Date(u.woesFilter1.startDate);o.convertToUtc(e),u.woesFilter.eq("startDate",o.buildISOString(e))}if(""!=u.woesFilter1.endDate&&null!=u.woesFilter1.endDate){u.woesFilter1.endDate=new Date(u.woesFilter1.endDate),u.woesFilter1.endDate.setHours(23,59,59,999);var t=new Date(u.woesFilter1.endDate);o.convertToUtc(t),u.woesFilter.eq("endDate",o.buildISOString(t))}}y.setDate(y.getDate()-90),u.woesFilter1={startDate:y,endDate:new Date,ServiceableItemId:u.id},u.id&&(p(),u.loadTable=!0),u.modelAttachment={},u.modelNote={},u.loadingIndicator=!1}angular.module("FieldConnectApp").controller("ServiceableItemsReadOnlyController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","qsService","timezoneService","ModalService","$timeout","cryptoStorageService","featuresFactory"]}();;!function(){"use strict";function e(e,t,a,i,l,r,o,s,m,n,d,u){var c=this;c.viewName="Sites",c.moduleName="SitesGrid",c.isLoading=!1,c.edit=function(e){c.isReadOnly?a.go("siteReadOnly",{id:e}):a.go("sitesEdit",{id:e})},c.editAttachments=function(e){var t={SiteId:c.filter.SiteId};i.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Site Attachment Edit",id:e,model:t,attributes:c.editAttributesAttachments,apiMethod:"siteattachments"}}).then(function(e){e.close.then(function(){c.filter.Reload++,c.filterAttachments.Reload++})})},c.editNotes=function(e){c.modelNotes.NoteTemp="",c.modelNotes.SiteId=c.filter.SiteId,i.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Site Note Edit",id:e,model:c.modelNotes,attributes:c.editAttributesNotes,apiMethod:"sitenotes"}}).then(function(e){e.close.then(function(){c.filterBySite.Reload++,c.filterNotes.Reload++})})},c.loadFilters=b,c.searchAttachment=p,c.searchNotes=T,c.loadTable=!1,c.$state=a,c.goToWo=function(e,t){c.isTech?function(e,t){i.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/reportReadOnly.html",controller:"ReportReadOnlyController",controllerAs:"vm",inputs:{modalTitle:"Serviceable Item Attachments Edit Form",id:t.Id}}).then(function(e){e.close.then(function(){})})}(0,t):a.go("workOrdersDetails",{id:e})},c.CustomerParam="Customer",c.secondedit=function(e){a.go("customersEdit",{id:e.CustomerId})},c.customerData={CustomerId:null};var N=n.getValue("authorizationData");c.isTech=!1,"Technician"!==N.userRoles&&"Apprentice"!==N.userRoles||(c.isTech=!0),c.guiViewName="CustomerModule",c.guiModuleName="SiteDetails",c.isReadOnly=!1,D(c.guiViewName,c.guiModuleName)===u.permissions.ReadOnly&&(c.isReadOnly=!0),c.filter1={status:["Active"],search:null},c.autoFilter=r.filter("and"),c.FilterStatus={filterId:"Customer"},c.search=function(){c.filter.SiteId&&(c.filterBySite.reset(),c.filterBySite.eq("SiteId",c.filter.SiteId),c.filterBySite.eq("Search",c.searchText))},c.searchSite=f,c.filterBySite=r.filter("and"),c.filterAttachments=r.filter("and"),c.filterNotes=r.filter("and"),c.attachmentSearchText=null,c.notesSearchText=null;var S={};c.customerId=parseInt(l.id),c.customerId?(c.autoFilterCustomer=r.filter("and"),c.autoFilterCustomer.filter=[],c.autoFilterCustomer.eq("CustomerId",c.customerId),c.customerData.CustomerId=c.customerId,c.CustomerId=c.customerId,m.selectiveExtend(S,c,["CustomerId"]),m.setTransitionParam("customerData",S)):(c.customerId=null,c.customerData.CustomerId=c.customerId,c.CustomerId=c.customerId,m.selectiveExtend(S,c,["CustomerId"]),m.setTransitionParam("customerData",S)),c.woTimezone={TzDatabaseName:"%TzDatabaseName%"},c.drilldownSettings={ApiMethod:"siteattachments",filter:c.filterAttachments,attributes:[{Name:"Date /Time",ValueName:"SysModifyUTC",FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName"},{Name:"Description",ValueName:"Desc"},{Name:"Type",ValueName:"AttachmentType"}],Edit:{ModalTitle:"",attributes:[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType",Filter:r.filter("and").eq("attachmentCategory","WO")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description:",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"siteattachments/file"}]}},c.filter={SiteId:null,Reload:0},c.woesFilter1={startDate:null,endDate:new Date};var h=new Date(c.woesFilter1.endDate);function f(){c.autoFilterCustomer=r.filter("and"),c.autoFilterCustomer.reset(),c.customerId&&c.autoFilterCustomer.eq("CustomerId",c.customerId),0==c.filter1.status.length&&(c.filter1.status=["Active"]),c.autoFilterCustomer.eq("Search",c.filter1.search),c.autoFilterCustomer.eq("Status",c.filter1.status);var t={};c.filter1.status&&(t.status=c.filter1.status),c.filter1.search&&(t.search=c.filter1.search);var a={};n.getValue("lastselection_"+c.UserData.Id)&&(a=n.getValue("lastselection_"+c.UserData.Id)),a.siteFilter=t,n.setValue("lastselection_"+c.UserData.Id,a),setTimeout(function(){c.isLoading=!1,e.$apply()},1e3)}function p(){c.filter.SiteId&&(c.filterAttachments.reset(),c.filterAttachments.eq("SiteId",c.filter.SiteId),c.filterAttachments.like("Search",c.attachmentSearchText?"%"+c.attachmentSearchText+"%":null))}function T(){c.filter.SiteId&&(c.filterNotes.reset(),c.filterNotes.eq("SiteId",c.filter.SiteId),c.filterNotes.like("Search",c.notesSearchText?"%"+c.notesSearchText+"%":null))}function b(){if(c.filter.SiteId){if(c.filterBySite.reset(),c.filterBySite.eq("SiteId",c.filter.SiteId),c.woesFilter=r.filter("and"),c.woesFilter.eq("SiteId",c.filter.SiteId),""!=c.woesFilter1.startDate&&null!=c.woesFilter1.startDate){c.woesFilter1.startDate=new Date(c.woesFilter1.startDate),c.woesFilter1.startDate.setHours(0,0,0,0);var e=new Date(c.woesFilter1.startDate);o.convertToUtc(e),c.woesFilter.ge("PromiseDate",o.buildISOString(e))}if(""!=c.woesFilter1.endDate&&null!=c.woesFilter1.endDate){c.woesFilter1.endDate=new Date(c.woesFilter1.endDate),c.woesFilter1.endDate.setHours(23,59,59,999);var t=new Date(c.woesFilter1.endDate);o.convertToUtc(t),c.woesFilter.le("PromiseDate",o.buildISOString(t))}c.loadTable=!1,s(function(){c.loadTable=!0})}else c.loadTable=!1}function D(e,t){return u.getModulePrivilege(e,t)}h.setDate(h.getDate()-90),c.woesFilter1.startDate=new Date(h),c.attributes=[{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0,SecondEdit:!0,BindedTo:"CustomerId",BindValue:0},{Name:"Site Code",ValueName:"SiteCode",Edit:!1,Sortable:!0},{Name:"Site Name",ValueName:"SiteName",Edit:!0,Sortable:!0},{Name:"Address",ValueName:"FullAddress",Edit:!1,Sortable:!0},{Name:"Contact",ValueName:"ContactName",Edit:!1,Sortable:!1},{Name:"Phone",ValueName:"Phone",Edit:!1,Sortable:!1},{Name:"Email",ValueName:"Email",Edit:!1,Sortable:!1},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0}],c.attributesNotes=[{Name:"Date Time",ValueName:"SysModifyUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Viewable",ValueName:"CustomerViewable",Edit:!1,Sortable:!0,CellFormat:"checkbox"},{Name:"Note",ValueName:"Note",Edit:!0,Sortable:!0}],c.siteNoteFilter=r.filter("and"),c.siteNoteFilter.eq("NoteType","Site"),c.editAttributesNotes=[{Type:"dropdown",Label:"Standard Notes:",ApiMethod:"notelibs",ValueProp:"Note",TextProp:"NoteTitle",ModelValue:"NoteTemp",Filter:c.siteNoteFilter},{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"CustomerViewable"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note",Required:!0}],c.attributesAttachments=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!0,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0}],c.editAttributesAttachments=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType",Filter:r.filter("and").eq("attachmentCategory","WO")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description:",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"siteattachments/file"}],c.attributesWoes=[{Name:"Work Order",ValueName:"AltId",Edit:!0,Sortable:!0},{Name:"Wo Type",ValueName:"WoType",Edit:!1,Sortable:!0},{Name:"Promised Date",ValueName:"PromiseDate",FormatDate:"datetime",Edit:!1,Sortable:!0},{Name:"Time Zone",ValueName:"TimeZoneName",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!0},{Name:"Agreement",ValueName:"AgreementDesc",Edit:!1,Sortable:!0},{Name:"Subcontractor",ValueName:"CompanyName",Edit:!1,Sortable:!0},{Name:"Sub Bill",ValueName:"SubInvoiceAltId",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"InvoiceReportUrl"}],d.getCurrentUserData().then(function(e){c.isLoading=!0,c.UserData=e;var t=n.getValue("lastselection_"+c.UserData.Id);t&&t.siteFilter?s(function(){t.siteFilter.status&&(c.filter1.status=t.siteFilter.status),t.siteFilter.search&&(c.filter1.search=t.siteFilter.search),f()}):f()}),c.modelNotes={SiteId:c.filter.SiteId,NoteTemp:""},e.$watch("vm.modelNotes.NoteTemp",function(){c.modelNotes.Note=c.modelNotes.NoteTemp}),e.$watch("vm.filter.SiteId",function(){c.isLoading=!0,c.attachmentSearchText=null,p(),c.notesSearchText=null,T(),b(),setTimeout(function(){c.isLoading=!1,e.$apply()},0)}),c.getModulePrivilege=D}angular.module("FieldConnectApp").controller("SiteController",e),e.$inject=["$scope","$location","$state","ModalService","$stateParams","qsService","timezoneService","$timeout","stateTransitionService","cryptoStorageService","currentUserService","guiPrivilegeService"]}();;!function(){"use strict";function e(e,t,a,l,o,r,i,d,n){var s=this;s.model={},s.$state=a,s.checkLatLong=function(e){if(void 0!=e){var t=e.latLng;void 0!=t&&(null!=t.Lat&&null!=t.Lng||o.warning({message:"Wrong address or city name. Can't generate latitude and longitude for this address!"}))}s.$state.go("sites")},s.editAttachments=function(e){var t={SiteId:s.filter.SiteId};d.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Site Attachment Edit",id:e,model:t,attributes:s.editAttributesAttachments,apiMethod:"siteattachments"}}).then(function(e){e.close.then(function(){s.filter.Reload++,s.filterAttachments.Reload++})})},s.editNotes=function(e){s.modelNotes.NoteTemp="",d.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Site Note Edit",id:e,model:s.modelNotes,attributes:s.editAttributesNotes,apiMethod:"sitenotes"}}).then(function(e){e.close.then(function(){s.filterBySite.Reload++,s.filterNotes.Reload++})})},s.loadWoesFilter=m,s.searchAttachment=p,s.searchNotes=c,s.goToWo=function(e,t){d.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/reportReadOnly.html",controller:"ReportReadOnlyController",controllerAs:"vm",inputs:{modalTitle:"Serviceable Item Attachments Edit Form",id:t.Id}}).then(function(e){e.close.then(function(){})})},s.goBack=function(){window.history.back()},s.loadTable=!1,s.filterBySite=r.filter("and"),s.filterAttachments=r.filter("and"),s.filterNotes=r.filter("and"),s.attachmentSearchText=null,s.notesSearchText=null,s.attributes=[{Type:"dropdown",Label:"Customer:",Required:!0,ApiMethod:"customers/getcustomer",ValueProp:"Id",TextProp:"CustomerName",ModelValue:"CustomerId",ConvertToInt:"true",Autofocus:"true",ReadOnly:!0},{Type:"dropdown",Label:"Office:",ApiMethod:"offices",Required:!0,ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true",ReadOnly:!0},{Type:"text",Label:"Site Name:",MaxLength:"50",ModelValue:"SiteName",Required:!0,ReadOnly:!0},{Type:"dropdown",Label:"Salesperson:",ApiMethod:"employees/getSalesPersonList",ValueProp:"Id",TextProp:"FullName",ModelValue:"SalesPersonId",ConvertToInt:"true",ReadOnly:!0},{Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc",ReadOnly:!0},{Type:"text",Label:"Site Code:",MaxLength:"50",ModelValue:"SiteCode",ReadOnly:!0},{Type:"text",Label:"Contact Title:",MaxLength:"50",ModelValue:"Title",ReadOnly:!0},{Type:"text",Label:"Address:",MaxLength:"50",ModelValue:"Address1",Required:!0,ReadOnly:!0},{Type:"text",Label:"Contact First Name:",Required:!0,MaxLength:"50",ModelValue:"FirstName",ReadOnly:!0},{Type:"text",Label:"",MaxLength:"50",ModelValue:"Address2",ReadOnly:!0},{Type:"text",Label:"Contact Last Name:",Required:!0,MaxLength:"50",ModelValue:"LastName",ReadOnly:!0},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"City",Required:!0,ReadOnly:!0},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"Phone",Required:!0,ReadOnly:!0},{Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"StateCode",Required:!0,ReadOnly:!0},{Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"Cell",ReadOnly:!0},{Type:"text",Label:"Postal Code:",MaxLength:"50",ModelValue:"PostalCode",Required:!0,ReadOnly:!0},{Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"Fax",ReadOnly:!0},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country",Required:!0,ReadOnly:!0},{Type:"email",Label:"Email:",MaxLength:"50",ModelValue:"Email",ReadOnly:!0},{Type:"dropdown",Label:"Default Tech:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"DefaultTechId",ConvertToInt:"true",ReadOnly:!0},{Type:"dropdown",Label:"Rate Sheet:",ApiMethod:"ratesheets",ValueProp:"Id",TextProp:"RateSheetName",ModelValue:"RateSheetId",ConvertToInt:"true",Required:!0,ReadOnly:!0},{Type:"dropdown",Label:"Currency Code:",ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode",Required:!0,ReadOnly:!0},{Type:"dropdown",Label:"Tax Rate ID:",ApiMethod:"taxrates",ValueProp:"Id",TextProp:"TaxName",ModelValue:"TaxRateId",ConvertToInt:"true",Required:!0,ReadOnly:!0},{Type:"dropdown",Label:"Time zone:",ApiMethod:"timezones",ValueProp:"Id",TextProp:"TimeZoneName",ModelValue:"TimeZoneId",ConvertToInt:"true",Required:!0,ReadOnly:!0}],s.id=l.id,s.filter={SiteId:null,Reload:0},s.filter.SiteId=s.id,s.siteNoteFilter=r.filter("and"),s.siteNoteFilter.eq("NoteType","Site"),s.woesFilter1={startDate:null,endDate:new Date};var u=new Date(s.woesFilter1.endDate);function m(){if(s.filter.SiteId){if(s.woesFilter.reset(),s.woesFilter.eq("SiteId",s.filter.SiteId),s.woesFilter=r.filter("and"),s.woesFilter.eq("SiteId",s.filter.SiteId),""!=s.woesFilter1.startDate&&null!=s.woesFilter1.startDate){s.woesFilter1.startDate=new Date(s.woesFilter1.startDate),s.woesFilter1.startDate.setHours(0,0,0,0);var e=new Date(s.woesFilter1.startDate);i.convertToUtc(e),s.woesFilter.ge("PromiseDate",i.buildISOString(e))}if(""!=s.woesFilter1.endDate&&null!=s.woesFilter1.endDate){s.woesFilter1.endDate=new Date(s.woesFilter1.endDate),s.woesFilter1.endDate.setHours(23,59,59,999);var t=new Date(s.woesFilter1.endDate);i.convertToUtc(t),s.woesFilter.le("PromiseDate",i.buildISOString(t))}}}function p(){s.filter.SiteId&&(s.filterAttachments.reset(),s.filterAttachments.eq("SiteId",s.filter.SiteId),s.filterAttachments.like("Search",s.attachmentSearchText?"%"+s.attachmentSearchText+"%":null))}function c(){s.filter.SiteId&&(s.filterNotes.reset(),s.filterNotes.eq("SiteId",s.filter.SiteId),s.filterNotes.like("Search",s.notesSearchText?"%"+s.notesSearchText+"%":null))}u.setDate(u.getDate()-90),s.woesFilter1.startDate=new Date(u),s.attributesNotes=[{Name:"Date Time",ValueName:"SysModifyUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Viewable",ValueName:"CustomerViewable",Edit:!1,Sortable:!0,CellFormat:"checkbox"},{Name:"Note",ValueName:"Note",Edit:!0,Sortable:!0}],s.siteNoteFilter=r.filter("and"),s.siteNoteFilter.eq("NoteType","Site"),s.editAttributesNotes=[{Type:"dropdown",Label:"Standard Notes:",ApiMethod:"notelibs",ValueProp:"Note",TextProp:"NoteTitle",ModelValue:"NoteTemp",Filter:s.siteNoteFilter},{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"CustomerViewable"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note",Required:!0}],s.attributesAttachments=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!0,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0}],s.editAttributesAttachments=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType",Filter:r.filter("and").eq("attachmentCategory","WO")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description:",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"siteattachments/file"}],s.attributesWoes=[{Name:"Work Order",ValueName:"AltId",Edit:!0,Sortable:!0},{Name:"Wo Type",ValueName:"WoType",Edit:!1,Sortable:!0},{Name:"Promised Date",ValueName:"PromiseDate",FormatDate:"datetime",Edit:!1,Sortable:!0},{Name:"Time Zone",ValueName:"TimeZoneName",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!0},{Name:"Agreement",ValueName:"AgreementDesc",Edit:!1,Sortable:!0},{Name:"Subcontractor",ValueName:"CompanyName",Edit:!1,Sortable:!0},{Name:"Sub Bill",ValueName:"SubInvoiceAltId",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"InvoiceReportUrl"}],s.woesFilter=r.filter("and"),s.woesFilter.eq("SiteId",s.filter.SiteId),s.loadingIndicator=!1,s.modelNotes={SiteId:s.filter.SiteId,NoteTemp:""},e.$watch("vm.modelNotes.NoteTemp",function(){s.modelNotes.Note=s.modelNotes.NoteTemp}),e.$watch("vm.filter.SiteId",function(){s.attachmentSearchText=null,p(),s.notesSearchText=null,c(),m()}),s.id&&(m(),s.loadTable=!0)}angular.module("FieldConnectApp").controller("SiteReadOnyController",e),e.$inject=["$scope","$location","$state","$stateParams","Notification","qsService","timezoneService","ModalService","$timeout"]}();;!function(){"use strict";function e(e,t,a,i,l){var o=this;o.edit=function(e,t){var a={SiteId:t.filterId};i.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Site Attachment Edit",id:e,model:a,attributes:o.editAttributes,apiMethod:"siteattachments"}}).then(function(e){e.close.then(function(){o.siteAttachmentFilter.reload++})})},o.siteAttachmentFilter={reload:0},o.attributes=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0},{Name:"Name",ValueName:"AttachmentName",Edit:!0,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0}],o.editAttributes=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType",Filter:l.filter("and").eq("attachmentCategory","WO")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description:",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"siteattachments/file"}]}angular.module("FieldConnectApp").controller("SiteAttachmentsController",e),e.$inject=["$scope","$location","$state","ModalService","qsService"]}();;!function(){"use strict";function e(e,t,o,a,l,r,i,d,n,s,m,u,c,p){var h=this;h.model={},h.$state=o,h.checkLatLong=function(e){if(void 0!=e&&!h.disableGeoCodeLookupOnSite){var t=e.latLng;void 0!=t&&(null!=t.Lat&&null!=t.Lng||l.warning({message:"Wrong address or city name. Can't generate latitude and longitude for this address!"}))}h.$state.go("sites")},h.editAttachments=function(e){var t={SiteId:h.filter.SiteId};d.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Site Attachment Edit",id:e,model:t,attributes:h.editAttributesAttachments,apiMethod:"siteattachments"}}).then(function(e){e.close.then(function(){h.filter.Reload++,h.filterAttachments.Reload++})})},h.editNotes=function(e){var t={SiteId:h.filter.SiteId};d.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Site Note Edit",id:e,model:t,attributes:h.editAttributesNotes,apiMethod:"sitenotes"}}).then(function(e){e.close.then(function(){h.filterBySite.Reload++,h.filterNotes.Reload++})})},h.loadFilters=b,h.goToWo=function(e,t){h.isTech?function(e,t){d.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/reportReadOnly.html",controller:"ReportReadOnlyController",controllerAs:"vm",inputs:{modalTitle:"Serviceable Item Attachments Edit Form",id:t.Id}}).then(function(e){e.close.then(function(){})})}(0,t):o.go("workOrdersDetails",{id:e})},h.search=function(){h.filter.SiteId&&(h.filterBySite.reset(),h.filterBySite.eq("SiteId",h.filter.SiteId),h.filterBySite.eq("Search",h.searchText))},h.searchAttachment=N,h.searchNotes=y,h.loadTable=!1;var f=!1,S=!1;h.CustomerData=m.getTransitionParam("customerData"),h.filterBySite=r.filter("and"),h.filterAttachments=r.filter("and"),h.filterNotes=r.filter("and"),h.attachmentSearchText=null,h.notesSearchText=null;var T=c.getValue("authorizationData");h.isTech=!1,"Technician"!==T.userRoles&&"Apprentice"!==T.userRoles||(h.isTech=!0),h.guiViewName="CustomerModule",h.guiModuleName="SiteDetails",h.isReadOnly=!1,I(h.guiViewName,h.guiModuleName)===u.permissions.ReadOnly&&(h.isReadOnly=!0),h.companySettingsFilter=r.filter("or"),h.companySettingsFilter.eq("Name","DisableGeoCodeLookupOnSite"),p.getCompanySettings(h.companySettingsFilter).then(function(){h.disableGeoCodeLookupOnSite=p.DisableGeoCodeLookupOnSite}),h.customerEdit={Type:"dropdownandlink",Label:"Customer:",onClick:function(e){"link"==e&&(0==h.model.CustomerId||null==h.model.CustomerId?l.warning({message:"First you must select customer"}):o.go("customersEdit",{id:h.model.CustomerId}))},Required:!0,ApiMethod:"customers/getcustomer",ValueProp:"Id",TextProp:"CustomerName",ModelValue:"CustomerId",ConvertToInt:"true",Autofocus:"true",ICustomInputClass:"fa fa-external-link ViewLink"},h.attributes=[h.customerEdit,{Type:"dropdown",Label:"Office:",ApiMethod:"offices",Required:!0,ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true"},{Type:"text",Label:"Site Name:",MaxLength:"50",ModelValue:"SiteName",Required:!0},{Type:"dropdown",Label:"Salesperson:",ApiMethod:"employees/getSalesPersonList",ValueProp:"Id",TextProp:"FullName",ModelValue:"SalesPersonId",ConvertToInt:"true"},{Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc"},{Type:"text",Label:"Site Code:",MaxLength:"50",ModelValue:"SiteCode"},{Type:"text",Label:"Contact Title:",MaxLength:"50",ModelValue:"Title"},{Type:"text",Label:"Address:",MaxLength:"50",ModelValue:"Address1"},{Type:"text",Label:"Contact First Name:",MaxLength:"50",ModelValue:"FirstName"},{Type:"text",Label:"",MaxLength:"50",ModelValue:"Address2"},{Type:"text",Label:"Contact Last Name:",MaxLength:"50",ModelValue:"LastName"},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"City"},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"Phone"},{Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"StateCode"},{Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"Cell"},{Type:"text",Label:"Postal Code:",MaxLength:"50",ModelValue:"PostalCode"},{Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"Fax"},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country"},{Type:"email",Label:"Email:",MaxLength:"50",ModelValue:"Email"},{Type:"dropdown",Label:"Default Tech:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"DefaultTechId",ConvertToInt:"true"},{Type:"dropdown",Label:"Rate Sheet:",ApiMethod:"ratesheets",ValueProp:"Id",TextProp:"RateSheetName",ModelValue:"RateSheetId",ConvertToInt:"true",Required:!0},{Type:"dropdown",Label:"Currency Code:",ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode",Required:!0},{Type:"dropdown",Label:"Tax Rate ID:",ApiMethod:"taxrates",ValueProp:"Id",TextProp:"TaxName",ModelValue:"TaxRateId",ConvertToInt:"true"},{Type:"dropdown",Label:"Time zone:",ApiMethod:"timezones",ValueProp:"Id",TextProp:"TimeZoneName",ModelValue:"TimeZoneId",ConvertToInt:"true",Required:!0}],h.id=a.id,h.filter={SiteId:null,Reload:0},h.filter.SiteId=h.id,h.siteNoteFilter=r.filter("and"),h.siteNoteFilter.eq("NoteType","Site"),h.woesFilter1={startDate:null,endDate:new Date};var C=new Date(h.woesFilter1.endDate);function N(){h.filter.SiteId&&(h.filterAttachments.reset(),h.filterAttachments.eq("SiteId",h.filter.SiteId),h.filterAttachments.like("Search",h.attachmentSearchText?"%"+h.attachmentSearchText+"%":null))}function y(){h.filter.SiteId&&(h.filterNotes.reset(),h.filterNotes.eq("SiteId",h.filter.SiteId),h.filterNotes.like("Search",h.notesSearchText?"%"+h.notesSearchText+"%":null))}function b(){if(h.filter.SiteId){if(h.filterBySite.reset(),h.filterBySite.eq("SiteId",h.filter.SiteId),h.woesFilter.reset(),h.woesFilter.eq("SiteId",h.filter.SiteId),h.attachmentSearchText=null,N(),h.notesSearchText=null,y(),""!=h.woesFilter1.startDate&&null!=h.woesFilter1.startDate){h.woesFilter1.startDate=new Date(h.woesFilter1.startDate),h.woesFilter1.startDate.setHours(0,0,0,0);var e=new Date(h.woesFilter1.startDate);i.convertToUtc(e),h.woesFilter.ge("PromiseDate",i.buildISOString(e))}if(""!=h.woesFilter1.endDate&&null!=h.woesFilter1.endDate){h.woesFilter1.endDate=new Date(h.woesFilter1.endDate),h.woesFilter1.endDate.setHours(23,59,59,999);var t=new Date(h.woesFilter1.endDate);i.convertToUtc(t),h.woesFilter.le("PromiseDate",i.buildISOString(t))}}}function I(e,t){return u.getModulePrivilege(e,t)}C.setDate(C.getDate()-90),h.woesFilter1.startDate=new Date(C),h.attributesNotes=[{Name:"Date Time",ValueName:"SysModifyUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Viewable",ValueName:"CustomerViewable",Edit:!1,Sortable:!0,CellFormat:"checkbox"},{Name:"Note",ValueName:"Note",Edit:!0,Sortable:!0}],h.editAttributesNotes=[{Type:"dropdown",Label:"Standard Notes:",ApiMethod:"notelibs",ValueProp:"Note",TextProp:"NoteTitle",ModelValue:"NoteTemp",Filter:h.siteNoteFilter},{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"CustomerViewable"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note",Required:!0}],h.attributesAttachments=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!0,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0}],h.editAttributesAttachments=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType",Filter:r.filter("and").eq("attachmentCategory","WO")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description:",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"siteattachments/file"}],h.attributesWoes=[{Name:"Work Order",ValueName:"AltId",Edit:!0,Sortable:!0},{Name:"Wo Type",ValueName:"WoType",Edit:!1,Sortable:!0},{Name:"Promised Date",ValueName:"PromiseDate",FormatDate:"datetime",Edit:!1,Sortable:!0},{Name:"Time Zone",ValueName:"TimeZoneName",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!0},{Name:"Agreement",ValueName:"AgreementDesc",Edit:!1,Sortable:!0},{Name:"Subcontractor",ValueName:"CompanyName",Edit:!1,Sortable:!0},{Name:"Sub Bill",ValueName:"SubInvoiceAltId",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"InvoiceReportUrl"}],h.woesFilter=r.filter("and"),h.woesFilter.eq("SiteId",h.filter.SiteId),h.loadingIndicator=!1,e.$watch("vm.CustomerData",function(){h.CustomerData&&h.CustomerData.CustomerId&&(s.getItem("customers/"+h.CustomerData.CustomerId).then(function(){h.customer=s.state.item,h.model.CustomerId=h.CustomerData.CustomerId,h.model.Address1=h.customer.Address1,h.model.Address2=h.customer.Address2,h.model.City=h.customer.City,h.model.StateCode=h.customer.StateCode,h.model.PostalCode=h.customer.PostalCode,h.model.Country=h.customer.Country,h.model.FirstName=h.customer.ContactFirstName,h.model.LastName=h.customer.ContactLastName,h.model.Phone=h.customer.ContactPhone,h.model.Cell=h.customer.ContactCell,h.model.Fax=h.customer.ContactFax,h.model.Email=h.customer.ContactEmail}),h.customerEdit.ReadOnly=!0)}),e.$watch("vm.modelNotes.NoteTemp",function(e,t){e!==t&&(h.modelNotes.Note=h.modelNotes.NoteTemp)}),h.id&&(f=!0,S=!0),e.$watch("vm.model.CustomerId",function(){h.model.CustomerId?f?f=!1:s.getItem("customers/"+h.model.CustomerId).then(function(){h.customer=s.state.item,h.model.OfficeId=h.customer.OfficeId}):h.model.OfficeId=null}),e.$watch("vm.model.OfficeId",function(){h.model.OfficeId?S?S=!1:s.getItem("offices/"+h.model.OfficeId).then(function(){h.office=s.state.item,h.model.Country=h.office.Country,h.model.CurrencyCode=h.office.CurrencyCode,h.model.TimeZoneId=h.office.TimeZoneId}):(h.model.Country=null,h.model.CurrencyCode=null,h.model.TimeZoneId=null)}),h.id&&(b(),h.loadTable=!0),h.getModulePrivilege=I}angular.module("FieldConnectApp").controller("SiteEditController",e),e.$inject=["$scope","$location","$state","$stateParams","Notification","qsService","timezoneService","ModalService","$timeout","restService","stateTransitionService","guiPrivilegeService","cryptoStorageService","currentCompanyService"]}();;!function(){"use strict";function e(e,t,l,o,i){var a=this;a.edit=function(e){o.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Site Note Edit",id:e,model:a.model,attributes:a.editAttributes,apiMethod:"sitenotes"}}).then(function(e){e.close.then(function(){a.filter.reload++})})},a.siteNoteFilter=i.filter("and"),a.siteNoteFilter.eq("NoteType","Site"),a.filter={filterId:null,reload:0},a.attributes=[{Name:"Date Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0},{Name:"Created By",ValueName:"SysCreatorId",Edit:!1,Sortable:!0},{Name:"Viewable",ValueName:"CustomerViewable",Edit:!1,Sortable:!0,CellFormat:"checkbox"},{Name:"Note",ValueName:"Note",Edit:!0,Sortable:!0}],a.editAttributes=[{Type:"dropdown",Label:"Standard Notes123:",Required:!0,ApiMethod:"notelibs",ValueProp:"Id",TextProp:"NoteTitle",ModelValue:"NoteTitle",filter:a.siteNoteFilter},{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"CustomerViewable"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"}],a.model={SiteId:"filterId"}}angular.module("FieldConnectApp").controller("SiteNoteController",e),e.$inject=["$scope","$location","$state","ModalService","qsService"]}();;!function(){"use strict";function e(e,t,o,a){this.$state=o,this.attributes=[{Type:"dropdown",Label:"Standard Notes234:",Required:!0,ApiMethod:"notelibs",ValueProp:"Id",TextProp:"NoteTitle",ModelValue:"NoteTitle",Autofocus:"true"},{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"CustomerViewable"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"}],this.id=a.id,this.loadingIndicator=!1}angular.module("FieldConnectApp").controller("SiteNoteEditController",e),e.$inject=["$scope","$location","$state","$stateParams"]}();;!function(){"use strict";function t(t,i,e){this.edit=function(t){e.go("skillTechsEdit",{id:t})},this.filter={filterId:null},this.attributes=[{Name:"Skill Name",ValueName:"SkillName",Edit:!0,Sortable:!0}],this.drilldownSettings={ApiMethod:"skilltechs",FilterFields:{SkillId:"Id"},attributes:[{Name:"Technician",ValueName:"FirstLastName"}]}}angular.module("FieldConnectApp").controller("SkillTechController",t),t.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,l,t,o){var i=this;i.goHome=function(){t.go("home")},i.$state=t,i.attributes=[{Type:"text",Label:"Skill Name:",ModelValue:"SkillName",ReadOnly:!0},{Type:"multiselect",Label:"Technicians:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"ListEmployeeIds"}],i.model={},i.id=o.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("SkillTechEditController",e),e.$inject=["$scope","$location","$state","$stateParams"]}();;!function(){"use strict";function t(t,e,a){this.filter={filterId:null},this.attributes=[{Name:"Standard Task",ValueName:"TaskCode",Edit:!0,Sortable:!0},{Name:"Name",ValueName:"Name",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Description",Edit:!1,Sortable:!0}],this.edit=function(t){a.go("standardTaskEdit",{id:t})}}angular.module("FieldConnectApp").controller("StandardTaskController",t),t.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,t,a,o){var l=this;l.goHome=function(){a.go("home")},l.$state=a,l.attributes=[{Type:"text",Label:"Standard Task:",Required:!0,MaxLength:"10",ModelValue:"TaskCode"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"Name"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"textarea",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Description"},{Type:"textarea",Label:"Note:",Required:!1,MaxLength:"500",ModelValue:"Note"}],l.model={},l.id=o.id,l.loadingIndicator=!1}angular.module("FieldConnectApp").controller("StandardTaskEditController",e),e.$inject=["$scope","$location","$state","$stateParams"]}();;!function(){"use strict";function t(t,a,o,e,i){var n=this;n.isLoading=!1,n.edit=function(t){o.go("subcontractorCompaniesEdit",{id:t})},n.$state=o,n.isLoading=!0,n.attributes=[{Name:"Subcontractor Name",ValueName:"CompanyName",Edit:!0,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0}],setTimeout(function(){n.isLoading=!1,t.$apply()},1e3)}angular.module("FieldConnectApp").controller("SubcontractorCompanyController",t),t.$inject=["$scope","$location","$state","ModalService","$stateParams"]}();;!function(){"use strict";function t(t,e,a,o,s,c,l){var u=this;function i(){l.update("subcontractorCompanies/status/"+u.model.Id,{Status:"Inactive"}).then(function(){u.model.Status="Inactive",c.success({message:"Subcontractor company has been inactivated."})})}function n(){l.update("subcontractorCompanies/status/"+u.model.Id,{Status:"Active"}).then(function(){u.model.Status="Active",c.success({message:"Subcontractor company has been activated."})})}u.selectedTab=s.selectedTab,u.$state=a,u.search=function(){u.Filter.searchText=u.searchText},u.model={},u.searchText="",u.id=s.id,u.editSub=function(t){void 0!=t?c.success({message:"Subcontractor company has been successfully updated."}):u.$state.go("subcontractorCompanies")},u.Inactivate=i,u.Activate=n,""!=s.selectedTab?(u.selectedTab=s.selectedTab,u.filtertab=!0):u.selectedTab="Subcontractor Setup",t.$watch("vm.selectedTab",function(){"Subcontractor Setup"==u.selectedTab&&(u.filtertab=!1)}),u.Filter={filterId:u.id,searchText:""},""==u.Filter.filterId&&(u.Filter.filterId=0),u.FilterStatus={filterId:"SubcontractorCompany"},u.loadingIndicator=!1,u.attributes=[{Type:"dropdown",Label:"Subcontractor Name:",Required:!0,ApiMethod:"subcontractorCompanies/getavailableSubcontractor",Filter:u.Filter,ValueProp:"Id",TextProp:"CompanyName",ModelValue:"SubcontractorId",ConvertToInt:"true",ReadOnly:!!u.id},{Type:"text",Label:"Status:",Required:!0,ApiMethod:"statuses/statusbytype",Filter:u.FilterStatus,ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",ReadOnly:!0},{Type:"email",Label:"Email:",MaxLength:"500",ModelValue:"Email"},{Type:"datepicker",Label:"Request Date:",ModelValue:"RequestDate",Format:"MM/dd/yyyy",SubType:"date",ReadOnly:!0},{Type:"datepicker",Label:"Response Date:",ModelValue:"ResponseDate",Format:"MM/dd/yyyy",SubType:"date",ReadOnly:!0},{Type:"empty"}],t.$watch("vm.model.Status",function(){null!=u.model.Status&&void 0!=u.model.Status||(u.model.Status="Active")}),t.$watch("vm.model.Status",function(){"Active"==u.model.Status?u.attributes[6]={Type:"button",CustomDivClass:"push-right-small",Label:"Inactivate",onClick:i}:u.attributes[6]={Type:"button",CustomDivClass:"push-right-small",Label:"Activate",onClick:n}})}angular.module("FieldConnectApp").controller("SubcontractorCompanyEditController",t),t.$inject=["$scope","$location","$state","ModalService","$stateParams","Notification","restService"]}();;!function(){"use strict";function e(e,t,a,r,i,o){var m=this;m.edit=function(e){a.go("itemSubEdit",{subcontractorId:m.id,id:e})},m.id=i.id,m.Filter={filterId:m.id},m.attributes=[{Name:"Item Name",ValueName:"ItemName",Edit:!0,Sortable:!0},{Name:"Part Number",ValueName:"PartNum",Edit:!1,Sortable:!0},{Name:"Sub Part Number",ValueName:"SubPartNum",Edit:!1,Sortable:!0},{Name:"Sub Price",ValueName:"Price",Edit:!1,Sortable:!0,CellFormat:"decimal"}],o.getItem("subcontractorCompanies",m.id).then(function(){m.subcontractor=o.state.item})}angular.module("FieldConnectApp").controller("ItemSubController",e),e.$inject=["$scope","$location","$state","ModalService","$stateParams","restService"]}();;!function(){"use strict";function t(t,e,r,i,s,a,n,u,o){var l=this;l.$state=r,l.search=function(){l.searchValue.filter=l.searchText?l.searchText.toString():"",l.subFilter.reset(),l.subFilter.eq("SubcontractorId",l.subcontractorId),""!=l.searchValue.filter&&(l.attributes[0].List=null,l.firstTime=!1,l.subFilter.like("ItemName","%"+l.searchValue.filter+"%"))},l.goBack=function(){r.go("subcontractorCompaniesEdit",{id:l.subcontractorId,selectedTab:"Items"})},l.searchText="",l.id=s.id,l.subcontractorId=s.subcontractorId,l.Filter={filterId:l.id,subcontractorId:l.subcontractorId,searchText:""},l.searchValue={filter:""},""==l.Filter.filterId&&(l.Filter.filterId=0),l.subFilter=n.filter("and"),l.subFilter.eq("SubcontractorId",l.subcontractorId),l.attributes=[{Type:"dropdown",Label:"Item Name:",Required:!0,ApiMethod:l.id?"subItems/getavailableItem":"items/dropdown",Filter:l.id?l.Filter:l.subFilter,ValueProp:"Id",TextProp:l.id?"ItemName":"Name",ModelValue:"ItemId",ConvertToInt:"true",ReadOnly:!!l.id,Name:"item",List:l.id?null:[""],CurrentList:[],SelectFirst:!l.id||null,OnOpen:function(){if(l.firstTime)for(var t=0;t<l.attributes.length;t++)if("item"===l.attributes[t].Name){l.attributes[t].List=null,l.subFilter.Reload++,l.firstTime=!1;break}},OnLoaded:function(){o(function(){0==l.attributes[0].CurrentList.length?(u.warning({message:"No results found"}),document.getElementById("seacrhInputPart").focus()):l.attributes[0].CurrentList.length>0&&0==l.attributes[0].CurrentList[0].Id&&(l.attributes[0].CurrentList.splice(0,l.attributes[0].CurrentList.length),u.warning({message:"The number of items is too high! <br /> Please use the search to  limit the number of the items first"}),document.getElementById("seacrhInputPart").focus())})}},{Type:"text",Label:"Part Number:",ModelValue:"PartNum",ReadOnly:"true"},{Type:"text",Label:"Sub Part Number:",ModelValue:"SubPartNum",MaxLength:"20"},{Type:"currency",Label:"Price:",ModelValue:"Price"}],a.getItem("subcontractorCompanies",l.subcontractorId).then(function(){l.subcontractor=a.state.item}),l.firstTime=!0,l.id||t.$on("isOpen",function(t,e){if(l.firstTime)for(var r=0;r<l.attributes.length;r++)if("item"===l.attributes[r].Name){l.attributes[r].List=null,l.subFilter.Reload++,l.firstTime=!1;break}o(function(){0==l.attributes[0].CurrentList.length&&l.isFocus?u.warning({message:"The number of items is too high! <br /> Please use the search to  limit the number of the items first"}):l.attributes[0].CurrentList.length>0&&0==l.attributes[0].CurrentList[0].Id&&(l.attributes[0].CurrentList.splice(0,l.attributes[0].CurrentList.length),l.isFocus=!0,u.warning({message:"The number of items is too high! <br /> Please use the search to  limit the number of the items first"}))},100)}),l.loadingIndicator=!1,l.model={},l.model.SubcontractorId=parseInt(l.subcontractorId),t.$watch("vm.model.ItemId",function(){null!=l.model.ItemId&&a.getItem("items",l.model.ItemId).then(function(){l.model.PartNum=a.state.item.PartNum})}),t.$watch("vm.model.Price",function(){null!=l.model.Price&&void 0!=l.model.Price||(l.model.Price=0)})}angular.module("FieldConnectApp").controller("ItemsSubEditController",t),t.$inject=["$scope","$location","$state","ModalService","$stateParams","restService","qsService","Notification","$timeout"]}();;!function(){"use strict";function e(e,o,t,a,s,i){var r=this;r.$state=t,r.Filter={filterId:s.id},r.editLaborCode=function(e){void 0!=e?i.success({message:"Labor codes for subcontractor  have been successfully updated."}):r.$state.go("subcontractorCompanies")},r.attributes=[{},{Type:"multiselect",Label:"Labor Codes:",ApiMethod:"laborCodes",ValueProp:"Id",TextProp:"LaborCodeName",ModelValue:"ListCodesIds"}],r.id=s.id,r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("LaborCodesSubEditController",e),e.$inject=["$scope","$location","$state","ModalService","$stateParams","Notification"]}();;!function(){"use strict";function t(t,e,a,o,r,c,i){var n=this;n.$state=a,n.submit=function(){n.FilterSubmit.SubPayRates=n.payRates,n.FilterSubmit.SubcontractorId=n.subcontractor.SubcontractorId,c.update("subPayRates",n.FilterSubmit).then(function(){i.success({message:"Pay Rates for subcontractor  have been successfully updated."})})},n.id=r.id,n.Filter={filterId:n.id},n.FilterSubcontactor={filterId:null},n.FilterSubmit={SubPayRates:null,SubcontractorId:null},n.payRates=[],c.getItem("subcontractorCompanies",n.id).then(function(){n.subcontractor=c.state.item,n.FilterSubcontactor.filterId=n.subcontractor.SubcontractorId,c.getItems("payRates/getPayRatesforSub",n.FilterSubcontactor).then(function(){n.payRates=c.state.items})}),n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("PayRatesSubEditController",t),t.$inject=["$scope","$location","$state","ModalService","$stateParams","restService","Notification"]}();;!function(){"use strict";function a(a,e,t,l){this.edit=function(a){t.go("taxRatesTableEdit",{id:a})},this.$state=t,this.taxRateService=l,this.attributes=[{Name:"Tax Name",ValueName:"TaxName",Edit:!0,Sortable:!0},{Name:"State",ValueName:"State",Edit:!1,Sortable:!0},{Name:"Tax Rate Part",ValueName:"TaxRatePart",Edit:!1,Sortable:!0,CellFormat:"decimal",DisplayFor:"Sales_Tax_Rate"},{Name:"Tax Rate Misc",ValueName:"TaxRateMisc",Edit:!1,Sortable:!0,CellFormat:"decimal",DisplayFor:"Sales_Tax_Rate"},{Name:"Tax Rate Equipment",ValueName:"TaxRateEquipment",Edit:!1,Sortable:!0,CellFormat:"decimal",DisplayFor:"Sales_Tax_Rate"},{Name:"Tax Rate Labor",ValueName:"TaxRateLabor",Edit:!1,Sortable:!0,CellFormat:"decimal",DisplayFor:"Sales_Tax_Rate"}]}angular.module("FieldConnectApp").controller("TaxRateController",a),a.$inject=["$scope","$location","$state","taxRateService"]}();;!function(){"use strict";function e(e,a,t,o,l){var i=this;i.model={},i.$state=t,i.goBack=function(){t.go("taxRatesTable")},i.goHome=function(){t.go("home")},i.taxRateState=l.state,i.attributes=[{Type:"text",Label:"Tax Name:",Required:!0,MaxLength:"50",ModelValue:"TaxName",Autofocus:"true"},{Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateName",ModelValue:"State"},{Type:"decimal",Label:"Tax Rate Part:",MaxLength:"8",ModelValue:"TaxRatePart",Step:"4"},{Type:"decimal",Label:"Tax Rate Misc:",MaxLength:"8",ModelValue:"TaxRateMisc",Step:"4"},{Type:"decimal",Label:"Tax Rate Equipment:",MaxLength:"8",ModelValue:"TaxRateEquipment",Step:"4"},{Type:"decimal",Label:"Tax Rate Labor:",MaxLength:"8",ModelValue:"TaxRateLabor",Step:"4"}],i.id=o.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("TaxRateEditController",e),e.$inject=["$scope","$location","$state","$stateParams","taxRateService"]}();;!function(){"use strict";function e(e,t,a,r,i,o,l,s){var n=this;function d(){n.isLoading=!0,n.reloadTable=!0,n.roleFilter.reset(),n.roleFilter.eq("RoleId",n.filter1.RoleId).eq("Search",n.filter1.Search),setTimeout(function(){n.isLoading=!1,e.$apply()},1e3)}n.viewName="Users",n.moduleName="UsersGrid",n.isLoading=!1,n.$window=i,n.edit=function(e){e?a.go("userEdit",{id:e}):l.getItems("users/getAvailableUsersForCompany").then(function(t){if("true"!==t.data)return s.error({message:"There are no available subscription licenses to add a user. Please contact your Administrator."}),!1;a.go("userEdit",{id:e})})},n.getUsers=d,n.reloadTable=!1,n.attributes=[{Name:"Name",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Username",ValueName:"UserName",Edit:!0,Sortable:!0},{Name:"Phone Number",ValueName:"Phone",Edit:!1,Sortable:!0},{Name:"Last Login Date/Time",ValueName:"LastLoginDate",Edit:!1,Sortable:!0,FormatDate:"datetime"}],n.model={},r(function(){$("#search-info").css("display","inline-block"),$("#search-info").attr("title","Search by user name or first/last name of user.")}),n.filter={UserId:null},n.filter1={RoleId:null,Search:""},n.roleFilter=o.filter("and"),d()}angular.module("FieldConnectApp").controller("UserController",e),e.$inject=["$scope","$location","$state","$timeout","$window","qsService","restService","Notification"]}();;!function(){"use strict";function e(e,s,t,a,r,o,l,d){var u=this;u.$state=t,u.id=s.id,u.$window=o,u.userDataModel={},u.resetPasswordModel={},u.submitUserData=function(){if(u.id)null==u.userDataModel.UserImg&&(u.userDataModel.UserImg=0),"Active"==u.userDataModel.Status?a.update("users/withRoles",u.userDataModel).then(function(){t.go("userTable")}):a.getItems("users/getAvailableUsersForCompany").then(function(e){if("Inactive"!=u.userDataModel.Status&&"true"!==e.data)return r.error({message:"There are no available subscription licenses to add a user. Please contact your Administrator."}),!1;a.update("users/withRoles/"+u.id,u.userDataModel).then(function(e){200===e.status&&(r.success({message:"User has been successfully updated."}),t.go("userTable"))})});else{if(u.userDataModel.Password!==u.userDataModel.ConfirmPassword)return void r.error({message:"Passwords don't match!"});a.getItems("users/getAvailableUsersForCompany").then(function(e){if("true"!==e.data)return r.error({message:"There are no available subscription licenses to add a user. Please contact your Administrator."}),!1;a.create("users/withRoles",u.userDataModel).then(function(){t.go("userTable")})})}},u.activateReset=function(){u.showResetPasword=!0},u.submitResetPassword=function(){if(u.resetPasswordModel.NewPassword!==u.resetPasswordModel.ConfirmNewPassword)return void r.error({message:"Passwords don't match!"});if(null==u.resetPasswordModel.NewPassword||0==u.resetPasswordModel.NewPassword.length||null==u.resetPasswordModel.ConfirmNewPassword||0==u.resetPasswordModel.ConfirmNewPassword.length)return void r.error({message:"Please choose a password."});u.resetPasswordModel.UserId=parseInt(u.id),u.resetPasswordModel.Id=parseInt(u.id),a.update("users/updatepassword",u.resetPasswordModel).then(function(){u.showResetPasword=!1,u.resetPasswordModel.NewPassword=null,u.resetPasswordModel.ConfirmNewPassword=null,r.success({message:"Password has been successfully changed."})})},u.cancelResetPasword=function(){u.showResetPasword=!1,u.resetPasswordModel.NewPassword=null,u.resetPasswordModel.ConfirmNewPassword=null},u.submitSetting=function(e){var s={};s.SettingId=e.SettingId,s.Value=e.Value,s.UserId=u.id,0==e.Id?null==s.Value||""==s.Value?!1===s.Value&&a.create("usersettings",s).then(function(s){r.success({message:"User setting has been successfully updated."}),e.Id=s.data.Id}):a.create("usersettings",s).then(function(s){r.success({message:"User setting has been successfully updated."}),e.Id=s.data.Id}):null==s.Value||""==s.Value?!1===s.Value?a.update("usersettings/"+e.Id,s).then(function(){r.success({message:"User setting has been successfully updated."})}):a.remove("usersettings",e.Id).then(function(){r.success({message:"User setting has been successfully updated."}),e.Id=0}):a.update("usersettings/"+e.Id,s).then(function(){r.success({message:"User setting has been successfully updated."})})},u.showResetPasword=!1;for(var n=d.getValue("authorizationData").userRoles.split(","),i=!1,m=!1,c=!1,p=!1,w=0;w<n.length;w++)"FieldConnect"==n[w]&&(c=!0),"SubAdmin"==n[w]&&(i=!0),"Admin"==n[w]&&(m=!0),"TransAdmin"==n[w]&&(p=!0);u.statusFilter={filterId:"User"},u.filterRoles=l.filter("or"),c||(m?u.filterRoles.neq("RoleTypeName","FC"):i?u.filterRoles.eq("RoleTypeName","SubAdmin").eq("RoleTypeName","SubContractor"):p?u.filterRoles.eq("RoleTypeName","TransAdmin"):u.filterRoles.eq("RoleTypeName","Noting")),u.filters=[],u.userSettingFilter=l.filter("and"),u.userSettingFilter.eq("scope","AdminUser").eq("UserId",u.id),u.userRole={Type:"multiselect",Label:"User Role:",ApiMethod:"roles",ValueProp:"Id",TextProp:"RoleName",ModelValue:"RoleIds",Filter:u.filterRoles,CurrentList:[],TabIndex:14},u.attributes=[{Type:"text",Label:"User Name:",Required:!0,MaxLength:50,ModelValue:"UserName",TabIndex:1},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:u.id?"empty":"password",Label:"Password:",Required:!0,ModelValue:"Password",TabIndex:2},{Type:u.id?"empty":"password",Label:"Confirm Password:",Required:!0,ModelValue:"ConfirmPassword",TabIndex:3},{Type:"line",CustomClass:"col-sm-12"},{Type:"byteimage",ModelValue:"UserImg",BindTo:"UserImgURL"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Image URL:",MaxLength:"100",ModelValue:"UserImgURL"},{Type:"text",Label:"First Name:",Required:!0,MaxLength:50,ModelValue:"FirstName",Autofocus:!0,TabIndex:4},{Type:"text",Label:"Cell:",Required:!1,MaxLength:20,ModelValue:"Cell",TabIndex:9},{Type:"text",Label:"Last Name:",Required:!0,MaxLength:50,ModelValue:"LastName",TabIndex:5},{Type:"text",Label:"Phone:",Required:!1,MaxLength:20,ModelValue:"Phone",TabIndex:10},{Type:"email",Label:"Email:",Required:!0,MaxLength:50,ModelValue:"Email",TabIndex:6},{Type:"dropdown",Label:"Office:",Required:!1,ModelValue:"OfficeId",ValueProp:"Id",TextProp:"OfficeName",ApiMethod:"offices",TabIndex:11},{Type:"dropdown",Label:"Time Zone:",Required:!0,ModelValue:"TimeZoneId",ValueProp:"Id",TextProp:"TimeZoneName",ApiMethod:"timezones",TabIndex:7},{Type:"dropdown",Label:"Status:",Required:!0,ModelValue:"Status",ValueProp:"StatusName",TextProp:"StatusName",ApiMethod:"statuses/statusbytype",CurrentList:[],Filter:u.statusFilter,TabIndex:12},{Type:"text",Label:"Employee Number:",Required:!1,ApiMethod:"employees",ModelValue:"EmployeeNum",ReadOnly:!0,TabIndex:13},{Type:"line",CustomClass:"col-sm-12"},u.userRole],u.attributesSetting=[{Type:"label",Name:"Name",ValueName:"Name",Sortable:!0},{Type:"label",Name:"Description",ValueName:"Desc",Sortable:!0},{Type:"editable",Name:"Value",Value:"Value"}],e.$watch("vm.userRole.CurrentList",function(){u.attributes&&u.userRole.CurrentList.length>0&&a.getItem("userroles",u.id).then(function(){var e=a.state.item;e&&(u.userDataModel.RoleIds=e.RoleIds)})},!0),u.newPassword={Type:"password",Label:"New Password:",ModelValue:"NewPassword",TabIndex:15},u.resetPasswordAttributes=[{Type:"line",CustomClass:"col-sm-12"},{Type:"subheader",Label:"Reset Password"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},u.newPassword,{Type:"password",Label:"Confirm New Password:",ModelValue:"ConfirmNewPassword",TabIndex:16}],e.$watch("vm.attributes[15].CurrentList",function(){if(u.attributes&&u.attributes[15].CurrentList.length>0)for(var e=0;e<u.attributes[15].CurrentList.length;e++)u.userDataModel.Status||"Active"==u.attributes[15].CurrentList[e].StatusName&&(u.userDataModel.Status=u.attributes[15].CurrentList[e].StatusName)},!0)}angular.module("FieldConnectApp").controller("UserEditController",e),e.$inject=["$scope","$stateParams","$state","restService","Notification","$window","qsService","cryptoStorageService"]}();;!function(){"use strict";function e(e,a,t,o,s,l,r){var d=this;d.$state=t,d.$window=l,d.userDataModel={},d.submitUserData=function(){d.userDataModel.NewCompanyId=d.newCompanyId,d.userDataModel.Password!==d.userDataModel.ConfirmPassword?s.error({message:"Passwords don't match!"}):o.create("users/userfornewcompanyByFc",d.userDataModel).then(function(e){if(200===e.status)for(var a in s.success({message:"User created successfully."}),d.userDataModel)delete d.userDataModel[a]})},d.newCompanyId=a.newCompanyId,d.statusFilter={filterId:"User"},d.companyFilter=r.filter("and"),d.companyFilter.eq("CompanyId",d.newCompanyId),d.attributes=[{Type:"text",Label:"User Name:",Required:!0,MaxLength:50,ModelValue:"UserName",TabIndex:1},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"password",Label:"Password:",Required:!0,ModelValue:"Password",TabIndex:2},{Type:"password",Label:"Confirm Password:",Required:!0,ModelValue:"ConfirmPassword",TabIndex:3},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"First Name:",Required:!0,MaxLength:50,ModelValue:"FirstName",Autofocus:!0,TabIndex:4},{Type:"text",Label:"Cell:",Required:!1,MaxLength:20,ModelValue:"Cell",TabIndex:8},{Type:"text",Label:"Last Name:",Required:!0,MaxLength:50,ModelValue:"LastName",TabIndex:5},{Type:"text",Label:"Phone:",Required:!1,MaxLength:20,ModelValue:"Phone",TabIndex:9},{Type:"email",Label:"Email:",Required:!0,MaxLength:50,ModelValue:"Email",TabIndex:6},{Type:"dropdown",Label:"Status:",Required:!0,ModelValue:"Status",ValueProp:"StatusName",TextProp:"StatusName",ApiMethod:"statuses/statusbytype",Filter:d.statusFilter,TabIndex:10},{Type:"dropdown",Label:"Time Zone:",Required:!0,ModelValue:"TimeZoneId",ValueProp:"Id",TextProp:"TimeZoneName",ApiMethod:"timezones",TabIndex:7},{Type:"line",CustomClass:"col-sm-12"},{Type:"multiselect",Label:"User Role:",ApiMethod:"roles/withoutfilterbycompany",Required:!0,ValueProp:"Id",TextProp:"RoleName",ModelValue:"RoleIds",Filter:d.companyFilter,TabIndex:11}]}angular.module("FieldConnectApp").controller("UserForNewCompanyEditController",e),e.$inject=["$scope","$stateParams","$state","restService","Notification","$window","qsService"]}();;!function(){"use strict";function e(e,t,s,a,u,l,n,i,r,o){var d=this;d.model={},d.settings={},d.$state=s,d.onBack=function(t){t?(l.success({message:"User info has been successfully updated."}),e.$emit("userChanged")):s.go("home")},d.submitSetting=function(e){var t={};t.SettingId=e.SettingId,t.Value=e.Value,0==e.Id?null==t.Value||""==t.Value?!1===t.Value&&u.create("usersettings",t).then(function(t){l.success({message:"User setting has been successfully updated."}),e.Id=t.data.Id}):u.create("usersettings",t).then(function(t){l.success({message:"User setting has been successfully updated."}),e.Id=t.data.Id}):null==t.Value||""==t.Value?!1===t.Value?u.update("usersettings/"+e.Id,t).then(function(){l.success({message:"User setting has been successfully updated."})}):u.remove("usersettings",e.Id).then(function(){l.success({message:"User setting has been successfully updated."}),e.Id=0}):u.update("usersettings/"+e.Id,t).then(function(){l.success({message:"User setting has been successfully updated."})})},d.filters=[],d.userSettingFilter=n.filter("and"),d.userSettingFilter.eq("scope","User");var c=!1,g=o.getValue("authorizationData");if(g){d.userRoleTypes=g.userRoleTypes;for(var p=0;p!=d.userRoleTypes.length;p++)c="CustomerPortalAdmin"===d.userRoleTypes[p].RoleTypeName||"CustomerUser"===d.userRoleTypes[p].RoleTypeName}var m={Type:"empty"};c||(m={Type:"dropdown",Label:"Office:",Required:!1,ModelValue:"OfficeId",ValueProp:"Id",TextProp:"OfficeName",ApiMethod:"offices",TabIndex:6}),d.attributesUser=[{Type:"text",Label:"First Name:",Required:!0,MaxLength:50,ModelValue:"FirstName",Autofocus:!0,TabIndex:1},{Type:"text",Label:"Cell:",Required:!1,MaxLength:20,ModelValue:"Cell",TabIndex:4},{Type:"text",Label:"Last Name:",Required:!0,MaxLength:50,ModelValue:"LastName",TabIndex:2},{Type:"text",Label:"Phone:",Required:!1,MaxLength:20,ModelValue:"Phone",TabIndex:5},{Type:"email",Label:"Email:",Required:!0,MaxLength:50,ModelValue:"Email",TabIndex:3},m],d.attributesSetting=[{Type:"label",Name:"Name",ValueName:"Name",Sortable:!0},{Type:"label",Name:"Description",ValueName:"Desc",Sortable:!0},{Type:"editable",Name:"Value",Value:"Value"}],d.loadingIndicator=!1}angular.module("FieldConnectApp").controller("UserSettingController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","Notification","qsService","ModalService","$timeout","cryptoStorageService"]}();;!function(){"use strict";function e(e,t,o,a,r,m,l,s,u,d){var i=this;i.loadingData=!1,i.isLoading=!1,i.generateButtonDisabled=!0,i.items=[],i.itemsMeta={},i.model={},i.$state=o,i.search=C,i.customer={customerId:0},i.selectCustomer=g,i.generateWo=function(){return d.getLocation("PMGenerateWorkOrders").then(function(e){if(i.model.FromDate.getTime()>=i.model.ToDate.getTime())m.error({message:"Invalid date range!"});else{i.isLoading=!0;for(var t={PMId:[],FromDate:null,ToDate:null},o=0;o<i.items.length;o++)t.PMId.push(i.items[o].Id);t.FromDate=i.model.FromDate,t.ToDate=i.model.ToDate;var a=e.coords.latitude,r=e.coords.longitude;null!==a&&(t.Latitude=a),null!==r&&(t.Longitude=r),l.create("wo/pm",t).then(function(e){e&&(m.success({message:e.data.generatedWoesNum+" PM Work Orders successfully created."}),e.data.syncCalendarResult&&m.success({message:e.data.syncCalendarResult})),C(),i.isLoading=!1})}})},i.toggleSort=function(e,t){if(!t)return;i.args.sortCol!==e?(i.args.sortCol=e,i.args.sortDir="asc"):"asc"===i.args.sortDir?i.args.sortDir="desc":i.args.sortDir="asc";c&&C()},i.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],i.siteAutocompleteFilter=r.filter("or"),i.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}];var n={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:function(e){i.customer.customerId=e.Id,i.customer.customerName=e.CustomerName,i.customer.customerCode=e.CustomerCode,i.customer.customerCode&&""!==i.customer.customerCode?i.model.CustomerName=i.customer.customerCode+" - "+i.customer.customerName:i.model.CustomerName=i.customer.customerName},SearchTrigger:1,Label:"Customer:",Required:!1,ApiMethod:"customers/active",ModelValue:"CustomerName",Id:"CustomerName",GridAttributes:i.ddlgridattrsCustomer,PageSize:22,SearchCols:i.searchColsCustomer,Autofocus:"true",TabIndex:2};i.args={page:1,pageSize:10,sortCol:"",sortDir:"asc",FromDate:null,ToDate:null};var c=!1;function C(){if(i.isLoading=!0,c=!0,null===i.model.FromDate||null===i.model.ToDate)return m.warning({message:"Please choose date range!"}),void setTimeout(function(){i.isLoading=!1,e.$apply()},0);if(i.model.FromDate.getTime()>=i.model.ToDate.getTime())return m.error({message:"Invalid date range!"}),void setTimeout(function(){i.isLoading=!1,e.$apply()},0);!function(){var e=new Date(i.model.FromDate);e.setHours(0,0,0,0);var t=new Date(e);s.convertToUtc(t),i.args.FromDate=s.buildISOString(t);var o=new Date(i.model.ToDate);o.setHours(23,59,59,999);var a=new Date(o);s.convertToUtc(a),i.args.ToDate=s.buildISOString(a)}();var t={};(t=r.filter("and")).page=i.args.page,t.pageSize=i.args.pageSize,t.sortCol=i.args.sortCol,t.sortDir=i.args.sortDir,t.eq("Status","Active").eq("CustomerName",i.model.CustomerName).le("StartDate",i.args.FromDate).ge("EndDate",i.args.ToDate),t.eq("AgreementTypeId",i.model.AgreementTypeId).eq("WoType",i.model.WoType).eq("ProblemCode",i.model.ProblemCode),l.getItems("pm",t).then(function(){i.items=l.state.items,i.itemsMeta=l.state.itemsMeta,i.items.length>0?i.generateButtonDisabled=!1:i.generateButtonDisabled=!0,setTimeout(function(){i.isLoading=!1,e.$apply()},1e3)})}function g(){var e="";if(i.model.CustomerId)e=angular.copy(i.model.CustomerName);else if(i.CustomerNameTemp){e=angular.copy(i.CustomerNameTemp);i.CustomerNameTemp=""}a.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectCustomer.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:i.customer,customerName:e}})}i.customerFilter=r.filter("and"),e.$watch("vm.model.CustomerId",function(){void 0!=i.model.CustomerId?(i.customerFilter.reset(),i.customerFilter.eq("Status","Active"),i.customerFilter.customerId=i.model.CustomerId):(i.customerFilter.reset(),i.customerFilter.eq("Status","Active"),i.customerFilter.customerId=0)}),i.attributesFilter=[n,{Type:"button",Label:"Search",onClick:g},{Type:"datepicker",Label:"Start Date:",ModelValue:"FromDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"datepicker",Label:"End Date:",ModelValue:"ToDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"dropdown",Label:"Agreement Type:",ApiMethod:"agreements/getAgreementsByCustomerForPMFilter",ValueProp:"AgreementTypeId",TextProp:"AgreementTypeName",ModelValue:"AgreementTypeId",ConvertToInt:"true",Filter:i.customerFilter},{Type:"dropdown",Label:"Problem Code:",ApiMethod:"problemcodes",ValueProp:"ProblemCodeName",TextProp:"ProblemCodeName",ModelValue:"ProblemCode"},{Type:"dropdown",Label:"Work Order Type:",ApiMethod:"wotypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"WoType"}],i.attributes=[{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0,CellFormat:"label"},{Name:"Code",ValueName:"PMCode",Edit:!1,Sortable:!0,CellFormat:"label"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0,CellFormat:"label"},{Name:"Agreement",ValueName:"AgreementAltId",Edit:!1,Sortable:!0,CellFormat:"label"},{Name:"Start Date",ValueName:"StartDate",Edit:!1,Sortable:!0,FormatDate:"date",CellFormat:"label"},{Name:"End Date",ValueName:"EndDate",Edit:!1,Sortable:!0,FormatDate:"date",CellFormat:"label"},{Name:"PM Last Date",ValueName:"LastDate",Edit:!1,Sortable:!0,FormatDate:"date",CellFormat:"label"},{Name:"WO Type",ValueName:"WoType",Edit:!1,Sortable:!0,CellFormat:"label"},{Name:"Problem Code",ValueName:"ProblemCode",Edit:!1,Sortable:!0,CellFormat:"label"},{Name:"Agreement Type",ValueName:"AgreementTypeName",Edit:!1,Sortable:!0,CellFormat:"label"},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0,CellFormat:"label"}],e.$on("CustomerNameSearching",function(e,t){i.model.CustomerId=null,i.customer.customerId=null}),i.CustomerNameTemp="",i.focusOut=function(e){e&&e.hasOwnProperty("FocusOut")&&e.FocusOut&&"CustomerName"===e.ModelValue&&(i.CustomerNameTemp=angular.copy(i.model.CustomerName),null===i.model.CustomerId&&(i.model.CustomerName=null))},e.$watch("vm.customer.customerId",function(){null!==i.customer.customerId&&i.customer.customerId>0&&(i.model.CustomerId=i.customer.customerId,i.model.CustomerName=i.customer.customerName)}),e.$watch("vm.args.page",function(){c&&C()}),i.firstWatchFix=!0,e.$watch("vm.args.pageSize",function(){i.firstWatchFix?i.firstWatchFix=!1:(1===i.args.page&&c&&C(),i.args.page=1)})}angular.module("FieldConnectApp").controller("GenerateWorkOrdersforPMPlansController",e),e.$inject=["$scope","$location","$state","ModalService","qsService","Notification","restService","timezoneService","cryptoStorageService","fcGeoLocationService"]}();;!function(){"use strict";function e(e,t,a,o,r,m){var s=this;s.model={},s.edit=function(e){m.setTransitionParam("agreementData",s.agrData),a.go("pmEdit",{id:e})},s.isLoading=!1,s.$state=a,s.search=l,s.customer={customerId:0},s.filters=r.filter("and"),s.selectCustomer=d,s.goToGenerateWorkOrders=function(){a.go("generateWorkOrdersforPMPlans")},s.FilterStatus={filterId:"PMStatus"},s.agreementText="",s.reloadTable=!1,s.agrData=m.popTransitionParam("agreementData"),s.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],s.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}];var u={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:function(e){s.customer.customerId=e.Id,s.customer.customerName=e.CustomerName,s.customer.customerCode=e.CustomerCode,s.customer.customerCode&&""!=s.customer.customerCode?s.model.CustomerName=s.customer.customerCode+" - "+s.customer.customerName:s.model.CustomerName=s.customer.customerName},SearchTrigger:1,Label:"Customer:",Required:!0,ApiMethod:"customers/active",ModelValue:"CustomerName",Id:"CustomerName",GridAttributes:s.ddlgridattrsCustomer,PageSize:22,SearchCols:s.searchColsCustomer,Autofocus:"true",TabIndex:1};function l(){s.isLoading=!0,s.filters.reset(),s.filters.eq("Status",s.model.Status).eq("CustomerName",s.model.CustomerName),s.agrData&&s.agrData.AgreementId&&s.filters.eq("AgreementId",s.agrData.AgreementId),setTimeout(function(){s.isLoading=!1,e.$apply()},1e3)}function d(){if(s.model.CustomerId)var e=angular.copy(s.model.CustomerName);else if(s.CustomerNameTemp){e=angular.copy(s.CustomerNameTemp);s.CustomerNameTemp=""}o.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectCustomer.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:s.customer,customerName:e}})}s.attributesFilter=[u,{Type:"button",Label:"Search",onClick:d,CustomInputClass:s.agrData&&s.agrData.AgreementId?"disabled":null},{Type:"dropdown",Label:"Status:",ApiMethod:"statuses/statusbytype",Filter:s.FilterStatus,ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",CustomInputClass:"col-sm-8",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo"},{Type:"button",Label:"Search",onClick:l,CustomInputClass:"btn-primary"}],s.attributes=[{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Code",ValueName:"PMCode",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!0,Sortable:!0},{Name:"Agreement",ValueName:"AgreementAltId",Edit:!1,Sortable:!0},{Name:"Start Date",ValueName:"StartDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"End Date",ValueName:"EndDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"PM Last Date",ValueName:"LastDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0}],e.$on("CustomerNameSearching",function(e,t){s.model.CustomerId=null,s.customer.customerId=null}),s.CustomerNameTemp="",s.focusOut=function(e){e&&e.hasOwnProperty("FocusOut")&&e.FocusOut&&"CustomerName"===e.ModelValue&&(s.CustomerNameTemp=angular.copy(s.model.CustomerName),null==s.model.CustomerId&&(s.model.CustomerName=null))},e.$watch("vm.customer.customerId",function(){null!=s.customer.customerId&&s.customer.customerId>0&&(s.model.CustomerId=s.customer.customerId,s.model.CustomerName=s.customer.customerName)}),e.$watch("vm.model.Status",function(){void 0==s.model.Status&&(void 0==s.agrData?(s.model.Status="Active",l(),s.reloadTable=!0):s.model.CustomerName=s.agrData.CustomerName)}),e.$watch("vm.agrData",function(){void 0!=s.agrData?(s.model.CustomerName=s.agrData.CustomerName,s.customer.CustomerId=s.agrData.CustomerId,s.agreementText="for Agreement "+s.agrData.AgreementAltId,s.filters.reset(),s.filters.eq("AgreementId",s.agrData.AgreementId).eq("CustomerName",s.model.CustomerName),s.reloadTable=!0):s.agreementText=""})}angular.module("FieldConnectApp").controller("PMController",e),e.$inject=["$scope","$location","$state","ModalService","qsService","stateTransitionService"]}();;!function(){"use strict";function e(e,t,a,o,r,l,m,d,i,s,u,n){var c=this;if(c.FilterStatus={filterId:"PMStatus"},c.model={},c.submit=function(){if(!function e(t,a){var o=!0;if(void 0==t)return;for(var r=0;r!=t.length;r++)switch(t[r].Type){case"group":o=e(t[r].Attributes,a);break;case"line":case"empty":break;case"file":if(void 0!==c.files[t[r].Index])break;o=!1;default:if(t[r].Required)if(c.formValidation[t[r].ModelValue]||(c.formValidation[t[r].ModelValue]={}),"email"==t[r].Type)if(void 0===c.model[t[r].ModelValue]||""===c.model[t[r].ModelValue]||null===c.model[t[r].ModelValue])c.formValidation[t[r].ModelValue].Error=!0,c.formValidation[t[r].ModelValue].Required=!0,c.formValidation[t[r].ModelValue].Email=!1,o=!1;else{/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i.test(c.model[t[r].ModelValue])?(c.formValidation[t[r].ModelValue].Error=!1,c.formValidation[t[r].ModelValue].Email=!1,c.formValidation[t[r].ModelValue].Required=!1):(c.formValidation[t[r].ModelValue].Error=!0,c.formValidation[t[r].ModelValue].Email=!0,c.formValidation[t[r].ModelValue].Required=!1,o=!1)}else void 0===c.model[t[r].ModelValue]||""===c.model[t[r].ModelValue]||null===c.model[t[r].ModelValue]||c.model[t[r].ModelValue].constructor===Array&&!c.model[t[r].ModelValue].length?(a||c.formValidation[t[r].ModelValue].Dirty)&&(c.formValidation[t[r].ModelValue].Error=!0,o=!1):(c.formValidation[t[r].ModelValue].Error=!1,c.formValidation[t[r].ModelValue].Dirty=!0)}return o}(c.attributes,!0))return void l.warning({message:"Please fill in required fields!"});c.id?e.update("pm",c.model).then(function(e){e&&(l.success({message:"Preventative Maintenance successfully updated!"}),c.reloadTable=!1,s(function(){c.reloadTable=!0}))}):e.create("pm",c.model).then(function(e){e&&(l.success({message:"Preventative Maintenance successfully created!"}),s(function(){o.go("pmEdit",{id:e.data.Id}),n.location.reload()},2e3))})},c.generateWo=b,c.goBack=function(){c.$state.go("PM")},c.editSite=function(){i.showModal({templateUrl:"Templates/PM/pmSiteEdit.html",controller:"PMAddSiteController",controllerAs:"vm",inputs:{modalTitle:"PM site edit",agreementId:c.model.AgreementId,customerId:c.model.CustomerId,pmId:c.id,apiMethod:"pmsites"}}).then(function(e){e.close.then(function(){c.pmSiteFilter.Reload++,c.reloadTable=!1,s(function(){c.reloadTable=!0})})})},c.editServiceableItem=function(){i.showModal({templateUrl:"Templates/PM/pmServiceableItemEdit.html",controller:"PMAddServiceableItemController",controllerAs:"vm",inputs:{modalTitle:"PM Serviceable Item edit",agreementId:c.model.AgreementId,customerId:c.model.CustomerId,pmId:c.id,apiMethod:"pmserviceableitems"}}).then(function(e){e.close.then(function(){c.pmserviceableitemsFilter.Reload++,c.reloadTable=!1,s(function(){c.reloadTable=!0})})})},c.goToWo=function(e,t){o.go("workOrdersDetails",{id:e})},c.removeSA=function(e,t){c.reloadTable=!1,s(function(){c.reloadTable=!0})},c.formValidation={},c.pmserviceableitemsFilter=m.filter("and"),c.pmSiteFilter=m.filter("and"),c.woesFilter=m.filter("and"),c.$state=o,c.reloadTable=!0,c.$stateParams=r,c.customer={customerId:0},c.selectCustomer=C,c.filterStatus=m.filter("and"),c.filterStatus.eq("Status","Active"),c.customerFilter=m.filter("and"),c.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],c.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}],c.ddgCustomer={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:function(e){c.customer.customerId=e.Id,c.customer.customerName=e.CustomerName,c.customer.customerCode=e.CustomerCode,c.customer.customerCode&&""!=c.customer.customerCode?c.model.CustomerName=c.customer.customerCode+" - "+c.customer.customerName:c.model.CustomerName=c.customer.customerName},SearchTrigger:1,Label:"Customer:",Required:!0,ApiMethod:"customers/active",ModelValue:"CustomerName",Id:"CustomerName",GridAttributes:c.ddlgridattrsCustomer,PageSize:22,SearchCols:c.searchColsCustomer,TabIndex:2},c.PMTriggerAttr={Type:"dropdown",Label:"",CustomLabelClass:"label-align-right col-sm-3 col-md-4 col-lg-3",ApiMethod:"pmTrigger",Required:!0,ValueProp:"Id",TextProp:"Trigger",ModelValue:"PMTriggerId",Plural:!0},c.agrData=d.popTransitionParam("agreementData"),c.PMCode={Type:"text",Label:"PM Code:",MaxLength:"20",ModelValue:"PMCode",Autofocus:"true"},c.Status={Type:"dropdown",Label:"Status:",ApiMethod:"statuses/statusbytype",Filter:c.FilterStatus,ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status"},c.CustomerSearch={Type:"button",Label:"Search",onClick:C},c.Agreement={Type:"dropdown",Label:"Agreement:",ApiMethod:"agreements/getAgreementsByCustomerForPM",ValueProp:"Id",TextProp:"Desc",ModelValue:"AgreementId",ConvertToInt:"true",Filter:c.customerFilter,Required:!0},c.StartDate={Type:"datepicker",Label:"Start Date:",ModelValue:"StartDate",Format:"MM/dd/yy",SubType:"date",ReadOnly:!0},c.Description={Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc",Required:!0},c.EndDate={Type:"datepicker",Label:"End Date:",ModelValue:"EndDate",Format:"MM/dd/yy",SubType:"date",ReadOnly:!0},c.GenerateWOInterval={Type:"int",Label:"Generate WOs Every:",Required:!0,ModelValue:"PMTriggerValue"},c.LastWODate={Type:"datepicker",Label:"Last WO Date:",ModelValue:"LastDate",Format:"MM/dd/yy",SubType:"date",ReadOnly:!0},c.SeparateWOPerSI={Type:"checkbox",Label:"Separate WO per Serviceable Item",ModelValue:"PerServiceableItem"},c.Technician={Type:"dropdown",Label:"Technician:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"TechId",ConvertToInt:"true"},c.ProblemCode={Type:"dropdown",Label:"Problem Code:",Required:!0,ApiMethod:"problemcodes",ValueProp:"ProblemCodeName",TextProp:"ProblemCodeName",ModelValue:"ProblemCode"},c.WOType={Type:"dropdown",Label:"Work Order Type:",Required:!0,ApiMethod:"wotypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"WoType"},c.Priority={Type:"dropdown",Label:"Priority:",Required:!0,ApiMethod:"priorities",ValueProp:"PriorityName",TextProp:"PriorityName",ModelValue:"Priority"},c.GenerateWO={Type:"button",Label:"Generate Work Orders",onClick:b,CustomInputClass:"btn btn-primary table-edit-submit-btn",CustomDivClass:"col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right"},c.attributes=[c.PMCode,c.Status,c.ddgCustomer,c.CustomerSearch,c.Agreement,c.StartDate,c.Description,c.EndDate,c.GenerateWOInterval,c.LastWODate,c.PMTriggerAttr,{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},c.SeparateWOPerSI,{Type:"line",CustomClass:"col-sm-12"},{Type:"subheader",Label:"WO Defaults"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},c.Technician,c.ProblemCode,c.WOType,c.Priority,{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},c.GenerateWO],""!=r.id&&(c.id=parseInt(r.id)),t.$on("CustomerNameSearching",function(e,t){c.model.CustomerId=null,c.customer.customerId=null}),c.CustomerNameTemp="",c.focusOut=function(e){e&&e.hasOwnProperty("FocusOut")&&e.FocusOut&&"CustomerName"===e.ModelValue&&(c.CustomerNameTemp=angular.copy(c.model.CustomerName),null==c.model.CustomerId&&(c.model.CustomerName=null))},!c.id){var p=t.$watch("vm.PMTriggerAttr.CurrentList",function(e){if(e){c.model.PMTriggerValue=1;for(var t=0;t<e.length;t++)if("Month"==e[t].TriggerType){c.model.PMTriggerId=e[t].Id,p();break}}});c.GenerateWO.CustomInputClass="hidden"}function C(){var e="";if(c.model.CustomerId)e=angular.copy(c.model.CustomerName);else if(c.CustomerNameTemp){e=angular.copy(c.CustomerNameTemp);c.CustomerNameTemp=""}i.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectCustomer.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:c.customer,customerName:e}})}function b(){i.showModal({templateUrl:"Templates/PM/generateWoesModal.html",controller:"PMGenerateWoesController",controllerAs:"vm",inputs:{modalTitle:"PM site edit",agreementId:c.model.AgreementId,customerId:c.model.CustomerId,pmId:c.id,apiMethod:"wo"}}).then(function(e){e.close.then(function(){c.pmSiteFilter.Reload++,c.reloadTable=!1,s(function(){c.reloadTable=!0,n.location.reload()},1e3)})})}c.id&&(c.CustomerSearch.CustomDivClass="hidden",c.Agreement.ReadOnly=!0,c.ddgCustomer.ReadOnly=!0),t.$watch("vm.customer.customerId",function(){null!=c.customer.customerId&&c.customer.customerId>0&&(c.model.CustomerId=c.customer.customerId,c.model.CustomerName=c.customer.customerName,c.customerFilter.reset(),c.customerFilter.eq("Status","Active"),c.customerFilter.customerId=c.model.CustomerId)}),t.$watch("vm.model.CustomerId",function(){void 0!=c.model.CustomerId?(c.customerFilter.reset(),c.customerFilter.eq("Status","Active"),c.customerFilter.customerId=c.model.CustomerId):(c.customerFilter.reset(),c.customerFilter.eq("Status","Active"),c.customerFilter.customerId=0)}),t.$watch("vm.model.AgreementId",function(){void 0!=c.model.AgreementId?e.getItem("agreements",c.model.AgreementId).then(function(){var t=e.state.item,a=u.parseISOString(t.StartDate);a=u.convertToLocal(a),c.model.StartDate=a;var o=u.parseISOString(t.EndDate);o=u.convertToLocal(o),c.model.EndDate=o}):(c.model.StartDate="",c.model.EndDate="")}),c.id&&(c.pmSiteFilter.eq("PMId",c.id),c.pmserviceableitemsFilter.eq("PMId",c.id),c.woesFilter.eq("PMId",c.id)),t.$watch("vm.model.Status",function(){void 0==c.model.Status&&(c.id||(c.model.Status="Active")),void 0!=c.agrData&&(c.model.CustomerName=c.agrData.CustomerName,c.model.CustomerId=c.agrData.CustomerId,c.model.AgreementId=c.agrData.AgreementId)}),c.attributesSite=[{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0}],c.attributesSerItems=[{Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!1,Sortable:!0}],c.attributesWoes=[{Name:"Work Order",ValueName:"AltId",Edit:!0,Sortable:!0},{Name:"Wo Type",ValueName:"WoType",Edit:!1,Sortable:!0},{Name:"Promised Date",ValueName:"PromiseDate",FormatDate:"datetime",Edit:!1,Sortable:!0},{Name:"Time Zone",ValueName:"TimeZoneName",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!0},{Name:"Agreement",ValueName:"AgreementDesc",Edit:!1,Sortable:!0},{Name:"Subcontractor",ValueName:"CompanyName",Edit:!1,Sortable:!0},{Name:"Sub Bill",ValueName:"SubInvoiceAltId",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"InvoiceReportUrl"}],c.loadingIndicator=!1,t.$watch("vm.agrData",function(){void 0!=c.agrData&&(c.model.CustomerName=c.agrData.CustomerName,c.model.CustomerId=c.agrData.CustomerId,c.model.AgreementId=c.agrData.AgreementId)}),c.siteSearch=function(){c.id&&(c.pmSiteFilter.reset(),c.pmSiteFilter=m.filter("and"),c.pmSiteFilter.eq("PMId",c.id),c.pmSiteFilter.eq("Search",c.siteSearchText))},c.siSearch=function(){c.id&&(c.pmserviceableitemsFilter.reset(),c.pmserviceableitemsFilter=m.filter("and"),c.pmserviceableitemsFilter.eq("PMId",c.id),c.pmserviceableitemsFilter.eq("Search",c.siSearchText))},c.attributesTasks=[{Name:"Standard Task",ValueName:"TaskCode",Edit:!1,Sortable:!0},{Name:"Task Name",ValueName:"TaskName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Description",Edit:!1,Sortable:!0},{Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!1,Sortable:!0}],c.editTasks=function(){c.pmFilter=m.filter("and"),c.pmFilter.eq("pmId",c.id),e.getItems("agreementtasks/getForPM",c.pmFilter).then(function(e){c.taskItems=e.data.Data,0===c.taskItems.length?l.warning("All Tasks have been added or No Tasks are available!"):i.showModal({templateUrl:"Templates/Agreements/addAgreementTaskModal.html",controller:"PMAddAgreementTaskController",controllerAs:"vm",inputs:{pmId:c.id,model:c.taskItems,title:"PM Tasks"}}).then(function(e){e.close.then(function(e){e&&(c.reloadTable=!1,s(function(){c.reloadTable=!0}))})})})}}angular.module("FieldConnectApp").controller("PMEditController",e),e.$inject=["restService","$scope","$location","$state","$stateParams","Notification","qsService","stateTransitionService","ModalService","$timeout","timezoneService","$window"]}();;!function(){"use strict";function e(e,t,a,s,r,o,n,i,c,l,u,d,m,f,v,g,T,h){var k=this;k.isActive=!1;var A=i.getValue("authorizationData").userRoles.split(","),p=!1,S=v.roleTypes,$=e.pmId,C={PMId:parseInt($),PMTasks:[]};k.title=e.title,k.agreementTasks=e.model,k.customerRoles=!1;for(var I=0;I<A.length;I++)if("CustAdmin"!==A[I]&&"Cust"!==A[I]||(k.customerRoles=!0),"Technician"===S[I]||"SubContractor"===A[I]){p=!0;break}function b(t){e.close(t,200)}k.modalClass=!1,o(function(){k.modalClass=!0}),k.isTech=p,k.$state=a,k.moduleName="AgreementTask",k.cancel=b,k.showAvailableAgreementTasks=!0,k.addAll=function(){for(var e=0;e<k.agreementTasks.length;e++)k.agreementTasks[e].Add=!k.addAllItems},k.onSubmit=function(){var e=T("filter")(k.agreementTasks,{Add:!0});if(0!==e.length){for(var t=0;t<e.length;t++)C.PMTasks.push(e[t].Id);n.create("pmtasks",C).then(function(e){b(e)})}else u.error("No Tasks Items have been selected!")}}angular.module("FieldConnectApp").controller("PMAddAgreementTaskController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","$timeout","restService","cryptoStorageService","qsService","stateTransitionService","Notification","$window","currentUserService","$rootScope","rolesFactory","featuresFactory","$filter","fcGeoLocationService"]}();;!function(){"use strict";function e(e,t,l,r,i,a,d,s){var m=this;m.modelServiceableItems={},m.$state=l,m.close=function(){m.modalClass=!1,e.close(null,50)},m.agreementId=e.agreementId,m.serviceableItemFilter=a.filter("and"),m.id=e.customerId,m.pmId=parseInt(e.pmId),m.modelServiceableItems.PMId=null,null!=m.id&&m.serviceableItemFilter.eq("CustomerId",m.id).eq("AgreementId",m.agreementId).eq("PMId",m.pmId),m.attributesEditServiceableItem=[{Type:"multiselect",Label:"ServiceableItem",ApiMethod:"serviceableitems/getServiceableItemsForPM",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ListServiceableItemIds",Filter:m.serviceableItemFilter}],m.reloadTable=!0,m.modelServiceableItems.PMId=m.pmId}angular.module("FieldConnectApp").controller("PMAddServiceableItemController",e),e.$inject=["$scope","$location","$state","ModalService","$stateParams","qsService","stateTransitionService","restService"]}();;!function(){"use strict";function e(e,t,i,l,d,s,r){var o=this;o.modelSites={},o.$state=i,o.close=function(){o.modalClass=!1,e.close(null,50)},o.agreementId=e.agreementId,o.siteFilter=s.filter("and"),o.id=e.customerId,o.pmId=parseInt(e.pmId),o.modelSites.PMId=null,null!=o.id&&o.siteFilter.eq("CustomerId",o.id).eq("AgreementId",o.agreementId).eq("PMId",o.pmId),o.attributesEditSite=[{Type:"multiselect",Label:"Site",ApiMethod:"sites/getSitesForPM",ValueProp:"Id",TextProp:"SiteName",ModelValue:"ListSitesIds",Filter:o.siteFilter}],o.reloadTable=!0,o.modelSites.PMId=o.pmId}angular.module("FieldConnectApp").controller("PMAddSiteController",e),e.$inject=["$scope","$location","$state","ModalService","$stateParams","qsService","stateTransitionService"]}();;!function(){"use strict";function e(e,t,a,r,o,l,d,m,n,i,s,g){var u=this;u.model={},u.$state=a,u.close=function(){u.modalClass=!1,e.close(null,50)},u.agreementId=e.agreementId,u.siteFilter=l.filter("and"),u.id=e.customerId,u.generateWoes=function(){return g.getLocation("PMGenerateWorkOrders").then(function(t){if(u.model.FromDate.getTime()>=u.model.ToDate.getTime()||u.model.FromDate.getTime()<new Date(u.model.StartDate).getTime()||u.model.ToDate.getTime()>new Date(u.model.EndDate).getTime())n.error({message:"Invalid date range!"});else{var a={PMId:[],FromDate:null,ToDate:null};u.loadingData=!0,a.PMId.push(u.model.PMId),a.FromDate=u.model.FromDate,a.ToDate=u.model.ToDate;var r=t.coords.latitude,o=t.coords.longitude;null!==r&&(a.Latitude=r),null!==o&&(a.Longitude=o),m.create("wo/pm",a).then(function(t){t&&(n.success({message:t.data.generatedWoesNum+" PM Work Orders successfully created."}),t.data.syncCalendarResult&&n.success({message:t.data.syncCalendarResult})),u.loadingData=!1,u.modalClass=!1,e.close(null,50)})}})},u.pmId=parseInt(e.pmId),u.PMTriggerValue=parseInt(e.PMTriggerValue),u.model.PMId=null,u.loadingData=!1,null!==u.id&&u.siteFilter.eq("CustomerId",u.id).eq("AgreementId",u.agreementId).eq("PMId",u.pmId),u.attributesGenerateWoesPopup=[{Type:"datepicker",Label:"Start Date:",Required:!0,ModelValue:"FromDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"datepicker",Label:"End Date:",Required:!0,ModelValue:"ToDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"datepicker",Label:"Agreement Start Date:",ModelValue:"StartDate",Format:"MM/dd/yy",SubType:"date",ReadOnly:!0},{Type:"datepicker",Label:"Agreement End Date:",ModelValue:"EndDate",Format:"MM/dd/yy",SubType:"date",ReadOnly:!0},{Type:"text",Label:"Every",Required:!1,ModelValue:"PMTriggerValue",ReadOnly:!0}],u.reloadTable=!0,u.model.PMId=u.pmId;var c={},D={};m.getItem("pm",u.pmId).then(function(){c=m.state.item,u.model.PMTriggerValue=c.PMTriggerValue,m.getItem("agreements",u.agreementId).then(function(){D=m.state.item;var e=i.parseISOString(D.StartDate);e=i.convertToLocal(e);var t=i.parseISOString(D.EndDate);t=i.convertToLocal(t),u.model.StartDate=e,u.model.EndDate=t;var a=new Date;a=i.parseISOString(a.toISOString());var r=i.convertToLocal(a);if(c.LastDate){var o=i.parseISOString(c.LastDate);(o=i.convertToLocal(o)).getTime()>r.getTime()?u.model.FromDate=o:u.model.FromDate=r}else e.getTime()>r.getTime()?u.model.FromDate=e:u.model.FromDate=r;if(null!==c.LastDate)switch(c.Trigger){case"Year":u.model.FromDate.setFullYear(u.model.FromDate.getFullYear()+u.model.PMTriggerValue);break;case"Month":u.model.FromDate.setMonth(u.model.FromDate.getMonth()+u.model.PMTriggerValue);break;case"Week":u.model.FromDate.setDate(u.model.FromDate.getDate()+7*u.model.PMTriggerValue);break;case"Day":u.model.FromDate.setDate(u.model.FromDate.getDate()+u.model.PMTriggerValue)}u.model.ToDate=new Date(u.model.FromDate),u.model.ToDate.setDate(u.model.ToDate.getDate()+30);var l=u.model.PMTriggerValue+" "+c.Trigger+"(s)";u.model.PMTriggerValue=l})})}angular.module("FieldConnectApp").controller("PMGenerateWoesController",e),e.$inject=["$scope","$location","$state","ModalService","$stateParams","qsService","stateTransitionService","restService","Notification","timezoneService","cryptoStorageService","fcGeoLocationService"]}();;!function(){"use strict";function e(e,t,a,r,i,l,o,n,d){var m=this;m.$state=t,m.viewName="Payment",m.moduleName="PaymentGrid",m.loadScopes=!1,m.filterBy={UserId:0,StartDate:null,EndDate:null},m.filter=a.filter("and"),d.getCurrentUserData().then(function(e){m.isLoading=!0,m.UserData=e,o.getCompanySettings().then(function(e){var t=n.getValue("lastpaymentfilter_"+m.UserData.Id);t?(m.filterBy.StartDate=t.StartDate,m.filterBy.EndDate=t.EndDate):(m.viewWorkOrdersDaysBack=o.getViewWorkOrdersDaysBack,m.viewWorkOrdersDaysForward=o.getViewWorkOrdersDaysForward,m.filterBy.StartDate=moment(m.currentDate).add(-1*m.viewWorkOrdersDaysBack,"days").format("MM/DD/YYYY"),m.filterBy.EndDate=moment(m.currentDate).add(m.viewWorkOrdersDaysForward,"days").format("MM/DD/YYYY")),m.attributes=[{Name:"Work Order",ValueName:"AltId",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Promise Date",ValueName:"PromiseDate",Edit:!1,Sortable:!0,FormatDate:"datetime"}],m.filterattributesFilter=[{Type:"datepicker",Label:"From:",ModelValue:"StartDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"datepicker",Label:"To:",ModelValue:"EndDate",Format:"MM/dd/yyyy",SubType:"date"}],m.search(),m.loadScopes=!0,m.isLoading=!1})}),m.search=function(){if(m.filterBy.EndDate<m.filterBy.StartDate)return i.warning({message:"To Date cannot be before From Date!"}),void(m.filterBy.EndDate=null);var e=null,t=null;null!==m.filterBy.StartDate&&(e=l.searchDateToUTC(m.filterBy.StartDate,"from")),null!==m.filterBy.EndDate&&(t=l.searchDateToUTC(m.filterBy.EndDate,"to")),m.filter.reset(),m.filter.eq("StartDate",r.buildISOString(e)),m.filter.eq("EndDate",r.buildISOString(t)),m.filterBy.StartDate=moment(m.filterBy.StartDate).format("MM/DD/YYYY"),m.filterBy.EndDate=moment(m.filterBy.EndDate).format("MM/DD/YYYY"),n.setValue("lastpaymentfilter_"+m.UserData.Id,m.filterBy)},m.submitPayment=function(){t.go("paymentTableEdit",{id:m.woScopeId})}}angular.module("FieldConnectApp").controller("PaymentController",e),e.$inject=["$scope","$state","qsService","timezoneService","Notification","dateService","currentCompanyService","cryptoStorageService","currentUserService"]}();;!function(){"use strict";function e(e,t,a,o,n,i,l,m,r,d){var u=this;function c(e){r.processRefund(e,u.transactionList).then(function(e){e&&m(function(){y()})})}function s(e){r.emailReceipt(e,u.model).then(function(e){})}function y(){r.updateSettlementStatus(u.woId).then(function(e){u.reloadTable=!1,m(function(){u.reloadTable=!0})})}function N(){e.$broadcast("clearValidationErrors"),u.model=r.clearModel(u.model)}u.$state=t,u.viewName="Payment",u.moduleName="PaymentEdit",u.woId=l.id,u.filter=a.filter("and"),u.filter.eq("WoId",u.woId),u.updateSettlementStatus=y,u.onBack=function(){b(),t.go("paymentTable")},u.onSubmit=function(){r.submitPayment(u.model).then(function(e){e&&(N(),m(function(){y()}))})},u.reloadTable=!0,u.transactionCount=-1,u.transactionList=[],u.isLoading=!1,u.filterByWorkOrder=a.filter("and"),u.filterByWorkOrder.eq("WoId",u.woId),u.filterByWorkOrder.eq("Desc","Payment Receipt"),u.model={WoId:u.woId},u.editAttributes=r.getPaymentAttributes(),u.attributes=[{Name:"Reference No",ValueName:"ReferenceNumber",Edit:!1,Sortable:!0},{Name:"Transaction Type",ValueName:"TransactionType",Edit:!1,Sortable:!0},{Name:"Amount",ValueName:"Amount",Edit:!1,Sortable:!0},{Name:"Request Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Settlement Status",ValueName:"SettlementStatus",Edit:!1,Sortable:!0},{Name:"Settlement Date",ValueName:"SettlementDate",Edit:!1,Sortable:!0},{Name:"Response",ValueName:"ResponseText",Edit:!1,Sortable:!0},{Name:"Capture Date",ValueName:"CaptureDate",Edit:!1,Sortable:!0},{Name:"Action",CellFormat:"button",CellFormatData:{Text:"Refund",onClick:c}}],u.filterattributesFilter=[{Type:"datepicker",Label:"From:",ModelValue:"StartDate",Format:"MM/dd/yyyy",SubType:"date"},{Type:"datepicker",Label:"To:",ModelValue:"EndDate",Format:"MM/dd/yyyy",SubType:"date"}],u.attributesWoatt=[{Name:"Date",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0},{Name:"Attached To",ValueName:"AttachedTo",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Action",CellFormat:"button",CellFormatData:{Text:"Email Receipt",onClick:s}}],u.isLoading=!0,m(function(){u.modalClass=!0,r.getPaymentBillingDetails(u.woId).then(function(e){m(function(){u.model.Amount=e.Amount,u.model.CardHolder=e.ContactName,u.model.CardHolderEmail=e.ContactEmail,u.model.PostalCode=e.PostalCode,u.isLoading=!1})},function(e){u.isLoading=!1})}),e.$on("$destroy",function(){e.$broadcast("destroyPaymentListener")});var f=e.$watch("vm.transactionCount",function(){-1!==u.transactionCount&&(u.transactionCount>0&&y(),f())}),b=e.$watch("vm.model.PaymentType",function(e,t){e!==t&&(null==u.model.PaymentType?u.model.PaymentType="cc":u.model.PaymentType&&(N(),u.editAttributes=r.getPaymentAttributes(u.model.PaymentType)))})}angular.module("FieldConnectApp").controller("PaymentEditController",e),e.$inject=["$scope","$state","qsService","timezoneService","Notification","dateService","$stateParams","$timeout","fcPaymentService","restService"]}();;!function(){"use strict";function e(e,o){var i=this;i.$scope=e,i.attributes=e.attributes,i.id=e.id,i.apiMethod=e.apiMethod,i.timezone=e.timezone,i.customFocus=e.customFocus,i.viewName=e.viewName,i.moduleName=e.moduleName,i.filter=e.filter,i.modalClass=!1,i.model=e.model,o(function(){i.modalClass=!0}),i.hideSubmit=!1,e.hideSubmit&&(i.hideSubmit=e.hideSubmit),i.onBack=function(o){if(e.onBack&&!e.onBack(o))return;i.modalClass=!1,e.close(o,200)},e.$watch("vm.model",function(e,t){if(t){var a=t.CardHolder,l=t.CardHolderEmail;o(function(){i.model.CardHolder=a,i.model.CardHolderEmail=l})}})}angular.module("FieldConnectApp").controller("PaymentReceiptEmailModalController",e),e.$inject=["$scope","$timeout"]}();;!function(){"use strict";function e(e,t,a,o,r,s,l,i,m){var d=this;d.model={},d.goHome=function(){a.go("home")},d.goToProjectEdit=function(){a.go("projectEdit",{id:d.id})},d.goToProjects=function(){a.go("projects")},d.getWoes=c,d.id=s.id,d.woes=[],d.checkWo=function(e){-1===d.woes.indexOf(e.Id)?d.woes.push(e.Id):d.woes.splice(d.woes.indexOf(e.Id),1)},d.addToProject=function(){var e={WoesIds:d.woes};m.update("wo/addProjectToWoes/"+d.id,e).then(function(){a.go("projectEdit",{id:d.id}),i.success({message:"Work orders has been successfully aded to project."})})},d.toggleSort=function(e,t){if(!t)return;d.args.sortCol!=e?(d.args.sortCol=e,d.args.sortDir="asc"):"asc"==d.args.sortDir?d.args.sortDir="desc":d.args.sortDir="asc";c()},d.filterStatus={filterId:"ProjectStatus"},d.loadingData=!1,d.args={page:1,pageSize:10,sortCol:"",sortDir:"asc",status:"",promisedDateStart:null,promisedDateEnd:null};var n={};function c(){d.loadingData=!0,function(){if(""!=d.promisedDateStart&&null!=d.promisedDateStart){var e=new Date(d.promisedDateStart);e.setHours(0,0,0,0);var t=new Date(e);r.convertToUtc(t),d.args.promisedDateStart=r.buildISOString(t)}else d.args.promisedDateStart=null;if(""!=d.promisedDateEnd&&null!=d.promisedDateEnd){var a=new Date(d.promisedDateEnd);a.setHours(23,59,59,999);var o=new Date(a);r.convertToUtc(o),d.args.promisedDateEnd=r.buildISOString(o)}else d.args.promisedDateEnd=null}(),d.woesFilter=o.filter("and"),d.woesFilter.page=d.args.page,d.woesFilter.pageSize=d.args.pageSize,d.woesFilter.sortCol=d.args.sortCol,d.woesFilter.sortDir=d.args.sortDir,d.woesFilter.eq("ProjectId",d.id).eq("woTypeName",d.model.WoTypeName).eq("CustomerId",d.model.CustomerId).eq("Status",d.model.WoStatusName).eq("SubcontractorId",d.model.SubcontractorId).eq("AltId",d.model.AltId).eq("StartDate",d.args.promisedDateStart).eq("EndDate",d.args.promisedDateEnd),m.getItems("wo/forProject",d.woesFilter).then(function(){d.items=m.state.items,d.itemsMeta=m.state.itemsMeta;for(var e=0;e<d.items.length;e++){var t=r.parseISOString(d.items[e].PromiseDate);d.items[e].PromiseDate=r.convertToLocal(t)}d.loadingData=!1})}(n=o.filter("and")).eq("Status","Active"),d.attributesFilter=[{Type:"dropdown",Label:"Customer:",ApiMethod:"customers",ValueProp:"Id",TextProp:"CustomerName",ModelValue:"CustomerId",ConvertToInt:"true"},{Type:"dropdown",Label:"Wo Type:",ApiMethod:"woTypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"WoTypeName"},{Type:"dropdown",Label:"Status:",ApiMethod:"wostatuses",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"WoStatusName"},{Type:"int",Label:"Work Order:",ModelValue:"AltId"},{Type:"dropdown",Label:"Subcontractor:",ApiMethod:"subcontractorCompanies",Filter:n,ValueProp:"SubcontractorId",TextProp:"CompanyName",ModelValue:"SubcontractorId",ConvertToInt:"true"}],d.attributes=[{Name:"Work Order",ValueName:"AltId",Sortable:!0},{Name:"WO Type",ValueName:"WoType",CellFormat:"label",Sortable:!0},{Name:"Promise Date",ValueName:"PromiseDate",Sortable:!0,FormatDate:!0},{Name:"Site",ValueName:"SiteName",CellFormat:"label",Sortable:!0},{Name:"Description",ValueName:"Desc",CellFormat:"label",Sortable:!0},{Name:"Customer",ValueName:"CustomerName",CellFormat:"label",Sortable:!0},{Name:"Status",ValueName:"Status",CellFormat:"label",Sortable:!0},{Name:"Subcontractor",ValueName:"SubcontractorId",CellFormat:"label",Sortable:!0},{Name:"Office",ValueName:"OfficeName",CellFormat:"label",Sortable:!0},{Name:"Customer",ValueName:"CustomerName",CellFormat:"label",Sortable:!0}],d.promisedDateStart=new Date,d.promisedDateEnd=new Date,d.project={},m.getItem("projects",d.id).then(function(){d.project=m.state.item;for(var e=0;e<d.items.length;e++){var t=r.parseISOString(d.items[e].PromiseDate);d.items[e].PromiseDate=r.convertToLocal(t)}}),c(),e.$watch("vm.args.page",function(){c()}),d.firstWatchFix=!0,e.$watch("vm.args.pageSize",function(){d.firstWatchFix?d.firstWatchFix=!1:(1==d.args.page&&c(),d.args.page=1)})}angular.module("FieldConnectApp").controller("ProjectAddWoController",e),e.$inject=["$scope","$location","$state","qsService","timezoneService","$stateParams","ModalService","Notification","restService"]}();;!function(){"use strict";function t(t,e,a,r,l,i,o,m,d,u){var f=this;f.goHome=function(){a.go("home")},f.edit=function(t){a.go("projectEdit",{id:t})},f.go=function(t,e){i.setTransitionParam("project",{}),a.go("workOrdersDetails",{id:t})},f.isLoading=!1,f.reloadData=function(){if(f.filter.fromDate&&(f.filter.fromDate=new Date(f.filter.fromDate),!u.validateDate(f.filter.fromDate)))return;if(f.filter.toDate&&(f.filter.toDate=new Date(f.filter.toDate),!u.validateDate(f.filter.toDate)))return;if(f.filter.fromDate&&f.filter.toDate&&!u.validateDateRange(f.filter.fromDate,f.filter.toDate))return;f.isLoading=!0,f.filter.fromEstimatedDate=null,f.filter.toEstimatedDate=null,f.filter.fromActualDate=null,f.filter.toActualDate=null,"Estimated"==f.filter.date?(f.filter.fromEstimatedDate=f.filter.fromDate,f.filter.toEstimatedDate=f.filter.toDate):(f.filter.fromActualDate=f.filter.fromDate,f.filter.toActualDate=f.filter.toDate);if(""!=f.filter.fromEstimatedDate&&null!=f.filter.fromEstimatedDate){f.filter.fromEstimatedDate=new Date(f.filter.fromEstimatedDate),f.filter.fromEstimatedDate.setHours(0,0,0,0);var e=new Date(f.filter.fromEstimatedDate);l.convertToUtc(e),f.filter.fromEstimatedDate=l.buildISOString(e)}if(""!=f.filter.toEstimatedDate&&null!=f.filter.toEstimatedDate){f.filter.toEstimatedDate=new Date(f.filter.toEstimatedDate),f.filter.toEstimatedDate.setHours(23,59,59,999);var a=new Date(f.filter.toEstimatedDate);l.convertToUtc(a),f.filter.toEstimatedDate=l.buildISOString(a)}if(""!=f.filter.fromActualDate&&null!=f.filter.fromActualDate){f.filter.fromActualDate=new Date(f.filter.fromActualDate),f.filter.fromActualDate.setHours(0,0,0,0);var r=new Date(f.filter.fromActualDate);l.convertToUtc(r),f.filter.fromActualDate=l.buildISOString(r)}if(""!=f.filter.toActualDate&&null!=f.filter.toActualDate){f.filter.toActualDate=new Date(f.filter.toActualDate),f.filter.toActualDate.setHours(23,59,59,999);var i=new Date(f.filter.toActualDate);l.convertToUtc(i),f.filter.toActualDate=l.buildISOString(i)}""==f.filter.searchByAltId&&(f.filter.searchByAltId=null);f.filterProjects.reset(),f.filterProjects.eq("ProjectName",f.filter.searchByName).eq("AltId",f.filter.searchByAltId).eq("CustomerId",f.filter.customerId).eq("EstStartDate",f.filter.fromEstimatedDate).eq("EstEndDate",f.filter.toEstimatedDate).eq("ActualStartDate",f.filter.fromActualDate).eq("ActualEndDate",f.filter.toActualDate),setTimeout(function(){f.isLoading=!1,t.$apply()},1e3)},f.deleteProject=function(t){o.remove("projects",t.Id).then(function(){f.reloadTable=!1,m(function(){f.reloadTable=!0})})},f.deviceDetect=d,f.items=[],f.filterProjects=r.filter("and"),f.filter={date:"Estimated",fromDate:null,toDate:null},f.isLoading=!0,f.reloadTable=!0,f.dateService=u,f.attributes=[{Name:"Project Id",ValueName:"AltId",Edit:!1,Sortable:!0},{Name:"Project Name",ValueName:"ProjectName",Edit:!0,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Estimated Start Date",ValueName:"EstStartDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"Estimated End Date",ValueName:"EstEndDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"Actual Start Date",ValueName:"ActualStartDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"Actual End Date",ValueName:"ActualEndDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0}],f.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],f.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}],f.attributeCustomer={Type:"dropdowngrid",FocusOut:!0,ShowHeader:!0,onSelect:function(t){f.filter.customerId=t.Id,f.filter.CustomerName=t.CustomerName},SearchTrigger:1,ApiMethod:"customers/active",ModelValue:"CustomerName",Id:"CustomerName",GridAttributes:f.ddlgridattrsCustomer,PageSize:22,SearchCols:f.searchColsCustomer,Autofocus:"true",TabIndex:1},f.drilldownFilter=r.filter("and"),f.drilldownSettings={ApiMethod:"wo",FilterFields:{ProjectId:"Id"},attributes:[{Name:"Work Order",ValueName:"AltId",Edit:!1,Sortable:!0,CellFormat:"link"},{Name:"WO Type",ValueName:"WoType",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Promised Date",ValueName:"PromiseDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!0},{Name:"Agreement",ValueName:"AgreementDesc",Edit:!1,Sortable:!0}]},setTimeout(function(){f.isLoading=!1,t.$apply()},1e3)}angular.module("FieldConnectApp").controller("ProjectController",t),t.$inject=["$scope","$location","$state","qsService","timezoneService","stateTransitionService","restService","$timeout","deviceDetector","dateService"]}();;!function(){"use strict";function e(e,t,o,a,m,l,r,s,d,u,i){var c=this;c.model={},c.goHome=function(){o.go("home")},c.selectCustomer=p,c.selectSite=b,c.go=function(e,t){var a={id:c.model.Id,projectName:c.model.ProjectName};i.setTransitionParam("project",a),o.go("workOrdersDetails",{id:e})},c.goToProjects=function(){o.go("projects")},c.addWoes=function(){o.go("addWoProject",{id:c.id})},c.editResult=function(e){e?c.id?s.success({message:"Project has been successfully updated."}):(o.go("projectEdit",{id:e.Id}),s.success({message:"Project has been successfully created."})):o.go("projects")},c.removeProjectFromWo=function(e){d.update("wo/removeProjectFromWo/"+e.Id).then(function(){c.loadTable=!1,u(function(){c.loadTable=!0})})},c.customer={customerId:0},c.customers=[],c.site={siteId:0},c.id=l.id,c.filterStatus={filterId:"ProjectStatus"},c.woesFilter=a.filter("and"),c.customerFilter=a.filter("and"),c.customerSiteFilter=a.filter("and"),c.woesFilter.eq("ProjectId",c.id),c.CustomerNameTemp="",c.SiteNameTemp="",c.loadTable=!1;var n={Type:"button",Label:"Search",onClick:p},C={Type:"button",Label:"Search",onClick:b};function S(e){e.CustomerCode&&""!=e.CustomerCode?c.model.CustomerName=e.CustomerCode+" - "+e.CustomerName:c.model.CustomerName=e.CustomerName,c.CustomerNameTemp=c.model.CustomerName,c.model.CustomerId=e.Id,c.model.SiteId=null,c.model.SiteName=null,c.SiteNameTemp=null}function N(t){t.SiteCode&&""!=t.SiteCode?c.model.SiteName=t.SiteCode+" - "+t.SiteName:c.model.SiteName=t.SiteName,c.SiteNameTemp=c.model.SiteName,c.model.SiteId=t.Id,c.model.OfficeId=t.OfficeId,d.getItem("sites/",t.Id).then(function(){var t=d.state.item,o=cryptoStorageService.getValue("authorizationData");o&&o.tzDatebaseName&&(c.tzName=o.tzDatebaseName,c.userTimeZone=moment.tz(c.tzName).zoneAbbr()),t.TimeZoneId?d.getItem("timezones/",t.TimeZoneId).then(function(){c.model.TzDatabaseName=o.tzDatebaseNamee}):c.model.OfficeId?d.getItem("offices/",c.model.OfficeId).then(function(){var e=d.state.item;e.TimeZoneId?d.getItem("timezones/",e.TimeZoneId).then(function(){c.model.TzDatabaseName=o.tzDatebaseNamee}):c.model.TzDatabaseName=o.tzDatebaseName}):c.model.TzDatabaseName=o.tzDatebaseName,(!c.model.CustomerId||0===c.model.CustomerId&&t.CustomerId)&&d.getItem("customers/",t.CustomerId).then(function(){var t=d.state.item;t.CreditHold?bootbox.confirm("The customer "+t.CustomerName+" is on credit hold!",function(o){u(function(){o&&(c.model.CustomerId=t.Id,t.CustomerCode&&""!=t.CustomerCode?c.model.CustomerName=t.CustomerCode+" - "+t.CustomerName:c.model.CustomerName=t.CustomerName,c.CustomerNameTemp=c.model.CustomerName),e.$apply()})}):(c.model.CustomerId=t.Id,t.CustomerCode&&""!=t.CustomerCode?c.model.CustomerName=t.CustomerCode+" - "+t.CustomerName:c.model.CustomerName=t.CustomerName,c.CustomerNameTemp=c.model.CustomerName)})})}if(c.siteAutocompleteFilter=a.filter("or"),c.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],c.searchColsSite=["Search"],c.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}],c.ddlgridattrsSite=[{Name:"Customer",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Site Code",ValueName:"SiteCode",Sortable:!0,CellFormat:"label"},{Name:"Site Name",ValueName:"SiteName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"FullAddress",Sortable:!0,CellFormat:"label"}],c.ddgCustomer={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:S,SearchTrigger:1,Label:"Customer:",Required:!0,ApiMethod:"customers/active",ModelValue:"CustomerName",Id:"CustomerName",GridAttributes:c.ddlgridattrsCustomer,PageSize:22,SearchCols:c.searchColsCustomer,TabIndex:"2"},c.ddgSite={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:N,SearchTrigger:1,Label:"Site:",Required:!0,ApiMethod:"sites/searchgrid",ModelValue:"SiteName",filter:c.siteAutocompleteFilter,Id:"SiteName",GridAttributes:c.ddlgridattrsSite,PageSize:22,SearchCols:c.searchColsSite,TabIndex:"3"},c.attributes=[{Type:"text",Label:"Project Id:",ReadOnly:!0,ModelValue:"AltId",TabIndex:"0"},{Type:"textarea",Label:"Description:",Required:!1,MaxLength:"200",ModelValue:"Desc",TabIndex:"7"},{Type:"text",Label:"Project Name:",Required:!0,MaxLength:"50",ModelValue:"ProjectName",Autofocus:"true",TabIndex:"1"},{Type:"dropdown",Label:"Status:",ApiMethod:"statuses/statusbytype",Filter:c.filterStatus,ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",Required:!0,TabIndex:"8"},c.ddgCustomer,n,c.ddgSite,C,{Type:"datepicker",Label:"Estimated Start Date:",ModelValue:"EstStartDate",Format:"MM/dd/yyyy",TabIndex:"4"},{Type:"datepicker",Label:"Actual Start Date:",ModelValue:"ActualStartDate",Format:"MM/dd/yyyy",TabIndex:"9"},{Type:"datepicker",Label:"Estimated End Date:",ModelValue:"EstEndDate",Format:"MM/dd/yyyy",TabIndex:"5"},{Type:"datepicker",Label:"Actual End Date:",ModelValue:"ActualEndDate",Format:"MM/dd/yyyy",TabIndex:"10"},{Type:"dropdown",Label:"Office:",ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true",TabIndex:"6"},{Type:"text",Label:"External Id:",MaxLength:"50",ModelValue:"ExternalId",TabIndex:"11"}],c.attributesWo=[{Name:"Work Order",ValueName:"AltId",Edit:!1,Sortable:!0,CellFormat:"link"},{Name:"WO Type",ValueName:"WoType",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Promised Date",ValueName:"PromiseDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!0},{Name:"Agreement",ValueName:"AgreementDesc",Edit:!1,Sortable:!0}],e.$on("CustomerNameSearching",function(e,t){c.model.CustomerId=null,c.model.SiteId=null,c.model.SiteName=null,c.SiteNameTemp=null}),e.$on("SiteNameSearching",function(e,t){c.model.SiteId=null}),c.focusOut=function(e){e&&e.hasOwnProperty("FocusOut")&&e.FocusOut&&("CustomerName"===e.ModelValue&&(c.CustomerNameTemp=angular.copy(c.model.CustomerName),null==c.model.CustomerId&&(c.model.CustomerName=null)),"SiteName"===e.ModelValue&&(c.SiteNameTemp=angular.copy(c.model.SiteName),null==c.model.SiteId&&(c.model.SiteName=null)))},!parseInt(l.id))var I=e.$watch("vm.model.Status",function(){c.model&&null===c.model.Status&&(c.model.Status="Active",I())});function p(){var e="";if(c.model.CustomerId)e=angular.copy(c.model.CustomerName);else if(c.CustomerNameTemp){e=angular.copy(c.CustomerNameTemp);c.CustomerNameTemp=""}r.showModal({templateUrl:"Templates/Projects/selectCustomer.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:c.customer,customerName:e,onSelect:S}})}function b(){var e="";if(c.model.SiteId)e=angular.copy(c.model.SiteName);else if(c.SiteNameTemp){e=angular.copy(c.SiteNameTemp);c.SiteNameTemp=""}r.showModal({templateUrl:"Templates/Projects/selectSite.html",controller:"SelectSiteController",controllerAs:"vm",inputs:{site:c.site,customerId:c.model.CustomerId,siteName:e,onSelect:N}})}c.id&&(c.loadTable=!0),e.$watch("vm.model.Id",function(){c.model.Id&&(c.customer.customerId=c.model.CustomerId,c.site.siteId=c.model.SiteId,c.customer.customerName=c.model.CustomerName,c.site.siteName=c.model.SiteName)}),e.$watch("vm.model.SiteId",function(){if(c.model.SiteId){for(var e=0;e<c.customerSiteFilter.filter.length;e++){"SiteId"==c.customerSiteFilter.filter[e].split(":")[0]&&c.customerSiteFilter.filter.splice(e,1)}c.customerSiteFilter.eq("SiteId",c.model.SiteId).eq("SiteId","null")}}),e.$watch("vm.model.CustomerId",function(){c.siteAutocompleteFilter.reset(),c.model.CustomerId?(c.customerSiteFilter.reset(),c.customerFilter.reset(),c.customerFilter.eq("Status","Active"),c.customerFilter.customerId=c.model.CustomerId,c.customerSiteFilter.eq("CustomerId",c.model.CustomerId).eq("CustomerId","null"),c.siteAutocompleteFilter.eq("CustomerId",c.model.CustomerId)):(c.customerFilter.reset(),c.customerFilter.eq("Status","Active"),c.customerFilter.customerId=0)})}angular.module("FieldConnectApp").controller("ProjectEditController",e),e.$inject=["$scope","$location","$state","qsService","timezoneService","$stateParams","ModalService","Notification","restService","$timeout","stateTransitionService"]}();;!function(){"use strict";function e(e,t,a,o,l,r,s,i,m,n,d,u){var c=this;c.model={},c.$scope=e,c.editData=function(e,t){e&&i.create("purchases/saveAsAttachment",t).then(function(e){u.$broadcast("addPORequest",e),s.success({message:"Purchase requisition successfully sent."})});return!0},c.viewName=e.vm.viewName,c.moduleName="PurchaseOrders",c.gui=n,c.modulePrivilege=c.gui.getModulePrivilege(c.viewName,c.moduleName),c.searchValue={filter:"",WoId:e.WoId},c.usingDSLNorthwest=d.usingDSLNorthwest,c.hide=!1,c.createPurchaseRequisition=function(e){c.model.AltId=e,I=0,o.showModal({templateUrl:"Templates/Purchase/popupEdit.html",controller:"PurchaseRequisitionController",controllerAs:"vm",inputs:{modalTitle:"Purchase Requisition",model:c.model,attributes:c.modalAttributes,apiMethod:"purchases/email",onBack:c.editData}}).then(function(e){e.close.then(function(){l(function(){})})})},c.$state=a,c.tmp=!1,c.assignemt=!1,c.$scope.$parent.vm.model.AltId,c.filterParts=r.filter("and"),c.drilldownFilter=r.filter("and"),c.filterParts.eq("SaleType","Parts"),c.filterVendor=r.filter("and"),c.filterVendor.eq("Status","Active"),c.attributes=[{Name:"PO Number",ValueName:"ExternalId",Edit:!1,Sortable:!0},{Name:"Vendor",ValueName:"VendorName",Edit:!1,Sortable:!0},{Name:"Note",ValueName:"Note",Edit:!1,Sortable:!0},{Name:"PO Date",ValueName:"PoDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"Promise Date",ValueName:"PromiseDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"Amount",CellFormat:"template",CellFormatData:{TemplateUrl:"amount.html"},Roles:["Admin","FieldConnect","TransAdmin","SubAdmin"]},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0}],c.drilldownSettings={ApiMethod:"purchases/details",FilterFields:{PoId:"Id"},attributes:[{Name:"Part Num",ValueName:"PartNum",Edit:!1},{Name:"Name",ValueName:"ItemName",Edit:!1,Sortable:!0},{Name:"Qty Ordered",ValueName:"Quantity",Edit:!1,Sortable:!0},{Name:"Qty Received",ValueName:"QuantityReceived",Edit:!1,Sortable:!0},{Name:"UOM",ValueName:"UOM",Edit:!1,Sortable:!0},{Name:"Unit Cost",CellFormat:"template",CellFormatData:{TemplateUrl:"unitCost.html"},Roles:["Admin","FieldConnect","TransAdmin","SubAdmin"]},{Name:"Ext. Cost",CellFormat:"template",CellFormatData:{TemplateUrl:"extCost.html"},Roles:["Admin","FieldConnect","TransAdmin","SubAdmin"]},{Name:"",CellFormat:"template",CustomHeaderClass:"form-action",CellFormatData:{TemplateUrl:"addToWOItem.html",addNewItem:function(t){c.hide?s.warning({message:"You don't have permission to add item to Work Order!"}):(c.model=t,c.model.WoId=parseInt(c.$state.params.id),i.create("parts/item",c.model).then(function(t){201===t.status&&(s.success({message:"Successfully add item to Work Order."}),e.$parent.vm.reloadPartsMisc(),e.$parent.vm.checkCustomerInfoChangeEnabled&&e.$parent.vm.checkCustomerInfoChangeEnabled(!0))}))}}}]},c.searchText={Type:"text",Label:"Search:",ModelValue:"searchText",MaxLength:"100",CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo"},c.searchButton={Type:"button",Label:"Search",onClick:P,CustomInputClass:"btn-primary",ObjectName:"btnSearch"},c.attDSLPostingGroup={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},c.attDSLLine1={Type:"line",CustomClass:"col-sm-12"},c.locations={Type:"dropdown",Label:"Location:",Required:!1,ApiMethod:"locations/dropdown",ValueProp:"Id",TextProp:"LocationName",ModelValue:"LocationId",Filter:c.filter,CustomDivClass:e.subcontractorId?"hidden":""},c.usingDSLNorthwest&&(c.attDSLPostingGroup={Type:"dropdown",Label:"Posting Group:",ApiMethod:"dslInventoryPostingGroup/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"PostingGroupId",ConvertToInt:"true"},e.$watch("pc.model.PostingGroupId",function(e,t){e!==t&&P()})),c.itemListIndex=5,c.modalAttributes=[c.locations,c.attDSLPostingGroup,c.searchText,c.searchButton,c.attDSLLine1,{Type:"dropdown",Label:"Item Name:",ApiMethod:"items/dropdown",ValueProp:"Name",TextProp:"Name",ModelValue:"ItemName",Filter:c.filterParts,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo"},{Type:"button",Label:"Add to List",onClick:function(){I<1&&(c.model.PartsBody="",I++);if(null==c.model.VendorName)return void s.warning({message:"You must choose Vendor."});if(null==c.model.ItemName)return void s.warning({message:"You must choose Item."});if(null==c.model.Quantity)return void s.warning({message:"You must choose Quantity."});c.model.PartsBody=c.model.PartsBody+c.model.VendorName+" "+c.model.ItemName+" Qty: "+c.model.Quantity+"\n",c.model.PartsBody.replace(/(\r\n|\n|\r)/gm,"<br />"),c.model.AltId=c.$scope.$parent.vm.model.AltId,c.model.WoId=c.$scope.$parent.vm.model.Id,c.model.CustomerId=c.$scope.$parent.vm.model.CustomerId,c.model.CompanyId=c.$scope.$parent.vm.model.CompanyId},CustomInputClass:"btn-primary"},{Type:"decimal",Label:"Quantity:",ModelValue:"Quantity"},{Type:"dropdown",Label:"Vendor Name:",ApiMethod:"vendors",ValueProp:"VendorName",TextProp:"VendorName",ModelValue:"VendorName",Filter:c.filterVendor,Required:!0},{Type:"textarea",Label:"Parts:",MaxLength:"200",ModelValue:"PartsBody",ReadOnly:!0,Required:!0},{Type:"textarea",Label:"Notes:",Required:!1,MaxLength:"200",ModelValue:"Note"}];var p=['<button class="btn btn-primary margin-right-60" ng-click="attr.CellFormatData.addNewItem(item)">Add to WO</button>'].join("");m.put("addToWOItem.html",p);var h=['{{item.Cost | currency:"$"}}'].join("");m.put("unitCost.html",h);var N=['{{item.Cost*item.QuantityReceived | currency:"$"}}'].join("");m.put("extCost.html",N);var I,C=['{{item.Amount| currency:"$"}}'].join("");function P(){c.searchText=c.model.searchText,c.searchValue.filter=c.searchText?c.searchText.toString():"",c.model.ItemId=null,c.filterParts.reset(),c.filterParts.eq("SaleType","Parts"),null===c.model.LocationId||void 0===c.model.LocationId?c.filterParts.eq("LocationId",c.LocationId):c.filterParts.eq("LocationId",c.model.LocationId),c.usingDSLNorthwest?(c.filterParts.eq("PostingGroupId",c.model.PostingGroupId),c.attributes[c.itemListIndex].List=null,c.firstTime=!1,c.filterParts.like("ItemName","%"+c.searchValue.filter+"%"),c.isFocus=!1):""!==c.searchValue.filter&&(c.attributes[c.itemListIndex].List=null,c.firstTime=!1,c.filterParts.like("ItemName","%"+c.searchValue.filter+"%"),c.isFocus=!1)}m.put("amount.html",C),e.$watch("pc.$scope.$parent.vm.model.AltId",function(){c.$scope.$parent.vm.altId&&0!=c.$scope.$parent.vm.altId&&c.$scope.$parent.vm.model.AltId}),e.$watch("pc.model.LocationId",function(e,t){e!==t&&P()})}angular.module("FieldConnectApp").controller("PurchaseController",e),e.$inject=["$scope","$location","$state","ModalService","$timeout","qsService","Notification","restService","$templateCache","guiPrivilegeService","featuresFactory","$rootScope"]}();;!function(){"use strict";function o(o,e,t,i,n){var l=this;l.$scope=o,l.attributes=o.attributes,l.id=o.id,l.apiMethod=o.apiMethod,l.timezone=o.timezone,l.model=o.model,l.modalClass=!1,n(function(){l.modalClass=!0}),l.onBack=function(e){if(o.onBack&&!o.onBack(e,l.model))return;l.modalClass=!1,o.close(null,200)}}angular.module("FieldConnectApp").controller("PurchaseRequisitionController",o),o.$inject=["$scope","$location","$state","ModalService","$timeout"]}();;!function(){"use strict";function e(e,t,a,o,n,l,m){var i=this;i.reloadTable=!0,i.editQuoteAttachment=function(t,a){void 0!=t&&exit;var n={QuoteId:parseInt(a)};o.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Quote Attachment Edit",id:t,model:n,attributes:i.attributesQuoteattEdit,apiMethod:"quoteattachments",onBack:i.editData,moduleName:i.moduleName,viewName:i.viewName,readOnly:!e.$parent.vm.notreadOnlyAttachments}}).then(function(e){e.close.then(function(){})})},i.editData=function(t){t&&(i.reloadTable=!1,n(function(){i.reloadTable=!0,"object"==typeof t&&e.$parent.vm.checkCustomerInfoChangeEnabled&&e.$parent.vm.checkCustomerInfoChangeEnabled(!0)}));return!0},i.moduleName="QuoteAttachments",i.viewName=e.vm.viewName,i.attributesQuoteatt=[{Name:"Date",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0},{Name:"Attached To",ValueName:"AttachedTo",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0}],i.attributesQuoteattEdit=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType",Filter:m.filter("and").eq("attachmentCategory","QUOTE")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description:",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"quoteattachments/file",Required:!0}],i.deleteEvent=function(){e.$parent.vm.checkCustomerInfoChangeEnabled&&e.$parent.vm.checkCustomerInfoChangeEnabled()}}angular.module("FieldConnectApp").controller("QuoteAttachmentController",e),e.$inject=["$scope","$location","$state","ModalService","$timeout","guiPrivilegeService","qsService"]}();;!function(){"use strict";function e(e,t,i,a,o,l,r,s,d,n){var u=this;u.id=e.id,u.focusOut=function(){u.filters.Cost=u.model.Cost,u.filters.ItemId=u.model.ItemId,a.getItems("quoteitems/initialDataForQuoteItem",u.filters).then(function(){b=a.state.items[0],u.model.Price=b.Price})},u.model={QuoteId:parseInt(e.QuoteId)},u.$scope=e,u.close=function(t){e.onBack&&e.onBack(t);u.modalClass=!1,e.close(null,50)},u.search=L,u.calculate=f,u.viewName=e.viewName,u.moduleName=e.moduleName,u.hideSubmit=e.readOnly,u.oldPrice=0,u.isMisc=!0,u.searchValue={filter:"",QuoteId:e.QuoteId},u.filters={QuoteId:e.QuoteId,ItemId:u.model.ItemId,Cost:u.model.Cost},u.filter={QuoteId:e.QuoteId},u.usingDSLNorthwest=n.usingDSLNorthwest,u.apiMethod="quoteitems",u.usingDSLNorthwest&&(u.apiMethod="dslQuoteMisc");for(var c=d.getValue("authorizationData").userRoles.split(","),m=!0,p=0;p<c.length;p++)"FieldConnect"!==c[p]&&"Admin"!==c[p]&&"Office"!==c[p]||(m=!1);if(u.miscFilter=o.filter("and"),u.miscFilter.eq("SaleType","Misc"),u.id?u.attributes=[{Type:"text",Label:"Item Name:",Required:!0,MaxLength:"50",ModelValue:"ItemName",ReadOnly:!0},{Type:"decimal",Label:"Quantity:",Required:!0,MaxLength:"50",ModelValue:"Quantity"},{Type:"currency",Label:"Unit Price:",Required:!m,ModelValue:"Price",ObjectName:"fieldQDMiscDetailPrice"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"}]:u.attributes=[{Type:"text",Label:"Search:",ModelValue:"searchText",MaxLength:"100",CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo"},{Type:"button",Label:"Search",onClick:L,CustomInputClass:"btn-primary",ObjectName:"btnSearch"},{Type:"dropdown",Label:"Item Name:",Required:!0,ApiMethod:u.isMisc&&u.id?"items/miscItems":u.id?"items/partsItems":"items/dropdown",ValueProp:"Id",TextProp:u.id?"ItemName":"Name",ModelValue:"ItemId",Autofocus:"true",Name:"misc",List:u.id?null:[""],Filter:u.miscFilter,CurrentList:[],SelectFirst:!0,OnOpen:function(){if(u.firstTime)for(var e=0;e<u.attributes.length;e++){if("parts"===u.attributes[e].Name){u.attributes[e].List=null,u.partsFilter.Reload++,u.firstTime=!1;break}if("misc"===u.attributes[e].Name){u.attributes[e].List=null,u.miscFilter.Reload++,u.firstTime=!1;break}}},OnLoaded:function(){s(function(){0===u.attributes[0].CurrentList.length?(r.warning({message:"No results found"}),document.getElementById("seacrhInputItem").focus()):u.attributes[0].CurrentList.length>0&&0===u.attributes[0].CurrentList[0].Id&&(u.attributes[0].CurrentList.splice(0,u.attributes[0].CurrentList.length),r.warning({message:"The number of items is too high! <br /> Please use the search to  limit the number of the items first"}),document.getElementById("seacrhInputItem").focus())})}},{Type:"decimal",Label:"Quantity:",Required:!0,MaxLength:"50",ModelValue:"Quantity"},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"QuoteItemName",ReadOnly:!1},{Type:"currency",Label:"Unit Price:",Required:!m,ModelValue:"Price",ObjectName:"fieldQDMiscDetailPrice"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"}],u.usingDSLNorthwest){u.attDSLActionTaken={Type:"dropdown",Label:"Action Taken:",ApiMethod:"dslActionTaken/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extActionTakenId",ConvertToInt:"true"},u.attDSLFaultAreas={Type:"dropdown",Label:"Trouble Found:",ApiMethod:"dslFaultAreas/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extFaultAreasId",ConvertToInt:"true"},u.attDSLApplicableCode={Type:"dropdown",Label:"Applicable Zone:",ApiMethod:"dslApplicableCode/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extApplicableCodeId",ConvertToInt:"true"},u.attDSLInstalledRemoved={Type:"dropdown",Label:"Installed/Removed:",ApiMethod:"dslInstalledRemoved/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extInstalledRemovedId",ConvertToInt:"true"},u.attDSLWhoPays={Type:"dropdown",Label:"Who Pays:",ApiMethod:"dslWhoPays/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extWhoPaysId",ConvertToInt:"true"},u.attDSLIndirectLaborQuantity={Type:"int",Label:"Indirect Labor Qty:",ModelValue:"extIndirectLaborQuantity"},u.attDSLIndirectPartNumber={Type:"text",Label:"Part#/TOF",ModelValue:"extIndirectPartNumber",MaxLength:"250"};var I=[u.attDSLActionTaken,u.attDSLFaultAreas,u.attDSLApplicableCode,u.attDSLInstalledRemoved,u.attDSLWhoPays,u.attDSLIndirectLaborQuantity,u.attDSLIndirectPartNumber];u.attributes=u.attributes.concat(I)}function L(){u.searchValue.filter=u.model.searchText?u.model.searchText.toString():"",u.model.ItemId=null,u.miscFilter.reset(),u.miscFilter.eq("SaleType","Misc"),""!==u.searchValue.filter&&(u.attributes[2].List=null,u.firstTime=!1,u.miscFilter.like("ItemName","%"+u.searchValue.filter+"%"),u.isFocus=!1)}u.firstTime=!0;var b,h=!1;function f(){u.model.ItemId?h?(u.filters.ItemId=u.model.ItemId,u.filters.Cost=null,a.getItems("quoteitems/initialDataForQuoteItem",u.filters).then(function(){b=a.state.items[0],u.model.Price=b.Price,u.model.Cost=b.Cost,u.model.QuoteItemName=b.QuoteItemName})):h=!0:u.model.Price=null}u.id||(h=!0),e.$watch("vm.model.ItemId",function(){f()})}angular.module("FieldConnectApp").controller("EditQuoteMiscController",e),e.$inject=["$scope","$location","$state","restService","qsService","stateTransitionService","Notification","$timeout","cryptoStorageService","featuresFactory"]}();;!function(){"use strict";function e(e,t,o,a,i,l,r,s,m,n){var c=this;c.$state=o,c.editMisc=function(t,o){c.reloadTable=!1,i.showModal({templateUrl:"Templates/Quote/itemModal.html",controller:"EditQuoteMiscController",controllerAs:"vm",inputs:{modalTitle:"Misc edit",id:t,QuoteId:o,onBack:c.responsePopup,moduleName:c.moduleName,viewName:c.viewName,apiMethod:c.apiMethod,misc:!0,readOnly:!e.$parent.vm.notreadOnlyMisc}}).then(function(e){e.close.then(function(){c.model={},c.reloadTable=!0})})},c.responsePopup=function(t){t&&(c.reloadTable=!1,l(function(){c.reloadTable=!0}),e.$emit("quoteHeaderApprovalsRefresh"))},c.viewName=e.vm.viewName,c.moduleName="QuoteMiscellaneous",c.quoteNotesCount=0,c.reloadTable=!0,c.model={NoteTemp:""},c.usingDSLNorthwest=n.usingDSLNorthwest,c.apiMethod="quoteitems",c.usingDSLNorthwest&&(c.apiMethod="dslQuoteMisc");var u=m.getValue("authorizationData").userRoles.split(",");c.customerRoles=!1;for(var d=0;d<u.length;d++)"CustAdmin"!=u[d]&&"Cust"!=u[d]||(c.customerRoles=!0);c.modalClass=!1,l(function(){c.modalClass=!0}),c.attributes=[{Name:"Item Name",ValueName:"ItemName",Edit:!0,Sortable:!0},{Name:"Qty",ValueName:"Quantity",Edit:!1,Sortable:!0},{Name:"Unit Price",ValueName:"Price",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colQDMiscGridPrice"},{Name:"Extended Price",ValueName:"ExtendedPrice",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colQDMiscGridExtendedPrice"}],c.emitEvent=function(){e.$emit("quoteHeaderApprovalsRefresh")}}angular.module("FieldConnectApp").controller("QuoteMiscController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","$timeout","qsService","restService","cryptoStorageService","featuresFactory"]}();;!function(){"use strict";function e(e,t,a,o,r,l,i,m,s,n){var u=this;u.$state=a,u.editParts=function(t,a){u.reloadTable=!1,r.showModal({templateUrl:"Templates/Quote/itemModal.html",controller:"EditQuoteItemController",controllerAs:"vm",inputs:{modalTitle:"Part edit",id:t,QuoteId:a,onBack:u.responsePopup,moduleName:u.moduleName,viewName:u.viewName,apiMethod:u.apiMethod,readOnly:!e.$parent.vm.notreadOnlyParts}}).then(function(e){e.close.then(function(){u.model={},u.reloadTable=!0})})},u.responsePopup=function(t){t&&(u.reloadTable=!1,l(function(){u.reloadTable=!0}),e.$emit("quoteHeaderApprovalsRefresh"))},u.viewName=e.vm.viewName,u.moduleName="QuoteParts",u.quoteNotesCount=0,u.reloadTable=!0,u.model={NoteTemp:""},u.usingDSLNorthwest=n.usingDSLNorthwest,u.apiMethod="quoteitems",u.usingDSLNorthwest&&(u.apiMethod="dslQuotePart");var d=s.getValue("authorizationData").userRoles.split(",");u.customerRoles=!1;for(var c=0;c<d.length;c++)"CustAdmin"!=d[c]&&"Cust"!=d[c]||(u.customerRoles=!0);u.modalClass=!1,l(function(){u.modalClass=!0}),u.attributes=[{Name:"Part Num",ValueName:"PartNum",Edit:!0,Sortable:!0},{Name:"Item Name",ValueName:"ItemName",Edit:!1,Sortable:!0},{Name:"Qty",ValueName:"Quantity",Edit:!1,Sortable:!0},{Name:"Unit Price",ValueName:"Price",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colQDPartsGridPrice"},{Name:"Extended Price",ValueName:"ExtendedPrice",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colQDPartsGridExtendedPrice"}],u.emitEvent=function(){e.$emit("quoteHeaderApprovalsRefresh")}}angular.module("FieldConnectApp").controller("QuotePartsController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","$timeout","qsService","restService","cryptoStorageService","featuresFactory"]}();;!function(){"use strict";function e(e,t,a,n,o,l,i,r,c,u,d,s){var p=this;p.$state=a,p.continue=function(){if(p.list&&p.list.length>0){var t=p.list[p.list.length-1].Status;if("Pending Signature"==t)return void r(function(){e.$parent.vm.serveportGrid=!0,$("#service-report .add-new-btn").click()})}v("Continue")},p.cancel=function(){bootbox.confirm({message:"Are you sure you want to Cancel the quote?",buttons:{confirm:{label:"Yes",className:"btn-primary"},cancel:{label:"No",className:"btn-default"}},callback:function(e){e&&v("Cancel")}})},p.reopen=function(){v("Reopen")},p.cancontinue=!0,p.cancancel=!0,p.canreopen=!0,p.quoteId=e.$parent.vm.id;var m=l.getValue("authorizationData").userRoles.split(",");function v(t){p.updateModel.Operation=t,s.getLocation(p.moduleName).then(function(t){p.updateModel.Latitude=t.coords.latitude,p.updateModel.Longitude=t.coords.longitude,i.create("quoteapprovals",p.updateModel).then(function(t){if(200==t.status){if(t.data.WoId)return c.success({message:"Quote successfully converted to Work Order."}),void r(function(){if(p.isOnlyTech)a.go("quoteDetails",{id:p.quoteId},{reload:!0});else{var e={quoteid:p.quoteId,converted:!0};u.setTransitionParam("quote",e),a.go("workOrdersDetails",{id:t.data.WoId})}});c.success({message:"Quote Status updated, new Quote Approval step created."}),n=t.data,p.reloadTable=!1,e.$parent.vm.reloadTable=!1,p.updateModel.Operation=null,r(function(){f(n),p.reloadTable=!0,e.$parent.vm.reloadTable=!0})}var n})})}function f(t){p.viewName="QuoteDetails",d.getModulePrivilege(p.viewName,p.moduleName)===d.permissions.ReadOnly?(p.cancontinue=!1,p.cancancel=!1,p.canreopen=!1):(p.cancontinue=t.CanContinue,p.cancancel=t.CanCancel,p.canreopen=t.CanReopen),r(function(){r(function(){e.$parent.vm.notreadOnlySubmit=!t.ReadOnly,e.$apply()}),r(function(){e.$parent.vm.notreadOnlyLabor=!t.ReadOnly,e.$apply()}),r(function(){e.$parent.vm.notreadOnlyParts=!t.ReadOnly,e.$apply()}),r(function(){e.$parent.vm.notreadOnlyMisc=!t.ReadOnly,e.$apply()}),r(function(){e.$parent.vm.notreadOnlyNote=!t.ReadOnly,e.$apply()}),r(function(){e.$parent.vm.notreadOnlyReport=!t.ReadOnly,e.$apply()}),r(function(){e.$parent.vm.notreadOnlyAttachments=!t.ReadOnly,e.$apply()});for(var a=0;a<e.$parent.vm.attributes.length;a++)"ddlStatusDropdown"!=e.$parent.vm.attributes[a].ObjectName&&(e.$parent.vm.attributes[a].ReadOnly=t.ReadOnly);e.$apply()})}p.isOnlyTech=1==m.length&&"Technician"==m[0],i.getItem("quoteapprovals/config",p.quoteId).then(function(e){e.data&&f(e.data)}),p.reloadTable=!1,p.moduleName="ApprovalStatus",p.autoFilter=o.filter("and"),p.autoFilter.eq("QuoteId",p.quoteId),p.updateModel={QuoteId:p.quoteId,Operation:null},p.attributes=[{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0,ObjectName:"colStatus"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0,ObjectName:"colDescription"},{Name:"Assigned To",ValueName:"AssignedTo",Edit:!1,Sortable:!0,CellFormat:"multiline",Separator:"<br>",ObjectName:"colAssignedTo"},{Name:"Completed Date",ValueName:"CompletedDate",FormatDate:"datetime",Edit:!1,Sortable:!0,ObjectName:"colCompletedDate"},{Name:"Completed By",ValueName:"CompletedBy",Edit:!1,Sortable:!0,ObjectName:"colCompletedBy"}],p.reloadTable=!0,p.list=[]}angular.module("FieldConnectApp").controller("QuoteApprovalController",e),e.$inject=["$scope","$location","$state","$stateParams","qsService","cryptoStorageService","restService","$timeout","Notification","stateTransitionService","guiPrivilegeService","fcGeoLocationService"]}();;!function(){"use strict";function e(e,t,o,i,a,l,r,s,n,d){var u=this;u.id=e.id,u.focusOut=function(){u.filters.Cost=u.model.Cost,u.filters.ItemId=u.model.ItemId,i.getItems("quoteitems/initialDataForQuoteItem",u.filters).then(function(){h=i.state.items[0],u.model.Price=h.Price})},u.model={QuoteId:parseInt(e.QuoteId)},u.$scope=e,u.close=function(t){e.onBack&&e.onBack(t);u.modalClass=!1,e.close(null,50)},u.search=L,u.calculate=y,u.viewName=e.viewName,u.moduleName=e.moduleName,u.hideSubmit=e.readOnly,u.oldPrice=0,u.isMisc=!1,u.usingDSLNorthwest=d.usingDSLNorthwest,u.apiMethod="quoteitems",u.usingDSLNorthwest&&(u.apiMethod="dslQuotePart"),u.searchValue={filter:"",QuoteId:e.QuoteId},u.filters={QuoteId:e.QuoteId,ItemId:u.model.ItemId,Cost:u.model.Cost},u.filter={QuoteId:e.QuoteId};for(var c=n.getValue("authorizationData").userRoles.split(","),m=!0,I=0;I<c.length;I++)"FieldConnect"!=c[I]&&"Admin"!=c[I]&&"Office"!=c[I]||(m=!1);u.partsFilter=a.filter("and"),u.partsFilter.eq("SaleType","Parts"),u.itemName={Type:"dropdown",Label:"Item Name:",Required:!0,ApiMethod:u.isMisc&&u.id?"items/miscItems":u.id?"items/partsItems":"items/dropdown",ValueProp:"Id",TextProp:u.id?"ItemName":"Name",ModelValue:"ItemId",Autofocus:"true",Name:u.isMisc?"misc":"parts",List:u.id?null:[""],Filter:u.isMisc?u.miscFilter:u.partsFilter,CurrentList:[],SelectFirst:!0,OnOpen:function(){if(u.firstTime)for(var e=0;e<u.attributes.length;e++)u.attributes[e].List=null,u.partsFilter.Reload++,u.firstTime=!1},OnLoaded:function(){s(function(){0==u.attributes[u.itemListIndex].CurrentList.length?(r.warning({message:"No results found"}),document.getElementById("seacrhInputItem").focus()):u.attributes[u.itemListIndex].CurrentList.length>0&&0==u.attributes[u.itemListIndex].CurrentList[0].Id&&(u.attributes[u.itemListIndex].CurrentList.splice(0,u.attributes[u.itemListIndex].CurrentList.length),r.warning({message:"The number of items is too high! <br /> Please use the search to  limit the number of the items first"}),document.getElementById("seacrhInputItem").focus())})}},u.itemNameEdit={Type:"text",Label:"Item Name:",Required:!0,MaxLength:"50",ModelValue:"ItemName",ReadOnly:!0},u.search={Type:"text",Label:"Search:",ModelValue:"searchText",MaxLength:"100",CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo"},u.searchButton={Type:"button",Label:"Search",onClick:L,CustomInputClass:"btn-primary",ObjectName:"btnSearch"},u.attDSLPostingGroup={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},u.usingDSLNorthwest&&(u.attDSLPostingGroup={Type:"dropdown",Label:"Posting Group:",ApiMethod:"dslInventoryPostingGroup/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"PostingGroupId",ConvertToInt:"true"}),u.locations={Type:"dropdown",Label:"Location:",Required:!1,ApiMethod:"locations/dropdown",ValueProp:"Id",TextProp:"LocationName",ModelValue:"LocationId",Filter:u.filter,CustomDivClass:e.subcontractorId?"hidden":""};if(u.id?(u.locations.ReadOnly=!0,u.attributes=[u.locations,{Type:"line",CustomClass:"col-sm-12"},u.itemNameEdit,{Type:"decimal",Label:"Quantity:",Required:!0,MaxLength:"50",ModelValue:"Quantity"},{Type:"currency",Label:"Unit Price:",Required:!m,ModelValue:"Price",ObjectName:"fieldQDPartsDetailPrice"},{Type:"decimal",Label:"Total Quantity:",MaxLength:"50",ModelValue:"AvailableQuantity",ReadOnly:!0},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"}]):u.attributes=[u.locations,u.attDSLPostingGroup,u.search,u.searchButton,{Type:"line",CustomClass:"col-sm-12"},u.itemName,{Type:"decimal",Label:"Quantity:",Required:!0,MaxLength:"50",ModelValue:"Quantity"},{Type:"currency",Label:"Unit Price:",Required:!m,ModelValue:"Price",ObjectName:"fieldQDPartsDetailPrice"},{Type:"decimal",Label:"Total Quantity:",MaxLength:"50",ModelValue:"AvailableQuantity",ReadOnly:!0},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"}],u.itemListIndex=5,u.usingDSLNorthwest){u.attDSLActionTaken={Type:"dropdown",Label:"Action Taken:",ApiMethod:"dslActionTaken/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extActionTakenId",ConvertToInt:"true"},u.attDSLFaultAreas={Type:"dropdown",Label:"Trouble Found:",ApiMethod:"dslFaultAreas/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extFaultAreasId",ConvertToInt:"true"},u.attDSLApplicableCode={Type:"dropdown",Label:"Applicable Zone:",ApiMethod:"dslApplicableCode/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extApplicableCodeId",ConvertToInt:"true"},u.attDSLInstalledRemoved={Type:"dropdown",Label:"Installed/Removed:",ApiMethod:"dslInstalledRemoved/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extInstalledRemovedId",ConvertToInt:"true"},u.attDSLWhoPays={Type:"dropdown",Label:"Who Pays:",ApiMethod:"dslWhoPays/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extWhoPaysId",ConvertToInt:"true"},u.attDSLIndirectLaborQuantity={Type:"int",Label:"Indirect Labor Qty:",ModelValue:"extIndirectLaborQuantity"},u.attDSLIndirectPartNumber={Type:"text",Label:"Part#/TOF",ModelValue:"extIndirectPartNumber",MaxLength:"250"};var p=[u.attDSLActionTaken,u.attDSLFaultAreas,u.attDSLApplicableCode,u.attDSLInstalledRemoved,u.attDSLWhoPays,u.attDSLIndirectLaborQuantity,u.attDSLIndirectPartNumber];u.attributes=u.attributes.concat(p)}function L(){u.searchValue.filter=u.model.searchText?u.model.searchText.toString():"",u.model.ItemId=null,u.partsFilter.reset(),u.partsFilter.eq("SaleType","Parts"),null===u.model.LocationId&&void 0===u.model.LocationId?u.partsFilter.eq("LocationId",u.LocationId):(u.partsFilter.eq("LocationId",u.model.LocationId),u.attributes[u.itemListIndex].List=null,u.isFocus=!1),u.usingDSLNorthwest&&null!==u.model.PostingGroupId&&void 0!==u.model.PostingGroupId&&(u.partsFilter.eq("PostingGroupId",u.model.PostingGroupId),u.attributes[u.itemListIndex].List=null,u.isFocus=!1),""!=u.searchValue.filter&&(u.attributes[u.itemListIndex].List=null,u.firstTime=!1,u.partsFilter.like("ItemName","%"+u.searchValue.filter+"%"),u.isFocus=!1)}u.firstTime=!0;var h,b=!1;function y(){u.model.ItemId?b?(u.filters.ItemId=u.model.ItemId,u.filters.Cost=null,i.getItems("quoteitems/initialDataForQuoteItem",u.filters).then(function(){h=i.state.items[0],u.model.Price=h.Price,u.model.Cost=h.Cost})):b=!0:u.model.Price=null}u.id||(b=!0),e.$watch("vm.model.ItemId",function(){y(),u.model.ItemId&&u.model.LocationId?(u.filters.ItemId=u.model.ItemId,u.filters.LocationId=u.model.LocationId,u.filters.WoId=0,i.getItems("parts/initialLocationDataForPart",u.filters).then(function(e){void 0!==e.data&&(u.model.AvailableQuantity=e.data.quantities,u.model.Availquantity=e.data.Availquantity)})):u.model.AvailableQuantity=null}),u.usingDSLNorthwest&&e.$watch("vm.model.PostingGroupId",function(e,t){e===t||u.id||L()}),e.$watch("vm.model.LocationId",function(e,t){e===t||u.id||L()}),i.getItem("employees/getCurrent").then(function(e){void 0!==e.data.Data[0]&&(u.model.LocationId=e.data.Data[0].InvLocId)})}angular.module("FieldConnectApp").controller("EditQuoteItemController",e),e.$inject=["$scope","$location","$state","restService","qsService","stateTransitionService","Notification","$timeout","cryptoStorageService","featuresFactory"]}();;!function(){"use strict";function e(e,t,a,o,r,d,l,i,n,u,s,p,b,m){var L=this;L.DefaultLaborCode={},L.edit=function(t,a,o){if(L.attLaborCodeDropdown={Type:"dropdown",Label:"Labor Code:",Required:!0,ApiMethod:"laborCodes",ValueProp:"Id",TextProp:"LaborCodeName",ModelValue:"LaborCodeId",CustomInputClass:"",Name:"LaborCode",TabIndex:2},L.usingDSLNorthwest){L.customerFilter=n.filter("and"),L.customerFilter.eq("CustomerId",e.$parent.vm.model.CustomerId),L.attLaborCodeDropdown={Type:"dropdown",Label:"Labor Code:",Required:!0,ApiMethod:"dslLaborCodeByServiceZoneCode/ddList",Filter:L.customerFilter,ValueProp:"Id",TextProp:"LaborCodeName",ModelValue:"LaborCodeId",CustomInputClass:"",Name:"LaborCode"},L.attDSLActionTaken={Type:"dropdown",Label:"Action Taken:",ApiMethod:"dslActionTaken/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extActionTakenId",ConvertToInt:"true"},L.attDSLFaultAreas={Type:"dropdown",Label:"Trouble Found:",ApiMethod:"dslFaultAreas/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extFaultAreasId",ConvertToInt:"true"},L.attDSLApplicableCode={Type:"dropdown",Label:"Applicable Zone:",ApiMethod:"dslApplicableCode/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extApplicableCodeId",ConvertToInt:"true"},L.attDSLInstalledRemoved={Type:"dropdown",Label:"Installed/Removed:",ApiMethod:"dslInstalledRemoved/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extInstalledRemovedId",ConvertToInt:"true"},L.attDSLWhoPays={Type:"dropdown",Label:"Who Pays:",ApiMethod:"dslWhoPays/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extWhoPaysId",ConvertToInt:"true"},L.attDSLIndirectLaborQuantity={Type:"int",Label:"Indirect Labor Qty:",ModelValue:"extIndirectLaborQuantity"},L.attDSLIndirectPartNumber={Type:"text",Label:"Part#/TOF",ModelValue:"extIndirectPartNumber",MaxLength:"250"};var d=[L.attDSLActionTaken,L.attDSLFaultAreas,L.attDSLApplicableCode,L.attDSLInstalledRemoved,L.attDSLWhoPays,L.attDSLIndirectLaborQuantity,L.attDSLIndirectPartNumber]}L.attributesEdit=[L.attLaborCodeDropdown,f,{Type:"decimal",Label:"Bill Hours:",ModelValue:"BillHours",Required:!0,TabIndex:1},{Type:"currency",Label:"Rate Hour:",ModelValue:"Rate",ReadOnly:!1,TabIndex:4,ObjectName:"fieldQDLaborDetailRate"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"}],L.usingDSLNorthwest&&(L.attributesEdit=L.attributesEdit.concat(d));L.firstTimeEdit=!0,c=!1,void 0!=t&&(c=!0,L.firstTimeEdit=!1);L.model.QuoteId=parseInt(a),L.model.NoteTemp="",L.reloadTable=!1;for(var i=0;i<L.attributesEdit.length;i++)L.attributesEdit[i].ReadOnly=!e.$parent.vm.notreadOnlyLabor;r.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Quote Labor edit",id:t,model:L.model,attributes:L.attributesEdit,apiMethod:L.apiMethod,moduleName:L.moduleName,viewName:L.viewName,onBack:L.responsePopup,hideSubmit:!e.$parent.vm.notreadOnlyLabor}}).then(function(e){e.close.then(function(){L.model={},L.reloadTable=!0})}),null!=o&&l.getItem("ratesheets",o).then(function(e){var t=e.data;L.model.LaborRateHour=t.LaborRateHour})},L.$state=a,L.filter={Reload:0},L.DefaultLaborCode={},L.DefaultLaborCodeId;var c=!1;L.defaultPayRateId=null,L.responsePopup=function(t){t&&(e.$emit("quoteHeaderApprovalsRefresh"),L.filter.Reload++,L.reloadTable=!1,L.laborData=null,d(function(){L.reloadTable=!0}));return!0},L.usingDSLNorthwest=m.usingDSLNorthwest,L.apiMethod="quotelabors",L.usingDSLNorthwest?L.apiMethod="dslQuoteLabors":l.getItem("settings/status?type=DefaultLaborCode").then(function(e){L.DefaultLaborCode=e.data,L.DefaultLaborCode.Value&&(L.defaultLaborCodeFilter=n.filter("and"),L.defaultLaborCodeFilter.eq("LaborCodeName",L.DefaultLaborCode.Value),l.getItems("laborCodes",L.defaultLaborCodeFilter).then(function(e){var t=e.data;t.Data.length>0&&(L.DefaultLaborCodeId=t.Data[0].Id,L.defaultPayRateId=t.Data[0].PayRateId)}))}),L.viewName=e.vm.viewName,L.moduleName="QuoteLabor",L.attributes=[{Name:"Labor Code",ValueName:"LaborCodeName",Edit:!0,Sortable:!0},{Name:"Hours",ValueName:"BillHours",Edit:!1,Autofocus:"true",Sortable:!0},{Name:"Unit Price",ValueName:"Rate",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colQDLaborGridRate"},{Name:"Extended Price",ValueName:"ExtendedPrice",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colQDLaborGridExtendedPrice"}];var I,C,f={Type:"dropdown",Label:"Pay Rate:",Required:!0,ApiMethod:"payRates",ValueProp:"Id",TextProp:"PayRateName",ModelValue:"PayRateId",Name:"PayRate",TabIndex:3};L.model={},L.reloadTable=!0,e.$watch("ql.attLaborCodeDropdown.CurrentList",function(e,t){e&&(c||d(function(){L.model.LaborCodeId=L.DefaultLaborCodeId,L.model.PayRateId=L.defaultPayRateId}))}),e.$watch("ql.model.LaborCodeId",function(){L.model.LaborCodeId?L.attLaborCodeDropdown.CurrentList&&d(function(){var e=L.attLaborCodeDropdown.CurrentList;I=$.grep(e,function(e){return e.Id==L.model.LaborCodeId}),L.model.PayRateId=I[0].PayRateId}):L.model.PayRateId=null}),L.emitEvent=function(){e.$emit("quoteHeaderApprovalsRefresh")},e.$watch("ql.model.PayRateId",function(){null!=L.model.PayRateId&&d(function(){var e=$.grep(L.attributesEdit,function(e){return"PayRate"==e.Name})[0].CurrentList;C=(C=$.grep(e,function(e){return e.Id==L.model.PayRateId}))[0],function(){if(L.firstTimeEdit){var e=0,t=0;C&&L.model.PayRateId?(e=null!=C.CostHour?C.CostHour:L.defaultTech?(1+C.CostMultiplier)*L.defaultTech.CostHour:1+C.CostMultiplier,t=null==C.RateMultiplier&&null==C.RateHour?L.model.LaborRateHour:null!=C.RateMultiplier?L.model.LaborRateHour*C.RateMultiplier:C.RateHour,L.model.Cost=e,L.model.Rate=t):L.model.Rate=null}else L.firstTimeEdit=!0}()})})}angular.module("FieldConnectApp").controller("QuoteLaborController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","$timeout","restService","cryptoStorageService","qsService","stateTransitionService","Notification","$window","currentUserService","featuresFactory"]}();;!function(){"use strict";function e(e,t,o,a,l,r,i,u,d){var m=this;m.$state=o,m.editNote=function(t,o){m.model.QuoteId=parseInt(o),m.model.NoteTemp="",m.reloadTable=!1;for(var a=0;a<m.attributesEdit.length;a++)m.attributesEdit[a].ReadOnly=!e.$parent.vm.notreadOnlyNote;l.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"QuoteNoteEditController",controllerAs:"vm",inputs:{modalTitle:"Quote Note edit",id:t,model:m.model,attributes:m.attributesEdit,apiMethod:"quotenotes",moduleName:m.moduleName,viewName:m.viewName,hideSubmit:!e.$parent.vm.notreadOnlyNote}}).then(function(e){e.close.then(function(){m.reloadTable=!0})})},m.getQuoteNoteLength=function(){var e=!1;m.quoteNotesCount>0&&(e=!0);return e},m.viewName=e.vm.viewName,m.moduleName="QuoteNotes",m.quoteNotesCount=0,m.reloadTable=!0,m.model={NoteTemp:""},m.quoteNoteFilter=i.filter("and"),m.quoteNoteFilter.eq("NoteType","Quote");var n=d.getValue("authorizationData").userRoles.split(",");m.customerRoles=!1;for(var s=0;s<n.length;s++)"CustAdmin"!=n[s]&&"Cust"!=n[s]||(m.customerRoles=!0);e.$watch("qn.model.NoteTemp",function(){m.model.Note=m.model.NoteTemp}),m.attributes=[{Name:"Date Time",ValueName:"SysModifyUTC",Edit:!e.$parent.vm.customerEdit,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},m.customerRoles?{CustomCellClass:"hidden",CustomHeaderClass:"hidden"}:{Name:"Customer Viewable",ValueName:"Viewable",Edit:!1,Sortable:!0,CellFormat:"checkbox"},{Name:"Note",ValueName:"Note",Edit:!1,Sortable:!0}],m.attributesEdit=[{Type:"dropdown",Label:"Standard Note:",ApiMethod:"notelibs",ValueProp:"Note",TextProp:"NoteTitle",Autofocus:"true",ModelValue:"NoteTemp",Filter:m.quoteNoteFilter},{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"Viewable"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note",Required:!0,Rows:10}]}angular.module("FieldConnectApp").controller("QuoteNoteController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","$timeout","qsService","restService","cryptoStorageService"]}();;!function(){"use strict";function e(e,o,t,i){var u=this;u.$scope=e,u.attributes=e.attributes,u.id=e.id,u.apiMethod=e.apiMethod,u.timezone=e.timezone,u.customFocus=e.customFocus,u.viewName=e.viewName,u.moduleName=e.moduleName,u.filter=e.filter,u.modalClass=!1;var a=i.getValue("authorizationData"),n=!1;t.getCompanySettings().then(function(e){u.userRoles=a.userRoles.split(","),null!==t.CustomerViewableQuoteNotesByRole&&u.userRoles.forEach(function(e){t.CustomerViewableQuoteNotesByRole.toLowerCase().search(e.toLowerCase())>-1&&(n=!0)})}),e.$watch(u.id,function(){void 0===u.id&&o(function(){u.$scope.model.QuoteId&&(u.$scope.model.Viewable=n)})}),o(function(){u.modalClass=!0}),u.hideSubmit=!1,e.hideSubmit&&(u.hideSubmit=e.hideSubmit),u.onBack=function(o){if(e.onBack&&!e.onBack(o))return;u.modalClass=!1,e.close(null,200)}}angular.module("FieldConnectApp").controller("QuoteNoteEditController",e),e.$inject=["$scope","$timeout","currentCompanyService","cryptoStorageService"]}();;!function(){"use strict";function e(e,t,o,a,l,r){var n=this;function i(e){e&&(t.$emit("quoteHeaderApprovalsRefresh"),n.reloadTable=!1,r(function(){n.reloadTable=!0}))}n.editServiceReport=function(e,t){var o={QuoteId:parseInt(t)};l.showModal({templateUrl:"Templates/Quote/QuoteReport.html",controller:"QuoteReportEditController",controllerAs:"vm",inputs:{id:e,model:o,onBack:i}}).then(function(e){e.close.then(function(){})})},n.reloadTable=!0,n.viewName=t.vm.viewName,n.moduleName="QuoteReports",n.attributes=[{Name:"Name",ValueName:"FileName",Sortable:!0,CellFormat:"download",DownloadValueName:"QuoteReportUrl"},{Name:"Date",ValueName:"SysCreateUTC",FormatDate:"datetime",Sortable:!0},{Name:"Signed By",ValueName:"SignedBy",Sortable:!0}],n.model={},n.deleteEvent=function(){n.reloadTable=!1,r(function(){n.reloadTable=!0})},n.popupClose=i}angular.module("FieldConnectApp").controller("QuoteReportController",e),e.$inject=["restService","$scope","$location","$state","ModalService","$timeout"]}();;!function(){"use strict";function e(e,o,t,r,a,i,s,l,n,d,u,c,m){var p=this;function g(){if(r=$("#signatureCanvas")[0],(a=document.createElement("canvas")).width=r.width,a.height=r.height,r.toDataURL()==a.toDataURL())d.warning({message:"Quote report must be signed."}),$("#signatureCanvas")[0].style.cssText="border: 1px  solid #FF0000";else{$("#signatureCanvas")[0].style.cssText="border: 1px  solid #000000";var o=new Image;o.src=$("#signatureCanvas")[0].toDataURL();var t=o.src.split(",")[1];p.model.Signature=t,u.getLocation("QuoteReport").then(function(o){p.model.Latitude=o.coords.latitude,p.model.Longitude=o.coords.longitude,e.create("quotereports",p.model).then(function(e){d.success({message:"Quote report has been successfully created."}),R(e)})})}var r,a}function R(e){o.onBack&&o.onBack(e),p.modalClass=!1,o.close(null,200)}p.$scope=o,p.ok=g,p.id=o.id,p.quoteId=o.model.QuoteId,p.miscTotal=0,p.partTotal=0,p.laborHoursTotal=0,p.laborPriceTotal=0,p.enableRemoteSignatureButton=!0,p.requestQuoteRemoteSignature=c.RequestQuoteReportSignature,e.getItem("quotereports",p.quoteId).then(function(e){p.model=e.data,p.model.Date=new Date,p.model.Date=s.convertToUtc(p.model.Date,p.model.Date.getTimezoneOffset()),p.model.Date=s.convertToLocal(p.model.Date),p.model.FullDateString=moment(p.model.Date).format("M/D/YYYY HH:mm:ss SSS"),p.model.DateString=moment(p.model.Date).format("M/D/YYYY"),p.model.ExpireDate=s.parseISOString(p.model.ExpireDate),p.model.ExpireDate=s.convertToLocal(p.model.ExpireDate),p.model.ExpireDate=moment(p.model.ExpireDate).format("M/D/YYYY"),p.requestQuoteRemoteSignature&&(p.model.DateString>p.model.ExpireDate?(p.enableRemoteSignatureButton=!1,d.warning("Quote has expired! Remote signature cannot be sent.")):"Pending Signature"!==p.model.QuoteStatus&&(p.enableRemoteSignatureButton=!1,d.warning("Quote status not 'Pending Signature'! Remote signature cannot be sent.")));for(var o=0;o<p.model.QuoteReportMiscs.length;o++)p.miscTotal+=p.model.QuoteReportMiscs[o].ExtendedPrice,p.model.QuoteReportMiscs[o].ExtendedPriceDisplay=p.model.QuoteReportMiscs[o].ExtendedPrice.toFixed(2),p.model.QuoteReportMiscs[o].PriceDisplay=p.model.QuoteReportMiscs[o].Price.toFixed(2);for(o=0;o<p.model.QuoteReportParts.length;o++)p.partTotal+=p.model.QuoteReportParts[o].ExtendedPrice,p.model.QuoteReportParts[o].ExtendedPriceDisplay=p.model.QuoteReportParts[o].ExtendedPrice.toFixed(2),p.model.QuoteReportParts[o].PriceDisplay=p.model.QuoteReportParts[o].Price.toFixed(2);for(o=0;o<p.model.QuoteReportLabors.length;o++)p.laborHoursTotal+=p.model.QuoteReportLabors[o].Hours,p.laborPriceTotal+=p.model.QuoteReportLabors[o].Price,p.model.QuoteReportLabors[o].PricePerHourDisplay=p.model.QuoteReportLabors[o].PricePerHour.toFixed(2),p.model.QuoteReportLabors[o].PriceDisplay=p.model.QuoteReportLabors[o].Price.toFixed(2),p.model.QuoteReportLabors[o].HoursDisplay=p.model.QuoteReportLabors[o].Hours.toFixed(2);p.miscTotalDisplay=p.miscTotal.toFixed(2),p.partTotalDisplay=p.partTotal.toFixed(2),p.laborPriceTotalDisplay=p.laborPriceTotal.toFixed(2),p.laborHoursTotalDislpay=p.laborHoursTotal.toFixed(2),p.ReportTolalDisplay=(p.miscTotal+p.partTotal+p.laborPriceTotal).toFixed(2);for(o=0;o<p.model.QuoteReportNotes.length;o++)p.model.QuoteReportNotes[o].SysModifyUTC=s.parseISOString(p.model.QuoteReportNotes[o].SysModifyUTC),p.model.QuoteReportNotes[o].SysModifyUTC=s.convertToLocal(p.model.QuoteReportNotes[o].SysModifyUTC),p.model.QuoteReportNotes[o].SysModifyUTCString=p.model.QuoteReportNotes[o].SysModifyUTC.toLocaleString("en-us").replace(",","")}),p.modalClass=!1,i(function(){p.modalClass=!0}),p.ok=g,p.clear=function(){var e=$("#signatureCanvas")[0];e.width=e.width,p.model.SignedBy="",$("#signatureCanvas")[0].style.cssText="border: 1px  solid #000000"},p.onBack=R,p.$scope.clearVal=0,p.$scope.saveVal=0,p.requestSignature=function(){if(p.model.ContactEmail)if(m.validateEmailAddress(p.model.ContactEmail)){p.isLoading=!0;var o={Email:p.model.ContactEmail,RecordId:p.quoteId};e.create("quotereports/remoteSignature",o).then(function(e){d.success("The request has been sent!")}).then(function(){R()},function(e){p.isLoading=!1,d.error("There was an error sending the request!")})}else d.error("Invalid request signature email!");else d.error("Enter an Email Address for Request Signature!")}}angular.module("FieldConnectApp").controller("QuoteReportEditController",e),e.$inject=["restService","$scope","$location","$state","ModalService","$timeout","timezoneService","cryptoStorageService","qsService","Notification","fcGeoLocationService","companySettingFactory","emailValidationService"]}();;!function(){"use strict";function e(e,t,a,r,i,l,o,s,n,d,u,c,f,m){var D=this;D.goHome=function(){a.go("home")},D.autoFilter=i.filter("and"),D.isLoading=!1,D.$state=a,D.deviceDetect=f,D.edit=function(e,t){a.go("quoteDetails",{id:e})},D.loadData=!1,D.dateService=m;var S=l.getValue("authorizationData");function g(e,t){return c.getModulePrivilege(e,t)}function I(){if(void 0!==D.filter.startDate){if(!m.validateDate(D.filter.startDate))return}else D.filter.startDate=null;if(void 0!==D.filter.endDate){if(!m.validateDate(D.filter.endDate))return}else D.filter.endDate=null;if(void 0===D.filter.startDate||void 0===D.filter.endDate||m.validateDateRange(D.filter.startDate,D.filter.endDate)){if(D.isLoading=!0,D.loadData=!1,D.autoFilter.reset(),""!=D.filter.startDate&&null!=D.filter.startDate){D.filter.startDate=new Date(D.filter.startDate),D.filter.startDate.setHours(0,0,0,0);var t=new Date(D.filter.startDate);s.convertToUtc(t),D.autoFilter.eq("StartDate",s.buildISOString(t))}if(""!=D.filter.endDate&&null!=D.filter.endDate){D.filter.endDate=new Date(D.filter.endDate),D.filter.endDate.setHours(23,59,59,999);var a=new Date(D.filter.endDate);s.convertToUtc(a),D.autoFilter.eq("EndDate",s.buildISOString(a))}D.autoFilter.eq("SearchDateBy",D.filter.date).eq("Search",D.filter.search).eq("StatusIds",D.filter.quotestatusIds).eq("PriorityIds",D.filter.priortyIds),D.userRoles.indexOf("Technician")>-1&&(D.TechsViewAllQuotes||D.autoFilter.eq("sysCreatorId",D.UserData.Id)),""!=D.filter.altId&&null!=D.filter.altId&&D.autoFilter.eq("AltId",D.filter.altId),D.loadData=!0;var r={};D.filter.startDate&&(r.StartDate=s.buildISOString(D.filter.startDate)),D.filter.endDate&&(r.EndDate=s.buildISOString(D.filter.endDate)),D.filter.date&&(r.SearchDateBy=D.filter.date),D.filter.search&&(r.Search=D.filter.search),D.filter.quotestatusIds&&(r.StatusIds=D.filter.quotestatusIds),D.filter.priortyIds&&(r.PriorityIds=D.filter.priortyIds),D.filter.altId&&(r.AltId=D.filter.altId);var i={};l.getValue("lastselection_"+D.UserData.Id)&&(i=l.getValue("lastselection_"+D.UserData.Id)),i.manageQuote=r,l.setValue("lastselection_"+D.UserData.Id,i),setTimeout(function(){D.isLoading=!1,e.$apply()},1e3)}}D.userRoles=S.userRoles.split(","),D.viewName="ManageQuote",D.moduleName="ManageQuoteGrid",D.reloadData=I,D.getModulePrivilege=g,g(),D.filter={date:"Create"},D.autofilter=i.filter("and"),D.attributestab=[{Name:"Quote",ValueName:"AltId",Edit:!0,Sortable:!0},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0,ObjectName:"colCustomerName"},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0,ObjectName:"colSiteName"},{Name:"Address",ValueName:"FullAddress",Edit:!1,Sortable:!0,ObjectName:"colAddress"},{Name:"Wo Type",ValueName:"WoTypeName",Edit:!1,Sortable:!0,ObjectName:"colWoTypeName"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0,ObjectName:"colDesc"},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0,ObjectName:"colStatus"},{Name:"Priority",ValueName:"PriorityName",Edit:!1,Sortable:!0,ObjectName:"colPriorityName"},{Name:"Created On",ValueName:"SysCreateUTC",FormatDate:"datetime",Edit:!1,Sortable:!0,ObjectName:"colSysCreateUTC"},{Name:"Expires On",ValueName:"ExpireDate",FormatDate:"date",Edit:!1,Sortable:!0,ObjectName:"colExpireDate"}],D.loadingIndicator=!1,D.TechsViewAllQuotes=!1,d.getCurrentUserData().then(function(e){D.isLoading=!0,D.UserData=e,n.getCompanySettings().then(function(e){D.TechsViewAllQuotes=n.TechsViewAllQuotes;var t=l.getValue("lastselection_"+D.UserData.Id);t&&t.manageQuote?u(function(){t.manageQuote.StartDate&&(D.filter.startDate=s.parseISOString(t.manageQuote.StartDate)),t.manageQuote.EndDate&&(D.filter.endDate=s.parseISOString(t.manageQuote.EndDate)),t.manageQuote.SearchDateBy&&(D.filter.date=t.manageQuote.SearchDateBy),t.manageQuote.Search&&(D.filter.search=t.manageQuote.Search),t.manageQuote.StatusIds&&(D.filter.quotestatusIds=t.manageQuote.StatusIds),t.manageQuote.PriorityIds&&(D.filter.priortyIds=t.manageQuote.PriorityIds),t.manageQuote.AltId&&(D.filter.altId=t.manageQuote.AltId),I()}):I()})})}angular.module("FieldConnectApp").controller("ManageQuoteController",e),e.$inject=["$scope","$location","$state","$stateParams","qsService","cryptoStorageService","restService","timezoneService","currentCompanyService","currentUserService","$timeout","guiPrivilegeService","deviceDetector","dateService"]}();;!function(){"use strict";function e(e,t,o,i,a,r,l,d,s,m,n,u,c,p,S,I,C,y){var b=this;b.$state=o,b.model={StatusId:null},b.id=i.id,b.id?(b.viewName="QuoteDetails",b.moduleName="QuoteHeader"):(b.viewName="NewQuote",b.moduleName="NewQuote"),b.notreadOnlySubmit=!0,b.notreadOnlyLabor=!0,b.notreadOnlyParts=!0,b.notreadOnlyMisc=!0,b.notreadOnlyNote=!0,b.notreadOnlyReport=!0,b.notreadOnlyAttachments=!0,b.usingDSLNorthwest=p.usingDSLNorthwest,b.apiMethod="quotes",b.usingDSLNorthwest&&(b.apiMethod="dslQuotes"),b.reloadNotesPanel=!0,b.filterNotesTab="Quote Notes",b.filterAttachmentsTab="Quote Attachments",b.deficiencyService=new y,b.isLoading=!1,b.isDeficiency=!1,b.showDeficiencyGrid=!1,b.params=t.$$search,b.hideDefiencyTab="hidden",b.params.isDeficiency&&(d.warning("Importing Deficiency, please wait..."),b.isLoading=!0,b.isDeficiency=JSON.parse(b.params.isDeficiency.trim().toLowerCase()),b.deficiencyId=b.params.DeficiencyId,t.search({}),b.deficiencyDetailFilter=a.filter("and"),b.deficiencyDetailFilter.eq("Id",b.deficiencyId),b.deficiencyService.getDeficiencies(b.deficiencyDetailFilter).then(function(e){b.deficiencyModel=e[0],l.getItem("wodetails",b.deficiencyModel.WoId).then(function(e){b.woModel=e.data,l.getItem("customers",b.woModel.CustomerId).then(function(e){b.customerModel=e.data,l.getItem("sites",b.woModel.SiteId).then(function(e){b.siteModel=e.data,l.getItems("wotypes").then(function(){b.woTypes=l.state.items}).then(function(){w(b.customerModel),x(b.siteModel),n(function(){b.model.DeficiencyId=b.deficiencyId,b.model.Desc=b.deficiencyModel.Description,b.model.ServiceableItemId=b.deficiencyModel.ServiceableItemId,b.model.WoAltId=b.deficiencyModel.AltId;for(var e=0;e<b.woTypes.length;e++)b.woTypes[e].WoTypeName===b.woModel.WoType&&(b.model.WoTypeId=b.woTypes[e].Id);b.isLoading=!1})},function(e){b.isLoading=!1})})})})})),I.getCompanySettings().then(function(e){b.attDescription.MaxLength=I.WODescMaxLength,function(){if(b.attributes=[N,D,h,T,b.attDescription,b.id?L:g,{Type:"text",Label:"Requested By",ModelValue:"",CustomInputClass:"hidden"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Name:",Required:!1,MaxLength:"100",ModelValue:"ContactName",TabIndex:4},{Type:"datepicker",Label:"Request Date:",ModelValue:"RequestDate",Format:"MM/dd/yyyy",TabIndex:6},{Type:"text",Label:"Phone:",Required:!1,MaxLength:"20",ModelValue:"ContactPhone",TabIndex:5},b.attDeficiencyWONum,{Type:"line",CustomClass:"col-sm-12"},{Type:"dropdown",Label:"Office:",Required:!0,ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true",ObjectName:"ddlWoOffice",TabIndex:7},{Type:"dropdown",Label:"Work Order Type:",Required:!0,ApiMethod:"wotypes",ValueProp:"Id",TextProp:"WoTypeName",ModelValue:"WoTypeId",ObjectName:"ddlWoTypeDropdown",TabIndex:13},{Type:"datepicker",Label:"Expire Date:",ModelValue:"ExpireDate",Format:"MM/dd/yyyy",SubType:"date",Required:!0,TabIndex:8},{Type:"dropdown",Label:"Agreement:",ApiMethod:"agreementsites/getcustomeragreementsite",ValueProp:"AgreementId",TextProp:"Desc",ModelValue:"AgreementId",ConvertToInt:"true",Filter:b.customerSiteFilter,ObjectName:"ddlWoAgreement",TabIndex:14},{Type:"dropdown",Label:"Rate Sheet:",Required:!0,ApiMethod:"ratesheets",ValueProp:"Id",TextProp:"RateSheetName",ModelValue:"RateSheetId",ConvertToInt:"true",ObjectName:"ddlWoRateSheet",TabIndex:9},{Type:"text",Label:"PO Number:",Required:!1,MaxLength:"50",ModelValue:"PONumber",TabIndex:16},{Type:"datepicker",Label:"Promised:",ModelValue:"PromiseDate",Format:"MM/dd/yyyy",Required:!0,TabIndex:11},{Type:"dropdown",Label:"Priority:",Required:!0,ApiMethod:"priorities",ValueProp:"Id",TextProp:"PriorityName",ModelValue:"PriorityId",ObjectName:"ddlWoPriority",TabIndex:18},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"line",CustomClass:"col-sm-12"},{Type:"dropdown",Label:"Problem Code:",Required:!0,ApiMethod:"problemcodes",ValueProp:"Id",TextProp:"ProblemCodeName",ModelValue:"ProblemCodeId",TabIndex:20},v],b.usingDSLNorthwest){b.attDSLFailureResolution={Type:"dropdown",Label:"Reason for Failed Install:",ApiMethod:"dslFailureResolution/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"qoeFailureResolution",ConvertToInt:"true",TabIndex:41},b.attDSLGroundCheck={Type:"checkbox",Label:"Ground Check",Required:!1,ModelValue:"qoeGroundCheck"},b.attDSLLine1={Type:"line",CustomClass:"col-sm-12"},b.attDSLWoExportHeader={Type:"text",Label:"WO Export",ModelValue:"",CustomInputClass:"hidden"},b.attDSLBlank1={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},b.attDSLUnitDown={Type:"checkbox",Label:"Unit Down",ModelValue:"qoeUnitDown",TabIndex:17},b.attDSLRewritePartsReceived={Type:"dropdown",Label:"Rewrite Parts Received:",Required:!1,ApiMethod:"dslPartsReceived/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"qoeRewritePartsReceived",TabIndex:18},b.attDSLIsUnitReplaceAnother={Type:"checkbox",Label:"Is Unit Replace Another",ModelValue:"qoeIsUnitReplaceAnother",TabIndex:17},b.attDSLRecallDueTo={Type:"dropdown",Label:"Recall Due To:",Required:!1,ApiMethod:"dslRecallDueTo/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"qoeRecallDueTo",TabIndex:18},b.attDSLFieldScrapFlag={Type:"checkbox",Label:"Field Scrap Flag",ModelValue:"qoeFieldScrapFlag",TabIndex:17},b.attDSLProcessPracticeFlag={Type:"checkbox",Label:"Process/Practice Flag",ModelValue:"qoeProcessPracticeFlag",TabIndex:17},b.attDSLUnitOperAtDepartureFlag={Type:"checkbox",Label:"Unit Oper. at Departure",ModelValue:"qoeUnitOperAtDeparture",TabIndex:17},b.attDSLBulletinNumber={Type:"text",Label:"Bulletin Number:",Required:!1,MaxLength:"20",ModelValue:"qoeBulletinNumber",TabIndex:5},b.attDSLQualityReportFlag={Type:"checkbox",Label:"Quality Report Flag",ModelValue:"qoeQualityReportFlag",TabIndex:17},b.attDSLCertificationNumber={Type:"text",Label:"Certification Number:",Required:!1,MaxLength:"20",ModelValue:"qoeCertificationNumber",TabIndex:5},b.attDSLPreviousUnitFieldSerialNumber={Type:"text",Label:"Previous Unit Field Serial No.:",Required:!1,MaxLength:"20",ModelValue:"qoePreviousUnitFieldSerialNumber",TabIndex:5},b.attDSLPurchasedFromDistributor={Type:"dropdown",Label:"Purchased From Distributor:",Required:!1,ApiMethod:"dslDistributor/ddList",ValueProp:"Id",TextProp:"Name",ModelValue:"qoePurchasedFromDistributor",TabIndex:18},b.DSLServiceZoneCode={Type:"dropdown",Label:"Service Zone Code:",ApiMethod:"dslServiceZoneCode/ddList",ValueProp:"Id",TextProp:"Code",ModelValue:"CustomerUser8",ConvertToInt:"true",ReadOnly:!0},b.attDSLLine2={Type:"line",CustomClass:"col-sm-12"},b.attDSLRewrite={Type:"checkbox",Label:"Rewrite",ModelValue:"User4",TabIndex:17},b.attDSLRecall={Type:"checkbox",Label:"Recall",ModelValue:"User5",TabIndex:17},b.attDSLFactoryServiceOrderType={Type:"dropdown",Label:"Factory Service Order Type:",ApiMethod:"dslServiceOrderType/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"User8",ConvertToInt:"true"},b.attDSLVisits={Type:"text",Label:"Visits:",ModelValue:"DSLVisits",ReadOnly:!0},b.attDSLAuthorizedBy={Type:"text",Label:"Authorized By:",Required:!1,MaxLength:"20",ModelValue:"User0",TabIndex:5},b.attDSLAdditionalDetailsHeader={Type:"text",Label:"Additional Details",ModelValue:"",CustomInputClass:"hidden"},b.attDSLLine3={Type:"line",CustomClass:"col-sm-12"},b.attDSLLine4={Type:"line",CustomClass:"col-sm-12"},b.attDSLBlank2={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},b.attDSLBlank3={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},b.dslServiceableItemFilter=a.filter("and"),b.dslServiceableItemFilter.eq("SiteId",0),v.ApiMethod="serviceableitems/dsldropdownbysite",v.TextProp="DDLabel",v.Filter=b.dslServiceableItemFilter,v.Required=b.isOnlyTech;var e=[b.attDSLFailureResolution,b.attDSLGroundCheck,b.attDSLLine1,b.attDSLAdditionalDetailsHeader,b.attDSLBlank1,b.attDSLRewrite,b.attDSLRecall,b.attDSLFactoryServiceOrderType,b.attDSLVisits,b.attDSLAuthorizedBy,b.DSLServiceZoneCode,b.attDSLLine4,b.attDSLWoExportHeader,b.attDSLBlank2,b.attDSLUnitDown,b.attDSLRewritePartsReceived,b.attDSLIsUnitReplaceAnother,b.attDSLRecallDueTo,b.attDSLFieldScrapFlag,b.attDSLProcessPracticeFlag,b.attDSLUnitOperAtDepartureFlag,b.attDSLBulletinNumber,b.attDSLQualityReportFlag,b.attDSLCertificationNumber,b.attDSLPreviousUnitFieldSerialNumber,b.attDSLPurchasedFromDistributor];b.attributes=b.attributes.concat(e)}b.reloadTable=!0}()}),b.filter1={rateSheetId:null},b.customerId=0,b.customer={customerId:0},b.customers=[],b.site={siteId:0},b.focusOut=function(e){e&&e.hasOwnProperty("FocusOut")&&e.FocusOut&&("CustomerName"===e.ModelValue&&(b.CustomerNameTemp=angular.copy(b.model.CustomerName),null==b.model.CustomerId&&(b.model.CustomerName=null)),"SiteName"===e.ModelValue&&(b.SiteNameTemp=angular.copy(b.model.SiteName),null==b.model.SiteId&&(b.model.SiteName=null)))},b.submit=function(e){e?(b.id?d.success({message:"Quote has been successfully updated."}):d.success({message:"Quote has been successfully created."}),s.scrollTo(0,0),e.Quote&&e.Quote.Id>0&&(b.quoteNumber=e.Quote.Id,b.altNumber=e.Quote.AltId,b.model.Desc=""),b.isDeficiency&&b.deficiencyId&&b.deficiencyService.getConversionStatusNameId().then(function(e){e&&(b.deficiencyModel.StatusId=e),b.deficiencyModel.Converted=!0,l.update("deficiency",b.deficiencyModel).then(function(){})})):b.isDeficiency&&b.deficiencyId?b.$state.go("manageDeficiency"):b.$state.go("manageQuote")},b.selectCustomer=P,b.selectSite=R,b.getModulePrivilege=function(e,t){return m.getModulePrivilege(e,t)},b.openWo=function(){o.go("workOrdersDetails",{id:b.woId})},b.quoteNumber=0,b.filterByQuote=a.filter("and"),b.filterByQuote.eq("QuoteId",b.id),b.filterPartsByQuote=a.filter("and"),b.filterPartsByQuote.eq("QuoteId",b.id).eq("SaleType","Parts"),b.filterMiscByQuote=a.filter("and"),b.filterMiscByQuote.eq("QuoteId",b.id).eq("SaleType","Misc"),b.customerFilter=a.filter("and"),b.customerSiteFilter=a.filter("and"),b.serviceableItemFilter={siteId:null};var f=u.getValue("authorizationData").userRoles.split(",");b.isOnlyTech=1==f.length&&"Technician"==f[0],b.userRole=null,b.isOnlyTech&&(b.userRole="Technician"),b.altNumber=0,b.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],b.searchColsSite=["Search"],b.siteAutocompleteFilter=a.filter("or"),b.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}],b.ddlgridattrsSite=[{Name:"Customer",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Site Code",ValueName:"SiteCode",Sortable:!0,CellFormat:"label"},{Name:"Site Name",ValueName:"SiteName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"FullAddress",Sortable:!0,CellFormat:"label"}];var N={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:w,SearchTrigger:1,Label:"Customer:",Required:!0,ApiMethod:"customers/active",ModelValue:"CustomerName",Id:"CustomerName",GridAttributes:b.ddlgridattrsCustomer,PageSize:22,SearchCols:b.searchColsCustomer,Autofocus:"true",TabIndex:1,ObjectName:"btnCustomerSearch"},h={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:x,SearchTrigger:1,Label:"Site:",Required:!0,ApiMethod:"sites/searchgrid",ModelValue:"SiteName",filter:b.siteAutocompleteFilter,Id:"SiteName",GridAttributes:b.ddlgridattrsSite,PageSize:22,SearchCols:b.searchColsSite,TabIndex:2,ObjectName:"btnSiteSearch"},T={Type:"button",Label:"Search",onClick:R,ReadOnly:!1,ObjectName:"btnSiteSearch"},D={Type:"button",Label:"Search",onClick:P,ObjectName:"btnCustomerSearch"},L={Type:"dropdown",Label:"Status:",ReadOnly:!0,ApiMethod:"quotestatuses",ValueProp:"Id",TextProp:"Status",ModelValue:"StatusId",ObjectName:"ddlStatusDropdown",TabIndex:2},g={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},v={Type:"dropdown",Label:"Serviceable Item:",ApiMethod:"serviceableitems/dropdownbysite",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",Filter:b.serviceableItemFilter,TabIndex:21};b.attDescription={Type:"textarea",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Desc",TabIndex:3},b.attDeficiencyWONum={Type:"text",Label:"Deficiency WO#:",ModelValue:"WoAltId",ReadOnly:!0},b.CustomerNameTemp="",b.SiteNameTemp="",e.$on("CustomerNameSearching",function(e,t){b.model.CustomerId=null,b.model.SiteId=null,b.model.SiteName=null,b.SiteNameTemp=null}),e.$on("SiteNameSearching",function(e,t){b.model.SiteId=null});var F=!0,M=e.$watch("vm.model.ExpireDate",function(){!b.model.ExpireDate&&F&&(b.companySettingsFilter=a.filter("or"),b.companySettingsFilter.eq("Name","ExpiryPeriod"),l.getItems("companysettings",b.companySettingsFilter).then(function(e){for(var t=e.data.Data,o=0;o<t.length;o++)"ExpiryPeriod"===t[o].Name&&t[o].Value&&(b.model.ExpireDate=new Date,b.model.ExpireDate.setDate(b.model.ExpireDate.getDate()+parseInt(t[o].Value)),b.model.ExpireDate.setHours(23),b.model.ExpireDate.setMinutes(59),b.model.ExpireDate.setSeconds(59),F=!1,M())}))});function w(t){t.CreditHold?bootbox.confirm("The customer "+t.CustomerName+" is on credit hold!",function(o){n(function(){o?(t.CustomerCode&&""!=t.CustomerCode?b.model.CustomerName=t.CustomerCode+" - "+t.CustomerName:b.model.CustomerName=t.CustomerName,b.CustomerNameTemp=b.model.CustomerName,b.model.CustomerId=t.Id,b.model.SiteId=null,b.model.SiteName=null,b.SiteNameTemp=null,C.getDefaultSite(t.Id).then(function(e){null!==e&&x(e)})):(b.CustomerNameTemp=null,b.model.CustomerName=null,b.model.CustomerId=null,b.model.SiteId=null,b.model.SiteName=null,b.SiteNameTemp=null),e.$apply()})}):(t.CustomerCode&&""!=t.CustomerCode?b.model.CustomerName=t.CustomerCode+" - "+t.CustomerName:b.model.CustomerName=t.CustomerName,b.CustomerNameTemp=b.model.CustomerName,b.model.CustomerId=t.Id,b.model.SiteId=null,b.model.SiteName=null,b.SiteNameTemp=null,b.usingDSLNorthwest&&(b.model.CustomerUser8=t.User8),C.getDefaultSite(t.Id).then(function(e){null!==e&&x(e)}),n(function(){document.querySelector("#SiteNameinput").focus()}))}function x(t){t.SiteCode&&""!=t.SiteCode?b.model.SiteName=t.SiteCode+" - "+t.SiteName:b.model.SiteName=t.SiteName,n(function(){document.getElementsByName("Desc")[0].focus()}),b.SiteNameTemp=b.model.SiteName,b.model.SiteId=t.Id,b.model.ContactName=t.ContactName,b.model.ContactPhone=t.Phone,b.model.RateSheetId=t.RateSheetId,b.serviceableItemFilter.siteId=t.Id,b.model.OfficeId=t.OfficeId,l.getItem("sites/",t.Id).then(function(t){var o=t.data;(!b.model.CustomerId||0===b.model.CustomerId&&o.CustomerId)&&l.getItem("customers/",o.CustomerId).then(function(t){var o=t.data;o.CreditHold?bootbox.confirm("The customer "+o.CustomerName+" is on credit hold!",function(t){n(function(){t?(b.model.CustomerId=o.Id,o.CustomerCode&&""!=o.CustomerCode?b.model.CustomerName=o.CustomerCode+" - "+o.CustomerName:b.model.CustomerName=o.CustomerName,b.CustomerNameTemp=b.model.CustomerName):(b.model.SiteName=null,b.SiteNameTemp=null,b.model.SiteId=null,b.model.ContactName=null,b.model.ContactPhone=null,b.model.RateSheetId=null,b.serviceableItemFilter.siteId=0,b.model.OfficeId=null),e.$apply()})}):(b.model.CustomerId=o.Id,o.CustomerCode&&""!=o.CustomerCode?b.model.CustomerName=o.CustomerCode+" - "+o.CustomerName:b.model.CustomerName=o.CustomerName,b.CustomerNameTemp=b.model.CustomerName)})})}function P(){var e="";if(b.model.CustomerId)e=angular.copy(b.model.CustomerName);else if(b.CustomerNameTemp){e=angular.copy(b.CustomerNameTemp);b.CustomerNameTemp=""}r.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectCustomer.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:b.customer,viewName:b.viewName,customerName:e,onSelect:w}})}function R(){var e="";if(b.model.SiteId)e=angular.copy(b.model.SiteName);else if(b.SiteNameTemp){e=angular.copy(b.SiteNameTemp);b.SiteNameTemp=""}r.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectSite.html",controller:"SelectSiteController",controllerAs:"vm",inputs:{site:b.site,customerId:b.model.CustomerId,customerUserSitesFilter:b.customerUserSitesFilter,viewName:b.viewName,siteName:e,onSelect:x}})}e.$watch("vm.model.Id",function(){b.model.Id&&(b.customer.customerId=b.model.CustomerId,b.site.siteId=b.model.SiteId,b.site.siteName=b.model.SiteName,b.site.title=b.model.ContactName,b.site.phone=b.model.ContactPhone,b.site.address=b.model.Address,b.serviceableItemFilter.siteId=b.model.SiteId,b.altId=b.model.AltId,b.woId=b.model.WoId,b.woAltId=b.model.WoAltId,b.model.DeficiencyId&&(b.deficiencyFilter=a.filter("and"),b.deficiencyFilter.eq("DeficiencyId",b.model.DeficiencyId),b.deficiencyNoteAttributesGrid=b.deficiencyService.getDeficiencyNotesGridAttributes(),b.deficiencyAttachmentAttributesGrid=b.deficiencyService.getDeficiencyAttachmentsGridAttributes(),b.showDeficiencyGrid=!0,b.hideDefiencyTab="",b.reloadNotesPanel=!1,n(function(){b.reloadNotesPanel=!0}),b.deficiencyDetailFilter=a.filter("and"),b.deficiencyDetailFilter.eq("Id",b.model.DeficiencyId),b.deficiencyService.getDeficiencies(b.deficiencyDetailFilter).then(function(e){b.model.WoAltId=e[0].AltId})),n(function(){var t;N.ReadOnly=!0,h.ReadOnly=!0,T.ReadOnly=!0,D.ReadOnly=!0,b.attDeficiencyWONum.ReadOnly=!0,b.usingDSLNorthwest&&(t=b.model.CustomerId,l.getItem("customers/",t).then(function(){var t=l.state.item;b.usingDSLNorthwest&&(b.model.CustomerUser8=t.User8),t.CreditHold?bootbox.confirm("The customer "+t.CustomerName+" is on credit hold!",function(o){n(function(){o?(b.customer.customerId=t.Id,b.customer.customerName=t.CustomerName,b.customer.customerCode=t.CustomerCode):(b.model.SiteId="",b.model.SiteName="",b.site.siteId=0),e.$apply()})}):(b.customer.customerId=t.Id,b.customer.customerName=t.CustomerName,b.customer.customerCode=t.CustomerCode)}),b.DSLServiceZoneCode.ReadOnly=!0,S.getVisits(b.model.SiteId).then(function(e){b.model.DSLVisits=e,b.attDSLVisits.ReadOnly=!0}))},1e3))}),e.$watch("vm.model.SiteId",function(){b.model.SiteId?(b.customerSiteFilter.reset(),b.customerSiteFilter.eq("CustomerId",b.model.CustomerId),b.customerSiteFilter.eq("SiteId",b.model.SiteId),b.usingDSLNorthwest&&(b.dslServiceableItemFilter.reset(),b.dslServiceableItemFilter.eq("SiteId",b.model.SiteId),S.getVisits(b.model.SiteId).then(function(e){b.model.DSLVisits=e}))):(b.customerSiteFilter.reset(),b.customerSiteFilter.eq("CustomerId",0))}),e.$watch("vm.model.RateSheetId",function(){null!=b.model.RateSheetId&&b.model.RateSheetId>0&&(b.filter1.rateSheetId=b.model.RateSheetId)}),b.statusFilter=a.filter("and"),b.statusFilter.eq("Status","Pending Details");M=e.$watch("vm.model",function(){b.model&&(l.getItems("quotestatuses",b.statusFilter).then(function(e){b.model.StatusId=e.data.Data[0].Id}),M())});e.$watch("vm.model.CustomerId",function(){b.siteAutocompleteFilter.reset(),b.model.CustomerId?(b.customerFilter.reset(),b.customerFilter.eq("Status","Active"),b.customerFilter.customerId=b.model.CustomerId,b.model.SiteId&&(b.customerSiteFilter.reset(),b.customerSiteFilter.eq("CustomerId",b.model.CustomerId),b.customerSiteFilter.eq("SiteId",b.model.SiteId)),b.siteAutocompleteFilter.reset(),b.siteAutocompleteFilter.eq("CustomerId",b.model.CustomerId)):(b.customerFilter.reset(),b.customerFilter.eq("Status","Active"),b.customerFilter.customerId=0)}),b.initialiseGrid=function(e){switch(e){case"approvalsGrid":b.approvalsGrid=!0;break;case"notesGrid":b.notesGrid=!0;break;case"laborGrid":b.laborGrid=!0;break;case"partsGrid":b.partsGrid=!0;break;case"miscGrid":b.miscGrid=!0;break;case"attachmentsGrid":b.attachmentsGrid=!0;break;case"reportsGrid":b.reportsGrid=!0;break;default:b.assignmentsGrid=!0,b.notesGrid=!0,b.laborGrid=!0,b.partsGrid=!0,b.miscGrid=!0,b.attachmentsGrid=!0,b.reportsGrid=!0}},b.approvalsGrid=!1,b.notesGrid=!1,b.laborGrid=!1,b.partsGrid=!1,b.miscGrid=!1,b.attachmentsGrid=!1,b.reportsGrid=!1,b.loadingIndicator=!1,b.serveportGrid=!0,b.initialiseApprovall=!0,b.setWindowPosition=!1,e.$on("quoteHeaderApprovalsRefresh",function(){var e={posX:s.pageXOffset,posY:s.pageYOffset};u.setValue("pageposition",e),b.initialiseApprovall=!1,b.reloadTable=!1,n(function(){b.initialiseApprovall=!0,b.reloadTable=!0,b.setWindowPosition=!0})}),b.windowPos=function(){var e=u.getValue("pageposition");e&&n(function(){var t=L.CurrentList,o=c.Enumerable().From(t).Where(function(e){return e.Id==b.model.StatusId}).FirstOrDefault();"Approved"===o.Status&&(angular.element(document.querySelector("#collapseOne"))[0].className="panel-collapse collapse in"),s.scrollTo(e.posX,e.posY),u.removeValue("pageposition"),b.setWindowPosition=!1})}}angular.module("FieldConnectApp").controller("QuoteEditController",e),e.$inject=["$scope","$location","$state","$stateParams","qsService","ModalService","restService","Notification","$window","guiPrivilegeService","$timeout","cryptoStorageService","$linq","featuresFactory","dslVisitsService","currentCompanyService","customerService","deficiencyService"]}();;!function(){"use strict";function t(t,e,s,a){var i=this;i.edit=function(t){s.go("assigmentStatusesTableEdit",{id:t})},i.attributes=[{Name:"Assignment Status Name",ValueName:"AssignmentStatusName",Edit:!0,Sortable:!0}],i.editAttributes=[{Type:"text",Label:"Assignment Status:",Required:!0,MaxLength:"15",ModelValue:"AssignmentStatusName"}],i.filter={Reload:0},i.model={SiteId:"test"}}angular.module("FieldConnectApp").controller("AssignmentStatusController",t),t.$inject=["$scope","$location","$state","ModalService"]}();;!function(){"use strict";function t(t,e,n,a){var s=this;s.$state=n,s.model={},s.attributes=[{Type:"text",Label:"Assignment Status:",Required:!0,MaxLength:"15",ModelValue:"AssignmentStatusName",Autofocus:"true"}],s.id=a.id,s.loadingIndicator=!1}angular.module("FieldConnectApp").controller("AssignmentStatusEditController",t),t.$inject=["$scope","$location","$state","$stateParams"]}();;!function(){"use strict";function t(t,e,o){this.edit=function(t){o.go("assignmentStatusColorsEdit",{id:t})},this.$state=o,this.attributes=[{Size:200,Name:"Assignment Status",ValueName:"AssignmentStatusName",Edit:!0,Sortable:!0},{Size:200,Name:"Color Code",ValueName:"ColorCode",Sortable:!0,CellFormat:"color"}]}angular.module("FieldConnectApp").controller("AssignmentStatusColorController",t),t.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function t(t,e,s,o,n){var a=this;if(a.$state=s,a.model={},a.attributes=[{Type:"dropdown",Label:"Assignment Status:",Required:!0,ApiMethod:"assignmentstatuses/forAssignmentStatusColor",ValueProp:"Id",TextProp:"AssignmentStatusName",ModelValue:"AssignmentStatusId",ConvertToInt:"true",Autofocus:"true"},{Type:"colorpicker",Label:"Color Code:",Required:!0,ModelValue:"ColorCode"}],a.id=o.id,a.id){var i={};n.getItem("assignmentstatuscolors/"+a.id).then(function(){i=n.state.item;a.model.AssignmentStatusId=i.AssignmentStatusId,a.attributes[0]={Type:"dropdown",Label:"Assignment Status:",Required:!0,ApiMethod:"assignmentstatuses",ValueProp:"Id",TextProp:"AssignmentStatusName",ModelValue:"AssignmentStatusId",ConvertToInt:"true",Autofocus:"true",ReadOnly:"true"}})}a.loadingIndicator=!1}angular.module("FieldConnectApp").controller("AssignmentStatusColorEditController",t),t.$inject=["$scope","$location","$state","$stateParams","restService"]}();;!function(){"use strict";function t(t,e,a,o){this.edit=function(t){a.go("attachmentCategoriesTableEdit",{id:t})},this.attachmentCategoryService=o,this.attributes=[{Size:250,Name:"Attachment Category",ValueName:"AttachmentCategoryName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("AttachmentCategoryController",t),t.$inject=["$scope","$location","$state","attachmentCategoryService"]}();;!function(){"use strict";function t(t,a,e,n,o){var c=this;c.$state=e,c.goBack=function(){e.go("attachmentCategoriesTable")},c.goHome=function(){e.go("home")},c.submit=function(){var t={};t.AttachmentCategoryName=c.AttachmentCategoryName,c.loadingIndicator=!0,n.id?(t.Id=parseInt(n.id),o.update(t).then(function(){c.loadingIndicator=!1,e.go("attachmentCategoriesTable")})):o.create(t).then(function(){c.loadingIndicator=!1,e.go("attachmentCategoriesTable")})},c.goClear=function(){c.AttachmentCategoryName=""},c.attachmentCategoryState=o.state,c.AttachmentCategoryName="",c.loadingIndicator=!1,n.id&&o.getAttachmentCategory(n.id).then(function(){c.AttachmentCategoryName=c.attachmentCategoryState.attachmentCategory.AttachmentCategoryName})}angular.module("FieldConnectApp").controller("AttachmentCategoryEditController",t),t.$inject=["$scope","$location","$state","$stateParams","attachmentCategoryService"]}();;!function(){"use strict";function t(t,e,a,n){this.edit=function(t){a.go("attachmentTypesTableEdit",{id:t})},this.attachmentTypeService=n,this.attributes=[{Size:250,Name:"Attachment Type",ValueName:"AttachmentTypeName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("AttachmentTypeController",t),t.$inject=["$scope","$location","$state","attachmentTypeService"]}();;!function(){"use strict";function t(t,e,a,o,n){var c=this;c.$state=a,c.goBack=function(){a.go("attachmentTypesTable")},c.goHome=function(){a.go("home")},c.model={},c.attachmentTypeState=n.state,c.attributes=[{Type:"text",Label:"Attachment Type:",Required:!0,MaxLength:"20",ModelValue:"AttachmentTypeName",Autofocus:"true"}],c.id=o.id,c.loadingIndicator=!1}angular.module("FieldConnectApp").controller("AttachmentTypeEditController",t),t.$inject=["$scope","$location","$state","$stateParams","attachmentTypeService"]}();;!function(){"use strict";function i(i,e,l,t){this.edit=function(i){l.go("billingPeriodsTableEdit",{id:i})},this.billingPeriodService=t,this.attributes=[{Size:250,Name:"Billing Period",ValueName:"BillingPeriodName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("BillingPeriodController",i),i.$inject=["$scope","$location","$state","billingPeriodService"]}();;!function(){"use strict";function e(e,i,t,l,o){var n=this;n.$state=t,n.model={},n.billingPeriodState=o.state,n.attributes=[{Type:"text",Label:"Billing Period:",Required:!0,MaxLength:"20",ModelValue:"BillingPeriodName",Autofocus:"true"}],n.id=l.id,n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("BillingPeriodEditController",e),e.$inject=["$scope","$location","$state","$stateParams","billingPeriodService"]}();;!function(){"use strict";function i(i,e,l,t){this.edit=function(i){l.go("billingTypesTableEdit",{id:i})},this.billingTypeService=t,this.attributes=[{Size:250,Name:"Billing Type",ValueName:"BillingTypeName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("BillingTypeController",i),i.$inject=["$scope","$location","$state","billingTypeService"]}();;!function(){"use strict";function e(e,t,i,l,n){var a=this;a.$state=i,a.model={},a.billingTypeState=n.state,a.attributes=[{Type:"text",Label:"Billing Type:",Required:!0,MaxLength:"20",ModelValue:"BillingTypeName",Autofocus:"true"}],a.id=l.id,a.loadingIndicator=!1}angular.module("FieldConnectApp").controller("BillingTypeEditController",e),e.$inject=["$scope","$location","$state","$stateParams","billingTypeService"]}();;!function(){"use strict";function e(e,t,a,i){this.edit=function(e){a.go("causesTableEdit",{id:e})},this.causeService=i,this.attributes=[{Name:"Cause",ValueName:"CauseName",Edit:!0,Sortable:!0},{Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("CauseController",e),e.$inject=["$scope","$location","$state","causeService"]}();;!function(){"use strict";function e(e,t,a,o,u){var s=this;s.$state=o,s.model={},s.causesState=u.state,s.attributes=[{Type:"text",Label:"Cause:",Required:!0,MaxLength:"50",ModelValue:"CauseName",Autofocus:"true"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],s.id=a.id,s.loadingIndicator=!1}angular.module("FieldConnectApp").controller("CauseEditController",e),e.$inject=["$scope","$location","$stateParams","$state","causeService"]}();;!function(){"use strict";function t(t,e,o,n){this.edit=function(t){o.go("countriesTableEdit",{id:t})},this.countryService=n,this.attributes=[{Name:"Country  Name",ValueName:"CountryName",Edit:!0,Sortable:!0},{Name:"Country ISO Code",ValueName:"CountryISOCode",Sortable:!0}]}angular.module("FieldConnectApp").controller("CountryController",t),t.$inject=["$scope","$location","$state","countryService"]}();;!function(){"use strict";function t(t,n,o,e,a){var c=this;c.$state=o,c.goBack=function(){o.go("referenceTables")},c.goHome=function(){o.go("home")},c.submit=function(){var t={};t.Name=c.Name,c.loadingIndicator=!0,e.id?(t.Id=e.id,a.update(t).then(function(){c.loadingIndicator=!1,o.go("countriesTable")})):a.create(t).then(function(){c.loadingIndicator=!1,o.go("countriesTable")})},c.countryState=a.state,c.Name=c.countryState.country.Name,c.loadingIndicator=!1,e.id&&a.getCountry(e.id).then(function(){c.Name=c.countryState.country.Name})}angular.module("FieldConnectApp").controller("CountryEditController",t),t.$inject=["$scope","$location","$state","$stateParams","countryService"]}();;!function(){"use strict";function t(t,e,o,a,n){var r=this;r.$state=a,r.model={},r.countriesState=n.state,r.attributes=[{Type:"text",Label:"Country Name:",Required:!0,MaxLength:"50",ModelValue:"CountryName",Autofocus:"true"},{Type:"text",Label:"Country ISO Code:",Required:!0,MaxLength:"5",ModelValue:"CountryISOCode"}],r.id=o.id,r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("CountryEditController",t),t.$inject=["$scope","$location","$stateParams","$state","countryService"]}();;!function(){"use strict";function e(e,a,r,t){this.edit=function(e){r.go("currenciesTableEdit",{id:e})},this.currencyService=t,this.attributes=[{Name:"Currency Code",ValueName:"CurrencyCode",Edit:!0,Sortable:!0},{Name:"Country",ValueName:"Country",Sortable:!0},{Name:"Currency Symbol",ValueName:"CurrencySymbol",Sortable:!0},{Name:"Decimal Punctuation Mark",ValueName:"DecimalSign",Sortable:!0},{Name:"Decimal Places",ValueName:"DecimalPlace",Sortable:!0}]}angular.module("FieldConnectApp").controller("CurrencyController",e),e.$inject=["$scope","$location","$state","currencyService"]}();;!function(){"use strict";function e(e,t,a,o){var r=this;r.$state=o,r.model={},r.attributes=[{Type:"text",Label:"Currency Code:",Required:!0,MaxLength:"10",ModelValue:"CurrencyCode",Autofocus:"true"},{Type:"dropdown",Label:"Country:",Required:!0,ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country"},{Type:"text",Label:"Currency Symbol:",Required:!0,MaxLength:"5",ModelValue:"CurrencySymbol"},{Type:"text",Label:"Decimal Punctuation Mark:",Required:!1,MaxLength:"1",ModelValue:"DecimalSign"},{Type:"int",Label:"Decimal Place:",Required:!1,Max:"255",ModelValue:"DecimalPlace"}],r.id=a.id,r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("CurrencyEditController",e),e.$inject=["$scope","$location","$stateParams","$state"]}();;!function(){"use strict";function e(e,t,i,n){this.edit=function(e){i.go("dslActionTakenTableEdit",{id:e})},this.DSLActionTakenService=n,this.attributes=[{Size:250,Name:"Code",ValueName:"Code",Edit:!0,Sortable:!0},{Size:500,Name:"Description",ValueName:"Description"}]}angular.module("FieldConnectApp").controller("DSLActionTakenController",e),e.$inject=["$scope","$location","$state","DSLActionTakenService"]}();;!function(){"use strict";function e(e,t,o,a,i){var n=this;n.$state=a,n.model={},n.DSLActionTakenState=i.state,n.attributes=[{Type:"text",Label:"Code:",Required:!0,MaxLength:"250",ModelValue:"Code",Autofocus:"true"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"500",ModelValue:"Description"}],n.id=o.id,n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("DSLActionTakenEditController",e),e.$inject=["$scope","$location","$stateParams","$state","DSLActionTakenService"]}();;!function(){"use strict";function e(e,i,t,l){this.edit=function(e){t.go("dslApplicableCodeTableEdit",{id:e})},this.DSLApplicableCodeService=l,this.attributes=[{Size:250,Name:"Type",ValueName:"Type",Edit:!0,Sortable:!0},{Size:250,Name:"Code",ValueName:"Code",Sortable:!0},{Size:500,Name:"Description",ValueName:"Description"}]}angular.module("FieldConnectApp").controller("DSLApplicableCodeController",e),e.$inject=["$scope","$location","$state","DSLApplicableCodeService"]}();;!function(){"use strict";function e(e,t,o,a,l){var i=this;i.$state=a,i.model={},i.DSLApplicableCodeState=l.state,i.attributes=[{Type:"text",Label:"Type:",Required:!0,MaxLength:"250",ModelValue:"Type",Autofocus:"true"},{Type:"text",Label:"Code:",Required:!0,MaxLength:"250",ModelValue:"Code",Autofocus:"true"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"500",ModelValue:"Description"}],i.id=o.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("DSLApplicableCodeEditController",e),e.$inject=["$scope","$location","$stateParams","$state","DSLApplicableCodeService"]}();;!function(){"use strict";function t(t,e,i,a){this.edit=function(t){i.go("dslDistributorTableEdit",{id:t})},this.DSLDistributorService=a,this.attributes=[{Size:250,Name:"Distributor Id",ValueName:"DistributorId",Edit:!0,Sortable:!0},{Size:250,Name:"Name",ValueName:"Name",Sortable:!0},{Size:500,Name:"City",ValueName:"City"},{Size:500,Name:"State",ValueName:"State"}]}angular.module("FieldConnectApp").controller("DSLDistributorController",t),t.$inject=["$scope","$location","$state","DSLDistributorService"]}();;!function(){"use strict";function t(t,e,a,i,r){var o=this;o.$state=i,o.model={},o.DSLDistributorState=r.state,o.attributes=[{Type:"text",Label:"Distributor Id:",Required:!0,MaxLength:"250",ModelValue:"DistributorId",Autofocus:"true"},{Type:"text",Label:"Name:",Required:!0,MaxLength:"250",ModelValue:"Name"},{Type:"text",Label:"City:",Required:!1,MaxLength:"250",ModelValue:"City"},{Type:"text",Label:"State:",Required:!1,MaxLength:"250",ModelValue:"State"}],o.id=a.id,o.loadingIndicator=!1}angular.module("FieldConnectApp").controller("DSLDistributorEditController",t),t.$inject=["$scope","$location","$stateParams","$state","DSLDistributorService"]}();;!function(){"use strict";function e(e,i,o,t){this.edit=function(e){o.go("dslFailureResolutionTableEdit",{id:e})},this.DSLFailureResolutionService=t,this.attributes=[{Size:250,Name:"Code",ValueName:"Code",Edit:!0,Sortable:!0},{Size:250,Name:"Code Type",ValueName:"CodeType",Sortable:!0},{Size:500,Name:"Description",ValueName:"Description"}]}angular.module("FieldConnectApp").controller("DSLFailureResolutionController",e),e.$inject=["$scope","$location","$state","DSLFailureResolutionService"]}();;!function(){"use strict";function e(e,t,o,i,a){var l=this;l.$state=i,l.model={},l.DSLFailureResolutionState=a.state,l.attributes=[{Type:"text",Label:"Code:",Required:!0,MaxLength:"250",ModelValue:"Code",Autofocus:"true"},{Type:"text",Label:"Code Type:",Required:!0,MaxLength:"250",ModelValue:"CodeType"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"500",ModelValue:"Description"}],l.id=o.id,l.loadingIndicator=!1}angular.module("FieldConnectApp").controller("DSLFailureResolutionEditController",e),e.$inject=["$scope","$location","$stateParams","$state","DSLFailureResolutionService"]}();;!function(){"use strict";function e(e,t,i,a){this.edit=function(e){i.go("dslFaultAreasTableEdit",{id:e})},this.DSLFaultAreasService=a,this.attributes=[{Size:250,Name:"Code",ValueName:"Code",Edit:!0,Sortable:!0},{Size:500,Name:"Description",ValueName:"Description"}]}angular.module("FieldConnectApp").controller("DSLFaultAreasController",e),e.$inject=["$scope","$location","$state","DSLFaultAreasService"]}();;!function(){"use strict";function e(e,t,a,o,i){var l=this;l.$state=o,l.model={},l.DSLFaultAreasState=i.state,l.attributes=[{Type:"text",Label:"Code:",Required:!0,MaxLength:"250",ModelValue:"Code",Autofocus:"true"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"500",ModelValue:"Description"}],l.id=a.id,l.loadingIndicator=!1}angular.module("FieldConnectApp").controller("DSLFaultAreasEditController",e),e.$inject=["$scope","$location","$stateParams","$state","DSLFaultAreasService"]}();;!function(){"use strict";function e(e,t,i,l){this.edit=function(e){i.go("dslInstalledRemovedTableEdit",{id:e})},this.DSLInstalledRemovedService=l,this.attributes=[{Size:500,Name:"Description",ValueName:"Description",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("DSLInstalledRemovedController",e),e.$inject=["$scope","$location","$state","DSLInstalledRemovedService"]}();;!function(){"use strict";function e(e,t,a,o,i){var l=this;l.$state=o,l.model={},l.DSLInstalledRemovedState=i.state,l.attributes=[{Type:"text",Label:"Description:",Required:!0,MaxLength:"500",ModelValue:"Description",Edit:!0,Sortable:!0}],l.id=a.id,l.loadingIndicator=!1}angular.module("FieldConnectApp").controller("DSLInstalledRemovedEditController",e),e.$inject=["$scope","$location","$stateParams","$state","DSLInstalledRemovedService"]}();;!function(){"use strict";function e(e,t,o,i){this.edit=function(e){o.go("dslInventoryPostingGroupTableEdit",{id:e})},this.DSLInventoryPostingGroupService=i,this.attributes=[{Size:250,Name:"Code",ValueName:"Code",Edit:!0,Sortable:!0},{Size:500,Name:"Description",ValueName:"Description"}]}angular.module("FieldConnectApp").controller("DSLInventoryPostingGroupController",e),e.$inject=["$scope","$location","$state","DSLInventoryPostingGroupService"]}();;!function(){"use strict";function e(e,t,o,n,i){var r=this;r.$state=n,r.model={},r.DSLInventoryPostingGroupState=i.state,r.attributes=[{Type:"text",Label:"Code:",Required:!0,MaxLength:"250",ModelValue:"Code",Autofocus:"true"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"500",ModelValue:"Description"}],r.id=o.id,r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("DSLInventoryPostingGroupEditController",e),e.$inject=["$scope","$location","$stateParams","$state","DSLInventoryPostingGroupService"]}();;!function(){"use strict";function e(e,t,i,c){this.edit=function(e){i.go("dslPartsReceivedTableEdit",{id:e})},this.DSLPartsReceivedService=c,this.attributes=[{Size:500,Name:"Description",ValueName:"Description",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("DSLPartsReceivedController",e),e.$inject=["$scope","$location","$state","DSLPartsReceivedService"]}();;!function(){"use strict";function e(e,t,i,a,o){var r=this;r.$state=a,r.model={},r.DSLPartsReceivedState=o.state,r.attributes=[{Type:"text",Label:"Description:",Required:!0,MaxLength:"500",ModelValue:"Description",Autofocus:"true"}],r.id=i.id,r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("DSLPartsReceivedEditController",e),e.$inject=["$scope","$location","$stateParams","$state","DSLPartsReceivedService"]}();;!function(){"use strict";function e(e,t,i,l){this.edit=function(e){i.go("dslRecallDueToTableEdit",{id:e})},this.DSLRecallDueToService=l,this.attributes=[{Size:500,Name:"Description",ValueName:"Description",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("DSLRecallDueToController",e),e.$inject=["$scope","$location","$state","DSLRecallDueToService"]}();;!function(){"use strict";function e(e,t,o,a,i){var l=this;l.$state=a,l.model={},l.DSLRecallDueToState=i.state,l.attributes=[{Type:"text",Label:"Description:",Required:!0,MaxLength:"500",ModelValue:"Description",Autofocus:"true"}],l.id=o.id,l.loadingIndicator=!1}angular.module("FieldConnectApp").controller("DSLRecallDueToEditController",e),e.$inject=["$scope","$location","$stateParams","$state","DSLRecallDueToService"]}();;!function(){"use strict";function e(e,i,r,t){this.edit=function(e){r.go("dslServiceOrderTypeTableEdit",{id:e})},this.DSLServiceOrderTypeService=t,this.attributes=[{Size:250,Name:"Code",ValueName:"Code",Edit:!0,Sortable:!0},{Size:500,Name:"Description",ValueName:"Description"}]}angular.module("FieldConnectApp").controller("DSLServiceOrderTypeController",e),e.$inject=["$scope","$location","$state","DSLServiceOrderTypeService"]}();;!function(){"use strict";function e(e,t,r,i,o){var a=this;a.$state=i,a.model={},a.DSLServiceOrderTypeState=o.state,a.attributes=[{Type:"text",Label:"Code:",Required:!0,MaxLength:"250",ModelValue:"Code",Autofocus:"true"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"500",ModelValue:"Description"}],a.id=r.id,a.loadingIndicator=!1}angular.module("FieldConnectApp").controller("DSLServiceOrderTypeEditController",e),e.$inject=["$scope","$location","$stateParams","$state","DSLServiceOrderTypeService"]}();;!function(){"use strict";function e(e,i,o,t){this.edit=function(e){o.go("dslServiceZoneCodeTableEdit",{id:e})},this.DSLServiceZoneCodeService=t,this.attributes=[{Size:250,Name:"Code",ValueName:"Code",Edit:!0,Sortable:!0},{Size:500,Name:"Description",ValueName:"Description"}]}angular.module("FieldConnectApp").controller("DSLServiceZoneCodeController",e),e.$inject=["$scope","$location","$state","DSLServiceZoneCodeService"]}();;!function(){"use strict";function e(e,t,o,i,a){var n=this;n.$state=i,n.model={},n.DSLServiceZoneCodeState=a.state,n.attributes=[{Type:"text",Label:"Code:",Required:!0,MaxLength:"250",ModelValue:"Code",Autofocus:"true"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"500",ModelValue:"Description"}],n.id=o.id,n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("DSLServiceZoneCodeEditController",e),e.$inject=["$scope","$location","$stateParams","$state","DSLServiceZoneCodeService"]}();;!function(){"use strict";function e(e,o,i,t){this.edit=function(e){i.go("dslServiceZoneLaborCodeTableEdit",{id:e})},this.DSLServiceZoneLaborCodeService=t,this.attributes=[{Size:250,Name:"Service Zone Code",ValueName:"Code",Edit:!0,Sortable:!0},{Size:250,Name:"Labor Code",ValueName:"LaborCodeName",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("DSLServiceZoneLaborCodeController",e),e.$inject=["$scope","$location","$state","DSLServiceZoneCodeService"]}();;!function(){"use strict";function e(e,o,d,r,t){var a=this;a.$state=r,a.model={},a.DSLServiceZoneLaborCodeState=t.state,a.DSLServiceZoneCode={Type:"dropdown",Label:"Service Zone Code:",ApiMethod:"dslServiceZoneCode/ddList",ValueProp:"Id",TextProp:"Code",ModelValue:"ServiceZoneCodeId",ConvertToInt:"true",TabIndex:0,Required:!0},a.LaborCode={Type:"dropdown",Label:"Labor Code:",ApiMethod:"laborCodes",ValueProp:"Id",TextProp:"LaborCodeName",ModelValue:"LaborCodeId",TabIndex:1,Required:!0},a.attributes=[a.DSLServiceZoneCode,a.LaborCode],a.id=d.id,a.loadingIndicator=!1}angular.module("FieldConnectApp").controller("DSLServiceZoneLaborCodeEditController",e),e.$inject=["$scope","$location","$stateParams","$state","DSLServiceZoneLaborCodeService"]}();;!function(){"use strict";function t(t,e,i,o){this.edit=function(t){i.go("dslWhoPaysTableEdit",{id:t})},this.DSLWhoPaysService=o,this.attributes=[{Size:500,Name:"Description",ValueName:"Description",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("DSLWhoPaysController",t),t.$inject=["$scope","$location","$state","DSLWhoPaysService"]}();;!function(){"use strict";function t(t,e,a,o,i){var n=this;n.$state=o,n.model={},n.DSLWhoPaysState=i.state,n.attributes=[{Type:"text",Label:"Description:",Required:!0,MaxLength:"500",ModelValue:"Description",Edit:!0,Sortable:!0}],n.id=a.id,n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("DSLWhoPaysEditController",t),t.$inject=["$scope","$location","$stateParams","$state","DSLWhoPaysService"]}();;!function(){"use strict";function e(e,t,i,a){this.edit=function(e){i.go("dashboardChartTypeTableEdit",{id:e})},this.dashboardChartTypeService=a,this.attributes=[{Size:15,Name:"Identifier",ValueName:"Identifier",Edit:!0,Sortable:!0},{Size:25,Name:"Description",ValueName:"Description",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("dashboardChartTypeController",e),e.$inject=["$scope","$location","$state","dashboardChartTypeService"]}();;!function(){"use strict";function e(e,t,a,i,r){var o=this;o.$state=i,o.model={},o.dashboardChartTypeState=r.state,o.attributes=[{Type:"text",Label:"Identifier:",Required:!0,MaxLength:"15",ModelValue:"Identifier"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"25",ModelValue:"Description"}],o.id=a.id,o.loadingIndicator=!1}angular.module("FieldConnectApp").controller("dashboardChartTypeEditController",e),e.$inject=["$scope","$location","$stateParams","$state","dashboardChartTypeService"]}();;!function(){"use strict";function e(e,i,t,a){this.edit=function(e){t.go("dashboardConfigDDListTableEdit",{id:e})},this.dashboardConfigDDListService=a,this.attributes=[{Size:15,Name:"Key",ValueName:"Key",Edit:!0,Sortable:!0},{Size:25,Name:"Value",ValueName:"Value",Edit:!0,Sortable:!0},{Size:15,Name:"Identifier",ValueName:"Identifier",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("dashboardConfigDDListController",e),e.$inject=["$scope","$location","$state","dashboardConfigDDListService"]}();;!function(){"use strict";function e(e,t,a,o,i){var n=this;n.$state=o,n.model={},n.dashboardConfigDDListServiceState=i.state,n.attributes=[{Type:"text",Label:"Key:",Required:!0,MaxLength:"15",ModelValue:"Key"},{Type:"text",Label:"Value:",Required:!0,MaxLength:"25",ModelValue:"Value"},{Type:"text",Label:"Identifier:",Required:!0,MaxLength:"15",ModelValue:"Identifier"},{Type:"checkbox",Label:"Convert to Int:",ModelValue:"ConvertToInt"}],n.id=a.id,n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("dashboardConfigDDListEditController",e),e.$inject=["$scope","$location","$stateParams","$state","dashboardConfigDDListService"]}();;!function(){"use strict";function e(e,t,i,a){this.edit=function(e){i.go("dashboardFilterDDListTableEdit",{id:e})},this.dashboardFilterDDListService=a,this.attributes=[{Size:15,Name:"Key",ValueName:"Key",Edit:!0,Sortable:!0},{Size:25,Name:"Value",ValueName:"Value",Edit:!0,Sortable:!0},{Size:15,Name:"Identifier",ValueName:"Identifier",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("dashboardFilterDDListController",e),e.$inject=["$scope","$location","$state","dashboardFilterDDListService"]}();;!function(){"use strict";function e(e,t,a,i,l){var o=this;o.$state=i,o.model={},o.dashboardFilterDDListServiceState=l.state,o.attributes=[{Type:"text",Label:"Key:",Required:!0,MaxLength:"15",ModelValue:"Key"},{Type:"text",Label:"Value:",Required:!0,MaxLength:"25",ModelValue:"Value"},{Type:"text",Label:"Identifier:",Required:!0,MaxLength:"15",ModelValue:"Identifier"},{Type:"checkbox",Label:"Convert to Int:",ModelValue:"ConvertToInt"}],o.id=a.id,o.loadingIndicator=!1}angular.module("FieldConnectApp").controller("dashboardFilterDDListEditController",e),e.$inject=["$scope","$location","$stateParams","$state","dashboardFilterDDListService"]}();;!function(){"use strict";function e(e,t,a,i){this.edit=function(e){a.go("dashboardReportTypeTableEdit",{id:e})},this.dashboardReportTypeService=i,this.attributes=[{Size:25,Name:"Identifier",ValueName:"Identifier",Edit:!0,Sortable:!0},{Size:50,Name:"Description",ValueName:"Description",Edit:!1,Sortable:!0},{Size:25,Name:"Chart Type",ValueName:"ChartDescription",Edit:!1,Sortable:!0},{Size:50,Name:"Feature",ValueName:"FeatureName",Edit:!1,Sortable:!0},{Size:15,Name:"Active",ValueName:"Active",Sortable:!0,CellFormat:"checkbox"}]}angular.module("FieldConnectApp").controller("dashboardReportTypeController",e),e.$inject=["$scope","$location","$state","dashboardReportTypeService"]}();;!function(){"use strict";function e(e,t,a,o,r){var d=this;d.$state=o,d.model={},d.dashboardReportTypeState=r.state,d.attributes=[{Type:"text",Label:"Identifier:",Required:!0,MaxLength:"25",ModelValue:"Identifier"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"50",ModelValue:"Description"},{Type:"dropdown",Label:"Chart Type:",ApiMethod:"dashboardChartType/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"DashboardChartTypeId",ConvertToInt:"true",Required:!0},{Type:"dropdown",Label:"Feature:",ApiMethod:"dashboardReportType/featureList",ValueProp:"Id",TextProp:"FeatureName",ModelValue:"FeatureId",ConvertToInt:"true"},{Type:"textarea",Label:"Filter Template (JSON):",Required:!0,Rows:"5",ModelValue:"FilterTemplate"},{Type:"textarea",Label:"Dataset Template (JSON):",Required:!0,Rows:"5",ModelValue:"DatasetTemplate"},{Type:"textarea",Label:"Config Template (JSON):",Required:!0,Rows:"5",ModelValue:"ConfigTemplate"},{Type:"text",Label:"API:",Required:!0,MaxLength:"150",ModelValue:"Api"},{Type:"checkbox",Label:"Active",ModelValue:"Active"}],d.id=a.id,d.loadingIndicator=!1}angular.module("FieldConnectApp").controller("dashboardReportTypeEditController",e),e.$inject=["$scope","$location","$stateParams","$state","dashboardReportTypeService"]}();;!function(){"use strict";function t(t,e,i,a){this.edit=function(t){i.go("defaultDispatchCalendarSettingsTableEdit",{id:t})},this.defaultDispatchCalendarSettingsService=a,this.attributes=[{Size:25,Name:"Description",ValueName:"Description",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("defaultDispatchCalendarSettingsController",t),t.$inject=["$scope","$location","$state","defaultDispatchCalendarSettingsService"]}();;!function(){"use strict";function e(e,a,t,d,l){var o=this;o.$state=d,o.model={},o.defaultDispatchCalendarSettingsState=l.state,o.attributes=[{Type:"dropdown",Label:"Calendar Theme:",Required:!0,ApiMethod:"dispatchCalendarThemes/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"CalendarThemeId",ConvertToInt:"true"},{Type:"dropdown",Label:"Chart Theme:",Required:!0,ApiMethod:"dispatchChartThemes/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"ChartThemeId",ConvertToInt:"true"},{Type:"dropdown",Label:"Monthly Calendar Theme:",Required:!0,ApiMethod:"dispatchMonthlyCalendarThemes/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"MonthlyCalendarThemeId",ConvertToInt:"true"},{Type:"dropdown",Label:"Navigation Labels:",Required:!0,ApiMethod:"lookup/navigationLabelType",ValueProp:"Key",TextProp:"Value",ModelValue:"NavigationLabels",ConvertToInt:"false"},{Type:"checkbox",Label:"Show Map",ModelValue:"ShowMap"},{Type:"checkbox",Label:"Hide Side Panel",ModelValue:"HideSidePanel"},{Type:"dropdown",Label:"Unassigned Grid Sort Column:",ApiMethod:"dispatchCalendarSettings/unassignedSortColDDList",ValueProp:"Key",TextProp:"Value",ModelValue:"UnassignedGridSortColumn"},{Type:"int",Label:"Calendar Time Cell Duration (min)",ModelValue:"CalendarTimeHeaderCellDuration"},{Type:"dropdown",Label:"Unassigned Grid Sort Direction:",ValueProp:"Key",TextProp:"Value",ModelValue:"UnassignedGridSortDirection",List:[{Value:"Ascending",Key:"asc"},{Value:"Descending",Key:"desc"}]},{Type:"int",Label:"Calendar Cell Duration (min)",ModelValue:"CalendarCellDuration"},{Type:"int",Label:"Unassigned Grid Height (px)",ModelValue:"UnassignedGridHeight"}],o.id=t.id,o.loadingIndicator=!1}angular.module("FieldConnectApp").controller("defaultDispatchCalendarSettingsEditController",e),e.$inject=["$scope","$location","$stateParams","$state","defaultDispatchCalendarSettingsService"]}();;!function(){"use strict";function e(e,t,a,i){this.edit=function(e){a.go("defaultStartPageTableEdit",{id:e})},this.defaultStartPageService=i,this.attributes=[{Size:25,Name:"Identifier",ValueName:"PageIdentifier",Edit:!0,Sortable:!0},{Size:50,Name:"Page Name",ValueName:"PageName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("defaultStartPageController",e),e.$inject=["$scope","$location","$state","defaultStartPageService"]}();;!function(){"use strict";function e(e,t,a,i,l){var r=this;r.$state=i,r.model={},r.defaultStartPageState=l.state,r.attributes=[{Type:"text",Label:"Identifier:",Required:!0,MaxLength:"25",ModelValue:"PageIdentifier"},{Type:"text",Label:"Page Name:",Required:!0,MaxLength:"50",ModelValue:"PageName"}],r.id=a.id,r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("defaultStartPageEditController",e),e.$inject=["$scope","$location","$stateParams","$state","defaultStartPageService"]}();;!function(){"use strict";function e(e,i,t,c){this.edit=function(e){t.go("deficiencySeverityEdit",{id:e})},this.deficiencySeverityService=c,this.attributes=[{Size:15,Name:"Code",ValueName:"SeverityCode",Edit:!0,Sortable:!0},{Size:15,Name:"Name",ValueName:"SeverityName",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("deficiencySeverityController",e),e.$inject=["$scope","$location","$state","deficiencySeverityService"]}();;!function(){"use strict";function e(e,t,i,a,o,n){var r=this;r.$state=a,r.model={},r.deficiencySeverityState=o.state,r.attributes=[{Type:"text",Label:"Code:",Required:!0,MaxLength:"15",ModelValue:"SeverityCode"},{Type:"text",Label:"Name:",Required:!0,MaxLength:"15",ModelValue:"SeverityName"}],r.id=i.id,r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("deficiencySeverityEditController",e),e.$inject=["$scope","$location","$stateParams","$state","deficiencySeverityService","$timeout"]}();;!function(){"use strict";function t(t,e,i,c){this.edit=function(t){i.go("deficiencyStatusEdit",{id:t})},this.deficiencyStatusService=c,this.attributes=[{Size:15,Name:"Name",ValueName:"StatusName",Edit:!0,Sortable:!0},{Size:15,Name:"Action",ValueName:"Action",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("deficiencyStatusController",t),t.$inject=["$scope","$location","$state","deficiencyStatusService"]}();;!function(){"use strict";function t(t,e,i,o,n,c){var a=this;a.$state=o,a.model={},a.deficiencyStatusState=n.state,a.statusAction={Type:"dropdown",Label:"Action:",ApiMethod:"deficiencyStatusAction/ddList",ValueProp:"Id",TextProp:"Action",ModelValue:"ActionId",ConvertToInt:"true",Required:!0},a.attributes=[{Type:"text",Label:"Name:",Required:!0,MaxLength:"15",ModelValue:"StatusName"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},a.statusAction,{Type:"textarea",Label:"Description:",ReadOnly:!0,ModelValue:"ActionDescription"}],a.id=i.id,a.loadingIndicator=!1,t.$watch("vm.model.ActionId",function(t,e){if(t){if(a.statusAction.CurrentList){var i=a.statusAction.CurrentList.findIndex(e=>e.Id==t),o=a.statusAction.CurrentList[i].Description;c(function(){a.model.ActionDescription=o})}}else c(function(){a.model.ActionDescription=""})})}angular.module("FieldConnectApp").controller("deficiencyStatusEditController",t),t.$inject=["$scope","$location","$stateParams","$state","deficiencyStatusService","$timeout"]}();;!function(){"use strict";function t(t,i,e,c){this.edit=function(t){e.go("deficiencyStatusActionEdit",{id:t})},this.deficiencyStatusActionService=c,this.attributes=[{Size:15,Name:"Action",ValueName:"Action",Edit:!0,Sortable:!0},{Size:150,Name:"Description",ValueName:"Description",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("deficiencyStatusActionController",t),t.$inject=["$scope","$location","$state","deficiencyStatusActionService"]}();;!function(){"use strict";function t(t,e,i,a,n){var o=this;o.$state=a,o.model={},o.deficiencyStatusActionState=n.state,o.attributes=[{Type:"text",Label:"Action:",Required:!0,MaxLength:"15",ModelValue:"Action"},{Type:"textarea",Label:"Description:",Required:!0,Rows:"5",ModelValue:"Description"}],o.id=i.id,o.loadingIndicator=!1}angular.module("FieldConnectApp").controller("deficiencyStatusActionEditController",t),t.$inject=["$scope","$location","$stateParams","$state","deficiencyStatusActionService"]}();;!function(){"use strict";function e(e,t,i,a){this.edit=function(e){i.go("dispatchCalendarThemesTableEdit",{id:e})},this.dispatchCalendarThemesService=a,this.attributes=[{Size:15,Name:"Identifier",ValueName:"Identifier",Edit:!0,Sortable:!0},{Size:25,Name:"Description",ValueName:"Description",Edit:!0,Sortable:!0},{Size:15,Name:"Active",ValueName:"Active",Sortable:!0,CellFormat:"checkbox"}]}angular.module("FieldConnectApp").controller("dispatchCalendarThemesController",e),e.$inject=["$scope","$location","$state","dispatchCalendarThemesService"]}();;!function(){"use strict";function e(e,t,a,i,l){var n=this;n.$state=i,n.model={},n.dispatchCalendarThemesState=l.state,n.attributes=[{Type:"text",Label:"Identifier:",Required:!0,MaxLength:"35",ModelValue:"Identifier"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"50",ModelValue:"Description"},{Type:"checkbox",Label:"Active",ModelValue:"Active"}],n.id=a.id,n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("dispatchCalendarThemesEditController",e),e.$inject=["$scope","$location","$stateParams","$state","dispatchCalendarThemesService"]}();;!function(){"use strict";function e(e,t,i,a){this.edit=function(e){i.go("dispatchChartThemesTableEdit",{id:e})},this.dispatchChartThemesService=a,this.attributes=[{Size:15,Name:"Identifier",ValueName:"Identifier",Edit:!0,Sortable:!0},{Size:25,Name:"Description",ValueName:"Description",Edit:!0,Sortable:!0},{Size:15,Name:"Active",ValueName:"Active",Sortable:!0,CellFormat:"checkbox"}]}angular.module("FieldConnectApp").controller("dispatchChartThemesController",e),e.$inject=["$scope","$location","$state","dispatchChartThemesService"]}();;!function(){"use strict";function e(e,t,i,a,o){var r=this;r.$state=a,r.model={},r.dispatchChartThemesState=o.state,r.attributes=[{Type:"text",Label:"Identifier:",Required:!0,MaxLength:"35",ModelValue:"Identifier"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"50",ModelValue:"Description"},{Type:"checkbox",Label:"Active",ModelValue:"Active"}],r.id=i.id,r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("dispatchChartThemesEditController",e),e.$inject=["$scope","$location","$stateParams","$state","dispatchChartThemesService"]}();;!function(){"use strict";function e(e,t,i,a){this.edit=function(e){i.go("dispatchMonthlyCalendarThemesTableEdit",{id:e})},this.dispatchMonthlyCalendarThemesService=a,this.attributes=[{Size:15,Name:"Identifier",ValueName:"Identifier",Edit:!0,Sortable:!0},{Size:25,Name:"Description",ValueName:"Description",Edit:!0,Sortable:!0},{Size:15,Name:"Active",ValueName:"Active",Sortable:!0,CellFormat:"checkbox"}]}angular.module("FieldConnectApp").controller("dispatchMonthlyCalendarThemesController",e),e.$inject=["$scope","$location","$state","dispatchMonthlyCalendarThemesService"]}();;!function(){"use strict";function e(e,t,a,i,l){var n=this;n.$state=i,n.model={},n.dispatchMonthlyCalendarThemesState=l.state,n.attributes=[{Type:"text",Label:"Identifier:",Required:!0,MaxLength:"35",ModelValue:"Identifier"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"50",ModelValue:"Description"},{Type:"checkbox",Label:"Active",ModelValue:"Active"}],n.id=a.id,n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("dispatchMonthlyCalendarThemesEditController",e),e.$inject=["$scope","$location","$stateParams","$state","dispatchMonthlyCalendarThemesService"]}();;!function(){"use strict";function e(e,t,o,i){this.edit=function(e){o.go("docTypesTableEdit",{id:e})},this.docTypeService=i,this.attributes=[{Size:250,Name:"Document Type",ValueName:"DocTypeName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("DocTypeController",e),e.$inject=["$scope","$location","$state","docTypeService"]}();;!function(){"use strict";function e(e,t,o,a,c){var i=this;i.$state=o,i.docTypeState=c.state,i.model={},i.attributes=[{Type:"text",Label:"Document Type:",Required:!0,MaxLength:"20",ModelValue:"DocTypeName",Autofocus:"true"}],i.id=a.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("DocTypeEditController",e),e.$inject=["$scope","$location","$state","$stateParams","docTypeService"]}();;!function(){"use strict";function e(e,t,a){this.edit=function(e){a.go("equipmentClassEdit",{id:e})},this.attributes=[{Size:250,Name:"Class Name",ValueName:"ClassName",Edit:!0,Sortable:!0},{Size:250,Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("EquipmentClassController",e),e.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,t,a,s,l){var i=this;i.$state=a,i.equipmentClassState=l.state,i.attributes=[{Type:"text",Label:"Class Name:",Required:!0,MaxLength:"50",ModelValue:"ClassName",Autofocus:"true"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],i.id=s.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("EquipmentClassEditController",e),e.$inject=["$scope","$location","$state","$stateParams","equipmentClassService"]}();;!function(){"use strict";function e(e,t,i,a){this.edit=function(e){i.go("equipmentTypeEdit",{id:e})},this.equipmentTypeService=a,this.attributes=[{Size:250,Name:"Type Name",ValueName:"TypeName",Edit:!0,Sortable:!0},{Size:250,Name:"Class Name",ValueName:"ClassName",Edit:!1,Sortable:!0},{Size:250,Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("EquipmentTypeController",e),e.$inject=["$scope","$location","$state","serviceableItemTypeService"]}();;!function(){"use strict";function e(e,t,a,o,l){var i=this;i.$state=a,i.serviceableItemTypeState=l.state,i.attributes=[{Type:"text",Label:"Type Name:",Required:!0,MaxLength:"50",ModelValue:"TypeName",Autofocus:"true"},{Type:"dropdown",Label:"Class Name:",Required:!0,ApiMethod:"equipmentClass",ValueProp:"Id",TextProp:"ClassName",ModelValue:"EquipmentClassId",ConvertToInt:"true"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],i.id=o.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("EquipmentTypeEditController",e),e.$inject=["$scope","$location","$state","$stateParams","serviceableItemTypeService"]}();;!function(){"use strict";function e(e,t,n,i){this.edit=function(e){n.go("eventTypesTableEdit",{id:e})},this.eventTypeService=i,this.attributes=[{Size:250,Name:"Event Type",ValueName:"EventTypeName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("EventTypeController",e),e.$inject=["$scope","$location","$state","eventTypeService"]}();;!function(){"use strict";function e(e,t,n,a,o){var i=this;i.$state=n,i.model={},i.eventTypeState=o.state,i.attributes=[{Type:"text",Label:"Event Type:",Required:!0,MaxLength:"20",ModelValue:"EventTypeName",Autofocus:"true"}],i.id=a.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("EventTypeEditController",e),e.$inject=["$scope","$location","$state","$stateParams","eventTypeService"]}();;!function(){"use strict";function t(t,e,i,n){this.edit=function(t){i.go("industriesTableEdit",{id:t})},this.industryService=n,this.attributes=[{Size:250,Name:"Industry",ValueName:"IndustryName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("IndustryController",t),t.$inject=["$scope","$location","$state","industryService"]}();;!function(){"use strict";function t(t,e,n,a,r){var i=this;i.$state=n,i.model={},i.industryState=r.state,i.attributes=[{Type:"text",Label:"Industry:",Required:!0,MaxLength:"50",ModelValue:"IndustryName",Autofocus:"true"}],i.id=a.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("IndustryEditController",t),t.$inject=["$scope","$location","$state","$stateParams","industryService"]}();;!function(){"use strict";function e(e,a,t,l){this.edit=function(e){t.go("itemClassEdit",{id:e})},this.itemClassService=l,this.attributes=[{Name:"Class Name",ValueName:"ClassName",Edit:!0,Sortable:!0},{Name:"Taxable",ValueName:"Taxable",Sortable:!0,CellFormat:"checkbox"},{Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("ItemClassController",e),e.$inject=["$scope","$location","$state","itemClassService"]}();;!function(){"use strict";function e(e,t,a,l,o){var s=this;s.$state=a,s.model={},s.itemClassState=o.state,s.attributes=[{Type:"text",Label:"Class Name:",Required:!0,MaxLength:"50",ModelValue:"ClassName",Autofocus:"true"},{Type:"checkbox",Label:"Taxable",ModelValue:"Taxable"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],s.id=l.id,s.loadingIndicator=!1}angular.module("FieldConnectApp").controller("ItemClassEditController",e),e.$inject=["$scope","$location","$state","$stateParams","itemClassService"]}();;!function(){"use strict";function e(e,t,a,i){this.edit=function(e){a.go("itemTypesEdit",{id:e})},this.itemTypeService=i,this.attributes=[{Name:"Type Name",ValueName:"TypeName",Edit:!0,Sortable:!0},{Name:"Class Name",ValueName:"ClassName",Edit:!1,Sortable:!0},{Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("ItemTypeController",e),e.$inject=["$scope","$location","$state","itemTypeService"]}();;!function(){"use strict";function e(e,t,a,o,l){var d=this;d.$state=a,d.model={},d.itemTypeState=l.state,d.attributes=[{Type:"text",Label:"Type Name:",Required:!0,MaxLength:"50",ModelValue:"TypeName",Autofocus:"true"},{Type:"dropdown",Label:"Class Name:",Required:!0,ApiMethod:"itemClasses",ValueProp:"Id",TextProp:"ClassName",ModelValue:"ClassId",ConvertToInt:"true"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],d.id=o.id,d.loadingIndicator=!1}angular.module("FieldConnectApp").controller("ItemTypeEditController",e),e.$inject=["$scope","$location","$state","$stateParams","itemTypeService"]}();;!function(){"use strict";function e(e,o,a,t){this.edit=function(e){a.go("laborCodeEdit",{id:e})},this.laborCodeService=t,this.attributes=[{Size:250,Name:"Labor Code",ValueName:"LaborCodeName",Edit:!0,Sortable:!0},{Size:250,Name:"Pay Rate",ValueName:"PayRateName",Edit:!1,Sortable:!0},{Size:250,Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("LaborCodeController",e),e.$inject=["$scope","$location","$state","laborCodeService"]}();;!function(){"use strict";function e(e,t,a,o,d){var r=this;r.$state=a,r.model={},r.laborCodeState=d.state,r.attributes=[{Type:"text",Label:"Labor Code:",Required:!0,MaxLength:"50",ModelValue:"LaborCodeName",Autofocus:"true"},{Type:"dropdown",Label:"Pay Rate:",Required:!1,ApiMethod:"payRates",ValueProp:"Id",TextProp:"PayRateName",ModelValue:"PayRateId",ConvertToInt:"true"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],r.id=o.id,r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("LaborCodeEditController",e),e.$inject=["$scope","$location","$state","$stateParams","laborCodeService"]}();;!function(){"use strict";function e(e,o,t,a){this.edit=function(e){t.go("laborGroupTableEdit",{id:e})},this.laborGroupService=a,this.attributes=[{Size:250,Name:"Labor Group Name",ValueName:"Name",Edit:!0,Sortable:!0},{Size:250,Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("LaborGroupController",e),e.$inject=["$scope","$location","$state","laborGroupService"]}();;!function(){"use strict";function e(e,t,o,a,r){var l=this;l.$state=o,l.model={},l.laborGroupState=r.state,l.attributes=[{Type:"text",Label:"Labor Group Name:",Required:!0,MaxLength:"50",ModelValue:"Name",Autofocus:"true"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],l.id=a.id,l.loadingIndicator=!1}angular.module("FieldConnectApp").controller("LaborGroupEditController",e),e.$inject=["$scope","$location","$state","$stateParams","laborGroupService"]}();;!function(){"use strict";function e(e,t,i,o){this.edit=function(e){i.go("leadSourceTableEdit",{id:e})},this.leadSourceService=o,this.attributes=[{Size:50,Name:"Source ID",ValueName:"SourceId",Edit:!0,Sortable:!0},{Size:250,Name:"Description",ValueName:"Description"}]}angular.module("FieldConnectApp").controller("LeadSourceController",e),e.$inject=["$scope","$location","$state","leadSourceService"]}();;!function(){"use strict";function e(e,t,o,a,r){var i=this;i.$state=a,i.model={},i.leadSourceState=r.state,i.attributes=[{Type:"text",Label:"Source ID:",Required:!0,MaxLength:"50",ModelValue:"SourceId",Autofocus:"true"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"250",ModelValue:"Description"}],i.id=o.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("LeadSourceEditController",e),e.$inject=["$scope","$location","$stateParams","$state","leadSourceService"]}();;!function(){"use strict";function e(e,t,o,a){this.edit=function(e){o.go("locationsTableEdit",{id:e})},this.locationService=a,this.attributes=[{Size:250,Name:"Location",ValueName:"LocationName",Edit:!0,Sortable:!0},{Size:250,Name:"Default",ValueName:"Default",Sortable:!0,CellFormat:"checkbox"},{Size:250,Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("LocationController",e),e.$inject=["$scope","$location","$state","locationService"]}();;!function(){"use strict";function e(e,t,o,a,l){var i=this;i.$state=a,i.model={},i.locationState=l.state,i.attributes=[{Type:"text",Label:"Location:",Required:!0,MaxLength:"50",ModelValue:"LocationName",Autofocus:"true"},{Type:"checkbox",Label:"Default",ModelValue:"Default"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],i.id=o.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("LocationEditController",e),e.$inject=["$scope","$location","$stateParams","$state","locationService"]}();;!function(){"use strict";function t(t,e,r,a){this.edit=function(t){r.go("manufacturerEdit",{id:t})},this.manufacturerService=a,this.attributes=[{Name:"Manufacturer",ValueName:"MfrName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("ManufacturerController",t),t.$inject=["$scope","$location","$state","manufacturerService"]}();;!function(){"use strict";function t(t,e,a,r,u){var n=this;n.$state=a,n.model={},n.manufacturerState=u.state,n.attributes=[{Type:"text",Label:"Manufacturer:",Required:!0,MaxLength:"20",ModelValue:"MfrName",Autofocus:"true"}],n.id=r.id,n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("ManufacturerEditController",t),t.$inject=["$scope","$location","$state","$stateParams","manufacturerService"]}();;!function(){"use strict";function e(e,t,a,i){this.edit=function(e){a.go("merchantsTableEdit",{id:e})},this.merchantService=i,this.attributes=[{Size:250,Name:"Name",ValueName:"Name",Edit:!0,Sortable:!0},{Size:250,Name:"Token",ValueName:"Token",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("MerchantController",e),e.$inject=["$scope","$location","$state","merchantService"]}();;!function(){"use strict";function e(e,t,a,l,o){var n=this;n.$state=a,n.model={},n.merchantState=o.state,n.attributes=[{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"Name",Autofocus:"true"},{Type:"text",Label:"Token:",Required:!1,MaxLength:"100",ModelValue:"Token"},{Type:"text",Label:"Pin:",Required:!1,MaxLength:"200",ModelValue:"Pin"},{Type:"text",Label:"MerchantId:",Required:!1,MaxLength:"50",ModelValue:"MerchantId"},{Type:"text",Label:"UserId:",Required:!1,MaxLength:"50",ModelValue:"UserId"},{Type:"text",Label:"TransactionType:",Required:!1,MaxLength:"50",ModelValue:"TransactionType"},{Type:"text",Label:"Url:",Required:!1,MaxLength:"200",ModelValue:"Url"},{Type:"checkbox",Label:"Active",ModelValue:"Active"},{Type:"checkbox",Label:"ShowForm",ModelValue:"ShowForm"}],n.id=l.id,n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("MerchantEditController",e),e.$inject=["$scope","$location","$state","$stateParams","merchantService"]}();;!function(){"use strict";function e(e,t,i,o){this.edit=function(e){i.go("noteLibsTableEdit",{id:e})},this.noteLibService=o,this.attributes=[{Size:150,Name:"Note Type",ValueName:"NoteType",Sortable:!0},{Size:150,Name:"Note Title",ValueName:"NoteTitle",Edit:!0,Sortable:!0},{Size:150,Name:"Note",ValueName:"Note",Sortable:!0}]}angular.module("FieldConnectApp").controller("NoteLibController",e),e.$inject=["$scope","$location","$state","noteLibService"]}();;!function(){"use strict";function e(e,t,o,a,r,i){var l=this;l.isSubContractor=!1;for(var u=i.getValue("authorizationData").userRoles.split(","),p=0;p<u.length;p++)"SubAdmin"==u[p]&&(l.isSubContractor=!0);l.$state=a,l.model={},l.noteLibsState=r.state,l.isSubContractor?l.attributes=[{Type:"dropdown",Label:"Note Type:",Required:!0,ValueProp:"NoteType",TextProp:"NoteType",ModelValue:"NoteType",List:[{NoteType:"Site"},{NoteType:"WorkOrder"}],Autofocus:"true"},{Type:"text",Label:"Note Title:",Required:!0,MaxLength:"50",ModelValue:"NoteTitle"},{Type:"textarea",Label:"Note:",Required:!0,MaxLength:"200",ModelValue:"Note"}]:l.attributes=[{Type:"dropdown",Label:"Note Type:",Required:!0,ValueProp:"NoteType",TextProp:"NoteType",ModelValue:"NoteType",List:[{NoteType:"Site"},{NoteType:"WorkOrder"},{NoteType:"Quote"}],Autofocus:"true"},{Type:"text",Label:"Note Title:",Required:!0,MaxLength:"50",ModelValue:"NoteTitle"},{Type:"textarea",Label:"Note:",Required:!0,MaxLength:"200",ModelValue:"Note"}],l.id=o.id,l.loadingIndicator=!1}angular.module("FieldConnectApp").controller("NoteLibEditController",e),e.$inject=["$scope","$location","$stateParams","$state","noteLibService","cryptoStorageService"]}();;!function(){"use strict";function e(e,o,t,i){this.edit=function(e){t.go("operationGroupsTableEdit",{id:e})},this.operationGroupService=i,this.attributes=[{Size:250,Name:"OperationGroup",ValueName:"OperationGroupName",Edit:!0,Sortable:!0},{Name:"Description",ValueName:"Desc",Sortable:!0}]}angular.module("FieldConnectApp").controller("OperationGroupController",e),e.$inject=["$scope","$location","$state","operationGroupService"]}();;!function(){"use strict";function e(e,t,o,a,r){var i=this;i.$state=a,i.model={},i.operationGroupState=r.state,i.attributes=[{Type:"text",Label:"Operation Group:",Required:!0,MaxLength:"20",ModelValue:"OperationGroupName",Autofocus:"true"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Desc"}],i.id=o.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("OperationGroupEditController",e),e.$inject=["$scope","$location","$stateParams","$state","operationGroupService"]}();;!function(){"use strict";function e(e,t,a,i){this.edit=function(e){a.go("paymentTermsTableEdit",{id:e})},this.paymentTermService=i,this.attributes=[{Size:250,Name:"Payment Term Name",ValueName:"PaymentTermName",Edit:!0,Sortable:!0},{Size:150,Name:"Days",ValueName:"Days"},{Size:250,Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("PaymentTermController",e),e.$inject=["$scope","$location","$state","paymentTermService"]}();;!function(){"use strict";function e(e,t,a,n,o){var r=this;r.$state=n,r.model={},r.paymentTermsState=o.state,r.attributes=[{Type:"text",Label:"Payment Term Name:",Required:!0,MaxLength:"20",ModelValue:"PaymentTermName",Autofocus:"true"},{Type:"int",Label:"Days:",Required:!0,ModelValue:"Days"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],r.id=a.id,r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("PaymentTermEditController",e),e.$inject=["$scope","$location","$stateParams","$state","paymentTermService"]}();;!function(){"use strict";function i(i,t,e,o){this.edit=function(i){e.go("priorityTableEdit",{id:i})},this.priorityService=o,this.attributes=[{Name:"Priority",ValueName:"PriorityName",Edit:!0,Sortable:!0},{Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("PriorityController",i),i.$inject=["$scope","$location","$state","priorityService"]}();;!function(){"use strict";function e(e,t,i,o,r){var a=this;a.$state=i,a.model={},a.prioritiesState=r.state,a.attributes=[{Type:"text",Label:"Priority:",Required:!0,MaxLength:"10",ModelValue:"PriorityName",Autofocus:"true"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],a.id=o.id,a.loadingIndicator=!1}angular.module("FieldConnectApp").controller("PriorityEditController",e),e.$inject=["$scope","$location","$state","$stateParams","priorityService"]}();;!function(){"use strict";function e(e,o,t,a){this.edit=function(e){t.go("problemCodesTableEdit",{id:e})},this.problemCodeService=a,this.attributes=[{Name:"Problem Code",ValueName:"ProblemCodeName",Edit:!0,Sortable:!0},{Name:"Description",ValueName:"Decs"},{Name:"Default Hours",ValueName:"DefaultHours"},{Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("ProblemCodeController",e),e.$inject=["$scope","$location","$state","problemCodeService"]}();;!function(){"use strict";function e(e,t,o,l,a){var r=this;r.$state=l,r.model={},r.problemCodeState=a.state,r.attributes=[{Type:"text",Label:"Problem Code:",Required:!0,MaxLength:"30",ModelValue:"ProblemCodeName",Autofocus:"true"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Decs"},{Type:"int",Label:"Default Hours:",Required:!0,ModelValue:"DefaultHours"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],r.id=o.id,r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("ProblemCodeEditController",e),e.$inject=["$scope","$location","$stateParams","$state","problemCodeService"]}();;!function(){"use strict";function e(e,a,o,t){this.edit=function(e){o.go("problemCodeTasksTableEdit",{id:e})},this.problemCodeTaskService=t,this.attributes=[{Name:"Task Name",ValueName:"TaskName",Edit:"true",Sortable:!0},{Name:"Problem Code Name",ValueName:"ProblemCodeName",Sortable:!0},{Name:"Task Descriptions",ValueName:"Desc"}]}angular.module("FieldConnectApp").controller("ProblemCodeTaskController",e),e.$inject=["$scope","$location","$state","problemCodeTaskService"]}();;!function(){"use strict";function e(e,o,t,a,r){var l=this;l.$state=t,l.model={},l.problemCodeTaskState=r.state,l.attributes=[{Type:"text",Label:"Task Name:",Required:!0,MaxLength:"50",ModelValue:"TaskName",Autofocus:"true"},{Type:"text",Label:"Task Description:",Required:!0,MaxLength:"200",ModelValue:"Desc"},{Type:"dropdown",Label:"Problem Code Name:",Required:!0,ApiMethod:"problemCodes",ValueProp:"Id",TextProp:"ProblemCodeName",ModelValue:"ProblemCodeId",ConvertToInt:"true"}],l.id=a.id,l.loadingIndicator=!1}angular.module("FieldConnectApp").controller("ProblemCodeTaskEditController",e),e.$inject=["$scope","$location","$state","$stateParams","problemCodeTaskService"]}();;!function(){"use strict";function t(t,e,i){this.edit=function(t){i.go("quotePriorityEdit",{id:t})},this.goToRefTable=function(){i.go("referenceTables")},this.attributes=[{Name:"Priority",ValueName:"Priority",Edit:"true",Sortable:!0}]}angular.module("FieldConnectApp").controller("QuotePriorityController",t),t.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function t(t,e,o,i){var r=this;r.goToRefTable=function(){o.go("referenceTables")},r.$state=o,r.model={},r.id=i.id,r.attributes=[{Type:"text",Label:"Priority:",Required:!0,MaxLength:"10",ModelValue:"Priority",Autofocus:"true"}],r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("QuotePriorityEditController",t),t.$inject=["$scope","$location","$state","$stateParams"]}();;!function(){"use strict";function e(e,t,o,i){this.edit=function(e){o.go("resolutionsTableEdit",{id:e})},this.resolutionService=i,this.attributes=[{Name:"Resolution",ValueName:"ResolutionName",Edit:!0,Sortable:!0},{Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("ResolutionController",e),e.$inject=["$scope","$location","$state","resolutionService"]}();;!function(){"use strict";function e(e,t,o,a,i){var l=this;l.$state=o,l.model={},l.resolutionState=i.state,l.attributes=[{Type:"text",Label:"Resolution:",Required:!0,MaxLength:"50",ModelValue:"ResolutionName",Autofocus:"true"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],l.id=a.id,l.loadingIndicator=!1}angular.module("FieldConnectApp").controller("ResolutionEditController",e),e.$inject=["$scope","$location","$state","$stateParams","resolutionService"]}();;!function(){"use strict";function e(e,l,o,t){this.edit=function(e){o.go("rolesTableEdit",{id:e})},this.roleService=t,this.attributes=[{Size:250,Name:"Role Name",ValueName:"RoleName",Edit:!0,Sortable:!0},{Size:250,Name:"Role Type",ValueName:"RoleTypeName",Edit:!0,Sortable:!0},{Size:250,Name:"Global",ValueName:"Global",Sortable:!0,CellFormat:"checkbox"}]}angular.module("FieldConnectApp").controller("RoleController",e),e.$inject=["$scope","$location","$state","roleService"]}();;!function(){"use strict";function e(e,l,o,t,r,a){var i=this;i.$state=o,i.roleState=r.state,i.roleFilter=a.filter("and"),i.roleFilter.neq("RoleTypeName","API"),i.attributes=[{Type:"text",Label:"Role Name:",Required:!0,MaxLength:"20",ModelValue:"RoleName",Autofocus:"true"},{Type:"dropdown",Label:"Role Type:",Required:!0,ApiMethod:"roleTypes",ValueProp:"Id",TextProp:"RoleTypeName",ModelValue:"RoleTypeId",ConvertToInt:"true",Filter:i.roleFilter},{Type:"checkbox",Label:"Global",ModelValue:"Global"}],i.id=t.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("RoleEditController",e),e.$inject=["$scope","$location","$state","$stateParams","roleService","qsService"]}();;!function(){"use strict";function e(e,t,o,i){this.edit=function(e){o.go("roleTypesTableEdit",{id:e})},this.roleTypeService=i,this.attributes=[{Size:250,Name:"Role Type",ValueName:"RoleTypeName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("RoleTypeController",e),e.$inject=["$scope","$location","$state","roleTypeService"]}();;!function(){"use strict";function e(e,t,o,a,l){var i=this;i.$state=a,i.roleTypesState=l.state,i.attributes=[{Type:"text",Label:"Role Type:",Required:!0,MaxLength:"20",ModelValue:"RoleTypeName",Autofocus:"true"}],i.id=o.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("RoleTypeEditController",e),e.$inject=["$scope","$location","$stateParams","$state","roleTypeService"]}();;!function(){"use strict";function e(e,i,r,t){this.edit=function(e){r.go("serviceAreasEdit",{id:e})},this.serviceAreaService=t,this.attributes=[{Name:"Service Area",ValueName:"ServiceAreaName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("ServiceAreaController",e),e.$inject=["$scope","$location","$state","serviceAreaService"]}();;!function(){"use strict";function e(e,t,a,r,i){var c=this;c.$state=a,c.serviceAreaState=i.state,c.attributes=[{Type:"text",Label:"Service Area:",Required:!0,MaxLength:"50",ModelValue:"ServiceAreaName",Autofocus:"true"}],c.id=r.id,c.loadingIndicator=!1}angular.module("FieldConnectApp").controller("ServiceAreaEditController",e),e.$inject=["$scope","$location","$state","$stateParams","serviceAreaService"]}();;!function(){"use strict";function e(e,t,a){this.edit=function(e){a.go("serviceableItemClassEdit",{id:e})},this.attributes=[{Size:250,Name:"Class Name",ValueName:"ClassName",Edit:!0,Sortable:!0},{Size:250,Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("ServiceableItemClassController",e),e.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,t,a,l,s){var i=this;i.$state=a,i.serviceableItemClassState=s.state,i.attributes=[{Type:"text",Label:"Class Name:",Required:!0,MaxLength:"50",ModelValue:"ClassName",Autofocus:"true"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],i.id=l.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("ServiceableItemClassEditController",e),e.$inject=["$scope","$location","$state","$stateParams","serviceableItemClassService"]}();;!function(){"use strict";function e(e,t,a,i){this.edit=function(e){a.go("serviceableItemTypeEdit",{id:e})},this.serviceableItemTypeService=i,this.attributes=[{Size:250,Name:"Type Name",ValueName:"TypeName",Edit:!0,Sortable:!0},{Size:250,Name:"Class Name",ValueName:"ClassName",Edit:!1,Sortable:!0},{Size:250,Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("ServiceableItemTypeController",e),e.$inject=["$scope","$location","$state","serviceableItemTypeService"]}();;!function(){"use strict";function e(e,t,a,l,o){var r=this;r.$state=a,r.serviceableItemTypeState=o.state,r.attributes=[{Type:"text",Label:"Type Name:",Required:!0,MaxLength:"50",ModelValue:"TypeName",Autofocus:"true"},{Type:"dropdown",Label:"Class Name:",Required:!0,ApiMethod:"serviceableItemClasses",ValueProp:"Id",TextProp:"ClassName",ModelValue:"ServiceableItemClassId",ConvertToInt:"true"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],r.id=l.id,r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("ServiceableItemTypeEditController",e),e.$inject=["$scope","$location","$state","$stateParams","serviceableItemTypeService"]}();;!function(){"use strict";function e(e,t,i,n){this.edit=function(e){i.go("settingsTableEdit",{id:e})},this.settingService=n,this.attributes=[{Size:200,Name:"Name",ValueName:"Name",Edit:!0,Sortable:!0},{Size:200,Name:"Description",ValueName:"Desc",Sortable:!0}]}angular.module("FieldConnectApp").controller("SettingController",e),e.$inject=["$scope","$location","$state","settingService"]}();;!function(){"use strict";function e(e,t,a,i,n){var o=this;o.$state=i,o.settingsState=n.state,o.attributes=[{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"Name",Autofocus:"true"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Desc"}],o.id=a.id,o.loadingIndicator=!1}angular.module("FieldConnectApp").controller("SettingEditController",e),e.$inject=["$scope","$location","$stateParams","$state","settingService"]}();;!function(){"use strict";function e(e,t,i,o){this.edit=function(e){i.go("siteTypesTableEdit",{id:e})},this.siteTypeService=o,this.attributes=[{Name:"Site Type",ValueName:"SiteTypeName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("SiteTypeController",e),e.$inject=["$scope","$location","$state","siteTypeService"]}();;!function(){"use strict";function e(e,t,i,a,o){var n=this;n.$state=i,n.siteTypeState=o.state,n.attributes=[{Type:"text",Label:"Site Type:",Required:!0,MaxLength:"50",ModelValue:"SiteTypeName",Autofocus:"true"}],n.id=a.id,n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("SiteTypeEditController",e),e.$inject=["$scope","$location","$state","$stateParams","siteTypeService"]}();;!function(){"use strict";function e(e,i,l,t){this.edit=function(e){l.go("skillsTableEdit",{id:e})},this.skillService=t,this.attributes=[{Size:250,Name:"Skill",ValueName:"SkillName",Edit:!0,Sortable:!0},{Size:250,Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("SkillController",e),e.$inject=["$scope","$location","$state","skillService"]}();;!function(){"use strict";function e(e,t,l,a,i){var o=this;o.$state=l,o.skillState=i.state,o.attributes=[{Type:"text",Label:"Skill:",Required:!0,MaxLength:"50",ModelValue:"SkillName",Autofocus:"true"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],o.id=a.id,o.loadingIndicator=!1}angular.module("FieldConnectApp").controller("SkillEditController",e),e.$inject=["$scope","$location","$state","$stateParams","skillService"]}();;!function(){"use strict";function t(t,e,a,i){this.edit=function(t){a.go("stateEdit",{id:t})},this.stateService=i,this.attributes=[{Name:"State",ValueName:"StateCode",Sortable:!0},{Name:"State Name",ValueName:"StateName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("StateController",t),t.$inject=["$scope","$location","$state","stateService"]}();;!function(){"use strict";function e(e,t,a,o,r){var n=this;n.$state=a,n.stateState=r.state,n.attributes=[{Type:"text",Label:"State:",Required:!0,MaxLength:"5",ModelValue:"StateCode",Autofocus:"true"},{Type:"dropdown",Label:"Country:",Required:!0,ApiMethod:"countries",ValueProp:"Id",TextProp:"CountryName",ModelValue:"CountryId",ConvertToInt:"true"},{Type:"text",Label:"State Name:",Required:!0,MaxLength:"20",ModelValue:"StateName"}],n.id=o.id,n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("StateEditController",e),e.$inject=["$scope","$location","$state","$stateParams","stateService"]}();;!function(){"use strict";function t(t,e,a,i){this.edit=function(t){a.go("statusesTableEdit",{id:t})},this.statusService=i,this.attributes=[{Size:200,Name:"Status Name",ValueName:"StatusName",Edit:!0,Sortable:!0},{Size:200,Name:"Type",ValueName:"Type",Sortable:!0}]}angular.module("FieldConnectApp").controller("StatusController",t),t.$inject=["$scope","$location","$state","statusService"]}();;!function(){"use strict";function t(t,e,a,o,u){var i=this;i.$state=a,i.statusState=u.state,i.attributes=[{Type:"text",Label:"Status Name:",Required:!0,MaxLength:"15",ModelValue:"StatusName",Autofocus:"true"},{Type:"text",Label:"Type:",Required:!0,MaxLength:"20",ModelValue:"Type"},{Type:"int",Label:"Sort:",Required:!0,ModelValue:"Sort"}],i.id=o.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("StatusEditController",t),t.$inject=["$scope","$location","$state","$stateParams","statusService"]}();;!function(){"use strict";function e(e,t,i,a){this.edit=function(e){i.go("subscriptionTypesTableEdit",{id:e})},this.subscriptionTypeService=a,this.attributes=[{Size:200,Name:"Type Name",ValueName:"TypeName",Edit:!0,Sortable:!0},{Size:200,Name:"Duration",ValueName:"Duration",Sortable:!0},{Size:200,Name:"Price",ValueName:"Price",Sortable:!0,CellFormat:"decimal"},{Size:200,Name:"Status",ValueName:"Status",Sortable:!0}]}angular.module("FieldConnectApp").controller("SubscriptionTypeController",e),e.$inject=["$scope","$location","$state","subscriptionTypeService"]}();;!function(){"use strict";function e(e,t,a,i,u){var r=this;r.$state=a,r.subscriptionTypeState=u.state,r.filterStatus={filterId:"SubscriptionType"},r.attributes=[{Type:"text",Label:"Type Name:",Required:!0,MaxLength:"50",ModelValue:"TypeName",Autofocus:"true"},{Type:"int",Label:"Duration:",Required:!0,ModelValue:"Duration"},{Type:"decimal",Label:"Price:",Required:!0,MaxLength:"18",ModelValue:"Price"},{Type:"dropdown",Label:"Status:",ApiMethod:"statuses/statusbytype",Filter:r.filterStatus,ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",Required:!0}],r.id=i.id,r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("SubscriptionTypeEditController",e),e.$inject=["$scope","$location","$state","$stateParams","subscriptionTypeService"]}();;!function(){"use strict";function e(e,i,t,o){this.edit=function(e){t.go("subscriptionTypeRolesTableEdit",{id:e})},this.subscriptionTypeRoleService=o,this.attributes=[{Name:"Subscription Type",ValueName:"TypeName",Edit:!0,Sortable:!0},{Name:"Subscription Role",ValueName:"RoleName",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("SubscriptionTypeRoleController",e),e.$inject=["$scope","$location","$state","subscriptionTypeRoleService"]}();;!function(){"use strict";function e(e,o,t,i,r){var p=this;p.$state=t,p.subscriptionTypeRoleState=r.state,p.attributes=[{Type:"dropdown",Label:"Subscription Type:",Required:!0,ApiMethod:"subscriptionTypes",ValueProp:"Id",TextProp:"TypeName",ModelValue:"SubscriptionTypeId",ConvertToInt:"true",Autofocus:"true"},{Type:"dropdown",Label:"Subscription Role:",Required:!0,ApiMethod:"roles",ValueProp:"Id",TextProp:"RoleName",ModelValue:"RoleId",ConvertToInt:"true"}],p.id=i.id,p.loadingIndicator=!1}angular.module("FieldConnectApp").controller("SubscriptionTypeRoleEditController",e),e.$inject=["$scope","$location","$state","$stateParams","subscriptionTypeRoleService"]}();;!function(){"use strict";function e(e,t,i,a){this.edit=function(e){i.go("tagTypesTableEdit",{id:e})},this.tagTypeService=a,this.attributes=[{Size:250,Name:"Tag Type",ValueName:"TagTypeName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("TagTypeController",e),e.$inject=["$scope","$location","$state","tagTypeService"]}();;!function(){"use strict";function t(t,e,a,o,i){var n=this;n.$state=a,n.tagTypeState=i.state,n.attributes=[{Type:"text",Label:"Tag Type:",Required:!0,MaxLength:"20",ModelValue:"TagTypeName",Autofocus:"true"}],n.id=o.id,n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("TagTypeEditController",t),t.$inject=["$scope","$location","$state","$stateParams","tagTypeService"]}();;!function(){"use strict";function e(e,t,i,o){this.edit=function(e){i.go("timeZoneTableEdit",{id:e})},this.timeZoneService=o,this.attributes=[{Name:"Time Zone",ValueName:"TimeZoneName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("TimeZoneController",e),e.$inject=["$scope","$location","$state","timeZoneService"]}();;!function(){"use strict";function e(e,t,a,o,i){this.$state=a,this.id=o.id,this.attributes=[{Type:"text",Label:"Time Zone Name:",Required:!0,MaxLength:"50",ModelValue:"TimeZoneName",Autofocus:"true"},{Type:"text",Label:"Time Zone Database Name:",Required:!0,MaxLength:"50",ModelValue:"TzDatabaseName"},{Type:"text",Label:"Microsoft Time Zone Name:",Required:!0,MaxLength:"50",ModelValue:"MicrosoftTimeZoneName"}]}angular.module("FieldConnectApp").controller("TimeZoneEditController",e),e.$inject=["$scope","$location","$state","$stateParams","timezoneService"]}();;!function(){"use strict";function a(a,e,i,l){this.edit=function(a){i.go("unavailablesTableEdit",{id:a})},this.unavailableService=l,this.attributes=[{Size:250,Name:"Unavailable Type",ValueName:"UnavailableName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("UnavailableController",a),a.$inject=["$scope","$location","$state","unavailableService"]}();;!function(){"use strict";function a(a,e,t,l,i){var n=this;n.$state=l,n.unavailablesState=i.state,n.attributes=[{Type:"text",Label:"Unavailable Type:",Required:!0,MaxLength:"50",ModelValue:"UnavailableName",Autofocus:"true"}],n.id=t.id,n.loadingIndicator=!1}angular.module("FieldConnectApp").controller("UnavailableEditController",a),a.$inject=["$scope","$location","$stateParams","$state","unavailableService"]}();;!function(){"use strict";function a(a,e,t){this.filter={filterId:null},this.attributes=[{Name:"Unavailable Name",ValueName:"UnavailableName",Edit:!0,Sortable:!0},{Name:"Pay Rate",ValueName:"PayRateName",Edit:!1,Sortable:!0}],this.edit=function(a){t.go("unavailablePayRateEdit",{id:a})}}angular.module("FieldConnectApp").controller("UnavailablePayRateController",a),a.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,a,t,o){var l=this;l.goHome=function(){t.go("home")},l.$state=t,l.attributes=[{Type:"dropdown",Label:"Type:",ApiMethod:"unavailables",ValueProp:"Id",TextProp:"UnavailableName",ModelValue:"UnavailableId",Required:!0,ConvertToInt:"true"},{Type:"dropdown",Label:"PayRate :",ApiMethod:"payRates",ValueProp:"Id",TextProp:"PayRateName",ModelValue:"PayRateId",ConvertToInt:"true",Required:!0}],l.model={},l.id=o.id,l.loadingIndicator=!1}angular.module("FieldConnectApp").controller("UnavailablePayRateEditController",e),e.$inject=["$scope","$location","$state","$stateParams"]}();;!function(){"use strict";function e(e,t,o,i){this.edit=function(e){o.go("uomsTableEdit",{id:e})},this.uomService=i,this.attributes=[{Size:250,Name:"UOM",ValueName:"UOMName",Edit:!0,Sortable:!0},{Size:250,Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("UomController",e),e.$inject=["$scope","$location","$state","uomService"]}();;!function(){"use strict";function e(e,t,o,a,i){var l=this;l.$state=a,l.uomsState=i.state,l.attributes=[{Type:"text",Label:"UOM:",Required:!0,MaxLength:"10",ModelValue:"UOMName",Autofocus:"true"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"}],l.id=o.id,l.loadingIndicator=!1}angular.module("FieldConnectApp").controller("UomEditController",e),e.$inject=["$scope","$location","$stateParams","$state","uomService"]}();;!function(){"use strict";function t(t,e,o,a){this.edit=function(t){o.go("woStatusTableEdit",{id:t})},this.woStatusService=a,this.attributes=[{Name:"WO Status",ValueName:"WoStatusName",Edit:!0,Sortable:!0}]}angular.module("FieldConnectApp").controller("WOStatusController",t),t.$inject=["$scope","$location","$state","woStatusService"]}();;!function(){"use strict";function t(t,e,a,o,s){var u=this;u.$state=o,u.woStatusState=s.state,u.attributes=[{Type:"text",Label:"WO Status:",Required:!0,MaxLength:"15",ModelValue:"WoStatusName",Autofocus:"true"}],u.id=a.id,u.loadingIndicator=!1}angular.module("FieldConnectApp").controller("WOStatusEditController",t),t.$inject=["$scope","$location","$stateParams","$state","woStatusService"]}();;!function(){"use strict";function o(o,t,e,a){this.edit=function(o){e.go("woStatusColorsEditTable",{id:o})},this.woStatusColorService=a,this.attributes=[{Size:200,Name:"WO Status",ValueName:"WoStatusName",Edit:!0,Sortable:!0},{Size:200,Name:"Color Code",ValueName:"ColorCode",Sortable:!0,CellFormat:"color"}]}angular.module("FieldConnectApp").controller("WOStatusColorController",o),o.$inject=["$scope","$location","$state","woStatusColorService"]}();;!function(){"use strict";function t(t,o,e,a,r,u){var s=this;if(s.$state=a,s.model={},s.woStatusColorState=r.state,s.attributes=[{Type:"dropdown",Label:"WO Status:",Required:!0,ApiMethod:"wostatuses/forWoStatusColor",ValueProp:"Id",TextProp:"WoStatusName",ModelValue:"WoStatusId",ConvertToInt:"true",Autofocus:"true"},{Type:"colorpicker",Label:"Color Code:",Required:!0,ModelValue:"ColorCode"}],s.id=e.id,s.id){var d={};u.getItem("wostatuscolors/"+s.id).then(function(){d=u.state.item;s.model.WoStatusId=d.WoStatusId,s.attributes[0]={Type:"dropdown",Label:"WO Status:",Required:!0,ApiMethod:"wostatuses/",ValueProp:"Id",TextProp:"WoStatusName",ModelValue:"WoStatusId",ConvertToInt:"true",Autofocus:"true",ReadOnly:"true"}})}s.loadingIndicator=!1}angular.module("FieldConnectApp").controller("WOStatusColorEditController",t),t.$inject=["$scope","$location","$stateParams","$state","woStatusColorService","restService"]}();;!function(){"use strict";function e(e,t,o,a){this.edit=function(e){o.go("woTypeTableEdit",{id:e})},this.woTypeService=a,this.attributes=[{Size:250,Name:"WO Type",ValueName:"WoTypeName",Edit:!0,Sortable:!0},{Size:250,Name:"Code",ValueName:"Code",Edit:!1,Sortable:!0},{Size:250,Name:"Default",ValueName:"Default",Sortable:!0,CellFormat:"checkbox"}]}angular.module("FieldConnectApp").controller("WOTypeController",e),e.$inject=["$scope","$location","$state","woTypeService"]}();;!function(){"use strict";function e(e,t,a,o,l){var i=this;i.$state=o,i.woTypesState=l.state,i.attributes=[{Type:"text",Label:"WO Type:",Required:!0,MaxLength:"30",ModelValue:"WoTypeName",Autofocus:"true"},{Type:"text",Label:"Code:",Required:!1,MaxLength:"250",ModelValue:"Code"},{Type:"checkbox",Label:"Default",ModelValue:"Default"}],i.id=a.id,i.loadingIndicator=!1}angular.module("FieldConnectApp").controller("WOTypeEditController",e),e.$inject=["$scope","$location","$stateParams","$state","woTypeService"]}();;!function(){"use strict";function o(o,e,n,t,i,a,s){var T,g=this;function l(){var o=t.getValue("authorizationData");o&&(g.userRoles=o.userRoles.split(","),g.userRoleTypes=o.userRoleTypes,-1!=g.userRoles.indexOf("FieldConnect")?g.isFC=!0:-1!=g.userRoles.indexOf("Admin")?g.isAdmin=!0:-1!=g.userRoles.indexOf("TransAdmin")?g.isTransAdmin=!0:-1!=g.userRoles.indexOf("Office")?g.isOffice=!0:-1!=g.userRoles.indexOf("Dispatch")?g.isDispatch=!0:-1!=g.userRoles.indexOf("SubAdmin")&&(g.isSubAdmin=!0))}function u(){n.go("problemCodesTable")}g.$state=n,g.isFC=!1,g.isAdmin=!1,g.isTransAdmin=!1,g.isOffice=!1,g.isDispatch=!1,g.isSubAdmin=!1,g.isQuotingEnabled=!1,g.goToHome=function(){n.go("home")},g.goToRefTable=function(){n.go("referenceTables")},g.goToServiceArea=function(){n.go("serviceAreasTable")},g.goToCountries=function(){n.go("countriesTable")},g.goToState=function(){n.go("stateTable")},g.goToCurrency=function(){n.go("currenciesTable")},g.goToLocation=function(){n.go("locationsTable")},g.goToTimeZone=function(){n.go("timeZonesTable")},g.goToWOStatus=function(){n.go("woStatusesTable")},g.goToWOType=function(){n.go("woTypesTable")},g.goToPriority=function(){n.go("prioritiesTable")},g.goToManufacturer=function(){n.go("manufacturer")},g.goToItemClass=function(){n.go("itemClass")},g.goToItemType=function(){n.go("itemType")},g.goToServiceableItemClass=function(){n.go("serviceableItemClass")},g.goToEquipment=function(){n.go("equipmentTable")},g.goToServiceableItemType=function(){n.go("serviceableItemType")},g.goToEquipmentClass=function(){n.go("equipmentClass")},g.goToEquipmentType=function(){n.go("equipmentType")},g.goToLaborCode=function(){n.go("laborCode")},g.goToSiteType=function(){n.go("siteTypesTable")},g.goToBillingType=function(){n.go("billingTypesTable")},g.goToAssigmentStatus=function(){n.go("assigmentStatusesTable")},g.goToCause=function(){n.go("causesTable")},g.goToSkill=function(){n.go("skillsTable")},g.goToResolution=function(){n.go("resolutionsTable")},g.goToIndustry=function(){n.go("industriesTable")},g.goToPaymentTerm=function(){n.go("paymentTermsTable")},g.goToMerchant=function(){n.go("merchantsTable")},g.goToEventType=function(){n.go("eventTypesTable")},g.goToTagType=function(){n.go("tagTypesTable")},g.goToLaborGroup=function(){n.go("laborGroupTable")},g.goToAttachmentCategory=function(){n.go("attachmentCategoriesTable")},g.goToUnavailableType=function(){n.go("unavailablesTable")},g.goToNoteLib=function(){n.go("noteLibsTable")},g.goToRoleType=function(){n.go("roleTypesTable")},g.goToRole=function(){n.go("rolesTable")},g.goToAttachmentType=function(){n.go("attachmentTypesTable")},g.goToOperationGroup=function(){n.go("operationGroupsTable")},g.goToProblemCodeTask=function(){n.go("problemCodeTasksTable")},g.goToSubscriptionType=function(){n.go("subscriptionTypesTable")},g.goToSubscriptionTypeRole=function(){n.go("subscriptionTypeRolesTable")},g.goToSetting=function(){n.go("settingsTable")},g.goToProblemCode=u,g.goToStatus=function(){n.go("statusesTable")},g.goToDocType=function(){n.go("docTypesTable")},g.goToBillingPeriod=function(){n.go("billingPeriodsTable")},g.goToWOStatusColor=function(){n.go("woStatusColorsTable")},g.goToProblemCode=u,g.goToCrew=function(){n.go("crewsTable")},g.goToUom=function(){n.go("uomsTable")},g.goToAssignmentStatusColor=function(){n.go("assignmentStatusColorsTable")},g.goToQuotePriority=function(){n.go("quotePriority")},g.isFCFunc=l,g.goToLeadSource=function(){n.go("leadSourceTable")},g.goToDSLServiceOrderType=function(){n.go("dslServiceOrderTypeTable")},g.goToDSLServiceZoneCode=function(){n.go("dslServiceZoneCodeTable")},g.goToDSLFailureResolution=function(){n.go("dslFailureResolutionTable")},g.goToDSLPartsReceived=function(){n.go("dslPartsReceivedTable")},g.goToDSLRecallDueTo=function(){n.go("dslRecallDueToTable")},g.goToDSLDistributor=function(){n.go("dslDistributorTable")},g.goToDSLInventoryPostingGroup=function(){n.go("dslInventoryPostingGroupTable")},g.goToDSLServiceZoneLaborCode=function(){n.go("dslServiceZoneLaborCodeTable")},g.goToDSLActionTaken=function(){n.go("dslActionTakenTable")},g.goToDSLFaultAreas=function(){n.go("dslFaultAreasTable")},g.goToDSLApplicableCode=function(){n.go("dslApplicableCodeTable")},g.goToDSLInstalledRemoved=function(){n.go("dslInstalledRemovedTable")},g.goToDSLWhoPays=function(){n.go("dslWhoPaysTable")},g.usingDSLNorthwest=s.usingDSLNorthwest,g.goToDashboardChartType=function(){n.go("dashboardChartTypeTable")},g.goToDashboardReportType=function(){n.go("dashboardReportTypeTable")},g.goToDashboardFilterDDList=function(){n.go("dashboardFilterDDListTable")},g.goToDashboardConfigDDList=function(){n.go("dashboardConfigDDListTable")},g.goToDispatchCalendarThemes=function(){n.go("dispatchCalendarThemesTable")},g.goToDispatchChartThemes=function(){n.go("dispatchChartThemesTable")},g.goToDispatchMonthlyCalendarThemes=function(){n.go("dispatchMonthlyCalendarThemesTable")},g.goToDefaultDispatchCalendarSettings=function(){n.go("defaultDispatchCalendarSettingsTable")},g.goToDefaultStartPage=function(){n.go("defaultStartPageTable")},g.goToDeficiencyStatusAction=function(){n.go("deficiencyStatusActionTable")},g.goToDeficiencyStatus=function(){n.go("deficiencyStatusTable")},g.goToDeficiencySeverity=function(){n.go("deficiencySeverityTable")},l(),(T=a.filter("and")).eq("FeatureName","Quoting"),i.getItems("companyfeatures/currentCompany",T).then(function(o){if(o&&o.data.Data&&1==o.data.Data.length){var e=o.data.Data[0];g.isQuotingEnabled=0!=e.Id}})}angular.module("FieldConnectApp").controller("ReferenceTablesController",o),o.$inject=["$scope","$location","$state","cryptoStorageService","restService","qsService","featuresFactory"]}();;!function(){"use strict";function e(e,t,a,o){var r=this;r.$state=a,r.filterTab="Reports",r.filterTabWindow=!1,r.edit=function(e){a.go("reportBuilderEdit",{id:e})},r.attributes=[{Size:25,Name:"Report Name",ValueName:"ReportName",Edit:!0,Sortable:!0},{Size:25,Name:"Report Type",ValueName:"ReportTypeName",Edit:!1,Sortable:!0}],r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("ReportBuilderController",e),e.$inject=["$scope","$location","$state","$stateParams"]}();;!function(){"use strict";function e(e,t,o,r,i,p,l,n,a,s){var d=this;d.$state=t,d.model={},d.id=i.id,d.showSections=!1,d.isServiceReport=!1,d.formValidation={},d.isLoading=!1,this.editorOptions={language:"ru",uiColor:"#000000"};var u=n.getValue("featurelist"),c=a("filter")(u,{FeatureName:"XOiIntegration"});d.usingXOiIntegration=c[0].Active,d.reportName={Type:"text",Label:"Name:",Required:!0,MaxLength:"25",ModelValue:"ReportName",ReadOnly:!1,CustomDivClass:"col-sm-6 col-lg-6"},d.reportType={Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"reports/reporttypeddlist",Filter:d.reportTypeFilter,ValueProp:"Id",TextProp:"ReportTypeName",ModelValue:"ReportTypeId",ConvertToInt:"true",ReadOnly:!1,Name:"ReportType",CustomDivClass:"col-sm-6 col-lg-6"},d.attributes=[d.reportName,d.reportType,{Type:"line",CustomClass:"col-sm-12"}],e.$watch("vm.model.Id",function(e,t){e!==t&&"Service Report"===d.model.ReportName&&r(function(){d.isServiceReport=!0,d.reportName.ReadOnly=!0,d.reportType.ReadOnly=!0})}),d.reportTypeIdWatch=e.$watch("vm.model.ReportTypeId",function(e,t){null!==e&&void 0!==e&&(d.isLoading=!0,r(function(){d.reportTypeName=d.getReportTypeName(d.model.ReportTypeId),d.isLoading=!1},500))}),d.getReportTypeName=function(e){var t="",o=$.grep(d.attributes,function(e){return"ReportType"===e.Name});if(void 0!==o[0].CurrentList){var r=o[0].CurrentList,i=$.grep(r,function(t){return t.Id===e});t=i[0].ReportTypeName,d.reportAttributes=i[0].Attributes,d.reportSections=i[0].Sections,d.usingXOiIntegration&&"Service Report"===i[0].ReportTypeName&&(d.reportAttributes+=s.reportAttributes)}return t},d.onSubmit=function(){d.isServiceReport||"Service Report"!==d.reportTypeName?d.validateFields()&&(d.model.Id?o.update("reports/"+d.model.Id,d.model).then(function(e){t.go("ReportBuilder")}):o.create("reports",d.model).then(function(e){t.go("ReportBuilder")})):l.warning({message:"Multiple Service Reports are not supported at this time! Select a different type."})},d.validateFields=function(){var e=!0;return d.reportName.CustomDivClass="col-sm-6 col-lg-6",d.reportType.CustomDivClass="col-sm-6 col-lg-6",void 0!==d.model.ReportName&&null!==d.model.ReportName||(d.reportName.CustomDivClass="col-sm-6 col-lg-6 has-error",e=!1),void 0!==d.model.ReportTypeId&&null!==d.model.ReportTypeId||(d.reportType.CustomDivClass="col-sm-6 col-lg-6 has-error",e=!1),e||l.warning({message:"Please fill in required fields!"}),e},d.onBack=function(){t.go("ReportBuilder")},d.showSectionsEdit=function(){d.showSections=!0},d.hideSectionsEdit=function(){d.showSections=!1}}angular.module("FieldConnectApp").controller("ReportBuilderEditController",e),e.$inject=["$scope","$state","restService","$timeout","$stateParams","qsService","Notification","cryptoStorageService","$filter","xoiService"]}();;!function(){"use strict";function e(e,t,o,i,n,l,r,s,c,d){var a=this;a.loadingData=!1,a.onSubmit=function(){i.update("reportbuilder/"+a.model.Id,a.model).then(function(e){console.log(e),e&&(n.success({message:"Report Section successfully updated!"}),d(function(){l.location.reload()},1200))})},a.disableSubmit=!0,a.ReportList=[],a.ReportSectionList=[],a.model={},a.model.Id=0,a.model.SectionHTML="",a.model.CustomerId=null,a.AllowedFields=[],a.sectionVariable=[],a.selectedSection=function(t){a.model.Id=t.Id,a.sectionVariable=[],i.getItems("reportbuilder/"+a.model.Id).then(function(t){a.model=t.data;var o=a.model.AllowedFields.split(","),i="";angular.forEach(o,function(e,t){a.sectionVariable.push({title:e,content:"{"+e+"}"}),i=i+" {"+e+"}"}),document.getElementById("sectionVariables").innerHTML="<u><strong>Attributes:</strong></u> "+i,d(function(){e.$broadcast("$tinymce:refresh"),a.updateHtml()},200),a.disableSubmit=!1})},this.updateHtml=function(){var e=a.model.SectionHTML;a.tinymceHtml=c.trustAsHtml(e)},a.sectionFilter=r.filter("and"),a.sectionFilter.eq("CustomerId",a.model.CustomerId),i.getItems("reportbuilder/getreportsection/",a.sectionFilter).then(function(e){a.ReportSectionList=e.data.Data})}angular.module("FieldConnectApp").controller("ReportSectionController",e),e.$inject=["$scope","$stateParams","$state","restService","Notification","$window","qsService","$q","$sce","$timeout"]}();;!function(){"use strict";function e(e,t,o,r,n,i,p,l,a,s){var d=this;function c(t){d.sectionFilter=p.filter("and"),d.sectionFilter.eq("CustomerId",d.reportModel.CustomerId),d.sectionFilter.eq("ReportId",t),r.getItems("reportbuilder/getreportsection/",d.sectionFilter).then(function(t){d.reportTempate=[];var o=t.data.Data;angular.forEach(o,function(e,t){d.reportTempate.push({title:e.SectionName,content:"{"+e.SectionName+"}"})}),d.reportTempate.push({title:"___________________",content:""}),d.reportTempate.push({title:"CompanyName",content:"{CompanyName}"}),d.reportTempate.push({title:"CompanyLogo",content:"{CompanyLogo}"}),d.reportTempate.push({title:"CompanyAddress",content:"{CompanyAddress}"}),d.reportTempate.push({title:"CompanyCity",content:"{CompanyCity}"}),d.reportTempate.push({title:"CompanyState",content:"{CompanyState}"}),d.reportTempate.push({title:"CompanyZipCode",content:"{CompanyZipCode}"}),r.getItems("reportbuilder/getreport/"+d.reportModel.Id).then(function(t){console.log(t),d.reportModel=t.data,d.reportstinymceOptions={theme:"modern",width:"100%",height:"200px",plugins:"code preview fullpage fullscreen image link media template table charmap hr textcolor",toolbar1:"undo redo | formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify  | numlist bullist outdent indent  | removeformat",templates:d.reportTempate},s(function(){e.$broadcast("$tinymce:refresh"),d.updateReportHtml()},200),d.disableSubmit=!1})})}d.loadingData=!1,d.onSubmit=function(){r.update("reportbuilder/report/"+d.reportModel.Id,d.reportModel).then(function(e){e&&(n.success({message:"Report successfully updated!"}),s(function(){i.location.reload()},1200))})},d.showPreview=function(){d.previewHTML="",r.getItems("reportbuilder/getreportTemplate/"+d.reportModel.Id+"/"+d.woid).then(function(e){console.log(e),d.previewHTML=a.trustAsHtml(e.data.ReportHTML)})},d.disableSubmit=!0,d.reportModel={},d.reportModel.Id=0,d.reportModel.SectionHTML="",d.reportModel.CustomerId=null,d.previewHTML="",d.woid="",d.ReportList=[],d.reportTempate=[],this.editorOptions={language:"ru",uiColor:"#000000"},d.selectedReport=function(e){null!=e?(d.reportModel.Id=e.Id,c(e.Id)):(d.reportModel={},d.previewHTML="")},this.updateReportHtml=function(){var e=d.reportModel.ReportHTML;d.reportTinymceHtml=a.trustAsHtml(e)},d.sectionFilter=p.filter("and"),d.sectionFilter.eq("CustomerId",d.reportModel.CustomerId),r.getItems("reportbuilder/getreporttype/",d.sectionFilter).then(function(e){d.ReportList=e.data.Data})}angular.module("FieldConnectApp").controller("ReportsController",e),e.$inject=["$scope","$stateParams","$state","restService","Notification","$window","qsService","$q","$sce","$timeout"]}();;!function(){"use strict";function e(e,t,r,i,s,l,o,a){var d=this;function n(){d.model.RoleId=d.filter.RoleId,d.model.GetResourceIds=[],d.model.CreateResourceIds=[],d.model.UpdateResourceIds=[],d.model.DeleteResourceIds=[];for(var t=0;t<e.itemsRightGet.length;t++){var r=e.itemsRightGet[t];d.model.GetResourceIds.push(r.Id)}for(t=0;t<e.itemsRightCreate.length;t++){r=e.itemsRightCreate[t];d.model.CreateResourceIds.push(r.Id)}for(t=0;t<e.itemsRightUpdate.length;t++){r=e.itemsRightUpdate[t];d.model.UpdateResourceIds.push(r.Id)}for(t=0;t<e.itemsRightDelete.length;t++){r=e.itemsRightDelete[t];d.model.DeleteResourceIds.push(r.Id)}}d.loadingData=!1,d.moveRightGet=function(){for(var t=e.leftGet,r=0;r<t.length;r++){var i=t[r];e.itemsRightGet.indexOf(i)<0&&(e.itemsRightGet.push(i),d.removeGet(t[r]))}e.leftGet=[]},d.moveRightCreate=function(){for(var t=e.leftCreate,r=0;r<t.length;r++){var i=t[r];e.itemsRightCreate.indexOf(i)<0&&(e.itemsRightCreate.push(i),d.removeCreate(t[r]))}e.leftCreate=[]},d.moveRightUpdate=function(){for(var t=e.leftUpdate,r=0;r<t.length;r++){var i=t[r];e.itemsRightUpdate.indexOf(i)<0&&(e.itemsRightUpdate.push(i),d.removeUpdate(t[r]))}e.leftUpdate=[]},d.moveRightDelete=function(){for(var t=e.leftDelete,r=0;r<t.length;r++){var i=t[r];e.itemsRightDelete.indexOf(i)<0&&(e.itemsRightDelete.push(i),d.removeDelete(t[r]))}e.leftDelete=[]},d.removeGet=function(t){var r=e.itemsLeftGet.indexOf(t);e.itemsLeftGet.splice(r,1)},d.removeCreate=function(t){var r=e.itemsLeftCreate.indexOf(t);e.itemsLeftCreate.splice(r,1)},d.removeUpdate=function(t){var r=e.itemsLeftUpdate.indexOf(t);e.itemsLeftUpdate.splice(r,1)},d.removeDelete=function(t){var r=e.itemsLeftDelete.indexOf(t);e.itemsLeftDelete.splice(r,1)},d.addGet=function(t){var r=e.itemsRightGet.indexOf(t);e.itemsRightGet.splice(r,1)},d.addCreate=function(t){var r=e.itemsRightCreate.indexOf(t);e.itemsRightCreate.splice(r,1)},d.addUpdate=function(t){var r=e.itemsRightUpdate.indexOf(t);e.itemsRightUpdate.splice(r,1)},d.addDelete=function(t){var r=e.itemsRightDelete.indexOf(t);e.itemsRightDelete.splice(r,1)},d.moveLeftGet=function(){for(var t=e.rightGet,r=0;r<t.length;r++){var i=t[r];e.itemsLeftGet.indexOf(i)<0&&(e.itemsLeftGet.push(i),d.addGet(t[r]))}e.rightGet=[]},d.moveLeftCreate=function(){for(var t=e.rightCreate,r=0;r<t.length;r++){var i=t[r];e.itemsLeftCreate.indexOf(i)<0&&(e.itemsLeftCreate.push(i),d.addCreate(t[r]))}e.rightCreate=[]},d.moveLeftUpdate=function(){for(var t=e.rightUpdate,r=0;r<t.length;r++){var i=t[r];e.itemsLeftUpdate.indexOf(i)<0&&(e.itemsLeftUpdate.push(i),d.addUpdate(t[r]))}e.rightUpdate=[]},d.moveLeftDelete=function(){for(var t=e.rightDelete,r=0;r<t.length;r++){var i=t[r];e.itemsLeftDelete.indexOf(i)<0&&(e.itemsLeftDelete.push(i),d.addDelete(t[r]))}e.rightDelete=[]},d.fillModel=n,d.submit=function(){d.loadingData=!0,n(),null==d.model.RoleId?(s.error({message:"Please pick role and load permissions."}),d.loadingData=!1):i.create("rolepermission",d.model).then(function(e){s.success({message:"Permissions have been updated"}),d.loadingData=!1},function(e){d.loadingData=!1})},d.model={RoleId:null,GetResourceIds:[],CreateResourceIds:[],UpdateResourceIds:[],DeleteResourceIds:[]},e.itemsRightGet=[],e.itemsRightCreate=[],e.itemsRightUpdate=[],e.itemsRightDelete=[],e.itemsLeftGet=[],e.itemsLeftCreate=[],e.itemsLeftUpdate=[],e.itemsLeftDelete=[],d.filter={RoleId:null},d.roleFilter=o.filter("and"),d.roleFilter.neq("RoleTypeName","Fc"),d.resourceFilterGetApplyed=o.filter("and"),d.resourceFilterGet=o.filter("and"),d.resourceFilterCreateApplyed=o.filter("and"),d.resourceFilterCreate=o.filter("and"),d.resourceFilterUpdateApplyed=o.filter("and"),d.resourceFilterUpdate=o.filter("and"),d.resourceFilterDeleteApplyed=o.filter("and"),d.resourceFilterDelete=o.filter("and"),e.$watch("vm.filter.RoleId",function(){if(null!=d.filter.RoleId){d.loadingData=!0,d.resourceFilterGetApplyed.reset(),d.resourceFilterGet.reset(),d.resourceFilterCreateApplyed.reset(),d.resourceFilterCreate.reset(),d.resourceFilterUpdateApplyed.reset(),d.resourceFilterUpdate.reset(),d.resourceFilterDeleteApplyed.reset(),d.resourceFilterDelete.reset(),d.resourceFilterGetApplyed.eq("RoleId",d.filter.RoleId).eq("PermissionName","Get").eq("Applyed",!0),d.resourceFilterGet.eq("RoleId",d.filter.RoleId).eq("PermissionName","Get").eq("Applyed",!1),d.resourceFilterCreateApplyed.eq("RoleId",d.filter.RoleId).eq("PermissionName","Create").eq("Applyed",!0),d.resourceFilterCreate.eq("RoleId",d.filter.RoleId).eq("PermissionName","Create").eq("Applyed",!1),d.resourceFilterUpdateApplyed.eq("RoleId",d.filter.RoleId).eq("PermissionName","Update").eq("Applyed",!0),d.resourceFilterUpdate.eq("RoleId",d.filter.RoleId).eq("PermissionName","Update").eq("Applyed",!1),d.resourceFilterDeleteApplyed.eq("RoleId",d.filter.RoleId).eq("PermissionName","Delete").eq("Applyed",!0),d.resourceFilterDelete.eq("RoleId",d.filter.RoleId).eq("PermissionName","Delete").eq("Applyed",!1);var t=i.getItems("resource",d.resourceFilterGetApplyed).then(function(){e.itemsRightGet=i.state.items}),r=i.getItems("resource",d.resourceFilterGet).then(function(){e.itemsLeftGet=i.state.items}),s=i.getItems("resource",d.resourceFilterCreateApplyed).then(function(){e.itemsRightCreate=i.state.items}),l=i.getItems("resource",d.resourceFilterCreate).then(function(){e.itemsLeftCreate=i.state.items}),o=i.getItems("resource",d.resourceFilterUpdateApplyed).then(function(){e.itemsRightUpdate=i.state.items}),n=i.getItems("resource",d.resourceFilterUpdate).then(function(){e.itemsLeftUpdate=i.state.items}),m=i.getItems("resource",d.resourceFilterDeleteApplyed).then(function(){e.itemsRightDelete=i.state.items}),f=i.getItems("resource",d.resourceFilterDelete).then(function(){e.itemsLeftDelete=i.state.items});a.all([t,r,s,l,o,n,m,f]).then(function(e){d.loadingData=!1})}},!0)}angular.module("FieldConnectApp").controller("RolePermissionController",e),e.$inject=["$scope","$stateParams","$state","restService","Notification","$window","qsService","$q"]}();;!function(){"use strict";function e(e,t,o,a,l,i,r,d,n){var s=this;s.$state=o,s.edit=function(e,t){s.model.WoId=parseInt(t),s.model.NoteTemp="",s.model.CustomerViewable=!0;var o=!1,a=angular.copy(s.attributesEdit);if(e&&u){for(var r=0;r<a.length;r++)a[r].ReadOnly=!0;o=!0}l.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Service Request Note edit",id:e,model:s.model,attributes:a,apiMethod:"wonotes",hideSubmit:o}}).then(function(e){e.close.then(function(){s.reloadTable=!1,i(function(){s.reloadTable=!0})})})},s.model={NoteTemp:""};var m=n.getValue("authorizationData");s.userRoles=m.userRoles.split(",");var u=!1;-1==s.userRoles.indexOf("CustAdmin")&&-1==s.userRoles.indexOf("Cust")||(u=!0),e.$watch("wn.model.NoteTemp",function(){s.model.Note=s.model.NoteTemp}),s.attributes=[{Name:"Date Time",ValueName:"SysModifyUTC",Edit:!0,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Customer Viewable",ValueName:"Viewable",Edit:!1,Sortable:!0,CellFormat:"checkbox",Roles:["Admin","Office","FieldConnect"]},{Name:"Note",ValueName:"Note",Edit:!1,Sortable:!0}],s.attributesEdit=[{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"Viewable",Roles:["Admin","Office","FieldConnect"]},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note",Required:!0,Rows:10}],s.reloadTable=!0}angular.module("FieldConnectApp").controller("ServiceRequestNoteController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","$timeout","qsService","restService","cryptoStorageService"]}();;!function(){"use strict";function e(e,t,r,l,a,o,i,m,s,d,u,n,c,S){var f=this;f.model={},f.edit=function(e){"Cancelled"===e.StatusName?a.go("serviceRequestReadOnly",{id:e.Id}):a.go("customerServiceRequestEdit",{id:e.Id})},f.$state=a,f.loadData=!1,f.isLoading=!1,f.reloadData=D,f.cancelServiceRequest=q,f.processServiceRequest=T,f.selectCustomer=y;var I=new Date;I.setDate(I.getDate()-30),f.filter={fromDate:I,toDate:new Date,customerId:null,siteId:null,serviceableItemId:null,statusId:null},f.filtermodel={},f.customer={customerId:0},f.customers=[],f.site={siteId:0},f.filterBySite=i.filter("and"),f.filterBySite.eq("SiteId",0),r.$watch("vm.filter.customerId",function(){f.filter.siteId=null,f.filter.serviceableItemId=null,f.filterSites.reset(),f.filterServisableItems.reset(),f.filter.customerId&&(f.filterSites.eq("CustomerId",f.filter.customerId),f.filterServisableItems.eq("CustomerId",f.filter.customerId))}),r.$watch("vm.filter.siteId",function(){f.filter.serviceableItemId=null,f.filterServisableItems.reset(),f.filter.siteId&&f.filterServisableItems.eq("CustomerId",f.filter.customerId).eq("SiteId",f.filter.siteId)}),f.filterServiceRequests=i.filter("and"),f.filterServiceRequests.neq("StatusName","WOCreated"),f.filterSites=i.filter("and"),f.filterServisableItems=i.filter("and"),f.filterStatuses=i.filter("and"),f.filterStatuses.eq("Type","ServiceRequestStatus").neq("StatusName","WOCreated");var C={Name:"Action",CellFormat:"template",CustomHeaderClass:"form-action",CustomCellClass:"form-action-cell",CellFormatData:{TemplateUrl:"cancelprocessView.html",onCancel:q,onProcess:T}},N={Type:"dropdown",Label:"Status:",ApiMethod:"statuses",ValueProp:"Id",TextProp:"StatusName",ModelValue:"ServiceRequestStatusId",Filter:f.filterStatuses,TabIndex:6};f.siteAutocompleteFilter=i.filter("or"),f.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],f.searchColsSite=["Search"],f.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}],f.ddlgridattrsSite=[{Name:"Customer",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Site Code",ValueName:"SiteCode",Sortable:!0,CellFormat:"label"},{Name:"Site Name",ValueName:"SiteName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"FullAddress",Sortable:!0,CellFormat:"label"}];var p={Type:"dropdowngridbutton",FocusOut:!0,ReadOnly:!1,ShowHeader:!0,onSelect:R,SearchTrigger:1,Label:"Customer:",Required:!1,ApiMethod:"customers/active",ModelValue:"CustomerName",Id:"CustomerName",GridAttributes:f.ddlgridattrsCustomer,PageSize:22,SearchCols:f.searchColsCustomer,Autofocus:"true",TabIndex:1,onClick:y},b={Type:"dropdowngridbutton",FocusOut:!0,ReadOnly:!1,ShowHeader:!0,onSelect:h,SearchTrigger:1,Label:"Site:",Required:!1,ApiMethod:"sites/searchgrid",ModelValue:"SiteName",filter:f.siteAutocompleteFilter,Id:"SiteName",GridAttributes:f.ddlgridattrsSite,PageSize:22,SearchCols:f.searchColsSite,TabIndex:2,onClick:function(){var e="";if(f.filtermodel.SiteId)var e=angular.copy(f.filtermodel.SiteName);else if(f.SiteNameTemp){var e=angular.copy(f.SiteNameTemp);f.SiteNameTemp=""}n.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectSite.html",controller:"SelectSiteController",controllerAs:"vm",inputs:{site:f.site,customerId:f.filtermodel.CustomerId,onSelect:h,siteName:e}})}};f.attributesFilter=[p,{Type:"datepicker",Label:"Start Date:",ModelValue:"StartDate",Format:"MM/dd/yyyy",SubType:"date",TabIndex:4,DefaultValue:!0},b,{Type:"datepicker",Label:"End Date:",ModelValue:"EndDate",Format:"MM/dd/yyyy",SubType:"date",TabIndex:5,DefaultValue:!0},{Type:"dropdown",Label:"Serviceable Item:",ApiMethod:"serviceableitems",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",Filter:f.filterBySite,TabIndex:3},N],f.attributes=[{Name:"Create Date",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Requested by",ValueName:"Name",Edit:!1,Sortable:!0},{Name:"Need By Date",ValueName:"NeedByDate",Edit:!1,Sortable:!0,FormatDate:"date"},{Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!1,Sortable:!0},{Name:"Problem Code",ValueName:"ProblemCodeName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!0,Sortable:!0},{Name:"Status",ValueName:"StatusName",Edit:!1,Sortable:!0},C];var v=['<button class="btn btn-default btn-xs" style="width: 50% display: inline-block" ng-click="attr.CellFormatData.onCancel(item)" ng-if="item.StatusName == \'Requested\'">Cancel Request</button>','<button class="btn btn-default btn-xs" style="width: 50% display: inline-block" ng-click="attr.CellFormatData.onProcess(item)" ng-if="item.StatusName == \'Requested\'">Process</button>'].join("");function D(){if(void 0!==f.filtermodel.StartDate){if(!S.validateDate(f.filtermodel.StartDate))return}else f.filtermodel.StartDate=null;if(void 0!==f.filtermodel.EndDate){if(!S.validateDate(f.filtermodel.EndDate))return}else f.filtermodel.EndDate=null;if(void 0===f.filtermodel.StartDate||void 0===f.filtermodel.EndDate||S.validateDateRange(f.filtermodel.StartDate,f.filtermodel.EndDate)){if(f.isLoading=!0,f.loadData=!1,""!=f.filtermodel.StartDate&&null!=f.filtermodel.StartDate){f.filtermodel.StartDate=new Date(f.filtermodel.StartDate),f.filtermodel.StartDate.setHours(0,0,0,0);var e=new Date(f.filtermodel.StartDate);m.convertToUtc(e);var t=m.buildISOString(e)}if(""!=f.filtermodel.EndDate&&null!=f.filtermodel.EndDate){f.filtermodel.EndDate=new Date(f.filtermodel.EndDate),f.filtermodel.EndDate.setHours(23,59,59,999);var l=new Date(f.filtermodel.EndDate);m.convertToUtc(l);var a=m.buildISOString(l)}f.filterServiceRequests.reset(),f.filterServiceRequests.neq("StatusName","WOCreated").ge("NeedByDate",t).le("NeedByDate",a).eq("CustomerId",f.filtermodel.CustomerId).eq("SiteId",f.filtermodel.SiteId).eq("serviceableItemId",f.filtermodel.ServiceableItemId).eq("ServiceRequestStatusId",f.filtermodel.ServiceRequestStatusId);var o={};f.filtermodel.CustomerId&&(o.CustomerId=f.filtermodel.CustomerId,o.CustomerInfo=f.CustomerInfo),f.filtermodel.SiteId&&(o.SiteId=f.filtermodel.SiteId,o.SiteInfo=f.SiteInfo),f.filtermodel.StartDate&&(o.StartDate=m.buildISOString(f.filtermodel.StartDate)),f.filtermodel.EndDate&&(o.EndDate=m.buildISOString(f.filtermodel.EndDate)),f.filtermodel.ServiceableItemId&&(o.ServiceableItemId=f.filtermodel.ServiceableItemId),f.filtermodel.ServiceRequestStatusId&&(o.ServiceRequestStatusId=f.filtermodel.ServiceRequestStatusId);var i={};s.getValue("lastselection_"+f.UserData.Id)&&(i=s.getValue("lastselection_"+f.UserData.Id)),i.proSerReq=o,s.setValue("lastselection_"+f.UserData.Id,i),setTimeout(function(){f.loadData=!0,f.isLoading=!1,r.$apply()},1e3)}}function q(t){bootbox.confirm({message:t.Desc.length>20?"Are you sure you want to Cancel the Service Request: '"+t.Desc.substring(0,20)+"...'?":"Are you sure you want to Cancel the Service Request: '"+t.Desc+"'?",buttons:{confirm:{label:"Yes",className:"btn-primary"},cancel:{label:"No",className:"btn-default"}},callback:function(l){if(l){for(var o=angular.copy(t),i=0;i<N.CurrentList.length;i++)if("Cancelled"==N.CurrentList[i].StatusName){o.ServiceRequestStatusId=N.CurrentList[i].Id;break}if(f.loadData=!1,o.NeedByDate){var s=new Date(o.NeedByDate);m.convertToUtc(s),o.NeedByDate=m.buildISOString(s)}e.update("servicerequests/"+o.Id,o).then(function(e){f.loadData=!0,u.success({message:"Service Request has been successfully updated."}),a.go("processServiceRequest")})}r.$apply(),a.go("processServiceRequest")}})}d.put("cancelprocessView.html",v),c.getCurrentUserData().then(function(e){f.isLoading=!0,f.UserData=e;var t=s.getValue("lastselection_"+f.UserData.Id);t&&t.proSerReq&&l(function(){t.proSerReq.CustomerId&&(f.filtermodel.CustomerId=t.proSerReq.CustomerId,R(t.proSerReq.CustomerInfo)),t.proSerReq.SiteId&&(f.filtermodel.SiteId=t.proSerReq.SiteId,h(t.proSerReq.SiteInfo)),t.proSerReq.StartDate&&(f.filtermodel.StartDate=m.parseISOString(t.proSerReq.StartDate)),t.proSerReq.EndDate&&(f.filtermodel.EndDate=m.parseISOString(t.proSerReq.EndDate)),t.proSerReq.ServiceableItemId&&(f.filtermodel.ServiceableItemId=t.proSerReq.ServiceableItemId),t.proSerReq.ServiceRequestStatusId&&(f.filtermodel.ServiceRequestStatusId=t.proSerReq.ServiceRequestStatusId),D()})}),r.$watch("vm.customer.customerId",function(){null!=f.customer.customerId&&f.customer.customerId>0&&f.filtermodel.CustomerId!=f.customer.customerId&&(f.filtermodel.CustomerId=f.customer.customerId,f.siteAutocompleteFilter.reset(),f.siteAutocompleteFilter.eq("CustomerId",f.customer.customerId)),f.filterBySite.eq("SiteId",0)});var g=r.$watch("vm.filtermodel.StartDate",function(){f.filtermodel.StartDate&&(f.filtermodel.StartDate=new Date(I),f.filtermodel.EndDate=new Date,D(),g())});function y(){var e="";if(f.filtermodel.CustomerId)e=angular.copy(f.filtermodel.CustomerName);else if(f.CustomerNameTemp){e=angular.copy(f.CustomerNameTemp);f.CustomerNameTemp=""}n.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectCustomer.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:f.customer,onSelect:R,customerName:e}})}function R(e){f.CustomerInfo=e,e.CustomerCode&&""!=e.CustomerCode?f.filtermodel.CustomerName=e.CustomerCode+" - "+e.CustomerName:f.filtermodel.CustomerName=e.CustomerName,f.filtermodel.CustomerId=e.Id,f.filtermodel.SiteId=null,f.filtermodel.SiteName=null,f.siteAutocompleteFilter.reset(),f.siteAutocompleteFilter.eq("CustomerId",e.Id)}function h(t){f.SiteInfo=t,t.SiteCode&&""!=t.SiteCode?f.filtermodel.SiteName=t.SiteCode+" - "+t.SiteName:f.filtermodel.SiteName=t.SiteName,f.filtermodel.SiteId=t.Id,(!f.filtermodel.CustomerId||0===f.filtermodel.CustomerId&&t.CustomerId)&&e.getItem("customers/",t.CustomerId).then(function(e){var t=e.data;t.CreditHold?bootbox.confirm("The customer "+t.CustomerName+" is on credit hold!",function(e){l(function(){e?(f.filtermodel.CustomerId=t.Id,f.siteAutocompleteFilter.reset(),f.siteAutocompleteFilter.eq("CustomerId",t.Id),t.CustomerCode&&""!=t.CustomerCode?f.filtermodel.CustomerName=t.CustomerCode+" - "+t.CustomerName:f.filtermodel.CustomerName=t.CustomerName,f.CustomerNameTemp=f.model.CustomerName):(f.filtermodel.SiteName=null,f.SiteNameTemp=null,f.filtermodel.SiteId=null),r.$apply()})}):(f.filtermodel.CustomerId=t.Id,t.CustomerCode&&""!=t.CustomerCode?f.filtermodel.CustomerName=t.CustomerCode+" - "+t.CustomerName:f.filtermodel.CustomerName=t.CustomerName,f.CustomerNameTemp=f.model.CustomerName,f.siteAutocompleteFilter.reset(),f.siteAutocompleteFilter.eq("CustomerId",t.Id))})}function T(e){t.path("newWorkOrders").search({isServiceRequest:"true",serviceRequestId:e.Id})}r.$watch("vm.filtermodel.SiteId",function(){f.filtermodel.SiteId&&(f.filterBySite.reset(),f.filterBySite.eq("SiteId",f.filtermodel.SiteId))}),f.loadingIndicator=!1,r.$on("CustomerNameSearching",function(e,t){f.filtermodel.CustomerId=null,f.filtermodel.SiteId=null,f.filtermodel.SiteName=null,f.SiteNameTemp=null,f.siteAutocompleteFilter.reset()}),r.$on("SiteNameSearching",function(e,t){f.filtermodel.SiteId=null}),f.focusOut=function(e){e&&e.hasOwnProperty("FocusOut")&&e.FocusOut&&("CustomerName"===e.ModelValue&&(f.CustomerNameTemp=angular.copy(f.filtermodel.CustomerName),null==f.filtermodel.CustomerId&&(f.filtermodel.CustomerName=null)),"SiteName"===e.ModelValue&&(f.SiteNameTemp=angular.copy(f.filtermodel.SiteName),null==f.filtermodel.SiteId&&(f.filtermodel.SiteName=null)))}}angular.module("FieldConnectApp").controller("ProcessServiceRequestController",e),e.$inject=["restService","$location","$scope","$timeout","$state","$stateParams","qsService","timezoneService","cryptoStorageService","$templateCache","Notification","ModalService","currentUserService","dateService"]}();;!function(){"use strict";function e(e,t,l,a,i,r,o,s,d,u,c,m,n,S){var f=this;f.goHome=function(){l.go("home")},f.search=I,f.edit=function(e,t){null!=t&&"Pending"!=t.WorkOrder||"Cancelled"==t.Status?l.go("serviceRequestCustomerReadOnly",{id:e}):l.go("customerServiceRequestEdit",{id:e})},f.model={},f.secondedit=function(e,t){null!=t&&"Pending"!=t.WorkOrder&&"Cancelled"!=t.WorkOrder&&l.go("serviceRequestWODetails",{id:t.WoId})},f.deviceDetect=S,f.cancelServiceRequest=v,f.loadData=!0,f.resetStatusFilter=function(){f.filtermodel.Name=null},f.filters=o.filter("and"),f.sitefilters=o.filter("and"),f.FilterStatus=o.filter("and"),f.FilterStatus.eq("Type","ServiceRequestStatus").neq("StatusName","WOCreated"),f.filtermodel={RequestDateFrom:null,RequestDateTo:null,AltId:null,SiteId:null,ServiceableItemId:null,WoTypeName:null,Name:null,isSRchecked:null},f.statusList=[],f.filterStatuses=o.filter("and"),f.filterStatuses.eq("Type","ServiceRequestStatus").eq("StatusName","Cancelled"),f.viewName="CustomerUserServiceStatus",f.moduleName="ServiceRequestGrid";m.getValue("authorizationData",!0);var q={Name:"Action",CellFormat:"template",CustomHeaderClass:"form-action",CustomCellClass:"form-action-cell",CellFormatData:{TemplateUrl:"cancelprocessView.html",onCancel:v}};f.attributesFilter=[{Type:"text",Label:"Work Order:",ModelValue:"AltId"},{Type:"dropdown",Label:"Site:",Required:!1,ApiMethod:"sites",ValueProp:"Id",TextProp:"SiteName",ModelValue:"SiteId",TabIndex:3},{Type:"dropdown",Label:"Serviceable Item:",Required:!1,ApiMethod:"serviceableitems",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",Filter:f.sitefilters,TabIndex:4},{Type:"dropdown",Label:"Work Order Type:",Required:!1,ApiMethod:"wotypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"WoTypeName",TabIndex:5}],f.attributes=[{Name:"Request Date",ValueName:"RequestDate",Edit:!1,Sortable:!0,FormatDate:"date",ObjectName:"colRequestDate"},{Name:"Work Order",ValueName:"WorkOrder",Edit:!1,Sortable:!0,ObjectName:"colWorkOrder",SecondEdit:!0,BindedTo:"WoId",BindValue:0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0,ObjectName:"colSiteName"},{Name:"Requested by",ValueName:"RequestedBy",Edit:!1,Sortable:!0,ObjectName:"colRequestedBy"},{Name:"Need By Date",ValueName:"NeedByDate",Edit:!1,Sortable:!0,FormatDate:"date",ObjectName:"colNeedByDate"},{Name:"Work Order Type",ValueName:"WoType",Edit:!1,Sortable:!0,ObjectName:"colWoType"},{Name:"Description",ValueName:"Description",Edit:!1,ConditionalEdit:!0,BindedTo:"Id",BindValue:0,Sortable:!0,ObjectName:"colDescription"},{Name:"Serviceable Item",ValueName:"ServiceableItems",Edit:!1,Sortable:!0,ObjectName:"colServiceableItems"},{Name:"Status",ValueName:"StatusName",Edit:!1,Sortable:!0,ObjectName:"colStatus"},q];var R=['<button class="btn btn-default" ng-click="attr.CellFormatData.onCancel(item)" ng-if="item.StatusName == \'Requested\'">Cancel Request</button>'].join("");function v(t){bootbox.confirm({message:t.Description.length>20?"Are you sure you want to Cancel the Service Request: '"+t.Description.substring(0,20)+"...' ?":"Are you sure you want to Cancel the Service Request: '"+t.Description+"' ?",buttons:{confirm:{label:"Yes",className:"btn-primary"},cancel:{label:"No",className:"btn-default"}},callback:function(l){l&&u.getItem("servicerequests",t.Id).then(function(e){for(var t=e.data,l=0;l<f.statusList.length;l++)if("Cancelled"==f.statusList[l].StatusName){t.ServiceRequestStatusId=f.statusList[l].Id;break}f.loadData=!1,u.update("servicerequests/"+t.Id,t).then(function(e){f.loadData=!0,c.success({message:"Service Request has been successfully updated."})})}),r(function(){e.$apply()})}})}function I(){for(;f.filters.filter.length>0;)f.filters.filter.splice(0,1);if(""!=f.filtermodel.RequestDateFrom&&null!=f.filtermodel.RequestDateFrom){f.filtermodel.RequestDateFrom=new Date(f.filtermodel.RequestDateFrom),f.filtermodel.RequestDateFrom.setHours(0,0,0,0);var e=new Date(f.filtermodel.RequestDateFrom);d.convertToUtc(e);var t=d.buildISOString(e)}if(""!=f.filtermodel.RequestDateTo&&null!=f.filtermodel.RequestDateTo){f.filtermodel.RequestDateTo=new Date(f.filtermodel.RequestDateTo),f.filtermodel.RequestDateTo.setHours(23,59,59,999);var l=new Date(f.filtermodel.RequestDateTo);d.convertToUtc(l);var a=d.buildISOString(l)}f.filtermodel.isSRchecked=!0;var i=angular.element(document.querySelector("#srStatusFilter"));i&&(f.filtermodel.isSRchecked=i[0].checked),f.filters.eq("StatusName",f.filtermodel.Name).eq("WorkOrder",f.filtermodel.AltId?f.filtermodel.AltId:null).eq("SiteId",f.filtermodel.SiteId).eq("ServiceableItemId",f.filtermodel.ServiceableItemId).eq("RequestDateFrom",t).eq("RequestDateTo",a).eq("WoType",f.filtermodel.WoTypeName).eq("OnlySR",f.filtermodel.isSRchecked),f.loadData=!0;var r={};f.filtermodel.RequestDateFrom&&(r.RequestDateFrom=d.buildISOString(f.filtermodel.RequestDateFrom)),f.filtermodel.RequestDateTo&&(r.RequestDateTo=d.buildISOString(f.filtermodel.RequestDateTo)),f.filtermodel.WoTypeName&&(r.WoTypeName=f.filtermodel.WoTypeName),f.filtermodel.SiteId&&(r.SiteId=f.filtermodel.SiteId),f.filtermodel.ServiceableItemId&&(r.ServiceableItemId=f.filtermodel.ServiceableItemId),f.filtermodel.Name&&(r.Name=f.filtermodel.Name),f.filtermodel.AltId&&(r.AltId=f.filtermodel.AltId),f.filtermodel.isSRchecked?r.isSRchecked=f.filtermodel.isSRchecked:r.isSRchecked=!1;var o={};m.getValue("lastselection_"+f.UserData.Id)&&(o=m.getValue("lastselection_"+f.UserData.Id)),o.serviceRequest=r,m.setValue("lastselection_"+f.UserData.Id,o)}s.put("cancelprocessView.html",R),u.getItems("statuses",f.filterStatuses).then(function(e){f.statusList=e.data.Data}),e.$watch("vm.filtermodel.SiteId",function(){f.sitefilters.reset(),f.filtermodel.SiteId&&f.sitefilters.eq("SiteId",f.filtermodel.SiteId)}),f.loadData=!1,n.getCurrentUserData().then(function(t){f.UserData=t;var l=m.getValue("lastselection_"+f.UserData.Id);l&&l.serviceRequest?r(function(){l.serviceRequest.RequestDateFrom&&(f.filtermodel.RequestDateFrom=d.parseISOString(l.serviceRequest.RequestDateFrom)),l.serviceRequest.RequestDateTo&&(f.filtermodel.RequestDateTo=d.parseISOString(l.serviceRequest.RequestDateTo)),l.serviceRequest.WoTypeName&&r(function(){f.filtermodel.WoTypeName=l.serviceRequest.WoTypeName}),l.serviceRequest.SiteId&&r(function(){f.filtermodel.SiteId=l.serviceRequest.SiteId}),l.serviceRequest.ServiceableItemId&&r(function(){f.filtermodel.ServiceableItemId=l.serviceRequest.ServiceableItemId}),l.serviceRequest.AltId&&r(function(){f.filtermodel.AltId=l.serviceRequest.AltId}),l.serviceRequest.isSRchecked?(f.filtermodel.isSRchecked=l.serviceRequest.isSRchecked,$('input:radio[id="srStatusFilter"]').filter('[value="sr"]').click()):(f.filtermodel.isSRchecked=!1,$('input:radio[id="woStatusFilter"]').filter('[value="wo"]').click()),l.serviceRequest.Name&&r(function(){f.filtermodel.Name=l.serviceRequest.Name}),r(function(){e.$apply(),I()})}):(f.filtermodel.RequestDateFrom=new Date(Date.now()+-2592e6),f.filtermodel.RequestDateTo=new Date,I())})}angular.module("FieldConnectApp").controller("ServiceRequestController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","$timeout","qsService","$templateCache","timezoneService","restService","Notification","cryptoStorageService","currentUserService","deviceDetector"]}();;!function(){"use strict";function e(e,t,i,o,a,s,n,u,c){var d=this;d.$scope=e,d.attributes=e.attributes,d.id=e.id,d.apiMethod=e.apiMethod,d.timezone=e.timezone,d.customFocus=e.customFocus,d.viewName=e.viewName,d.moduleName=e.moduleName,d.filter=e.filter,d.modalClass=!1,d.model=e.model,d.isLoading=!0,d.ServiceRequestStatusFilter=c.filter("and").eq("Type","ServiceRequestStatus");var r=s.getValue("authorizationData");function m(t){e.onBack&&!e.onBack(t)||(d.modalClass=!1,e.close(t,200))}r&&r.tzDatebaseName&&(d.tzName=r.tzDatebaseName,d.userTimeZone=moment.tz(d.tzName).zoneAbbr()),t(function(){d.modalClass=!0}),d.hideSubmit=!1,e.hideSubmit&&(d.hideSubmit=e.hideSubmit),d.onBack=m,d.onSubmit=function(){if(d.isLoading)return void u.warning("Copy is in progress, please wait....");d.isLoading=!0;var e=angular.copy(d.model),t=new Date(e.NeedByDate),i=moment.tz.zone(r.tzDatebaseName).offset(t),s=d.statusCodes.findIndex(e=>"Requested"==e.StatusName);e.StatusName=d.statusCodes[s].StatusName,e.ServiceRequestStatusId=d.statusCodes[s].Id,n.convertToUtc(t,i),e.NeedByDate=n.buildISOString(t),a.getLocation("ServiceRequestCopy").then(function(t){e.Longitude=t.coords.longitude,e.Latitude=t.coords.latitude,o.create("servicerequests",e).then(function(e){d.isLoading=!1,u.success("The Service Request has been copied!"),m(e.data)},function(e){d.isLoading=!1})})},o.getItems("statuses",d.ServiceRequestStatusFilter).then(function(){d.statusCodes=o.state.items}),e.$watch("vm.model.Id",function(e,i){e&&t(function(){d.model.NeedByDate=new Date,d.isLoading=!1})})}angular.module("FieldConnectApp").controller("ServiceRequestCopyController",e),e.$inject=["$scope","$timeout","currentCompanyService","restService","fcGeoLocationService","cryptoStorageService","timezoneService","Notification","qsService"]}();;!function(){"use strict";function e(e,t,a,i,r,o,s,l,n,m,c,d,u,h,p,y){var S=this;S.id=i.id,S.$state=a,S.goHome=function(){a.go("home")},S.goBack=C,S.submit=function(){S.submittingNewServiceRequest=!0,S.disableSubmit=!0;var e=angular.copy(S.model),t=new Date(e.NeedByDate);if(!S.id&&e.AttachmentTypeId){var a=$(".upload-file"),i=a.data("max-size");if(a[0]&&a[0].files.length){var r=a[0].files[0].size;if(r>i)return d.warning({message:"File size is larger than "+i/1048576+" MB"}),S.submittingNewServiceRequest=!1,!1}}u.convertToUtc(t),e.NeedByDate=u.buildISOString(t),S.id?m.update("servicerequests/"+S.id,e).then(function(){d.success({message:"Service Request has been successfully updated."}),o(function(){C()},0)}):(delete e.AttachmentTypeId,delete e.AttachmentDesc,delete e.AttachmentName,delete e.unknown,m.create("servicerequests",e).then(function(e){if(d.success({message:"Service Request has been successfully created."}),S.model.AttachmentTypeId){d.warning({message:"Uploading attachment, please wait..."});var t=(i=S.model,r=e,(o={}).AttachmentName=i.AttachmentName,o.Desc=i.AttachmentDesc,o.AttachmentTypeId=i.AttachmentTypeId,o.ServiceRequestId=r.data.Id,o);m.create("serviceRequestAttachments",t).then(function(e){var t=new FormData,i=e.data.Id;t.append("file",a[0].files[0]),m.uploadFile("serviceRequestAttachments/file/"+e.data.Id,t).then(function(e){200==e.status?d.success({message:"Attachment has been uploaded."}):d.error({message:"There was an Error uploading the attachment!"})}).then(function(){g()},function(e){var t=e.data.Details[0].DeveloperMessage,a=t.search("already exists");-1!==a?(d.error("The file already exists!  Open the Service Request to re-attach the file."),m.remove("serviceRequestAttachments",i).then(function(e){g()})):g()})},function(){S.submittingNewServiceRequest=!1})}else g();var i,r,o}))},S.selectSite=q,S.loaddefaulData=A,S.selectCustomer=T,S.isCustomerSite=!1,void 0!=h.getTransitionParam("customerSite")&&(S.isCustomerSite=!0,h.popTransitionParam("customerSite")),S.model={},S.customer={customerId:0},S.customers=[],S.site={siteId:0},S.filterBySite=s.filter("and"),S.serviceRequestFilter=s.filter("and"),S.disableSubmit=!1,S.submittingNewServiceRequest=!1,S.reloadTable=!0,parseInt(S.id)?S.fromHome=!1:S.fromHome=!0,S.customerRoles=!1;for(var v=l.getValue("authorizationData").userRoles.split(","),R=0;R<v.length;R++)"CustAdmin"!=v[R]&&"Cust"!=v[R]||(S.customerRoles=!0);if(!S.id&&S.customerRoles){S.filterBySite.eq("SiteId",0);var f=n.getCurrentUserData().then(function(e){S.currentUser=e}),b=m.getItems("customers").then(function(e){S.customer=e.data.Data});c.all([b,f]).then(function(e){o(function(){A()})})}var I={Type:"dropdown",Label:"Serviceable Item:",ApiMethod:"serviceableItems",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",Filter:S.filterBySite,Required:!1,TabIndex:5,ReadOnly:!0};if(S.attachmentName={Type:"text",Label:"Name:",Required:!1,MaxLength:"50",ModelValue:"AttachmentName",ReadOnly:!0},S.attachmentDescription={Type:"text",Label:"Description:",Required:!1,MaxLength:"200",ModelValue:"AttachmentDesc",ReadOnly:!0},S.attachmentFile={Type:"file",Label:"File:",ApiMethod:"serviceRequestAttachments/file",Required:!1,ReadOnly:!0},S.attachmentAttributes=[{Type:"line",CustomClass:"col-sm-12"},{Type:"subheader",Label:"Attachment"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"dropdown",Label:"Type:",Required:!1,ApiMethod:"attachmentTypes",ValueProp:"Id",TextProp:"AttachmentTypeName",ModelValue:"AttachmentTypeId",Filter:s.filter("and").eq("attachmentCategory","ServiceRequest")},S.attachmentName,S.attachmentDescription,S.attachmentFile],S.attPriority={Type:"dropdown",Label:"Priority:",Required:!1,ApiMethod:"priorities",ValueProp:"Id",TextProp:"PriorityName",ModelValue:"PriorityId",ConvertToInt:"True"},S.attributes=[{Type:"textbutton",Label:"Customer:",Required:!0,MaxLength:"50",ModelValue:"CustomerName",HideBtn:!S.customerRoles,ReadOnly:!0,onClick:T,TabIndex:1},{Type:"dropdown",Label:"Status:",ApiMethod:"statuses/getstatusforservicerequest",ReadOnly:!0,ValueProp:"Id",TextProp:"Name",ModelValue:"ServiceRequestStatusId",TabIndex:6,Name:"statusDdl"},{Type:"textbutton",Label:"Site:",Required:!0,MaxLength:"50",ModelValue:"SiteName",ReadOnly:!0,HideBtn:!0,onClick:q,TabIndex:2},{Type:"datepicker",Label:"Need By Date:",Required:!0,ModelValue:"NeedByDate",Format:"MM/dd/yyyy",TabIndex:7},{Type:"dropdown",Label:"Problem Code:",ApiMethod:"problemcodes",ValueProp:"Id",TextProp:"ProblemCodeName",ModelValue:"ProblemCodeId",Required:!0,TabIndex:3},S.attPriority,{Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc",Autofocus:"true",Required:!0,TabIndex:4},{Type:"text",Label:"Name:",MaxLength:"50",ModelValue:"Name",Required:!0,TabIndex:8},I,{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"Phone",Required:!0,TabIndex:9}],S.attachmentGridAttributes=[{Name:"Date",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Type",ValueName:"AttachmentTypeName",Edit:!1,Sortable:!0},{Name:"Attached To",ValueName:"AttachedTo",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0}],S.attachmentEditAttributes=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"Id",TextProp:"AttachmentTypeName",ModelValue:"AttachmentTypeId",Filter:s.filter("and").eq("attachmentCategory","ServiceRequest")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description:",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"serviceRequestAttachments/file",Required:!0}],e.$watch("vm.model.AttachmentTypeId",function(e,t){e?(S.attachmentName.Required=!0,S.attachmentName.ReadOnly=!1,S.attachmentDescription.Required=!0,S.attachmentDescription.ReadOnly=!1,S.attachmentFile.Required=!0,S.attachmentFile.ReadOnly=!1):(S.attachmentName.Required=!1,S.attachmentName.ReadOnly=!0,S.attachmentDescription.Required=!1,S.attachmentDescription.ReadOnly=!0,S.attachmentFile.Required=!1,S.attachmentFile.ReadOnly=!0,o(function(){S.model.AttachmentName="",S.model.AttachmentDesc=""}))}),e.$watch("vm.customer.customerId",function(){null!=S.customer.customerId&&S.customer.customerId>0&&S.model.CustomerId!=S.customer.customerId&&(S.model.CustomerId=S.customer.customerId,S.customer.customerCode&&""!=S.customer.customerCode?S.model.CustomerName=S.customer.customerCode+" - "+S.customer.customerName:S.model.CustomerName=S.customer.customerName,S.model.SiteId=0,S.model.SiteName="")}),e.$watch("vm.site.siteId",function(){I.ReadOnly=!0,null!=S.site.siteId&&S.site.siteId>0&&(S.model.SiteId=S.site.siteId,S.filterBySite.reset(),S.filterBySite.eq("SiteId",S.model.SiteId),I.ReadOnly=!1,S.site.siteCode&&""!=S.site.siteCode?S.model.SiteName=S.site.siteCode+" - "+S.site.siteName:S.model.SiteName=S.site.siteName)}),S.id){S.serviceRequestFilter.reset(),S.serviceRequestFilter.eq("ServiceRequestId",S.id);var N=e.$watch("vm.model.SiteId",function(){S.model.SiteId&&(S.filterBySite.reset(),S.filterBySite.eq("SiteId",S.model.SiteId),N())})}else{S.attributes=S.attributes.concat(S.attachmentAttributes);for(R=0;R<S.attributes.length;R++)if(S.attributes[R].Name&&"statusDdl"===S.attributes[R].Name){S.attributes[R].Type="hidden";break}}function T(){r.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectCustomer.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:S.customer}})}function q(e){"link"==e?0==S.model.SiteId?d.warning({message:"First you must select site"}):a.go("siteReadOnly",{id:S.model.SiteId}):S.customerRoles?S.customerRoles&&r.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectSite.html",controller:"SelectSiteDetailsController",controllerAs:"vm",inputs:{site:S.site,customerId:S.model.CustomerId}}):r.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectSite.html",controller:"SelectSiteDetailsController",controllerAs:"vm",inputs:{site:S.site,customerId:S.customer.customerId}})}function A(){var t=e.$watch("vm.model.CustomerName",function(){S.customer[0]&&null==S.model.CustomerName&&(S.model.CustomerName=S.customer[0].CustomerName,S.model.CustomerId=S.customer[0].Id,p.getDefaultSite(S.customer[0].Id).then(function(e){null!==e&&(S.site.siteCode=e.SiteCode,S.site.siteName=e.SiteName,S.site.siteId=e.Id)}),t())}),a=e.$watch("vm.model.Name",function(){S.currentUser&&null==S.model.Name&&(S.model.Name=S.currentUser.FullName,a())}),i=e.$watch("vm.model.Phone",function(){S.currentUser&&null==S.model.Phone&&(S.model.Phone=S.currentUser.Phone,i())})}function g(){S.submittingNewServiceRequest=!1,o(function(){S.customerRoles?S.$state.go("serviceRequest"):S.$state.go("processServiceRequest")},0)}function C(){S.submittingNewServiceRequest=!1,S.disableSubmit=!1,S.customerRoles?window.history.back():S.$state.go("processServiceRequest")}function M(){S.reloadTable=!1,o(function(){S.reloadTable=!0})}S.loadingIndicator=!1,S.copyServiceRequest=function(){y.copyServiceRequest(S.model).then(function(e){e.Id&&(h.popTransitionParam("serviceRequestEdit"),a.go("serviceRequestEdit",{id:e.Id}))})},S.initialiseGrid=function(e){switch(e){case"serviceRequestAttachmentGrid":S.serviceRequestAttachmentGrid=!0;break;default:S.serviceRequestAttachmentGrid=!0}},S.editAttachment=function(e){var t={ServiceRequestId:parseInt(S.id)};r.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Service Request Attachment edit",id:e,model:t,attributes:S.attachmentEditAttributes,apiMethod:"serviceRequestAttachments",moduleName:S.moduleName,viewName:S.viewName}}).then(function(e){e.close.then(function(){M()})})},S.reloadTable=M}angular.module("FieldConnectApp").controller("ServiceRequestEditController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","$timeout","qsService","cryptoStorageService","currentUserService","restService","$q","Notification","timezoneService","stateTransitionService","customerService","copyServiceRequestService"]}();;!function(){"use strict";function e(e,t,o,a,r,i,s,d,l,m){var u=this;u.model={};var c=d.getValue("authorizationData").userRoles.split(",");u.$state=o,u.goHome=function(){o.go("home")},u.goBack=function(){window.history.back()},u.cancelBtnText="Back",u.customer={customerId:0},u.customers=[],u.site={siteId:0},u.filterBySite=s.filter("and"),u.serviceRequestFilter=s.filter("and"),u.serviceRequestFilter.eq("ServiceRequestId",a.id),u.reloadTable=!0;var n=o.current.name;u.isServicRequest="serviceRequestCustomerReadOnly"==n,u.isCustomerSite=!1,void 0!=l.getTransitionParam("customerSite")&&(u.isCustomerSite=!0,l.popTransitionParam("customerSite")),u.customerRoles=!1;for(var y=0;y<c.length;y++)"CustAdmin"!=c[y]&&"Cust"!=c[y]||(u.customerRoles=!0);u.attPriority={Type:"dropdown",Label:"Priority:",Required:!1,ApiMethod:"priorities",ValueProp:"Id",TextProp:"PriorityName",ModelValue:"PriorityId",ConvertToInt:"True",ReadOnly:!0},u.attributes=[{Type:"text",Label:"Customer:",Required:!0,MaxLength:"50",ModelValue:"CustomerName",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Site:",Required:!0,MaxLength:"50",ModelValue:"SiteName",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"dropdown",Label:"Problem Code:",ApiMethod:"problemcodes",ValueProp:"Id",TextProp:"ProblemCodeName",ModelValue:"ProblemCodeId",Required:!0,TabIndex:1,ReadOnly:!0},u.attPriority,{Type:"textarea",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Desc",TabIndex:3,ReadOnly:!0},{Type:"dropdown",Label:"ServiceableItem:",ApiMethod:"serviceableItems",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",Filter:u.filterBySite,Required:!1,TabIndex:2,ReadOnly:!0},{Type:"line",CustomClass:"col-sm-12"},{Type:"datepicker",Label:"Need By Date:",Required:!0,ModelValue:"NeedByDate",Format:"MM/dd/yyyy",TabIndex:4,ReadOnly:!0},{Type:"text",Label:"Name:",MaxLength:"50",ModelValue:"Name",TabIndex:5,ReadOnly:!0},{Type:"text",Label:"Phone:",MaxLength:"50",ModelValue:"Phone",TabIndex:6,ReadOnly:!0},{Type:"int",ModelValue:"WorkOrderId",ReadOnly:!0,CustomDivClass:"hidden"}],u.attachmentGridAttributes=[{Name:"Date",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Type",ValueName:"AttachmentTypeName",Edit:!1,Sortable:!0},{Name:"Attached To",ValueName:"AttachedTo",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0}],u.id=a.id,u.loadingIndicator=!1,e.$watch("vm.customer.customerId",function(){null!=u.customer.customerId&&u.customer.customerId>0&&u.model.CustomerId!=u.customer.customerId&&(u.model.CustomerId=u.customer.customerId,u.customer.customerCode&&""!=u.customer.customerCode?u.model.CustomerName=u.customer.customerCode+" - "+u.customer.customerName:u.model.CustomerName=u.customer.customerName,u.model.SiteId=0,u.model.SiteName="")}),e.$watch("vm.model.WorkOrderId",function(){u.model.WorkOrderId&&(u.filterByWo=s.filter("and"),u.filterByWo.eq("WoId",u.model.WorkOrderId))}),e.$watch("vm.site.siteId",function(){null!=u.site.siteId&&u.site.siteId>0&&(u.model.SiteId=u.site.siteId,u.filterBySite.eq("SiteId",u.model.SiteId),u.site.siteCode&&""!=u.site.siteCode?u.model.SiteName=u.site.siteCode+" - "+u.site.siteName:u.model.SiteName=u.site.siteName)}),u.copyServiceRequest=function(){m.copyServiceRequest(u.model).then(function(e){e.Id&&(l.popTransitionParam("serviceRequestEdit"),o.go("serviceRequestEdit",{id:e.Id}))})},u.initialiseGrid=function(e){switch(e){case"serviceRequestAttachmentGrid":u.serviceRequestAttachmentGrid=!0;break;default:u.serviceRequestAttachmentGrid=!0}}}angular.module("FieldConnectApp").controller("ServiceRequestReadOnlyController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","$timeout","qsService","cryptoStorageService","stateTransitionService","copyServiceRequestService"]}();;!function(){"use strict";function e(e,t,a,r,o,s,i,m,n,l,d){var u=this;function D(){if(void 0!==u.promisedDateStart&&null!==u.promisedDateStart){if(u.promisedDateStart=new Date(u.promisedDateStart),!d.validateDate(u.promisedDateStart))return}else u.promisedDateStart=null;if(void 0!==u.promisedDateEnd&&null!==u.promisedDateEnd){if(u.promisedDateEnd=new Date(u.promisedDateEnd),!d.validateDate(u.promisedDateEnd))return}else u.promisedDateEnd=null;if(void 0===u.promisedDateStart||void 0===u.promisedDateEnd||d.validateDateRange(u.promisedDateStart,u.promisedDateEnd)){!function(){if(""!=u.promisedDateStart&&null!=u.promisedDateStart){var e=new Date(u.promisedDateStart);e.setHours(0,0,0,0);var t=new Date(e);m.convertToUtc(t),u.args.promisedDateStart=m.buildISOString(t)}else u.args.promisedDateStart=null;if(""!=u.promisedDateEnd&&null!=u.promisedDateEnd){var a=new Date(u.promisedDateEnd);a.setHours(23,59,59,999);var r=new Date(a);m.convertToUtc(r),u.args.promisedDateEnd=m.buildISOString(r)}else u.args.promisedDateEnd=null}(),u.isLoading=!0;var t={};(t=i.filter("and")).page=u.args.page,t.pageSize=u.args.pageSize,t.sortCol=u.args.sortCol,t.sortDir=u.args.sortDir,""!=u.args.status&&t.eq("BiddingStatus",u.args.status),null!=u.args.promisedDateStart&&t.ge("WoPromiseDate",u.args.promisedDateStart),null!=u.args.promisedDateEnd&&t.le("WoPromiseDate",u.args.promisedDateEnd),u.woId&&t.eq("WoId",u.woId),o.getItems("subcontractorAwardWork",t).then(function(){u.items=o.state.items,u.itemsMeta=o.state.itemsMeta;for(var e=0;e<u.items.length;e++)if(null==u.items[e].PromiseDate)u.items[e].PromiseDate="";else{var t=l.getValue("authorizationData");t&&t.tzDatebaseName&&(u.userTimeZoneAbbr=moment.tz(t.tzDatebaseName).zoneAbbr());var a=m.parseISOString(u.items[e].PromiseDate),r=moment.tz.zone(t.tzDatebaseName).offset(a),s=m.convertToLocal(a,r);if(u.items[e].PromiseDate=moment(s).format("M/DD/YYYY h:mm A")+" "+u.userTimeZoneAbbr,null==u.items[e].SubPromiseDate)u.items[e].SubPromiseDate="";else{a=m.parseISOString(u.items[e].SubPromiseDate),r=moment.tz.zone(t.tzDatebaseName).offset(a),s=m.convertToLocal(a,r);u.items[e].SubPromiseDate=moment(s).format("M/DD/YYYY h:mm A")+" "+u.userTimeZoneAbbr}}}),u.woId="",setTimeout(function(){u.isLoading=!1,e.$apply()},1e3)}}u.$state=a,u.items=[],u.itemsMeta={},u.isLoading=!1,u.get=D,u.award=function(e){o.update("subcontractorAwardWork/Award",e).then(function(e){200===e.status&&(s.success({message:"Subcontractor Awarded."}),D())})},u.reject=function(e){o.update("subcontractorAwardWork/Reject",e).then(function(e){200===e.status&&(s.success({message:"Subcontractor Rejected."}),D())})},u.openWo=function(e){u.$state.go("workOrdersDetailsReadOnly",{id:e.WoId})},u.woId=r.woId,u.statusTemp=r.status,u.toggleSort=function(e,t){if(!t)return;u.args.sortCol!=e?(u.args.sortCol=e,u.args.sortDir="asc"):"asc"==u.args.sortDir?u.args.sortDir="desc":u.args.sortDir="asc";D()},u.deviceDetect=n,u.dateService=d,u.args={page:1,pageSize:10,sortCol:"",sortDir:"asc",status:"",promisedDateStart:null,promisedDateEnd:null},u.woId?u.args.status=u.statusTemp:(u.promisedDateStart=new Date,u.promisedDateEnd=new Date),u.attributes=[{Name:"Work Order",CellFormat:"button",Text:"",Action:u.openWo,ValueName:"WoAltId"},{Name:"Promise Date",ValueName:"PromiseDate",CellFormat:"label",Sortable:!0,FormatDate:!0},{Name:"Status",ValueName:"BiddingStatus",CellFormat:"label",Sortable:!0},{Name:"Customer",ValueName:"CustomerName",CellFormat:"label",Sortable:!0},{Name:"Site",ValueName:"SiteName",CellFormat:"label",Sortable:!0},{Name:"Description",ValueName:"WoDescription",CellFormat:"label",Sortable:!0},{Name:"WO Type",ValueName:"WoType",CellFormat:"label",Sortable:!0},{Name:"Not To Exceed Amount",ValueName:"WoOrBidNotToExceedAmount",CellFormat:"label",Sortable:!0},{Name:"Subcontractor",ValueName:"SubCompanyName",CellFormat:"label",Sortable:!0},{Name:"Bid Amount",ValueName:"BidAmount",CellFormat:"label",Sortable:!0},{Name:"Sub Promise Date",ValueName:"SubPromiseDate",CellFormat:"label",FormatDate:"date",Sortable:!0},{CellFormat:"button",Text:"Award",Action:u.award},{CellFormat:"button",Text:"Reject",Action:u.reject}],e.$watch("vm.args.page",function(){D()}),u.firstWatchFix=!0,e.$watch("vm.args.pageSize",function(){u.firstWatchFix?u.firstWatchFix=!1:(1==u.args.page&&D(),u.args.page=1)})}angular.module("FieldConnectApp").controller("AwardSubcontractorController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","Notification","qsService","timezoneService","deviceDetector","cryptoStorageService","dateService"]}();;!function(){"use strict";function e(e,t,a,o,d,l,s){var r=this;r.$state=a,r.selectSite=function(){d.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectSite.html",controller:"SelectSiteDetailsController",controllerAs:"vm",inputs:{site:r.site,customerId:r.customer.customerId}})},r.woNumber="",r.altId=0,r.model={},r.filter={filterId:o.id},r.filter1={siteId:null},r.customer={customerId:0},r.customers=[],r.site={siteId:0},r.id=o.id,r.companyWoStatus={},r.companyAssignmentStatus={},r.attributes=[{Type:"text",Label:"Customer:",Required:!0,MaxLength:"50",ModelValue:"CustomerName",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Site:",Required:!0,MaxLength:"50",ModelValue:"SiteName",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"textarea",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Desc",Autofocus:"true",ReadOnly:!0},{Type:"dropdown",Label:"Subcontractor:",ApiMethod:"subcontractorCompanies",ValueProp:"SubcontractorId",TextProp:"CompanyName",ModelValue:"SubContractorId",ConvertToInt:"true",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Address",Required:!1,MaxLength:"100",ModelValue:"Address1",ReadOnly:!0},{Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"wostatuses",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"Status",ReadOnly:!0},{Type:"text",Label:"Site Contact",Required:!1,MaxLength:"100",ModelValue:"ContactName",ReadOnly:!0},{Type:"dropdown",Label:"Work Order Type:",Required:!1,ApiMethod:"wotypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"WoType",ReadOnly:!0},{Type:"text",Label:"Phone:",MaxLength:"50",ModelValue:"ContactPhone",ReadOnly:!0},{Type:"dropdown",Label:"Priority:",Required:!1,ApiMethod:"priorities",ValueProp:"PriorityName",TextProp:"PriorityName",ModelValue:"Priority",ReadOnly:!0},{Type:"dropdown",Label:"Office:",Required:!0,ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true",ReadOnly:!0},{Type:"dropdown",Label:"Agreement:",Required:!1,ApiMethod:"agreements",ValueProp:"Id",TextProp:"Desc",ModelValue:"AgreementId",ConvertToInt:"true",ReadOnly:!0},{Type:"dropdown",Label:"Payment Term:",Required:!1,ApiMethod:"paymentTerms",ValueProp:"Id",TextProp:"PaymentTermName",ModelValue:"PaymentTermId",ConvertToInt:"true",ReadOnly:!0},{Type:"datepicker",Label:"Request Date:",ModelValue:"RequestDate",Format:"MM/dd/yyyy",SubType:"date",ReadOnly:!0},{Type:"dropdown",Label:"Currency Code:",ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode",ReadOnly:!0},{Type:"datepicker",Label:"Entered Date:",ModelValue:"EnteredDate",Format:"MM/dd/yyyy",SubType:"date",ReadOnly:!0},{Type:"datepicker",Label:"Promised:",ModelValue:"PromiseDate",Required:!0,Format:"MM/dd/yyyy",ReadOnly:!0},{Type:"datepicker",Label:"Entered Time:",ModelValue:"EnteredDate",Format:"hh:mm:ss a",SubType:"time",ReadOnly:!0},{Type:"int",Label:"Quote Id:",ModelValue:"QuoteId",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6",ReadOnly:!0},{Type:"text",Label:"External Id:",Required:!1,MaxLength:"50",ModelValue:"ExternalId",ReadOnly:!0},{Type:"line",CustomClass:"col-sm-12"},{Type:"dropdown",Label:"Rate Sheet:",Required:!0,ApiMethod:"ratesheets",ValueProp:"Id",TextProp:"RateSheetName",ModelValue:"RateSheetId",ConvertToInt:"true",ReadOnly:!0},{Type:"dropdown",Label:"Tax Rate:",ApiMethod:"taxrates",ValueProp:"Id",TextProp:"TaxName",ModelValue:"TaxRateId",ConvertToInt:"true",ReadOnly:!0},{Type:"decimal",Label:"Tax Rate Labor %: ",ModelValue:"TaxRateLabor",ReadOnly:!0},{Type:"decimal",Label:"Tax Rate Part %: ",ModelValue:"TaxRatePart",ReadOnly:!0},{Type:"decimal",Label:"Tax Rate Misc %: ",ModelValue:"TaxRateMisc",ReadOnly:!0}],e.$watch("vm.model.TaxRateId",function(){l.getItem("taxrates",r.model.TaxRateId).then(function(){r.selectedTaxRate=l.state.item,r.model.TaxRateLabor=r.selectedTaxRate.TaxRateLabor,r.model.TaxRatePart=r.selectedTaxRate.TaxRatePart,r.model.TaxRateMisc=r.selectedTaxRate.TaxRateMisc})}),r.loadingIndicator=!1,e.$watch("vm.model.Id",function(){r.customer.customerId=r.model.CustomerId,r.site.siteId=r.model.SiteId,r.site.siteName=r.model.SiteName,r.site.title=r.model.ContactName,r.site.phone=r.model.ContactPhone,r.site.address=r.model.Address,r.altId=r.model.AltId,l.getItem("settings/status?type=WOStatus").then(function(){r.companyWoStatus=l.state.item}),l.getItem("settings/status?type=AssignmentStatus").then(function(){r.companyAssignmentStatus=l.state.item})}),e.$watch("vm.customer.customerId",function(){null!=r.customer.customerId&&r.customer.customerId>0&&r.model.CustomerId!=r.customer.customerId&&(r.model.CustomerId=r.customer.customerId,r.model.CustomerName=r.customer.customerName,r.model.SiteId=0,r.model.SiteName="",r.model.Address="",r.model.ContactName="",r.model.ContactPhone="")}),e.$watch("vm.site.siteId",function(){null!=r.site.siteId&&r.site.siteId>0&&(r.model.SiteId=r.site.siteId,r.model.SiteName=r.site.siteName,r.model.ContactName=r.site.title,r.model.ContactPhone=r.site.phone,r.model.Address1=r.site.address,r.filter1.siteId=r.site.siteId)})}angular.module("FieldConnectApp").controller("AwardWOController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","restService","stateTransitionService"]}();;!function(){"use strict";function e(e,a,t,o,n,l){var r=this;r.$state=a,r.model={},r.urlParams={CompanyId:parseInt(t.CompanyId),SubcontractorId:parseInt(t.SubcontractorId),IsActive:"True"==t.IsActive,Email:"",JoinEmail:t.InvitedEmail,isInvitation:"True"==t.isInvitation},r.attributes=[{Type:"text",Label:"Company Name:",MaxLength:"50",ModelValue:"CompanyName",Required:!0,ReadOnly:!0},{Type:"multiselect",Label:"Industry:",ApiMethod:"industries",ValueProp:"Id",TextProp:"IndustryName",ModelValue:"ListIndustryIds",ReadOnly:!0},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"Title:",MaxLength:"50",ModelValue:"Title",Required:!0,ReadOnly:!0},{Type:"text",Label:"Address:",MaxLength:"100",ModelValue:"Address1",Required:!0,ReadOnly:!0},{Type:"text",Label:"Contact First Name:",MaxLength:"50",ModelValue:"FirstName",Requried:!0,ReadOnly:!0},{Type:"text",Label:"",MaxLength:"100",ModelValue:"Address2",ReadOnly:!0},{Type:"text",Label:"Contact Last Name:",MaxLength:"50",ModelValue:"LastName",Requried:!0,ReadOnly:!0},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"City",Required:!0,ReadOnly:!0},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"Phone",Required:!0,ReadOnly:!0},{Type:"text",Label:"Postal Code",MaxLength:"20",ModelValue:"PostalCode",Required:!0,ReadOnly:!0},{Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"Fax",ReadOnly:!0},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country",Required:!0,ReadOnly:!0},{Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"Cell",ReadOnly:!0},{Type:"dropdown",Label:"State Code:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"StateCode",Required:!0,ReadOnly:!0},{Type:"text",Label:"Email:",MaxLength:"50",ModelValue:"Email",Required:!0,ReadOnly:!0},{Type:"text",Label:"Web site:",MaxLength:"50",ModelValue:"WebSite",Required:!0,ReadOnly:!0}],o.getItem("subcontractorCompanies/getCompanyStatus",r.urlParams.CompanyId).then(function(){r.subcontractorCompany=o.state.item,"null"!=r.subcontractorCompany&&o.getItem("companyinfos/getCurrentCompany").then(function(){r.currentCompany=o.state.item,r.urlParams.isInvitation?r.currentCompany.Id!=r.urlParams.SubcontractorId?(n.warning({message:"Sorry, your Company does not match the invited Subcontractor’s Company."}),r.$state.go("home")):r.urlParams.isInvitation&&(r.urlParams.Email=r.model.Email,r.urlParams.Id=r.urlParams.CompanyId,o.update("subcontractorList/invitePost",r.urlParams).then(function(){r.urlParams.IsActive?n.success({message:"Congratulations, you are now a SubContractor for "+r.model.CompanyName+". Contact information is as follows:"}):n.success({message:"Invitation from "+r.model.CompanyName+" has been declined."})})):r.urlParams.isInvitation||(r.urlParams.Email=r.urlParams.JoinEmail,r.urlParams.Id=r.urlParams.CompanyId,o.update("subcontractorList/joinLogin",r.urlParams).then(function(){n.success({message:"Congratulations, you are now a SubContractor for "+r.model.CompanyName+". Contact information is as follows:"})}))})}),r.loadingIndicator=!1}angular.module("FieldConnectApp").controller("CompanyInviteController",e),e.$inject=["$scope","$state","$stateParams","restService","Notification","$timeout"]}();;!function(){"use strict";function e(e,o,t,a){var i=this;function n(){return/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i.test(i.model.Email)?(i.emailInvalid=!1,!0):(i.emailInvalid=!0,!1)}function l(o){e.onBack&&!e.onBack(o)||(i.model.Email="",i.model.FirstName="",i.model.LastName="",i.model.SubcontractorName="",i.$scope.model=i.model,i.modalClass=!1,e.close(null,200))}i.model=e.model,i.$scope=e,i.submitJoin=function(){n()&&o.create("subcontractorList/joinPut",i.model).then(function(){l(),t.success({message:"Invitation message sent successfully."})})},i.emailValidated=n,i.attributes=e.attributes,i.id=e.id,i.apiMethod=e.apiMethod,i.timezone=e.timezone,i.emailInvalid=!1,i.modalClass=!1,a(function(){i.modalClass=!0}),i.onBack=l}angular.module("FieldConnectApp").controller("InviteNewController",e),e.$inject=["$scope","restService","Notification","$timeout"]}();;!function(){"use strict";function t(t,r,o,e,a,i,s,c,n,u,l,S){var b=this;b.isLoading=!1,b.goHome=function(){o.go("home")},b.search=function(){loadFilter()};var d=!1;function m(){b.isLoading=!0,d=!1;var r={};(r=l.filter("and")).eq("Search",b.filterSubcontractorList.search).eq("Status",b.filterSubcontractorList.status).eq("Industry",b.filterSubcontractorList.industry).eq("SubcontractorList",b.filterSubcontractorList.subcontractorList),r.page=b.filterSubcontractorList.page,r.pageSize=b.filterSubcontractorList.pageSize,r.total=b.filterSubcontractorList.total,r.sortCol=b.filterSubcontractorList.sortCol,r.sortDir=b.filterSubcontractorList.sortDir,a.getItems("subcontractorList",r).then(function(){b.SubcontractorList=a.state.items,b.SubcontractorListMeta=a.state.itemsMeta,1==b.SubcontractorListMeta.Paging.PageSize&&(b.SubcontractorListMeta.Paging.PageSize=10)}),setTimeout(function(){b.isLoading=!1,t.$apply()},1e3)}b.$state=o,b.isLoading=!1,b.model={},b.inviteNew=function(){b.model=b.emailattributes,c.showModal({templateUrl:"Templates/SubContractor/SubContractorList/inviteModal.html",controller:"InviteNewController",controllerAs:"vm",inputs:{modalTitle:"Please invite a new subcontractor to your network",model:b.model}}).then(function(t){t.close.then(function(){b.filter.Reload++,b.reloadTable=!1,u(function(){b.reloadTable=!0})})})},b.invite=function(t){for(var r,o=0;o<b.SubcontractorList.length;o++)b.SubcontractorList[o].Id==t&&(r=b.SubcontractorList[o]);a.create("subcontractorList/invitePut",r).then(function(t){200===t.status&&(n.success({message:"Invite successfully sent."}),i.scrollTo(0,0),m(),d=!0)})},b.id=e.id,b.filter={search:"",status:"",industry:""},b.getSubcontractorList=m,b.toggleSort=function(t,r){if(!r)return;b.filterSubcontractorList.sortCol!=t?(b.filterSubcontractorList.sortCol=t,b.filterSubcontractorList.sortDir="asc"):"asc"==b.filterSubcontractorList.sortDir?b.filterSubcontractorList.sortDir="desc":b.filterSubcontractorList.sortDir="asc";d&&m();d=!0},b.SubcontractorList=[],b.SubcontractorListMeta={},b.Subcontractors={selected:"Select"},b.filterSubcontractorList={page:1,pageSize:10,total:0,sortCol:"",sortDir:"asc",search:"",status:"",industry:"",subcontractorList:"allSubcontractors"},b.attributes=[{Name:"Subcontractor Name",ValueName:"SubcontractorName",Edit:!1,Sortable:!0},{Name:"Main Address",ValueName:"SubcontractorMainAddress",Edit:!1,Sortable:!0},{Name:"Contact",ValueName:"SubcontractorContact",FormatDate:"date",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"SubcontractorCompanyStatus",Edit:!1,Sortable:!0},{Name:"Industry",ValueName:"Industries",Edit:!1,Sortable:!0}],b.emailattributes={},b.emailattributes.Email="",b.emailattributes.FirstName="",b.emailattributes.LastName="",b.emailattributes.SubcontractorName="",b.loadingIndicator=!1,b.industries=[],a.getItems("industries").then(function(){b.isLoading=!0,b.industries=a.state.items,b.industries.sort(S.sortArray("IndustryName")),setTimeout(function(){b.isLoading=!1,t.$apply()},1e3)}),m(),t.$watch("vm.SubcontractorListMeta.Paging",function(){null!=b.SubcontractorListMeta.Paging&&(b.filterSubcontractorList.page=b.SubcontractorListMeta.Paging.Page,b.filterSubcontractorList.pageSize=b.SubcontractorListMeta.Paging.PageSize,d&&m(),d=!0)},!0)}angular.module("FieldConnectApp").controller("SubContractorListController",t),t.$inject=["$scope","$location","$state","$stateParams","restService","$window","$anchorScroll","ModalService","Notification","$timeout","qsService","sortArrayObjectsByAttrService"]}();;!function(){"use strict";function e(e,t,a,o,d,l,r,s){var n=this;n.$state=a,n.selectSite=function(){d.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectSite.html",controller:"SelectSiteDetailsController",controllerAs:"vm",inputs:{site:n.site,customerId:n.customer.customerId}})},n.woNumber="",n.altId=0,n.model={},n.filter={filterId:o.id},n.filterByWorkOrder=qsService.filter("and"),n.filterByWorkOrder.eq("WoId",n.filter.filterId),n.filterBySite=qsService.filter("and"),n.filter1={siteId:null},n.customer={customerId:0},n.customers=[],n.site={siteId:0},n.id=o.id,n.companyWoStatus={},n.companyAssignmentStatus={},s.clearCustomer(),n.attributes=[{Type:"text",Label:"Customer:",Required:!0,MaxLength:"50",ModelValue:"CustomerName",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Site:",Required:!0,MaxLength:"50",ModelValue:"SiteName",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"textarea",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Desc",Autofocus:"true",ReadOnly:!0},{Type:"dropdown",Label:"Subcontractor:",ApiMethod:"subcontractorCompanies",ValueProp:"SubcontractorId",TextProp:"CompanyName",ModelValue:"SubContractorId",ConvertToInt:"true",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Address",Required:!1,MaxLength:"100",ModelValue:"Address1",ReadOnly:!0},{Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"wostatuses",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"Status",ReadOnly:!0},{Type:"text",Label:"Site Contact",Required:!1,MaxLength:"100",ModelValue:"ContactName",ReadOnly:!0},{Type:"dropdown",Label:"Work Order Type:",Required:!1,ApiMethod:"wotypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"WoType",ReadOnly:!0},{Type:"text",Label:"Phone:",MaxLength:"50",ModelValue:"ContactPhone",ReadOnly:!0},{Type:"dropdown",Label:"Priority:",Required:!1,ApiMethod:"priorities",ValueProp:"PriorityName",TextProp:"PriorityName",ModelValue:"Priority",ReadOnly:!0},{Type:"dropdown",Label:"Office:",Required:!0,ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true",ReadOnly:!0},{Type:"dropdown",Label:"Agreement:",Required:!1,ApiMethod:"agreements",ValueProp:"Id",TextProp:"Desc",ModelValue:"AgreementId",ConvertToInt:"true",ReadOnly:!0},{Type:"dropdown",Label:"Payment Term:",Required:!1,ApiMethod:"paymentTerms",ValueProp:"Id",TextProp:"PaymentTermName",ModelValue:"PaymentTermId",ConvertToInt:"true",ReadOnly:!0},{Type:"datepicker",Label:"Request Date:",ModelValue:"RequestDate",Format:"MM/dd/yyyy",SubType:"date",ReadOnly:!0},{Type:"dropdown",Label:"Currency Code:",ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode",ReadOnly:!0},{Type:"datepicker",Label:"Entered Date:",ModelValue:"EnteredDate",Format:"MM/dd/yyyy",SubType:"date",ReadOnly:!0},{Type:"datepicker",Label:"Promised:",ModelValue:"PromiseDate",Required:!0,Format:"MM/dd/yyyy",ReadOnly:!0},{Type:"datepicker",Label:"Entered Time:",ModelValue:"EnteredDate",Format:"hh:mm:ss a",SubType:"time",ReadOnly:!0},{Type:"int",Label:"Quote Id:",ModelValue:"QuoteId",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6",ReadOnly:!0},{Type:"text",Label:"External Id:",Required:!1,MaxLength:"50",ModelValue:"ExternalId",ReadOnly:!0},{Type:"line",CustomClass:"col-sm-12"},{Type:"dropdown",Label:"Rate Sheet:",Required:!0,ApiMethod:"ratesheets",ValueProp:"Id",TextProp:"RateSheetName",ModelValue:"RateSheetId",ConvertToInt:"true",ReadOnly:!0},{Type:"dropdown",Label:"Tax Rate:",ApiMethod:"taxrates",ValueProp:"Id",TextProp:"TaxName",ModelValue:"TaxRateId",ConvertToInt:"true",ReadOnly:!0},{Type:"decimal",Label:"Tax Rate Labor %: ",ModelValue:"TaxRateLabor",ReadOnly:!0},{Type:"decimal",Label:"Tax Rate Part %: ",ModelValue:"TaxRatePart",ReadOnly:!0},{Type:"decimal",Label:"Tax Rate Misc %: ",ModelValue:"TaxRateMisc",ReadOnly:!0}],e.$watch("vm.model.TaxRateId",function(){l.getItem("taxrates",n.model.TaxRateId).then(function(){n.selectedTaxRate=l.state.item,n.model.TaxRateLabor=n.selectedTaxRate.TaxRateLabor,n.model.TaxRatePart=n.selectedTaxRate.TaxRatePart,n.model.TaxRateMisc=n.selectedTaxRate.TaxRateMisc})}),n.loadingIndicator=!1,e.$watch("vm.model.Id",function(){n.customer.customerId=n.model.CustomerId,n.site.siteId=n.model.SiteId,n.site.siteName=n.model.SiteName,n.site.title=n.model.ContactName,n.site.phone=n.model.ContactPhone,n.site.address=n.model.Address,n.altId=n.model.AltId,n.filterBySite.eq("SiteId",n.model.SiteId),l.getItem("settings/status?type=WOStatus").then(function(){n.companyWoStatus=l.state.item}),l.getItem("settings/status?type=AssignmentStatus").then(function(){n.companyAssignmentStatus=l.state.item})}),e.$watch("vm.customer.customerId",function(){null!==n.customer.customerId&&n.customer.customerId>0&&n.model.CustomerId!==n.customer.customerId&&(n.model.CustomerId=n.customer.customerId,n.model.CustomerName=n.customer.customerName,n.model.SiteId=0,n.model.SiteName="",n.model.Address="",n.model.ContactName="",n.model.ContactPhone="")}),e.$watch("vm.site.siteId",function(){null!=n.site.siteId&&n.site.siteId>0&&(n.model.SiteId=n.site.siteId,n.model.SiteName=n.site.siteName,n.model.ContactName=n.site.title,n.model.ContactPhone=n.site.phone,n.model.Address1=n.site.address,n.filter1.siteId=n.site.siteId)})}angular.module("FieldConnectApp").controller("AcceptWOController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","restService","stateTransitionService","gbCustomFactory"]}();;!function(){"use strict";function e(e,t,o,a,r,i,n,s,m){var c=this;function l(){c.isLoading=!0,r.getItem("companyinfos/getCurrentCompany").then(function(){c.currentCompany=r.state.item,function(t){c.isLoading=!0;var o={};(o=s.filter("and")).page=c.args.page,o.pageSize=c.args.pageSize,o.sortCol=c.args.sortCol,o.sortDir=c.args.sortDir,""!=c.args.woId&&o.eq("WoId",c.args.woId);""!=c.args.subcontractorId?o.eq("BiddingSubcontractorId",c.args.subcontractorId):o.eq("BiddingSubcontractorId",t);r.getItems("subcontractorAcceptWork",o).then(function(){c.items=r.state.items,c.itemsMeta=r.state.itemsMeta;for(var e=0;e<c.items.length;e++)if(null==c.items[e].PromiseDate)c.items[e].PromiseDate="";else{var t=m.parseISOString(c.items[e].PromiseDate),o=moment.tz.zone(c.items[e].TzDatabaseName).offset(t);c.items[e].PromiseDate=m.convertToLocal(t,o)}}),setTimeout(function(){c.isLoading=!1,e.$apply()},1e3)}(c.currentCompany.Id)}),setTimeout(function(){c.isLoading=!1,e.$apply()},1e3)}c.$state=o,c.isLoading=!1,c.items=[],c.itemsMeta={},c.get=l,c.accept=function(t){c.woTemp=t;var o={BidAmount:t.NotToExceedAmount,SubPromiseDate:t.PromiseDate,Id:t.Id,PromiseDate:t.PromiseDate,NotToExceedAmount:t.NotToExceedAmount};e.$watch("item.NotToExceedAmount",function(){null!=t.NotToExceedAmount&&void 0!=t.NotToExceedAmount||(o.BidAmount=0)}),i.showModal({templateUrl:"Templates/SubContractor/SubcontractorAcceptWork/BidForm.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Bid Form",model:o,attributes:[{Type:"text",Label:"Not To Exceed Amount:",ModelValue:"NotToExceedAmount",ReadOnly:!0},{Type:"decimal",Label:"Bid Amount:",Required:!0,MaxLength:"50",ModelValue:"BidAmount"},{Type:"datepicker",Label:"Promise Date:",ModelValue:"PromiseDate",Format:"MM/dd/yyyy",ReadOnly:!0},{Type:"datepicker",Label:"Your Promise Date:",MaxLength:"200",ModelValue:"SubPromiseDate",Format:"MM/dd/yyyy",Required:!0}],apiMethod:"subcontractorAcceptWork/accept",timezone:c.acceptWoTimezone,onBack:c.notification}}).then(function(e){e.close.then(function(){l()})})},c.reject=function(e){for(var t,o=0;o<c.items.length;o++)c.items[o].Id==e.Id&&(t=c.items[o]);r.update("subcontractorAcceptWork/rejected",t).then(function(e){200===e.status&&(n.success({message:"Work Order Rejected."}),l())})},c.openWo=function(e){c.$state.go("workOrdersDetailsReadOnly",{id:e.WoId})},c.notification=function(e){void 0!=e&&(1==e.awarded?(c.woAltIdTemp=c.woTemp.WoAltId,c.woIdTemp=c.woTemp.WoId,c.awarded=!0,n.success({message:"You have been awarded Work Order "+c.woAltIdTemp})):n.success({message:"Your bid has been submitted for review."}));return!0},c.model={},c.attributes=[{CellFormat:"button",Text:"Accept",Action:c.accept},{CellFormat:"button",Text:"Reject",Action:c.reject},{Name:"Contractor",ValueName:"CompanyName",CellFormat:"label",Sortable:!0},{Name:"Work Order",CellFormat:"button",Text:"",Action:c.openWo,ValueName:"WoAltId"},{Name:"Promise Date",ValueName:"PromiseDate",CellFormat:"label",Sortable:!0,FormatDate:!0},{Name:"Time Zone",ValueName:"TimeZoneName",CellFormat:"label",Sortable:!0},{Name:"Status",ValueName:"BiddingStatus",CellFormat:"label",Sortable:!0},{Name:"Customer",ValueName:"CustomerName",CellFormat:"label",Sortable:!0},{Name:"Site",ValueName:"SiteName",CellFormat:"label",Sortable:!0},{Name:"Description",ValueName:"WoDescription",CellFormat:"label",Sortable:!0},{Name:"WO Type",ValueName:"WoType",CellFormat:"label",Sortable:!0},{Name:"Not To Exceed Amount",ValueName:"NotToExceedAmount",CellFormat:"label",Sortable:!0}],c.args={page:1,pageSize:10,sortCol:"",sortDir:"asc",subcontractorId:a.id,woId:a.woId},c.woAltIdTemp=0,c.woIdTemp=0,c.awarded=!1,c.woTemp={},c.acceptWoTimezone={TzDatabaseName:"%TzDatabaseName%"},e.$watch("vm.args.page",function(){l()}),c.firstWatchFix=!0,e.$watch("vm.args.pageSize",function(){c.firstWatchFix?c.firstWatchFix=!1:(1==c.args.page&&l(),c.args.page=1)}),c.toggleSort=function(e,t){if(!t)return;c.args.sortCol!=e?(c.args.sortCol=e,c.args.sortDir="asc"):"asc"==c.args.sortDir?c.args.sortDir="desc":c.args.sortDir="asc";l()}}angular.module("FieldConnectApp").controller("SubcontractorAcceptWorkController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","ModalService","Notification","qsService","timezoneService"]}();;!function(){"use strict";function o(o,t,n){var e=this;function c(){e.modalClass=!1,o.close(null,200)}e.submit=function(){for(var r=o.subcontractors,u=0;u<r.length;u++)r[u].NotToExceedAmount=e.model.NotToExceedAmount;t.create("subcontractorBids/submitForBidding",r).then(function(t){c(),n.go("workOrdersDetails",{id:o.woId})})},e.onBack=c,e.model={NotToExceedAmount:null}}angular.module("FieldConnectApp").controller("subcontractorBidPopupController",o),o.$inject=["$scope","restService","$state"]}();;!function(){"use strict";function t(t,e,o,r,a,s,i,c,n){var l=this;function u(){l.listOfSub=n.state.transitionParams.checkSelect.listOfSub,l.listOfId=n.state.transitionParams.checkSelect.listOfId;var t={};(t=s.filter("and")).eq("CompanyStatus","Active").eq("SubcontractorStatus","Active"),t.page=l.args.page,t.pageSize=l.args.pageSize,t.sortCol=l.args.sortCol,t.sortDir=l.args.sortDir,t.like("SubcontractorName","%"+l.args.searchText+"%"),a.getItems("subcontractorBids",t).then(function(){l.items=a.state.items,l.itemsMeta=a.state.itemsMeta,d(l.listOfSub.length),function(){for(var t=0;t<l.items.length;t++)for(var e=0;e<l.listOfSub.length;e++){if(l.listOfSub[e]==l.items[t].SubcontractorId){l.items[t].Checked=!0;break}l.items[t].Checked=!1}}()})}l.$state=o,l.items={Checked:!1},l.itemsMeta={},l.goBack=function(){window.history.back()},l.get=u,l.submitForBidding=function(){for(var t=[],e=0;e<l.listOfSub.length;e++)t.push({Id:l.listOfId[e],SubcontractorId:l.listOfSub[e],WoId:parseInt(l.args.woId),NotToExceedAmount:null});0==t.length?c.error({message:"First you need to select subcontractor."}):i.showModal({templateUrl:"Templates/SubContractor/SubcontractorBid/bidPopUp.html",controller:"subcontractorBidPopupController",controllerAs:"vm",inputs:{modalTitle:"Add Not to Exceed Amount",subcontractors:t,woId:l.args.woId}}).then(function(t){t.close.then(function(){})})},l.assign=function(){var t={};angular.forEach(l.items,function(e){if(e.Checked)return t={Id:e.Id,SubcontractorId:e.SubcontractorId,WoId:parseInt(l.args.woId)},!1}),a.create("subcontractorBids/assignWorkOrder",t).then(function(t){o.go("workOrdersDetails",{id:l.args.woId})})},l.toggleSort=function(t,e){if(!e)return;l.args.sortCol!=t?(l.args.sortCol=t,l.args.sortDir="asc"):"asc"==l.args.sortDir?l.args.sortDir="desc":l.args.sortDir="asc";f(),u()},l.checkboxChanged=function(t){if(t.Checked)l.listOfSub.push(t.SubcontractorId),l.listOfId.push(t.Id);else for(var e=0;e<l.listOfSub.length;e++)l.listOfSub[e]==t.SubcontractorId&&(l.listOfSub.splice(e,1),l.listOfId.splice(e,1));d(l.listOfSub.length)},l.assignButtonDisabled=!0,l.listOfSub=[],l.listOfId=[],l.attributes=[{Name:"",ValueName:"SubcontractorId",CellFormat:"checkbox",Sortable:!1},{Name:"Subcontractor",ValueName:"SubcontractorName",CellFormat:"label",Sortable:!0},{Name:"Industry",ValueName:"IndustryName",CellFormat:"label",Sortable:!0},{Name:"Address",ValueName:"SubcontractorAddress",CellFormat:"label",Sortable:!0}],l.attributesNotExceed=[{Type:"decimal",Label:"Not to Exceed Amount:",MaxLength:"50",ModelValue:"NotToExceedAmount"}],l.args={page:1,pageSize:10,sortCol:"",sortDir:"asc",companyId:r.companyId,woId:r.woId,searchText:""};function d(t){l.assignButtonDisabled=!0,1===t&&(l.assignButtonDisabled=!1)}function f(){var t={};n.selectiveExtend(t,l,["listOfSub","listOfWoId","listOfId"]),n.setTransitionParam("checkSelect",t)}t.$watch("vm.args.page",function(){f(),u()}),l.firstWatchFix=!0,t.$watch("vm.args.pageSize",function(){l.firstWatchFix?l.firstWatchFix=!1:(1==l.args.page&&(f(),u()),l.args.page=1)})}angular.module("FieldConnectApp").controller("SubcontractorBidController",t),t.$inject=["$scope","$location","$state","$stateParams","restService","qsService","ModalService","Notification","stateTransitionService"]}();;!function(){"use strict";function e(e,t,n,o,s,i,m,l,r,c){var a=this;a.$state=o;var d=s.id;function u(){t.$watch("vm.model",function(){$("#submitForm").trigger("submit")})}a.model={},a.Active=!0,a.filterByActive=m.filter("and"),a.filterByActive.eq("Active",a.Active),e.getItems("merchants",a.filterByActive).then(function(){a.merchant=e.state.items,a.model.ssl_merchant_id=a.merchant[0].MerchantId,a.model.ssl_user_id=a.merchant[0].UserId,a.model.ssl_pin=a.merchant[0].Pin,a.model.ssl_transaction_type=a.merchant[0].TransactionType,a.model.ssl_show_form=a.merchant[0].ShowForm,a.model.url=c.trustAsResourceUrl(a.merchant[0].Url),a.model.ssl_company&&u()}),e.getItem("subscriptions/token?token="+d).then(function(){a.sub=e.state.item,a.model.ssl_amount=a.sub.Price,a.model.ssl_email=a.sub.Email,a.model.ssl_company=a.sub.CompanyName,a.model.token=a.sub.Token,a.model.ssl_pin&&u()}),a.loadingIndicator=!1,a.model={}}angular.module("FieldConnectApp").controller("PaymentCompanyController",e),e.$inject=["restService","$scope","$location","$state","$stateParams","Notification","qsService","$timeout","$window","$sce"]}();;!function(){"use strict";function t(t,e,n,s,o,i,r,a,l,m){var c=this;c.$state=s,c.onSubmit=function(){c.model.Status="Active",t.update("subscriptions/newCompany",c.model).then(function(t){200===t.status&&(n.path("newsubscribeduser/"+u),a(function(){l.location.reload()}))})},c.submitMerchant=d;var u=n.url().split("/")[2];function d(){e.$watch("vm.model",function(){angular.element("#submitForm").trigger("submit")})}c.model={},c.attributes=[],c.Active=!0,c.filterByActive=r.filter("and"),c.filterByActive.eq("Active",c.Active),t.getItems("merchants",c.filterByActive).then(function(){c.merchant=t.state.items,c.model.ssl_merchant_id=c.merchant[0].MerchantId,c.model.ssl_user_id=c.merchant[0].UserId,c.model.ssl_pin=c.merchant[0].Pin,c.model.ssl_transaction_type=c.merchant[0].TransactionType,c.model.url=m.trustAsResourceUrl(c.merchant[0].Url),c.model.ssl_show_form=c.merchant[0].ShowForm,c.model.ssl_company&&d()}),t.getItem("subscriptions/token?token="+u).then(function(){c.sub=t.state.item,c.model.ssl_amount=c.sub.Price,c.model.ssl_email=c.sub.Email,c.model.ssl_company=c.sub.CompanyName,c.model.token=c.sub.Token,c.model.ssl_pin&&d()}),c.loadingIndicator=!1}angular.module("FieldConnectApp").controller("PaymentsController",t),t.$inject=["restService","$scope","$location","$state","$stateParams","Notification","qsService","$timeout","$window","$sce"]}();;!function(){"use strict";function i(i,o,n,t,e,a,s,r,c,l,d){var u=this;function m(){n.go("subscriptionPlan")}u.goHome=function(){n.go("home")},u.model={},u.createUpdate=function(){if(!u.subscription.$valid)return u.formValidation.plan=!u.subscription.plan.$valid,u.formValidation.month=!u.subscription.month.$valid,u.formValidation.desc=!u.subscription.desc.$valid,u.formValidation.price=!u.subscription.price.$valid,void(u.formValidation.transactions=!u.subscription.transactions.$valid);u.id?e.update("subscriptionplans",u.model).then(function(i){200===i.status&&m()}):e.create("subscriptionplans",u.model).then(function(i){201===i.status&&m()})},u.showMonths=!1,u.showTransaction=!1,u.goBack=m,u.disablePrice=!1,u.formValidation={},u.labelPrice="*Price",u.id=parseInt(t.id),u.model.Trial=!1,u.id&&e.getItem("subscriptionplans",u.id).then(function(i){u.model=e.state.item}),i.$watch("vm.model.Type",function(){"User"===u.model.Type&&(u.showMonths=!0,u.showTransaction=!1,u.labelPrice="*Plan Price per User"),"Transaction"===u.model.Type&&(u.showTransaction=!0,u.showMonths=!1,u.labelPrice="*Price")}),i.$watch("vm.model.Trial",function(){u.model.Trial?(u.disablePrice=!0,u.model.Price=0):(u.disablePrice=!1,u.model.Price=null)})}angular.module("FieldConnectApp").controller("SubscriptionPlanEditController",i),i.$inject=["$scope","$location","$state","$stateParams","restService","$window","$anchorScroll","ModalService","Notification","$timeout","qsService"]}();;!function(){"use strict";function e(e,t,a,i,o,l,n,r,s,m,c){this.goHome=function(){a.go("home")},this.edit=function(e){a.go("subscriptionPlanEdit",{id:e})},this.attributes=[{Name:"Subscription Plan",ValueName:"Plan",Edit:!0,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"Type",Edit:!1,Sortable:!0},{Name:"Duration",ValueName:"Months",Edit:!1,Sortable:!0},{Name:"Minimum Users",ValueName:"MinimumUsers",Edit:!1,Sortable:!0},{Name:"Transactions",ValueName:"Transactions",Edit:!1,Sortable:!0},{Name:"Price",ValueName:"Price",Edit:!1,Sortable:!0,CellFormat:"decimal"},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0}]}angular.module("FieldConnectApp").controller("SubscriptionPlanController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","$window","$anchorScroll","ModalService","Notification","$timeout","qsService"]}();;!function(){"use strict";function e(e,o,t,a,r,n,l,d,i,s,m,c){var u=this;u.$state=a,u.goToTerms=P,u.goBack=function(){t.url("/subscriptionType"),i(function(){window.location.reload()})},u.onSubmit=function(){p||0==u.model.Price?u.model.Status="Active":u.model.Status="Inactive";var o=null;u.model.AcceptTerms?(s.setValue("tmpData",{model:u.model,type:"Transaction"}),p||0===u.model.Price?e.create("subscriptions/newCompany",u.model).then(function(a){a&&201===a.status&&(o=a.data.Token,u.model.Token=o,e.create("newcompanyusers",u.model).then(function(o){o&&200===o.status&&e.create("subscriptionPayments/trial",u.model).then(function(e){if(e&&200===e.status){n.success({message:"User has been successfully created."});var o={username:e.data.Username,password:e.data.Password};m.login(o).then(function(e){m.dpsLogin(e.data.access_token),c.setUserAuthData(!1,!1).then(function(){t.path("master-tables/companyInfos/").search({param:"isNewCompany"}),i(function(){d.location.reload()})},function(){n.error({message:"User authentication data not found."}),m.logOut(!0)})},function(){n.error({message:"Authentication error. Please, try again later."}),m.logOut(!0)})}})}))}):e.create("subscriptions/newCompany",u.model).then(function(o){if(201===o.status){var a=o.data.Token;u.model.Token=a,e.create("newcompanyusers",u.model).then(function(e){200===e.status&&(t.path("payments/"+a).search({}),i(function(){d.location.reload()}))})}})):(n.warning({message:"You must accept Terms and Conditions!"}),d.scrollTo(0,0));u.loadingIndicator=!1};var p=!1,y=s.getValue("tmpData"),C=t.url(),T=C.split("?");C.split("/");if("Declined=true"==(b=T[1]))bootbox.alert("There has been an error processing your credit card! Please try again later. <br/>",function(){y?(u.model.CompanyName=y.model.CompanyName,u.model.Email=y.model.Email,u.model.FirstName=y.model.FirstName,u.model.LastName=y.model.LastName,u.model.Phone=y.model.Phone,u.model.CurrencyCode=y.model.CurrencyCode,u.model.TimeZoneId=y.model.TimeZoneId,u.model.Address=y.model.Address,u.model.City=y.model.City,u.model.StateCode=y.model.StateCode,u.model.PostalCode=y.model.PostalCode,u.model.Country=y.model.Country,u.model.AcceptTerms=y.model.AcceptTerms,u.model.Status=y.model.Status,u.model.Price=y.model.Price,u.model.Desc=y.model.Desc,u.model.TransactionNumber=y.model.TransactionNumber,u.model.SubscriptionPlanId=y.model.SubscriptionPlanId,o.$apply(),s.removeValue("tmpData")):(t.path("login/"),i(function(){d.location.reload()}))});else if(b&&"isPayment=true"!=b){var b,h=(b=decodeURIComponent(b)).split("&");u.paymentErrorModel={ErrorCode:h[0].split("=")[1],ErrorName:h[1].split("=")[1],ErrorMsg:h[2].split("=")[1]}}function P(){d.open("terms","_blank")}void 0!==b&&"Declined=true"!=b&&"isPayment=true"!=b&&e.create("paymenterror",u.paymentErrorModel).then(function(){bootbox.alert('There has been an error processing your credit card <br/>"'+u.paymentErrorModel.ErrorName+'"<br/> Please try again and if problems persist, contact FieldConnect.',function(){y?(u.model.CompanyName=y.model.CompanyName,u.model.Email=y.model.Email,u.model.FirstName=y.model.FirstName,u.model.LastName=y.model.LastName,u.model.Phone=y.model.Phone,u.model.CurrencyCode=y.model.CurrencyCode,u.model.TimeZoneId=y.model.TimeZoneId,u.model.Address=y.model.Address,u.model.City=y.model.City,u.model.StateCode=y.model.StateCode,u.model.PostalCode=y.model.PostalCode,u.model.Country=y.model.Country,u.model.AcceptTerms=y.model.AcceptTerms,u.model.Status=y.model.Status,u.model.Price=y.model.Price,u.model.Desc=y.model.Desc,u.model.UserCount=y.model.UserCount,u.model.SubscriptionPlanId=y.model.SubscriptionPlanId,u.model.TmpPrice=y.model.TmpPrice,o.$apply(),s.removeValue("tmpData")):(t.path("login/"),i(function(){d.location.reload()}))})}),u.model={Status:"Inactive"},o.$on("$locationChangeSuccess",function(){u.searchText=t.url(),"/subscriptionType"==u.searchText&&d.location.reload()}),u.plans=["Both","CreditCardOnly"],u.filterStatusNewCompany=l.filter("and"),u.filterStatusNewCompany.eq("Status","Active").eq("Type","Transaction").eq("BillingOption",u.plans),u.attributes=[{Type:"dropdown",Label:"Subscription Plan",Required:!0,ApiMethod:"subscriptionPlans",ValueProp:"Id",TextProp:"Plan",ModelValue:"SubscriptionPlanId",Filter:u.filterStatusNewCompany},{Type:"currency",Label:"Price",ModelValue:"Price",ReadOnly:!0},{Type:"textarea",Label:"Description",ModelValue:"Desc",ReadOnly:!0},{Type:"int",Label:"Transaction",ModelValue:"TransactionNumber",ReadOnly:!0},{Type:"text",Label:"",ModelValue:"Status",CustomInputClass:"hidden"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Company Name:",MaxLength:"50",ModelValue:"CompanyName",Required:!0},{Type:"text",Label:"Address:",MaxLength:"100",ModelValue:"Address",Required:!0},{Type:"email",Label:"Email:",MaxLength:"50",ModelValue:"Email",Required:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"First Name:",MaxLength:"50",ModelValue:"FirstName",Required:!0},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"City",Required:!0},{Type:"text",Label:"Last Name:",MaxLength:"50",ModelValue:"LastName",Required:!0},{Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"StateCode",Required:!0},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"Phone",Required:!0},{Type:"text",Label:"Postal Code",MaxLength:"20",ModelValue:"PostalCode",Required:!0},{Type:"dropdown",Label:"Currency:",ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode",CurrentList:[]},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country",Required:!0},{Type:"dropdown",Label:"Time Zone:",Required:!0,ModelValue:"TimeZoneId",ValueProp:"Id",TextProp:"TimeZoneName",ApiMethod:"timezones"},{Type:"checkbox",Label:"Accept",ModelValue:"AcceptTerms",CustomLabelClass:"col-sm-offset-3",Link:"Terms and Conditions",LinkOnClick:P}],o.$watch("vm.attributes[16].CurrentList",function(){if(u.attributes&&u.attributes[16].CurrentList.length>0)for(var e=0;e<u.attributes[16].CurrentList.length;e++)u.model.CurrencyCode||"USD"==u.attributes[16].CurrentList[e].CurrencyCode&&(u.model.CurrencyCode=u.attributes[16].CurrentList[e].CurrencyCode)},!0),o.$watch("vm.model.SubscriptionPlanId",function(){e.getItem("subscriptionplans",u.model.SubscriptionPlanId).then(function(o){u.item=e.state.item,u.model.Desc=u.item.Desc,u.model.Price=u.item.Price,u.model.TransactionNumber=u.item.Transactions,p=u.item.Trial})})}angular.module("FieldConnectApp").controller("SubscriptionNewTransactionBasedController",e),e.$inject=["restService","$scope","$location","$state","$stateParams","Notification","qsService","$window","$timeout","cryptoStorageService","authService","currentUserService"]}();;!function(){"use strict";function e(e,t,o,a,n,i,l,r,d){var m=this;m.$state=a,m.onSubmit=function(){d.setValue("tmpData",{model:m.model,type:"TransactionUpdate"}),("CreditCardOnly"==m.model.BillingOption||"Both"==m.model.BillingOption)&&m.model.Price>0?(m.model.Status="Pending",e.create("subscriptions",m.model).then(function(e){if(201===e.status){var t=e.data.Token;a.go("companypayments",{id:t})}})):0==m.model.Price?(m.model.Status="Active",e.create("subscriptions",m.model).then(function(e){201===e.status&&(m.disableBtn=!0,a.go("subscription",{id:!0}))})):"InvoiceOnly"==m.model.BillingOption?(m.model.Status="Pending",e.create("subscriptions",m.model).then(function(e){201===e.status&&(m.disableBtn=!0,a.go("subscription",{id:!0}))})):"CreditCardOnly"!=m.model.BillingOption&&m.model.Price>0&&(m.model.Status="Pending",e.create("subscriptions",m.model).then(function(e){201===e.status&&(m.disableBtn=!0,a.go("subscription",{id:!0}))}));m.loadingIndicator=!1,m.model={}},m.disableBtn=!1;m.model={Status:"Pending",CompanyId:null},m.filterStatusOldCompany=l.filter("and"),m.filterStatusOldCompany.eq("Status","Active").eq("Type","Transaction").neq("Trial","True");var s=d.getValue("authorizationData"),c=d.getValue("tmpData"),p=o.url(),u=p.split("?");p.split("/");if("Declined=true"==(y=u[1]))bootbox.alert("There has been an error processing your credit card! Please try again later. <br/>",function(){c?(m.model.Status=c.model.Status,m.model.Price=c.model.Price,m.model.Desc=c.model.Desc,m.model.TransactionNumber=c.model.TransactionNumber,m.model.SubscriptionPlanId=c.model.SubscriptionPlanId,m.model.CompanyId=c.model.CompanyId,m.model.Email=c.model.Email,t.$apply(),d.removeValue("tmpData")):(o.path("login/"),$timeout(function(){r.location.reload()}))});else if(y&&"isPayment=true"!=y){var y,b=(y=decodeURIComponent(y)).split("&");m.paymentErrorModel={ErrorCode:b[0].split("=")[1],ErrorName:b[1].split("=")[1],ErrorMsg:b[2].split("=")[1]}}void 0!==y&&"Declined=true"!=y&&"isPayment=true"!=y&&(e.create("paymenterror",m.paymentErrorModel).then(function(){}),bootbox.alert('There has been an error processing your credit card <br/>"'+m.paymentErrorModel.ErrorName+'"<br/> Please try again and if problems persist, contact FieldConnect.',function(){c?(m.model.Status=c.model.Status,m.model.Price=c.model.Price,m.model.Desc=c.model.Desc,m.model.TransactionNumber=c.model.TransactionNumber,m.model.SubscriptionPlanId=c.model.SubscriptionPlanId,m.model.CompanyId=c.model.CompanyId,m.model.Email=c.model.Email,t.$apply(),d.removeValue("tmpData")):(o.path("login/"),$timeout(function(){r.location.reload()}))}));for(var P=s.userRoles.split(","),f=!1,C=0;C<P.length;C++)"FieldConnect"==P[C]&&(f=!0);f||m.filterStatusOldCompany.eq("Status","Active").eq("Type","Transaction").neq("Trial","True").neq("BillingOption","InvoiceOnly");var g={Type:"text",Label:"Company",ModelValue:"CompanyName",Required:!0,ReadOnly:!0};if(m.attributes=[{Type:"dropdown",Label:"Subscription Plan",Required:!0,ApiMethod:"subscriptionPlans",ValueProp:"Id",TextProp:"Plan",ModelValue:"SubscriptionPlanId",Filter:m.filterStatusOldCompany},g,{Type:"textarea",Label:"Description",ModelValue:"Desc",ReadOnly:!0},{Type:"email",Label:"Email",ModelValue:"email",Required:!0},{Type:"int",Label:"Transaction",ModelValue:"TransactionNumber",ReadOnly:!0},{Type:"currency",Label:"Price",ModelValue:"Price",ReadOnly:!0}],f)t.$watch("vm.model.CompanyId",function(){m.model&&e.getItem("companyinfos",m.model.CompanyId).then(function(e){m.model.CompanyName=e.data.CompanyName,m.model.email=e.data.Email})},!0),m.attributes[1]={Type:"dropdown",Label:"Company",ModelValue:"CompanyId",Required:!0,ApiMethod:"companyinfos",ValueProp:"Id",TextProp:"CompanyName"};else{var T=t.$watch("vm.model",function(){m.model&&e.getItems("companyinfos/getCurrentCompany").then(function(e){m.model.CompanyName=e.data.CompanyName,m.model.CompanyId=e.data.Id,m.model.email=e.data.Email,T()})},!0);m.attributes[1]=g}t.$watch("vm.model.SubscriptionPlanId",function(){e.getItem("subscriptionplans",m.model.SubscriptionPlanId).then(function(t){m.item=e.state.item,m.model.Desc=m.item.Desc,m.model.Price=m.item.Price,m.model.TransactionNumber=m.item.Transactions,m.model.BillingOption=m.item.BillingOption})})}angular.module("FieldConnectApp").controller("SubscriptionTransactionBasedController",e),e.$inject=["restService","$scope","$location","$state","$stateParams","Notification","qsService","$window","cryptoStorageService"]}();;!function(){"use strict";function e(e,t,o,a,r,n,l,d,s,i,m,u,c,p){var y=this;y.$state=a,y.onSubmit=function(){if(y.model.UserCount<y.userCount)n.warning({message:"You can not enter less then minimum user count!"}),d.scrollTo(0,0),y.model.UserCount=y.userCount;else{y.totalPrice=y.model.TmpPrice*y.model.UserCount,y.model.Price=y.totalPrice,y.tmpDate=new Date,y.model.StartDate=new Date(y.tmpDate),y.model.EndDate=new Date(new Date(y.tmpDate).setMonth(y.tmpDate.getMonth()+C)),h||0==y.model.Price?y.model.Status="Active":y.model.Status="Inactive";var t=null;y.model.AcceptTerms?y.model.AcceptTerms&&(i.setValue("tmpData",{model:y.model,type:"User"}),h||0===y.model.Price?e.create("subscriptions/newCompany",y.model).then(function(a){201===a.status&&(t=a.data.Token,y.model.Token=t,e.create("newcompanyusers",y.model).then(function(t){200===t.status&&e.create("subscriptionPayments/trial",y.model).then(function(e){if(200===e.status){n.success({message:"User has been successfully created."});var t={username:e.data.Username,password:e.data.Password};c.login(t).then(function(e){c.dpsLogin(e.data.access_token),p.setUserAuthData(!1,!1).then(function(){o.path("master-tables/companyInfos/").search({param:"isNewCompany"}),s(function(){d.location.reload()})},function(){n.error({message:"User authentication data not found."}),c.logOut(!0)})},function(){n.error({message:"Authentication error. Please, try again later."}),c.logOut(!0)})}})}))}):e.create("subscriptions/newCompany",y.model).then(function(t){if(t&&201===t.status){var a=t.data.Token;y.model.Token=a,e.create("newcompanyusers",y.model).then(function(e){e&&200===e.status&&(o.path("payments/"+a).search({}),s(function(){d.location.reload()}))})}})):(n.warning({message:"You must accept Terms and Conditions!"}),d.scrollTo(0,0)),y.loadingIndicator=!1}},y.goBack=function(){o.url("/subscriptionType"),s(function(){window.location.reload()})};var C=0,h=!1,b=i.getValue("tmpData");y.searchText=a.params.search;var T=o.url(),P=T.split("?");T.split("/");if("Declined=true"==(g=P[1]))bootbox.alert("There has been an error processing your credit card! Please try again later. <br/>",function(){b?(y.model.CompanyName=b.model.CompanyName,y.model.Email=b.model.Email,y.model.FirstName=b.model.FirstName,y.model.LastName=b.model.LastName,y.model.Phone=b.model.Phone,y.model.CurrencyCode=b.model.CurrencyCode,y.model.TimeZoneId=b.model.TimeZoneId,y.model.Address=b.model.Address,y.model.City=b.model.City,y.model.StateCode=b.model.StateCode,y.model.PostalCode=b.model.PostalCode,y.model.Country=b.model.Country,y.model.AcceptTerms=b.model.AcceptTerms,y.model.Status=b.model.Status,y.model.Price=b.model.Price,y.model.Desc=b.model.Desc,y.model.TransactionNumber=b.model.TransactionNumber,y.model.SubscriptionPlanId=b.model.SubscriptionPlanId,t.$apply(),i.removeValue("tmpData")):(o.path("login/"),s(function(){d.location.reload()}))});else if(g&&"isPayment=true"!=g){var g,M=(g=decodeURIComponent(g)).split("&");y.paymentErrorModel={ErrorCode:M[0].split("=")[1],ErrorName:M[1].split("=")[1],ErrorMsg:M[2].split("=")[1]}}void 0!==g&&"Declined=true"!=g&&"isPayment=true"!=g&&e.create("paymenterror",y.paymentErrorModel).then(function(){bootbox.alert('There has been an error processing your credit card <br/>"'+y.paymentErrorModel.ErrorName+'"<br/> Please try again and if problems persist, contact FieldConnect.',function(){b?(y.model.CompanyName=b.model.CompanyName,y.model.Email=b.model.Email,y.model.FirstName=b.model.FirstName,y.model.LastName=b.model.LastName,y.model.Phone=b.model.Phone,y.model.CurrencyCode=b.model.CurrencyCode,y.model.TimeZoneId=b.model.TimeZoneId,y.model.Address=b.model.Address,y.model.City=b.model.City,y.model.StateCode=b.model.StateCode,y.model.PostalCode=b.model.PostalCode,y.model.Country=b.model.Country,y.model.AcceptTerms=b.model.AcceptTerms,y.model.Status=b.model.Status,y.model.Price=b.model.Price,y.model.Desc=b.model.Desc,y.model.UserCount=b.model.UserCount,y.model.SubscriptionPlanId=b.model.SubscriptionPlanId,y.model.TmpPrice=b.model.TmpPrice,t.$apply(),i.removeValue("tmpData")):(o.path("login/"),s(function(){d.location.reload()}))})}),y.model={Status:"Pending"},t.$on("$locationChangeSuccess",function(){y.searchText=o.url(),"/subscriptionType"==y.searchText&&d.location.reload()});var f=new Date,S=(new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")[f.getDay()],f.getDate()),D=new Array("January","February","March","April","May","June","July","August","September","October","November","December")[f.getMonth()],L=f.getFullYear();y.StartDate=D+" "+S+", "+L,y.plans=["Both","CreditCardOnly"],y.filterStatusNewCompany=l.filter("and"),y.filterStatusNewCompany.eq("Status","Active").eq("Type","User").eq("BillingOption",y.plans),y.attributes=[{Type:"dropdown",Label:"Subscription Plan",Required:!0,ApiMethod:"subscriptionPlans",ValueProp:"Id",TextProp:"Plan",ModelValue:"SubscriptionPlanId",Filter:y.filterStatusNewCompany},{Type:"currency",Label:"Price per User",ModelValue:"TmpPrice",ReadOnly:!0},{Type:"textarea",Label:"Description",ModelValue:"Desc",ReadOnly:!0},{Type:"int",Label:"User Count",ModelValue:"UserCount",Required:!0},{Type:"text",Label:"Company Name:",MaxLength:"50",ModelValue:"CompanyName",Required:!0},{Type:"text",Label:"Address:",MaxLength:"100",ModelValue:"Address",Required:!0},{Type:"email",Label:"Email:",MaxLength:"50",ModelValue:"Email",Required:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"First Name:",MaxLength:"50",ModelValue:"FirstName",Required:!0},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"City",Required:!0},{Type:"text",Label:"Last Name:",MaxLength:"50",ModelValue:"LastName",Required:!0},{Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"StateCode",Required:!0},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"Phone",Required:!0},{Type:"text",Label:"Postal Code",MaxLength:"20",ModelValue:"PostalCode",Required:!0},{Type:"dropdown",Label:"Currency:",ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode",CurrentList:[]},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country",Required:!0},{Type:"dropdown",Label:"Time Zone:",Required:!0,ModelValue:"TimeZoneId",ValueProp:"Id",TextProp:"TimeZoneName",ApiMethod:"timezones"},{Type:"checkbox",Label:"Accept",ModelValue:"AcceptTerms",CustomLabelClass:"col-sm-offset-3",Link:"Terms and Conditions",LinkOnClick:function(){d.open("https://www.fieldconnect.com/master-services-agreement","_blank")}}],t.$watch("vm.attributes[14].CurrentList",function(){if(y.attributes&&y.attributes[14].CurrentList.length>0)for(var e=0;e<y.attributes[14].CurrentList.length;e++)y.model.CurrencyCode||"USD"==y.attributes[14].CurrentList[e].CurrencyCode&&(y.model.CurrencyCode=y.attributes[14].CurrentList[e].CurrencyCode)},!0),t.$watch("vm.model.SubscriptionPlanId",function(){e.getItem("subscriptionplans",y.model.SubscriptionPlanId).then(function(t){if(y.item=e.state.item,y.model.Desc=y.item.Desc,y.model.TmpPrice=y.item.Price,y.userCount=y.item.MinimumUsers,y.model.UserCount=y.userCount,h=y.item.trial,C=y.item.Months,y.item.Months){y.tmpDate=new Date;var o=new Date(new Date(y.tmpDate).setMonth(y.tmpDate.getMonth()+C)),a=(new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")[o.getDay()],o.getDate()),r=new Array("January","February","March","April","May","June","July","August","September","October","November","December")[o.getMonth()],n=o.getFullYear();y.EndDate=r+" "+a+", "+n}else y.EndDate=""})})}angular.module("FieldConnectApp").controller("SubscriptionNewUserBasedController",e),e.$inject=["restService","$scope","$location","$state","$stateParams","Notification","qsService","$window","$timeout","cryptoStorageService","$http","ngAuthSettings","authService","currentUserService"]}();;!function(){"use strict";function e(e,t,a,o,n,r,l,i,d){var m=this;m.$state=o,m.onSubmit=function(){i.setValue("tmpData",{model:m.model,type:"UserUpdate"}),m.model.UserCount<m.userCount?(r.warning({message:"You can not enter less then minimum user count!"}),$window.scrollTo(0,0),m.model.UserCount=m.userCount):(m.totalPrice=m.model.TmpPrice*m.model.UserCount,m.model.Price=m.totalPrice,m.tmpDate=new Date,m.model.EndDate=new Date(m.model.StartDate),m.model.StartDate=new Date(m.model.StartDate),m.model.EndDate=new Date(m.model.EndDate.setMonth(m.model.StartDate.getMonth()+m.item.Months)),("CreditCardOnly"==m.model.BillingOption||"Both"==m.model.BillingOption)&&m.model.Price>0?(m.model.Status="Pending",e.create("subscriptions",m.model).then(function(e){if(201===e.status){var t=e.data.Token;o.go("companypayments",{id:t})}})):0==m.model.Price?(m.model.Status="Active",e.create("subscriptions",m.model).then(function(e){201===e.status&&(m.disableBtn=!0,o.go("subscription",{id:!0}))})):"InvoiceOnly"==m.model.BillingOption?(m.model.Status="Pending",e.create("subscriptions",m.model).then(function(e){201===e.status&&(m.disableBtn=!0,o.go("subscription",{id:!0}))})):"CreditCardOnly"!=m.model.BillingOption&&m.model.Price>0&&(m.model.Status="Pending",e.create("subscriptions",m.model).then(function(e){201===e.status&&(m.disableBtn=!0,o.go("subscription",{id:!0}))})),m.loadingIndicator=!1);m.model.StartDate.setHours(0),m.model.StartDate.setMinutes(0),m.model.StartDate>m.tmpDate.setHours(0,0,0,0)&&(m.model.Status="Inactive");m.model.StartDate=d.buildISOString(m.model.StartDate),m.model.EndDate.setHours(23),m.model.EndDate.setMinutes(59),m.model.EndDate=d.buildISOString(m.model.EndDate)},m.writeDate=h;m.model={Status:"Pending",CompanyId:null},m.filterStatusOldCompany=l.filter("and"),m.filterStatusOldCompany.eq("Status","Active").eq("Type","User").neq("Trial","True");var s=i.getValue("authorizationData"),u=i.getValue("tmpData"),c=a.url(),p=c.split("?");c.split("/");if("Declined=true"==(y=p[1]))bootbox.alert("There has been an error processing your credit card! Please try again later. <br/>",function(){u?(m.model.Status=u.model.Status,m.model.Price=u.model.Price,m.model.Desc=u.model.Desc,m.model.TransactionNumber=u.model.TransactionNumber,m.model.SubscriptionPlanId=u.model.SubscriptionPlanId,m.model.CompanyId=u.model.CompanyId,m.model.Email=u.model.Email,t.$apply(),i.removeValue("tmpData")):(a.path("login/"),$timeout(function(){$window.location.reload()}))});else if(y&&"isPayment=true"!=y){var y,D=(y=decodeURIComponent(y)).split("&");m.paymentErrorModel={ErrorCode:D[0].split("=")[1],ErrorName:D[1].split("=")[1],ErrorMsg:D[2].split("=")[1]}}void 0!==y&&"Declined=true"!=y&&"isPayment=true"!=y&&(e.create("paymenterror",m.paymentErrorModel).then(function(){}),bootbox.alert('There has been an error processing your credit card <br/>"'+m.paymentErrorModel.ErrorName+'"<br/> Please try again and if problems persist, contact FieldConnect.',function(){u?(m.model.Status=u.model.Status,m.model.Price=u.model.Price,m.model.Desc=u.model.Desc,m.model.UserCount=u.model.UserCount,m.model.SubscriptionPlanId=u.model.SubscriptionPlanId,m.model.TmpPrice=u.model.TmpPrice,m.model.CompanyId=u.model.CompanyId,m.model.Email=u.model.Email,t.$apply(),i.removeValue("tmpData")):(a.path("login/"),$timeout(function(){$window.location.reload()}))}));for(var S=s.userRoles.split(","),b=!1,g=0;g<S.length;g++)"FieldConnect"==S[g]&&(b=!0);b||m.filterStatusOldCompany.eq("Status","Active").eq("Type","User").neq("Trial","True").neq("BillingOption","InvoiceOnly");var C={Type:"text",Label:"Company",ModelValue:"CompanyName",Required:!0,ReadOnly:!0};if(m.attributes=[{Type:"dropdown",Label:"Subscription Plan",Required:!0,ApiMethod:"subscriptionPlans",ValueProp:"Id",TextProp:"Plan",ModelValue:"SubscriptionPlanId",Filter:m.filterStatusOldCompany},C,{Type:"textarea",Label:"Description",ModelValue:"Desc",ReadOnly:!0},{Type:"email",Label:"Email",ModelValue:"email",Required:!0},{Type:"currency",Label:"Price per User",ModelValue:"TmpPrice",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"int",Label:"User Count",ModelValue:"UserCount",Required:!0},{Type:"datepicker",Label:"Start Date:",ModelValue:"StartDate",Format:"MM/dd/yyyy",SubType:"date",Required:!0}],b)t.$watch("vm.model.CompanyId",function(){m.model&&e.getItem("companyinfos",m.model.CompanyId).then(function(e){m.model.CompanyName=e.data.CompanyName,m.model.email=e.data.Email})},!0),m.attributes[1]={Type:"dropdown",Label:"Company",ModelValue:"CompanyId",Required:!0,ApiMethod:"companyinfos",ValueProp:"Id",TextProp:"CompanyName"};else{var P=t.$watch("vm.model",function(){m.model&&e.getItems("companyinfos/getCurrentCompany").then(function(e){m.model.CompanyName=e.data.CompanyName,m.model.CompanyId=e.data.Id,m.model.email=e.data.Email,P()})},!0);m.attributes[1]=C}function h(){if(m.item&&m.item.Months){m.tmpDate=new Date(m.model.StartDate);var e=new Date(new Date(m.model.StartDate).setMonth(m.tmpDate.getMonth()+m.item.Months)),t=(new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")[e.getDay()],e.getDate()),a=new Array("January","February","March","April","May","June","July","August","September","October","November","December")[e.getMonth()],o=e.getFullYear();m.EndDate=a+" "+t+", "+o}else m.EndDate="";var n=new Date(m.model.StartDate),r=(new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")[n.getDay()],n.getDate()),l=new Array("January","February","March","April","May","June","July","August","September","October","November","December")[n.getMonth()],i=n.getFullYear();m.StartDate=l+" "+r+", "+i}t.$watch("vm.model.SubscriptionPlanId",function(){e.getItem("subscriptionplans",m.model.SubscriptionPlanId).then(function(t){m.item=e.state.item,m.model.Desc=m.item.Desc,m.model.TmpPrice=m.item.Price,m.userCount=m.item.MinimumUsers,m.model.UserCount=m.userCount,m.model.BillingOption=m.item.BillingOption,h()})}),t.$watch("vm.model.StartDate",function(){m.model.StartDate&&h()})}angular.module("FieldConnectApp").controller("SubscriptionUserBased",e),e.$inject=["restService","$scope","$location","$state","$stateParams","Notification","qsService","cryptoStorageService","timezoneService"]}();;!function(){"use strict";function e(e,t,a,i,o,s,n,r,l){var m=this;m.isLoading=!1,m.edit=function(e){m.$state.go("subscriptionEdit",{id:e})},m.$state=i,m.goToTransactions=function(){m.$state.go("subscriptionTransactionBased")},m.goToUserSubscription=function(){m.$state.go("subscriptionUserBased")},m.search=function(){m.isLoading=!0,m.filterSubscription.reset(),""==m.model.Status&&(m.model.Status=null);""==m.model.Id&&(m.model.Id=null);m.filterSubscription.eq("CompanyId",m.model.Id).eq("Status",m.model.Status),""==m.model.Type?m.filterSubscription.eq("Status",m.model.Status).eq("CompanyId",m.model.Id):"Transaction"==m.model.Type?(m.filterSubscription.reset(),m.filterSubscription.eq("Status",m.model.Status).eq("CompanyId",m.model.Id).eq("Type","Transaction")):"User"==m.model.Type&&(m.filterSubscription.reset(),m.filterSubscription.eq("Status",m.model.Status).eq("CompanyId",m.model.Id).eq("Type","User"));setTimeout(function(){m.isLoading=!1,t.$apply()},1e3)};var u=a.url().split("/")[2];m.model={},m.isLoading=!0;var d=r.getValue("authorizationData").userRoles.split(",");m.isAdmin=!1,m.isFC=!1,m.showAdmin=!1,m.showTransAdmin=!1,"true"==u&&(s.success({message:"Subscription successfully created."}),r.removeValue("tmpData"));for(var p=0;p<d.length;p++)"FieldConnect"==d[p]?m.isFC=!0:(d[p],m.isAdmin=!0);for(p=0;p<d.length;p++)"Admin"==d[p]&&(m.showAdmin=!0),"TransAdmin"==d[p]&&(m.showTransAdmin=!0);m.filterSubscription=n.filter("and"),m.isFC||e.getItem("companyinfos/getCurrentCompany").then(function(){m.model.Id=e.state.item.Id,t.$watch("vm.model.CompanyName",function(){m.model.CompanyName=e.state.item.CompanyName},!0)}),m.statusIds=[];var c={Type:"multiselect",Label:"Company:",ApiMethod:"companyinfos/forSubscriptionSort",ValueProp:"Id",TextProp:"CompanyName",ModelValue:"Id",ConvertToInt:"true"},S={Name:"Plan",ValueName:"Plan",Edit:!0,Sortable:!0};m.attributesFilter=[c,{Type:"multiselect",Label:"Status:",ValueProp:"Status",TextProp:"Status",ModelValue:"Status",List:[{Status:"Active"},{Status:"Inactive"},{Status:"Pending"}]},{Type:"multiselect",Label:"SubscriptionType:",ValueProp:"Type",TextProp:"Type",ModelValue:"Type",List:[{Type:"Transaction"},{Type:"User"}]}],m.attributes=[{Name:"Company Name",ValueName:"CompanyName",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"Type",Edit:!1,Sortable:!0},S,{Name:"User Count",ValueName:"UserCount",Edit:!1,Sortable:!0},{Name:"Start Date",CellFormat:"template",FormatDate:"date",Edit:!1,Sortable:!0,CellFormatData:{TemplateUrl:"setDate.html"}},{Name:"End Date",ValueName:"EndDate",FormatDate:"date",Edit:!1,Sortable:!0},{Name:"Transactions",ValueName:"TransactionNumber",Edit:!1,Sortable:!0},{Name:"Available Transactions",ValueName:"AvailableTransactions",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0}],m.isFC?(m.attributesFilter[0]=c,m.attributes[2]=S):(m.attributesFilter[0]={Type:"text",Label:"Company Name",ReadOnly:!0,ModelValue:"CompanyName"},m.attributes[2]={Name:"Plan",ValueName:"Plan",Edit:!0,Sortable:!0});var y=['<span ng-if="item.Type == \'Transaction\'">{{item.SysCreateUTC | date:"MM/dd/yyyy"}}</span>','<span ng-if="item.Type == \'User\'">{{item.StartDate | date:"MM/dd/yyyy"}}</span>'].join("");l.put("setDate.html",y),m.loadingIndicator=!1,setTimeout(function(){m.isLoading=!1,t.$apply()},1e3)}angular.module("FieldConnectApp").controller("SubscriptionController",e),e.$inject=["restService","$scope","$location","$state","$stateParams","Notification","qsService","cryptoStorageService","$templateCache"]}();;!function(){"use strict";function e(e,t,a,n,l,o,i,d){var s=this;s.$state=n,s.goHome=function(){s.$state.go("home")},s.goBack=function(){s.$state.go("subscriptionPlan")},s.$stateParams=l,s.model={},s.id=s.$stateParams.id;for(var r=!1,u=d.getValue("authorizationData").userRoles.split(","),y=0;y<u.length;y++)"FieldConnect"==u[y]&&(r=!0);var p={Type:"text",Label:"Transaction",ReadOnly:!0,ModelValue:"Transaction"},c={Type:"empty",Label:"Start Date",ReadOnly:!0,ModelValue:"StartDate",Format:"MM/dd/yyyy",SubType:"date"},m={Type:"empty",Label:"End Date",ReadOnly:!0,ModelValue:"EndDate",Format:"MM/dd/yyyy",SubType:"date"},T={Type:"dropdown",Label:"Status",Required:!0,ValueProp:"Status",TextProp:"Status",ModelValue:"Status",List:[{Status:"Active"},{Status:"Inactive"},{Status:"Pending"}],ReadOnly:!1};s.attributes=[{Type:"text",Label:"Company Name",ReadOnly:!0,ModelValue:"CompanyName"},T,{Type:"text",Label:"Plan",ReadOnly:!0,ModelValue:"Plan"},{Type:"text",Label:"Type",ReadOnly:!0,ModelValue:"Type"},p,{Type:"currency",Label:"Price",ReadOnly:!0,ModelValue:"Price"},c,m],r||(T.ReadOnly=!0),t.$watch("vm.model",function(){void 0!==s.model.SubscriptionPlanId&&null!==s.model.SubscriptionPlanId&&e.getItem("subscriptionplans",s.model.SubscriptionPlanId).then(function(t){s.sub=e.state.item,s.model.Transaction=s.sub.Transactions,s.model.Plan=s.sub.Plan,s.model.Type=s.sub.Type,"Transaction"==s.model.Type?(p.Label="Transaction",p.ModelValue="Transaction",c.Type="empty",m.Type="empty"):"User"==s.model.Type&&(p.Label="User Count",p.ModelValue="UserCount",c.Type="datepicker",m.Type="datepicker")})},!0)}angular.module("FieldConnectApp").controller("SubscriptionEditController",e),e.$inject=["restService","$scope","$location","$state","$stateParams","Notification","qsService","cryptoStorageService"]}();;!function(){"use strict";function t(t,o,a,n,e,i,r,c,s,l,p,u){this.$state=n;var d=l.getValue("authorizationData"),h=l.getValue("tmpData");d?h&&"UserUpdate"==h.type?(a.path("subscriptionUserBased/"),s(function(){c.location.reload()})):h&&"TransactionUpdate"==h.type?(a.path("subscriptionTransactionBased/"),s(function(){c.location.reload()})):(a.path("login/"),s(function(){c.location.reload()})):h&&"User"==h.type?(a.path("newSubscriptionUserBased/"),s(function(){c.location.reload()})):h&&"Transaction"==h.type?(a.path("newSubscriptionTransactionBased/"),s(function(){c.location.reload()})):(a.path("login/"),s(function(){c.location.reload()}))}angular.module("FieldConnectApp").controller("SubscriptionErrorController",t),t.$inject=["restService","$scope","$location","$state","$stateParams","Notification","qsService","$window","$timeout","cryptoStorageService","$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t,a,o){var r=this;function n(t){e.onBack&&!e.onBack(t)||(r.modalClass=!1,e.close(null,200))}function i(){Quagga.init({inputStream:{name:"Live",type:"LiveStream",target:document.querySelector(r.targetElement),constraints:{facingMode:"environment"}},locator:{patchSize:"medium",halfSample:!1},numOfWorkers:1,frequency:10,decoder:{readers:[{format:"ean_reader",config:{supplements:["ean_5_reader","ean_2_reader"]}},{format:"ean_reader",config:{}}]},locate:!0},function(e){e?console.log(e):Quagga.start()}),Quagga.onProcessed(function(e){var t=Quagga.canvas.ctx.overlay,a=Quagga.canvas.dom.overlay;e&&(e.boxes&&(t.clearRect(0,0,parseInt(a.getAttribute("width")),parseInt(a.getAttribute("height"))),e.boxes.filter(function(t){return t!==e.box}).forEach(function(e){Quagga.ImageDebug.drawPath(e,{x:0,y:1},t,{color:"green",lineWidth:2})})),e.box&&Quagga.ImageDebug.drawPath(e.box,{x:0,y:1},t,{color:"#00F",lineWidth:2}),e.codeResult&&e.codeResult.code&&Quagga.ImageDebug.drawPath(e.line,{x:"x",y:"y"},t,{color:"red",lineWidth:3}))}),Quagga.onDetected(function(e){r.barcode=e.codeResult.code,Quagga.stop(),n()})}r.$scope=e,r.attributes=e.attributes,r.id=e.id,r.apiMethod=e.apiMethod,r.timezone=e.timezone,r.customFocus=e.customFocus,r.viewName=e.viewName,r.moduleName=e.moduleName,r.filter=e.filter,r.modalClass=!1,r.model={},r.barcodeModalTimeout=500,r.targetElement="#interactive.viewport-desktop",r.isMobile=a.onMobile(),o.getItem("settings/status?type=BarcodeScanUseCamera").then(function(e){r.modalClass=!0,null==e.data.Value?r.useCamera=!0:r.useCamera="true"===e.data.Value,r.useCamera?t(function(){r.modalClass=!0,i()}):o.getItem("settings/status?type=BarcodeScanModalTimeout").then(function(e){e.data.Value>0&&(r.barcodeModalTimeout=1e3*e.data.Value)})}),r.attributes=[{Type:"text",Label:"Barcode:",Required:!0,MaxLength:"50",ModelValue:"BarCode",Autofocus:"true"}],r.isMobile&&(r.targetElement="#interactive.viewport-mobile"),e.$watch("vm.model.BarCode",function(){void 0==r.model.BarCode&&null==r.model.BarCode||t(function(){r.barcode=r.model.BarCode,n()},r.barcodeModalTimeout)}),r.hideSubmit=!1,e.hideSubmit&&(r.hideSubmit=e.hideSubmit),r.onBack=n,r.startScan=i}angular.module("FieldConnectApp").controller("BarcodeScanController",e),e.$inject=["$scope","$timeout","mobileDetectService","restService"]}();;!function(){"use strict";function e(e,t){var i=this;i.$scope=e,i.attributes=e.attributes,i.id=e.id,i.apiMethod=e.apiMethod,i.timezone=e.timezone,i.customFocus=e.customFocus,i.viewName=e.viewName,i.moduleName=e.moduleName,i.filter=e.filter,i.modalClass=!1,t(function(){i.modalClass=!0}),i.hideSubmit=!1,e.hideSubmit&&(i.hideSubmit=e.hideSubmit),i.onBack=function(t){if(e.onBack&&!e.onBack(t))return;i.modalClass=!1,e.close(null,200)}}angular.module("FieldConnectApp").controller("PopupEditController",e),e.$inject=["$scope","$timeout"]}();;!function(){"use strict";function e(e,t,a){var o=this;o.isLoading=!0,o.goHome=function(){a.go("home")},o.edit=function(e){a.go("vendorEdit",{id:e})},o.attributes=[{Name:"Id",ValueName:"AltId",Edit:!1,Sortable:!0},{Name:"Vendor  Name",ValueName:"VendorName",Edit:!0,Sortable:!0},{Name:"Note",ValueName:"Note",Edit:!1,Sortable:!0},{Name:"External Id",ValueName:"ExternalId",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0}],setTimeout(function(){o.isLoading=!1,e.$apply()},1e3)}angular.module("FieldConnectApp").controller("VendorController",e),e.$inject=["$scope","$location","$state"]}();;!function(){"use strict";function e(e,t,a,o){var l=this;if(l.model={},l.$state=a,l.goBack=function(){a.go("vendors")},l.goHome=function(){a.go("home")},l.attributes=[{Type:"int",Label:"Id",Required:!1,ModelValue:"AltId",ReadOnly:!0},{Type:"textarea",Label:"Note",Required:!1,MaxLength:"1000",ModelValue:"Note"},{Type:"text",Label:"Vendor Name",Required:!0,MaxLength:"50",ModelValue:"VendorName",Autofocus:"true"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"dropdown",Label:"Status",Required:!1,ModelValue:"Status",ValueProp:"Status",TextProp:"Status",List:[{Status:"Active"},{Status:"Inactive"}]},{Type:"text",Label:"External Id",Required:!1,ModelValue:"ExternalId",MaxLength:"50"}],l.id=o.id,!parseInt(o.id))var n=e.$watch("vm.model.Status",function(){l.model&&null===l.model.Status&&(l.model.Status="Active",n())});l.loadingIndicator=!1}angular.module("FieldConnectApp").controller("VendorEditController",e),e.$inject=["$scope","$location","$state","$stateParams"]}();;!function(){"use strict";function e(e,o,t,l,a,r,i,d,n,s,p){var u=this;u.model={},u.modeldropdown={},u.settings={},u.$state=t,u.goBack=function(){window.history.back()},u.submit=function(e){},u.search=w;var c=p.getValue("authorizationData").userRoles.split(",");u.viewFilter=i.filter("and"),u.viewFcFilter=i.filter("and"),u.filter=i.filter("and"),u.filter.eq("Visible",!0),u.isLoadedPrivilege=!0,u.submitText="View has been successfully updated.";for(var m=0;m<c.length;m++)"Admin"==c[m]&&!0;function w(){u.modeldropdown.Id&&u.modeldropdown.RoleId?u.searchBtn=!1:u.searchBtn=!0,u.viewFilter.reset(),u.viewFilter.eq("RoleId",u.modeldropdown.RoleId),u.viewFilter.eq("ViewId",u.modeldropdown.Id),n(function(){e.$apply()})}u.attributesdropdown=[{Type:"dropdown",Label:"View:",ApiMethod:"views",ValueProp:"Id",TextProp:"ViewName",ModelValue:"Id",ConvertToInt:"true",Filter:u.filter},{Type:"dropdown",Label:"Role:",ApiMethod:"roles/rolesforview",ValueProp:"Id",TextProp:"Name",ModelValue:"RoleId",ConvertToInt:"true",Name:"Role",Filter:u.viewFcFilter}],u.attributes=[{Type:"label",Name:"Module Name",ValueName:"Name",Sortable:!0},{Type:"label",Name:"Description",ValueName:"Description",Sortable:!0},{Type:"editable",Name:"Permissions",ValueName:"Name",Value:"PrivilegeId",ValueProp:"Id",TextProp:"PrivilegeName",ConvertToInt:!0,List:"List"}],u.childAttributes=[{Type:"label",Name:"Object Name",ValueName:"Name",Sortable:!1},{Type:"label",Name:"Description",ValueName:"Description",Sortable:!1},{Type:"editable",Name:"Permissions",ValueName:"Name",Value:"PrivilegeId",ValueProp:"Id",TextProp:"PrivilegeName",ConvertToInt:!0,List:"List"}],u.loadingIndicator=!1,u.privilegeChange=!1,u.startFlag=!0,e.$watch("vm.modeldropdown.Id",function(o,t){if(u.modeldropdown.Id&&u.modeldropdown.RoleId?u.searchBtn=!1:u.searchBtn=!0,u.startFlag){$("#enableBtn").length?u.privilegeChange=!0:u.privilegeChange=!1;u.modeldropdown.Id?(u.tmpRoleId=angular.copy(u.modeldropdown.RoleId),u.tmpOld=angular.copy(t),u.privilegeChange?bootbox.confirm("You have unsaved changes. Do you want to discard changes?",function(o){if(o)u.modeldropdown.RoleId=null;else if(u.startFlag)return u.modeldropdown.Id=u.tmpOld,u.startFlag=!1,void n(function(){e.$apply()});w()}):(u.viewFcFilter.reset(),u.modeldropdown.RoleId=null,u.viewFcFilter.eq("ViewId",u.modeldropdown.Id),u.viewFcFilter.eq("WithFc",!1),w())):u.modeldropdown.RoleId=null}else u.startFlag=!0}),e.$watch("vm.modeldropdown.RoleId",function(o,t){if(u.modeldropdown.Id&&u.modeldropdown.RoleId?u.searchBtn=!1:u.searchBtn=!0,u.startFlag){$("#enableBtn").length?u.privilegeChange=!0:u.privilegeChange=!1;if(u.modeldropdown.RoleId){u.privilegeChange&&bootbox.confirm("You have unsaved changes. Do you want to discard changes?",function(o){o?w():u.startFlag&&(u.modeldropdown.RoleId=t,u.startFlag=!1,n(function(){e.$apply()}))}),u.submitText="View has been successfully updated.";for(var l=0;l<u.attributesdropdown[1].CurrentList.length;l++)if(u.attributesdropdown[1].CurrentList[l].Id==u.modeldropdown.RoleId)for(var a=0;a<c.length;a++)if(c[a]==u.attributesdropdown[1].CurrentList[l].Name){u.submitText="View has been successfully updated. The changes will become active on your next login.";break}}}else u.startFlag=!0}),u.searchBtn=!0}angular.module("FieldConnectApp").controller("ViewsController",e),e.$inject=["$scope","$location","$state","$stateParams","restService","Notification","qsService","ModalService","$timeout","$templateCache","cryptoStorageService"]}();;!function(){"use strict";function e(e,t,a,o,s,l,n,d,i,r,m,u,c,p,b,h){var S=this;S.editAssignment=function(t,a,o,l){S.reloadTable=!1,S.filter.siteId=o,S.usingDSLNorthwest&&(S.dslServiceableItemFilter=r.filter("and"),S.dslServiceableItemFilter.reset(),S.dslServiceableItemFilter.eq("SiteId",o),S.attServiceableItem.Filter=S.dslServiceableItemFilter,S.assignmentatt=g);S.isFirstProblemCode=!t;S.model={WoId:parseInt(a)},l&&(S.assignmentatt[0]={Type:"text",Label:"Problem Code:",ModelValue:"ProblemCode",Required:!0,ReadOnly:!0});i.getItems("problemcodes").then(function(){y=i.state.items}),s.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"AssignmentEditController",controllerAs:"vm",inputs:{modalTitle:"Assignment edit",id:t,model:S.model,attributes:S.assignmentatt,apiMethod:"woassignments",filter:S.filter,onBack:S.editData,onSubmit:S.submit,timezone:S.assignmentsTimezone}}).then(function(t){S.assEditPopupScope=t.scope,t.close.then(function(){S.reloadTable=!0,e.$parent.vm.reloadServiceableItemTable()})})},S.editAssignmentSub=function(t,a,o,l){S.filter.siteId=o,S.model={WoId:parseInt(a)},S.isFirstProblemCode=!t;l&&(S.assignmentatt[0]={Type:"text",Label:"Problem Code:",ModelValue:"ProblemCode",Required:!0,ReadOnly:!0});var n=e.$watch("va.model",function(){S.model&&S.model.CompanyId&&(S.filterByMainCompany.reset(),S.filterByMainCompany.eq("CompanyId",S.model.CompanyId),i.getItems("problemcodes/getPCforSub",S.filterByMainCompany).then(function(){y=i.state.items}),n())},!0);s.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Assignment edit",id:t,model:S.model,attributes:S.assignmentsubatt,timezone:S.assignmentsTimezone,apiMethod:"woassignments",filter:S.filter,onSubmit:S.submit,onBack:S.editData}}).then(function(e){S.assEditPopupScope=e.scope,e.close.then(function(){})})},S.editData=N,S.submit=function(){return u.getLocation("WOAssignments").then(function(e){var t=angular.copy(S.model),a=e.coords.latitude,o=e.coords.longitude;if(null!==a&&(t.Latitude=a),null!==o&&(t.Longitude=o),void 0!=t.EstStartDate){var s=new Date(t.EstStartDate);I.tzDatebaseNamee&&(l=moment.tz.zone(I.tzDatebaseNamee).offset(s)),c.convertToUtc(s,l),t.EstStartDate=c.buildISOString(s)}if(void 0!=t.EstEndDate){var l,n=new Date(t.EstEndDate);I.tzDatebaseNamee&&(l=moment.tz.zone(I.tzDatebaseNamee).offset(n)),c.convertToUtc(n,l),t.EstEndDate=c.buildISOString(n)}t.Id?i.update("woassignments/"+t.Id,t).then(function(e){N(e),w(e)}):i.create("woassignments",t).then(function(e){N(e),w(e)}),S.assEditPopupScope&&S.assEditPopupScope.close(null,200)})},S.tmpStatus="",S.techList=L,S.reloadTable=!0,S.id=n.assId,S.assigId=parseInt(S.id),S.goToServisableItem=M,S.editReadOnly=function(){m.warning("Assignment can't be edited because Work Order has been invoiced!")},S.filter={siteId:0},S.deleteEvent=function(){e.$parent.vm.checkTotalCount?e.$parent.vm.checkTotalCount():e.$parent.vd.checkTotalCount&&e.$parent.vd.checkTotalCount();e.$parent.vm.checkCustomerInfoChangeEnabled?e.$parent.vm.checkCustomerInfoChangeEnabled():e.$parent.vd.checkCustomerInfoChangeEnabled&&e.$parent.vd.checkCustomerInfoChangeEnabled()};var E=b.roleTypes;S.isTechnician=E.includes("Technician"),S.usingDSLNorthwest=p.usingDSLNorthwest;var v={Type:"dropdown",Label:"Technician:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"TechId",ConvertToInt:"true",CustomDivClass:"col-sm-4",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-5 custom-input-assignment"},T={Type:"button",Label:"Filter Tech",onClick:L,CustomDivClass:"col-sm-3 custom-button-assignment"},C={Type:"text",Label:"Technician:",MaxLength:"50",ModelValue:"FullName",ReadOnly:!0},D={Type:"button",Label:"Filter Tech",onClick:L,CustomDivClass:"hidden"};S.attProblemCode={Type:"dropdown",Label:"Problem Code:",ApiMethod:"problemcodes",ValueProp:"ProblemCodeName",TextProp:"ProblemCodeName",ModelValue:"ProblemCode",Required:!0,Autofocus:"true"},S.attScheduledStartDate={Type:"datepicker",Label:"Scheduled Start Date/Time:",ModelValue:"EstStartDate",Format:"MM/dd/yyyy"},S.attDescription={Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc",Required:!0},S.attScheduledEndDate={Type:"datepicker",Label:"Scheduled End Date/Time:",ModelValue:"EstEndDate",Format:"MM/dd/yyyy"},S.attServiceableItem={Type:"dropdown",Label:"Serviceable Item:",ApiMethod:"serviceableitems/dropdownbysite",Filter:S.filter,ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",ConvertToInt:"true",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo"},S.attServiceableItemLink={Type:"link",onClick:M,ICustomInputClass:"fa fa-external-link ViewLink"},S.attEstimatedHours={Type:"decimal",Label:"Estimated Hours:",MaxLength:"50",ModelValue:"EstHours",Required:!1},S.attCause={Type:"dropdown",Label:"Cause:",ApiMethod:"causes",ValueProp:"CauseName",TextProp:"CauseName",ModelValue:"Cause"},S.attResolution={Type:"dropdown",Label:"Resolution:",ApiMethod:"resolutions",ValueProp:"ResolutionName",TextProp:"ResolutionName",ModelValue:"Resolution"},S.attStatus={Type:"dropdown",Label:"Status:",ApiMethod:"assignmentstatuses/ddList",ValueProp:"AssignmentStatusName",TextProp:"AssignmentStatusName",ModelValue:"Status",Required:!0},S.attNote={Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note",ReadOnly:!1},S.attEmpty={Type:"empty"},S.attGraphObjectId={Type:"hidden",ModelValue:"GraphObjectId"},S.attGraphOwnerId={Type:"hidden",ModelValue:"GraphOwnerId"},S.attEventSynchronized={Type:"hidden",ModelValue:"EventSynchronized"},S.attDSLFailureResolution={Type:"dropdown",Label:"Reason for Failed Install:",ApiMethod:"dslFailureResolution/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"User8",ConvertToInt:"true",TabIndex:41},S.attDSLGroundCheck={Type:"checkbox",Label:"Ground Check",Required:!1,ModelValue:"User4"},S.attDSLServiceableItem={Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!1,Sortable:!0},S.attEmpty={Type:"empty"};var f=[S.attProblemCode,S.attScheduledStartDate,S.attDescription,S.attScheduledEndDate,S.attServiceableItem,S.attServiceableItemLink,S.attEstimatedHours,S.attCause,v,T,S.attResolution,S.attStatus,S.attNote,S.attEmpty,S.attGraphObjectId,S.attGraphOwnerId,S.attEventSynchronized];if(S.usingDSLNorthwest){S.attDSLFailureResolution={Type:"dropdown",Label:"Reason for Failed Install:",ApiMethod:"dslFailureResolution/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"User8",ConvertToInt:"true",TabIndex:41},S.attDSLGroundCheck={Type:"checkbox",Label:"Ground Check",Required:!1,ModelValue:"User4"},S.attDSLServiceableItem={Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!1,Sortable:!0},S.attEmpty={Type:"empty"},S.attServiceableItem.ApiMethod="serviceableitems/dsldropdownbysite",S.attServiceableItem.TextProp="DDLabel",S.attDSLServiceableItem.ValueName="DSLServiceableItemName",S.attServiceableItem.Required=S.isTechnician;var g=[S.attProblemCode,S.attScheduledStartDate,S.attDescription,S.attScheduledEndDate,S.attServiceableItem,S.attServiceableItemLink,S.attEstimatedHours,S.attCause,v,T,S.attResolution,S.attStatus,S.attNote,S.attDSLFailureResolution,S.attEmpty,S.attDSLGroundCheck,S.attGraphObjectId,S.attGraphOwnerId,S.attEventSynchronized];S.assignmentatt=g,S.usingDSLNorthwest=!0}else S.assignmentatt=f;S.attributes=[{Name:"Problem Code",ValueName:"ProblemCode",Edit:!e.$parent.vm.customerEdit,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},S.attDSLServiceableItem,{Name:"Technician",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Scheduled Start Date/Time",ValueName:"EstStartDate",FormatDate:"datetime",Edit:!1,Sortable:!0},{Name:"Estimated End Date/Time",ValueName:"EstEndDate",FormatDate:"datetime",Edit:!1,Sortable:!0,HideRoles:["CustAdmin","CustUser"]},{Name:"Site Time Zone",ValueName:"TimeZoneName",Edit:!1,Sortable:!0,HideRoles:["CustAdmin","CustUser"]},{Name:"Estimated Hours",ValueName:"EstHours",Edit:!1,Sortable:!0,HideRoles:["CustAdmin","CustUser"]}],S.filterByMainCompany=r.filter("and"),S.assignmentsubatt=[{Type:"dropdown",Label:"Problem Code:",ApiMethod:"problemcodes/getPCforSub",ValueProp:"ProblemCodeName",TextProp:"ProblemCodeName",ModelValue:"ProblemCode",Filter:S.filterByMainCompany,Required:!0,Autofocus:"true"},{Type:"datepicker",Label:"Scheduled Start Date/Time:",ModelValue:"EstStartDate",Format:"MM/dd/yyyy"},{Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc",Required:!0},{Type:"datepicker",Label:"Scheduled End Date/Time:",ModelValue:"EstEndDate",Format:"MM/dd/yyyy"},{Type:"dropdown",Label:"Serviceable Item:",ApiMethod:"serviceableitems/dropdownbysite",Filter:S.filter,ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",ConvertToInt:"true"},{Type:"decimal",Label:"Estimated Hours:",MaxLength:"50",ModelValue:"EstHours",Required:!1,Step:"0.25"},{Type:"dropdown",Label:"Technician:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"TechId",ConvertToInt:"true",CustomDivClass:"col-sm-4",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-5 custom-input-assignment"},{Type:"button",Label:"Filter Tech",onClick:L,CustomDivClass:"col-sm-3 custom-button-assignment"},{Type:"dropdown",Label:"Cause:",ApiMethod:"causes/getCausesForSub",ValueProp:"CauseName",TextProp:"CauseName",ModelValue:"Cause",Filter:S.filterByMainCompany},{Type:"text",Label:"Site Time Zone:",ModelValue:"TimeZoneName",ReadOnly:!0},{Type:"dropdown",Label:"Resolution:",ApiMethod:"resolutions/getResForSub",ValueProp:"ResolutionName",TextProp:"ResolutionName",ModelValue:"Resolution",Filter:S.filterByMainCompany},{Type:"dropdown",Label:"Status:",ApiMethod:"assignmentstatuses/ddList",ValueProp:"AssignmentStatusName",TextProp:"AssignmentStatusName",ModelValue:"Status",Required:!0},{Type:"empty"},{Type:"hidden",ModelValue:"GraphObjectId"},{Type:"hidden",ModelValue:"GraphOwnerId"},{Type:"hidden",ModelValue:"EventSynchronized"}];var I=t.getValue("authorizationData");S.model={};var y=[];function M(){if(null==S.model.ServiceableItemId)m.warning({message:"First you must select serviceable item"});else{for(var e=t.getValue("authorizationData").userRoles.split(","),a=!1,s=!1,l=!1,n=0;n<e.length;n++)"Admin"==e[n]||"Office"==e[n]||"TransAdmin"==e?a=!0:"FieldConnect"==e[n]&&(s=!0);if(!a&&!s)for(n=0;n<e.length;n++)if("Supervisor"==e[n]){l=!0;break}S.assEditPopupScope&&S.assEditPopupScope.close(null,200),i.getItem("wo",S.model.WoId).then(function(){var e=i.state.item;l?o.go("serviceableItemsReadOnly",{customerId:e.CustomerId,id:S.model.ServiceableItemId}):o.go("serviceableItemsEdit",{customerId:e.CustomerId,id:S.model.ServiceableItemId})})}}function N(t){return void 0!=t&&(!function(t){if(void 0!=t){var a=r.filter("and");a.eq("Woid",t),i.getItems("woassignments",a).then(function(){for(var t=i.state.items,a=0,o=0;o<t.length;o++)"Complete"==t[o].Status&&(a+=1);if(1==e.$parent.vm.allAssignmentsCompleted){for(var o=0;o<t.length;o++)if("Complete"!=t[o].Status){e.$parent.vm.allAssignmentsCompleted=!1;break}}else a==t.length&&(e.$parent.vm.allAssignmentsCompleted=!0)})}}(t.data.WoId),S.reloadTable=!1,e.$emit("wo.assignmentChange"),l(function(){S.reloadTable=!0,"object"==typeof t&&201===t.status&&(e.$parent.vm.checkCustomerInfoChangeEnabled?e.$parent.vm.checkCustomerInfoChangeEnabled(!0):e.$parent.vd.checkCustomerInfoChangeEnabled&&e.$parent.vd.checkCustomerInfoChangeEnabled(!0)),e.$parent.vm.checkTotalCount?e.$parent.vm.checkTotalCount():e.$parent.vd.checkTotalCount&&e.$parent.vd.checkTotalCount()})),!0}function L(){s.showModal({templateUrl:"Templates/Dispatch/DispatchScheduling/techpopup.html",controller:"PopupTechController",controllerAs:"vm",inputs:{modalTitle:"Tech List",startDateTime:S.model.EstStartDate,endDateTime:S.model.EstEndDate,attributes:S.attech,timezone:S.assignmentsTimezone,apiMethod:"woassignments",model:S.model}}).then(function(e){e.close.then(function(){S.reloadTable=!1,l(function(){S.reloadTable=!0})})})}function w(e){if(e&&e.data&&(S.model.EventSynchronized=e.data.EventSynchronized,S.model.GraphOwnerId=e.data.GraphOwnerId,S.model.GraphObjectId=e.data.GraphObjectId,e.data.ActionResults))for(var t=0;t<e.data.ActionResults.length;t++)-1==e.data.ActionResults[t].Result?m.error({message:e.data.ActionResults[t].Message}):0==e.data.ActionResults[t].Result?m.warning({message:e.data.ActionResults[t].Message}):1==e.data.ActionResults[t].Result&&m.success({message:e.data.ActionResults[t].Message})}i.getItem("settings/status?type=AssignmentStatus").then(function(){S.companyAssignmentStatus=i.state.item,S.tmpStatus=S.companyAssignmentStatus.Value}),e.$watch("va.model.WoId",function(){S.model.WoId&&i.getItem("wo",S.model.WoId).then(function(){S.item=i.state.item,S.item.SubContractorId?(S.assignmentatt[8]=C,S.assignmentatt[9]=D):(S.assignmentatt[8]=v,S.assignmentatt[9]=T)})}),e.$watch("va.model.EstStartDate",function(){if(null!=S.model.EstStartDate||void 0!=S.model.EstStartDate){if(null!=S.model.EstHours){var e=new Date(S.model.EstStartDate),t=Math.floor(S.model.EstHours),a=Math.round(100*(S.model.EstHours-t)),o=t,s=Math.round(60*a/100);e.setMinutes(e.getMinutes()+s),e.setHours(e.getHours()+o),S.model.EstEndDate=e}else if(null!=S.model.EstEndDate){if(S.model.EstEndDate<S.model.EstStartDate)return S.model.EstEndDate=S.model.EstStartDate,void m.error("The scheduled start can’t be after scheduled end!");var l=moment(S.model.EstStartDate).format(),n=moment(S.model.EstEndDate).format();o=moment.duration(moment(n).diff(l)).asHours();S.model.EstHours=o}}else S.model.EstEndDate=null},!0),e.$watch("va.model.EstEndDate",function(e,t){if(null!=S.model.EstEndDate||void 0!=S.model.EstEndDate){if(null!=S.model.EstStartDate){if(100*Math.round(S.model.EstEndDate/1e5)!=100*Math.round(S.model.EstStartDate/1e5)&&S.model.EstEndDate<S.model.EstStartDate&&(S.model.EstEndDate<t||null===t))return S.model.EstEndDate=t,void m.error("The scheduled start can’t be after scheduled end!");var a=moment(S.model.EstStartDate),o=moment(S.model.EstEndDate),s=moment.duration(o.diff(a)).asHours();S.model.EstHours=s}else if(null!=S.model.EstHours){var l=new Date(S.model.EstEndDate),n=Math.floor(S.model.EstHours),d=Math.round(100*(S.model.EstHours-n)),i=(s=n,Math.round(60*d/100));l.setMinutes(l.getMinutes()-i),l.setHours(l.getHours()-s),S.model.EstStartDate=l}}else S.model.EstStartDate=null},!0),e.$watch("va.model.EstHours",function(){if(null!=S.model.EstHours||void 0!=S.model.EstHours)if(null!=S.model.EstStartDate){var e=new Date(S.model.EstStartDate),t=Math.floor(S.model.EstHours),a=Math.round(100*(S.model.EstHours-t)),o=t,s=Math.round(60*a/100);e.setMinutes(e.getMinutes()+s),e.setHours(e.getHours()+o),S.model.EstEndDate=e}else if(null!=S.model.EstEndDate){var l=new Date(S.model.EstEndDate);t=Math.floor(S.model.EstHours),a=Math.round(100*(S.model.EstHours-t)),o=t,s=Math.round(60*a/100);l.setMinutes(l.getMinutes()-s),l.setHours(l.getHours()-o),S.model.EstStartDate=l}},!0),e.$watch("va.model.ProblemCode",function(){if(void 0!=S.model.ProblemCode)if(S.isFirstProblemCode){for(var e=0;e<y.length;e++)if(y[e].ProblemCodeName==S.model.ProblemCode){S.model.EstHours=y[e].DefaultHours,S.model.Desc=y[e].Decs;break}}else S.isFirstProblemCode=!0;else S.model.EstHours=null,S.model.Desc=null}),e.$watch("va.model.Status",function(e,t){void 0==S.model.Status&&S.tmpStatus&&(S.model.Status=S.tmpStatus)}),e.$watch("va.model.TimeZoneName",function(){e.$parent.vd&&void 0==S.model.TimeZoneName&&e.$parent.vd.model.TimeZoneName&&(S.model.TimeZoneName=I.tzDatebaseName,S.model.TzDatabaseName=I.tzDatebaseName),void 0==S.model.TimeZoneName&&e.$parent.vm.model.TimeZoneName&&(S.model.TimeZoneName=I.tzDatebaseName,S.model.TzDatabaseName=I.tzDatebaseName)}),S.assignmentsTimezone={TzDatabaseName:"%TzDatabaseName%"}}angular.module("FieldConnectApp").controller("AssingmentController",e),e.$inject=["$scope","cryptoStorageService","$location","$state","ModalService","$timeout","$stateParams","stateTransitionService","restService","qsService","Notification","fcGeoLocationService","timezoneService","featuresFactory","rolesFactory","xoiService"]}();;!function(){"use strict";function e(e,t,i,a){var n=this;n.$scope=e,n.attributes=e.attributes,n.id=e.id,n.apiMethod=e.apiMethod,n.timezone=e.timezone,n.customFocus=e.customFocus,n.viewName=e.viewName,n.moduleName=e.moduleName,n.filter=e.filter,n.modalClass=!1,t(function(){n.modalClass=!0}),n.hideSubmit=!1,e.hideSubmit&&(n.hideSubmit=e.hideSubmit),n.onBack=function(t){if(e.onBack&&!e.onBack(t))return;n.modalClass=!1,e.close(null,200)},e.$watch("id",function(e,s){void 0!==e?i.checkInProgressLabor(n.id).then(function(e){e?t(function(){a.warning({message:"Assignment status or assigned technician cannot be changed while timer is in progress!"}),n.setFieldsForTrackRealtime(e)}):n.setFieldsForTrackRealtime(!1)}):t(function(){n.setFieldsForTrackRealtime(!1)})}),n.setFieldsForTrackRealtime=function(e){for(var t=0;t<n.attributes.length;t++)"Status:"===n.attributes[t].Label&&(n.attributes[t].ReadOnly=e),"Technician:"===n.attributes[t].Label&&(n.attributes[t].ReadOnly=e),"Filter Tech"===n.attributes[t].Label&&(n.attributes[t].ReadOnly=e)}}angular.module("FieldConnectApp").controller("AssignmentEditController",e),e.$inject=["$scope","$timeout","trackRealTimeService","Notification"]}();;!function(){"use strict";function e(e,o,n){var t=this;function l(){e.create("woassignments/email",t.model).then(function(e){s()})}function s(){t.modalClass=!1,o.close(null,200)}t.$scope=o,t.model={},t.ok=l,t.model.WoId=o.model.WoId,t.model.AssignmentId=o.model.Id,e.getItem("users/sendcreatoremail",o.model.SysCreatorId).then(function(){t.model.Email=e.state.item.Email}),t.modalClass=!1,n(function(){t.modalClass=!0}),t.ok=l,t.onBack=s}angular.module("FieldConnectApp").controller("AssignmentSendEmailController",e),e.$inject=["restService","$scope","$timeout"]}();;!function(){"use strict";function e(e,t,a,i,s){var n=this;function r(e){var t=new Date(e);return s.convertToUtc(t),s.buildISOString(t)}n.$scope=e,n.attributes=e.attributes,n.id=e.id,n.apiMethod=e.apiMethod,n.search=function(){""!==n.filter.startDateTime&&(n.filter.startDateTime=r(n.filter.startDateTime));""!==n.filter.endDateTime&&(n.filter.endDateTime=r(n.filter.endDateTime));a.getItems("employees/getTechnicianForAssignment",n.filter).then(function(){n.techNames.splice(0,n.techNames.length);for(var e=0;e!=a.state.items.length;e++)n.techNames.push(a.state.items[e]);n.techNames.sort(i.sortArray("FullName"))})},n.filter={groupId:0,skillId:0,officeId:0,startDateTime:e.startDateTime?new Date(e.startDateTime).toISOString():"",endDateTime:e.endDateTime?new Date(e.endDateTime).toISOString():"",onlyAvailable:!1,tech:0,techNameId:0},n.modalClass=!1,t(function(){n.modalClass=!0}),n.onBack=function(){n.modalClass=!1,e.close(null,200)},n.ok=function(){n.modalClass=!1,e.model.TechId=n.techId,e.model.AssignmentTechId=n.techId,e.close(null,200)},n.groups=[],n.skills=[],n.techNames=[],n.techId=0,a.getItems("employees/getTechnician").then(function(){n.techNames.splice(0,n.techNames.length);for(var e=0;e!=a.state.items.length;e++)n.techNames.push(a.state.items[e]);n.techNames.sort(i.sortArray("FullName"))})}angular.module("FieldConnectApp").controller("PopupTechController",e),e.$inject=["$scope","$timeout","restService","sortArrayObjectsByAttrService","timezoneService"]}();;!function(){"use strict";function e(e,t,a,o,l,m,i,n){var r=this;r.reloadTable=!0,r.editWoAttachment=function(e,t){var a={WoId:parseInt(t)};o.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Work Order Attachment edit",id:e,model:a,attributes:r.attributesWoattEdit,apiMethod:"woattachments",onBack:r.editData,moduleName:r.moduleName,viewName:r.viewName}}).then(function(e){e.close.then(function(){})})},r.editSiteAttachment=function(e,t){var a={SiteId:t};o.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Site Attachment edit",id:e,model:a,attributes:r.attributesSiattEdit,apiMethod:"siteattachments",moduleName:r.moduleName,viewName:r.viewName}}).then(function(e){e.close.then(function(){r.reloadTable=!1,l(function(){r.reloadTable=!0})})})},r.editData=function(t){t&&(r.reloadTable=!1,l(function(){r.reloadTable=!0,"object"==typeof t&&e.$parent.vm.checkCustomerInfoChangeEnabled&&e.$parent.vm.checkCustomerInfoChangeEnabled(!0)}));return!0},r.moduleName="Attachments",r.viewName=e.vm.viewName,r.filterTab="Work Order Attachments",r.attributesWoatt=[{Name:"Date",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0},{Name:"Attached To",ValueName:"AttachedTo",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0}],r.attributesSiatt=[{Name:"Date",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0},{Name:"Attached To",ValueName:"AttachedTo",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0}],r.attributesWoattEdit=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType",Filter:i.filter("and").eq("attachmentCategory","WO")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description:",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"woattachments/file",Required:!0}],r.attributesSiattEdit=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType",Filter:i.filter("and").eq("attachmentCategory","WO")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description:",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"siteattachments/file",Required:!0}],r.attributesQuoteatt=[{Name:"Date",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0},{Name:"Attached To",ValueName:"AttachedTo",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0}],r.attributesServiceRequestAtt=[{Name:"Date",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Type",ValueName:"AttachmentTypeName",Edit:!1,Sortable:!0},{Name:"Attached To",ValueName:"AttachedTo",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0}],r.deleteEvent=function(){e.$parent.vm.checkCustomerInfoChangeEnabled&&e.$parent.vm.checkCustomerInfoChangeEnabled()},n.$on("addPORequest",function(e){r.reloadTable=!1,l(function(){r.reloadTable=!0})})}angular.module("FieldConnectApp").controller("WoAttachmentController",e),e.$inject=["$scope","$location","$state","ModalService","$timeout","guiPrivilegeService","qsService","$rootScope"]}();;!function(){"use strict";function e(e,t,a,i,o,l,n,m,r,u,d,s,c,g){var b=this;b.auth=s.getValue("authorization",!0),b.$state=a,b.myAssigmentId=m.id,b.email=h,b.UsertName="",b.UserData={},b.AltId="",b.DPDDocumentName="",b.getAltId=function(){n.getItem("wo",b.myAssigmentId).then(function(e){b.item=e.data,b.AltId=b.item.AltId})},b.Date="",b.getAltId(),b.deleteEvent=function(){e.$parent.vm.checkCustomerInfoChangeEnabled&&e.$parent.vm.checkCustomerInfoChangeEnabled()},b.gui=d,b.viewName=e.vm.viewName,b.moduleName="Forms";var p={EventType:"DELETE",RecordId:0};b.viewName&&b.moduleName&&(b.modulePrivilege=b.gui.getModulePrivilege(b.viewName,b.moduleName));var D={Name:"Action",CellFormat:"template",CustomHeaderClass:"form-action",CustomCellClass:"form-action-cell",CellFormatData:{TemplateUrl:"openEditView.html",onOpen:v,onEdit:N,onComplete:F,onReopen:E,onView:P,onEmail:h,disabled:{}}},f={Name:"Action",CellFormat:"template",CustomHeaderClass:"form-action",CustomCellClass:"form-action-cell",CellFormatData:{TemplateUrl:"openEditViewForSite.html",onOpen:v,onEdit:N,onComplete:F,onReopen:E,onView:P,onEmail:h,disabled:{}}};b.Date=moment().subtract(10,"days").calendar()+" "+moment().format("LT"),b.attributes=[{Name:"Name",ValueName:"Name",Sortable:!0},{Name:"Created By",ValueName:"CreatedBy",Sortable:!0},{Name:"Create Date",ValueName:"CreateDate",FormatDate:"date",Sortable:!0},{Name:"Status",ValueName:"Status",Sortable:!0},D],b.siteAttributes=[{Name:"Serviceable Item Name",ValueName:"ServiceableItemName",Sortable:!0},{Name:"Name",ValueName:"Name",Sortable:!0},{Name:"Created By",ValueName:"CreatedBy",Sortable:!0},{Name:"Create Date",ValueName:"CreateDate",FormatDate:"date",Sortable:!0},{Name:"Status",ValueName:"Status",Sortable:!0},f],a.is("workOrdersDetailsReadOnly")&&(b.attributes.splice(4,1),b.attributes.splice(5,1));var I=0;u.getCurrentUserEmployeeData().then(function(e){e&&(I=e.Id)}),u.getCurrentUserData().then(function(e){b.UserData=e,b.UserName=b.UserData.FirstName+" "+b.UserData.LastName});var C=[b.gui.getVisibility(b.modulePrivilege,"Create")?'<button class="btn btn-default" ng-class="{disabled: attr.CellFormatData.disabled[item.DPSTemplateId + \'_\' + itemIndex]}"  ng-click="attr.CellFormatData.onOpen(item, attr, itemIndex)" ng-if="item.Status == \'New\'">Open</button>':"",b.gui.getVisibility(b.modulePrivilege,"Update")?'<button class="btn btn-default" ng-click="attr.CellFormatData.onEdit(item)" ng-if="item.Status == \'In Progress\'">Edit</button>':"",'<button class="btn btn-default" ng-click="attr.CellFormatData.onView(item)" ng-if="item.Status == \'Completed\'">View</button>',b.gui.getVisibility(b.modulePrivilege,"Create")?'<button class="btn btn-default" ng-click="attr.CellFormatData.onComplete(item)" ng-if="item.Status == \'In Progress\'">Complete</button>':"",b.gui.getVisibility(b.modulePrivilege,"Create")?'<button class="btn btn-default" ng-click="attr.CellFormatData.onReopen(item)" ng-if="item.Status == \'Completed\'">Reopen</button>':"",b.gui.getVisibility(b.modulePrivilege,"Create")?'<button class="btn btn-default" ng-click="attr.CellFormatData.onEmail(item)" ng-if="item.Status == \'Completed\'">Email</button>':"",b.gui.getVisibility(b.modulePrivilege,"Delete")?'<a class="btn btn-delete" ng-click="vm.remove(item)" style="float:right; line-height: 40px;" data-original-title="Remove" data-toggle="tooltip" ng-if="item.Id && item.Id != 0"><i class="fa fa-times-circle"></i></a>':""].join("");l.put("openEditView.html",C);var S=[b.gui.getVisibility(b.modulePrivilege,"Create")?'<button class="btn btn-default" ng-click="attr.CellFormatData.onOpen(item, attr, itemIndex)" ng-if="item.Status == \'New\'">Open</button>':"",b.gui.getVisibility(b.modulePrivilege,"Update")?'<button class="btn btn-default" ng-click="attr.CellFormatData.onEdit(item)" ng-if="item.Status == \'In Progress\'">Edit</button>':"",'<button class="btn btn-default" ng-click="attr.CellFormatData.onView(item)" ng-if="item.Status == \'Completed\'">View</button>',b.gui.getVisibility(b.modulePrivilege,"Create")?'<button class="btn btn-default" ng-click="attr.CellFormatData.onComplete(item)" ng-if="item.Status == \'In Progress\'">Complete</button>':"",b.gui.getVisibility(b.modulePrivilege,"Create")?'<button class="btn btn-default" ng-click="attr.CellFormatData.onReopen(item)" ng-if="item.Status == \'Completed\'">Reopen</button>':"",b.gui.getVisibility(b.modulePrivilege,"Create")?'<button class="btn btn-default" ng-click="attr.CellFormatData.onEmail(item)" ng-if="item.Status == \'Completed\'">Email</button>':"",b.gui.getVisibility(b.modulePrivilege,"Delete")?'<a class="btn btn-delete" ng-click="vm.remove(item)" style="float:right; line-height: 40px;" data-original-title="Remove" data-toggle="tooltip" ng-if="item.Id && item.Id != 0"><i class="fa fa-times-circle"></i></a>':""].join("");function v(e,t,a){e.ServiceableItemId?t.CellFormatData.disabled[e.ServiceableItemId+"_"+a]=!0:t.CellFormatData.disabled[e.DPSTemplateId+"_"+a]=!0;var l=i.filter("and");l.eq("WoId",b.woId),l.eq("FormTemplateId",e.FormTemplateId),b.myAssigmentId&&l.eq("Id",b.myAssigmentId),b.getAltId(),b.DPDDocumentName=e.Name+"-"+b.AltId+"-"+b.Date+"-"+b.UserName;var n={headers:{Authorization:"Bearer "+b.auth.access_token}};return c.post(e.DPSURL+"/Document/SendToken",n).then(function(t){return p.EventType="UPDATE",p.RecordId=e.Id,p.Note="WoForm update, open form",V(p),o.open(e.DPSURL+"/Document/Edit?&templateID="+e.DPSTemplateId+"&WorkOrderId="+b.woId+"&TechID="+I+"&ServiceableItemId="+e.ServiceableItemId+"&DocumentName="+b.DPDDocumentName,"_blank"),t},function(e,t){return console.log("DPS login failure."),e})}function N(e){p.EventType="UPDATE",p.RecordId=e.Id,p.Note="WoForm update, edit form",V(p),o.open(e.DPSURL+"/Document/Edit/"+e.DPSDocumentId+"?templateID="+e.DPSTemplateId,"_blank")}function P(e){o.open(e.DPSURL+"/Document/Print/"+e.DPSDocumentId+"?templateID="+e.DPSTemplateId+"&printOrientation=Portrait","_blank")}function E(e){p.EventType="UPDATE",p.RecordId=e.Id,p.Note="WoForm update, reopen form",V(p),b.status={Status:"In Progress"},n.update("forms/"+e.Id,b.status).then(function(){e.Status="In Progress"})}function F(e){p.EventType="UPDATE",p.RecordId=e.Id,p.Note="WoForm update, complete form",V(p),b.status={Status:"Completed"},n.update("forms/"+e.Id,b.status).then(function(){e.Status="Completed"})}function h(e){var t={URL:e.DPSURL+"/Document/Print/"+e.DPSDocumentId+"?templateID="+e.DPSTemplateId+"&printOrientation=Portrait",Name:e.Name};r.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/formEmail.html",controller:"WoFormSendEmailController",controllerAs:"vm",inputs:{model:t}}).then(function(e){e.close.then(function(){ctrl.reloadTable=!1,$timeout(function(){ctrl.reloadTable=!0})})})}function V(e){e.TableName="WoForm",e.ParentRecordId=b.WoId,g.getLocation("WoForm").then(function(t){e.Latitude=t.coords.latitude,e.Longitude=t.coords.longitude,n.create("events",e).then(function(){})})}l.put("openEditViewForSite.html",S)}angular.module("FieldConnectApp").controller("WoFormController",e),e.$inject=["$scope","$location","$state","qsService","$window","$templateCache","restService","$stateParams","ModalService","currentUserService","guiPrivilegeService","cryptoStorageService","$http","fcGeoLocationService"]}();;!function(){"use strict";function o(o,e,l){var n=this;function t(){o.create("forms/email",n.model).then(function(o){m()})}function m(){n.modalClass=!1,e.close(null,200)}n.$scope=e,n.model={},n.ok=t,n.model.URL=e.model.URL,n.model.Name=e.model.Name,n.modalClass=!1,l(function(){n.modalClass=!0}),n.ok=t,n.onBack=m}angular.module("FieldConnectApp").controller("WoFormSendEmailController",o),o.$inject=["restService","$scope","$timeout"]}();;!function(){"use strict";function e(e,a,t,o,l,r,d,i,u,n,s,b,m,c,p,y){var L=this;L.isActive=!1;var T=i.getValue("authorizationData").userRoles.split(","),h=!1,R=!1;L.customerRoles=!1;for(var N=p.roleTypes,C=0;C<T.length;C++)if("CustAdmin"!==T[C]&&"Cust"!==T[C]||(L.customerRoles=!0),"Technician"===N[C]||"SubContractor"===T[C]){h=!0;break}var f=["Admin","FieldConnect","TransAdmin","Office","Dispatch"];h&&d.getItem("settings/status?type=AllowTaxOverride").then(function(e){null!=e.data.Value&&"true"==e.data.Value&&f.push("Technician")}),L.focusOut=function(e){e&&e.hasOwnProperty("FocusOut")&&e.FocusOut&&"WorkHours"===e.ModelValue&&(h?L.model.Hours=L.model.WorkHours:(L.model.WorkHours||0==L.model.WorkHours)&&(null!=L.model.Hours&&""!=L.model.Hours||0!=L.model.Hours&&(L.model.Hours=L.model.WorkHours)))},L.isTech=h,L.edit=function(a,t,o,i,n,b){(L=this).id=a,L.model={},A=!0,L.firstTimeEdit=!1,R=!1,void 0!=a&&(R=!0);L.LaborCode={Type:"dropdown",Label:"Labor Code:",Required:!0,ApiMethod:"laborCodes",ValueProp:"LaborCodeName",TextProp:"LaborCodeName",ModelValue:"LaborCodeName",CustomInputClass:"",Name:"LaborCode"},L.usingDSLNorthwest&&(L.customerFilter=u.filter("and"),L.customerFilter.eq("CustomerId",b.customerId),L.LaborCode={Type:"dropdown",Label:"Labor Code:",Required:!0,ApiMethod:"dslLaborCodeByServiceZoneCode/ddList",Filter:L.customerFilter,ValueProp:"LaborCodeName",TextProp:"LaborCodeName",ModelValue:"LaborCodeName",CustomInputClass:"",Name:"LaborCode"});if(e.$watch("vl.model.TechId",function(){L.selectedTechId&&(L.model.TechId=L.selectedTechId)}),!L.usingDSLNorthwest&&L.DefaultLaborCode.Value)var m=e.$watch("vl.LaborCode.CurrentList",function(e,a){e&&!R&&r(function(){L.model.LaborCodeName=L.DefaultLaborCode.Value,m()})});L.subTech;L.filter2={fromDate:null,toDate:null,search:"",status:""},e.$watch("vl.isActive",function(){1==L.isActive&&L.activeId==a?(L.LaborCode.ReadOnly=!0,L.usingDSLNorthwest&&(L.attDSLActionTaken.ReadOnly=!0,L.attDSLFaultAreas.ReadOnly=!0,L.attDSLApplicableCode.ReadOnly=!0,L.attDSLInstalledRemoved.ReadOnly=!0,L.attDSLWhoPays.ReadOnly=!0,L.attDSLIndirectLaborQuantity.ReadOnly=!0,L.attDSLIndirectPartNumber.ReadOnly=!0),L.laborAttributesEdit=[L.LaborCode,{Type:"datepicker",Label:"Date:",ModelValue:"Date",Format:"MM/dd/yyyy",SubType:"date",ReadOnly:!0},{Type:"decimal",Label:"Work Hours:",ModelValue:"WorkHours",ReadOnly:!0,FocusOut:!0,Required:!0},{Type:"decimal",Label:"Bill Hours:",ModelValue:"Hours",ReadOnly:!0,ObjectName:"fieldADLaborDetailHours"},{Type:"dropdown",Label:"Pay Rate:",ReadOnly:!0,ApiMethod:"payRates",ValueProp:"Id",TextProp:"PayRateName",ModelValue:"PayRateId",Name:"PayRate"},{Type:"currency",Label:"Rate Hour:",ModelValue:"Rate",ReadOnly:!0,ObjectName:"fieldADLaborDetailRate"},{Type:"checkbox",Label:"Taxable",ReadOnly:!0,ModelValue:"Taxable",Roles:f},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"checkbox",Label:"Billable",ReadOnly:!0,ModelValue:"Billable"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"}]):0==L.isActive?L.laborAttributesEdit=[L.LaborCode,{Type:"datepicker",Label:"Date:",ModelValue:"Date",Format:"MM/dd/yyyy",SubType:"date"},{Type:"decimal",Label:"Work Hours:",ModelValue:"WorkHours",FocusOut:!0,Required:!0},{Type:"decimal",Label:"Bill Hours:",ModelValue:"Hours",ObjectName:"fieldADLaborDetailHours"},{Type:"dropdown",Label:"Pay Rate:",ApiMethod:"payRates",ValueProp:"Id",TextProp:"PayRateName",ModelValue:"PayRateId",Name:"PayRate"},{Type:"currency",Label:"Rate Hour:",ModelValue:"Rate",ObjectName:"fieldADLaborDetailRate"},{Type:"checkbox",Label:"Taxable",ModelValue:"Taxable",Roles:f},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"checkbox",Label:"Billable",ModelValue:"Billable"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"}]:1==L.isActive&&L.activeId!=a&&(L.laborAttributesEdit=[L.LaborCode,{Type:"datepicker",Label:"Date:",ModelValue:"Date",Format:"MM/dd/yyyy",SubType:"date"},{Type:"decimal",Label:"Work Hours:",ModelValue:"WorkHours",FocusOut:!0,Required:!0},{Type:"decimal",Label:"Bill Hours:",ModelValue:"Hours",ObjectName:"fieldADLaborDetailHours"},{Type:"dropdown",Label:"Pay Rate:",ApiMethod:"payRates",ValueProp:"Id",TextProp:"PayRateName",ModelValue:"PayRateId",Name:"PayRate"},{Type:"currency",Label:"Rate Hour:",ModelValue:"Rate",ObjectName:"fieldADLaborDetailRate"},{Type:"checkbox",Label:"Taxable",ModelValue:"Taxable",Roles:f},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"checkbox",Label:"Billable",ModelValue:"Billable"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"}]),L.usingDSLNorthwest&&(L.laborAttributesEdit=L.laborAttributesEdit.concat(c))}),L.laborAttributes=[L.LaborCode,M,{Type:"decimal",Label:"Work Hours:",ModelValue:"WorkHours",FocusOut:!0,Required:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6",Roles:["Admin","FieldConnect","TransAdmin","SubAdmin","Office"]},{Type:"decimal",Label:"Bill Hours:",ModelValue:"Hours",Required:!0,ObjectName:"fieldADLaborDetailHours"},{Type:"datepicker",Label:"Date:",ModelValue:"Date",Format:"MM/dd/yyyy",SubType:"date",Required:!0},D,{Type:"currency",Label:"Rate Hour:",ModelValue:"Rate",ReadOnly:!1,ObjectName:"fieldADLaborDetailRate"},{Type:"checkbox",Label:"Taxable",Required:!1,ModelValue:"Taxable",Roles:f},{Type:"checkbox",Label:"Billable",ModelValue:"Billable"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"}],L.attDSLActionTaken={Type:"dropdown",Label:"Action Taken:",ApiMethod:"dslActionTaken/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extActionTakenId",ConvertToInt:"true"},L.attDSLFaultAreas={Type:"dropdown",Label:"Trouble Found:",ApiMethod:"dslFaultAreas/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extFaultAreasId",ConvertToInt:"true"},L.attDSLApplicableCode={Type:"dropdown",Label:"Applicable Zone:",ApiMethod:"dslApplicableCode/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extApplicableCodeId",ConvertToInt:"true"},L.attDSLInstalledRemoved={Type:"dropdown",Label:"Installed/Removed:",ApiMethod:"dslInstalledRemoved/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extInstalledRemovedId",ConvertToInt:"true"},L.attDSLWhoPays={Type:"dropdown",Label:"Who Pays:",ApiMethod:"dslWhoPays/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extWhoPaysId",ConvertToInt:"true"},L.attDSLIndirectLaborQuantity={Type:"int",Label:"Indirect Labor Qty:",ModelValue:"extIndirectLaborQuantity"},L.attDSLIndirectPartNumber={Type:"text",Label:"Part#/TOF",ModelValue:"extIndirectPartNumber",MaxLength:"250"};var c=[L.attDSLActionTaken,L.attDSLFaultAreas,L.attDSLApplicableCode,L.attDSLInstalledRemoved,L.attDSLWhoPays,L.attDSLIndirectLaborQuantity,L.attDSLIndirectPartNumber];L.usingDSLNorthwest&&(L.laborAttributes=L.laborAttributes.concat(c));n&&(L.firstTimeEdit=!0,L.subcontractorId=n,L.subPayRateFilter=u.filter("and"),L.subPayRateFilter.eq("SubcontractorId",n),L.subPayRateFilter.eq("CompanyId",b),L.laborSubFilter=u.filter("and"),L.laborSubFilter.eq("SubcontractorId",n),L.laborSubFilter.eq("CompanyId",b),L.laborAttributes=[{Type:"dropdown",Label:"Labor Code:",Required:!0,ApiMethod:"laborsubcodes",ValueProp:"LaborCodeName",TextProp:"LaborCodeName",ModelValue:"LaborCodeName",Filter:L.laborSubFilter,Name:"LaborCode"},M,{Type:"decimal",Label:"Work Hours:",ModelValue:"WorkHours",FocusOut:!0,Required:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6",Roles:["Admin","FieldConnect","TransAdmin","SubAdmin","Office"]},{Type:"decimal",Label:"Bill Hours:",ModelValue:"Hours",Required:!0,ObjectName:"fieldADLaborDetailHours"},{Type:"datepicker",Label:"Date:",ModelValue:"Date",Format:"MM/dd/yyyy",SubType:"date",Required:!0},{Type:"dropdown",Label:"Pay Rate:",Required:!0,ApiMethod:"payRates/getSubPayRate",ValueProp:"Id",TextProp:"PayRateName",ModelValue:"PayRateId",Filter:L.subPayRateFilter,Name:"PayRate"},{Type:"currency",Label:"Cost:",ModelValue:"Cost",MaxLength:"50",Step:"0.01",ReadOnly:!0,Roles:["SubAdmin"]},{Type:"checkbox",Label:"Taxable",Required:!1,ModelValue:"Taxable",Roles:f},{Type:"checkbox",Label:"Billable",ModelValue:"Billable"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"}],L.laborAttributesEdit=[{Type:"dropdown",Label:"Labor Code:",Required:!0,ApiMethod:"laborsubcodes",ValueProp:"LaborCodeName",TextProp:"LaborCodeName",ModelValue:"LaborCodeName",Filter:L.laborSubFilter,Name:"LaborCode"},{Type:"datepicker",Label:"Date:",ModelValue:"Date",Format:"MM/dd/yyyy",SubType:"date"},{Type:"decimal",Label:"Work Hours:",ModelValue:"WorkHours",FocusOut:!0,Required:!0},{Type:"decimal",Label:"Bill Hours:",ModelValue:"Hours",ObjectName:"fieldADLaborDetailHours"},{Type:"dropdown",Label:"Pay Rate:",Required:!0,ApiMethod:"payRates/getSubPayRate",ValueProp:"Id",TextProp:"PayRateName",ModelValue:"PayRateId",Filter:L.subPayRateFilter,Name:"PayRate"},{Type:"currency",Label:"Cost:",ModelValue:"Cost",MaxLength:"50",Step:"0.01",ReadOnly:!0,Roles:["TransAdmin","SubAdmin"]},{Type:"checkbox",Label:"Taxable",ModelValue:"Taxable",Roles:f},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"checkbox",Label:"Billable",ModelValue:"Billable"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"}]);L.customerRoles||d.getItems("employees/getTechForLabor").then(function(e){L.lengthOfTechs=e.data.Data.length,L.isTech&&1==L.lengthOfTechs&&(L.laborAttributes[1]=I,L.selectedTechId=e.data.Data[0].Id,L.model.ListEmployeeIds=null)});null==a?(L.firstTimeEdit=!0,L.model.Hours=null,L.model.WoId=parseInt(t),l.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Labor edit",id:a,model:L.model,attributes:L.laborAttributes,apiMethod:L.apiMethod,customFocus:L.focusOut,onBack:L.responsePopup,viewName:L.viewName,moduleName:L.moduleName,currentList:L.currentList}}).then(function(e){e.close.then(function(){})})):(L.model.WoId=parseInt(t),e.$watch("vl.labordata",function(){d.getItem(L.apiMethod,a).then(function(e){var t=e.data;t&&(t.Approved&&(s.warning("Hours can only be edited via the Time Report"),L.laborAttributesEdit.forEach(function(e){e.ReadOnly=!0})),null!==t.EndDate&&void 0!==t.EndDate&&(s.warning({message:"Changes affect the labor hours, but not the start and stop times."}),s.warning({message:"This line has been generated using Track-Realtime."})),null!==t.EndDate&&void 0!==t.EndDate||null===t.StartDate||(s.warning({message:"In-progress labor items should not be modified!"}),s.warning({message:"This line has been generated using Track-Realtime."})),t.InvoiceId&&!n?s.warning({message:"This line has been invoiced, so it may not be edited."}):l.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Labor edit",id:a,model:L.model,attributes:L.laborAttributesEdit,apiMethod:L.apiMethod,customFocus:L.focusOut,onBack:L.responsePopup,viewName:L.viewName,moduleName:L.moduleName,currentList:L.currentList,hideSubmit:t.Approved}}).then(function(e){e.close.then(function(){})}))})}));null!=o&&(L.subcontractorId?(L.rateSheetFilter=u.filter("and"),L.rateSheetFilter.eq("Id",o),L.rateSheetFilter.eq("CompanyId",b),d.getItems("ratesheets/getRateSheetforSub",L.rateSheetFilter).then(function(e){var a=e.data;L.model.LaborRateHour=a.LaborRateHour})):d.getItem("ratesheets",o).then(function(e){var a=e.data;L.model.LaborRateHour=a.LaborRateHour}));if(!L.customerRoles)var p=e.$watch("vl.model.ListEmployeeIds",function(){v(),p()})},L.getCurrent=v,L.$state=t,L.defaultTech={},L.laborData=n.getTransitionParam("agreement"),L.filter={Reload:0},L.editLaborSub=function(){s.warning({message:"This line has been invoiced, so it may not be edited."})},L.subPayRateFilter={},L.laborSubFilter={},L.itemDeleted=function(){e.$emit("wo.itemDelete"),e.$parent.vm.quoteId&&S()},L.responsePopup=function(a){a&&(L.filter.Reload++,L.reloadTable=!1,L.laborData=null,r(function(){L.reloadTable=!0}),"object"==typeof a&&e.$emit("wo.itemChange"));return!0},L.viewName=e.vm.viewName,L.moduleName="Labor",L.header=null,L.usingDSLNorthwest=y.usingDSLNorthwest,L.apiMethod="woLabors",L.DefaultLaborCode={},L.usingDSLNorthwest?L.apiMethod="dslWoLabors":d.getItem("settings/status?type=DefaultLaborCode").then(function(e){L.DefaultLaborCode=e.data}),L.attributes=[{Name:"Tech",ValueName:"FullName",Edit:!0,Sortable:!0},{Name:"Work Hours",ValueName:"WorkHours",Edit:!1,Sortable:!0},{Name:"Bill Hours",ValueName:"Hours",CompareValueName:"QuoteBillHours",Edit:!1,Sortable:!0,ObjectName:"colADLaborGridHours"},{Name:"Date",ValueName:"Date",FormatDate:"date",Edit:!1,Sortable:!0},{Name:"Labor Code",ValueName:"LaborCodeName",Edit:!1,Sortable:!0},{Name:"Pay Rate",ValueName:"PayRateName",Edit:!1,Sortable:!0},{Name:"Rate Hour",ValueName:"Rate",CompareValueName:"QuoteRate",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colADLaborGridRate"},{Name:"Extended Price",ValueName:"ExtendedPrice",CompareValueName:"QuoteExtendedPrice",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colADLaborGridExtendedPrice"}],L.attributesSubcontractor=[{Name:"Tech",ValueName:"FullName",Edit:!0,Sortable:!0},{Name:"Work Hours",ValueName:"WorkHours",Edit:!1,Sortable:!0},{Name:"Bill Hours",ValueName:"Hours",Edit:!1,Sortable:!0,Roles:["Admin","FieldConnect","TransAdmin","SubAdmin","Office"]},{Name:"Date",ValueName:"Date",FormatDate:"date",Edit:!1,Sortable:!0},{Name:"Labor Code",ValueName:"LaborCodeName",Edit:!1,Sortable:!0},{Name:"Pay Rate",ValueName:"PayRateName",Edit:!1,Sortable:!0},{Name:"Cost Hour",ValueName:"Cost",Edit:!1,Sortable:!0,CellFormat:"decimal",Roles:["Admin","FieldConnect","TransAdmin","SubAdmin","Office"]},{Name:"Extended Cost",ValueName:"ExtendedCost",Edit:!1,Sortable:!0,CellFormat:"decimal",Roles:["Admin","FieldConnect","TransAdmin","SubAdmin","Office"]}];var M={Type:"multiselect",Label:"Tech",ApiMethod:"employees/getTechForLabor",ValueProp:"Id",TextProp:"FullName",ModelValue:"ListEmployeeIds",Required:!0},I={Type:"dropdown",Label:"Tech:",ApiMethod:"employees/getTechForLabor",ValueProp:"Id",TextProp:"FullName",ModelValue:"TechId",Required:!0,Filter:L.subTech},D=(L.subTech,{Type:"dropdown",Label:"Pay Rate:",Required:!0,ApiMethod:"payRates",ValueProp:"Id",TextProp:"PayRateName",ModelValue:"PayRateId",Name:"PayRate"});L.subTech=u.filter("and"),L.model={},L.reloadTable=!0;var P,V,A=!0;function S(){d.getItem("woLabors/header",e.$parent.vm.id).then(function(e){e.data&&(L.header=e.data.Header)})}function g(){if(L.firstTimeEdit){var e=0,a=0;null==L.model.SubContractorId?V&&L.model.PayRateId?e=null!=V.CostHour?V.CostHour:L.defaultTech?(1+V.CostMultiplier)*L.defaultTech.CostHour:1+V.CostMultiplier:L.model.Rate=null:e=L.model.SubContractorPayRateCostHour,V&&L.model.PayRateId?(a=null==V.RateMultiplier&&null==V.RateHour?L.model.LaborRateHour:null!=V.RateMultiplier?L.model.LaborRateHour*V.RateMultiplier:V.RateHour,L.model.Cost=e,L.model.Rate=a):L.model.Rate=null}else L.firstTimeEdit=!0}function v(){m.getCurrentUserEmployeeData().then(function(e){L.defaultTech=e,L.model.ListEmployeeIds&&(L.model.ListEmployeeIds=[]),L.defaultTech&&L.model.ListEmployeeIds&&L.defaultTech.Technician&&L.model.ListEmployeeIds.push(L.defaultTech.Id)})}e.$watch("vl.model.LaborCodeName",function(){L.model.LaborCodeName?L.LaborCode.CurrentList&&(r(function(){var e=L.LaborCode.CurrentList;P=$.grep(e,function(e){return e.LaborCodeName==L.model.LaborCodeName}),L.model.PayRateId=P[0].PayRateId}),n.getTransitionParam("quoteId")?L.model.Billable=!1:L.laborData?0==L.laborData.laborData.laborCovered?L.model.Billable=!0:1==L.laborData.laborData.laborCovered&&(L.model.Billable=!1):L.model.Billable=!0,L.model.Taxable=!0):L.model.PayRateId=null}),e.$watch("vl.model.Billable",function(){null!=L.model.Billable?(L.oldPrice=angular.copy(L.model.Rate),L.model.Billable?L.laborData=null:L.laborData=n.getTransitionParam("agreement")):L.model.Billable=!0}),e.$watch("vl.model.Rate",function(){L.laborData=n.getTransitionParam("agreement"),L.laborData&&A&&(L.laborData.laborData.laborCovered&&0==L.model.Billable||A&&1==L.model.Billable&&L.firstTimeEdit&&(L.model.Rate=L.model.Rate*(1+L.laborData.laborData.laborMarkup),A=!1),L.firstTimeEdit=!0)}),L.id,e.$watch("vl.model.PayRateId",function(){null!=L.model.PayRateId&&(A=!0,L.subcontractorId,r(function(){var e=$.grep(L.id?L.laborAttributesEdit:L.laborAttributes,function(e){return"PayRate"==e.Name});if(void 0!==e[0].CurrentList){var a=e[0].CurrentList;V=(V=$.grep(a,function(e){return e.Id==L.model.PayRateId}))[0],g()}}))}),e.$watch("vl.model.Taxable",function(){null!=L.model.Taxable&&(L.model.Taxable?L.model.WoId&&d.getItem("wo",L.model.WoId).then(function(e){var a=e.data;L.model.TaxRate=a.TaxRateLabor}):(L.model.TaxRate=null,L.model.Taxable=!1))}),e.$on("wo.loadQuoteItemsHeaders",function(e,a){S()}),c.$on("applyBundle",function(e){L.reloadLaborTable()}),c.$on("reloadLaborTable",function(e,a){L.reloadLaborTable()}),c.$on("setTimeTracking",function(e,a){a.active?(L.assignmentId=a.assid,L.checkLaborInProgress()):L.isActive=!1}),L.reloadLaborTable=function(){L.reloadTable=!1,r(function(){L.reloadTable=!0})},L.checkLaborInProgress=function(){L.assignmentFilter=u.filter("and"),L.assignmentFilter.eq("AssignmentId",L.assignmentId).eq("EndDate","NULL"),d.getItems("woLabors",L.assignmentFilter).then(function(e){L.updateTime=e.data.Data,L.updateTime.length>0?(L.isActive=!0,L.activeId=L.updateTime[0].Id):L.isActive=!1})}}angular.module("FieldConnectApp").controller("WoLaborController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","$timeout","restService","cryptoStorageService","qsService","stateTransitionService","Notification","$window","currentUserService","$rootScope","rolesFactory","featuresFactory"]}();;!function(){"use strict";function e(e,t,r,i,o,l,d,a,s,n,u){var c=this;c.$state=r,c.goBack=function(){window.history.back()},c.viewName="CustomerUserWorkOrderDetails",c.moduleName="SRWODetailsHeader",c.woNumber="",c.altId=0,c.model={},c.modelSite={},c.filter={filterId:i.id},c.filter1={siteId:null},c.customerEdit=!0,c.filterByWorkOrder=a.filter("and"),c.filterByWorkOrder.eq("WoId",c.filter.filterId),c.filterBySite=a.filter("and"),c.filterSiteForms=a.filter("and"),c.customer={customerId:0},c.customers=[],c.site={siteId:0},c.id=i.id,c.count=0,c.companyWoStatus={},c.companyAssignmentStatus={},c.isMain=!0,c.companySettings=[],c.customerSiteFilter=a.filter("and"),c.customerFilter=a.filter("or"),$(window).focus(function(){c.reloadFilter=!1,e.$apply(),c.reloadFilter=!0,e.$apply()});var m={Type:"dropdown",Label:"Agreement:",Required:!1,ApiMethod:"agreements/getAgreementsByCustomer",ValueProp:"Id",TextProp:"Desc",ModelValue:"AgreementId",ConvertToInt:"true",Filter:c.customerFilter,ReadOnly:!0,List:[]},p={Type:"dropdown",Label:"Project:",Required:!1,ApiMethod:"projects/getProjectForWo",ValueProp:"Id",TextProp:"ProjectName",ModelValue:"ProjectId",ConvertToInt:"true",Filter:c.customerSiteFilter,ReadOnly:!0,List:[]};c.attributes=[{Type:"text",Label:"Site:",MaxLength:"50",ModelValue:"SiteName",ReadOnly:!0},{Type:"text",Label:"Address",MaxLength:"100",ModelValue:"Address",ReadOnly:!0},{Type:"text",Label:"Status:",ModelValue:"Status",ReadOnly:!0},{Type:"text",Label:"Requestor:",MaxLength:"100",ModelValue:"ContactName",ReadOnly:!0},{Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc",Autofocus:"true",ReadOnly:!0},{Type:"text",Label:"Phone:",MaxLength:"50",ModelValue:"ContactPhone",ReadOnly:!0},{Type:"text",Label:"Work Order Type:",ModelValue:"WoType",ReadOnly:!0},m,p,{Type:"text",Label:"Customer PO Number:",Required:!1,MaxLength:"50",ModelValue:"CustomerPONum",ReadOnly:!0}],c.loadingIndicator=!1,e.$watch("vm.model.Id",function(){c.model.Id&&(c.altId=c.model.AltId,c.filter1.siteId=c.model.SiteId,c.customerFilter.customerId=c.model.CustomerId,c.filterBySite.eq("SiteId",c.model.SiteId),c.customerSiteFilter.eq("WoId",c.id).eq("CustomerId",c.model.CustomerId).eq("SiteId",c.model.SiteId),m.List=null,p.List=null,c.reloadFilter=!0)}),c.assignmentsGrid=!0,c.notesGrid=!0,c.servreportGrid=!1,c.initialiseGrid=function(e){switch(e){case"assignmentsGrid":c.assignmentsGrid=!0;break;case"notesGrid":c.notesGrid=!0;break;case"servreportGrid":c.servreportGrid=!0;break;default:c.assignmentsGrid=!0,c.notesGrid=!0,c.servreportGrid=!0}},c.getModulePrivilege=function(e,t){return u.getModulePrivilege(e,t)}}angular.module("FieldConnectApp").controller("SRWODetailsController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","restService","stateTransitionService","qsService","cryptoStorageService","currentCompanyService","guiPrivilegeService"]}();;!function(){"use strict";function e(e,t,o,a,r,i,d,l,s,n,m,u,c,p,y,S){var L=this;L.$state=o,L.goBack=function(){window.history.back()},L.checkTotalCount=O,L.viewName="WorkOrderDetails",L.moduleName="WODetailsHeader",L.woNumber="",L.altId=0,L.model={},L.modelSite={},L.filter={filterId:a.id},L.filter1={siteId:null},L.partsData={partsCovered:!1},L.miscData={miscCovered:!1},L.laborData={laborMarkup:0,laborCovered:!1},L.usingQuoting=p.usingQuoting,L.usingDSLNorthwest=p.usingDSLNorthwest,L.showWoPayment=p.usingFCPayments,L.isReadOnly=!0,L.roleUsingPayments=!1,L.serviceableItemModuleName="WoServiceableItems",y.clearCustomer(),L.usingGroundBreakers=p.usingGroundBreakers,L.customReport=!1,L.serviceReportCount=0,L.serviceReportMax=99,L.serviceReportAPI="woservicereports",L.usingGroundBreakers&&(L.serviceReportAPI="gbwoservicereports"),L.hideQuoteAttachments="hidden",L.hideServiceRequestAttachments="hidden",L.serviceRequestFilter=l.filter("and"),L.changeForms=function(){L.woForm=!L.woForm,L.woForm?L.btnName="Site Equipment Forms":(L.filterSiteForms.reset(),L.filterSiteForms.eq("SiteId",L.model.SiteId).eq("Id",L.modelSite.Id).eq("WoId",L.filter.filterId),L.btnName="Work Order Forms")},L.filterByWorkOrder=l.filter("and"),L.filterByWorkOrder.eq("WoId",L.filter.filterId),L.filterBySite=l.filter("and"),L.filterSiteForms=l.filter("and"),L.customer={customerId:0},L.customers=[],L.site={siteId:0},L.id=a.id,L.companyWoStatus={},L.companyAssignmentStatus={},L.taskGrid=!1,L.poGrid=!1,L.isMain=!0,L.companySettings=[],L.customerSiteFilter=l.filter("and"),L.customerFilter=l.filter("or"),i.getItems("companysettings").then(function(e){L.companySettings=e.data.Data;for(var t=0;t<L.companySettings.length;t++)"POGrid"==L.companySettings[t].Name&&0!=L.companySettings[t].Id&&null!=L.companySettings[t].Value&&(L.poGrid=JSON.parse(L.companySettings[t].Value.toLowerCase())),"TaskGrid"==L.companySettings[t].Name&&0!=L.companySettings[t].Id&&null!=L.companySettings[t].Value&&(L.taskGrid=JSON.parse(L.companySettings[t].Value.toLowerCase()))}),L.reloadFilter=!1,L.count=0,L.estHoursTotal=0;var T=[];i.getItems("usersettings").then(function(e){T=e.data.Data;for(var t=0;t<T.length;t++){if("OpenAllPanels"==T[t].Name&&0!=T[t].Id&&null!=T[t].Value)JSON.parse(T[t].Value.toLowerCase())&&($('.panel-collapse:not(".in")').collapse("show"),F())}}),$(window).focus(function(){L.reloadFilter=!1,e.$apply(),L.reloadFilter=!0,e.$apply()});for(var b=s.getValue("authorizationData").userRoles.split(","),I=!1,R=0;R<b.length;R++)if("Admin"==b[R]||"TransAdmin"==b[R]||"FieldConnect"==b[R]){I=!0;break}var C={Type:"text",Label:"Status:",ModelValue:"Status",ReadOnly:!0};L.ShowSubmit=!1,I&&(C={Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"wostatuses/getStatusForManageWorkOrderAdmin",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"Status",ObjectName:"ddlStatusDropdown"},L.ShowSubmit=!0),L.attributesSite=[{Type:"dropdown",Label:"Forms",Required:!1,ApiMethod:"forms/getforSiteEquipmentDropdown",ValueProp:"Id",TextProp:"Name",ModelValue:"Id",Filter:L.filterByWorkOrder}];var f=e.$watch("vm.attributesSite[0].CurrentList",function(){L.attributesSite[0].CurrentList&&L.attributesSite[0].CurrentList.length>0&&(L.modelSite.Id=L.attributesSite[0].CurrentList[0].Id,L.filterSiteForms.reset(),L.filterSiteForms.eq("SiteId",L.model.SiteId).eq("Id",L.modelSite.Id).eq("WoId",L.filter.filterId),f())}),h={Type:"dropdown",Label:"Agreement:",Required:!1,ApiMethod:"agreements/getAgreementsByCustomer",ValueProp:"Id",TextProp:"Desc",ModelValue:"AgreementId",ConvertToInt:"true",Filter:L.customerFilter,ReadOnly:!0,Roles:["Admin","TransAdmin","FieldConnect","Dispatch","Office"],ObjectName:"ddlWoAgreement",List:[]},D={Type:"dropdown",Label:"Project:",Required:!1,ApiMethod:"projects/getProjectForWo",ValueProp:"Id",TextProp:"ProjectName",ModelValue:"ProjectId",ConvertToInt:"true",Filter:L.customerSiteFilter,ReadOnly:!0,Roles:["Admin","TransAdmin","FieldConnect","Dispatch","Office"],ObjectName:"ddlWoProject",List:[]};L.attWoCustomer={Type:"text",Label:"Customer:",MaxLength:"50",ModelValue:"CustomerName",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo",ReadOnly:!0},L.attWoEmpty1={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},L.attWoSite={Type:"text",Label:"Site:",MaxLength:"50",ModelValue:"SiteName",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo",ReadOnly:!0},L.attWoEmpty2={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},L.attWoDescription={Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc",Autofocus:"true",ReadOnly:!0},L.attWoSubContractor={Type:"dropdown",Label:"Subcontractor:",ApiMethod:"subcontractorCompanies",ValueProp:"SubcontractorId",TextProp:"CompanyName",ModelValue:"SubContractorId",ConvertToInt:"true",ReadOnly:!0,Roles:["Admin","TransAdmin","FieldConnect","Dispatch","Office"]},L.attWoLine1={Type:"line",CustomClass:"col-sm-12",Roles:["Admin","TransAdmin","FieldConnect","Dispatch","Office"]},L.attWoAddress={Type:"text",Label:"Address",MaxLength:"100",ModelValue:"Address",ReadOnly:!0},L.attWoWorkOrderType={Type:"text",Label:"Work Order Type:",ModelValue:"WoType",ReadOnly:!0,ObjectName:"ddlWoTypeDropdown"},L.attWoRequestor={Type:"text",Label:"Requestor:",MaxLength:"100",ModelValue:"ContactName",ReadOnly:!0},L.attWoPriority={Type:"text",Label:"Priority:",ModelValue:"Priority",ReadOnly:!0,ObjectName:"ddlWoPriority"},L.attWoPhone={Type:"text",Label:"Phone:",MaxLength:"50",ModelValue:"ContactPhone",ReadOnly:!0},L.attWoOffice={Type:"dropdown",Label:"Office:",ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true",ReadOnly:!0,Roles:["Admin","TransAdmin","FieldConnect","Dispatch","Office"],ObjectName:"ddlWoOffice"},L.attWoRequestDate={Type:"datepicker",Label:"Request Date:",ModelValue:"RequestDate",Format:"MM/dd/yyyy",SubType:"date",ReadOnly:!0,Roles:["Admin","TransAdmin","FieldConnect","Dispatch","Office"]},L.attWoPaymentTerm={Type:"dropdown",Label:"Payment Term:",Required:!1,ApiMethod:"paymentTerms",ValueProp:"Id",TextProp:"PaymentTermName",ModelValue:"PaymentTermId",ConvertToInt:"true",ReadOnly:!0,Roles:["Admin","TransAdmin","FieldConnect","Dispatch","Office"],ObjectName:"ddlWoPaymentTerm"},L.attWoCustomerPoNumber={Type:"text",Label:"Customer PO Number:",Required:!1,MaxLength:"50",ModelValue:"CustomerPONum",ReadOnly:!0},L.attWoCurrencyCode={Type:"dropdown",Label:"Currency Code:",ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode",ReadOnly:!0,Roles:["Admin","TransAdmin","FieldConnect","Dispatch","Office"],ObjectName:"ddlWoCurrencyCode"},L.attWoQuoteId={Type:"int",Label:"Quote Id:",ModelValue:"QuoteAltId",ReadOnly:!0,Roles:["Admin","TransAdmin","FieldConnect"]},L.attWoPromised={Type:"datepicker",Label:"Promised:",Required:!0,ModelValue:"PromiseDate",Format:"MM/dd/yyyy",ReadOnly:!0},L.attWoExternalId={Type:"text",Label:"External Id:",Required:!1,MaxLength:"50",ModelValue:"ExternalId",ReadOnly:!0,Roles:["Admin","TransAdmin","FieldConnect","Dispatch","Office"]},L.attWoSalesPerson={Type:"dropdown",Label:"Salesperson:",ApiMethod:"employees/getSalesPersonList",ValueProp:"Id",TextProp:"FullName",ModelValue:"SalesPersonId",ConvertToInt:"true",ReadOnly:!0},L.attWoRateSheet={Type:"dropdown",Label:"Rate Sheet:",Required:!0,ApiMethod:"ratesheets",ValueProp:"Id",TextProp:"RateSheetName",ModelValue:"RateSheetId",ConvertToInt:"true",ReadOnly:!0,Roles:["Admin","TransAdmin","FieldConnect","Dispatch","Office"],ObjectName:"ddlWoRateSheet"},L.attWoLeadSource={Type:"dropdown",Label:"Lead Source:",ApiMethod:"leadSource/ddList",ValueProp:"Id",TextProp:"DdlLabel",ModelValue:"LeadSourceId",ConvertToInt:"true",ReadOnly:!0},L.attWoCreatedBy={Type:"text",Label:"Created By:",ModelValue:"CreatedBy",ReadOnly:!0},L.attWoLine2={Type:"line",CustomClass:"col-sm-12",Roles:["Admin","TransAdmin","FieldConnect","Dispatch","Office"]},L.attWoTaxRate={Type:"dropdown",Label:"Tax Rate:",ApiMethod:"taxrates",ValueProp:"Id",TextProp:"TaxName",ModelValue:"TaxRateId",ConvertToInt:"true",ReadOnly:!0,Roles:["Admin","TransAdmin","FieldConnect","Dispatch","Office"],ObjectName:"ddlWoTaxRate"},L.attWoTaxRateLabor={Type:"decimal",Label:"Tax Rate Labor %: ",ModelValue:"TaxRateLabor",ReadOnly:!0,Roles:["Admin","TransAdmin","FieldConnect","Dispatch","Office"]},L.attWoTaxRatePart={Type:"decimal",Label:"Tax Rate Part %: ",ModelValue:"TaxRatePart",ReadOnly:!0,Roles:["Admin","TransAdmin","FieldConnect","Dispatch","Office"]},L.attWoTaxRateMisc={Type:"decimal",Label:"Tax Rate Misc %: ",ModelValue:"TaxRateMisc",ReadOnly:!0,Roles:["Admin","TransAdmin","FieldConnect","Dispatch","Office"]},L.attDSLLine1={Type:"line",CustomClass:"col-sm-12"},L.attDSLWoExportHeader={Type:"text",Label:"WO Export",ModelValue:"",CustomInputClass:"hidden",ReadOnly:!0},L.attDSLBlank1={Type:"empty",CustomClass:"fc-empty-control col-sm-6",ReadOnly:!0},L.attDSLUnitDown={Type:"checkbox",Label:"Unit Down",ModelValue:"woeUnitDown",ReadOnly:!0},L.attDSLRewritePartsReceived={Type:"dropdown",Label:"Rewrite Parts Received:",Required:!1,ApiMethod:"dslPartsReceived/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"woeRewritePartsReceived",ReadOnly:!0},L.attDSLIsUnitReplaceAnother={Type:"checkbox",Label:"Is Unit Replace Another",ModelValue:"woeIsUnitReplaceAnother",TabIndex:17,ReadOnly:!0},L.attDSLRecallDueTo={Type:"dropdown",Label:"Recall Due To:",Required:!1,ApiMethod:"dslRecallDueTo/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"woeRecallDueTo",ReadOnly:!0},L.attDSLFieldScrapFlag={Type:"checkbox",Label:"Field Scrap Flag",ModelValue:"woeFieldScrapFlag",TabIndex:17,ReadOnly:!0},L.attDSLProcessPracticeFlag={Type:"checkbox",Label:"Process/Practice Flag",ModelValue:"woeProcessPracticeFlag",ReadOnly:!0},L.attDSLUnitOperAtDepartureFlag={Type:"checkbox",Label:"Unit Oper. at Departure",ModelValue:"woeUnitOperAtDeparture",ReadOnly:!0},L.attDSLBulletinNumber={Type:"text",Label:"Bulletin Number:",Required:!1,MaxLength:"20",ModelValue:"woeBulletinNumber",ReadOnly:!0},L.attDSLQualityReportFlag={Type:"checkbox",Label:"Quality Report Flag",ModelValue:"woeQualityReportFlag",ReadOnly:!0},L.attDSLCertificationNumber={Type:"text",Label:"Certification Number:",Required:!1,MaxLength:"20",ModelValue:"woeCertificationNumber",ReadOnly:!0},L.attDSLPreviousUnitFieldSerialNumber={Type:"text",Label:"Previous Unit Field Serial No.:",Required:!1,MaxLength:"20",ModelValue:"woePreviousUnitFieldSerialNumber",ReadOnly:!0},L.attDSLPurchasedFromDistributor={Type:"dropdown",Label:"Purchased From Distributor:",Required:!1,ApiMethod:"dslDistributor/ddList",ValueProp:"Id",TextProp:"Name",ModelValue:"woePurchasedFromDistributor",ReadOnly:!0},L.attDSLWOEId={Type:"hidden",ModelValue:"woeId"},L.attDSLServiceZoneCode={Type:"text",Label:"Service Zone Code:",Required:!1,ReadOnly:!0,MaxLength:"20",ModelValue:"ServiceZoneCode"},L.attDSLLine2={Type:"line",CustomClass:"col-sm-12"},L.attDSLRewrite={Type:"checkbox",Label:"Rewrite",ModelValue:"User4",ReadOnly:!0},L.attDSLRecall={Type:"checkbox",Label:"Recall",ModelValue:"User5",ReadOnly:!0},L.attDSLFactoryServiceOrderType={Type:"dropdown",Label:"Factory Service Order Type:",ApiMethod:"dslServiceOrderType/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"User8",ConvertToInt:"true",ReadOnly:!0},L.attDSLVisits={Type:"text",Label:"Visits:",ModelValue:"DSLVisits",ReadOnly:!0},L.attDSLAuthorizedBy={Type:"text",Label:"Authorized By:",Required:!1,MaxLength:"20",ModelValue:"User0",ReadOnly:!0},L.attDSLAdditionalDetailsHeader={Type:"text",Label:"Additional Details",ModelValue:"",CustomInputClass:"hidden"},L.attDSLLine3={Type:"line",CustomClass:"col-sm-12"},L.attDSLLine4={Type:"line",CustomClass:"col-sm-12"},L.attDSLBlank2={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},L.attDSLBlank3={Type:"empty",CustomClass:"fc-empty-control col-sm-6"};var W=[L.attWoCustomer,L.attWoEmpty1,L.attWoSite,L.attWoEmpty2,L.attWoDescription,L.attWoSubContractor,L.attWoLine1,C,L.attWoAddress,L.attWoWorkOrderType,L.attWoRequestor,L.attWoPriority,L.attWoPhone,h,L.attWoOffice,D,L.attWoRequestDate,L.attWoPaymentTerm,L.attWoCustomerPoNumber,L.attWoCurrencyCode,L.attWoQuoteId,L.attWoPromised,L.attWoExternalId,L.attWoSalesPerson,L.attWoRateSheet,L.attWoLeadSource,L.attWoCreatedBy,L.attWoLine2,L.attWoTaxRate,L.attWoTaxRateLabor,L.attWoTaxRatePart,L.attWoTaxRateMisc],P=[L.attWoCustomer,L.attWoEmpty1,L.attWoSite,L.attWoEmpty2,L.attWoDescription,L.attWoSubContractor,L.attWoLine1,C,L.attWoAddress,L.attWoWorkOrderType,L.attWoRequestor,L.attWoPriority,L.attWoPhone,h,L.attWoOffice,D,L.attWoRequestDate,L.attWoPaymentTerm,L.attWoCustomerPoNumber,L.attWoCurrencyCode,L.attWoQuoteId,L.attWoPromised,L.attWoExternalId,L.attWoSalesPerson,L.attWoRateSheet,L.attWoLeadSource,L.attWoCreatedBy,L.attWoLine2,L.attWoTaxRate,L.attWoTaxRateLabor,L.attWoTaxRatePart,L.attWoTaxRateMisc,L.attDSLLine1,L.attDSLAdditionalDetailsHeader,L.attDSLBlank2,L.attDSLRewrite,L.attDSLRecall,L.attDSLFactoryServiceOrderType,L.attDSLVisits,L.attDSLAuthorizedBy,L.attDSLServiceZoneCode,L.attDSLLine4,L.attDSLWoExportHeader,L.attDSLBlank1,L.attDSLUnitDown,L.attDSLRewritePartsReceived,L.attDSLIsUnitReplaceAnother,L.attDSLRecallDueTo,L.attDSLFieldScrapFlag,L.attDSLProcessPracticeFlag,L.attDSLUnitOperAtDepartureFlag,L.attDSLBulletinNumber,L.attDSLQualityReportFlag,L.attDSLCertificationNumber,L.attDSLPreviousUnitFieldSerialNumber,L.attDSLPurchasedFromDistributor,L.attDSLWOEId];function O(){L.id&&(L.filterWoForTotalCount=l.filter("and"),L.filterWoForTotalCount.eq("WoId",L.id),i.getItems("woassignments/estHoursTotal",L.filterWoForTotalCount).then(function(e){L.estHoursTotal=e.data.EstHoursTotal}))}function F(e){switch(e){case"assignmentsGrid":L.assignmentsGrid=!0;break;case"notesGrid":L.notesGrid=!0;break;case"laborGrid":L.laborGrid=!0;break;case"partsGrid":L.partsGrid=!0;break;case"miscGrid":L.miscGrid=!0;break;case"tasksGrid":L.tasksGrid=!0;break;case"servreportGrid":L.servreportGrid=!0;break;case"attachmentsGrid":L.attachmentsGrid=!0;break;case"formsGrid":L.formsGrid=!0;break;case"poesGrid":L.poesGrid=!0;break;case"serviceableItemGrid":L.serviceableItemGrid=!0;break;case"woPaymentGrid":L.woPaymentGrid=!0;break;case"deficiencyGrid":L.deficiencyGrid=!0;break;default:L.assignmentsGrid=!0,L.notesGrid=!0,L.laborGrid=!0,L.partsGrid=!0,L.miscGrid=!0,L.tasksGrid=!0,L.servreportGrid=!0,L.attachmentsGrid=!0,L.formsGrid=!0,L.poesGrid=!0,L.serviceableItemGrid=!0,L.woPaymentGrid=!0,L.deficiencyGrid=!0}}L.showForm=!1,L.usingDSLNorthwest?(L.woAPI="wodetails/dsl",L.woAssignmentsAPI="dslwoassignments",L.attributes=P,L.usingDSLNorthwest=!0):(L.woAPI="wodetails",L.woAssignmentsAPI="woassignments",L.attributes=W),L.showForm=!0,L.loadingIndicator=!1,O(),e.$watch("vm.model.Id",function(){if(void 0!=L.model.Id&&null!=L.model.Id&&L.model.Id>0){n.isContractorCompany(L.model).then(function(e){L.isMain=e,e||I||(1==L.model.SubInvoiced?L.model.Status="Invoiced":"Invoiced"!=L.model.Status&&"ReadytoInvoice"!=L.model.Status||(L.model.Status="Complete"))});var e=s.getValue("authorizationData");e&&e.tzDatebaseName&&(L.userTimeZoneAbbr=moment.tz(e.tzDatebaseName).zoneAbbr());var t=new Date(L.model.SysCreateUTC),o=moment.tz.zone(e.tzDatebaseName).offset(t);u.convertToLocal(t,o),i.getItem("users",L.model.SysCreatorId).then(function(){var e=i.state.item;L.model.CreatedBy=e.FirstName+" "+e.LastName+" - "+moment(t).format("MM/DD/YYYY h:mm A")+" "+L.userTimeZoneAbbr})}}),e.$watch("vm.modelSite",function(){void 0!==L.modelSite.Id&&(null==L.modelSite.Id&&L.attributesSite[0].CurrentList&&L.attributesSite[0].CurrentList.length>0&&(L.modelSite.Id=L.attributesSite[0].CurrentList[0].Id),L.filterSiteForms.reset(),L.filterSiteForms.eq("SiteId",L.model.SiteId).eq("Id",L.modelSite.Id).eq("WoId",L.filter.filterId))},!0),e.$watch("vm.model.Id",function(){L.model.Id&&(L.customer.customerId=L.model.CustomerId,L.site.siteId=L.model.SiteId,L.site.siteName=L.model.SiteName,L.site.title=L.model.ContactName,L.site.phone=L.model.ContactPhone,L.site.address=L.model.Address,L.altId=L.model.AltId,L.filter1.siteId=L.model.SiteId,L.customerFilter.customerId=L.model.CustomerId,L.filterBySite.eq("SiteId",L.model.SiteId),L.customerSiteFilter.eq("WoId",L.id).eq("CustomerId",L.model.CustomerId).eq("SiteId",L.model.SiteId),h.List=null,D.List=null,L.reloadFilter=!0,L.isFromQuote=!1,L.model.QuoteId&&(L.isFromQuote=!0,L.filterByQuote=l.filter("and"),L.filterByQuote.eq("QuoteId",L.model.QuoteId),L.hideQuoteAttachments=""),L.model.ServiceRequestId&&(L.serviceRequestFilter.reset(),L.serviceRequestFilter.eq("ServiceRequestId",L.model.ServiceRequestId),L.hideServiceRequestAttachments=""),L.usingDSLNorthwest&&c.getVisits(L.model.SiteId).then(function(e){L.model.DSLVisits=e}))}),L.WOdetailsTimezone={TzDatabaseName:"%TzDatabaseName%"},L.woForm=!0,L.btnName="Site Equipment Forms",e.$watch("vm.model.CustomerId",function(){L.model.CustomerId?(L.customerFilter.reset(),L.customerFilter.eq("Status","Active"),L.customerFilter.eq("Id",L.model.AgreementId),L.customerFilter.customerId=L.model.CustomerId,L.customerSiteFilter.reset(),L.customerSiteFilter.eq("CustomerId",L.model.CustomerId).eq("WoId",L.id),L.usingGroundBreakers&&i.getItem("customers/",L.model.CustomerId).then(function(){var e=i.state.item;y.addCustomer(e),L.serviceReportMax=1,L.customReport=e.User4})):(L.customerFilter.reset(),L.customerFilter.eq("Status","Active"),L.customerFilter.eq("Id",L.model.AgreementId),L.customerFilter.customerId=0)}),e.$watch("vm.model.SiteId",function(){L.model.SiteId&&(L.customerSiteFilter.reset(),L.customerSiteFilter.eq("CustomerId",L.model.CustomerId).eq("WoId",L.id).eq("SiteId",L.model.SiteId))}),L.assignmentsGrid=!0,L.notesGrid=!0,L.laborGrid=!1,L.partsGrid=!1,L.miscGrid=!1,L.tasksGrid=!1,L.servreportGrid=!1,L.attachmentsGrid=!1,L.formsGrid=!1,L.poesGrid=!1,L.serviceableItemGrid=!1,L.woPaymentGrid=!1,L.deficiencyGrid=!1,L.initialiseGrid=F,L.getModulePrivilege=function(e,t){return m.getModulePrivilege(e,t)},L.copyWO=function(){S.CopyWo(L.model)}}angular.module("FieldConnectApp").controller("WODetailsReadOnlyController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","restService","stateTransitionService","qsService","cryptoStorageService","currentCompanyService","guiPrivilegeService","timezoneService","dslVisitsService","featuresFactory","gbCustomFactory","copyWorkOrderFactory"]}();;!function(){"use strict";function e(e,t,a,o,r,l,i,d,n,m,s,u,c,S){var N=this;N.goHome=function(){a.go("home")},N.autoFilter=r.filter("and"),N.dateService=S,N.$state=a,N.model={},N.edit=function(e,t){n.isContractorCompany(t).then(function(t){t?a.go("workOrdersDetails",{id:e}):a.go("subcontractorWorkOrdersDetails",{id:e})})},N.wos=[],N.isLoading=!1,N.id=o.id,N.loadFilter=g,N.loginLoading=!1;var b=l.getValue("authorizationData");N.userRoles=b.userRoles.split(","),N.isSubAdmin=!1,N.viewName="ManageWorkOrders",N.moduleName="ManageWorkOrdersGrid",N.deviceDetect=c,N.currentDate=moment();var D={Name:"Invoiced",ValueName:"SubInvoiceAltId",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"InvoiceReportUrl"};function f(e,t){return u.getModulePrivilege(e,t)}function g(){if(void 0!==N.filter1.startDate){if(!S.validateDate(N.filter1.startDate))return}else N.filter1.startDate=null;if(void 0!==N.filter1.endDate){if(!S.validateDate(N.filter1.endDate))return}else N.filter1.endDate=null;if(void 0===N.filter1.startDate||void 0===N.filter1.endDate||S.validateDateRange(N.filter1.startDate,N.filter1.endDate)){for(N.isLoading=!0,""==N.model.AltId&&(N.model.AltId=null);N.autoFilter.filter.length>0;)N.autoFilter.filter.splice(0,1);if(""!=N.filter1.startDate&&null!=N.filter1.startDate){N.filter1.startDate=new Date(N.filter1.startDate),N.filter1.startDate.setHours(0,0,0,0);var t=new Date(N.filter1.startDate);d.convertToUtc(t),N.autoFilter.eq("StartDate",d.buildISOString(t))}if(""!=N.filter1.endDate&&null!=N.filter1.endDate){N.filter1.endDate=new Date(N.filter1.endDate),N.filter1.endDate.setHours(23,59,59,999);var a=new Date(N.filter1.endDate);d.convertToUtc(a),N.autoFilter.eq("EndDate",d.buildISOString(a))}N.isSubAdmin?N.autoFilter.eq("woTypeName",N.model.Name).eq("TechId",N.model.DefaultTechId).eq("Status",N.model.WoStatusName).eq("Search",N.model.Search).eq("SubcontractorList",N.model.SubcontractorId).eq("AltId",N.model.AltId):N.autoFilter.eq("woTypeName",N.model.WoTypeName).eq("TechId",N.model.DefaultTechId).eq("Status",N.model.WoStatusName).eq("Search",N.model.Search).eq("SubcontractorList",N.model.SubcontractorId).eq("AltId",N.model.AltId),N.loadWoes=!0;var o={};N.filter1.startDate&&(o.StartDate=d.buildISOString(N.filter1.startDate)),N.filter1.endDate&&(o.EndDate=d.buildISOString(N.filter1.endDate)),(N.isSubAdmin?N.model.Name:N.model.WoTypeName)&&(o.woTypeName=N.isSubAdmin?N.model.Name:N.model.WoTypeName),N.model.WoStatusName&&(o.Status=N.model.WoStatusName),N.model.Search&&(o.Search=N.model.Search),N.model.SubcontractorId&&(o.SubcontractorList=N.model.SubcontractorId),N.model.AltId&&(o.AltId=N.model.AltId);var r={};l.getValue("lastselection_"+N.UserData.Id)&&(r=l.getValue("lastselection_"+N.UserData.Id)),r.manageWo=o,l.setValue("lastselection_"+N.UserData.Id,r),N.newQuery||(N.newQuery=!1,setTimeout(function(){N.isLoading=!1,e.$apply()},1e3))}}-1!=N.userRoles.indexOf("FieldConnect")||-1!=N.userRoles.indexOf("Admin")||-1!=N.userRoles.indexOf("TransAdmin")||-1!=N.userRoles.indexOf("Office")||-1!=N.userRoles.indexOf("Dispatch")||-1!=N.userRoles.indexOf("Supervisor")?N.isSubAdmin=!1:-1!=N.userRoles.indexOf("SubAdmin")&&(N.isSubAdmin=!0),N.getModulePrivilege=f,f(),N.filter={filterId:null,siteId:null},N.filter1={woTypeName:null,status:null,TechId:0,subcontractorId:"",startDate:null,endDate:""},N.autofilter=r.filter("and"),N.attributes=[{Type:"text",Label:"Search",ModelValue:"Search"},{Type:"dropdown",Label:"Wo Type:",ApiMethod:N.isSubAdmin?"woTypes/getWoTypeForSubContractorMangeWorkOrder":"woTypes",ValueProp:N.isSubAdmin?"Name":"WoTypeName",TextProp:N.isSubAdmin?"Name":"WoTypeName",ModelValue:N.isSubAdmin?"Name":"WoTypeName"},{Type:"dropdown",Label:"Status:",ApiMethod:"wostatuses",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"WoStatusName"},{Type:"int",Label:"Work Order",ModelValue:"AltId"},{Type:"multiselect",Label:"Subcontractor:",ApiMethod:"subcontractorCompanies",ValueProp:"SubcontractorId",TextProp:"CompanyName",ModelValue:"SubcontractorId",ConvertToInt:"true"}],N.attributestab=[{Name:"Work Order",ValueName:"AltId",Edit:!0,Sortable:!0},{Name:"Wo Type",ValueName:"WoType",Edit:!1,Sortable:!0,ObjectName:"colWorkOrderType"},{Name:"Promised Date",ValueName:"PromiseDate",FormatDate:"datetime",Edit:!1,Sortable:!0,ObjectName:"colPromisedDate"},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0,ObjectName:"colStatus"},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0,ObjectName:"colCustomer"},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0,ObjectName:"colSite"},{Name:"Full Address",ValueName:"Address",Edit:!1,Sortable:!0,ObjectName:"colSiteAddress"},{Name:"Address",ValueName:"Address1",Edit:!1,Sortable:!0,ObjectName:"colMWOGSiteAddress1"},{Name:"Address2",ValueName:"Address2",Edit:!1,Sortable:!0,ObjectName:"colMWOGSiteAddress2"},{Name:"City",ValueName:"City",Edit:!1,Sortable:!0,ObjectName:"colMWOGSiteCity"},{Name:"State",ValueName:"StateCode",Edit:!1,Sortable:!0,ObjectName:"colMWOGSiteStateCode"},{Name:"Postal Code",ValueName:"PostalCode",Edit:!1,Sortable:!0,ObjectName:"colMWOGSitePostalCode"},{Name:"Country",ValueName:"Country",Edit:!1,Sortable:!0,ObjectName:"colMWOGSiteCountry"},{Name:"Site Time Zone",ValueName:"TimeZoneName",Edit:!1,Sortable:!0,ObjectName:"colTimeZone"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0,ObjectName:"colDescription"},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!0,ObjectName:"colOffice"},{Name:"Agreement",ValueName:"AgreementDesc",Edit:!1,Sortable:!0,ObjectName:"colAgreement"},{Name:"PO Number",ValueName:"CustomerPONum",Edit:!1,Sortable:!0,ObjectName:"colMWOGCustomerPoNumber"},{Name:"Subcontractor",ValueName:"CompanyName",Edit:!1,Sortable:!0,ObjectName:"colSubContractor"},{Name:"Sub Bill",ValueName:"SubInvoiceAltId",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"InvoiceReportUrl",ObjectName:"colSubBill"}],N.loadingIndicator=!1,e.$watch("vm.isSubAdmin",function(){1==N.isSubAdmin&&(N.attributestab[11]=D)}),N.manageWOTimezone={TzDatabaseName:"%TzDatabaseName%"},N.loadWoes=!1,m.getCurrentUserData().then(function(t){N.isLoading=!0,N.UserData=t;var a=l.getValue("lastselection_"+N.UserData.Id);m.getUserSetting("DisableInitialManageWorkordersSearch").then(function(t){N.disableInitialManageWorkordersSearch=!1,null!==t&&(N.disableInitialManageWorkordersSearch=JSON.parse(t.toLowerCase())),a&&a.manageWo?s(function(){a.manageWo.StartDate&&(N.filter1.startDate=d.parseISOString(a.manageWo.StartDate)),a.manageWo.EndDate&&(N.filter1.endDate=d.parseISOString(a.manageWo.EndDate)),a.manageWo.woTypeName&&(N.isSubAdmin?N.model.Name=a.manageWo.woTypeName:N.model.WoTypeName=a.manageWo.woTypeName),a.manageWo.Status&&(N.model.WoStatusName=a.manageWo.Status),a.manageWo.Search&&(N.model.Search=a.manageWo.Search),a.manageWo.SubcontractorList&&(N.model.SubcontractorId=a.manageWo.SubcontractorList),a.manageWo.AltId&&(N.model.AltId=a.manageWo.AltId),N.disableInitialManageWorkordersSearch?setTimeout(function(){N.isLoading=!1,e.$apply()}):g()}):n.getCompanySettings().then(function(t){N.viewWorkOrdersDaysBack=n.getViewWorkOrdersDaysBack,N.viewWorkOrdersDaysForward=n.getViewWorkOrdersDaysForward,N.filter1.startDate=moment(N.currentDate).add(-1*N.viewWorkOrdersDaysBack,"days").format("MM/DD/YYYY"),N.filter1.endDate=moment(N.currentDate).add(N.viewWorkOrdersDaysForward,"days").format("MM/DD/YYYY"),N.disableInitialManageWorkordersSearch?setTimeout(function(){N.isLoading=!1,e.$apply()}):g()})})}),N.onLast=function(){setTimeout(function(){N.newQuery=!1,N.isLoading=!1,e.$apply()},100)},N.newQuery=!0,e.$watch("vm.autoFilter",function(e,t){e!==t&&(N.newQuery=!0)},!0)}angular.module("FieldConnectApp").controller("ManageWorkOrderController",e),e.$inject=["$scope","$location","$state","$stateParams","qsService","cryptoStorageService","restService","timezoneService","currentCompanyService","currentUserService","$timeout","guiPrivilegeService","deviceDetector","dateService"]}();;!function(){"use strict";function e(e,o,t,r,n,a,i,l,s,u,d,m){var I=this;I.stringToArray=i,I.$scope=e,I.close=F,I.onSubmit=function(){if(0==I.partCoversionItems.length&&0==I.miscCoversionItems.length&&0==I.laborCoversionItems.length&&0==I.noteCoversionItems.length)return void F();var o=!1;if(a.Enumerable().From(I.partCoversionItems).ForEach(function(e){if(function(e){var o=b(e.QuoteItemId),t=!1;return e.Quantity||void 0!=e.Quantity&&0==e.Quantity?o.Quantity=!1:(o.Quantity=!0,t=!0),e.Price||void 0!=e.Price&&0==e.Price?o.Price=!1:(o.Price=!0,t=!0),e.Cost||void 0!=e.Cost&&0==e.Cost?o.Cost=!1:(o.Cost=!0,t=!0),e.Serialized&&(e.SerialNum&&""!=e.SerialNum?o.SerialNum=!1:(o.SerialNum=!0,t=!0)),t}(e)){o=!0,I.drilldownOpenPart[e.QuoteItemId]||(I.drilldownOpenPart[e.QuoteItemId]=!I.drilldownOpenPart[e.QuoteItemId]);var t=angular.element(document.querySelector("#collapseConversionTreeToogle"));"collapsed"==t[0].className&&t[0].click()}}),a.Enumerable().From(I.miscCoversionItems).ForEach(function(e){if(function(e){var o=p(e.QuoteItemId),t=!1;return e.WoItemName&&""!=e.WoItemName?o.WoItemName=!1:(o.WoItemName=!0,t=!0),e.Quantity||void 0!=e.Quantity&&0==e.Quantity?o.Quantity=!1:(o.Quantity=!0,t=!0),e.Price||void 0!=e.Price&&0==e.Price?o.Price=!1:(o.Price=!0,t=!0),e.Cost||void 0!=e.Cost&&0==e.Cost?o.Cost=!1:(o.Cost=!0,t=!0),t}(e)){o=!0,I.drilldownOpenMisc[e.QuoteItemId]||(I.drilldownOpenMisc[e.QuoteItemId]=!I.drilldownOpenMisc[e.QuoteItemId]);var t=angular.element(document.querySelector("#collapseConversionTFourToogle"));"collapsed"==t[0].className&&t[0].click()}}),a.Enumerable().From(I.laborCoversionItems).ForEach(function(e){if(function(e){var o=C(e.QuoteLaborId),t=!1;return e.LaborCodeName&&""!=e.LaborCodeName?o.LaborCodeName=!1:(o.LaborCodeName=!0,t=!0),e.Hours||void 0!=e.Hours&&0==e.Hours?o.Hours=!1:(o.BillHours=!0,t=!0),e.WorkHours||void 0!=e.WorkHours&&0==e.WorkHours?o.WorkHours=!1:(o.WorkHours=!0,t=!0),e.PayRateId||void 0!=e.PayRateId&&0==e.PayRateId?o.PayRateId=!1:(o.PayRateId=!0,t=!0),e.Date&&""!=e.Date?o.Date=!1:(o.Date=!0,t=!0),e.ListEmployeeIds&&e.ListEmployeeIds.length>0?o.ListEmployeeIds=!1:(o.ListEmployeeIds=!0,t=!0),t}(e)){o=!0,I.drilldownOpenLabor[e.QuoteLaborId]||(I.drilldownOpenLabor[e.QuoteLaborId]=!I.drilldownOpenLabor[e.QuoteLaborId]);var t=angular.element(document.querySelector("#collapseConversionTwoToogle"));"collapsed"==t[0].className&&t[0].click()}}),a.Enumerable().From(I.noteCoversionItems).ForEach(function(e){if(function(e){var o=N(e.QuoteNoteId),t=!1;return e.Note&&""!=e.Note?o.Note=!1:(o.Note=!0,t=!0),void 0!=e.Viewable?o.Viewable=!1:(o.Viewable=!0,t=!0),t}(e)){o=!0,I.drilldownOpenNote[e.QuoteNoteId]||(I.drilldownOpenNote[e.QuoteNoteId]=!I.drilldownOpenNote[e.QuoteNoteId]);var t=angular.element(document.querySelector("#collapseConversionOneToogle"));"collapsed"==t[0].className&&t[0].click()}}),o)return void s.warning({message:"Please fill in required fields!"});var t={Parts:I.partCoversionItems,Misc:I.miscCoversionItems,Labor:I.laborCoversionItems,Notes:I.noteCoversionItems};I.disableSubmit=!0,r.create("quoteconversion",t).then(function(o){s.success({message:"Line items has been successfully converted."}),e.$broadcast("wo.loadQuoteItemsHeaders"),F(!0)})};var c=e.quoteId;I.quoteConversionData={};var f=m.getValue("authorizationData").userRoles.split(",");I.isBackOffice=!1;for(var v=0;v<f.length;v++)if("Admin"==f[v]||"FieldConnect"==f[v]||"Dispatch"==f[v]||"Office"==f[v]){I.isBackOffice=!0;break}function b(e){return a.Enumerable().From(I.partFormsValidation).Where(function(o){return o.QuoteItemId==e}).FirstOrDefault()}function p(e){return a.Enumerable().From(I.miscFormsValidation).Where(function(o){return o.QuoteItemId==e}).FirstOrDefault()}function C(e){return a.Enumerable().From(I.laborFormsValidation).Where(function(o){return o.QuoteLaborId==e}).FirstOrDefault()}function N(e){return a.Enumerable().From(I.noteFormsValidation).Where(function(o){return o.QuoteNoteId==e}).FirstOrDefault()}function F(o){I.modalClass=!1,e.close(o,200)}I.lineItems={},I.loadingData=!1,I.disableSubmit=!1,c&&(I.loadingData=!0,r.getItem("quoteconversion",c).then(function(e){I.quoteConversionData=e.data,u.processCoverage(I.quoteConversionData.Agreement),I.lineItems=d.prepareLineItemsData(I.quoteConversionData),0==I.lineItems.partLineItems.avalaibleForConversion.length&&0==I.lineItems.miscLineItems.avalaibleForConversion.length&&0==I.lineItems.laborLineItems.avalaibleForConversion.length&&0==I.lineItems.noteLineItems.avalaibleForConversion.length&&(I.disableSubmit=!0),I.loadingData=!1})),I.modalClass=!1,l(function(){I.modalClass=!0}),I.partCoversionItems=[],I.getPartLineItemModel=function(e){return a.Enumerable().From(I.partCoversionItems).Where(function(o){return o.QuoteItemId==e}).FirstOrDefault()},I.miscCoversionItems=[],I.getMiscLineItemModel=function(e){return a.Enumerable().From(I.miscCoversionItems).Where(function(o){return o.QuoteItemId==e}).FirstOrDefault()},I.laborCoversionItems=[],I.getLaborLineItemModel=function(e){return a.Enumerable().From(I.laborCoversionItems).Where(function(o){return o.QuoteLaborId==e}).FirstOrDefault()},I.noteCoversionItems=[],I.getNoteLineItemModel=function(e){return a.Enumerable().From(I.noteCoversionItems).Where(function(o){return o.QuoteNoteId==e}).FirstOrDefault()},I.partFormsValidation=[],I.getPartFormsValidation=b,I.miscFormsValidation=[],I.getMiscFormsValidation=p,I.laborFormsValidation=[],I.getLaborFormsValidation=C,I.noteFormsValidation=[],I.getNoteFormsValidation=N,I.prepareWoPart=function(e){l(function(){e.Convert?null!=e.ItemId&&r.getItem("items",e.ItemId).then(function(){var o=r.state.item,t={QuoteId:e.QuoteId,WoId:I.quoteConversionData.Wo.Id,QuoteItemId:e.Id,ItemName:e.ItemName,ItemId:e.ItemId,Quantity:e.Quantity,Price:e.Price,Billable:!0,Cost:0,LocationId:e.LocationId,LocationName:e.LocationName,Note:e.Note,Serialized:!1,SerialNum:null},n={QuoteItemId:e.Id,Quantity:!1,Price:!1,Cost:!1,SerialNum:!1};1==o.Serialized&&(t.Serialized=!0),I.partCoversionItems.push(t),I.partFormsValidation.push(n)}):-1!=a.Enumerable().From(I.partCoversionItems).Select(function(e){return e.QuoteItemId}).IndexOf(e.Id)&&(I.partCoversionItems.splice(a.Enumerable().From(I.partCoversionItems).Select(function(e){return e.QuoteItemId}).IndexOf(e.Id)),I.partFormsValidation.splice(a.Enumerable().From(I.partFormsValidation).Select(function(e){return e.QuoteItemId}).IndexOf(e.Id)),I.drilldownOpenPart[e.Id]&&(I.drilldownOpenPart[e.Id]=!I.drilldownOpenPart[e.Id]))})},I.prepareWoMisc=function(e){l(function(){if(e.Convert){if(null!=e.ItemId){var o={QuoteId:e.QuoteId,WoId:I.quoteConversionData.Wo.Id,QuoteItemId:e.Id,ItemName:e.ItemName,WoItemName:e.ItemName,ItemId:e.ItemId,Quantity:e.Quantity,Price:e.Price,Billable:!0,Cost:0,Note:e.Note},t={QuoteItemId:e.Id,WoItemName:!1,Quantity:!1,Price:!1,Cost:!1};I.miscCoversionItems.push(o),I.miscFormsValidation.push(t)}}else-1!=a.Enumerable().From(I.miscCoversionItems).Select(function(e){return e.QuoteItemId}).IndexOf(e.Id)&&(I.miscCoversionItems.splice(a.Enumerable().From(I.miscCoversionItems).Select(function(e){return e.QuoteItemId}).IndexOf(e.Id)),I.miscFormsValidation.splice(a.Enumerable().From(I.miscFormsValidation).Select(function(e){return e.QuoteItemId}).IndexOf(e.Id)),I.drilldownOpenMisc[e.Id]&&(I.drilldownOpenMisc[e.Id]=!I.drilldownOpenMisc[e.Id]))})},I.prepareWoLabor=function(e){l(function(){if(e.Convert){if(null!=e.LaborCode){var o={QuoteId:e.QuoteId,WoId:I.quoteConversionData.Wo.Id,QuoteLaborId:e.Id,LaborCodeName:e.LaborCode,Hours:e.BillHours,WorkHours:e.BillHours,PayRateId:e.PayRateId,Cost:0,Rate:e.Rate,Billable:!0,Note:e.Note},t={QuoteLaborId:e.Id,LaborCodeName:!1,Hours:!1,WorkHours:!1,PayRateId:!1,Date:!1,ListEmployeeIds:!1};I.laborCoversionItems.push(o),I.laborFormsValidation.push(t)}}else-1!=a.Enumerable().From(I.laborCoversionItems).Select(function(e){return e.QuoteLaborId}).IndexOf(e.Id)&&(I.laborCoversionItems.splice(a.Enumerable().From(I.laborCoversionItems).Select(function(e){return e.QuoteLaborId}).IndexOf(e.Id)),I.laborFormsValidation.splice(a.Enumerable().From(I.laborFormsValidation).Select(function(e){return e.QuoteLaborId}).IndexOf(e.Id)),I.drilldownOpenLabor[e.Id]&&(I.drilldownOpenLabor[e.Id]=!I.drilldownOpenLabor[e.Id]))})},I.prepareWoNote=function(e){l(function(){if(e.Convert){if(null!=e.Note){var o={WoId:I.quoteConversionData.Wo.Id,QuoteNoteId:e.Id,Note:e.Note,Viewable:JSON.parse(e.Viewable.toLowerCase())},t={QuoteNoteId:e.Id,Note:!1,Viewable:!1};I.noteCoversionItems.push(o),I.noteFormsValidation.push(t)}}else-1!=a.Enumerable().From(I.noteCoversionItems).Select(function(e){return e.QuoteNoteId}).IndexOf(e.Id)&&(I.noteCoversionItems.splice(a.Enumerable().From(I.noteCoversionItems).Select(function(e){return e.QuoteNoteId}).IndexOf(e.Id)),I.noteFormsValidation.splice(a.Enumerable().From(I.noteFormsValidation).Select(function(e){return e.QuoteNoteId}).IndexOf(e.Id)),I.drilldownOpenNote[e.Id]&&(I.drilldownOpenNote[e.Id]=!I.drilldownOpenNote[e.Id]))})},I.taxRatePartClick=function(e){l(function(){e.Taxable?e.TaxRate=I.quoteConversionData.Wo.TaxRatePart:e.TaxRate=null})},I.taxRateMiscClick=function(e){l(function(){e.Taxable?e.TaxRate=I.quoteConversionData.Wo.TaxRateMisc:e.TaxRate=null})},I.taxRateLaborClick=function(e){l(function(){e.Taxable?e.TaxRate=I.quoteConversionData.Wo.TaxRateLabor:e.TaxRate=null})},I.workHoursChanged=function(e){I.isBackOffice||(e.Hours=e.WorkHours)},I.payRateChanged=function(e,o){null==e.RateMultiplier&&null==e.RateHour?o.Rate=I.quoteConversionData.RateSheet.LaborRateHour:null!=e.RateMultiplier?o.Rate=I.quoteConversionData.RateSheet.LaborRateHour*e.RateMultiplier:o.Rate=e.RateHour;o.Rate=o.Rate.toFixed(2)},I.drilldownOpenPart=[],I.drilldownOpenMisc=[],I.drilldownOpenLabor=[],I.drilldownOpenNote=[],I.toggleDrilldown=function(e,o){switch(o){case"Parts":I.drilldownOpenPart[e]=!I.drilldownOpenPart[e];break;case"Misc":I.drilldownOpenMisc[e]=!I.drilldownOpenMisc[e];break;case"Labor":I.drilldownOpenLabor[e]=!I.drilldownOpenLabor[e];break;case"Note":I.drilldownOpenNote[e]=!I.drilldownOpenNote[e]}}}angular.module("FieldConnectApp").controller("QuoteConversionLineItemsController",e),e.$inject=["$scope","$location","$state","restService","qsService","$linq","stringToArrayService","$timeout","Notification","agreementCoverageService","lineItemsTransformationService","cryptoStorageService"]}();;!function(){"use strict";function e(e,t,o,a,l,d){var r=this;r.edit=!1,r.autoFilterCustomer=l.filter("and"),r.autoFilterCustomer.eq("CustomerId",e.customerId),r.model={};var s=d.getValue("authorizationData").userRoles.split(",");r.showAdd=!0;for(var i=0;i<s.length;i++)"CustAdmin"!=s[i]&&"Cust"!=s[i]||(r.showAdd=!1);r.sites=[],r.search=function(){r.autoFilterCustomer.reset(),r.autoFilterCustomer.eq("CustomerId",e.customerId),""!=r.siteFilter.search&&r.autoFilterCustomer.like("SiteName","%"+r.siteFilter.search+"%")},r.$scope=e,r.close=function(){r.modalClass=!1,e.close(null,50)},r.siteId=0,r.setCustomer=n;var u=!1,m=!1;function n(){e.customerId&&(a.getItem("customers/"+e.customerId).then(function(){r.customer=a.state.item,r.model.CustomerId=e.customerId,r.model.Address1=r.customer.Address1,r.model.Address2=r.customer.Address2,r.model.City=r.customer.City,r.model.StateCode=r.customer.StateCode,r.model.PostalCode=r.customer.PostalCode,r.model.Country=r.customer.Country,r.model.FirstName=r.customer.ContactFirstName,r.model.LastName=r.customer.ContactLastName,r.model.Phone=r.customer.ContactPhone,r.model.Cell=r.customer.ContactCell,r.model.Fax=r.customer.ContactFax,r.model.Email=r.customer.ContactEmail}),r.customerEdit.ReadOnly=!0)}r.moduleName="Site",r.viewName=e.viewName,r.attributes=[{Name:"Customer",ValueName:"CustomerName",Sortable:!0},{Name:"Site Code",ValueName:"SiteCode",Sortable:!0},{Name:"Site Name",ValueName:"SiteName",Sortable:!0},{Name:"Address",ValueName:"FullAddress",Sortable:!0},{Name:"Contact",ValueName:"ContactName",Edit:!1,Sortable:!1},{Name:"Phone",ValueName:"Phone",Sortable:!0},{Name:"Email",ValueName:"Email",Sortable:!0}],r.customerEdit={Type:"dropdown",Label:"Customer:",Required:!0,ApiMethod:"customers/getcustomer",ValueProp:"Id",TextProp:"CustomerName",ModelValue:"CustomerId",ConvertToInt:"true",Autofocus:"true"},r.attributesEdit=[r.customerEdit,{Type:"dropdown",Label:"Office:",Required:!0,ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true"},{Type:"text",Label:"Site Name:",Required:!0,MaxLength:"50",ModelValue:"SiteName"},{Type:"text",CustomDivClass:"col-sm-6 col-lg-6 visibilityNone"},{Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc"},{Type:"text",Label:"Site Code:",MaxLength:"50",ModelValue:"SiteCode"},{Type:"text",Label:"Contact Title:",MaxLength:"50",ModelValue:"Title"},{Type:"text",Label:"Address:",MaxLength:"50",ModelValue:"Address1"},{Type:"text",Label:"First Name:",MaxLength:"50",ModelValue:"FirstName"},{Type:"text",Label:"",MaxLength:"50",ModelValue:"Address2"},{Type:"text",Label:"Last Name:",MaxLength:"50",ModelValue:"LastName"},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"City"},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"Phone"},{Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"StateCode"},{Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"Cell"},{Type:"text",Label:"Postal Code:",MaxLength:"50",ModelValue:"PostalCode"},{Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"Fax"},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country"},{Type:"email",Label:"Email:",MaxLength:"50",ModelValue:"Email"},{Type:"dropdown",Label:"Default Tech:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"DefaultTechId",ConvertToInt:"true"},{Type:"dropdown",Label:"Rate Sheet:",Required:!0,ApiMethod:"ratesheets",ValueProp:"Id",TextProp:"RateSheetName",ModelValue:"RateSheetId",ConvertToInt:"true"},{Type:"dropdown",Label:"Currency Code:",Required:!0,ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode"},{Type:"dropdown",Label:"Tax Rate ID:",ApiMethod:"taxrates",ValueProp:"Id",TextProp:"TaxName",ModelValue:"TaxRateId",ConvertToInt:"true"},{Type:"dropdown",Label:"Time zone:",ApiMethod:"timezones",ValueProp:"Id",TextProp:"TimeZoneName",ModelValue:"TimeZoneId",Required:!0}],r.id&&(u=!0,m=!0),e.$watch("vm.edit",function(){r.edit&&n()}),e.$watch("vm.model.CustomerId",function(){r.model.CustomerId?u?u=!1:a.getItem("customers/"+r.model.CustomerId).then(function(){r.customer=a.state.item,r.model.OfficeId=r.customer.OfficeId}):r.model.OfficeId=null}),e.$watch("vm.model.OfficeId",function(){r.model.OfficeId?m?m=!1:a.getItem("offices/"+r.model.OfficeId).then(function(){r.office=a.state.item,r.model.Country=r.office.Country,r.model.CurrencyCode=r.office.CurrencyCode,r.model.TimeZoneId=r.office.TimeZoneId}):(r.model.Country=null,r.model.CurrencyCode=null,r.model.TimeZoneId=null)}),e.$watch("vm.siteId",function(){if(r.siteId>0){e.site.siteId=r.siteId;for(var t=0;t<r.sites.length;t++)if(r.sites[t].Id==r.siteId){e.site.siteName=r.sites[t].SiteName,e.site.siteCode=r.sites[t].SiteCode,e.site.contactId=r.sites[t].ContactId,e.site.title=r.sites[t].Title,e.site.phone=r.sites[t].Phone,e.site.address=r.sites[t].FullAddress;break}r.close()}})}angular.module("FieldConnectApp").controller("SelectSiteDetailsController",e),e.$inject=["$scope","$location","$state","restService","qsService","cryptoStorageService"]}();;!function(){"use strict";function e(e,t,o,a,r,i,s,d,n,l,m,u,c,p,S,I){var f=this;f.$state=o,f.updateStatus=function(){return I.getLocation().then(function(e){var t={Status:f.model.Status},o=e.coords.latitude,a=e.coords.longitude;null!==o&&(t.Latitude=o),null!==a&&(t.Longitude=a),i.update("wo/status/"+f.id,t).then(function(){l.success({message:"Work order has been successfully updated."}),k()})})},f.checkTotalCount=g,f.woNumber="",f.altId=0,f.model={},f.modelSite={},f.changeForms=function(){f.woForm=!f.woForm,f.woForm?f.btnName="Site Equipment Forms":(f.filterSiteForms.reset(),f.filterSiteForms.eq("SiteId",f.model.SiteId).eq("Id",f.modelSite.Id).eq("WoId",f.filter.filterId),f.btnName="Work Order Forms")},f.filter={filterId:a.id},f.filter1={siteId:null,rateSheetId:null},f.workorderData={isSubAdmin:!1,AltId:null,SubcontractorId:null},f.partsData={partsCovered:!1},f.miscData={miscCovered:!1},f.laborData={laborMarkup:0,laborCovered:!1},f.reloadFilter=!0,f.count=0,f.estHoursTotal=0,$(window).focus(function(){f.reloadFilter=!1,e.$apply(),f.reloadFilter=!0,e.$apply()}),f.filterByWorkOrder=d.filter("and"),f.filterByWorkOrder.eq("WoId",f.filter.filterId),f.filterByMainCompany=d.filter("and"),f.filterBySite=d.filter("and"),f.filterSiteForms=d.filter("and"),f.customer={customerId:0},f.customers=[],f.site={siteId:0},f.id=a.id,f.companyAutoCompleteWO={},i.getItem("settings/status?type=AutoCompleteWO").then(function(e){f.companyAutoCompleteWO=e.data}),f.taskGrid=!1,f.poGrid=!1,f.addTask=!0,f.companySettings=[],i.getItems("companysettings").then(function(e){f.companySettings=e.data.Data;for(var t=0;t<f.companySettings.length;t++)"POGrid"==f.companySettings[t].Name&&0!=f.companySettings[t].Id&&null!=f.companySettings[t].Value&&(f.poGrid=JSON.parse(f.companySettings[t].Value.toLowerCase())),"TaskGrid"==f.companySettings[t].Name&&0!=f.companySettings[t].Id&&null!=f.companySettings[t].Value&&(f.taskGrid=JSON.parse(f.companySettings[t].Value.toLowerCase()))});var y=[];i.getItems("usersettings").then(function(e){y=e.data.Data;for(var t=0;t<y.length;t++){if("OpenAllPanels"==y[t].Name&&0!=y[t].Id&&null!=y[t].Value)JSON.parse(y[t].Value.toLowerCase())&&($('.panel-collapse:not(".in")').collapse("show"),L())}}),e.$watch("vm.model.Id",function(){f.model.Id&&c.isContractorCompany(f.model).then(function(e){e?o.go("workOrdersDetails",{id:wo.Id}):f.model.SubInvoiced&&o.go("workOrdersDetailsReadOnly",{id:wo.Id})})}),f.WOdetailsTimezone={TzDatabaseName:"%TzDatabaseName%"},f.companyWoStatus={},f.companyAssignmentStatus={},f.formswo=[],f.allAssignmentsCompleted=!1;var C={Type:"button",Name:"InvoiceBtn",Label:"Create Invoice",onClick:function(){var e={};s.selectiveExtend(e,f,["workorderData"]),s.setTransitionParam("createInvoice",e),o.go("createInvoiceForSubcontractor")},Roles:["Admin","SubAdmin","Office"]},b={Type:"empty"};f.attributesSite=[{Type:"dropdown",Label:"Forms",Required:!1,ApiMethod:"forms/getforSiteEquipmentDropdown",ValueProp:"Id",TextProp:"Name",ModelValue:"Id",Filter:f.filterByWorkOrder}];var v=e.$watch("vm.attributesSite[0].CurrentList",function(){f.attributesSite[0].CurrentList&&f.attributesSite[0].CurrentList.length>0&&(f.modelSite.Id=f.attributesSite[0].CurrentList[0].Id,f.filterSiteForms.reset(),f.filterSiteForms.eq("SiteId",f.model.SiteId).eq("Id",f.modelSite.Id).eq("WoId",f.filter.filterId),v())}),w={Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"wostatuses/getStatusForSubContractorMangeWorkOrder",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"Status",Filter:f.filterByMainCompany,List:[]};f.attributes=[{Type:"text",Label:"Customer:",MaxLength:"50",ModelValue:"CustomerName",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Site:",MaxLength:"50",ModelValue:"SiteName",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc",Autofocus:"true",ReadOnly:!0},{Type:"text",Label:"Address",MaxLength:"100",ModelValue:"Address",ReadOnly:!0},w,{Type:"text",Label:"Requestor:",MaxLength:"100",ModelValue:"ContactName",ReadOnly:!0},{Type:"text",Label:"Work Order Type:",ModelValue:"WoType",ReadOnly:!0},{Type:"text",Label:"Phone:",MaxLength:"50",ModelValue:"ContactPhone",ReadOnly:!0},{Type:"text",Label:"Priority:",ModelValue:"Priority",ReadOnly:!0},{Type:"datepicker",Label:"Promise Date:",Required:!0,ModelValue:"PromiseDate",Format:"MM/dd/yyyy",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"TimeZone",ModelValue:"TimeZoneName",ReadOnly:!0}],f.loadingIndicator=!1;var h="";function g(){f.id&&(f.filterWoForTotalCount=d.filter("and"),f.filterWoForTotalCount.eq("WoId",f.id),i.getItems("woassignments/estHoursTotal",f.filterWoForTotalCount).then(function(e){f.estHoursTotal=e.data.EstHoursTotal}))}g(),e.$watch("vm.model.Status",function(){void 0!=f.model.Status&&("Invoiced"==f.model.Status?h=f.model.Status:""==h&&(h=f.model.Status)),"Invoiced"!=f.model.Status&&"ReadyToInvoice"!=f.model.Status||(f.model.Status="Complete")}),e.$watch("vm.modelSite",function(){void 0!==f.modelSite.Id&&(null==f.modelSite.Id&&f.attributesSite[0].CurrentList&&f.attributesSite[0].CurrentList.length>0&&(f.modelSite.Id=f.attributesSite[0].CurrentList[0].Id),f.filterSiteForms.reset(),f.filterSiteForms.eq("SiteId",f.model.SiteId).eq("Id",f.modelSite.Id).eq("WoId",f.filter.filterId))},!0),f.woForm=!0,f.btnName="Site Equipment Forms",e.$watch("vm.model.Id",function(){f.model.Id&&(f.customer.customerId=f.model.CustomerId,f.site.siteId=f.model.SiteId,f.site.siteName=f.model.SiteName,f.site.title=f.model.ContactName,f.site.phone=f.model.ContactPhone,f.site.address=f.model.Address,f.altId=f.model.AltId,f.subcontractorId=f.model.SubContractorId,f.woCompanyId=f.model.CompanyId,f.filterByMainCompany.reset(),f.filterByMainCompany.eq("CompanyId",f.model.CompanyId),f.workorderData.AltId=f.model.AltId,f.workorderData.Status=f.model.Status,f.workorderData.CustomerId=f.model.CustomerId,f.workorderData.SiteId=f.model.SiteId,f.workorderData.PaymentTermId=f.model.PaymentTermId,f.workorderData.CustomerName=f.model.CustomerName,f.workorderData.SiteName=f.model.SiteName,f.workorderData.SubcontractorId=f.model.SubContractorId,f.workorderData.WorkOrderId=f.model.Id,f.workorderData.TimeZoneName=f.model.TimeZoneName,f.workorderData.PromiseDate=f.model.PromiseDate,f.filter1.siteId=f.model.SiteId,f.filterBySite.eq("SiteId",f.model.SiteId),k(),w.List=null)}),e.$watch("vm.allAssignmentsCompleted",function(){if(void 0!=f.allAssignmentsCompleted&&void 0!=h){var e=f.companyAutoCompleteWO.Value;e&&"true"==e.toLowerCase()&&"Invoiced"!=h&&(h="Complete",f.model.Status="Complete",k())}});var T=0;function k(e){i.getItem("wo/checkinvoice",f.filter.filterId).then(function(e){f.notInvoiced=e.data.NotInvoiced,G(0)})}function G(t){var o=!1;if("ReadyToInvoice"!=f.model.Status&&"Invoiced"!=f.model.Status&&"Complete"!=f.model.Status||(o=!0),o&&f.notInvoiced-t>0){f.existInvBtn=!1;for(var a=f.attributes.length-1;a>=0;a--)"InvoiceBtn"==f.attributes[a].Name&&(f.existInvBtn=!0);f.existInvBtn||f.attributes.push(C)}else for(a=f.attributes.length-1;a>=0;a--)"InvoiceBtn"==f.attributes[a].Name&&(f.attributes.splice(a,1),f.attributes.push(b),u(function(){e.$apply(),f.attributes.splice(a,1)}))}function L(e){switch(e){case"assignmentsGrid":f.assignmentsGrid=!0;break;case"notesGrid":f.notesGrid=!0;break;case"laborGrid":f.laborGrid=!0;break;case"partsGrid":f.partsGrid=!0;break;case"miscGrid":f.miscGrid=!0;break;case"tasksGrid":f.tasksGrid=!0;break;case"servreportGrid":f.servreportGrid=!0;break;case"attachmentsGrid":f.attachmentsGrid=!0;break;case"formsGrid":f.formsGrid=!0;break;default:f.assignmentsGrid=!0,f.notesGrid=!0,f.laborGrid=!0,f.partsGrid=!0,f.miscGrid=!0,f.tasksGrid=!0,f.servreportGrid=!0,f.attachmentsGrid=!0,f.formsGrid=!0}}e.$on("wo.itemChange",function(e,t){G(--T)}),e.$on("wo.itemDelete",function(e,t){G(++T)}),e.$watch("vm.model.RateSheetId",function(){null!=f.model.RateSheetId&&f.model.RateSheetId>0&&(f.filter1.rateSheetId=f.model.RateSheetId)}),f.WOdetailsTimezone={TzDatabaseName:"%TzDatabaseName%"},f.assignmentsGrid=!0,f.notesGrid=!0,f.laborGrid=!1,f.partsGrid=!1,f.miscGrid=!1,f.tasksGrid=!1,f.servreportGrid=!1,f.attachmentsGrid=!1,f.formsGrid=!1,f.initialiseGrid=L}angular.module("FieldConnectApp").controller("SubcontractorWorkOrderDetails",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","restService","stateTransitionService","qsService","cryptoStorageService","Notification","$q","$timeout","currentCompanyService","timezoneService","$window","fcGeoLocationService"]}();;!function(){"use strict";function e(e,t,o,a,r,i,d,l,s,n,m,u,c,p,S,I,b,C,T,y,h,f,g,v,N){var L=this;L.viewName="WorkOrderDetails",L.moduleName="WODetailsHeader";var D=s.getValue("authorizationData").userRoles.split(","),P=!1,w=!1,W=!1,R=!1;L.checkInvoiceBtn=ae,L.changeForms=function(){L.woForm=!L.woForm,L.woForm?L.btnName="Site Equipment Forms":L.btnName="Work Order Forms"},L.checkForms=!1,L.woForm=!0,L.isFromQuote=!1;var x=Ie(L.viewName,"Parts");L.laborIsActive=!1,L.addPart=!0,10!==x&&2!==x||(L.addPart=!1);var A=Ie(L.viewName,"Task");L.addTask=!0,10!==A&&2!==A||(L.addTask=!1);for(var F=h.roleTypes,O=0;O<D.length;O++)"Admin"==D[O]||"Office"==D[O]||"TransAdmin"==D?w=!0:"FieldConnect"==D[O]&&(W=!0);if(!w&&!W)for(O=0;O<D.length;O++){if("SubAdmin"==D[O]){P=!0;break}if("Supervisor"==D[O]){R=!0;break}}L.roleUsingPayments=!1,(h.isAdmin||h.isDispatch||h.isSupervisor||h.isTechnician)&&(L.roleUsingPayments=!0),L.usingDSLNorthwest=y.usingDSLNorthwest,L.showWoPayment=y.usingFCPayments,L.isReadOnly=!1,L.woAPI="wodetails",L.woAssignmentsAPI="woassignments",L.usingDSLNorthwest&&(L.woAPI="wodetails/DSL",L.woAssignmentsAPI="dslwoassignments"),L.usingGroundBreakers=y.usingGroundBreakers,L.customReport=!1,L.serviceReportCount=0,L.serviceReportMax=99,L.serviceReportAPI="woservicereports",L.usingGroundBreakers&&(L.serviceReportAPI="gbwoservicereports"),L.viewQuoteAttachments=!1,L.usingQuoting=y.usingQuoting,L.hideAddButton=!1,e.$watch("vm.count",function(e,t){e!==t&&(L.hideAddButton=!1,L.count>0&&L.usingDSLNorthwest&&(L.hideAddButton=!0))}),L.$state=o,L.isSubAdmin=P,L.isAdmin=w,L.selectCustomer=se,L.selectSite=ne,L.editWo=function(){if(L.laborIsActive&&L.currentStatus!==L.model.Status)return L.model.Status=L.currentStatus,void m.warning("Labor in progress! Work Order Status cannot be changed.");return g.getLocation("WorkOrder").then(function(e){var t=s.getValue("authorizationData");t&&t.tzDatebaseName&&(L.tzName=t.tzDatebaseName,L.userTimeZone=moment.tz(L.tzName).zoneAbbr());var o,a,r=angular.copy(L.model),d=e.coords.latitude,l=e.coords.longitude;if(null!==d&&(r.Latitude=d),null!==l&&(r.Longitude=l),r.RequestDate){var n=new Date(r.RequestDate);o=n,a=new Date,o.setHours(a.getHours()),o.setMinutes(a.getMinutes()),o.setSeconds(a.getSeconds()),n=o;var p=moment.tz.zone(t.tzDatebaseName).offset(n);S.convertToUtc(n,p),r.RequestDate=S.buildISOString(n)}var I=new Date(r.PromiseDate);S.convertToUtc(I,p),r.PromiseDate=S.buildISOString(I),L.model.QuoteId&&("Complete"===L.model.Status&&"Complete"!==L.InitialStatus||"ReadyToInvoice"===L.model.Status&&"ReadyToInvoice"!==L.InitialStatus)?i.getItem("wo/woandquoteprices",L.filter.filterId).then(function(e){var t=e.data;t.WoPrice!=t.QuotePrice?bootbox.confirm({message:"The total work order price "+t.WoPrice.toFixed(2)+" "+t.CurrencyCode+" does not match the quote price "+t.QuotePrice.toFixed(2)+" "+t.CurrencyCode+".<br>Do you want to continue?",buttons:{confirm:{label:"Yes",className:"btn-primary"},cancel:{label:"No",className:"btn-default"}},callback:function(e){e&&(ue(),i.update(L.woAPI+"/"+L.id,r).then(function(){m.success({message:"Work order has been successfully updated."}),c(function(){u.location.reload()},2e3)}))}}):(ue(),i.update(L.woAPI+"/"+L.id,r).then(function(){m.success({message:"Work order has been successfully updated."}),c(function(){u.location.reload()},2e3)}))}):(ue(),i.update(L.woAPI+"/"+L.id,r).then(function(){m.success({message:"Work order has been successfully updated."}),c(function(){u.location.reload()},2e3)}))})},L.checkTotalCount=re,L.woNumber="",L.fromProjects=!1,L.fromProjectEdit=!1,L.ProjectID=null,L.projectName="Project";var M=d.getTransitionParam("project");void 0!=M&&(void 0!=M.id?(L.ProjectID=M.id,void 0!=M.projectName&&""!=M.projectName&&(L.projectName=M.projectName),L.fromProjectEdit=!0):L.fromProjects=!0),d.popTransitionParam("project"),L.goToProject=function(){o.go("projectEdit",{id:L.ProjectID})},L.model={},L.modelSite={},L.filter={filterId:a.id},L.filter1={siteId:null,rateSheetId:null},L.workorderData={isSubAdmin:!1,AltId:null,SubcontractorId:null},L.partsData={partsCovered:!1},L.miscData={miscCovered:!1},L.laborData={laborMarkup:0,laborCovered:!1},L.customer={customerId:0},L.customers=[],L.site={siteId:0},L.reloadFilter=!1,L.reloadForms=function(){L.reloadFilter=!1,c(function(){Y++,L.reloadFilter=!0,L.filterByWorkOrderForms.reset(),L.filterByWorkOrderForms.eq("WoId",L.filter.filterId).eq("Count",Y)})},L.id=a.id,L.customerSiteFilter=l.filter("and"),L.isInvoiced=!1,L.companyAutoCompleteWO={},L.reloadPartsMisc=function(){e.$broadcast("partsmiscChange")},L.openConversionPopup=pe,L.openQuote=function(){o.go("quoteDetails",{id:L.quoteId})},L.reloadAttachmentsTable=!0,L.hideQuoteAttachments="hidden",L.hideServiceRequestAttachments="hidden",L.serviceRequestFilter=l.filter("and");i.getItem("timezones/forCurrentUser").then(function(e){e.data}),L.taskGrid=!1,L.poGrid=!1,L.companySettings=[],L.companySettingsFilter=l.filter("or"),L.companySettingsFilter.eq("Name","POGrid").eq("Name","TaskGrid").eq("Name","AutoCompleteWO"),i.getItems("companysettings",L.companySettingsFilter).then(function(e){L.companySettings=e.data.Data;for(var t=0;t<L.companySettings.length;t++)"POGrid"==L.companySettings[t].Name&&0!=L.companySettings[t].Id&&null!=L.companySettings[t].Value&&(L.poGrid=JSON.parse(L.companySettings[t].Value.toLowerCase())),"TaskGrid"==L.companySettings[t].Name&&0!=L.companySettings[t].Id&&null!=L.companySettings[t].Value&&(L.taskGrid=JSON.parse(L.companySettings[t].Value.toLowerCase())),"AutoCompleteWO"==L.companySettings[t].Name&&0!=L.companySettings[t].Id&&null!=L.companySettings[t].Value&&(L.companyAutoCompleteWO=JSON.parse(L.companySettings[t].Value.toLowerCase()))});var k=[];i.getItems("usersettings").then(function(e){k=e.data.Data;for(var t=0;t<k.length;t++){if("OpenAllPanels"==k[t].Name&&0!=k[t].Id&&null!=k[t].Value)JSON.parse(k[t].Value.toLowerCase())&&($('.panel-collapse:not(".in")').collapse("show"),Se())}}),L.hasParent=!1,N.HasParent(L.id).then(function(e){L.hasParent=e.hasParent,L.parentAltId=e.parentAltId,L.parentWoId=e.parentWoId}),L.copyWO=function(){N.CopyWo(L.model)},L.importParentItems=function(e){alert("import parent items ("+e+")")},L.openParent=function(){d.popTransitionParam("workOrderDetails"),o.go(o.current,{id:L.parentWoId})},L.serviceableItemModuleName="WoServiceableItems",L.reloadSITable=!0,L.reloadServiceableItemTable=function(){L.reloadSITable=!1,c(function(){L.reloadSITable=!0})},L.addtransaction=me,L.allAssignmentsCompleted=!1;var V={Type:"button",Label:"Create Invoice",Name:"InvoiceBtn",onClick:function(){var e={};d.selectiveExtend(e,L,["workorderData"]),d.popTransitionParam("addInvoice"),d.popTransitionParam("createInvoice"),d.setTransitionParam("createInvoice",e),o.go("createInvoice")},ObjectName:"btnInvoiceButton"},q={Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"wostatuses/getStatusForMangeWorkOrder",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"Status",ObjectName:"ddlStatusDropdown",TabIndex:2},G={Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"wostatuses",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"Status",ReadOnly:!0,ObjectName:"ddlStatusDropdown"},B={Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"wostatuses",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"Status",ObjectName:"ddlStatusDropdown"},j={Type:"button",Label:"Submit to Subcontractor...",onClick:function(){i.getItem("wodetails",L.model.Id).then(function(e){L.checTransactions=e.data,L.checTransactions.Available?o.go("subcontractorBids",{woId:L.model.Id,companyId:L.model.CompanyId}):(m.success({message:"You do not have enough available transactions!"}),u.scrollTo(0,0),c(function(){u.location.reload()},2e3))})},CustomDivClass:"SubmitSubContractorBtn"},z={Type:"button",Label:"Remove from Subcontractor...",onClick:function(){bootbox.confirm("Are you sure that you want to remove the Subcontractor from the Work Order?",function(e){e&&(L.model.SubContractorId=null,i.update("wodetails",L.model).then(function(e){200===e.status&&(m.success({message:"Subcontractor removed from work order!"}),u.scrollTo(0,0),c(function(){u.location.reload()},1e3))}))})}},U={Type:"button",Label:"Add Transactions",onClick:me},Q={Type:"button",Label:"Search",onClick:se,ReadOnly:!1,ObjectName:"btnCustomerSearch"},E={Type:"buttonandlink",Label:"Search",onClick:ne,ReadOnly:!1,ObjectName:"btnSiteSearch",ICustomInputClass:"fa fa-external-link ViewLink"},H={Type:"empty"};L.filterByWorkOrder=l.filter("and"),L.filterByWorkOrderForms=l.filter("and"),L.filterBySite=l.filter("and"),L.filterByWorkOrder.eq("WoId",L.filter.filterId),L.filterByWorkOrderForms.eq("WoId",L.filter.filterId),L.filterSiteForms=l.filter("and"),L.count=0,L.estHoursTotal=0,L.customerFilter=l.filter("and"),L.attributesSite=[{Type:"dropdown",Label:"Form Template:",Required:!1,ApiMethod:"forms/getforSiteEquipmentDropdown",ValueProp:"Id",TextProp:"Name",ModelValue:"Id",Filter:L.filterByWorkOrderForms}];var Z=e.$watch("vm.attributesSite[0].CurrentList",function(){L.attributesSite[0].CurrentList&&L.attributesSite[0].CurrentList.length>0&&(L.modelSite.Id=L.attributesSite[0].CurrentList[0].Id,L.filterSiteForms.reset(),L.filterSiteForms.eq("SiteId",L.model.SiteId).eq("Id",L.modelSite.Id).eq("WoId",L.filter.filterId),Z())});$(window).focus(function(){c(function(){L.reloadFilter=!1,e.$apply(),L.reloadFilter=!0,e.$apply(),L.checkForms&&(ie(),L.checkForms=!1)})});var Y=0;L.showForm=!1,p.getCompanySettings().then(function(e){L.attWoDescription.MaxLength=p.WODescMaxLength,function(){var e=[X,Q,_,E,L.attWoDescription,L.attWoSubContractor,L.attWoEmpty1,L.attWoEmpty2,L.attWoLine1,q,L.attWoAddress,L.attWoWorkOrderType,L.attWoRequstor,L.attWoPriority,L.attWoPhone,J,L.attWoOffice,K,L.attWoRequestDate,L.attWoPaymentTerm,L.attWoCustomerPoNumber,L.attWoCurrencyCode,L.attWoQuoteId,L.attWoPromised,L.attWoExternalId,L.attWoSalesPerson,L.attWoRateSheet,L.attWoLeadSource,L.attWoEmpty3,L.attWoCreatedOn,L.attWoCreatedBy,L.attWoLine2,L.attWoTaxRate,L.attWoTaxRateLabor,L.attWoTaxRatePart,L.attWoTaxRateMisc],t=[X,Q,_,E,L.attWoDescription,L.attWoSubContractor,L.attWoEmpty1,L.attWoEmpty2,L.attWoLine1,q,L.attWoAddress,L.attWoWorkOrderType,L.attWoRequstor,L.attWoPriority,L.attWoPhone,J,L.attWoOffice,K,L.attWoRequestDate,L.attWoPaymentTerm,L.attWoCustomerPoNumber,L.attWoCurrencyCode,L.attWoQuoteId,L.attWoPromised,L.attWoExternalId,L.attWoSalesPerson,L.attWoRateSheet,L.attWoLeadSource,L.attWoCreatedOn,L.attWoCreatedBy,L.attWoLine2,L.attWoTaxRate,L.attWoTaxRateLabor,L.attWoTaxRatePart,L.attWoTaxRateMisc,L.attDSLLine1,L.attDSLAdditionalDetailsHeader,L.attDSLBlank2,L.attDSLRewrite,L.attDSLRecall,L.attDSLFactoryServiceOrderType,L.attDSLVisits,L.attDSLAuthorizedBy,L.attDSLServiceZoneCode,L.attDSLLine4,L.attDSLWoExportHeader,L.attDSLBlank1,L.attDSLUnitDown,L.attDSLRewritePartsReceived,L.attDSLIsUnitReplaceAnother,L.attDSLRecallDueTo,L.attDSLFieldScrapFlag,L.attDSLProcessPracticeFlag,L.attDSLUnitOperAtDepartureFlag,L.attDSLBulletinNumber,L.attDSLQualityReportFlag,L.attDSLCertificationNumber,L.attDSLPreviousUnitFieldSerialNumber,L.attDSLPurchasedFromDistributor];L.showForm=!1,L.usingDSLNorthwest?L.attributes=t:L.attributes=e;L.showForm=!0}()});var J={Type:"dropdown",Label:"Agreement:",Required:!1,ApiMethod:"agreements/getAgreementsByCustomer",ValueProp:"Id",TextProp:"Desc",ModelValue:"AgreementId",ConvertToInt:"true",Filter:L.customerFilter,List:[],ObjectName:"ddlWoAgreement",TabIndex:5},K={Type:"dropdown",Label:"Project:",Required:!1,ApiMethod:"projects/getProjectForWo",ValueProp:"Id",TextProp:"ProjectName",ModelValue:"ProjectId",ConvertToInt:"true",Filter:L.customerSiteFilter,List:[],ObjectName:"ddlWoProject",TabIndex:6};L.siteAutocompleteFilter=l.filter("or"),L.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],L.searchColsSite=["Search"],L.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}],L.ddlgridattrsSite=[{Name:"Customer",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Site Code",ValueName:"SiteCode",Sortable:!0,CellFormat:"label"},{Name:"Site Name",ValueName:"SiteName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"FullAddress",Sortable:!0,CellFormat:"label"}];var X={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:ee,SearchTrigger:1,Label:"Customer:",Required:!0,ApiMethod:"customers/active",ModelValue:"CustomerName",Id:"CustomerName",GridAttributes:L.ddlgridattrsCustomer,PageSize:22,SearchCols:L.searchColsCustomer,Autofocus:"true",TabIndex:1,ObjectName:"btnCustomerSearch"},_={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:te,SearchTrigger:1,Label:"Site:",Required:!0,ApiMethod:"sites/searchgrid",ModelValue:"SiteName",filter:L.siteAutocompleteFilter,Id:"SiteName",GridAttributes:L.ddlgridattrsSite,PageSize:22,SearchCols:L.searchColsSite,TabIndex:2,ObjectName:"btnSiteSearch"};function ee(e){e.CustomerCode&&""!=e.CustomerCode?L.model.CustomerName=e.CustomerCode+" - "+e.CustomerName:L.model.CustomerName=e.CustomerName,L.CustomerNameTemp=L.model.CustomerName,L.model.CustomerId=e.Id,L.model.SiteId=null,L.model.SiteName=null,L.SiteNameTemp=null}function te(t){t.SiteCode&&""!=t.SiteCode?L.model.SiteName=t.SiteCode+" - "+t.SiteName:L.model.SiteName=t.SiteName,L.SiteNameTemp=L.model.SiteName,L.model.SiteId=t.Id,L.model.ContactName=t.ContactName,L.model.ContactPhone=t.Phone,L.model.TechId=t.TechId,L.model.RateSheetId=t.RateSheetId,L.filter1.siteId=t.Id,L.model.OfficeId=t.OfficeId;var o=s.getValue("authorizationData");o&&o.tzDatebaseName&&(L.userTimeZone=moment.tz(o.tzDatebaseName).zoneAbbr(),L.model.TzDatabaseName=o.tzDatebaseName),i.getItem("sites/",t.Id).then(function(){var t=i.state.item;(!L.model.CustomerId||0===L.model.CustomerId&&t.CustomerId)&&i.getItem("customers/",t.CustomerId).then(function(){var t=i.state.item;t.CreditHold?bootbox.confirm("The customer "+t.CustomerName+" is on credit hold!",function(o){c(function(){o&&(L.model.CustomerId=t.Id,t.CustomerCode&&""!=t.CustomerCode?L.model.CustomerName=t.CustomerCode+" - "+t.CustomerName:L.model.CustomerName=t.CustomerName,L.CustomerNameTemp=L.model.CustomerName),e.$apply()})}):(L.model.CustomerId=t.Id,t.CustomerCode&&""!=t.CustomerCode?L.model.CustomerName=t.CustomerCode+" - "+t.CustomerName:L.model.CustomerName=t.CustomerName,L.CustomerNameTemp=L.model.CustomerName)})})}function oe(e){i.getItem("wo/checkinvoice",L.filter.filterId).then(function(e){L.notInvoiced=e.data.NotInvoiced,ae(0)})}function ae(t){var o=!1;if("ReadyToInvoice"!=L.model.Status&&"Complete"!=L.model.Status||(o=!0),o&&L.notInvoiced-t>0){L.existInvBtn=!1;for(var a=L.attributes.length-1;a>=0;a--)"InvoiceBtn"==L.attributes[a].Name&&(L.existInvBtn=!0);L.existInvBtn||L.attributes.push(V)}else for(a=L.attributes.length-1;a>=0;a--)"InvoiceBtn"==L.attributes[a].Name&&(L.attributes.splice(a,1),L.attributes.push(H),c(function(){e.$apply(),L.attributes.splice(a,1)}))}function re(){L.id&&(L.filterWoForTotalCount=l.filter("and"),L.filterWoForTotalCount.eq("WoId",L.id),i.getItems("woassignments/estHoursTotal",L.filterWoForTotalCount).then(function(e){L.estHoursTotal=e.data.EstHoursTotal}))}function ie(e){L.id&&(e?(Q.ReadOnly=!0,E.ReadOnly=!0,X.ReadOnly=!0,_.ReadOnly=!0):i.getItem("wodetails/haschild/",L.id).then(function(e){var t="true"==e.data||null==e.data;Q.ReadOnly=t,E.ReadOnly=t,X.ReadOnly=t,_.ReadOnly=t}))}L.attWoDescription={Type:"textarea",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Desc",Autofocus:"true",TabIndex:3},L.attWoSubContractor={Type:"dropdown",Label:"Subcontractor:",ApiMethod:"subcontractorCompanies",ValueProp:"SubcontractorId",TextProp:"CompanyName",ModelValue:"SubContractorId",ConvertToInt:"true",ReadOnly:!0},L.attWoEmpty1={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},L.attWoEmpty2={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},L.attWoLine1={Type:"line",CustomClass:"col-sm-12"},L.attWoAddress={Type:"text",Label:"Address",Required:!1,MaxLength:"100",ModelValue:"Address",ReadOnly:!0},L.attWoWorkOrderType={Type:"dropdown",Label:"Work Order Type:",Required:!1,ApiMethod:"wotypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"WoType",ObjectName:"ddlWoTypeDropdown",TabIndex:3},L.attWoRequstor={Type:"text",Label:"Requestor:",Required:!1,MaxLength:"100",ModelValue:"ContactName",TabIndex:11},L.attWoPriority={Type:"dropdown",Label:"Priority:",Required:!1,ApiMethod:"priorities",ValueProp:"PriorityName",TextProp:"PriorityName",ModelValue:"Priority",ObjectName:"ddlWoPriority",TabIndex:4},L.attWoPhone={Type:"text",Label:"Phone:",MaxLength:"50",ModelValue:"ContactPhone",TabIndex:11},L.attWoOffice={Type:"dropdown",Label:"Office:",Required:!0,ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true",ObjectName:"ddlWoOffice",TabIndex:13},L.attWoRequestDate={Type:"datepicker",Label:"Request Date:",ModelValue:"RequestDate",Format:"MM/dd/yyyy",SubType:"date",TabIndex:14},L.attWoPaymentTerm={Type:"dropdown",Label:"Payment Term:",Required:!1,ApiMethod:"paymentTerms",ValueProp:"Id",TextProp:"PaymentTermName",ModelValue:"PaymentTermId",ConvertToInt:"true",ObjectName:"ddlWoPaymentTerm",TabIndex:7},L.attWoCustomerPoNumber={Type:"text",Label:"Customer PO Number:",Required:!1,MaxLength:"50",ModelValue:"CustomerPONum",TabIndex:15},L.attWoCurrencyCode={Type:"dropdown",Label:"Currency Code:",ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode",ObjectName:"ddlWoCurrencyCode",TabIndex:8},L.attWoQuoteId={Type:"int",Label:"Quote Id:",ModelValue:"QuoteAltId",ReadOnly:!0,TabIndex:16},L.attWoPromised={Type:"datepicker",Label:"Promised:",Required:!0,ModelValue:"PromiseDate",Format:"MM/dd/yyyy",TabIndex:9},L.attWoExternalId={Type:"text",Label:"External Id:",Required:!1,MaxLength:"50",ModelValue:"ExternalId",TabIndex:17},L.attWoSalesPerson={Type:"dropdown",Label:"Salesperson:",ApiMethod:"employees/getSalesPersonList",ValueProp:"Id",TextProp:"FullName",ModelValue:"SalesPersonId",ConvertToInt:"true",TabIndex:12},L.attWoRateSheet={Type:"dropdown",Label:"Rate Sheet:",Required:!0,ApiMethod:"ratesheets",ValueProp:"Id",TextProp:"RateSheetName",ModelValue:"RateSheetId",ConvertToInt:"true",ObjectName:"ddlWoRateSheet",TabIndex:18},L.attWoLeadSource={Type:"dropdown",Label:"Lead Source:",ApiMethod:"leadSource/ddList",ValueProp:"Id",TextProp:"DdlLabel",ModelValue:"LeadSourceId",ConvertToInt:"true",TabIndex:13},L.attWoEmpty3={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},L.attWoCreatedOn={Type:"text",Label:"Created On:",ModelValue:"CreatedOn",ReadOnly:!0,TabIndex:19},L.attWoCreatedBy={Type:"text",Label:"Created By:",ModelValue:"CreatedBy",ReadOnly:!0,TabIndex:10},L.attWoLine2={Type:"line",CustomClass:"col-sm-12"},L.attWoTaxRate={Type:"dropdown",Label:"Tax Rate:",ApiMethod:"taxrates",ValueProp:"Id",TextProp:"TaxName",ModelValue:"TaxRateId",ConvertToInt:"true",ObjectName:"ddlWoTaxRate",TabIndex:20},L.attWoTaxRateLabor={Type:"decimal",Label:"Tax Rate Labor %: ",ModelValue:"TaxRateLabor",ReadOnly:!0,TabIndex:22},L.attWoTaxRatePart={Type:"decimal",Label:"Tax Rate Part %: ",ModelValue:"TaxRatePart",ReadOnly:!0,TabIndex:21},L.attWoTaxRateMisc={Type:"decimal",Label:"Tax Rate Misc %: ",ModelValue:"TaxRateMisc",ReadOnly:!0,TabIndex:23},L.attDSLFailureResolution={Type:"dropdown",Label:"Reason for Failed Install:",ApiMethod:"dslFailureResolution/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"AssignmentUser8",ConvertToInt:"true",TabIndex:41},L.attDSLGroundCheck={Type:"checkbox",Label:"Ground Check",Required:!1,ModelValue:"AssignmentUser4"},L.attDSLLine1={Type:"line",CustomClass:"col-sm-12"},L.attDSLWoExportHeader={Type:"text",Label:"WO Export",ModelValue:"",CustomInputClass:"hidden"},L.attDSLBlank1={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},L.attDSLUnitDown={Type:"checkbox",Label:"Unit Down",ModelValue:"woeUnitDown",TabIndex:17},L.attDSLRewritePartsReceived={Type:"dropdown",Label:"Rewrite Parts Received:",Required:!1,ApiMethod:"dslPartsReceived/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"woeRewritePartsReceived",TabIndex:18},L.attDSLIsUnitReplaceAnother={Type:"checkbox",Label:"Is Unit Replace Another",ModelValue:"woeIsUnitReplaceAnother",TabIndex:17},L.attDSLRecallDueTo={Type:"dropdown",Label:"Recall Due To:",Required:!1,ApiMethod:"dslRecallDueTo/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"woeRecallDueTo",TabIndex:18},L.attDSLFieldScrapFlag={Type:"checkbox",Label:"Field Scrap Flag",ModelValue:"woeFieldScrapFlag",TabIndex:17},L.attDSLProcessPracticeFlag={Type:"checkbox",Label:"Process/Practice Flag",ModelValue:"woeProcessPracticeFlag",TabIndex:17},L.attDSLUnitOperAtDepartureFlag={Type:"checkbox",Label:"Unit Oper. at Departure",ModelValue:"woeUnitOperAtDeparture",TabIndex:17},L.attDSLBulletinNumber={Type:"text",Label:"Bulletin Number:",Required:!1,MaxLength:"20",ModelValue:"woeBulletinNumber",TabIndex:5},L.attDSLQualityReportFlag={Type:"checkbox",Label:"Quality Report Flag",ModelValue:"woeQualityReportFlag",TabIndex:17},L.attDSLCertificationNumber={Type:"text",Label:"Certification Number:",Required:!1,MaxLength:"20",ModelValue:"woeCertificationNumber",TabIndex:5},L.attDSLPreviousUnitFieldSerialNumber={Type:"text",Label:"Previous Unit Field Serial No.:",Required:!1,MaxLength:"20",ModelValue:"woePreviousUnitFieldSerialNumber",TabIndex:5},L.attDSLPurchasedFromDistributor={Type:"dropdown",Label:"Purchased From Distributor:",Required:!1,ApiMethod:"dslDistributor/ddList",ValueProp:"Id",TextProp:"Name",ModelValue:"woePurchasedFromDistributor",TabIndex:18},L.attDSLServiceZoneCode={Type:"text",Label:"Service Zone Code:",Required:!1,ReadOnly:!0,MaxLength:"20",ModelValue:"ServiceZoneCode"},L.attDSLLine2={Type:"line",CustomClass:"col-sm-12"},L.attDSLRewrite={Type:"checkbox",Label:"Rewrite",ModelValue:"User4",TabIndex:17},L.attDSLRecall={Type:"checkbox",Label:"Recall",ModelValue:"User5",TabIndex:17},L.attDSLFactoryServiceOrderType={Type:"dropdown",Label:"Factory Service Order Type:",ApiMethod:"dslServiceOrderType/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"User8",ConvertToInt:"true"},L.attDSLVisits={Type:"text",Label:"Visits:",ModelValue:"DSLVisits",ReadOnly:!0},L.attDSLAuthorizedBy={Type:"text",Label:"Authorized By:",Required:!1,MaxLength:"20",ModelValue:"User0",TabIndex:5},L.attDSLAdditionalDetailsHeader={Type:"text",Label:"Additional Details",ModelValue:"",CustomInputClass:"hidden"},L.attDSLLine3={Type:"line",CustomClass:"col-sm-12"},L.attDSLLine4={Type:"line",CustomClass:"col-sm-12"},L.attDSLBlank2={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},L.attDSLBlank3={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},L.CustomerNameTemp="",L.SiteNameTemp="",e.$on("CustomerNameSearching",function(e,t){L.model.CustomerId=null,L.model.SiteId=null,L.model.SiteName=null,L.SiteNameTemp=null}),e.$on("SiteNameSearching",function(e,t){L.model.SiteId=null}),L.focusOut=function(e){e&&e.hasOwnProperty("FocusOut")&&e.FocusOut&&("CustomerName"===e.ModelValue&&(L.CustomerNameTemp=angular.copy(L.model.CustomerName),null==L.model.CustomerId&&(L.model.CustomerName=null)),"SiteName"===e.ModelValue&&(L.SiteNameTemp=angular.copy(L.model.SiteName),null==L.model.SiteId&&(L.model.SiteName=null)))},L.checkCustomerInfoChangeEnabled=ie,e.$watch("vm.model.Id",function(){L.model.Id&&(L.model.ServiceRequestId&&(L.serviceRequestFilter.reset(),L.serviceRequestFilter.eq("ServiceRequestId",L.model.ServiceRequestId),L.hideServiceRequestAttachments=""),p.isContractorCompany(L.model).then(function(e){e?"Invoiced"!=L.model.Status||W||o.go("workOrdersDetailsReadOnly",{id:L.model.Id}):o.go("subcontractorWorkOrdersDetails",{id:L.model.Id})}))}),L.WOdetailsTimezone={TzDatabaseName:"%TzDatabaseName%"},L.btnName="Site Equipment Forms",re();var de=0;e.$on("wo.itemChange",function(e,t){ae(--de),ie(!0)}),e.$on("wo.itemDelete",function(e,t){ae(++de),ie(de)}),L.InitialStatus="";var le=e.$watch("vm.model.Status",function(){""===L.InitialStatus&&L.model.Status&&""!==L.model.Status&&(L.InitialStatus=L.model.Status),"Invoiced"==L.model.Status&&w?(L.attributes[10]=B,le()):"Invoiced"!=L.model.Status||w||(L.attributes[10]=G,le())});function se(){var e="";if(L.model.CustomerId)e=angular.copy(L.model.CustomerName);else if(L.CustomerNameTemp){e=angular.copy(L.CustomerNameTemp);L.CustomerNameTemp=""}r.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectCustomer.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:L.customer,viewName:L.viewName,customerName:e,onSelect:ee}})}function ne(e){if("link"==e)0==L.model.SiteId?m.warning({message:"First you must select site"}):R?o.go("siteReadOnly",{id:L.model.SiteId}):o.go("sitesEdit",{id:L.model.SiteId});else{var t="";if(L.model.SiteId)t=angular.copy(L.model.SiteName);else if(L.SiteNameTemp){t=angular.copy(L.SiteNameTemp);L.SiteNameTemp=""}r.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectSite.html",controller:"SelectSiteController",controllerAs:"vm",inputs:{site:L.site,customerId:L.model.CustomerId,customerUserSitesFilter:L.customerUserSitesFilter,viewName:L.viewName,siteName:t,onSelect:te}})}}function me(){L.$state.go("subscriptionTransactionBased")}function ue(){if(!L.allAssignmentsCompleted&&"Complete"===L.model.Status){var e=l.filter("and");e.eq("Woid",L.model.Id),i.getItems("woassignments",e).then(function(){var e=i.state.items;e.length>0&&function e(t,o){"Complete"!=o[t].Status?(o[t].Status="Complete",i.update("woassignments/"+o[t].Id,o[t]).then(function(){o[++t]?e(t,o):m.success({message:"All Assignments Completed!"})})):o[++t]&&e(t,o)}(0,e)})}}e.$watch("vm.modelSite",function(){void 0!==L.modelSite.Id&&(null==L.modelSite.Id&&L.attributesSite[0].CurrentList&&L.attributesSite[0].CurrentList.length>0&&(L.modelSite.Id=L.attributesSite[0].CurrentList[0].Id),L.filterSiteForms.reset(),L.filterSiteForms.eq("SiteId",L.model.SiteId).eq("Id",L.modelSite.Id).eq("WoId",L.filter.filterId))},!0),e.$watch("vm.allAssignmentsCompleted",function(){void 0!=L.allAssignmentsCompleted&&1==L.allAssignmentsCompleted&&L.companyAutoCompleteWO&&"Invoiced"!=L.model.Status&&(L.model.Status="Complete",oe(),L.servreportGrid=!0,c(function(){$("#service-report .add-new-btn").click()},0,!1))}),e.$watch("vm.model.TaxRateId",function(){L.model.TaxRateLabor=null,L.model.TaxRatePart=null,L.model.TaxRateMisc=null,L.model.TaxRateId&&i.getItem("taxrates",L.model.TaxRateId).then(function(e){L.selectedTaxRate=e.data,L.model.TaxRateLabor=L.selectedTaxRate.TaxRateLabor,L.model.TaxRatePart=L.selectedTaxRate.TaxRatePart,L.model.TaxRateMisc=L.selectedTaxRate.TaxRateMisc})}),e.$watch("vm.model.AgreementId",function(){L.model.AgreementId?L.attWoRateSheet.ReadOnly=!0:L.attWoRateSheet.ReadOnly=!1,void 0!=L.model.AgreementId&&(d.popTransitionParam("agreement"),L.agreementFilter=l.filter("and"),L.agreementFilter.eq("Id",L.model.AgreementId),i.getItems("woagreements",L.agreementFilter).then(function(e){L.items=e.data.Data;var t={},o=new Array(7);o[0]="Sunday",o[1]="Monday",o[2]="Tuesday",o[3]="Wednesday",o[4]="Thursday",o[5]="Friday",o[6]="Saturday",L.partsData.partsCovered=!1,L.miscData.miscCovered=!1,L.laborData.laborCovered=!1,L.laborData.laborMarkup=0;var a=new Date;a=S.parseISOString(a.toISOString());for(var r=S.convertToLocal(a),i=r.getDay(),l=r.getHours(),s=r.getMinutes(),n="",m=0;m<L.items.length;m++){n=6==i||0==i?"Weekend":"Weekday";var u=S.parseISOString(L.items[m].StartTime),c=S.parseISOString(L.items[m].EndTime),p=u.getHours(),I=c.getHours(),b=u.getMinutes(),C=c.getMinutes(),T=S.parseISOString(L.items[m].StartDate);T=S.convertToLocal(T);var y=S.parseISOString(L.items[m].EndDate);y=S.convertToLocal(y);var h=!1,f=!1;p<=l?p+1<=l?h=!0:b<=s&&(h=!0):h=!1,I>=l?I-1>=l?f=!0:C>=s&&(f=!0):f=!1,"Active"==L.items[m].Status&&(L.items[m].Day==o[i]||L.items[m].Day==n||"All Days"==L.items[m].Day)&&T<=r&&y>r&&f&&h&&(L.model.RateSheetId=L.items[m].RateSheetId,L.partsData.partsCovered=L.items[m].PartsCovered,L.miscData.miscCovered=L.items[m].MiscCovered,L.laborData.laborCovered=L.items[m].LaborCovered,L.laborData.laborMarkup=L.items[m].LaborMarkup,d.selectiveExtend(t,L,["partsData","miscData","laborData"]),d.setTransitionParam("agreement",t))}}))}),L.loadingIndicator=!1,e.$watch("vm.model.Id",function(){if(L.model.Id){if(L.customer.customerId=L.model.CustomerId,L.site.siteId=L.model.SiteId,L.site.siteName=L.model.SiteName,L.site.title=L.model.ContactName,L.site.phone=L.model.ContactPhone,L.site.address=L.model.Address,L.altId=L.model.AltId,L.quoteId=L.model.QuoteId,L.quoteAltId=L.model.QuoteAltId,L.workorderData.AltId=L.model.AltId,L.workorderData.Status=L.model.Status,L.currentStatus=L.model.Status,L.workorderData.CustomerId=L.model.CustomerId,L.workorderData.SiteId=L.model.SiteId,L.workorderData.PaymentTermId=L.model.PaymentTermId,L.workorderData.CustomerName=L.model.CustomerName,L.workorderData.SiteName=L.model.SiteName,L.workorderData.SubcontractorId=L.model.SubcontractorId,L.workorderData.WorkOrderId=L.model.Id,L.customerFilter.customerId=L.model.CustomerId,L.SubInvoiced=L.model.SubInvoiced,L.model.SubContractorId?1==L.model.SubInvoiced?L.attributes[7]=H:L.attributes[7]=z:null!=L.model.Available&&(L.model.Available?L.attributes[7]=j:L.attributes[7]=U),L.filterBySite.eq("SiteId",L.model.SiteId),oe(),ie(),L.customerSiteFilter.eq("WoId",L.id).eq("CustomerId",L.model.CustomerId).eq("SiteId",L.model.SiteId),J.List=null,K.List=null,L.reloadFilter=!0,L.filter1.siteId=L.model.SiteId,L.quoteId){e.$broadcast("wo.loadQuoteItemsHeaders"),L.isFromQuote=!0,L.filterByQuote=l.filter("and"),L.filterByQuote.eq("QuoteId",L.quoteId),L.hideQuoteAttachments="";for(var t=0;t<D.length;t++)"Admin"!=D[t]&&"Dispatch"!=D[t]&&"Office"!=D[t]&&"Technician"!=F[t]||(L.viewQuoteAttachments=!0)}var o=s.getValue("authorizationData");o&&o.tzDatebaseName&&(L.tzName=o.tzDatebaseName,L.userTimeZone=moment.tz(L.tzName).zoneAbbr());var a=new Date(L.model.SysCreateUTC),r=moment.tz.zone(o.tzDatebaseName).offset(a);S.convertToLocal(a,r),i.getItem("users",L.model.SysCreatorId).then(function(){var e=i.state.item;L.model.CreatedBy=e.FirstName+" "+e.LastName,L.model.CreatedOn=moment(a).format("MM/DD/YYYY h:mm A")+" "+L.userTimeZone}),L.usingDSLNorthwest&&T.getVisits(L.model.SiteId).then(function(e){L.model.DSLVisits=e}),v.checkInProgressLaborByWOId(L.model.Id).then(function(e){e&&(L.laborIsActive=!0)})}L.model.QuoteId?d.setTransitionParam("quoteId",L.model.QuoteId):d.popTransitionParam("quoteId")}),e.$watch("vm.model.CustomerId",function(){L.siteAutocompleteFilter.reset(),L.model.CustomerId?(L.customerFilter.reset(),L.customerFilter.eq("Status","Active"),L.customerFilter.eq("Id",L.model.AgreementId),L.customerFilter.customerId=L.model.CustomerId,L.customerSiteFilter.reset(),L.customerSiteFilter.eq("CustomerId",L.model.CustomerId).eq("WoId",L.id),L.siteAutocompleteFilter.eq("CustomerId",L.model.CustomerId),L.usingGroundBreakers&&i.getItem("customers/",L.model.CustomerId).then(function(){var e=i.state.item;f.addCustomer(e),L.serviceReportMax=1,L.customReport=e.User4})):(L.customerFilter.reset(),L.customerFilter.eq("Status","Active"),L.customerFilter.eq("Id",L.model.AgreementId),L.customerFilter.customerId=0,L.model.SiteId=null,L.model.SiteName=null,L.model.Address=null,L.model.ContactName=null,L.model.ContactPhone=null)}),e.$watch("vm.model.SiteId",function(){L.model.SiteId&&(L.customerSiteFilter.reset(),L.customerSiteFilter.eq("CustomerId",L.model.CustomerId).eq("WoId",L.id).eq("SiteId",L.model.SiteId))}),e.$watch("vm.model.RateSheetId",function(){null!=L.model.RateSheetId&&L.model.RateSheetId>0&&(L.filter1.rateSheetId=L.model.RateSheetId)}),e.$watch("vm.model.AgreementId",function(){null!=L.model.AgreementId&&L.model.AgreementId>0&&(L.filter1.agreementId=L.model.AgreementId)}),L.lineItemsConverted=!1;var ce=d.getTransitionParam("quote");function pe(t){r.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/quoteConversionLineItemsModal.html",controller:"QuoteConversionLineItemsController",controllerAs:"vm",inputs:{quoteId:t}}).then(function(t){t.close.then(function(t){t&&(L.lineItemsConverted=!0,c(function(){L.lineItemsConverted=!1,e.$broadcast("wo.loadQuoteItemsHeaders")}))})})}function Se(e){switch(e){case"assignmentsGrid":L.assignmentsGrid=!0;break;case"notesGrid":L.notesGrid=!0;break;case"laborGrid":L.laborGrid=!0;break;case"partsGrid":L.partsGrid=!0;break;case"miscGrid":L.miscGrid=!0;break;case"tasksGrid":L.tasksGrid=!0;break;case"servreportGrid":L.servreportGrid=!0;break;case"attachmentsGrid":L.attachmentsGrid=!0;break;case"formsGrid":L.formsGrid=!0;break;case"poesGrid":L.poesGrid=!0;break;case"serviceableItemGrid":L.serviceableItemGrid=!0;break;case"woPaymentGrid":L.woPaymentGrid=!0;break;case"deficiencyGrid":L.deficiencyGrid=!0;break;default:L.assignmentsGrid=!0,L.notesGrid=!0,L.laborGrid=!0,L.partsGrid=!0,L.miscGrid=!0,L.tasksGrid=!0,L.attachmentsGrid=!0,L.formsGrid=!0,L.poesGrid=!0,L.serviceableItemGrid=!0,L.woPaymentGrid=!0,L.deficiencyGrid=!0}}function Ie(e,t){return b.getModulePrivilege(e,t)}void 0!=ce&&ce.converted&&ce.quoteid&&pe(ce.quoteid),d.popTransitionParam("quote"),L.assignmentsGrid=!0,L.notesGrid=!0,L.laborGrid=!1,L.partsGrid=!1,L.miscGrid=!1,L.tasksGrid=!1,L.servreportGrid=!1,L.attachmentsGrid=!1,L.formsGrid=!1,L.poesGrid=!1,L.serviceableItemGrid=!1,L.woPaymentGrid=!1,L.deficiencyGrid=!1,L.initialiseGrid=Se,L.getModulePrivilege=Ie}angular.module("FieldConnectApp").controller("WorkOrderDetailsEditController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","restService","stateTransitionService","qsService","cryptoStorageService","$q","Notification","$window","$timeout","currentCompanyService","timezoneService","$geolocation","guiPrivilegeService","$linq","dslVisitsService","featuresFactory","rolesFactory","gbCustomFactory","fcGeoLocationService","trackRealTimeService","copyWorkOrderFactory"]}();;!function(){"use strict";function e(e,t,a,l,i,o,r,d,s){var n=this;n.id=e.id,n.model={WoId:parseInt(e.WoId)},n.$scope=e,n.close=function(t){e.onBack&&e.onBack(t);n.modalClass=!1,e.close(null,50)},n.focusOut=u,n.search=b,n.calculate=T,n.viewName=e.viewName,n.moduleName=e.moduleName,n.oldPrice=0,n.miscData=r.getTransitionParam("agreement"),n.usingDSLNorthwest=s.usingDSLNorthwest,n.apiMethod="miscs",n.usingDSLNorthwest&&(n.apiMethod="dslMiscs"),n.searchValue={filter:"",WoId:e.WoId},n.filters={WoId:e.WoId,ItemId:n.model.ItemId,Cost:n.model.Cost},n.filter={WoId:e.WoId},n.miscFilter=o.filter("and"),n.miscFilter.eq("SaleType","Misc"),e.subcontractorId&&(n.miscFilter.eq("SubcontractorId",e.subcontractorId),n.miscFilter.eq("CompanyId",e.woCompanyId)),n.itemName={Type:"dropdown",Label:"Item Name:",Required:!0,ApiMethod:e.subcontractorId&&n.id?"items/itemsSubcontractor":n.id?"items/miscItems":"items/dropdown",ValueProp:"Id",TextProp:n.id?"ItemName":"Name",ModelValue:"ItemId",Autofocus:"true",Name:"misc",List:n.id?null:[""],Filter:n.miscFilter,SelectFirst:!0,OnOpen:function(){if(n.firstTime)for(var e=0;e<n.attributes.length;e++)if("misc"===n.attributes[e].Name){n.attributes[e].List=null,n.miscFilter.Reload++,n.firstTime=!1;break}},OnLoaded:function(){l(function(){0==n.attributes[c].CurrentList.length?(d.warning({message:"No results found"}),document.getElementById("seacrhInputMisc").focus()):n.attributes[c].CurrentList.length>0&&0==n.attributes[c].CurrentList[0].Id&&(n.attributes[c].CurrentList.splice(0,n.attributes[c].CurrentList.length),d.warning({message:"The number of items is too high! <br /> Please use the search to  limit the number of the items first"}),document.getElementById("seacrhInputMisc").focus())})}},n.itemNameEdit={Type:"text",Label:"Item Name:",Required:!0,MaxLength:"50",ModelValue:"ItemName",ReadOnly:!0},n.attSearchText={Type:"text",Label:"Search:",ModelValue:"searchText",MaxLength:"100",CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo"},n.attSearchButton={Type:"button",Label:"Search",onClick:b,CustomInputClass:"btn-primary",ObjectName:"btnSearch"};var c=2;if(n.id?(c=0,n.attributes=[n.itemNameEdit,{Type:"decimal",Label:"Quantity:",Required:!0,MaxLength:"50",ModelValue:"Quantity"},{Type:"text",Label:"Description:",Required:!0,MaxLength:"50",ModelValue:"WoItemName"},{Type:"currency",Label:"Unit Cost:",Required:!0,ModelValue:"Cost",ObjectName:"fieldADMiscDetailCost",OnFocus:u},{Type:"currency",Label:"Unit Price:",Required:!0,ModelValue:"Price",ObjectName:"fieldADMiscDetailPrice",CustomDivClass:e.subcontractorId?"hidden":""},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"},{Type:"checkbox",Label:"Taxable",Required:!1,ModelValue:"Taxable",Roles:["Admin","FieldConnect","TransAdmin","Office","Dispatch"]},{Type:"checkbox",Label:"Billable",ModelValue:"Billable"}]):n.attributes=[n.attSearchText,n.attSearchButton,n.itemName,{Type:"decimal",Label:"Quantity:",Required:!0,MaxLength:"50",ModelValue:"Quantity"},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"WoItemName"},{Type:"currency",Label:"Unit Cost:",Required:!0,ModelValue:"Cost",ObjectName:"fieldADMiscDetailCost",OnFocus:u},{Type:"currency",Label:"Unit Price:",Required:!0,ModelValue:"Price",ObjectName:"fieldADMiscDetailPrice",CustomDivClass:e.subcontractorId?"hidden":""},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"},{Type:"checkbox",Label:"Taxable",Required:!1,ModelValue:"Taxable",Roles:["Admin","FieldConnect","TransAdmin","Office","Dispatch"]},{Type:"checkbox",Label:"Billable",ModelValue:"Billable"}],n.usingDSLNorthwest){n.attDSLActionTaken={Type:"dropdown",Label:"Action Taken:",ApiMethod:"dslActionTaken/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extActionTakenId",ConvertToInt:"true"},n.attDSLFaultAreas={Type:"dropdown",Label:"Trouble Found:",ApiMethod:"dslFaultAreas/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extFaultAreasId",ConvertToInt:"true"},n.attDSLApplicableCode={Type:"dropdown",Label:"Applicable Zone:",ApiMethod:"dslApplicableCode/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extApplicableCodeId",ConvertToInt:"true"},n.attDSLInstalledRemoved={Type:"dropdown",Label:"Installed/Removed:",ApiMethod:"dslInstalledRemoved/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extInstalledRemovedId",ConvertToInt:"true"},n.attDSLWhoPays={Type:"dropdown",Label:"Who Pays:",ApiMethod:"dslWhoPays/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extWhoPaysId",ConvertToInt:"true"},n.attDSLIndirectLaborQuantity={Type:"int",Label:"Indirect Labor Qty:",ModelValue:"extIndirectLaborQuantity"},n.attDSLIndirectPartNumber={Type:"text",Label:"Part#/TOF",ModelValue:"extIndirectPartNumber",MaxLength:"250"};var m=[n.attDSLActionTaken,n.attDSLFaultAreas,n.attDSLApplicableCode,n.attDSLInstalledRemoved,n.attDSLWhoPays,n.attDSLIndirectLaborQuantity,n.attDSLIndirectPartNumber];n.attributes=n.attributes.concat(m)}function u(){n.filters.Cost=n.model.Cost,n.filters.ItemId=n.model.ItemId,i.getItems("miscs/initialDataForMisc",n.filters).then(function(){I=i.state.items[0],n.model.Price=I.Price})}function b(){n.searchValue.filter=n.model.searchText?n.model.searchText.toString():"",n.model.ItemId=null,n.miscFilter.reset(),n.miscFilter.eq("SaleType","Misc"),""!=n.searchValue.filter&&(n.attributes[c].List=null,n.firstTime=!1,n.miscFilter.like("ItemName","%"+n.searchValue.filter+"%"),n.isFocus=!1),e.subcontractorId&&(n.miscFilter.eq("SubcontractorId",e.subcontractorId),n.miscFilter.eq("CompanyId",e.woCompanyId))}n.firstTime=!0,e.$watch("miscEdit.model.Taxable",function(){null!=n.model.Taxable?n.model.Taxable&&n.model.WoId&&i.getItem("wo",n.model.WoId).then(function(){var e=i.state.item;n.model.TaxRate=e.TaxRateMisc}):(n.model.TaxRate=null,n.model.Taxable=!1)});var I,p=!1;function T(){n.model.ItemId?p?(n.filters.ItemId=n.model.ItemId,n.filters.Cost=null,i.getItems("miscs/initialDataForMisc",n.filters).then(function(){I=i.state.items[0],n.model.Price=I.Price,n.model.Cost=I.Cost,null==e.id&&n.model.ItemId>0&&n.model.Billable&&(n.model.Taxable=I.Taxable),n.model.WoItemName=I.WoItemName})):p=!0:(n.model.Price=null,n.model.Cost=null,n.model.Billable=!1)}n.id||(p=!0),e.$watch("miscEdit.model.ItemId",function(){r.getTransitionParam("quoteId")?n.model.Billable=!1:n.miscData&&!n.id&&n.model.ItemId?n.miscData.miscData.miscCovered?n.model.Billable=!1:n.model.Billable=!0:n.model.ItemId&&!n.id&&(n.model.Billable=!0),T()})}angular.module("FieldConnectApp").controller("EditMiscController",e),e.$inject=["$scope","$location","$state","$timeout","restService","qsService","stateTransitionService","Notification","featuresFactory"]}();;!function(){"use strict";function e(e,t,i,a,o,l,n,d,r,c,m){var s=this;function u(){d.getItem("miscs/header",e.$parent.vm.id).then(function(e){e.data&&(s.header=e.data.Header)})}function f(e,t,i,a,l){l||o.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/miscModal.html",controller:"EditMiscController",controllerAs:"miscEdit",inputs:{modalTitle:"Miscellaneous edit",id:e,WoId:t,onBack:s.responsePopup,subcontractorId:i,woCompanyId:a,moduleName:s.moduleName,viewName:s.viewName}}).then(function(e){e.close.then(function(){})})}s.editMisc=function(t,i,a,o){var l=!1;e.$watch("misc.model",function(){t?d.getItem(s.apiMethod,t).then(function(){var e=d.state.item;e&&e.InvoiceId&&!a&&(n.warning({message:"This line has been invoiced, so it may not be edited."}),l=!0),f(t,i,a,o,l)}):f(t,i,a,o,l)})},s.$state=i,s.model={},s.editMiscSub=function(){n.warning({message:"This line has been invoiced, so it may not be edited."})},s.autoFilter={},s.filter={filterId:null,classId:null,typeId:null,Reload:0},s.itemDeleted=function(){e.$emit("wo.itemDelete"),e.$parent.vm.quoteId&&u()},s.responsePopup=function(t){t&&(s.filter.Reload++,s.reloadTable=!1,a(function(){s.reloadTable=!0}),"object"==typeof t&&e.$emit("wo.itemChange"))},s.viewName=e.vm.viewName,s.moduleName="Misc",s.header=null,s.usingDSLNorthwest=m.usingDSLNorthwest,s.apiMethod="miscs",s.usingDSLNorthwest&&(s.apiMethod="dslMiscs"),s.attributes=[{Name:"Description",ValueName:"WoItemName",Edit:!0,Sortable:!0},{Name:"Qty",ValueName:"Quantity",CompareValueName:"QuoteQuantity",Edit:!1,Sortable:!0},{Name:"Unit Price",ValueName:"Price",CompareValueName:"QuotePrice",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colADMiscGridPrice"},{Name:"Extended Price",ValueName:"ExtendedPrice",CompareValueName:"QuoteExtendedPrice",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colADMiscGridExtendedPrice"},{Name:"Unit Cost",ValueName:"Cost",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colADMiscGridCost"},{Name:"Extended Cost",ValueName:"ExtendedCost",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colADMiscGridExtendedCost"}],s.attributesSubcontractor=[{Name:"Description",ValueName:"WoItemName",Edit:!0,Sortable:!0},{Name:"Qty",ValueName:"Quantity",Edit:!1,Sortable:!0},{Name:"Unit Cost",ValueName:"Cost",Edit:!1,Sortable:!0,CellFormat:"decimal",Roles:["Admin","FieldConnect","SubAdmin","TransAdmin","Office"]},{Name:"Extended Cost",ValueName:"ExtendedCost",Edit:!1,Sortable:!0,CellFormat:"decimal",Roles:["Admin","FieldConnect","SubAdmin","TransAdmin","Office"]}],s.reloadTable=!0,e.$watch("vm.filter.filterId",function(e){s.filter.filterId=e}),e.$watch("misc.model.ClassId",function(){s.filter.classId=s.model.ClassId}),e.$watch("misc.model.TypeId",function(){s.filter.typeId=s.model.TypeId}),e.$on("partsmiscChange",function(e,t){s.reloadTable=!1,a(function(){s.reloadTable=!0})}),e.$watch("misc.filter",function(){s.autoFilter=l.filter("and"),null==s.filter.classId||null==s.filter.typeId?s.autoFilter.eq("WoId",s.filter.filterId):s.autoFilter.eq("WoId",s.filter.filterId).eq("ClassId",s.filter.classId).eq("TypeId",s.filter.typeId)},!0),e.$on("wo.loadQuoteItemsHeaders",function(e,t){u()}),c.$on("applyBundle",function(e){s.reloadTable=!1,a(function(){s.reloadTable=!0})})}angular.module("FieldConnectApp").controller("MiscController",e),e.$inject=["$scope","$location","$state","$timeout","ModalService","qsService","Notification","restService","$window","$rootScope","featuresFactory"]}();;!function(){"use strict";var e;angular.module("cbTimer",[]);function t(t,a,o,s,i,r,n,d,l,u,m,c,p,g,S,b,I,h,f,v,D,T,y,w){var L=this;L.$state=o,L.goToServItemPage=X,L.viewName="AssignmentDetails",L.moduleName="WOAssignmentHeader",L.selectSite=function(){i.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectSite.html",controller:"SelectSiteDetailsController",controllerAs:"vm",inputs:{site:L.site,customerId:L.customer.customerId}})},L.isActive="",L.goToSitePage=Q,L.woNumber="",L.refresh=!0,L.modelSite={},L.ReadOnly="",L.model={},L.model1={},L.modelStatus={},L.assignmentStatusInitial=null,L.update=function(){var e=angular.copy(L.model1),a=new Date(e.EstStartDate),s=new Date(e.EstEndDate),i=moment.tz.zone(H.tzDatebaseName).offset(a),n=moment.tz.zone(H.tzDatebaseName).offset(s);return p.convertToUtc(a,i),p.convertToUtc(s,n),e.EstStartDate=p.buildISOString(a),e.EstEndDate=p.buildISOString(s),D.getLocation(L.moduleName).then(function(a){e.Latitude=a.coords.latitude,e.Longitude=a.coords.longitude,r.update("woassignments/"+L.model1.Id,e).then(function(e){!function(e){if(e&&e.data&&(L.assignment=e.data,L.serviceableItemIdFilter.reset(),L.serviceableItemIdFilter.eq("ServiceableItemId",L.assignment.ServiceableItemId),L.model1.EventSynchronized=e.data.EventSynchronized,L.model1.GraphOwnerId=e.data.GraphOwnerId,L.model1.GraphObjectId=e.data.GraphObjectId,e.data.ActionResults))for(var t=0;t<e.data.ActionResults.length;t++)-1==e.data.ActionResults[t].Result?d.error({message:e.data.ActionResults[t].Message}):0==e.data.ActionResults[t].Result?d.warning({message:e.data.ActionResults[t].Message}):1==e.data.ActionResults[t].Result&&d.success({message:e.data.ActionResults[t].Message})}(e),t.$broadcast("assignmentstatuschanged"),e.data&&Y.Id!=e.data.TechId&&!W&&(d.error("Assignment does not belong to the technician."),o.go("myWorkOrders")),L.usingXOiIntegration&&(N(),x())})})},L.reloadPartsMisc=function(){t.$broadcast("partsmiscChange")},L.goToServItemReadOnly=!1,L.changeForms=function(){L.woForm=!L.woForm,L.woForm?L.btnName="Site Equipment Forms":(L.filterSiteForms.reset(),L.filterSiteForms.eq("SiteId",L.model.SiteId).eq("Id",L.modelSite.Id).eq("woId",L.model.Id),L.btnName="Work Order Forms")},L.reloadAttachmentsTable=!0,L.reloadPartsTable=!0,L.hideQuoteAttachments="hidden",L.hideServiceRequestAttachments="hidden",L.serviceRequestFilter=u.filter("and");l.getTransitionParam("workOrdersDetails");var A=window.location.pathname.split("/"),C=A[A.length-1];"myAssignments"===C&&(window.name="false");var M=te(L.viewName,"Parts");L.addPart=!0,10!==M&&2!==M||(L.addPart=!1);var P=te(L.viewName,"Labor");L.addLabor=!0,10!==P&&2!==P||(L.addLabor=!1);var O=te(L.viewName,"Task");L.addTask=!0,10===O||2===O?L.addTask=!1:"dispatchCalendar"!==C&&"dispatchChart"!==C||(window.name="true"),"true"===window.name?L.fromDispatch=!0:"false"===window.name&&(L.fromDispatch=!1),L.reloadFilter=!0,$(window).focus(function(){L.reloadFilter=!1,t.$apply(),L.reloadFilter=!0,t.$apply()});var R=n.getValue("authorizationData");L.showWoPayment=f.usingFCPayments,L.isReadOnly=!1,L.userRoles=R.userRoles.split(",");var W=!1;-1==L.userRoles.indexOf("FieldConnect")&&-1==L.userRoles.indexOf("Admin")&&-1==L.userRoles.indexOf("TransAdmin")&&-1==L.userRoles.indexOf("Office")&&-1==L.userRoles.indexOf("Dispatch")||(W=!0);var k=h.roleTypes;L.isTechnician=k.includes("Technician"),L.usingDSLNorthwest=f.usingDSLNorthwest;var F=[];function N(){L.usingXOiIntegration&&(d.warning("Loading XOi Data, please wait..."),L.isLoading=!0,w.setXOiJob(s.assId).then(function(e){L.showDeepLinks=!1,L.xoiViewJobAttribute={Type:"button",Label:"View Job",onClick:w.viewXOiJob,CustomInputClass:"col-sm-12 col-md-12 col-lg-12 btn btn-primary",CustomDivClass:"col-sm-4",Disabled:!1},L.xoiSiteHistoryAttribute={Type:"button",Label:"Site History",onClick:w.viewSiteHistory,CustomInputClass:"col-sm-12 col-md-12 col-lg-12 btn btn-primary",CustomDivClass:"col-sm-4",Disabled:!1},L.xoiVisionLiveAttribute={Type:"button",Label:"Vision Live",onClick:w.viewXOiVisionLive,CustomInputClass:"col-sm-12 col-md-12 col-lg-12 btn btn-primary",CustomDivClass:"col-sm-4",Disabled:!1},L.xoiViewShareAttribute={Type:"button",Label:"View Share",onClick:w.viewVisionShare,CustomInputClass:"col-sm-12 col-md-12 col-lg-12 btn btn-primary",CustomDivClass:"col-sm-4",Disabled:!1},L.xoiViewKnowledgeBaseAttribute={Type:"button",Label:"Knowledge Base",onClick:L.ViewKnowledgeBase,CustomInputClass:"col-sm-12 col-md-12 col-lg-12 btn btn-primary",CustomDivClass:"col-sm-4",Disabled:!0},L.xoiImportNotesAttribute={Type:"button",Label:"Import Transcriptions",onClick:L.ProcessXOICapturedData,CustomInputClass:"col-sm-12 col-md-12 col-lg-12 btn btn-primary",CustomDivClass:"col-sm-4",Disabled:!1},L.xoiViewShareAttribute.Disabled=!w.hasJobShareLink(),"none"===w.saveXOiTranscriptNote?L.xoiImportNotesAttribute.Disabled=!0:"serviceableitemnote"===w.saveXOiTranscriptNote&&null===L.assignment.ServiceableItemId&&(L.xoiImportNotesAttribute.Disabled=!0),L.assignment.ServiceableItemId&&(L.xoiViewKnowledgeBaseAttribute.Disabled=!1),L.deeplinks=[L.xoiViewJobAttribute,L.xoiSiteHistoryAttribute,L.xoiVisionLiveAttribute,L.xoiViewShareAttribute,L.xoiViewKnowledgeBaseAttribute,L.xoiImportNotesAttribute],L.deeplinksGroup={Type:"group",Attributes:L.deeplinks},L.deeplinksAttributes=[L.deeplinksGroup],L.showDeepLinks=!0,L.isLoading=!1,d.success("XOi Data Load complete.")}))}function x(){w.usingXOiIntegration&&w.preventAssignmentCompleteIfXOiJobOpen&&t.$watch("vm.modelStatus.Status",function(e,t){t&&e&&t!==e&&"Complete"===e&&(d.warning("Checking XOi Job Status, please wait..."),L.isLoading=!0,w.isXOiJobComplete(s.assId).then(function(e){e?(d.success("The Assignment can be completed."),L.isLoading=!1):(d.error("XOi Job is Open! The Assignment cannot be completed."),m(function(){L.modelStatus.Status=t,L.isLoading=!1}))}))})}L.laborApiMethod="woLabors",L.usingDSLNorthwest&&(L.laborApiMethod="dslWoLabors"),L.isTechnician?L.showOpenWorkOrder=!1:L.showOpenWorkOrder=!0,L.openWorkOrder=function(){l.popTransitionParam("workOrderDetails"),o.go("workOrdersDetails",{id:s.id})},L.usingXOiIntegration=!1,L.usingXOiIntegration=w.usingXOiIntegration(),L.serviceableItemModuleName="AssignServiceableItems",L.usingQuoting=f.usingQuoting,v.clearCustomer(),L.usingGroundBreakers=f.usingGroundBreakers,L.customReport=!1,L.serviceReportCount=0,L.serviceReportMax=99,L.serviceReportAPI="woservicereports",L.usingGroundBreakers&&(L.serviceReportAPI="gbwoservicereports"),L.hideAddButton=!1,t.$watch("vm.count",function(e,t){e!==t&&(L.hideAddButton=!1,L.count>0&&L.usingDSLNorthwest&&(L.hideAddButton=!0))}),L.roleUsingPayments=!1,L.showScannerPanel=!1,L.isTechnician&&L.usingDSLNorthwest&&(L.showScannerPanel=!0),(h.isAdmin||h.isDispatch||h.isSupervisor||h.isTechnician)&&(L.roleUsingPayments=!0),L.filter={filterId:s.id},L.filter1={siteId:L.model.SiteId,rateSheetId:null},L.filter2={fromDate:null,toDate:null,search:"",status:""},L.filter3={filterAltId:s.assId},L.partsData={partsCovered:!1},L.miscData={miscCovered:!1},L.laborData={laborMarkup:0,laborCovered:!1},L.filterByWorkOrder=u.filter("and"),L.filterByWorkOrder.eq("WoId",L.filter.filterId),L.filterOnlyByWorkOrder=u.filter("and"),L.filterOnlyByWorkOrder.eq("WoId",L.filter.filterId),L.showBundles=!1,r.getItems("companyfeatures/currentCompany").then(function(e){for(var t=e.data.Data,a=0;a<t.length;a++)if("Bundles"===t[a].FeatureName){L.showBundles=JSON.parse(t[a].Value.toLowerCase());break}L.showBundles&&r.getItem("woassignments",s.assId).then(function(e){L.filterBundles=u.filter("and"),L.filterBundles.eq("ProblemCodeId",e.data.ProblemCodeId).eq("WoId",L.filter.filterId),r.getItems("bundle/woGrid",L.filterBundles).then(function(e){e.data.Data.length>0&&function e(t,a){if(a[t].AutoApply&&null==a[t].WoId){var o={};o.Id=a[t].Id,o.assignmentId=s.assId,r.create("bundle/apply",o).then(function(o){var s="Bundle "+a[t].BundleName+" has been applied";d.success({message:s}),a[++t]&&e(t,a)})}else a[++t]&&e(t,a)}(0,e.data.Data)})})}),L.count=0,L.estHoursTotal=0,L.countSiteNotes=0,L.countWoNotes=0,L.customer={customerId:0},L.customers=[],L.site={siteId:0},L.serviceableItemIdFilter=u.filter("and"),L.countAssignments=0,L.countLabor=0,L.countParts=0,L.countMisc=0,L.id=s.id,L.assid=s.assId,L.companyWoStatus={},L.companyAssignmentStatus={},L.editWorkorder=function(){if(L.isActive&&L.currentStatus!==L.model.Status)return L.model.Status=L.currentStatus,void d.warning("Labor in progress! Work Order Status cannot be changed.");return D.getLocation("WorkOrder").then(function(e){var t=angular.copy(L.model),a=e.coords.latitude,s=e.coords.longitude;null!==a&&(t.Latitude=a),null!==s&&(t.Longitude=s);var i=n.getValue("authorizationData");i&&i.tzDatebaseName&&(L.userTimeZone=moment.tz(i.tzDatebaseName).zoneAbbr());var l=new Date(t.PromiseDate),c=moment.tz.zone(i.tzDatebaseName).offset(l);return p.convertToUtc(l,c),t.PromiseDate=p.buildISOString(l),function(){if("Complete"===L.model.Status){var e=u.filter("and");e.eq("Woid",L.model.Id),r.getItems("woassignments",e).then(function(){var e=r.state.items;e.length>0&&function e(t,a){"Complete"!=a[t].Status?(a[t].Status="Complete",r.update("woassignments/"+a[t].Id,a[t]).then(function(){a[++t]?e(t,a):d.success({message:"All Assignments Completed!"})})):a[++t]&&e(t,a)}(0,e)})}}(),r.update(L.woAPI+"/"+L.id,t).then(function(){d.success({message:"Work order has been successfully updated."}),m(function(){o.reload()},2e3)})})},L.assignmentChanged=!1,L.editAssignmentStatus=function(){return D.getLocation("AssignmentStatus").then(function(e){var a=e.coords.latitude,o=e.coords.longitude;null!==a&&(L.modelStatus.Latitude=a),null!==o&&(L.modelStatus.Longitude=o),r.update("woassignments/status/"+L.assid,L.modelStatus).then(function(){if(L.model1.Status=L.modelStatus.Status,t.$broadcast("assignmentstatuschanged"),d.success({message:"Assignment status has been successfully updated."}),"Traveling"===L.model1.Status&&L.model1.Status!==L.assignmentStatusInitial&&(L.assignmentFilter={AssignmentId:L.assid,AssignmentStatus:L.model1.Status},r.create("woassignments/sendAssignmentStatusNotification",L.assignmentFilter).then(function(e){200==e.status&&d.success("Customer notification has been sent.")})),"Complete"===L.model1.Status&&L.model1.Status!==L.assignmentStatusInitial){var e=[],a=u.filter("and");a.eq("WoId",L.id),r.getItems("woassignments",a).then(function(t){e=t.data.Data;for(var a=!0,o=!0,s=0;s<e.length;s++)"Complete"!=e[s].Status&&(a=!1),e[s].TechId===L.model1.TechId&&"Complete"!=e[s].Status&&(o=!1);if(a){if("always"===L.showRptAfterComplete.toLowerCase()||"last assignment"===L.showRptAfterComplete.toLowerCase()){var i={};l.setTransitionParam("openServiceReport",i)}L.$state.go("assignmentDetailsReadOnly",{id:L.id,assId:L.assid})}else if(!W&&o){if("always"===L.showRptAfterComplete.toLowerCase()){var i={};l.setTransitionParam("openServiceReport",i)}L.$state.go("assignmentDetailsReadOnly",{id:L.id,assId:L.assid})}else"always"===L.showRptAfterComplete.toLowerCase()&&(ee("servreportGrid"),$('.panel-collapse:not(".in")').collapse("show"),m(function(){$("#service-report .add-new-btn").click()},1e3,!1))})}L.assignmentStatusInitial=L.model1.Status})})},L.checkTotalCount=Z,Z(),L.customerFilter=u.filter("or"),L.filterByWorkOrder.eq("Id",L.assid),L.filterBySite=u.filter("and"),L.filterSiteForms=u.filter("and"),L.customerSiteFilter=u.filter("and"),L.customerSiteFilter.eq("WoId",L.id),L.taskGrid=!1,L.poGrid=!1,T.getCompanySettings().then(function(e){L.attWoDescription.MaxLength=T.WODescMaxLength,L.poGrid=T.POGrid,L.taskGrid=T.TaskGrid,L.companyAutoCompleteWO=T.AutoCompleteWO,L.showRptAfterComplete=T.ShowReportAfterComplete,L.defaultAssignmentStatus=T.DefaultAssignmentStatus,function(){var e=[L.attWoWorkOrder,L.attWoStatus,L.attWoCustomer,L.attWoPriority,L.attWoAddress,L.attWoRequestor,L.attWoSite,L.attWoLink,L.attWoDescription,L.attWoWorkOrderType,L.attWoPhone,L.attWoAgreement,L.attWoPromisedDate,G,L.attWoCustomerPoNumber,L.attWoOffice,L.attWoSiteTimeZone,L.attWoSalesperson,L.attWoCreatedBy,L.attWoLeadSource,L.attWoGraphObjectId,L.attWoGraphOwnerId,L.attWoEventSynchronized],t=[L.attAssignLine1,L.attAssignDescription,L.attAssignEstStartDate,L.attAssignServiceableItem,L.attAssignLink,L.attAssignProblemCode,L.attAssignEstimatedHours,L.attAssignCause,L.attAssignTechnician,L.attAssignResolution,L.attAssignNote,j,L.attAssignEstEndDate,L.attAssignGraphObjectId,L.attAssignGraphOwnerId,L.attAssgnEventSynchronized];if(L.showForm=!1,L.usingDSLNorthwest){L.attDSLLine1={Type:"line",CustomClass:"col-sm-12"},L.attDSLWoExportHeader={Type:"text",Label:"WO Export",ModelValue:"",CustomInputClass:"hidden"},L.attDSLBlank1={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},L.attDSLUnitDown={Type:"checkbox",Label:"Unit Down",ModelValue:"woeUnitDown",TabIndex:17},L.attDSLRewritePartsReceived={Type:"dropdown",Label:"Rewrite Parts Received:",Required:!1,ApiMethod:"dslPartsReceived/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"woeRewritePartsReceived",TabIndex:18},L.attDSLIsUnitReplaceAnother={Type:"checkbox",Label:"Is Unit Replace Another",ModelValue:"woeIsUnitReplaceAnother",TabIndex:17},L.attDSLRecallDueTo={Type:"dropdown",Label:"Recall Due To:",Required:!1,ApiMethod:"dslRecallDueTo/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"woeRecallDueTo",TabIndex:18},L.attDSLFieldScrapFlag={Type:"checkbox",Label:"Field Scrap Flag",ModelValue:"woeFieldScrapFlag",TabIndex:17},L.attDSLProcessPracticeFlag={Type:"checkbox",Label:"Process/Practice Flag",ModelValue:"woeProcessPracticeFlag",TabIndex:17},L.attDSLUnitOperAtDepartureFlag={Type:"checkbox",Label:"Unit Oper. at Departure",ModelValue:"woeUnitOperAtDeparture",TabIndex:17},L.attDSLBulletinNumber={Type:"text",Label:"Bulletin Number:",Required:!1,MaxLength:"20",ModelValue:"woeBulletinNumber",TabIndex:5},L.attDSLQualityReportFlag={Type:"checkbox",Label:"Quality Report Flag",ModelValue:"woeQualityReportFlag",TabIndex:17},L.attDSLCertificationNumber={Type:"text",Label:"Certification Number:",Required:!1,MaxLength:"20",ModelValue:"woeCertificationNumber",TabIndex:5},L.attDSLPreviousUnitFieldSerialNumber={Type:"text",Label:"Previous Unit Field Serial No.:",Required:!1,MaxLength:"20",ModelValue:"woePreviousUnitFieldSerialNumber",TabIndex:5},L.attDSLPurchasedFromDistributor={Type:"dropdown",Label:"Purchased From Distributor:",Required:!1,ApiMethod:"dslDistributor/ddList",ValueProp:"Id",TextProp:"Name",ModelValue:"woePurchasedFromDistributor",TabIndex:18},L.attDSLWOEId={Type:"hidden",ModelValue:"woeId"},L.attDSLServiceZoneCode={Type:"text",Label:"Service Zone Code:",Required:!1,ReadOnly:!0,MaxLength:"20",ModelValue:"ServiceZoneCode"},L.attDSLLine2={Type:"line",CustomClass:"col-sm-12"},L.attDSLRewrite={Type:"checkbox",Label:"Rewrite",ModelValue:"User4",TabIndex:17},L.attDSLRecall={Type:"checkbox",Label:"Recall",ModelValue:"User5",TabIndex:17},L.attDSLFactoryServiceOrderType={Type:"dropdown",Label:"Factory Service Order Type:",ApiMethod:"dslServiceOrderType/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"User8",ConvertToInt:"true"},L.attDSLVisits={Type:"text",Label:"Visits:",ModelValue:"DSLVisits",ReadOnly:!0},L.attDSLAuthorizedBy={Type:"text",Label:"Authorized By:",Required:!1,MaxLength:"20",ModelValue:"User0",TabIndex:5},L.attDSLAdditionalDetailsHeader={Type:"text",Label:"Additional Details",ModelValue:"",CustomInputClass:"hidden"},L.attDSLLine3={Type:"line",CustomClass:"col-sm-12"},L.attDSLLine4={Type:"line",CustomClass:"col-sm-12"},L.attDSLBlank2={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},L.attDSLBlank3={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},L.attDSLFailureResolution={Type:"dropdown",Label:"Reason for Failed Install:",ApiMethod:"dslFailureResolution/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"User8",ConvertToInt:"true",TabIndex:41},L.attDSLGroundCheck={Type:"checkbox",Label:"Ground Check",Required:!1,ModelValue:"User4"};var a=[L.attWoWorkOrder,L.attWoStatus,L.attWoCustomer,L.attWoPriority,L.attWoAddress,L.attWoRequestor,L.attWoSite,L.attWoLink,L.attWoDescription,L.attWoWorkOrderType,L.attWoPhone,L.attWoAgreement,L.attWoPromisedDate,G,L.attWoCustomerPoNumber,L.attWoOffice,L.attWoSiteTimeZone,L.attWoSalesperson,L.attWoCreatedBy,L.attWoLeadSource,L.attDSLLine1,L.attDSLAdditionalDetailsHeader,L.attDSLBlank2,L.attDSLRewrite,L.attDSLRecall,L.attDSLFactoryServiceOrderType,L.attDSLVisits,L.attDSLAuthorizedBy,L.attDSLServiceZoneCode,L.attDSLLine4,L.attDSLWoExportHeader,L.attDSLBlank1,L.attDSLUnitDown,L.attDSLRewritePartsReceived,L.attDSLIsUnitReplaceAnother,L.attDSLRecallDueTo,L.attDSLFieldScrapFlag,L.attDSLProcessPracticeFlag,L.attDSLUnitOperAtDepartureFlag,L.attDSLBulletinNumber,L.attDSLQualityReportFlag,L.attDSLCertificationNumber,L.attDSLPreviousUnitFieldSerialNumber,L.attDSLPurchasedFromDistributor,L.attWoGraphObjectId,L.attWoGraphOwnerId,L.attWoEventSynchronized,L.attDSLWOEId];L.attDSLFailureResolution={Type:"dropdown",Label:"Reason for Failed Install:",ApiMethod:"dslFailureResolution/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"User8",ConvertToInt:"true",TabIndex:41},L.attDSLGroundCheck={Type:"checkbox",Label:"Ground Check",Required:!1,ModelValue:"User4"},F=[L.attAssignLine1,L.attAssignDescription,L.attAssignEstStartDate,L.attAssignServiceableItem,L.attAssignLink,L.attAssignProblemCode,L.attAssignEstimatedHours,L.attAssignCause,L.attAssignTechnician,L.attAssignResolution,L.attAssignNote,L.attDSLFailureResolution,L.attDSLGroundCheck,j,L.attAssignEstEndDate,L.attAssignGraphObjectId,L.attAssignGraphOwnerId,L.attAssgnEventSynchronized],L.attAssignServiceableItem.ApiMethod="serviceableitems/dsldropdownbysite",L.attAssignServiceableItem.TextProp="DDLabel",L.woAssignmentsAPI="dslwoassignments",L.attAssignServiceableItem.Required=L.isTechnician,L.woAPI="wodetails/DSL",L.attributes=a,L.assignmentatt=F}else L.woAPI="wodetails",L.woAssignmentsAPI="woassignments",L.attributes=e,L.assignmentatt=t;L.showForm=!0}()}),L.ProcessXOICapturedData=function(){L.isLoading=!0,w.processXOICapturedData().then(function(e){e?(L.reloadNoteTable=!1,L.refresh=!1,m(function(){L.reloadNoteTable=!0,L.refresh=!0,L.isLoading=!1})):L.isLoading=!1})},L.ViewKnowledgeBase=function(){w.viewKnowlegeBase(L.assignment.ServiceableItemId)},L.reloadNoteTable=!0;var E=[];L.userSettingsFilter=u.filter("and"),L.userSettingsFilter.eq("Name","OpenAllPanels"),r.getItems("usersettings",L.userSettingsFilter).then(function(e){E=e.data.Data;for(var t=0;t<E.length;t++){if("OpenAllPanels"==E[t].Name&&0!=E[t].Id&&null!=E[t].Value)JSON.parse(E[t].Value.toLowerCase())&&(ee(),$('.panel-collapse:not(".in")').collapse("show"))}}),L.formswo=[];var V={page:0,pageSize:0},G={};W?(L.goToServItemReadOnly=!1,G={Type:"dropdown",Label:"Project:",Required:!1,ApiMethod:"projects/getProjectForWo",ValueProp:"Id",TextProp:"ProjectName",ModelValue:"ProjectId",ConvertToInt:"true",Filter:L.customerSiteFilter,ObjectName:"ddlWoProject"}):(L.goToServItemReadOnly=!0,G={Type:"dropdown",Label:"Project:",Required:!1,ApiMethod:"projects/getProjectForWo",ValueProp:"Id",TextProp:"ProjectName",ModelValue:"ProjectId",ConvertToInt:"true",Filter:L.customerSiteFilter,ReadOnly:!0,ObjectName:"ddlWoProject"}),(V=u.filter("and")).eq("WoId",L.id),V.page=1,V.pageSize=100,r.getItems("forms/getforwodetails",V).then(function(){L.formswo=r.state.items}),L.attributesSite=[{Type:"dropdown",Label:"Forms",Required:!1,ApiMethod:"forms/getforSiteEquipmentDropdown",ValueProp:"Id",TextProp:"Name",ModelValue:"Id",Filter:L.filterByWorkOrder}];var q=t.$watch("vm.attributesSite[0].CurrentList",function(){L.attributesSite[0].CurrentList&&L.attributesSite[0].CurrentList.length>0&&(L.modelSite.Id=L.attributesSite[0].CurrentList[0].Id,L.filterSiteForms.reset(),L.filterSiteForms.eq("SiteId",L.model.SiteId).eq("Id",L.modelSite.Id).eq("woId",L.model.Id),q())}),B={Type:"button",Label:"Notify Dispatcher",onClick:_,CustomDivClass:"col-sm-2",ObjectName:"btnInvoiceButton"},H=n.getValue("authorizationData");H&&H.tzDatebaseName&&(L.userTimeZone=moment.tz(H.tzDatebaseName).zoneAbbr()),L.attWoWorkOrder={Type:"text",Label:"Work Order:",ReadOnly:!0,ModelValue:"AltId"},L.attWoStatus={Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"wostatuses",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"Status",ObjectName:"ddlAssignDetailWOStatus"},L.attWoCustomer={Type:"text",Label:"Customer:",Required:!0,MaxLength:"50",ModelValue:"CustomerName",ReadOnly:!0},L.attWoPriority={Type:"dropdown",Label:"Priority:",Required:!1,ApiMethod:"priorities",ValueProp:"PriorityName",TextProp:"PriorityName",ModelValue:"Priority",ObjectName:"ddlWoPriority"},L.attWoAddress={Type:"text",Label:"Address",Required:!1,MaxLength:"100",ModelValue:"Address",ReadOnly:!0},L.attWoRequestor={Type:"text",Label:"Requestor:",Required:!1,MaxLength:"100",ModelValue:"ContactName"},L.attWoSite={Type:"text",Label:"Site:",Required:!0,MaxLength:"50",ModelValue:"SiteName",ReadOnly:!0,CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo"},L.attWoLink={Type:"link",onClick:Q,ICustomInputClass:"fa fa-external-link ViewLink"},L.attWoDescription={Type:"textarea",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Desc",Autofocus:"true"},L.attWoWorkOrderType={Type:"dropdown",Label:"Work Order Type:",Required:!1,ApiMethod:"wotypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"WoType",ObjectName:"ddlWoTypeDropdown"},L.attWoPhone={Type:"text",Label:"Phone:",MaxLength:"50",ModelValue:"ContactPhone"},L.attWoAgreement={Type:"dropdown",Label:"Agreement:",Required:!1,ApiMethod:"agreements/getAgreementsByCustomer",ValueProp:"Id",TextProp:"Desc",ModelValue:"AgreementId",ConvertToInt:"true",Filter:L.customerFilter,ObjectName:"ddlWoAgreement"},L.attWoPromisedDate={Type:"datepicker",Label:"Promised Date:",ModelValue:"PromiseDate",Format:"MM/dd/yyyy hh:mm a "+L.userTimeZone,SubType:"date"},L.attWoCustomerPoNumber={Type:"text",Label:"Customer PO Number:",Required:!1,MaxLength:"50",ModelValue:"CustomerPONum"},L.attWoOffice={Type:"dropdown",Label:"Office:",Required:!0,ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true",ObjectName:"ddlWoOffice"},L.attWoSiteTimeZone={Type:"text",Label:"Site Time Zone:",ModelValue:"TimeZoneName",ReadOnly:!0},L.attWoSalesperson={Type:"dropdown",Label:"Salesperson:",ApiMethod:"employees/getSalesPersonList",ValueProp:"Id",TextProp:"FullName",ModelValue:"SalesPersonId",ConvertToInt:"true",ReadOnly:!0},L.attWoCreatedBy={Type:"text",Label:"Created By:",ModelValue:"CreatedBy",ReadOnly:!0},L.attWoLeadSource={Type:"dropdown",Label:"Lead Source:",ApiMethod:"leadSource/ddList",ValueProp:"Id",TextProp:"DdlLabel",ModelValue:"LeadSourceId",ConvertToInt:"true",ReadOnly:!0},L.attWoGraphObjectId={Type:"hidden",ModelValue:"GraphObjectId"},L.attWoGraphOwnerId={Type:"hidden",ModelValue:"GraphOwnerId"},L.attWoEventSynchronized={Type:"hidden",ModelValue:"EventSynchronized"},L.attAssignLine1={Type:"line",CustomClass:"col-sm-12"},L.attAssignDescription={Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc",Required:!0},L.attAssignEstStartDate={Type:"datepicker",Label:"Scheduled:",ModelValue:"EstStartDate",Format:"MM/dd/yyyy"},L.attAssignServiceableItem={Type:"dropdown",Label:"Serviceable Item:",ApiMethod:"serviceableitems/dropdownbysite",Filter:L.filter1,ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",ConvertToInt:"true",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo"},L.attAssignLink={Type:"link",onClick:X,ICustomInputClass:"fa fa-external-link ViewLink"},L.attAssignProblemCode={Type:"dropdown",Label:"Problem Code:",ApiMethod:"problemcodes",ValueProp:"ProblemCodeName",TextProp:"ProblemCodeName",ModelValue:"ProblemCode",Required:!0},L.attAssignEstimatedHours={Type:"decimal",Label:"Estimated Hours:",MaxLength:"50",ModelValue:"EstHours"},L.attAssignCause={Type:"dropdown",Label:"Cause:",ApiMethod:"causes",ValueProp:"CauseName",TextProp:"CauseName",ModelValue:"Cause"},L.attAssignTechnician={Type:"dropdown",Label:"Technician:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"TechId",ConvertToInt:"true",ReadOnly:!1},L.attAssignResolution={Type:"dropdown",Label:"Resolution:",ApiMethod:"resolutions",ValueProp:"ResolutionName",TextProp:"ResolutionName",ModelValue:"Resolution"},L.attAssignNote={Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"},L.attAssignEstEndDate={Type:"datepicker",ModelValue:"EstEndDate",Format:"MM/dd/yyyy",CustomInputClass:"hidden"},L.attAssignGraphObjectId={Type:"hidden",ModelValue:"GraphObjectId"},L.attAssignGraphOwnerId={Type:"hidden",ModelValue:"GraphOwnerId"},L.attAssgnEventSynchronized={Type:"hidden",ModelValue:"EventSynchronized"};var z={Type:"button",Label:"Unassign",onClick:function(){r.getItem("woassignments/status/"+L.assignment.Id).then(function(e){"Assigned"===e.data.Status?bootbox.confirm("Are you sure that you want to unassign this Assignment?",function(e){e&&m(function(){L.model1.TechId=null,L.model1.EstStartDate=null,L.model1.Status=L.defaultAssignmentStatus,L.modelStatus.Status=L.defaultAssignmentStatus,r.update("woassignments/unassign/"+L.assignment.Id).then(function(e){d.success({message:"This Assignment has been unassigned."})})})}):d.warning({message:'Only Assignments with a status of "Assigned" can be unassigned!'})})},CustomDivClass:"col-sm-2"},U=[];0!==L.userRoles.indexOf("Dispatch")&&U.push(B),0!==L.userRoles.indexOf("Dispatch")&&0!==L.userRoles.indexOf("Admin")||U.push(z);var j={Type:"group",Attributes:U,CustomClass:"col-sm-8"};function X(){null==L.model1.ServiceableItemId?d.warning({message:"First you must select serviceable item"}):1==L.goToServItemReadOnly?o.go("serviceableItemsReadOnly",{customerId:L.customer.customerId,id:L.model1.ServiceableItemId}):o.go("serviceableItemsEdit",{customerId:L.customer.customerId,id:L.model1.ServiceableItemId})}function Q(){o.go("siteReadOnly",{id:L.model.SiteId})}function Z(e){L.filterWoForTotalCount=u.filter("and"),L.filterWoForTotalCount.eq("WoId",L.id),r.getItems("woassignments",L.filterWoForTotalCount).then(function(e){var t=e.data.Data;L.count=t.length,L.estHoursTotal=0;for(var a=0;a<t.length;a++)L.estHoursTotal=L.estHoursTotal+t[a].EstHours})}function J(){r.getItem("woassignments",L.assid).then(function(){var e=r.state.item;if(L.assignment=e,L.usingXOiIntegration&&(N(),x()),L.resetServiceableItemIdFilter(),"Complete"==e.WorkOrderStatus||"Invoiced"==e.WorkOrderStatus||"ReadyToInvoice"==e.WorkOrderStatus)o.go("assignmentDetailsReadOnly",{id:e.WoId,assId:e.Id});else{var t=[],a={},s=!0;(a=u.filter("and")).reset(),a.eq("TechId",e.TechId).eq("WoId",e.WoId),r.getItems("woassignments",a).then(function(){t=r.state.items;for(var a=0;a<t.length;a++)if("Complete"!=t[a].Status){s=!1;break}s?o.go("assignmentDetailsReadOnly",{id:e.WoId,assId:e.Id}):r.getItem("companyinfos/getCurrentCompany").then(function(){L.currentCompany=r.state.item,e.CompanyId==L.currentCompany.Id?o.go("assignmentDetails",{id:e.WoId,assId:e.Id}):o.go("assignmentSubcontractorDetails",{id:e.WoId,assId:e.Id})})})}})}t.$watch("vm.isActive",function(e,t){1==L.isActive?("Traveling"===L.modelStatus.Status?L.disableServiceButton=!0:L.serviceButton=!0,L.laborDeleteButton=!1,L.isActiveLaborMessage="*In-Progress labor entries cannot be modified",L.isActiveStatusMessage="*Assignment Status can not be changed while an assignment is In-Progress",L.trackingInfo={active:!0,assid:L.assid},y.$broadcast("setTimeTracking",L.trackingInfo),L.assignmentStatus=[{Type:"dropdown",Label:"Status:",ReadOnly:!0,ApiMethod:"assignmentstatuses",ValueProp:"AssignmentStatusName",TextProp:"AssignmentStatusName",ModelValue:"Status",Required:!0,ObjectName:"ddlStatusDropdown"}]):0==L.isActive&&(L.serviceButton=!1,L.laborDeleteButton=!0,L.isActiveLaborMessage="",L.isActiveStatusMessage="",L.trackingInfo={active:!1,assid:L.assid},y.$broadcast("setTimeTracking",L.trackingInfo),L.assignmentStatus=[{Type:"dropdown",Label:"Status:",ApiMethod:"assignmentstatuses/ddList",ValueProp:"AssignmentStatusName",TextProp:"AssignmentStatusName",ModelValue:"Status",Required:!0,ObjectName:"ddlStatusDropdown"}])}),L.loadingIndicator=!1,t.$on("wo.assignmentChange",function(e,t){L.refresh=!1,m(function(){L.refresh=!0})}),L.assignmnentTimezone={TzDatabaseName:"%TzDatabaseName%"},L.woTimezone={TzDatabaseName:"%TzDatabaseName%"},L.woForm=!0,L.btnName="Site Equipment Forms",t.$watch("vm.model.Id",function(e,t){L.customer.customerId=L.model.CustomerId,L.site.siteId=L.model.SiteId,L.site.siteName=L.model.SiteName,L.site.title=L.model.ContactName,L.site.phone=L.model.ContactPhone,L.site.address=L.model.Address,L.filterBySite.eq("SiteId",L.model.SiteId),L.customerSiteFilter.reset(),L.customerSiteFilter.eq("WoId",L.id).eq("CustomerId",L.model.CustomerId).eq("SiteId",L.model.SiteId),L.currentStatus=L.model.Status,L.viewQuoteAttachments=!1,L.model.ServiceRequestId&&(L.serviceRequestFilter.reset(),L.serviceRequestFilter.eq("ServiceRequestId",L.model.ServiceRequestId),L.hideServiceRequestAttachments="");for(var a=0;a<L.userRoles.length;a++)"Admin"!=L.userRoles[a]&&"Dispatch"!=L.userRoles[a]&&"Office"!=L.userRoles[a]&&"Technician"!=k[a]||(L.viewQuoteAttachments=!0);L.isFromQuote=!1,L.model.QuoteId&&L.viewQuoteAttachments&&(L.isFromQuote=!0,L.filterByQuote=u.filter("and"),L.filterByQuote.eq("QuoteId",L.model.QuoteId),L.hideQuoteAttachments="");var o=new Date(L.model.SysCreateUTC),s=moment.tz.zone(H.tzDatebaseName).offset(o);p.convertToLocal(o,s),r.getItem("users",L.model.SysCreatorId).then(function(){var e=r.state.item;L.model.CreatedOn=o.toLocaleString()+" "+L.userTimeZone,L.model.CreatedBy=e.FirstName+" "+e.LastName+" - "+moment(o).format("MM/DD/YYYY h:mm A")+" "+L.userTimeZone}),L.model.QuoteId?l.setTransitionParam("quoteId",L.model.QuoteId):l.popTransitionParam("quoteId"),L.usingDSLNorthwest&&I.getVisits(L.model.SiteId).then(function(e){L.model.DSLVisits=e}),e!==t&&L.checkInProgressLabor(),L.usingXOiIntegration&&m(function(){w.setSiteAddress(L.model.Address)})}),t.$watch("vm.model1.Id",function(){L.model1&&(L.assignmentStatusInitial=L.model1.Status)}),t.$watch("vm.modelSite",function(){void 0!==L.modelSite.Id&&(null==L.modelSite.Id&&L.attributesSite[0].CurrentList&&L.attributesSite[0].CurrentList.length>0&&(L.modelSite.Id=L.attributesSite[0].CurrentList[0].Id),L.filterSiteForms.reset(),L.filterSiteForms.eq("SiteId",L.model.SiteId).eq("Id",L.modelSite.Id).eq("woId",L.model.Id))},!0),t.$watch("vm.customer.customerId",function(){null!=L.customer.customerId&&L.customer.customerId>0&&L.model.CustomerId!=L.customer.customerId&&(L.model.CustomerId=L.customer.customerId,L.model.CustomerName=L.customer.customerName,L.model.SiteId=0,L.model.SiteName="",L.model.Address="",L.model.ContactName="",L.model.ContactPhone=""),null!=L.customer.customerId&&L.usingGroundBreakers&&r.getItem("customers/",L.model.CustomerId).then(function(){var e=r.state.item;v.addCustomer(e),L.serviceReportMax=1,L.customReport=e.User4})}),t.$watch("vm.site.siteId",function(){null!=L.site.siteId&&L.site.siteId>0&&(L.model.SiteId=L.site.siteId,L.model.SiteName=L.site.siteName,L.model.ContactName=L.site.title,L.model.ContactPhone=L.site.phone,L.model.Address=L.site.address,L.filter1.siteId=L.site.siteId,L.usingDSLNorthwest&&(L.dslServiceableItemFilter=u.filter("and"),L.dslServiceableItemFilter.reset(),L.dslServiceableItemFilter.eq("SiteId",L.site.siteId),L.attAssignServiceableItem.Filter=L.dslServiceableItemFilter,L.assignmentatt=F))}),t.$watch("vm.model.RateSheetId",function(){null!=L.model.RateSheetId&&L.model.RateSheetId>0&&(L.filter1.rateSheetId=L.model.RateSheetId)}),J();var K=[];r.getItems("problemcodes").then(function(){K=r.state.items}),t.$watch("vm.model1.EstStartDate",function(){if(null!=L.model1.EstStartDate||void 0!=L.model1.EstStartDate){if(null!=L.model1.EstHours){var e=new Date(L.model1.EstStartDate),t=Math.floor(L.model1.EstHours),a=Math.round(100*(L.model1.EstHours-t)),o=t,s=Math.round(60*a/100);e.setMinutes(e.getMinutes()+s),e.setHours(e.getHours()+o),L.model1.EstEndDate=e}else if(null!=L.model.EstEndDate){if(L.model1.EstEndDate<L.model1.EstStartDate)return L.model1.EstEndDate=L.model1.EstStartDate,void d.error("The scheduled start can’t be after scheduled end!");var i=100*Math.round(L.model.EstEndDate/1e5),r=100*Math.round(L.model.EstStartDate/1e5);o=(new Date(i)-new Date(r))/3600;isEstChange=!0,L.model.EstHours=Math.round(100*o)/100}}else L.model.EstEndDate=null},!0),t.$watch("vm.model1.EstEndDate",function(e,t){if(null!=L.model1.EstEndDate||void 0!=L.model1.EstEndDate){if(null!=L.model1.EstStartDate){if(100*Math.round(L.model.EstEndDate/1e5)!=100*Math.round(L.model.EstStartDate/1e5)&&L.model.EstEndDate<L.model.EstStartDate&&(L.model.EstEndDate<t||null===t))return L.model.EstEndDate=t,void d.error("The scheduled start can’t be after scheduled end!");var a=100*Math.round(L.model.EstEndDate/1e5),o=100*Math.round(L.model.EstStartDate/1e5),s=(new Date(a)-new Date(o))/3600;L.model.EstHours=s}else if(0==isEstChange){var i=new Date(L.model.EstEndDate),r=Math.floor(L.model.EstHours),n=Math.round(100*(L.model.EstHours-r)),l=(s=r,Math.round(60*n/100));i.setMinutes(i.getMinutes()-l),i.setHours(i.getHours()-s),L.model.EstStartDate=i}}else L.model.EstStartDate=null},!0),t.$watch("vm.model1.EstHours",function(){if(null!=L.model1.EstHours||void 0!=L.model1.EstHours)if(null!=L.model1.EstStartDate){var e=new Date(L.model1.EstStartDate),t=Math.floor(L.model1.EstHours),a=Math.round(100*(L.model1.EstHours-t)),o=t,s=Math.round(60*a/100);e.setMinutes(e.getMinutes()+s),e.setHours(e.getHours()+o),L.model1.EstEndDate=e}else if(null!=L.model.EstEndDate){var i=new Date(L.model.EstEndDate);t=Math.floor(L.model.EstHours),a=Math.round(100*(L.model.EstHours-t)),o=t,s=Math.round(60*a/100);i.setMinutes(i.getMinutes()-s),i.setHours(i.getHours()-o),L.model.EstStartDate=i}},!0),L.isFirstProblemCode=!1,t.$watch("vm.model1.ProblemCode",function(){if(void 0!=L.model1.ProblemCode)if(L.isFirstProblemCode){for(var e=0;e<K.length;e++)if(K[e].ProblemCodeName==L.model1.ProblemCode){L.model1.EstHours=K[e].DefaultHours,L.model1.Desc=K[e].Decs;break}}else L.isFirstProblemCode=!0;else L.model1.EstHours=null,L.model1.Desc=null});var Y={};function _(){var e={WoId:L.model.AltId,Id:parseInt(L.assid),SysCreatorId:L.model1.SysCreatorId};i.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/assignmentEmail.html",controller:"AssignmentSendEmailController",controllerAs:"vm",inputs:{model:e}}).then(function(e){e.close.then(function(){L.reloadTable=!1,m(function(){L.reloadTable=!0})})})}function ee(e){switch(e){case"assignmentsGrid":L.assignmentsGrid=!0;break;case"notesGrid":L.notesGrid=!0;break;case"laborGrid":L.laborGrid=!0;break;case"partsGrid":L.partsGrid=!0;break;case"miscGrid":L.miscGrid=!0;break;case"tasksGrid":L.tasksGrid=!0;break;case"servreportGrid":L.servreportGrid=!0;break;case"attachmentsGrid":L.attachmentsGrid=!0;break;case"formsGrid":L.formsGrid=!0;break;case"poesGrid":L.poesGrid=!0;break;case"woHeader":L.woHeader=!0;break;case"bundleGrid":L.bundleGrid=!0;break;case"woServiceableItemPanel":L.woServiceableItemPanel=!0;break;case"xoiGrid":L.xoiGrid=!0;break;case"woPaymentGrid":L.woPaymentGrid=!0;break;case"deficiencyGrid":L.deficiencyGrid=!0;break;default:L.assignmentsGrid=!0,L.notesGrid=!0,L.laborGrid=!0,L.partsGrid=!0,L.miscGrid=!0,L.tasksGrid=!0,L.servreportGrid=!0,L.attachmentsGrid=!0,L.formsGrid=!0,L.poesGrid=!0,L.woHeader=!0,L.bundleGrid=!0,L.woServiceableItemPanel=!0,L.xoiGrid=!0,L.woPaymentGrid=!0,L.deficiencyGrid=!0}}function te(e,t){return b.getModulePrivilege(e,t)}S.getCurrentUserEmployeeData().then(function(e){Y=e}),t.$watch("vm.model.CustomerId",function(){L.model.CustomerId?(L.customerFilter.reset(),L.customerFilter.eq("Status","Active"),L.customerFilter.eq("Id",L.model.AgreementId),L.customerFilter.customerId=L.model.CustomerId):(L.customerFilter.reset(),L.customerFilter.eq("Status","Active"),L.customerFilter.eq("Id",L.model.AgreementId),L.customerFilter.customerId=0)}),t.$watch("vm.model.AgreementId",function(){void 0!=L.model.AgreementId&&(l.popTransitionParam("agreement"),L.agreementFilter=u.filter("and"),L.agreementFilter.eq("Id",L.model.AgreementId),r.getItems("woagreements",L.agreementFilter).then(function(){L.items=r.state.items;var e={},t=new Array(7);t[0]="Sunday",t[1]="Monday",t[2]="Tuesday",t[3]="Wednesday",t[4]="Thursday",t[5]="Friday",t[6]="Saturday",L.partsData.partsCovered=!1,L.miscData.miscCovered=!1,L.laborData.laborCovered=!1,L.laborData.laborMarkup=0;var a=new Date;a=p.parseISOString(a.toISOString());for(var o=p.convertToLocal(a),s=o.getDay(),i=o.getHours(),n=o.getMinutes(),d="",u=0;u<L.items.length;u++){d=6==s||0==s?"Weekend":"Weekday";var m=p.parseISOString(L.items[u].StartTime),c=p.parseISOString(L.items[u].EndTime),g=m.getHours(),S=c.getHours(),b=m.getMinutes(),I=c.getMinutes(),h=p.parseISOString(L.items[u].StartDate);h=p.convertToLocal(h);var f=p.parseISOString(L.items[u].EndDate);f=p.convertToLocal(f);var v=!1,D=!1;g<=i?g+1<=i?v=!0:b<=n&&(v=!0):v=!1,S>=i?S-1>=i?D=!0:I>=n&&(D=!0):D=!1,"Active"==L.items[u].Status&&(L.items[u].Day==t[s]||L.items[u].Day==d||"All Days"==L.items[u].Day)&&h<=o&&f>o&&D&&v&&(L.model.RateSheetId=L.items[u].RateSheetId,L.partsData.partsCovered=L.items[u].PartsCovered,L.miscData.miscCovered=L.items[u].MiscCovered,L.laborData.laborCovered=L.items[u].LaborCovered,L.laborData.laborMarkup=L.items[u].LaborMarkup,l.selectiveExtend(e,L,["partsData","miscData","laborData"]),l.setTransitionParam("agreement",e))}}))}),L.assignmentsGrid=!1,L.notesGrid=!0,L.laborGrid=!1,L.partsGrid=!1,L.miscGrid=!1,L.tasksGrid=!1,L.servreportGrid=!1,L.attachmentsGrid=!1,L.formsGrid=!1,L.poesGrid=!1,L.woHeader=!0,L.bundleGrid=!1,L.woServiceableItemPanel=!1,L.xoiGrid=!1,L.woPaymentGrid=!1,L.deficiencyGrid=!1,L.initialiseGrid=ee,L.getModulePrivilege=te,b.loadObjectPrivileges(L.viewName,L.serviceableItemModuleName),L.getObjectPrivilege=function(e){return b.getObjectPrivilege(e)},L.timerModel={},L.getStartTime=function(e){var t=new Date(e),a=new Date;return p.convertToLocal(t,a.getTimezoneOffset()).getTime()},L.startTimer=function(e,t){var a=new Date;if(ae=void 0!==e&&null!==e?L.getStartTime(e):a.getTime(),1===t){L.timerModel.StartDate=new Date,L.timerModel.WoId=L.assignment.WoId,L.timerModel.CompanyId=L.assignment.CompanyId,L.timerModel.TechId=L.assignment.TechId,L.timerModel.Date=new Date,L.timerModel.AssignmentId=L.assignment.Id,L.modelStatus.Status="Started",L.editAssignmentStatus();D.getLocation("TR Labor").then(function(e){L.timerModel.Latitude=e.coords.latitude,L.timerModel.Longitude=e.coords.longitude,r.create("woLabors",L.timerModel).then(function(e){y.$broadcast("reloadLaborTable",e),L.isActive=!0})})}else L.isActive=!0;ie()},L.stopTimer=function(){bootbox.confirm("Are you sure you want to stop your Service time?",function(t){t&&(m(function(){m.cancel(e)}),L.assignmentFilter=u.filter("and"),L.assignmentFilter.eq("AssignmentId",L.assid).eq("EndDate","NULL"),r.getItems(L.laborApiMethod,L.assignmentFilter).then(function(e){var t=e.data.Data[0],a=new Date;ae=L.getStartTime(t.StartDate);var o=(oe=a.getTime())-ae,s=(o/36e5).toFixed(2);if(o<12e4)return d.warning({message:"Time entries must be greater than 2 minutes."}),void ie();L.modelStatus.Status="Open",L.editAssignmentStatus(),t.rawHours=o,t.WorkHours=s,t.StartDate=t.StartDate,t.EndDate=a,t.Billable=!0,t.AssignmentId=L.assid;D.getLocation("TR Labor").then(function(e){t.Latitude=e.coords.latitude,t.Longitude=e.coords.longitude,r.update(L.laborApiMethod+"/"+t.Id,t).then(function(e){i.showModal({templateUrl:"Templates/Agreements/agreementTimePopup.html",controller:"AgreementTimePopupController",controllerAs:"vm",inputs:{modalTitle:"Assignment Labor Edit",id:t.Id,model:t,onSubmit:L.submit,apiMethod:L.laborApiMethod,moduleName:"Labor",viewName:L.viewName,customerId:L.customer.customerId}}).then(function(t){t.close.then(function(){y.$broadcast("reloadLaborTable",e),m(function(){L.isActive=!1})})})})})}))})},L.submit=function(){};var ae=0,oe=0;function se(e){return(e=e<1?0:e)<10&&(e="0"+e),e}function ie(){var a,o,s,i,r=new Date;oe=r.getTime(),i=Math.floor((oe-ae)/1e3),a=se(Math.floor(i/3600)),i=Math.floor(i%3600),o=se(Math.floor(i/60)),i=Math.floor(i%60),s=se(Math.floor(i)),t.timer=a+":"+o+":"+s,e=m(function(){ie()},500)}t.timer="00:00:00",L.checkInProgressLabor=function(){L.assignmentFilter=u.filter("and"),L.assignmentFilter.eq("AssignmentId",L.assid).eq("EndDate","NULL"),L.disableServiceButton=!1,r.getItems("woLabors",L.assignmentFilter).then(function(e){L.updateTime=e.data.Data,L.updateTime.length>0?(L.isActive=!0,L.attAssignTechnician.ReadOnly=!0,L.startTimer(L.updateTime[0].StartDate)):(L.attAssignTechnician.ReadOnly=!1,L.checkOtherLaborInProgress())})},L.checkOtherLaborInProgress=function(){r.getItems("myworkorders",L.filter2).then(function(e){L.assigments4=e.data.Data;for(var t=0;t<L.assigments4.length;t++)"Traveling"==L.assigments4[t].AssignmentStatusName?(L.assignmentFilter=u.filter("and"),L.assignmentFilter.eq("AssignmentId",L.assigments4[t].Id).eq("EndDate","NULL"),r.getItems("woLabors",L.assignmentFilter).then(function(e){L.updateTime=e.data.Data,L.updateTime.length>0?L.disableServiceButton=!0:L.isActive=!1})):"Started"==L.assigments4[t].AssignmentStatusName&&(L.assignmentFilter=u.filter("and"),L.assignmentFilter.eq("AssignmentId",L.assigments4[t].Id).eq("EndDate","NULL"),r.getItems("woLabors",L.assignmentFilter).then(function(e){L.updateTime=e.data.Data,L.updateTime.length>0?L.disableServiceButton=!0:L.isActive=!1}))})},L.checkWoAssStatuses=J,L.resetServiceableItemIdFilter=function(){L.serviceableItemIdFilter.reset(),L.serviceableItemIdFilter.eq("ServiceableItemId",L.assignment.ServiceableItemId)},L.checkCustomerInfoChangeEnabled=function(e){}}angular.module("FieldConnectApp").controller("AssignmentDetailsEditController",t),t.$inject=["$scope","$location","$state","$stateParams","ModalService","restService","cryptoStorageService","Notification","stateTransitionService","qsService","$timeout","$window","timezoneService","$geolocation","currentUserService","guiPrivilegeService","dslVisitsService","rolesFactory","featuresFactory","gbCustomFactory","fcGeoLocationService","currentCompanyService","$rootScope","xoiService"]}();;!function(){"use strict";function e(e,t,o,a,r,i,s,l,d,n,u,m,c,p,S,y,b,I){var D=this;D.$state=o,D.goToServItemPage=A,D.viewName="AssignmentDetails",D.moduleName="WOAssignmentHeader",D.selectSite=function(){r.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectSite.html",controller:"SelectSiteDetailsController",controllerAs:"vm",inputs:{site:D.site,customerId:D.customer.customerId}})},D.woNumber="",D.assid=a.assId,D.model={},D.model1={},D.model2={},D.modelSite={},D.changeForms=function(){D.woForm=!D.woForm,D.woForm?D.btnName="Site Equipment Forms":(D.filterSiteForms.reset(),D.filterSiteForms.eq("SiteId",D.model.SiteId).eq("Id",D.modelSite.Id),D.btnName="Work Order Forms")};l.getTransitionParam("workOrdersDetails");var g=window.location.pathname.split("/"),h=g[g.length-1];"myAssignments"===h?window.name="false":"dispatchCalendar"===h&&(window.name="true"),"true"===window.name?D.fromDispatch=!0:"false"===window.name&&(D.fromDispatch=!1);var L=l.getTransitionParam("openServiceReport");D.usingQuoting=y.usingQuoting,D.usingDSLNorthwest=y.usingDSLNorthwest,D.showWoPayment=y.usingFCPayments,D.isReadOnly=!0,D.roleUsingPayments=!1,b.clearCustomer(),D.usingGroundBreakers=y.usingGroundBreakers,b.addCustomer(null),D.customReport=!1,D.serviceReportCount=0,D.serviceReportMax=99,D.serviceReportAPI="woservicereports",D.usingGroundBreakers&&(D.serviceReportAPI="gbwoservicereports"),D.usingXOiIntegration=!1,D.usingXOiIntegration=I.usingXOiIntegration(),D.ViewKnowledgeBase=function(){I.viewKnowlegeBase(D.serviceableItemId)},D.serviceableItemModuleName="AssignServiceableItems",D.hasXOiJob=!1,D.hideQuoteAttachments="hidden",D.hideServiceRequestAttachments="hidden",D.serviceRequestFilter=d.filter("and"),D.serviceableItemIdFilter=d.filter("and"),i.getItem("woassignments",a.assId).then(function(e){D.serviceableItemId=e.data.ServiceableItemId,D.serviceableItemIdFilter.eq("ServiceableItemId",D.serviceableItemId),D.usingXOiIntegration&&I.getXOiJob(a.assId).then(function(e){D.hasXOiJob=e,D.xoiViewJobAttribute={Type:"button",Label:"View Job",onClick:I.viewXOiJob,CustomInputClass:"col-sm-12 col-md-12 col-lg-12 btn btn-primary",CustomDivClass:"col-sm-4",Disabled:!1},D.xoiSiteHistoryAttribute={Type:"button",Label:"Site History",onClick:I.viewSiteHistory,CustomInputClass:"col-sm-12 col-md-12 col-lg-12 btn btn-primary",CustomDivClass:"col-sm-4",Disabled:!1},D.xoiVisionLiveAttribute={Type:"button",Label:"Vision Live",onClick:I.viewXOiVisionLive,CustomInputClass:"col-sm-12 col-md-12 col-lg-12 btn btn-primary",CustomDivClass:"col-sm-4",Disabled:!1},D.xoiViewShareAttribute={Type:"button",Label:"View Share",onClick:I.viewVisionShare,CustomInputClass:"col-sm-12 col-md-12 col-lg-12 btn btn-primary",CustomDivClass:"col-sm-4",Disabled:!1},D.xoiViewKnowledgeBaseAttribute={Type:"button",Label:"Knowledge Base",onClick:D.ViewKnowledgeBase,CustomInputClass:"col-sm-12 col-md-12 col-lg-12 btn btn-primary",CustomDivClass:"col-sm-4",Disabled:!0},D.xoiViewJobAttribute.Disabled=!e,D.xoiSiteHistoryAttribute.Disabled=!e,D.xoiVisionLiveAttribute.Disabled=!e,D.xoiViewShareAttribute.Disabled=!e,e&&(D.xoiViewShareAttribute.Disabled=!I.hasJobShareLink()),D.serviceableItemId&&(D.xoiViewKnowledgeBaseAttribute.Disabled=!1),D.deeplinks=[D.xoiViewJobAttribute,D.xoiSiteHistoryAttribute,D.xoiVisionLiveAttribute,D.xoiViewShareAttribute,D.xoiViewKnowledgeBaseAttribute],D.deeplinksGroup={Type:"group",Attributes:D.deeplinks},D.deeplinksAttributes=[D.deeplinksGroup]})}),D.filter={filterId:a.id},D.filter1={siteId:D.model.SiteId,rateSheetId:null},D.partsData={partsCovered:!1},D.miscData={miscCovered:!1},D.laborData={laborMarkup:0,laborCovered:!1},D.reloadFilter=!0,$(window).focus(function(){D.reloadFilter=!1,e.$apply(),D.reloadFilter=!0,e.$apply()}),D.filterByWorkOrder=d.filter("and"),D.filterByWorkOrder.eq("WoId",D.filter.filterId),D.filterOnlyByWorkOrder=d.filter("and"),D.filterOnlyByWorkOrder.eq("WoId",D.filter.filterId),D.filterByWorkOrder.eq("Id",D.assid),D.filterBySite=d.filter("and"),D.filterSiteForms=d.filter("and"),D.count=0,D.estHoursTotal=0,D.checkTotalCount=R,R(),D.customer={customerId:0},D.customers=[],D.site={siteId:0},D.id=a.id,D.assid=a.assId,D.companyWoStatus={},D.companyAssignmentStatus={},D.editWorkorder=function(){s.success({message:"Work order has been successfully updated."})},D.customerFilter=d.filter("and"),D.customerSiteFilter=d.filter("and"),D.customerSiteFilter.eq("WoId",D.id),D.taskGrid=!1,D.poGrid=!1,D.isMain=!0,D.companySettings=[],D.companySettingsFilter=d.filter("or"),D.companySettingsFilter.eq("Name","POGrid").eq("Name","TaskGrid"),i.getItems("companysettings",D.companySettingsFilter).then(function(e){D.companySettings=e.data.Data;for(var t=0;t<D.companySettings.length;t++)"POGrid"==D.companySettings[t].Name&&0!=D.companySettings[t].Id&&null!=D.companySettings[t].Value&&(D.poGrid=JSON.parse(D.companySettings[t].Value.toLowerCase())),"TaskGrid"==D.companySettings[t].Name&&0!=D.companySettings[t].Id&&null!=D.companySettings[t].Value&&(D.taskGrid=JSON.parse(D.companySettings[t].Value.toLowerCase()))});var C=[];i.getItems("usersettings").then(function(e){C=e.data.Data;for(var t=0;t<C.length;t++)if("OpenAllPanels"==C[t].Name&&0!=C[t].Id&&null!=C[t].Value){var o=JSON.parse(C[t].Value.toLowerCase());o&&(O(),$('.panel-collapse:not(".in")').collapse("show"))}void 0!=L&&(o||(O("servreportGrid"),$('.panel-collapse:not(".in")').collapse("show")),l.popTransitionParam("openServiceReport"),u(function(){$("#service-report .add-new-btn").click()},1e3,!1))}),D.attributesSite=[{Type:"dropdown",Label:"Forms",Required:!1,ApiMethod:"forms/getforSiteEquipmentDropdown",ValueProp:"Id",TextProp:"Name",ModelValue:"Id",Filter:D.filterByWorkOrder}];var v=e.$watch("vm.attributesSite[0].CurrentList",function(){D.attributesSite[0].CurrentList&&D.attributesSite[0].CurrentList.length>0&&(D.modelSite.Id=D.attributesSite[0].CurrentList[0].Id,D.filterSiteForms.reset(),D.filterSiteForms.eq("SiteId",D.model.SiteId).eq("Id",D.modelSite.Id),v())});D.attWoWorkOrder={Type:"text",Label:"Work Order:",ReadOnly:!0,ModelValue:"AltId"},D.attWoStatus={Type:"dropdown",Label:"Status:",ReadOnly:!0,ApiMethod:"wostatuses",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"Status"},D.attWoCustomer={Type:"text",Label:"Customer:",ReadOnly:!0,MaxLength:"50",ModelValue:"CustomerName"},D.attWoPriority={Type:"dropdown",Label:"Priority:",ReadOnly:!0,ApiMethod:"priorities",ValueProp:"PriorityName",TextProp:"PriorityName",ModelValue:"Priority"},D.attWoAddress={Type:"text",Label:"Address",ReadOnly:!0,MaxLength:"100",ModelValue:"Address"},D.attWoSite={Type:"text",Label:"Site:",ReadOnly:!0,MaxLength:"50",ModelValue:"SiteName"},D.attWoDescription={Type:"textarea",Label:"Description:",ReadOnly:!0,MaxLength:"200",ModelValue:"Desc",Autofocus:"true"},D.attWoRequestor={Type:"text",Label:"Requestor:",ReadOnly:!0,MaxLength:"100",ModelValue:"ContactName"},D.attWoWorkOrderType={Type:"dropdown",Label:"Work Order Type:",ReadOnly:!0,ApiMethod:"wotypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"WoType"},D.attWoPhone={Type:"text",Label:"Phone:",MaxLength:"50",ModelValue:"ContactPhone",ReadOnly:!0},D.attWoAgreement={Type:"dropdown",Label:"Agreement:",ReadOnly:!0,ApiMethod:"agreements",ValueProp:"Id",TextProp:"Desc",ModelValue:"AgreementId",ConvertToInt:"true",Filter:D.customerFilter,Roles:["Admin","FieldConnect","TransAdmin","Dispatch","Technician","Supervisor","Office"]},D.attWoPromisedDate={Type:"datepicker",Label:"Promised Date:",ModelValue:"PromiseDate",Format:"MM/dd/yyyy hh:mm a",SubType:"date",ReadOnly:!0},D.attWoProject={Type:"dropdown",Label:"Project:",Required:!1,ApiMethod:"projects/getProjectForWo",ValueProp:"Id",TextProp:"ProjectName",ModelValue:"ProjectId",ConvertToInt:"true",Filter:D.customerSiteFilter,ReadOnly:!0,Roles:["Admin","FieldConnect","TransAdmin","Dispatch","Technician","Supervisor","Office"]},D.attWoTimeZone={Type:"text",Label:"Time Zone:",ModelValue:"TimeZoneName",ReadOnly:!0},D.attWoCreatedBy={Type:"text",Label:"Created By:",ModelValue:"CreatedBy",ReadOnly:!0},D.attWoCreatedOn={Type:"text",Label:"Created On:",ModelValue:"CreatedOn",ReadOnly:!0},D.attWoCustomerPONumber={Type:"text",Label:"Customer PO Number:",Required:!1,MaxLength:"50",ModelValue:"CustomerPONum",ReadOnly:!0},D.attWoOffice={Type:"dropdown",Label:"Office:",Required:!0,ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true",ReadOnly:!0},D.attWoLeadSource={Type:"dropdown",Label:"Lead Source:",ApiMethod:"leadSource/ddList",ValueProp:"Id",TextProp:"DdlLabel",ModelValue:"LeadSourceId",ConvertToInt:"true",ReadOnly:!0},D.attWoSalesPerson={Type:"dropdown",Label:"Salesperson:",ApiMethod:"employees/getSalesPersonList",ValueProp:"Id",TextProp:"FullName",ModelValue:"SalesPersonId",ConvertToInt:"true",ReadOnly:!0},D.attDSLLine1={Type:"line",CustomClass:"col-sm-12"},D.attDSLWoExportHeader={Type:"text",Label:"WO Export",ModelValue:"",CustomInputClass:"hidden",ReadOnly:!0},D.attDSLBlank1={Type:"empty",CustomClass:"fc-empty-control col-sm-6",ReadOnly:!0},D.attDSLUnitDown={Type:"checkbox",Label:"Unit Down",ModelValue:"woeUnitDown",ReadOnly:!0},D.attDSLRewritePartsReceived={Type:"dropdown",Label:"Rewrite Parts Received:",Required:!1,ApiMethod:"dslPartsReceived/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"woeRewritePartsReceived",ReadOnly:!0},D.attDSLIsUnitReplaceAnother={Type:"checkbox",Label:"Is Unit Replace Another",ModelValue:"woeIsUnitReplaceAnother",TabIndex:17,ReadOnly:!0},D.attDSLRecallDueTo={Type:"dropdown",Label:"Recall Due To:",Required:!1,ApiMethod:"dslRecallDueTo/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"woeRecallDueTo",ReadOnly:!0},D.attDSLFieldScrapFlag={Type:"checkbox",Label:"Field Scrap Flag",ModelValue:"woeFieldScrapFlag",TabIndex:17,ReadOnly:!0},D.attDSLProcessPracticeFlag={Type:"checkbox",Label:"Process/Practice Flag",ModelValue:"woeProcessPracticeFlag",ReadOnly:!0},D.attDSLUnitOperAtDepartureFlag={Type:"checkbox",Label:"Unit Oper. at Departure",ModelValue:"woeUnitOperAtDeparture",ReadOnly:!0},D.attDSLBulletinNumber={Type:"text",Label:"Bulletin Number:",Required:!1,MaxLength:"20",ModelValue:"woeBulletinNumber",ReadOnly:!0},D.attDSLQualityReportFlag={Type:"checkbox",Label:"Quality Report Flag",ModelValue:"woeQualityReportFlag",ReadOnly:!0},D.attDSLCertificationNumber={Type:"text",Label:"Certification Number:",Required:!1,MaxLength:"20",ModelValue:"woeCertificationNumber",ReadOnly:!0},D.attDSLPreviousUnitFieldSerialNumber={Type:"text",Label:"Previous Unit Field Serial No.:",Required:!1,MaxLength:"20",ModelValue:"woePreviousUnitFieldSerialNumber",ReadOnly:!0},D.attDSLPurchasedFromDistributor={Type:"dropdown",Label:"Purchased From Distributor:",Required:!1,ApiMethod:"dslDistributor/ddList",ValueProp:"Id",TextProp:"Name",ModelValue:"woePurchasedFromDistributor",ReadOnly:!0},D.attDSLWOEId={Type:"hidden",ModelValue:"woeId"},D.attDSLServiceZoneCode={Type:"text",Label:"Service Zone Code:",Required:!1,ReadOnly:!0,MaxLength:"20",ModelValue:"ServiceZoneCode"},D.attDSLLine2={Type:"line",CustomClass:"col-sm-12"},D.attDSLRewrite={Type:"checkbox",Label:"Rewrite",ModelValue:"User4",ReadOnly:!0},D.attDSLRecall={Type:"checkbox",Label:"Recall",ModelValue:"User5",ReadOnly:!0},D.attDSLFactoryServiceOrderType={Type:"dropdown",Label:"Factory Service Order Type:",ApiMethod:"dslServiceOrderType/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"User8",ConvertToInt:"true",ReadOnly:!0},D.attDSLVisits={Type:"text",Label:"Visits:",ModelValue:"DSLVisits",ReadOnly:!0},D.attDSLAuthorizedBy={Type:"text",Label:"Authorized By:",Required:!1,MaxLength:"20",ModelValue:"User0",ReadOnly:!0},D.attDSLAdditionalDetailsHeader={Type:"text",Label:"Additional Details",ModelValue:"",CustomInputClass:"hidden"},D.attDSLLine3={Type:"line",CustomClass:"col-sm-12"},D.attDSLLine4={Type:"line",CustomClass:"col-sm-12"},D.attDSLBlank2={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},D.attDSLBlank3={Type:"empty",CustomClass:"fc-empty-control col-sm-6"};var w=[D.attWoWorkOrder,D.attWoStatus,D.attWoCustomer,D.attWoPriority,D.attWoAddress,D.attWoSite,D.attWoDescription,D.attWoRequestor,D.attWoWorkOrderType,D.attWoPhone,D.attWoAgreement,D.attWoPromisedDate,D.attWoProject,D.attWoTimeZone,D.attWoCreatedBy,D.attWoCreatedOn,D.attWoCustomerPONumber,D.attWoOffice,D.attWoLeadSource,D.attWoSalesPerson],T=[D.attWoWorkOrder,D.attWoStatus,D.attWoCustomer,D.attWoPriority,D.attWoAddress,D.attWoSite,D.attWoDescription,D.attWoRequestor,D.attWoWorkOrderType,D.attWoPhone,D.attWoAgreement,D.attWoPromisedDate,D.attWoProject,D.attWoTimeZone,D.attWoCreatedBy,D.attWoCreatedOn,D.attWoCustomerPONumber,D.attWoOffice,D.attWoLeadSource,D.attWoSalesPerson,D.attDSLLine1,D.attDSLAdditionalDetailsHeader,D.attDSLBlank2,D.attDSLRewrite,D.attDSLRecall,D.attDSLFactoryServiceOrderType,D.attDSLVisits,D.attDSLAuthorizedBy,D.attDSLServiceZoneCode,D.attDSLLine4,D.attDSLWoExportHeader,D.attDSLBlank1,D.attDSLUnitDown,D.attDSLRewritePartsReceived,D.attDSLIsUnitReplaceAnother,D.attDSLRecallDueTo,D.attDSLFieldScrapFlag,D.attDSLProcessPracticeFlag,D.attDSLUnitOperAtDepartureFlag,D.attDSLBulletinNumber,D.attDSLQualityReportFlag,D.attDSLCertificationNumber,D.attDSLPreviousUnitFieldSerialNumber,D.attDSLPurchasedFromDistributor,D.attDSLWOEId];D.attAssignLine1={Type:"line",CustomClass:"col-sm-12"},D.attAssignDescription={Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc",ReadOnly:!0},D.attAssignEmpty={Type:"empty"},D.attAssignServiceableItem={Type:"text",Label:"Serviceable Item:",ModelValue:"ServiceableItemName",ConvertToInt:"true",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo",ReadOnly:!0},D.attAssignLink={Type:"link",onClick:A,ICustomInputClass:"fa fa-external-link ViewLink"},D.attAssignProblemCode={Type:"text",Label:"Problem Code:",ModelValue:"ProblemCode",ReadOnly:!0},D.attAssignEstStartDate={Type:"datepicker",Label:"Scheduled:",ModelValue:"EstStartDate",Format:"MM/dd/yyyy",ReadOnly:!0},D.attAssignCause={Type:"text",Label:"Cause:",ModelValue:"Cause",ReadOnly:!0},D.attAssignEstimatedHours={Type:"decimal",Label:"Estimated Hours:",MaxLength:"50",ModelValue:"EstHours",ReadOnly:!0},D.attAssignResolution={Type:"text",Label:"Resolution:",ModelValue:"Resolution",ReadOnly:!0},D.attAssignTechnician={Type:"dropdown",Label:"Technician:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"TechId",ConvertToInt:"true",ReadOnly:!0},D.attAssignEstEndDate={Type:"datepicker",ModelValue:"EstEndDate",Format:"MM/dd/yyyy",CustomInputClass:"hidden"},D.attDSLFailureResolution={Type:"dropdown",Label:"Reason for Failed Install:",ApiMethod:"dslFailureResolution/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"User8",ConvertToInt:"true",ReadOnly:!0},D.attDSLGroundCheck={Type:"checkbox",Label:"Ground Check",Required:!1,ModelValue:"User4",ReadOnly:!0},D.attDSLAssignServiceableItem={Type:"dropdown",Label:"Serviceable Item:",ApiMethod:"serviceableitems/dsldropdownbysite",Filter:D.dslServiceableItemFilter,ValueProp:"Id",TextProp:"DDLabel",ModelValue:"ServiceableItemId",ConvertToInt:"true",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo",ReadOnly:!0};var f=[D.attAssignLine1,D.attAssignDescription,D.attAssignEmpty,D.attAssignServiceableItem,D.attAssignLink,D.attAssignProblemCode,D.attAssignEstStartDate,D.attAssignCause,D.attAssignEstimatedHours,D.attAssignResolution,D.attAssignTechnician,D.attAssignEstEndDate],P=[D.attAssignLine1,D.attAssignDescription,D.attAssignEmpty,D.attDSLAssignServiceableItem,D.attAssignLink,D.attAssignProblemCode,D.attAssignEstStartDate,D.attAssignCause,D.attAssignEstimatedHours,D.attAssignResolution,D.attAssignTechnician,D.attDSLFailureResolution,D.attDSLGroundCheck];function R(){D.filterWoForTotalCount=d.filter("and"),D.filterWoForTotalCount.eq("WoId",a.id),i.getItems("woassignments",D.filterWoForTotalCount).then(function(){var e=i.state.items;D.count=e.length,D.estHoursTotal=0;for(var t=0;t<e.length;t++)D.estHoursTotal=D.estHoursTotal+e[t].EstHours})}function A(){null==D.model1.ServiceableItemId?s.warning({message:"First you must select serviceable item"}):o.go("serviceableItemsReadOnly",{customerId:D.customer.customerId,id:D.model1.ServiceableItemId})}D.showForm=!1,D.usingDSLNorthwest?(D.woAPI="wodetails/dsl",D.woAssignmentsAPI="dslwoassignments",D.attributes=T,D.assignmentatt=P):(D.woAPI="wodetails",D.woAssignmentsAPI="woassignments",D.attributes=w,D.assignmentatt=f),D.showForm=!0,D.assignmentStatus=[{Type:"dropdown",Label:"Status:",ApiMethod:"assignmentstatuses",ValueProp:"AssignmentStatusName",TextProp:"AssignmentStatusName",ModelValue:"Status",ReadOnly:!0}],D.loadingIndicator=!1,e.$watch("vm.model.Id",function(){D.customer.customerId=D.model.CustomerId,D.site.siteId=D.model.SiteId,D.site.siteName=D.model.SiteName,D.site.title=D.model.ContactName,D.site.phone=D.model.ContactPhone,D.site.address=D.model.Address,D.filterBySite.eq("SiteId",D.model.SiteId),D.isFromQuote=!1,D.model.QuoteId&&(D.isFromQuote=!0,D.filterByQuote=d.filter("and"),D.filterByQuote.eq("QuoteId",D.model.QuoteId),D.hideQuoteAttachments=""),D.model.ServiceRequestId&&(D.serviceRequestFilter.reset(),D.serviceRequestFilter.eq("ServiceRequestId",D.model.ServiceRequestId),D.hideServiceRequestAttachments="");var e=new Date(D.model.SysCreateUTC),t=p.getValue("authorizationData");t&&t.tzDatebaseName&&(D.tzName=t.tzDatebaseName,D.userTimeZone=moment.tz(D.tzName).zoneAbbr()),i.getItem("users",D.model.SysCreatorId).then(function(){var o=i.state.item;D.model.CreatedBy=o.FirstName+" "+o.LastName,D.userTimeZone=moment.tz(t.tzDatebaseName).zoneAbbr(),D.model.CreatedOn=e.toLocaleString()+" "+D.userTimeZone}),D.usingDSLNorthwest&&S.getVisits(D.model.SiteId).then(function(e){D.model.DSLVisits=e}),D.usingXOiIntegration&&u(function(){I.setSiteAddress(D.model.Address)})}),D.woTimezone={TzDatabaseName:"%TzDatabaseName%"},D.woForm=!0,D.btnName="Site Equipment Forms",e.$watch("vm.customer.customerId",function(){null!=D.customer.customerId&&D.customer.customerId>0&&D.model.CustomerId!=D.customer.customerId&&(D.model.CustomerId=D.customer.customerId,D.model.CustomerName=D.customer.customerName,D.model.SiteId=0,D.model.SiteName="",D.model.Address="",D.model.ContactName="",D.model.ContactPhone="")}),e.$watch("vm.model.Id",function(){void 0!=D.model.Id&&null!=D.model.Id&&D.model.Id>0&&m.isContractorCompany(D.model).then(function(e){e||(1==D.model.SubInvoiced?D.model.Status="Invoiced":"Invoiced"!=D.model.Status&&"ReadytoInvoice"!=D.model.Status||(D.model.Status="Complete"),D.isMain=!1)})}),e.$watch("vm.site.siteId",function(){null!=D.site.siteId&&D.site.siteId>0&&(D.model.SiteId=D.site.siteId,D.model.SiteName=D.site.siteName,D.model.ContactName=D.site.title,D.model.ContactPhone=D.site.phone,D.model.Address=D.site.address,D.filter1.siteId=D.site.siteId)}),e.$watch("vm.modelSite",function(){void 0!==D.modelSite.Id&&(null==D.modelSite.Id&&D.attributesSite[0].CurrentList&&D.attributesSite[0].CurrentList.length>0&&(D.modelSite.Id=D.attributesSite[0].CurrentList[0].Id),D.filterSiteForms.reset(),D.filterSiteForms.eq("SiteId",D.model.SiteId).eq("Id",D.modelSite.Id))},!0),e.$watch("vm.model.RateSheetId",function(){null!=D.model.RateSheetId&&D.model.RateSheetId>0&&(D.filter1.rateSheetId=D.model.RateSheetId)});var M=[];function O(e){switch(e){case"assignmentsGrid":D.assignmentsGrid=!0;break;case"notesGrid":D.notesGrid=!0;break;case"laborGrid":D.laborGrid=!0;break;case"partsGrid":D.partsGrid=!0;break;case"miscGrid":D.miscGrid=!0;break;case"tasksGrid":D.tasksGrid=!0;break;case"servreportGrid":D.servreportGrid=!0;break;case"attachmentsGrid":D.attachmentsGrid=!0;break;case"formsGrid":D.formsGrid=!0;break;case"poesGrid":D.poesGrid=!0;break;case"woesGrid":D.woesGrid=!0;break;case"xoiGrid":D.xoiGrid=!0;break;case"woServiceableItemPanel":D.woServiceableItemPanel=!0;break;case"woPaymentGrid":D.woPaymentGrid=!0;break;case"deficiencyGrid":D.deficiencyGrid=!0;break;default:D.assignmentsGrid=!0,D.notesGrid=!0,D.laborGrid=!0,D.partsGrid=!0,D.miscGrid=!0,D.tasksGrid=!0,D.servreportGrid=!0,D.attachmentsGrid=!0,D.formsGrid=!0,D.poesGrid=!0,D.woesGrid=!0,D.xoiGrid=!0,D.woServiceableItemPanel=!0,D.woPaymentGrid=!0,D.deficiencyGrid=!0}}i.getItems("problemcodes").then(function(){M=i.state.items}),e.$watch("vm.model1.EstStartDate",function(){if(null!=D.model1.EstStartDate||void 0!=D.model1.EstStartDate){if(null!=D.model1.EstHours){var e=new Date(D.model1.EstStartDate),t=Math.floor(D.model1.EstHours),o=Math.round(100*(D.model1.EstHours-t)),a=t,r=Math.round(60*o/100);e.setMinutes(e.getMinutes()+r),e.setHours(e.getHours()+a),D.model1.EstEndDate=e}else if(null!=D.model1.EstEndDate){if(D.model1.EstEndDate<D.model1.EstStartDate)return D.model1.EstEndDate=D.model1.EstStartDate,void s.error("The scheduled start can’t be after scheduled end!");var i=100*Math.round(D.model1.EstEndDate/1e5),l=100*Math.round(D.model1.EstStartDate/1e5);a=(new Date(i)-new Date(l))/3600;D.model1.EstHours=Math.round(100*a)/100}}else D.model1.EstEndDate=null},!0),e.$watch("vm.model1.EstEndDate",function(){if(null!=D.model1.EstEndDate||void 0!=D.model1.EstEndDate){if(null!=D.model1.EstStartDate){if(D.model1.EstEndDate<D.model1.EstStartDate&&(D.model1.EstEndDate<oldValue||null===oldValue))return D.model1.EstEndDate=oldValue,void s.error("The scheduled start can’t be after scheduled end!");var e=100*Math.round(D.model1.EstEndDate/1e5),t=100*Math.round(D.model1.EstStartDate/1e5),o=(new Date(e)-new Date(t))/3600;D.model1.EstHours=o}else if(null!=D.model1.EstHours){var a=new Date(D.model1.EstEndDate),r=Math.floor(D.model1.EstHours),i=Math.round(100*(D.model1.EstHours-r)),l=(o=r,Math.round(60*i/100));a.setMinutes(a.getMinutes()-l),a.setHours(a.getHours()-o),D.model1.EstStartDate=a}}else D.model1.EstStartDate=null},!0),e.$watch("vm.model1.EstHours",function(){if(null!=D.model1.EstHours||void 0!=D.model1.EstHours)if(null!=D.model1.EstStartDate){var e=new Date(D.model1.EstStartDate),t=Math.floor(D.model1.EstHours),o=Math.round(100*(D.model1.EstHours-t)),a=t,r=Math.round(60*o/100);e.setMinutes(e.getMinutes()+r),e.setHours(e.getHours()+a),D.model1.EstEndDate=e}else if(null!=D.model1.EstEndDate){var i=new Date(D.model1.EstEndDate);t=Math.floor(D.model1.EstHours),o=Math.round(100*(D.model1.EstHours-t)),a=t,r=Math.round(60*o/100);i.setMinutes(i.getMinutes()-r),i.setHours(i.getHours()-a),D.model1.EstStartDate=i}},!0),D.isFirstProblemCode=!1,e.$watch("vm.model1.ProblemCode",function(){if(void 0!=D.model1.ProblemCode)if(D.isFirstProblemCode){for(var e=0;e<M.length;e++)if(M[e].ProblemCodeName==D.model1.ProblemCode){D.model1.EstHours=M[e].DefaultHours;break}}else D.isFirstProblemCode=!0}),e.$watch("vm.model.CustomerId",function(){D.customerFilter.reset(),D.customerFilter.eq("CustomerId",D.model.CustomerId)}),e.$watch("vm.model1.ServiceableItemId",function(e,t){e===t||D.id||D.usingDSLNorthwest&&(D.dslServiceableItemFilter=d.filter("and"),D.dslServiceableItemFilter.reset(),D.dslServiceableItemFilter.eq("Id",D.model1.ServiceableitemId),D.assignmentatt=P)}),e.$watch("vm.model2",function(){D.model1.Status=D.model2.Status},!0),D.assignmentsGrid=!1,D.notesGrid=!1,D.laborGrid=!1,D.partsGrid=!1,D.miscGrid=!1,D.tasksGrid=!1,D.servreportGrid=!1,D.attachmentsGrid=!1,D.formsGrid=!1,D.poesGrid=!1,D.woesGrid=!0,D.xoiGrid=!1,D.woServiceableItemPanel=!1,D.woPaymentGrid=!1,D.deficiencyGrid=!1,D.initialiseGrid=O,D.getModulePrivilege=function(e,t){return c.getModulePrivilege(e,t)}}angular.module("FieldConnectApp").controller("AssignmentDetailsReadOnlyController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","restService","Notification","stateTransitionService","qsService","timezoneService","$timeout","currentCompanyService","guiPrivilegeService","cryptoStorageService","dslVisitsService","featuresFactory","gbCustomFactory","xoiService"]}();;!function(){"use strict";function e(e,t,o,a,s,r,d,n,l,i,m,u,c,p,f){var S=this;S.$state=o,S.goToServItemPage=function(){null==S.model1.ServiceableItemId?d.warning({message:"First you must select serviceable item"}):o.go("serviceableItemsReadOnly",{customerId:S.customer.customerId,id:S.model1.ServiceableItemId})},S.selectSite=function(){s.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectSite.html",controller:"SelectSiteDetailsController",controllerAs:"vm",inputs:{site:S.site,customerId:S.customer.customerId}})},S.woNumber="",S.update=function(){var e=angular.copy(S.model1),t=new Date(e.EstStartDate),a=new Date(e.EstEndDate),s=moment.tz.zone(e.TzDatabaseName).offset(t),n=moment.tz.zone(e.TzDatabaseName).offset(a);return i.convertToUtc(t,s),i.convertToUtc(a,n),e.EstStartDate=i.buildISOString(t),e.EstEndDate=i.buildISOString(a),r.update("woassignments/"+S.model1.Id,e).then(function(e){!function(e){if(e&&e.data&&(S.model1.EventSynchronized=e.data.EventSynchronized,S.model1.GraphOwnerId=e.data.GraphOwnerId,S.model1.GraphObjectId=e.data.GraphObjectId,e.data.ActionResults))for(var t=0;t<e.data.ActionResults.length;t++)-1==e.data.ActionResults[t].Result?d.error({message:e.data.ActionResults[t].Message}):0==e.data.ActionResults[t].Result?d.warning({message:e.data.ActionResults[t].Message}):1==e.data.ActionResults[t].Result&&d.success({message:e.data.ActionResults[t].Message})}(e),e.data&&L.Id!=e.data.TechId&&y&&(d.error("Assignment does not belong to the technician."),o.go("myWorkOrders"))})},S.model={},S.model1={},S.modelSite={},S.filter={filterId:a.id},S.changeForms=function(){S.woForm=!S.woForm,S.woForm?S.btnName="Site Equipment Forms":(S.filterSiteForms.reset(),S.filterSiteForms.eq("SiteId",S.model.SiteId).eq("Id",S.modelSite.Id),S.btnName="Work Order Forms")},S.filter1={siteId:S.model.SiteId,rateSheetId:null},S.partsData={partsCovered:!1},S.miscData={miscCovered:!1},S.laborData={laborMarkup:0,laborCovered:!1},S.reloadFilter=!0,$(window).focus(function(){S.reloadFilter=!1,e.$apply(),S.reloadFilter=!0,e.$apply()});var y=!1,I=u.getValue("authorizationData");S.userRoles=I.userRoles.split(",");for(var h=f.roleTypes,g=0;g<S.userRoles.length;g++)"Technician"!==h[g]&&"SubContractor"!==S.userRoles[g]||(y=!0);S.refresh=!0,S.filterByWorkOrder=l.filter("and"),S.filterByWorkOrder.eq("WoId",S.filter.filterId),S.filterOnlyByWorkOrder=l.filter("and"),S.filterOnlyByWorkOrder.eq("WoId",S.filter.filterId),S.filterBySite=l.filter("and"),S.filterSiteForms=l.filter("and"),S.customer={customerId:0},S.customers=[],S.site={siteId:0},S.email=k,S.id=a.id,S.assid=a.assId,S.companyWoStatus={},S.companyAssignmentStatus={},S.editWorkorder=function(){r.update("wodetails/"+S.id,S.model).then(function(){d.success({message:"Work order has been successfully updated."})})},S.editAssignmentStatus=function(){return m.getLocation("AssignmentStatus").then(function(t){var o=t.coords.latitude,a=t.coords.longitude;null!==o&&(S.modelStatus.Latitude=o),null!==a&&(S.modelStatus.Longitude=a),r.update("woassignments/status/"+S.assid,S.modelStatus).then(function(){S.model1.Status=S.modelStatus.Status,e.$broadcast("assignmentstatuschanged"),d.success({message:"Assignment status has been successfully updated."}),w()})})},S.filterByWorkOrder.eq("Id",S.assid),S.count=0,S.estHoursTotal=0,S.techAssignments=A,S.checkTotalCount=G,G(),S.checkAssignmentsStatuses=w,S.filterByMainCompany=l.filter("and"),S.addTask=!0;n.getTransitionParam("workOrdersDetails");var C=window.location.pathname.split("/"),b=C[C.length-1];"myAssignments"===b?window.name="false":"dispatchCalendar"===b&&(window.name="true"),"true"===window.name?S.fromDispatch=!0:"false"===window.name&&(S.fromDispatch=!1),S.allAssignmentsCompleted=!1,S.taskGrid=!1,S.poGrid=!1,S.companySettings=[],S.companySettingsFilter=l.filter("or"),S.companySettingsFilter.eq("Name","POGrid").eq("Name","TaskGrid").eq("Name","AutoCompleteWO"),r.getItems("companysettings",S.companySettingsFilter).then(function(e){S.companySettings=e.data.Data;for(var t=0;t<S.companySettings.length;t++)"POGrid"==S.companySettings[t].Name&&0!=S.companySettings[t].Id&&null!=S.companySettings[t].Value&&(S.poGrid=JSON.parse(S.companySettings[t].Value.toLowerCase())),"TaskGrid"==S.companySettings[t].Name&&0!=S.companySettings[t].Id&&null!=S.companySettings[t].Value&&(S.taskGrid=JSON.parse(S.companySettings[t].Value.toLowerCase())),"AutoCompleteWO"==S.companySettings[t].Name&&0!=S.companySettings[t].Id&&null!=S.companySettings[t].Value&&(S.companyAutoCompleteWO=JSON.parse(S.companySettings[t].Value.toLowerCase()))}),S.formswo=[];var v={page:0,pageSize:0};(v=l.filter("and")).eq("WoId",S.id),v.page=1,v.pageSize=100,r.getItems("forms/getforwodetails",v).then(function(){S.formswo=r.state.items});var E=[];r.getItems("usersettings").then(function(){E=r.state.items;for(var e=0;e<E.length;e++){if("OpenAllPanels"==E[e].Name&&0!=E[e].Id&&null!=E[e].Value)JSON.parse(E[e].Value.toLowerCase())&&(N(),$('.panel-collapse:not(".in")').collapse("show"))}}),S.attributesSite=[{Type:"dropdown",Label:"Forms",Required:!1,ApiMethod:"forms/getforSiteEquipmentDropdown",ValueProp:"Id",TextProp:"Name",ModelValue:"Id",Filter:S.filterByWorkOrder}];var T=e.$watch("vm.attributesSite[0].CurrentList",function(){S.attributesSite[0].CurrentList&&S.attributesSite[0].CurrentList.length>0&&(S.modelSite.Id=S.attributesSite[0].CurrentList[0].Id,S.filterSiteForms.reset(),S.filterSiteForms.eq("SiteId",S.model.SiteId).eq("Id",S.modelSite.Id),T())}),M={Type:"button",Label:"Notify Dispatcher",onClick:k,CustomDivClass:""};S.attributes=[{Type:"text",Label:"Work Order:",ReadOnly:!0,ModelValue:"AltId"},{Type:"text",Label:"Status:",ModelValue:"Status",ReadOnly:!0},{Type:"text",Label:"Customer:",MaxLength:"50",ModelValue:"CustomerName",ReadOnly:!0},{Type:"text",Label:"Priority:",ModelValue:"Priority",ReadOnly:!0},{Type:"text",Label:"Address",MaxLength:"100",ModelValue:"Address",ReadOnly:!0},{Type:"text",Label:"Site:",MaxLength:"50",ModelValue:"SiteName",ReadOnly:!0},{Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc",Autofocus:"true",ReadOnly:!0},{Type:"text",Label:"Requestor:",MaxLength:"100",ModelValue:"ContactName",ReadOnly:!0},{Type:"text",Label:"Work Order Type:",ModelValue:"WoType",ReadOnly:!0},{Type:"text",Label:"Phone:",MaxLength:"50",ModelValue:"ContactPhone",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"datepicker",Label:"Promised Date:",ModelValue:"PromiseDate",Format:"MM/dd/yyyy hh:mm a",SubType:"date",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Time Zone:",ModelValue:"TimeZoneName",ReadOnly:!0}],S.assignmentatt=[{Type:"line",CustomClass:"col-sm-12"},{Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc",Required:!0},{Type:"empty"},{Type:"dropdown",Label:"Serviceable Item:",ApiMethod:"serviceableitems/dropdownbysite",Filter:S.filter1,ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",ConvertToInt:"true"},{Type:"dropdown",Label:"Problem Code:",ApiMethod:"problemcodes/getPCforSub",ValueProp:"ProblemCodeName",TextProp:"ProblemCodeName",ModelValue:"ProblemCode",Filter:S.filterByMainCompany},{Type:"datepicker",Label:"Scheduled:",ModelValue:"EstStartDate",Format:"MM/dd/yyyy"},{Type:"dropdown",Label:"Cause:",ApiMethod:"causes/getCausesForSub",ValueProp:"CauseName",TextProp:"CauseName",ModelValue:"Cause",Filter:S.filterByMainCompany},{Type:"decimal",Label:"Estimated Hours:",MaxLength:"50",ModelValue:"EstHours"},{Type:"dropdown",Label:"Resolution:",ApiMethod:"resolutions/getResForSub",ValueProp:"ResolutionName",TextProp:"ResolutionName",ModelValue:"Resolution",Filter:S.filterByMainCompany},{Type:"text",Label:"Time Zone:",ModelValue:"TimeZoneName",ReadOnly:!0},{Type:"dropdown",Label:"Technician:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"TechId",ConvertToInt:"true"},{Type:"empty"},{Type:"datepicker",ModelValue:"EstEndDate",Format:"MM/dd/yyyy",CustomInputClass:"hidden"},{Type:"empty"},M,{Type:"hidden",ModelValue:"GraphObjectId"},{Type:"hidden",ModelValue:"GraphOwnerId"},{Type:"hidden",ModelValue:"EventSynchronized"}],S.assignmentStatus=[{Type:"dropdown",Label:"Status:",ApiMethod:"assignmentstatuses",ValueProp:"AssignmentStatusName",TextProp:"AssignmentStatusName",ModelValue:"Status",Required:!0}],e.$on("wo.assignmentChange",function(e,t){S.refresh=!1,p(function(){S.refresh=!0})}),S.loadingIndicator=!1,e.$watch("vm.allAssignmentsCompleted",function(){void 0!=S.allAssignmentsCompleted&&(1==S.allAssignmentsCompleted?void 0!=S.companyAutoCompleteWO&&"true"==S.companyAutoCompleteWO.Value.toLowerCase()&&"Invoiced"!=S.model.Status&&A():A())}),S.assignmnentTimezone={TzDatabaseName:"%TzDatabaseName%"},S.woForm=!0,S.btnName="Site Equipment Forms";var D=[];function w(){if(void 0!=S.model1.WoId){var e=l.filter("and");e.eq("Woid",S.model1.WoId),r.getItems("woassignments",e).then(function(){var e=r.state.items;S.count=e.length;for(var t=0,o=0;o<e.length;o++)"Complete"==e[o].Status&&(t+=1),S.estHoursTotal=S.estHoursTotal+e[o].EstHours;if(t==e.length){n.setTransitionParam("openServiceReport",{}),O(!0)}else O(!1)})}}function G(){S.filterWoForTotalCount=l.filter("and"),S.filterWoForTotalCount.eq("WoId",S.id),r.getItems("woassignments",S.filterWoForTotalCount).then(function(){var e=r.state.items;S.count=e.length,S.estHoursTotal=0;for(var t=0;t<e.length;t++)S.estHoursTotal=S.estHoursTotal+e[t].EstHours})}function O(e){void 0!=e&&(1==e?void 0!=S.companyAutoCompleteWO&&"true"==S.companyAutoCompleteWO.Value.toLowerCase()&&"Invoiced"!=S.model.Status&&(S.model.Status="Complete",A()):A())}function A(){var e=[],t={},o=!0;(t=l.filter("and")).reset(),t.eq("TechId",S.model1.TechId).eq("WoId",S.model1.WoId),r.getItems("woassignments",t).then(function(){e=r.state.items;for(var t=0;t<e.length;t++)"Complete"!=e[t].Status&&(o=!1);o&&S.$state.go("assignmentDetailsReadOnly",{id:S.model1.WoId,assId:S.model1.Id})})}function k(){var e={WoId:S.model.AltId,Id:parseInt(S.assid),SysCreatorId:S.model1.SysCreatorId};s.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/assignmentEmail.html",controller:"AssignmentSendEmailController",controllerAs:"vm",inputs:{model:e}}).then(function(e){e.close.then(function(){S.reloadTable=!1,p(function(){S.reloadTable=!0})})})}e.$watch("vm.model.Id",function(){S.model.Id&&(S.customer.customerId=S.model.CustomerId,S.site.siteId=S.model.SiteId,S.site.siteName=S.model.SiteName,S.site.title=S.model.ContactName,S.site.phone=S.model.ContactPhone,S.site.address=S.model.Address,S.subcontractorId=S.model.SubContractorId,S.woCompanyId=S.model.CompanyId,S.filterBySite.eq("SiteId",S.model.SiteId),S.model&&S.model.Id&&(S.filterByMainCompany.reset(),S.filterByMainCompany.eq("CompanyId",S.model.CompanyId),r.getItems("problemcodes/getPCforSub",S.filterByMainCompany).then(function(){D=r.state.items})))}),e.$watch("vm.modelSite",function(){void 0!==S.modelSite.Id&&(null==S.modelSite.Id&&S.attributesSite[0].CurrentList&&S.attributesSite[0].CurrentList.length>0&&(S.modelSite.Id=S.attributesSite[0].CurrentList[0].Id),S.filterSiteForms.reset(),S.filterSiteForms.eq("SiteId",S.model.SiteId).eq("Id",S.modelSite.Id))},!0),e.$watch("vm.customer.customerId",function(){null!=S.customer.customerId&&S.customer.customerId>0&&S.model.CustomerId!=S.customer.customerId&&(S.model.CustomerId=S.customer.customerId,S.model.CustomerName=S.customer.customerName,S.model.SiteId=0,S.model.SiteName="",S.model.Address="",S.model.ContactName="",S.model.ContactPhone="")}),e.$watch("vm.site.siteId",function(){null!=S.site.siteId&&S.site.siteId>0&&(S.model.SiteId=S.site.siteId,S.model.SiteName=S.site.siteName,S.model.ContactName=S.site.title,S.model.ContactPhone=S.site.phone,S.model.Address=S.site.address,S.filter1.siteId=S.site.siteId)}),e.$watch("vm.model.RateSheetId",function(){null!=S.model.RateSheetId&&S.model.RateSheetId>0&&(S.filter1.rateSheetId=S.model.RateSheetId)}),e.$watch("vm.model1.EstStartDate",function(){if(null!=S.model1.EstStartDate||void 0!=S.model1.EstStartDate){if(null!=S.model1.EstHours){var e=new Date(S.model1.EstStartDate),t=Math.floor(S.model1.EstHours),o=Math.round(100*(S.model1.EstHours-t)),a=t,s=Math.round(60*o/100);e.setMinutes(e.getMinutes()+s),e.setHours(e.getHours()+a),S.model1.EstEndDate=e}else if(null!=S.model1.EstEndDat){if(S.model1.EstEndDate<S.model1.EstStartDate)return S.model1.EstEndDate=S.model1.EstStartDate,void d.error("The scheduled start can’t be after scheduled end!");var r=100*Math.round(S.model1.EstEndDate/1e5),n=100*Math.round(S.model1.EstStartDate/1e5);a=(new Date(r)-new Date(n))/3600;S.model1.EstHours=Math.round(100*a)/100}}else S.model.EstEndDate=null},!0),e.$watch("vm.model1.EstEndDate",function(){if(null!=S.model1.EstEndDate||void 0!=S.model1.EstEndDate){if(null!=S.model1.EstStartDate){if(100*Math.round(S.model1.EstEndDate/1e5)!=100*Math.round(S.model1.EstStartDate/1e5)&&S.model1.EstEndDate<S.model1.EstStartDate&&(S.model1.EstEndDate<oldValue||null===oldValue))return S.model1.EstEndDate=oldValue,void d.error("The scheduled start can’t be after scheduled end!");var e=100*Math.round(S.model1.EstEndDate/1e5),t=100*Math.round(S.model1.EstStartDate/1e5),o=(new Date(e)-new Date(t))/3600;S.model1.EstHours=o}else if(null!=S.model1.EstHours){var a=new Date(S.model1.EstEndDate),s=Math.floor(S.model1.EstHours),r=Math.round(100*(S.model1.EstHours-s)),n=(o=s,Math.round(60*r/100));a.setMinutes(a.getMinutes()-n),a.setHours(a.getHours()-o),S.model1.EstStartDate=a}}else S.model1.EstStartDate=null},!0),e.$watch("vm.model1.EstHours",function(){if(null!=S.model1.EstHours||void 0!=S.model1.EstHours)if(null!=S.model1.EstStartDate){var e=new Date(S.model1.EstStartDate),t=Math.floor(S.model1.EstHours),o=Math.round(100*(S.model1.EstHours-t)),a=t,s=Math.round(60*o/100);e.setMinutes(e.getMinutes()+s),e.setHours(e.getHours()+a),S.model1.EstEndDate=e}else if(null!=S.model.EstEndDate){var r=new Date(S.model.EstEndDate);t=Math.floor(S.model.EstHours),o=Math.round(100*(S.model.EstHours-t)),a=t,s=Math.round(60*o/100);r.setMinutes(r.getMinutes()-s),r.setHours(r.getHours()-a),S.model.EstStartDate=r}},!0),S.isFirstProblemCode=!1,e.$watch("vm.model1.ProblemCode",function(){if(void 0!=S.model1.ProblemCode)if(S.isFirstProblemCode){for(var e=0;e<D.length;e++)if(D[e].ProblemCodeName==S.model1.ProblemCode){S.model1.EstHours=D[e].DefaultHours,S.model1.Desc=D[e].Decs;break}}else S.isFirstProblemCode=!0;else S.model1.EstHours=null,S.model1.Desc=null},!0),r.getItem("woassignments",S.assid).then(function(){var e=r.state.item;if("Complete"==e.WorkOrderStatus||"Invoiced"==e.WorkOrderStatus||"ReadyToInvoice"==e.WorkOrderStatus)o.go("assignmentDetailsReadOnly",{id:e.WoId,assId:e.Id});else{var t=[],a={},s=!0;(a=l.filter("and")).reset(),a.eq("TechId",e.TechId).eq("WoId",e.WoId),r.getItems("woassignments",a).then(function(){t=r.state.items;for(var a=0;a<t.length;a++)if("Complete"!=t[a].Status){s=!1;break}s?o.go("assignmentDetailsReadOnly",{id:e.WoId,assId:e.Id}):r.getItem("companyinfos/getCurrentCompany").then(function(){S.currentCompany=r.state.item,e.CompanyId==S.currentCompany.Id?o.go("assignmentDetails",{id:e.WoId,assId:e.Id}):o.go("assignmentSubcontractorDetails",{id:e.WoId,assId:e.Id})})})}});var L={};function N(e){switch(e){case"assignmentsGrid":S.assignmentsGrid=!0;break;case"notesGrid":S.notesGrid=!0;break;case"laborGrid":S.laborGrid=!0;break;case"partsGrid":S.partsGrid=!0;break;case"miscGrid":S.miscGrid=!0;break;case"tasksGrid":S.tasksGrid=!0;break;case"servreportGrid":S.servreportGrid=!0;break;case"attachmentsGrid":S.attachmentsGrid=!0;break;case"formsGrid":S.formsGrid=!0;break;case"poesGrid":S.poesGrid=!0;break;case"woesGrid":S.woesGrid=!0;break;default:S.assignmentsGrid=!0,S.notesGrid=!0,S.laborGrid=!0,S.partsGrid=!0,S.miscGrid=!0,S.tasksGrid=!0,S.servreportGrid=!0,S.attachmentsGrid=!0,S.formsGrid=!0,S.poesGrid=!0,S.woesGrid=!0}}c.getCurrentUserEmployeeData().then(function(e){L=e}),S.assignmentsGrid=!1,S.notesGrid=!1,S.laborGrid=!1,S.partsGrid=!1,S.miscGrid=!1,S.tasksGrid=!1,S.servreportGrid=!1,S.attachmentsGrid=!1,S.formsGrid=!1,S.poesGrid=!1,S.woesGrid=!0,S.initialiseGrid=N}angular.module("FieldConnectApp").controller("AssignmentSubcontractorDetailsEditController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","restService","Notification","stateTransitionService","qsService","timezoneService","fcGeoLocationService","cryptoStorageService","currentUserService","$timeout","rolesFactory"]}();;!function(){"use strict";function e(e,t,a,o,s,n,l,i,d,r,m,u,c,p,h,S,E,b){var D=this;D.editAssignment=function(t,a,o,n,l){p.isTechnician(n).then(function(n){var i=n;if(i||!t||g){if(D.model={WoId:parseInt(a)},D.usingDSLNorthwest?(D.dslServiceableItemFilter=r.filter("and"),D.dslServiceableItemFilter.reset(),D.dslServiceableItemFilter.eq("SiteId",o),D.attServiceableItem.Filter=D.dslServiceableItemFilter,D.assignmentatt=C):D.filter1.siteId=o,D.isFirstProblemCode=!t,l){D.assignmentatt[0]={Type:"text",Label:"Problem Code:",ModelValue:"ProblemCode",ReadOnly:!0};var m=e.$watch("va.model",function(){D.model&&D.model.CompanyId&&(D.filterByMainCompany.reset(),D.filterByMainCompany.eq("CompanyId",D.model.CompanyId),d.getItems("problemcodes/getPCforSub",D.filterByMainCompany).then(function(){y=d.state.items}),m())},!0)}else d.getItems("problemcodes").then(function(){y=d.state.items});s.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"AssignmentEditController",controllerAs:"vm",inputs:{modalTitle:"Assignment edit",id:t,model:D.model,attributes:D.assignmentatt,apiMethod:"woassignments",timezone:D.assignmentsTimezone,onSubmit:D.submit,onBack:D.editData}}).then(function(a){D.assEditPopupScope=a.scope,a.close.then(function(){t||(D.isFirstProblemCode=!1),t==e.$parent.vm.assid&&e.$parent.vm.checkWoAssStatuses()})})}else c.warning({message:"You don't have permission to edit this assignment!"})})},D.submit=function(){return m.getLocation("WOAssignments").then(function(e){var t=angular.copy(D.model),a=e.coords.latitude,o=e.coords.longitude;if(null!=a&&(t.Latitude=a),null!=o&&(t.Longitude=o),void 0!=t.EstStartDate){var s=new Date(t.EstStartDate);t.TzDatabaseName&&(n=moment.tz.zone(N.tzDatebaseName).offset(s)),u.convertToUtc(s,n),t.EstStartDate=u.buildISOString(s)}if(void 0!=t.EstEndDate){var n,l=new Date(t.EstEndDate);t.TzDatabaseName&&(n=moment.tz.zone(N.tzDatebaseName).offset(l)),u.convertToUtc(l,n),t.EstEndDate=u.buildISOString(l)}t.Id?d.update("woassignments/"+t.Id,t).then(function(e){w(e),A(e)}):d.create("woassignments",t).then(function(e){w(e),A(e)})})},D.techList=P,D.tmpStatus="",D.reloadTable=!0,D.id=l.assId,D.filterByMainCompany=r.filter("and"),D.assigId=parseInt(D.id),D.model={},D.editData=w,D.deleteiscurrenttech=function(t){p.isTechnician(t).then(function(a){var s=a;if(!s&&!g)return c.warning({message:"You don't have permission to delete this assignment!"}),null;D.loadingIndicator=!0,D.reloadTable=!1,D.tmpassignmentId=t.Id,d.remove("woassignments",t.Id).then(function(){void 0!==e.selected&&(e.selected=null),D.tmpassignmentId==D.assigId&&v?o.go("myWorkOrders"):D.tmpassignmentId==D.assigId&&g&&v?o.go("myWorkOrders"):D.tmpassignmentId==D.assigId&&g&&o.go("dispatchCalendar"),D.reloadTable=!0}).then(function(){var e={EventType:"DELETE",RecordId:t.Id,TableName:"WoAssignment",ParentRecordId:t.WoId,Note:"WoAssignment "+t.Desc+", ProblemCode: "+t.ProblemCode+", Status: "+t.AssignmentStatusName};E.createEvent(e),D.loadingIndicator=!1})})},D.filter1={siteId:0};for(var T=t.getValue("authorizationData").userRoles.split(","),g=!1,v=!1,f=h.roleTypes,I=0;I<T.length;I++)"Admin"!==T[I]&&"FieldConnect"!==T[I]&&"Dispatch"!==T[I]||(g=!0),"Technician"===f[I]&&(v=!0);var y=[];D.usingDSLNorthwest=S.usingDSLNorthwest,D.attProblemCode={Type:"dropdown",Label:"Problem Code:",ApiMethod:"problemcodes",ValueProp:"ProblemCodeName",TextProp:"ProblemCodeName",ModelValue:"ProblemCode",Required:!0,Autofocus:"true"},D.attScheduledStartDate={Type:"datepicker",Label:"Scheduled Start Date/Time:",ModelValue:"EstStartDate",Format:"MM/dd/yyyy"},D.attDescription={Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc",Required:!0},D.attScheduledEndDate={Type:"datepicker",Label:"Scheduled End Date/Time:",ModelValue:"EstEndDate",Format:"MM/dd/yyyy"},D.attServiceableItem={Type:"dropdown",Label:"Serviceable Item:",ApiMethod:"serviceableitems/dropdownbysite",Filter:D.filter1,ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",ConvertToInt:"true"},D.attEstimatedHours={Type:"decimal",Label:"Estimated Hours:",MaxLength:"50",ModelValue:"EstHours"},D.attTechnician={Type:"dropdown",Label:"Technician:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"TechId",ConvertToInt:"true",CustomDivClass:"col-sm-4",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-5 custom-input-assignment"},D.attFilterTech={Type:"button",Label:"Filter Tech",onClick:P,CustomDivClass:"col-sm-2 custom-button-assignment"},D.attCause={Type:"dropdown",Label:"Cause:",ApiMethod:"causes",ValueProp:"CauseName",TextProp:"CauseName",ModelValue:"Cause",Filter:D.filterByMainCompany},D.attSiteTimeZone={Type:"text",Label:"Site Time Zone:",ModelValue:"TimeZoneName",ReadOnly:!0},D.attResolution={Type:"dropdown",Label:"Resolution:",ApiMethod:"resolutions",ValueProp:"ResolutionName",TextProp:"ResolutionName",ModelValue:"Resolution",Filter:D.filterByMainCompany},D.attStatus={Type:"dropdown",Label:"Status:",ApiMethod:"assignmentstatuses/ddList",ValueProp:"AssignmentStatusName",TextProp:"AssignmentStatusName",ModelValue:"Status",Required:!0},D.attEmpty1={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},D.attNote={Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note",ReadOnly:!1},D.attGraphObjectId={Type:"hidden",ModelValue:"GraphObjectId"},D.attGraphOwnerId={Type:"hidden",ModelValue:"GraphOwnerId"},D.attEventSynchronized={Type:"hidden",ModelValue:"EventSynchronized"},D.DSLATTServiceableItem={Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!1,Sortable:!0};var M=[D.attProblemCode,D.attScheduledStartDate,D.attDescription,D.attScheduledEndDate,D.attServiceableItem,D.attEstimatedHours,D.attTechnician,D.attFilterTech,D.attCause,D.attSiteTimeZone,D.attResolution,D.attStatus,D.attEmpty1,D.attNote,D.attGraphObjectId,D.attGraphOwnerId,D.attEventSynchronized],C=[D.attProblemCode,D.attScheduledStartDate,D.attDescription,D.attScheduledEndDate,D.attServiceableItem,D.attEstimatedHours,D.attTechnician,D.attFilterTech,D.attCause,D.attSiteTimeZone,D.attResolution,D.attStatus,D.attEmpty1,D.attNote,D.attGraphObjectId,D.attGraphOwnerId,D.attEventSynchronized];D.usingDSLNorthwest?(D.attServiceableItem.ApiMethod="serviceableitems/dsldropdownbysite",D.attServiceableItem.TextProp="DDLabel",D.DSLATTServiceableItem.ValueName="DSLServiceableItemName",D.attServiceableItem.Required=!0,D.assignmentatt=C):D.assignmentatt=M,D.attributes=[{Name:"Problem Code",ValueName:"ProblemCode",Edit:!0,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},D.DSLATTServiceableItem,{Name:"Technician",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Scheduled Start Date/Time",ValueName:"EstStartDate",FormatDate:"datetime",Edit:!1,Sortable:!0},{Name:"Scheduled End Date/Time",ValueName:"EstEndDate",FormatDate:"datetime",Edit:!1,Sortable:!0},{Name:"Site Time Zone",ValueName:"TimeZoneName",Edit:!1,Sortable:!0},{Name:"Estimated Hours",ValueName:"EstHours",Edit:!1,Sortable:!0}],d.getItem("settings/status?type=AssignmentStatus").then(function(){D.companyAssignmentStatus=d.state.item,D.tmpStatus=D.companyAssignmentStatus.Value}),y=[],e.$watch("va.model.Status",function(e,t){void 0==D.model.Status&&D.tmpStatus&&(D.model.Status=D.tmpStatus),D.model.Id&&b.usingXOiIntegration()&&b.preventAssignmentCompleteIfXOiJobOpen&&t&&e&&t!==e&&"Complete"===e&&(c.warning("Checking XOi Job Status, please wait..."),b.isXOiJobComplete(D.model.Id).then(function(e){e?c.success("The Assignment can be completed."):(c.error("XOi Job is Open! The Assignment cannot be completed."),n(function(){D.model.Status=t}))}))});e.$watch("va.model.EstStartDate",function(){if(null!=D.model.EstStartDate||void 0!=D.model.EstStartDate){if(null!=D.model.EstHours){var e=new Date(D.model.EstStartDate),t=Math.floor(D.model.EstHours),a=Math.round(100*(D.model.EstHours-t)),o=t,s=Math.round(60*a/100);e.setMinutes(e.getMinutes()+s),e.setHours(e.getHours()+o),D.model.EstEndDate=e}else if(null!=D.model.EstEndDate){if(D.model.EstEndDate<D.model.EstStartDate)return D.model.EstEndDate=D.model.EstStartDate,void c.error("The scheduled start can’t be after scheduled end!");var n=100*Math.round(D.model.EstEndDate/1e5),l=100*Math.round(D.model.EstStartDate/1e5);o=(new Date(n)-new Date(l))/3600;D.model.EstHours=o}}else D.model.EstEndDate=null},!0),e.$watch("va.model.EstEndDate",function(e,t){if(null!=D.model.EstEndDate||void 0!=D.model.EstEndDate){if(null!=D.model.EstStartDate){if(100*Math.round(D.model.EstEndDate/1e5)!=100*Math.round(D.model.EstStartDate/1e5)&&D.model.EstEndDate<D.model.EstStartDate&&(D.model.EstEndDate<t||null===t))return D.model.EstEndDate=t,void c.error("The scheduled start can’t be after scheduled end!");var a=100*Math.round(D.model.EstEndDate/1e5),o=100*Math.round(D.model.EstStartDate/1e5),s=(new Date(a)-new Date(o))/3600;D.model.EstHours=s}else if(null!=D.model.EstHours){var n=new Date(D.model.EstEndDate),l=Math.floor(D.model.EstHours),i=Math.round(100*(D.model.EstHours-l)),d=(s=l,Math.round(60*i/100));n.setMinutes(n.getMinutes()-d),n.setHours(n.getHours()-s),D.model.EstStartDate=n}}else D.model.EstStartDate=null},!0),e.$watch("va.model.EstHours",function(){if(null!=D.model.EstHours||void 0!=D.model.EstHours)if(null!=D.model.EstStartDate){var e=new Date(D.model.EstStartDate),t=Math.floor(D.model.EstHours),a=Math.round(100*(D.model.EstHours-t)),o=t,s=Math.round(60*a/100);e.setMinutes(e.getMinutes()+s),e.setHours(e.getHours()+o),D.model.EstEndDate=e}else if(null!=D.model.EstEndDate){var n=new Date(D.model.EstEndDate);t=Math.floor(D.model.EstHours),a=Math.round(100*(D.model.EstHours-t)),o=t,s=Math.round(60*a/100);n.setMinutes(n.getMinutes()-s),n.setHours(n.getHours()-o),D.model.EstStartDate=n}},!0),D.isFirstProblemCode=!1,e.$watch("va.model.ProblemCode",function(){if(void 0!=D.model.ProblemCode)if(D.isFirstProblemCode){for(var e=0;e<y.length;e++)if(y[e].ProblemCodeName==D.model.ProblemCode){D.model.EstHours=y[e].DefaultHours,D.model.Desc=y[e].Decs,!1;break}}else D.isFirstProblemCode=!0,!1;else D.model.EstHours=null,D.model.Desc=null}),e.$watch("va.reloadTable",function(){e.$parent.vm.checkTotalCount()});var N=t.getValue("authorizationData");function w(t){return D.assEditPopupScope&&D.assEditPopupScope.close(null,200),void 0!=t&&(e.$parent.vm.checkTotalCount(t),e.$emit("wo.assignmentChange"),e.$parent.vm.filterOnlyByWorkOrder.Reload++,D.reloadTable=!1,n(function(){D.reloadTable=!0,e.$apply()})),!0}function P(){s.showModal({templateUrl:"Templates/Dispatch/DispatchScheduling/techpopup.html",controller:"PopupTechController",controllerAs:"vm",inputs:{modalTitle:"Tech List",startDateTime:D.model.EstStartDate,endDateTime:D.model.EstEndDate,attributes:D.attech,apiMethod:"woassignments",timezone:D.assignmentsTimezone,model:D.model}}).then(function(t){t.close.then(function(){D.reloadTable=!1,n(function(){D.reloadTable=!0,e.$apply()})})})}function A(e){if(e&&e.data&&(D.model.EventSynchronized=e.data.EventSynchronized,D.model.GraphOwnerId=e.data.GraphOwnerId,D.model.GraphObjectId=e.data.GraphObjectId,e.data.ActionResults))for(var t=0;t<e.data.ActionResults.length;t++)-1==e.data.ActionResults[t].Result?c.error({message:e.data.ActionResults[t].Message}):0==e.data.ActionResults[t].Result?c.warning({message:e.data.ActionResults[t].Message}):1==e.data.ActionResults[t].Result&&c.success({message:e.data.ActionResults[t].Message})}N&&N.tzDatebaseName&&(D.tzName=N.tzDatebaseName,D.userTimeZone=moment.tz(D.tzName).zoneAbbr()),D.assignmentsTimezone={TzDatabaseName:"%TzDatabaseName%"},e.$on("assignmentstatuschanged",function(e,t){D.reloadTable=!1,n(function(){D.reloadTable=!0})}),e.$watch("va.model.TimeZoneName",function(){void 0==D.model.TimeZoneName&&e.$parent.vm.model.TimeZoneName&&(D.model.TimeZoneName=e.$parent.vm.model.TimeZoneName,D.model.TzDatabaseName=e.$parent.vm.model.TzDatabaseName)})}angular.module("FieldConnectApp").controller("MyAssingmentController",e),e.$inject=["$scope","cryptoStorageService","$location","$state","ModalService","$timeout","$stateParams","stateTransitionService","restService","qsService","fcGeoLocationService","timezoneService","Notification","currentUserService","rolesFactory","featuresFactory","fcEventService","xoiService"]}();;!function(){"use strict";var e;angular.module("cbTimer",[]);function t(t,s,o,a,n,r,i,l,m,d,c,u,g,f,C,v,p,D){var S=this;S.travelButton=[],S.serviceButton=[],S.assigments1=[],S.hideCancel=!0,S.isActive="",S.activeType="",S.date="",S.i="",S.submit=function(){},S.firstTime={},S.apiUpdateTime="",S.disableTravelButtons=[],S.disableServiceButtons=[],S.timerModel={},S.colorCodes={completeColorCode:"",assignedColorCode:"",onholdColorCode:"",openColorCode:"",incompleteColorCode:"",startedColorCode:"",travelingColorCode:"",suspendedColorCode:"",partsArrivedColorCode:"",partsOnOrderColorCode:""};var A=0,h=0;t.timer="00:00:00",S.startTimer=k,S.stopTimer=function(t,o,a,n){if(3==a)var r="Travel";else if(4==a)var r="Service";bootbox.confirm("Are you sure you want to stop your "+r+" time?",function(t){t&&(f.cancel(e),S.assignmentFilter=l.filter("and"),S.assignmentFilter.eq("AssignmentId",n.Id).eq("EndDate","NULL"),i.getItems(S.apiMethod,S.assignmentFilter).then(function(e){D.getLocation("TR Labor").then(function(t){S.updateTime=e.data.Data;var o=S.updateTime[0];S.startDateTime=o.StartDate;var r=new Date(S.startDateTime),l=new Date,m=c.convertToLocal(r,l.getTimezoneOffset()),d=new Date(m),g=new Date;A=d.getTime();var f=(h=g.getTime())-A,C=(f/36e5).toFixed(2);if(f<12e4)return u.warning({message:"Time entries must be greater than 2 minutes."}),void z();if(n.Latitude=t.coords.latitude,n.Longitude=t.coords.longitude,3==a){n.Status="Open",n.AssignmentStatusName="Open",F(n);var v="woassignments/"+n.Id;i.update(v,n).then(function(e){})}else if(4==a){n.Status="Open",n.AssignmentStatusName="Open",F(n);var v="woassignments/"+n.Id;i.update(v,n).then(function(e){})}o.rawHours=f,o.WorkHours=C,o.StartDate=S.startDateTime,o.EndDate=g,o.Billable=!0,o.AssignmentId=n.Id,o.Latitude=t.coords.latitude,o.Longitude=t.coords.longitude,i.update(S.apiMethod+"/"+o.Id,o).then(function(e){s.showModal({templateUrl:"Templates/Agreements/agreementTimePopup.html",controller:"AgreementTimePopupController",controllerAs:"vm",inputs:{modalTitle:"Assignment Labor Edit",id:o.Id,model:o,onSubmit:S.submit,customerId:n.CustomerId,apiMethod:S.apiMethod,moduleName:S.moduleName,viewName:S.viewName}});for(var t=0;t<S.assigments.length;t++)S.assigments[t+"_0"]=!1,S.travelButton[t+"_0"]=!1,S.serviceButton[t+"_0"]=!1,S.disableTravelButtons[t+"_0"]=!1,S.disableServiceButtons[t+"_0"]=!1})})}))})},S.deviceDetect=C,S.currentDate=moment(),S.userTimeZone="",S.companySettings=[],S.currentColors=[],S.usingDSLNorthwest=v.usingDSLNorthwest,S.apiMethod="woLabors",S.usingDSLNorthwest&&(S.apiMethod="dslWoLabors"),S.$state=n,S.goToManage=function(e){d.popTransitionParam("workOrdersDetails"),d.popTransitionParam("openServiceReport"),"Complete"==e.WorkOrderStatus||"Invoiced"==e.WorkOrderStatus||"ReadyToInvoice"==e.WorkOrderStatus?n.go("assignmentDetailsReadOnly",{id:e.WoId,assId:e.Id}):i.getItem("companyinfos/getCurrentCompany").then(function(){S.currentCompany=i.state.item,e.CompanyId==S.currentCompany.Id?n.go("assignmentDetails",{id:e.WoId,assId:e.Id}):n.go("assignmentSubcontractorDetails",{id:e.WoId,assId:e.Id})})},S.loadAssigments=O;var T=m.getValue("authorizationData").userRoles.split(",");S.isAdmin=!1;for(var b=0;b<T.length;b++)if("Admin"==T[b]){S.isAdmin=!0;break}S.filter={fromDate:null,toDate:null,search:"",status:"",sortBy:"",sortReverse:!0},S.filter1Tmp={fromDate:null,toDate:null},S.statuses=[];var I=!1;function w(e){var t=angular.element(document.querySelector("#radioAsc")),s=angular.element(document.querySelector("#radioDesc"));e===p.sortDesc?(S.sortDesc(),t[0].checked=!1,s[0].checked=!0):(S.sortAsc(),t[0].checked=!0,s[0].checked=!1)}g.getUserSetting("AssignmentListSortOrder").then(function(e){S.assignmentSortOrderDesc=e,p.getCompanySettings().then(function(e){S.viewAssignmentDaysBack=p.getViewAssignmentsDaysBack,S.viewAssignmentDaysForward=p.getViewAssignmentsDaysForward,null===S.assignmentSortOrderDesc&&(S.assignmentSortOrderDesc=p.getDefaultAssignmentListSortOrder),g.getCurrentUserData().then(function(e){S.UserData=e;var t=m.getValue("lastselection_"+S.UserData.Id);if(t&&t.myAssignments){var s=angular.element(document.querySelector("#Collapsible")),o=angular.element(document.querySelector("#buttonCollapsible"));f(function(){if(t.myAssignments.statuses&&t.myAssignments.statuses.length>0)for(var e=0;e<t.myAssignments.statuses.length;e++)S.statuses.push(t.myAssignments.statuses[e]);S.filter.search=t.myAssignments.search,S.filter.sortBy=t.myAssignments.sortBy,w(function(e){var t=p.sortAsc;return e&&(t=p.sortDesc),t}(t.myAssignments.sortReverse)),t.myAssignments.colapsed?(s[0].className="clearfix collapse in",o[0].className="btn btn-info pull-right Collapsible",I=t.myAssignments.colapsed):(s[0].className="clearfix collapse ",o[0].className="btn btn-info pull-right Collapsible collapsed"),S.filter1Tmp.fromDate=t.myAssignments.fromDate,S.filter1Tmp.toDate=t.myAssignments.toDate,O()})}else w(S.assignmentSortOrderDesc),i.getItems("assignmentstatuses").then(function(){var e=i.state.items;!function(e){for(var t=e.length,s=[];t--;)s.push(e[t].AssignmentStatusName);f(function(){S.statuses=s,S.filter.sortBy="EstStartDate",O()})}(e)})})})}),S.assigments=[],S.showConsent=!1,S.consentUrl=null,i.getItems("graph/consentUrl").then(function(e){e.data&&(S.consentUrl=e.data.url,S.showConsent=null!=S.consentUrl)}),S.consent=function(){null!=S.consentUrl&&(window.location.href=S.consentUrl)};var y=o.search();if(0==y.result){var N="Consent was not successful.";y.error&&(N+="Error: "+decodeURI(y.error)),y.error_details&&(N=NaN+decodeURI(y.error_details)),u.error({message:N})}else if(1==y.result){var B="Consent was successful. "+y.success+" assignments are synchronized with your Office 365 Calendar.";if(u.success({message:B}),y.failure>0){var _=y.failure+" assignments were not synchronized with your Office 365 Calendar.";u.warning({message:_})}}o.url(o.path());function O(){if(S.isLoading=!0,null===S.filter1Tmp.fromDate&&(S.filter1Tmp.fromDate=moment(S.currentDate).add(-1*S.viewAssignmentDaysBack,"days").format("MM/DD/YYYY")),null===S.filter1Tmp.toDate&&(S.filter1Tmp.toDate=moment(S.currentDate).add(S.viewAssignmentDaysForward,"days").format("MM/DD/YYYY")),S.filter.fromDate=S.filter1Tmp.fromDate,S.filter.toDate=S.filter1Tmp.toDate,""!=S.filter.fromDate&&null!=S.filter.fromDate){S.filter.fromDate=new Date(S.filter.fromDate),S.filter.fromDate.setHours(0,0,0,0);var e=new Date(S.filter.fromDate);c.convertToUtc(e),S.filter.fromDate=c.buildISOString(e)}else S.filter.fromDate=null;if(""!=S.filter.toDate&&null!=S.filter.toDate){S.filter.toDate=new Date(S.filter.toDate),S.filter.toDate.setHours(23,59,59,999);var s=new Date(S.filter.toDate);c.convertToUtc(s),S.filter.toDate=c.buildISOString(s)}else S.filter.toDate=null;null!=S.statuses&&(S.filter.status=S.statuses.toString()),i.getItems("myworkorders",S.filter).then(function(e){S.assigments4=e.data.Data;for(var t=0;t<S.assigments4.length;t++)"Traveling"==S.assigments4[t].AssignmentStatusName?(S.assignmentFilter=l.filter("and"),S.assignmentFilter.eq("AssignmentId",S.assigments4[t].Id).eq("EndDate","NULL"),i.getItems(S.apiMethod,S.assignmentFilter).then(function(e){S.updateTime=e.data.Data,S.updateTime.length>0&&(S.isActive=!0,S.laborDeleteButton=!1)})):"Started"==S.assigments4[t].AssignmentStatusName&&(S.assignmentFilter=l.filter("and"),S.assignmentFilter.eq("AssignmentId",S.assigments4[t].Id).eq("EndDate","NULL"),i.getItems(S.apiMethod,S.assignmentFilter).then(function(e){S.updateTime=e.data.Data,S.updateTime.length>0&&(S.isActive=!0,S.laborDeleteButton=!1)}));S.isLoading=!1}),t.$watch("vm.isActive",function(){i.getItems("assignmentstatuscolors").then(function(){S.arr=i.state.items;for(var e=0;e<S.arr.length;e++)switch(S.arr[e].AssignmentStatusName){case"Complete":S.colorCodes.completeColorCode=S.arr[e].ColorCode;break;case"Assigned":S.colorCodes.assignedColorCode=S.arr[e].ColorCode;break;case"On Hold":S.colorCodes.onholdColorCode=S.arr[e].ColorCode;break;case"Open":S.colorCodes.openColorCode=S.arr[e].ColorCode;break;case"Incomplete":S.colorCodes.incompleteColorCode=S.arr[e].ColorCode;break;case"Started":S.colorCodes.startedColorCode=S.arr[e].ColorCode;break;case"Traveling":S.colorCodes.travelingColorCode=S.arr[e].ColorCode;break;case"Suspended":S.colorCodes.suspendedColorCode=S.arr[e].ColorCode;break;case"Parts Arrived":S.colorCodes.partsArrivedColorCode=S.arr[e].ColorCode;break;case"Parts on Order":S.colorCodes.partsOnOrderColorCode=S.arr[e].ColorCode;break;default:S.colorCode=""}}),i.getItems("myworkorders",S.filter).then(function(e){S.assigments1=e.data.Data,S.assigments=S.assigments1.reverse();for(var t=0;t<S.assigments.length;t++){"Complete"==S.assigments[t].AssignmentStatusName?S.assigments[t].colorCode=S.colorCodes.completeColorCode:"Assigned"==S.assigments[t].AssignmentStatusName?S.assigments[t].colorCode=S.colorCodes.assignedColorCode:"On Hold"==S.assigments[t].AssignmentStatusName?S.assigments[t].colorCode=S.colorCodes.onholdColorCode:"Open"==S.assigments[t].AssignmentStatusName?S.assigments[t].colorCode=S.colorCodes.openColorCode:"Incomplete"==S.assigments[t].AssignmentStatusName?S.assigments[t].colorCode=S.colorCodes.incompleteColorCode:"Started"==S.assigments[t].AssignmentStatusName?S.assigments[t].colorCode=S.colorCodes.startedColorCode:"Traveling"==S.assigments[t].AssignmentStatusName?S.assigments[t].colorCode=S.colorCodes.travelingColorCode:"Suspended"==S.assigments[t].AssignmentStatusName?S.assigments[t].colorCode=S.colorCodes.suspendedColorCode:"Parts Arrived"==S.assigments[t].AssignmentStatusName?S.assigments[t].colorCode=S.colorCodes.partsArrivedColorCode:"Parts on Order"==S.assigments[t].AssignmentStatusName?S.assigments[t].colorCode=S.colorCodes.partsOnOrderColorCode:S.assigments[t].colorCode="";var s=S.assigments[t].colorCode;if(S.techIdForAssignment=S.assigments[t].TechId,S.assigments[t].fontColor="#5a1823"==s||"#8b008b"==s||"#a60404"==s||"#8d0303"==s||"#14164a"==s||"#002147"==s||"#4d3382"==s?"#eafbff":"#000000",1==S.isActive?"Traveling"==S.assigments[t].AssignmentStatusName?(S.assigments[t+"_0"]=!0,S.travelButton[t+"_0"]=!0,S.serviceButton[t+"_0"]=!1,S.disableTravelButtons[t+"_0"]=!0,S.disableServiceButtons[t+"_0"]=!0,S.activeType=1,S.i=t,S.getAssignment=S.assigments[t].Id,S.assignmentFilter=l.filter("and"),S.assignmentFilter.eq("AssignmentId",S.getAssignment).eq("EndDate","NULL").eq("TechId",S.techIdForAssignment),i.getItems(S.apiMethod,S.assignmentFilter).then(function(e){S.updateTime=e.data.Data,S.updateTime1=S.updateTime[0].StartDate,S.date=S.updateTime1,1==S.isActive&&1==S.activeType?(S.timerAssignment=S.assigments[S.i],k(S.i,0,null,S.timerAssignment,S.date)):(S.travelButton[t+"_0"]=!1,S.serviceButton[t+"_0"]=!1,S.disableTravelButtons[t+"_0"]=!1,S.disableServiceButtons[t+"_0"]=!1)})):"Started"==S.assigments[t].AssignmentStatusName?(S.assigments[t+"_0"]=!0,S.travelButton[t+"_0"]=!1,S.serviceButton[t+"_0"]=!0,S.disableTravelButtons[t+"_0"]=!0,S.disableServiceButtons[t+"_0"]=!0,S.isActive=!0,S.activeType=2,S.i=t,S.getAssignment=S.assigments[t].Id,S.assignmentFilter=l.filter("and"),S.assignmentFilter.eq("AssignmentId",S.getAssignment).eq("EndDate","NULL").eq("TechId",S.assigments[t].TechId),i.getItems(S.apiMethod,S.assignmentFilter).then(function(e){S.updateTime=e.data.Data,S.updateTime1=S.updateTime[0].StartDate,S.date=S.updateTime1,1==S.isActive&&2==S.activeType?(S.timerAssignment=S.assigments[S.i],k(S.i,0,null,S.timerAssignment,S.date)):(S.travelButton[t+"_0"]=!1,S.serviceButton[t+"_0"]=!1,S.disableTravelButtons[t+"_0"]=!1,S.disableServiceButtons[t+"_0"]=!1)})):(S.travelButton[t+"_0"]=!1,S.serviceButton[t+"_0"]=!1,S.disableTravelButtons[t+"_0"]=!0,S.disableServiceButtons[t+"_0"]=!0):"Complete"==S.assigments[t].AssignmentStatusName?(S.travelButton[t+"_0"]=!1,S.serviceButton[t+"_0"]=!1,S.disableTravelButtons[t+"_0"]=!0,S.disableServiceButtons[t+"_0"]=!0):(S.travelButton[t+"_0"]=!1,S.serviceButton[t+"_0"]=!1,S.disableTravelButtons[t+"_0"]=!1,S.disableServiceButtons[t+"_0"]=!1),null==S.assigments[t].EstStartDate)S.assigments[t].EstStartDate="";else{var o=m.getValue("authorizationData");o&&o.tzDatebaseName&&(S.userTimeZone=moment.tz(o.tzDatebaseName).zoneAbbr());var a=c.parseISOString(S.assigments[t].EstStartDate),n=moment.tz.zone(o.tzDatebaseName).offset(a);S.assigments[t].EstStartDate=c.convertToLocal(a,n)}var r="";if(S.assigments[t].FullAddress)for(var d=S.assigments[t].FullAddress.split(" "),u=0;u<d.length;u++)r+=d[u],u!=d.length-1&&(r+="+");else S.assigments[t].FullAddress="-";S.assigments[t].googleUrl="https://www.google.com/maps/search/?api=1&z=13&query="+r}})}),L()}function L(){var e={};e.fromDate=S.filter1Tmp.fromDate,e.toDate=S.filter1Tmp.toDate,e.statuses=S.statuses,e.search=S.filter.search,e.sortBy=S.filter.sortBy,e.sortReverse=S.sortReverse,e.colapsed=I;var t={};m.getValue("lastselection_"+S.UserData.Id)&&(t=m.getValue("lastselection_"+S.UserData.Id)),t.myAssignments=e,m.setValue("lastselection_"+S.UserData.Id,t)}function M(e){return(e=e<1?0:e)<10&&(e="0"+e),e}function F(e){"Complete"==e.AssignmentStatusName?e.colorCode=S.colorCodes.completeColorCode:"Assigned"==e.AssignmentStatusName?e.colorCode=S.colorCodes.assignedColorCode:"On Hold"==e.AssignmentStatusName?e.colorCode=S.colorCodes.onholdColorCode:"Open"==e.AssignmentStatusName?e.colorCode=S.colorCodes.openColorCode:"Incomplete"==e.AssignmentStatusName?e.colorCode=S.colorCodes.incompleteColorCode:"Started"==e.AssignmentStatusName?e.colorCode=S.colorCodes.startedColorCode:"Traveling"==e.AssignmentStatusName?e.colorCode=S.colorCodes.travelingColorCode:"Suspended"==e.AssignmentStatusName?e.colorCode=S.colorCodes.suspendedColorCode:"Parts Arrived"==e.AssignmentStatusName?e.colorCode=S.colorCodes.partsArrivedColorCode:"Parts on Order"==e.AssignmentStatusName?e.colorCode=S.colorCodes.partsOnOrderColorCode:e.colorCode="";var t=e.colorCode;e.fontColor="#5a1823"==t||"#8b008b"==t||"#a60404"==t||"#8d0303"==t||"#14164a"==t||"#002147"==t||"#4d3382"==t?"#eafbff":"#000000"}function k(e,s,o,a,n){D.getLocation("TR Labor").then(function(r){if(null==n){S.timerModel.StartDate=new Date,S.timerModel.WoId=a.WoId,S.timerModel.CompanyId=a.CompanyId,S.timerModel.TechId=a.TechId,S.timerModel.Date=new Date,S.timerModel.AssignmentId=a.Id;for(var l=0;l<S.assigments.length;l++){if(S.assigments[l+"_0"]=!1,S.travelButton[l+"_0"]=!1,S.serviceButton[l+"_0"]=!1,S.disableTravelButtons[l+"_0"]=!0,S.disableServiceButtons[l+"_0"]=!0,"Traveling"==S.assigments[l].AssignmentStatusName||"Started"==S.assigments[l].AssignmentStatusName){S.assigments[l].Status="Open",S.assigments[l].AssignmentStatusName="Open";var m="woassignments/"+S.assigments[l].Id;S.assigments[l].Latitude=r.coords.latitude,S.assigments[l].Longitude=r.coords.longitude,i.update(m,S.assigments[l]).then(function(e){})}F(S.assigments[l])}S.disableTravelButtons[e+"_0"]=!1}if(null!=n){S.startDateTime2=n;var d=new Date(S.startDateTime2),g=new Date,C=c.convertToLocal(d,g.getTimezoneOffset());A=C.getTime()}else{var v=new Date;A=v.getTime()}if(z(),1==o){S.disableServiceButtons[e+"_0"]=!0,a.Status="Traveling",a.AssignmentStatusName="Traveling",F(a);m="woassignments/"+S.timerModel.AssignmentId;a.Latitude=r.coords.latitude,a.Longitude=r.coords.longitude,i.update(m,a).then(function(e){S.timerModel.Latitude=r.coords.latitude,S.timerModel.Longitude=r.coords.longitude,i.create(S.apiMethod,S.timerModel).then(function(e){S.assignmentFilter={AssignmentId:S.timerModel.AssignmentId,AssignmentStatus:a.Status},i.create("woassignments/sendAssignmentStatusNotification",S.assignmentFilter).then(function(e){200==e.status&&u.success("Customer notification has been sent.")})})}),f(function(){S.assigments[e+"_"+s]=!0,S.travelButton[e+"_"+s]=!0,t.$apply()},0)}else if(2==o){S.disableTravelButtons[e+"_0"]=!0,a.Status="Started",a.AssignmentStatusName="Started",F(a);m="woassignments/"+S.timerModel.AssignmentId;a.Latitude=r.coords.latitude,a.Longitude=r.coords.longitude,i.update(m,a).then(function(e){S.timerModel.Latitude=r.coords.latitude,S.timerModel.Longitude=r.coords.longitude,i.create(S.apiMethod,S.timerModel).then(function(e){})}),f(function(){S.assigments[e+"_"+s]=!0,S.serviceButton[e+"_"+s]=!0,t.$apply()},0)}S.viewName=t.vm.viewName,S.moduleName="Labor"})}S.sortReverse=!0,S.sortAsc=function(){S.sortReverse=!1,S.filter.sortReverse=!1},S.sortDesc=function(){S.sortReverse=!0,S.filter.sortReverse=!0},t.$watch("vm.filter.toDate",function(){var e=c.parseISOString(S.filter.toDate);c.buildISOString(e),S.filter1Tmp.toDate=c.convertToLocal(e)}),t.$watch("vm.filter.fromDate",function(){var e=c.parseISOString(S.filter.fromDate);c.buildISOString(e),S.filter1Tmp.fromDate=c.convertToLocal(e)}),S.toggleColapseSearch=function(){I=!I,L()};var U=m.getValue("authorizationData");function z(){var s,o,a,n,r=new Date;h=r.getTime(),n=Math.floor((h-A)/1e3),s=M(Math.floor(n/3600)),n=Math.floor(n%3600),o=M(Math.floor(n/60)),n=Math.floor(n%60),a=M(Math.floor(n)),t.timer=s+":"+o+":"+a,e=f(function(){z()},500)}U&&U.tzDatebaseName&&(S.userTimeZone=moment.tz(U.tzDatebaseName).zoneAbbr());var q=(new Date).getTime();$(document.body).bind("mousemove keypress",function(e){q=(new Date).getTime()}),setTimeout(function e(){(new Date).getTime()-q>=6e5?window.location.reload(!0):setTimeout(e,1e4)},1e4)}angular.module("FieldConnectApp").controller("MyWorkOrderController",t),t.$inject=["$scope","ModalService","$location","$window","$state","$stateParams","restService","qsService","cryptoStorageService","stateTransitionService","timezoneService","Notification","currentUserService","$timeout","deviceDetector","featuresFactory","currentCompanyService","fcGeoLocationService"]}();;!function(){"use strict";function e(e,t,o,a,r,s,l,m,d,i,n,u,c,S,p,C,I,T,b){var h=this;h.$state=o,h.selectCustomer=R,h.selectSite=F,h.servItemPage=function(){0==h.customer.customerId&&null==h.model.ServiceableItemId?l.warning({message:"First you must select customer and serviceable item"}):0==h.customer.customerId?l.warning({message:"First you must select customer"}):null==h.model.ServiceableItemId?l.warning({message:"First you must select serviceable item"}):o.go("serviceableItemsEdit",{customerId:h.customer.customerId,id:h.model.ServiceableItemId})},h.woNumber=0,h.woAltNumber=0,h.customerId=0,h.woAssignmentId=0,h.getCustomer=function(t){s.getItem("customers/",t).then(function(t){var o=t.data;o.CreditHold?bootbox.confirm("The customer "+o.CustomerName+" is on credit hold!",function(t){u(function(){t?(h.customer.customerId=o.Id,h.customer.customerName=o.CustomerName,h.customer.customerCode=o.CustomerCode,h.customer.currencyCode=o.CurrencyCode,h.customer.paymentTermId=o.PaymentTermId):(h.model.SiteId="",h.model.SiteName="",h.site.siteId=0,h.customer.currencyCode=null,h.customer.paymentTermId=null),e.$apply()})}):(h.customer.customerId=o.Id,h.customer.customerName=o.CustomerName,h.customer.customerCode=o.CustomerCode,h.customer.currencyCode=o.CurrencyCode,h.customer.paymentTermId=o.PaymentTermId)})};h.submit=function(){h.submittingNewWo=!0,h.disableSubmit=!0,N&&N.tzDatebaseName&&(h.tzName=N.tzDatebaseName,h.userTimeZone=moment.tz(h.tzName).zoneAbbr());var e=angular.copy(h.model),t=moment.tz.zone(N.tzDatebaseName).offset(o);if(e.RequestDate){var o=new Date(e.RequestDate);i.convertToUtc(o,t),e.RequestDate=i.buildISOString(o)}if(e.PromiseDate){var a=new Date(e.PromiseDate);i.convertToUtc(a,t),e.PromiseDate=i.buildISOString(a)}if(e.EstStartDate){var r=new Date(e.EstStartDate);i.convertToUtc(r,t),e.EstStartDate=i.buildISOString(r)}if(e.EstEndDate){var l=new Date(e.EstEndDate);i.convertToUtc(l,t),e.EstEndDate=i.buildISOString(l)}h.isServiceRequest&&h.serviceRequestId&&(h.isAdmin||h.isFieldConnect||h.isDispatch)?s.create("wo/servicerequest",e).then(function(e){x(e.data),h.submittingNewWo=!1,h.disableSubmit=!1}):s.create(h.woAPI,e).then(function(e){x(e.data),h.submittingNewWo=!1,h.disableSubmit=!1})},h.back=function(){h.isServiceRequest&&h.serviceRequestId&&(h.isAdmin||h.isFieldConnect||h.isDispatch)?h.$state.go("processServiceRequest"):h.isAdmin||h.isFieldConnect?h.$state.go("manageWorkOrders"):h.isDispatch?h.$state.go("dispatchCalendar"):h.isTechnician&&h.$state.go("myWorkOrders")},h.viewName="NewWorkOrder",h.moduleName="NewWorkOrder",h.model={},h.submitText="Submit",h.searchCustomer="",h.searchSite="",h.submittingNewWo=!1,h.disableSubmit=!1;I.getLocation("NewWorkOrder").then(function(e){var t=e.coords.latitude,o=e.coords.longitude;null!==t&&(h.model.Latitude=t),null!==o&&(h.model.Longitude=o)}),T.getCompanySettings().then(function(e){h.attPromised.ShowDefaultDate=T.DefaultPromiseDateToToday,h.attDescription.MaxLength=T.WODescMaxLength,function(){var e=[f,P,v,L,h.attLine1,h.attDescription,h.attLine2,h.attRequestedBy,h.attBlank1,h.attName,h.attRequestDate,h.attPhone,h.siteAddress,h.attCurrencyCode,h.attPaymentTerm,h.attLine3,h.attOffice,h.attWorkOrderType,h.attAgreement,h.attRateSheet,h.attProject,h.attCustomerPONumber,h.attStatus,h.attPromised,h.attPriority,h.attSalesPerson,h.attWoPaymentTerm,h.attLeadSource,h.attLine4,h.attSafetyHealth,h.attWarranty,h.attLine5,h.attAssignmentHeader,h.attBlank3,h.attAssignProblemCode,h.attAssignEstStartDate,h.attAssignDescription,h.attAssignEstEndDate,h.attAssignServiceableItem,h.attAssignEstHours,h.techDropDown,A,h.attAssignStatus];if(h.showForm=!1,h.usingDSLNorthwest){h.attDSLFailureResolution={Type:"dropdown",Label:"Reason for Failed Install:",ApiMethod:"dslFailureResolution/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"AssignmentUser8",ConvertToInt:"true",TabIndex:41},h.attDSLGroundCheck={Type:"checkbox",Label:"Ground Check",Required:!1,ModelValue:"AssignmentUser4"},h.attDSLLine1={Type:"line",CustomClass:"col-sm-12"},h.attDSLWoExportHeader={Type:"text",Label:"WO Export",ModelValue:"",CustomInputClass:"hidden"},h.attDSLBlank1={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},h.attDSLUnitDown={Type:"checkbox",Label:"Unit Down",ModelValue:"woeUnitDown",TabIndex:17},h.attDSLRewritePartsReceived={Type:"dropdown",Label:"Rewrite Parts Received:",Required:!1,ApiMethod:"dslPartsReceived/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"woeRewritePartsReceived",TabIndex:18},h.attDSLIsUnitReplaceAnother={Type:"checkbox",Label:"Is Unit Replace Another",ModelValue:"woeIsUnitReplaceAnother",TabIndex:17},h.attDSLRecallDueTo={Type:"dropdown",Label:"Recall Due To:",Required:!1,ApiMethod:"dslRecallDueTo/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"woeRecallDueTo",TabIndex:18},h.attDSLFieldScrapFlag={Type:"checkbox",Label:"Field Scrap Flag",ModelValue:"woeFieldScrapFlag",TabIndex:17},h.attDSLProcessPracticeFlag={Type:"checkbox",Label:"Process/Practice Flag",ModelValue:"woeProcessPracticeFlag",TabIndex:17},h.attDSLUnitOperAtDepartureFlag={Type:"checkbox",Label:"Unit Oper. at Departure",ModelValue:"woeUnitOperAtDeparture",TabIndex:17},h.attDSLBulletinNumber={Type:"text",Label:"Bulletin Number:",Required:!1,MaxLength:"20",ModelValue:"woeBulletinNumber",TabIndex:5},h.attDSLQualityReportFlag={Type:"checkbox",Label:"Quality Report Flag",ModelValue:"woeQualityReportFlag",TabIndex:17},h.attDSLCertificationNumber={Type:"text",Label:"Certification Number:",Required:!1,MaxLength:"20",ModelValue:"woeCertificationNumber",TabIndex:5},h.attDSLPreviousUnitFieldSerialNumber={Type:"text",Label:"Previous Unit Field Serial No.:",Required:!1,MaxLength:"20",ModelValue:"woePreviousUnitFieldSerialNumber",TabIndex:5},h.attDSLPurchasedFromDistributor={Type:"dropdown",Label:"Purchased From Distributor:",Required:!1,ApiMethod:"dslDistributor/ddList",ValueProp:"Id",TextProp:"Name",ModelValue:"woePurchasedFromDistributor",TabIndex:18},h.DSLServiceZoneCode={Type:"dropdown",Label:"Service Zone Code:",ApiMethod:"dslServiceZoneCode/ddList",ValueProp:"Id",TextProp:"Code",ModelValue:"CustomerUser8",ConvertToInt:"true",ReadOnly:!0},h.attDSLLine2={Type:"line",CustomClass:"col-sm-12"},h.attDSLRewrite={Type:"checkbox",Label:"Rewrite",ModelValue:"User4",TabIndex:17},h.attDSLRecall={Type:"checkbox",Label:"Recall",ModelValue:"User5",TabIndex:17},h.attDSLFactoryServiceOrderType={Type:"dropdown",Label:"Factory Service Order Type:",ApiMethod:"dslServiceOrderType/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"User8",ConvertToInt:"true"},h.attDSLVisits={Type:"text",Label:"Visits:",ModelValue:"DSLVisits",ReadOnly:!0},h.attDSLAuthorizedBy={Type:"text",Label:"Authorized By:",Required:!1,MaxLength:"20",ModelValue:"User0",TabIndex:5},h.attDSLAdditionalDetailsHeader={Type:"text",Label:"Additional Details",ModelValue:"",CustomInputClass:"hidden"},h.attDSLLine3={Type:"line",CustomClass:"col-sm-12"},h.attDSLLine4={Type:"line",CustomClass:"col-sm-12"},h.attDSLBlank2={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},h.attDSLBlank3={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},h.woAPI="wo/dsl",h.attAssignServiceableItem.ApiMethod="serviceableitems/dsldropdownbysite",h.attAssignServiceableItem.TextProp="DDLabel",h.attAssignServiceableItem.Filter=h.dslServiceableItemFilter,h.attAssignServiceableItem.Required=h.isTechnician;var t=[f,P,v,L,h.attLine1,h.attDescription,h.attLine2,h.attRequestedBy,h.attBlank1,h.attName,h.attRequestDate,h.attPhone,h.siteAddress,h.attCurrencyCode,h.attPaymentTerm,h.attLine3,h.attOffice,h.attWorkOrderType,h.attAgreement,h.attRateSheet,h.attProject,h.attCustomerPONumber,h.attStatus,h.attPromised,h.attPriority,h.attSalesPerson,h.attWoPaymentTerm,h.attLeadSource,h.attLine4,h.attSafetyHealth,h.attWarranty,h.attLine5,h.attAssignmentHeader,h.attBlank3,h.attAssignProblemCode,h.attAssignEstStartDate,h.attAssignDescription,h.attAssignEstEndDate,h.attAssignServiceableItem,h.attAssignEstHours,h.techDropDown,A,h.attAssignStatus,h.attDSLFailureResolution,h.attDSLGroundCheck,h.attDSLLine1,h.attDSLAdditionalDetailsHeader,h.attDSLBlank1,h.attDSLRewrite,h.attDSLRecall,h.attDSLFactoryServiceOrderType,h.attDSLVisits,h.attDSLAuthorizedBy,h.DSLServiceZoneCode,h.attDSLLine4,h.attDSLWoExportHeader,h.attDSLBlank2,h.attDSLUnitDown,h.attDSLRewritePartsReceived,h.attDSLIsUnitReplaceAnother,h.attDSLRecallDueTo,h.attDSLFieldScrapFlag,h.attDSLProcessPracticeFlag,h.attDSLUnitOperAtDepartureFlag,h.attDSLBulletinNumber,h.attDSLQualityReportFlag,h.attDSLCertificationNumber,h.attDSLPreviousUnitFieldSerialNumber,h.attDSLPurchasedFromDistributor];h.attributes=t,h.usingDSLNorthwest=!0}else h.woAPI="wo",h.attributes=e;h.showForm=!0}()}),h.customer={customerId:0},h.customers=[],h.site={siteId:0},h.id=a.id,h.companyWoStatus={},h.companyAssignmentStatus={},h.priority={},h.customerHasError=!1,h.siteHasError=!1,h.serviceableItemFilter={siteId:null};new Date;h.isTechnician=!1,h.isAdmin=!1,h.isFieldConnect=!1,h.isDispatch=!1,h.isSupervisor=!1,h.model.TzDatabaseName=null;s.getItem("timezones/forCurrentUser").then(function(e){e.data}),h.WOTimezone={TzDatabaseName:"%TzDatabaseName%"};for(var D=n.getValue("authorizationData").userRoles.split(","),y=p.roleTypes,g=0;g<D.length;g++)"Admin"===D[g]||"Office"===D[g]||"TransAdmin"===D[g]?h.isAdmin=!0:"FieldConnect"===D[g]?h.isFieldConnect=!0:"Technician"===y[g]?h.isTechnician=!0:"Dispatch"===D[g]?h.isDispatch=!0:"Supervisor"===D[g]&&(h.isSupervisor=!0);h.usingDSLNorthwest=C.usingDSLNorthwest,h.usingDSLNorthwest&&(h.dslServiceableItemFilter=d.filter("and"));var N=n.getValue("authorizationData");h.customerFilter=d.filter("and"),h.customerSiteFilter=d.filter("and"),h.prepareNewWorkorder=x,h.isServiceRequest=!1,h.params=t.$$search,h.params.isServiceRequest&&(h.isServiceRequest=JSON.parse(h.params.isServiceRequest.trim().toLowerCase()),t.search({})),h.serviceRequestId=h.params.serviceRequestId,h.searchColsCustomer=["CustomerName","CustomerCode","ContactAddress","FullName"],h.searchColsSite=["Search"],h.siteAutocompleteFilter=d.filter("or"),h.ddlgridattrsCustomer=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0,CellFormat:"label"},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"ContactAddress",Sortable:!0,CellFormat:"label"}],h.ddlgridattrsSite=[{Name:"Customer",ValueName:"CustomerName",Sortable:!0,CellFormat:"label"},{Name:"Site Code",ValueName:"SiteCode",Sortable:!0,CellFormat:"label"},{Name:"Site Name",ValueName:"SiteName",Sortable:!0,CellFormat:"label"},{Name:"Address",ValueName:"FullAddress",Sortable:!0,CellFormat:"label"}];var f={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:w,SearchTrigger:1,Label:"Customer:",Required:!0,ApiMethod:"customers/active",ModelValue:"CustomerName",Id:"CustomerName",GridAttributes:h.ddlgridattrsCustomer,PageSize:22,SearchCols:h.searchColsCustomer,Autofocus:"true",TabIndex:1,ObjectName:"btnCustomerSearch"},v={Type:"dropdowngrid",FocusOut:!0,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5",ReadOnly:!1,ShowHeader:!0,onSelect:M,SearchTrigger:1,Label:"Site:",Required:!0,ApiMethod:"sites/searchgrid",ModelValue:"SiteName",filter:h.siteAutocompleteFilter,Id:"SiteName",GridAttributes:h.ddlgridattrsSite,PageSize:22,SearchCols:h.searchColsSite,TabIndex:2,ObjectName:"btnSiteSearch"};h.techDropDown={Type:"dropdown",Label:"Technician:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"AssignmentTechId",ConvertToInt:"true",TabIndex:21,CustomDivClass:"col-sm-4",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-5 custom-input-assignment"};var L={Type:"button",Label:"Search",onClick:F,ReadOnly:!1,ObjectName:"btnSiteSearch"},P={Type:"button",Label:"Search",onClick:R,ObjectName:"btnCustomerSearch"};h.maxLength=10;var A={Type:"button",Label:"Filter Tech",onClick:function(){r.showModal({templateUrl:"Templates/Dispatch/DispatchScheduling/techpopup.html",controller:"PopupTechController",controllerAs:"vm",inputs:{modalTitle:"Tech List",startDateTime:h.model.EstStartDate,endDateTime:h.model.EstEndDate,attributes:h.attech,timezone:h.assignmentsTimezone,apiMethod:"woassignments",model:h.model}}).then(function(e){e.close.then(function(){h.reloadTable=!1,u(function(){h.reloadTable=!0})})})},CustomDivClass:"col-sm-3 custom-button-assignment"};function w(t){t.CreditHold?bootbox.confirm("The customer "+t.CustomerName+" is on credit hold!",function(o){u(function(){o?(t.CustomerCode&&""!=t.CustomerCode?h.model.CustomerName=t.CustomerCode+" - "+t.CustomerName:h.model.CustomerName=t.CustomerName,h.CustomerNameTemp=h.model.CustomerName,h.model.CustomerId=t.Id,h.model.CurrencyCode=t.CurrencyCode,h.model.PaymentTermId=t.PaymentTermId,h.model.SiteId=null,h.model.SiteName=null,h.SiteNameTemp=null,b.getDefaultSite(t.Id).then(function(e){null!==e&&M(e)})):(h.model.CustomerName=null,h.CustomerNameTemp=null,h.model.CustomerId=null,h.model.SiteId=null,h.model.SiteName=null,h.SiteNameTemp=null),e.$apply()})}):(t.CustomerCode&&""!=t.CustomerCode?h.model.CustomerName=t.CustomerCode+" - "+t.CustomerName:h.model.CustomerName=t.CustomerName,h.CustomerNameTemp=h.model.CustomerName,h.model.CustomerId=t.Id,h.model.CurrencyCode=t.CurrencyCode,h.model.PaymentTermId=t.PaymentTermId,h.model.SiteId=null,h.model.SiteName=null,h.SiteNameTemp=null,h.model.CustomerUser8=t.User8,b.getDefaultSite(t.Id).then(function(e){null!==e&&M(e)}),u(function(){document.querySelector("#SiteNameinput").focus()}))}function M(t){t.SiteCode&&""!=t.SiteCode?h.model.SiteName=t.SiteCode+" - "+t.SiteName:h.model.SiteName=t.SiteName,u(function(){document.getElementsByName("Desc")[0].focus()}),h.SiteNameTemp=h.model.SiteName,h.model.SiteId=t.Id,h.model.ContactName=t.ContactName,h.model.ContactPhone=t.Phone,h.model.SiteAddress=t.FullAddress,h.isTechnician?(h.model.AssignmentTechId=h.currentTechId,h.model.TechId=h.currentTechId):(h.model.AssignmentTechId=t.DefaultTechId,h.model.TechId=t.DefaultTechId),h.model.RateSheetId=t.RateSheetId,h.serviceableItemFilter.siteId=t.Id,h.model.OfficeId=t.OfficeId,h.model.SalesPersonId=t.SalesPersonId,h.usingDSLNorthwest&&(h.dslServiceableItemFilter.reset(),h.dslServiceableItemFilter.eq("SiteId",t.Id)),N&&N.tzDatebaseName&&(h.tzName=N.tzDatebaseName,h.userTimeZone=moment.tz(h.tzName).zoneAbbr()),s.getItem("sites/",t.Id).then(function(t){var o=t.data;o.TimeZoneId?s.getItem("timezones/",o.TimeZoneId).then(function(e){h.model.TzDatabaseName=N.tzDatebaseName}):h.model.OfficeId?s.getItem("offices/",h.model.OfficeId).then(function(e){var t=e.data;t.TimeZoneId?s.getItem("timezones/",t.TimeZoneId).then(function(e){h.model.TzDatabaseName=N.tzDatebaseNamee}):h.model.TzDatabaseName=N.tzDatebaseName}):h.model.TzDatabaseName=N.tzDatebaseName,(!h.model.CustomerId||0===h.model.CustomerId&&o.CustomerId)&&s.getItem("customers/",o.CustomerId).then(function(t){var o=t.data;o.CreditHold?bootbox.confirm("The customer "+o.CustomerName+" is on credit hold!",function(t){u(function(){t?(h.model.CustomerId=o.Id,o.CustomerCode&&""!=o.CustomerCode?h.model.CustomerName=o.CustomerCode+" - "+o.CustomerName:h.model.CustomerName=o.CustomerName,h.CustomerNameTemp=h.model.CustomerName):(h.model.SiteName=null,h.SiteNameTemp=null,h.model.SiteId=null,h.model.ContactName=null,h.model.ContactPhone=null,h.model.TechId=null,h.model.RateSheetId=null,h.serviceableItemFilter.siteId=null,h.model.OfficeId=null),e.$apply()})}):(h.model.CustomerId=o.Id,o.CustomerCode&&""!=o.CustomerCode?h.model.CustomerName=o.CustomerCode+" - "+o.CustomerName:h.model.CustomerName=o.CustomerName,h.CustomerNameTemp=h.model.CustomerName)})})}function R(){var e="";h.model.CustomerId?e=angular.copy(h.model.CustomerName):h.CustomerNameTemp&&(e=angular.copy(h.CustomerNameTemp),h.CustomerNameTemp=""),r.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectCustomer.html",controller:"SelectCustomerController",controllerAs:"vm",inputs:{customer:h.customer,viewName:h.viewName,customerName:e,onSelect:w}})}function F(){var e="";h.model.SiteId?e=angular.copy(h.model.SiteName):h.SiteNameTemp&&(e=angular.copy(h.SiteNameTemp),h.SiteNameTemp=""),r.showModal({templateUrl:"Templates/WorkOrder/NewWorkOrder/selectSite.html",controller:"SelectSiteController",controllerAs:"vm",inputs:{site:h.site,customerId:h.model.CustomerId,customerUserSitesFilter:h.customerUserSitesFilter,viewName:h.viewName,siteName:e,onSelect:M}})}function x(o){o?(l.success({message:"Work order has been successfully created."}),o.Wo.ServiceRequestId?bootbox.confirm({message:"WO "+o.Wo.AltId+" was created. Do you want to see WO details?",buttons:{confirm:{label:"Yes",className:"btn-primary"},cancel:{label:"No",className:"btn-default"}},callback:function(a){a?(t.search({}),E(o,!0)):h.$state.go("processServiceRequest"),u(function(){e.$apply()})}}):E(o,!1)):h.$state.go("manageWorkOrders")}function E(e,t){m.scrollTo(0,0),e.Wo.Id>0&&(h.woNumber=e.Wo.Id,h.woAltNumber=e.Wo.AltId,h.woAssignmentId=e.Assignment.Id,h.model.Desc="");for(var o=0;o<e.ActionResults.length;o++)-1==e.ActionResults[o].Result?l.error({message:e.ActionResults[o].Message}):0==e.ActionResults[o].Result?l.warning({message:e.ActionResults[o].Message}):1==e.ActionResults[o].Result&&l.success({message:e.ActionResults[o].Message});t&&h.$state.go("workOrdersDetails",{id:h.woNumber})}h.attLine1={Type:"line",CustomClass:"col-sm-12"},h.attDescription={Type:"textarea",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Desc",Id:"Desc",TabIndex:3},h.attLine2={Type:"line",CustomClass:"col-sm-12"},h.attRequestedBy={Type:"text",Label:"Requested By",ModelValue:"",CustomInputClass:"hidden"},h.attBlank1={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},h.attName={Type:"text",Label:"Name:",Required:!1,MaxLength:"100",ModelValue:"ContactName",TabIndex:4},h.attRequestDate={Type:"datepicker",Label:"Request Date:",ModelValue:"RequestDate",Format:"MM/dd/yyyy",TabIndex:6},h.attPhone={Type:"text",Label:"Phone:",Required:!1,MaxLength:"20",ModelValue:"ContactPhone",TabIndex:5},h.attRequestTime={Type:"hidden",ModelValue:"RequestTime"},h.attCurrencyCode={Type:"hidden",ModelValue:"CurrencyCode"},h.attPaymentTerm={Type:"hidden",ModelValue:"PaymentTermId"},h.attLine3={Type:"line",CustomClass:"col-sm-12"},h.attOffice={Type:"dropdown",Label:"Office:",Required:!0,ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true",ObjectName:"ddlWoOffice",TabIndex:7},h.attWorkOrderType={Type:"dropdown",Label:"Work Order Type:",Required:!0,ApiMethod:"wotypes",ValueProp:"WoTypeName",TextProp:"WoTypeName",ModelValue:"WoType",ObjectName:"ddlWoTypeDropdown",TabIndex:13},h.attAgreement={Type:"dropdown",Label:"Agreement:",ApiMethod:"agreementsites/getcustomeragreementsite",ValueProp:"AgreementId",TextProp:"Desc",ModelValue:"AgreementId",ConvertToInt:"true",Filter:h.customerSiteFilter,ObjectName:"ddlWoAgreement",TabIndex:8},h.attRateSheet={Type:"dropdown",Label:"Rate Sheet:",Required:!0,ApiMethod:"ratesheets",ValueProp:"Id",TextProp:"RateSheetName",ModelValue:"RateSheetId",ConvertToInt:"true",ObjectName:"ddlWoRateSheet",TabIndex:14},h.attProject={Type:"dropdown",Label:"Project:",Required:!1,ApiMethod:"projects/getProjectForWo",ValueProp:"Id",TextProp:"ProjectName",ModelValue:"ProjectId",ConvertToInt:"true",Filter:h.customerSiteFilter,ObjectName:"ddlWoProject",TabIndex:9},h.attCustomerPONumber={Type:"text",Label:"Customer PO Number:",Required:!1,MaxLength:"50",ModelValue:"CustomerPONum",TabIndex:15},h.attStatus={Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"wostatuses",ValueProp:"WoStatusName",TextProp:"WoStatusName",ModelValue:"Status",ObjectName:"ddlStatusDropdown",TabIndex:10},h.attPromised={Type:"datepicker",Label:"Promised:",ModelValue:"PromiseDate",Format:"MM/dd/yyyy",Required:!0,TabIndex:16,ShowDefaultDate:!0},h.attPriority={Type:"dropdown",Label:"Priority:",Required:!0,ApiMethod:"priorities",ValueProp:"PriorityName",TextProp:"PriorityName",ModelValue:"Priority",ObjectName:"ddlWoPriority",TabIndex:11},h.attSalesPerson={Type:"dropdown",Label:"Salesperson:",ApiMethod:"employees/getSalesPersonList",ValueProp:"Id",TextProp:"FullName",ModelValue:"SalesPersonId",ConvertToInt:"true",TabIndex:12},h.attBlank2={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},h.attLeadSource={Type:"dropdown",Label:"Lead Source:",ApiMethod:"leadSource/ddList",ValueProp:"Id",TextProp:"DdlLabel",ModelValue:"LeadSourceId",ConvertToInt:"true",TabIndex:13},h.attLine4={Type:"line",CustomClass:"col-sm-12"},h.attSafetyHealth={Type:"checkbox",Label:"Safety/Health",ModelValue:"Safety",TabIndex:12},h.attWarranty={Type:"checkbox",Label:"Warranty",ModelValue:"Warranty",TabIndex:17},h.attLine5={Type:"line",CustomClass:"col-sm-12"},h.attAssignmentHeader={Type:"text",Label:"Assignment",ModelValue:"",CustomInputClass:"hidden"},h.attBlank3={Type:"empty",CustomClass:"fc-empty-control col-sm-6"},h.attAssignProblemCode={Type:"dropdown",Label:"Problem Code:",Required:!0,ApiMethod:"problemcodes",ValueProp:"ProblemCodeName",TextProp:"ProblemCodeName",ModelValue:"AssignmentProblemCode",TabIndex:18},h.attAssignEstStartDate={Type:"datepicker",Label:"Scheduled Start:",ModelValue:"EstStartDate",Format:"MM/dd/yyyy",TabIndex:22},h.attAssignDescription={Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"AssignmentDesc",TabIndex:19},h.attAssignEstEndDate={Type:"datepicker",Label:"Scheduled End:",ModelValue:"EstEndDate",Format:"MM/dd/yyyy",TabIndex:23},h.attAssignServiceableItem={Type:"dropdown",Label:"Serviceable Item:",Silent:!0,ApiMethod:"serviceableitems/dropdownbysite",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",Filter:h.serviceableItemFilter,TabIndex:20},h.attAssignEstHours={Type:"decimal",Label:"Estimated Hours:",Required:!1,ModelValue:"EstHours",Step:"0.25",TabIndex:24},h.attAssignStatus={Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"assignmentstatuses/ddList",ValueProp:"AssignmentStatusName",TextProp:"AssignmentStatusName",ModelValue:"AssignmentStatus",TabIndex:25},h.attWoPaymentTerm={Type:"dropdown",Label:"Payment Term:",Required:!1,ApiMethod:"paymentTerms",ValueProp:"Id",TextProp:"PaymentTermName",ModelValue:"PaymentTermId",ConvertToInt:"true",ObjectName:"ddlWoPaymentTerm"},h.siteAddress={Type:"text",Label:"Address:",Required:!1,MaxLength:"100",ModelValue:"SiteAddress",ReadOnly:!0},e.$on("CustomerNameSearching",function(e,t){h.model.CustomerId=null,h.model.SiteId=null,h.model.SiteName=null,h.SiteNameTemp=null}),e.$on("SiteNameSearching",function(e,t){h.model.SiteId=null}),h.focusOut=function(e){e&&e.hasOwnProperty("FocusOut")&&e.FocusOut&&("CustomerName"===e.ModelValue&&(h.CustomerNameTemp=angular.copy(h.model.CustomerName),null==h.model.CustomerId&&(h.model.CustomerName=null)),"SiteName"===e.ModelValue&&(h.SiteNameTemp=angular.copy(h.model.SiteName),null==h.model.SiteId&&(h.model.SiteName=null)))},h.loadingIndicator=!1,h.companySettingsFilter=d.filter("or"),h.companySettingsFilter.eq("Name","WOStatus").eq("Name","AssignmentStatus").eq("Name","Priority"),s.getItems("companysettings",h.companySettingsFilter).then(function(e){for(var t=e.data.Data,o=0;o<t.length;o++)"WOStatus"===t[o].Name&&(h.model.Status=t[o].Value),"AssignmentStatus"===t[o].Name&&(h.model.AssignmentStatus=t[o].Value),"Priority"===t[o].Name&&(h.model.Priority=t[o].Value)}),s.getItems("wotypes").then(function(){h.woTypes=s.state.items;for(var e=0;e<h.woTypes.length;e++)h.woTypes[e].Default&&(h.model.WoType=h.woTypes[e].WoTypeName)}),h.customerUserSitesFilter=d.filter("and"),h.isServiceRequest&&h.serviceRequestId&&(h.isAdmin||h.isFieldConnect||h.isDispatch)&&(P.ReadOnly=!0,h.submitText="Create",s.getItem("servicerequests",h.serviceRequestId).then(function(e){var t=e.data;h.model.CustomerId=t.CustomerId,s.getItem("customers",h.model.CustomerId).then(function(e){e.data.CustomerCode&&""!=e.data.CustomerCode?(h.model.CustomerName=e.data.CustomerCode+" - "+e.data.CustomerName,h.customer.customerCode=e.data.CustomerCode,h.customer.customerName=e.data.CustomerName,h.customer.currencyCode=e.data.CurrencyCode,h.customer.PaymentTermId=e.data.PaymentTermId):(h.model.CustomerName=e.data.CustomerName,h.customer.customerName=e.data.CustomerName),h.customer.customerId=h.model.CustomerId,L.ReadOnly=!1,h.model.ServiceRequestId=h.serviceRequestId,h.model.ServiceableItemId=t.ServiceableItemId,h.model.Desc=t.Desc,h.model.ContactName=t.Name,h.model.ContactPhone=t.Phone,h.model.SiteId=t.SiteId,s.getItem("sites",h.model.SiteId).then(function(e){var o=e.data;if(o.SiteCode&&""!=o.SiteCode?h.model.SiteName=o.SiteCode+" - "+o.SiteName:h.model.SiteName=o.SiteName,o.TimeZoneId)s.getItem("timezones/",o.TimeZoneId).then(function(e){var o=e.data;h.model.UtcOffset=o.UTCOffset,h.model.TzDatabaseName=N.tzDatebaseName;var a=new Date(t.NeedByDate),r=moment.tz.zone(h.model.TzDatabaseName).offset(a);h.model.RequestDate=i.convertToLocal(a,r)});else{var a=new Date(t.NeedByDate);h.model.RequestDate=i.convertToLocal(a)}h.isTechnician||(h.model.TechId=o.techId),h.model.RateSheetId=o.RateSheetId,h.model.OfficeId=o.OfficeId,h.serviceableItemFilter.siteId=h.model.SiteId,h.customerSiteFilter.reset(),h.customerSiteFilter.eq("CustomerId",h.model.CustomerId).eq("SiteId",h.model.SiteId),h.usingDSLNorthwest&&(h.dslServiceableItemFilter.reset(),h.dslServiceableItemFilter.eq("SiteId",h.model.SiteId))})}),s.getItem("problemcodes",t.ProblemCodeId).then(function(e){var t=e.data;h.model.AssignmentProblemCode=t.ProblemCodeName}),s.getItems("sites").then(function(e){var t=e.data;if(t.length>0){for(var o=[],a=0;a<t.length;a++)o.push(t[a].Id);h.customerUserSitesFilter.eq("Id",o)}}),t.PriorityId&&s.getItem("priorities",t.PriorityId).then(function(e){h.model.Priority=e.data.PriorityName})})),e.$watch("vm.model.RequestDate",function(){if(void 0!==h.model.RequestDate&&(null==h.model.RequestDate||""==h.model.RequestDate)){var e=new Date;e=i.convertToUtc(e,e.getTimezoneOffset()),i.convertToLocal(e);var t=(e.getHours()+24)%24,o=e.getMinutes(),a=15*Math.floor(o/15);(a+=15)>=60&&(a="00",t+=1),e.setHours(t),e.setMinutes(a),h.model.RequestDate=e}}),e.$watch("vm.model.SiteId",function(){h.model.SiteId?(h.customerSiteFilter.reset(),h.customerSiteFilter.eq("CustomerId",h.model.CustomerId),h.customerSiteFilter.eq("SiteId",h.model.SiteId),h.usingDSLNorthwest&&S.getVisits(h.model.SiteId).then(function(e){h.model.DSLVisits=e})):(h.customerSiteFilter.reset(),h.customerSiteFilter.eq("CustomerId",0),h.model.SiteAddress=null)}),e.$watch("vm.model.CustomerId",function(){h.siteAutocompleteFilter.reset(),h.model.CustomerId?(h.customerFilter.reset(),h.customerFilter.eq("Status","Active"),h.customerFilter.customerId=h.model.CustomerId,h.model.SiteId&&(h.customerSiteFilter.reset(),h.customerSiteFilter.eq("CustomerId",h.model.CustomerId),h.customerSiteFilter.eq("SiteId",h.model.SiteId)),h.siteAutocompleteFilter.reset(),h.siteAutocompleteFilter.eq("CustomerId",h.model.CustomerId)):(h.customerFilter.reset(),h.customerFilter.eq("Status","Active"),h.customerFilter.customerId=0)});var V=[];if(s.getItems("problemcodes").then(function(){V=s.state.items}),e.$watch("vm.model.EstStartDate",function(){if(null!=h.model.EstStartDate||void 0!=h.model.EstStartDate){if(null!=h.model.EstHours){var e=new Date(h.model.EstStartDate),t=Math.floor(h.model.EstHours),o=Math.round(100*(h.model.EstHours-t)),a=t,r=Math.round(60*o/100);e.setMinutes(e.getMinutes()+r),e.setHours(e.getHours()+a),h.model.EstEndDate=e}else if(null!=h.model.EstEndDate){if(h.model.EstEndDate<h.model.EstStartDate)return h.model.EstEndDate=h.model.EstStartDate,void l.error("The scheduled start can’t be after scheduled end!");var s=moment(h.model.EstStartDate).format(),m=moment(h.model.EstEndDate).format(),d=moment.duration(moment(m).diff(s)),i=(moment.parseZone(m).utcOffset()-moment.parseZone(s).utcOffset())/60;a=d.asHours()+i;h.model.EstHours=a}}else h.model.EstEndDate=null},!0),e.$watch("vm.model.EstEndDate",function(e,t){if(null!=h.model.EstEndDate||void 0!=h.model.EstEndDate){if(null!=h.model.EstStartDate){if(100*Math.round(h.model.EstEndDate/1e5)!=100*Math.round(h.model.EstStartDate/1e5)&&h.model.EstEndDate<h.model.EstStartDate&&(h.model.EstEndDate<t||null===t))return h.model.EstEndDate=t,void l.error("The scheduled start can’t be after scheduled end!");var o=moment(h.model.EstStartDate),a=moment(h.model.EstEndDate),r=moment.duration(a.diff(o)),s=(moment.parseZone(a).utcOffset()-moment.parseZone(o).utcOffset())/60,m=r.asHours()+s;h.model.EstHours=m}else if(null!=h.model.EstHours){var d=new Date(h.model.EstEndDate),i=Math.floor(h.model.EstHours),n=Math.round(100*(h.model.EstHours-i)),u=(m=i,Math.round(60*n/100));d.setMinutes(d.getMinutes()-u),d.setHours(d.getHours()-m),h.model.EstStartDate=d}}else h.model.EstStartDate=null},!0),e.$watch("vm.model.EstHours",function(){if(null!=h.model.EstHours||void 0!=h.model.EstHours)if(null!=h.model.EstStartDate){var e=new Date(h.model.EstStartDate),t=Math.floor(h.model.EstHours),o=Math.round(100*(h.model.EstHours-t)),a=t,r=Math.round(60*o/100);e.setMinutes(e.getMinutes()+r),e.setHours(e.getHours()+a),h.model.EstEndDate=e}else if(null!=h.model.EstEndDate){var s=new Date(h.model.EstEndDate);t=Math.floor(h.model.EstHours),o=Math.round(100*(h.model.EstHours-t)),a=t,r=Math.round(60*o/100);s.setMinutes(s.getMinutes()-r),s.setHours(s.getHours()-a),h.model.EstStartDate=s}},!0),e.$watch("vm.model.AssignmentProblemCode",function(){if(void 0!=h.model.AssignmentProblemCode){for(var e=0;e<V.length;e++)if(V[e].ProblemCodeName==h.model.AssignmentProblemCode){h.model.EstHours=V[e].DefaultHours,h.model.AssignmentDesc=V[e].Decs;break}}else h.model.EstHours=null,h.model.AssignmentDesc=null}),e.$watch("vm.model.AgreementId",function(){void 0!=h.model.AgreementId&&(h.agreementFilter=d.filter("and"),h.agreementFilter.eq("Id",h.model.AgreementId),s.getItems("woagreements",h.agreementFilter).then(function(){h.items=s.state.items;var e=new Array(7);e[0]="Sunday",e[1]="Monday",e[2]="Tuesday",e[3]="Wednesday",e[4]="Thursday",e[5]="Friday",e[6]="Saturday";var t=new Date;t=i.parseISOString(t.toISOString());for(var o=i.convertToLocal(t),a=o.getDay(),r=o.getHours(),l=o.getMinutes(),m="",d=0;d<h.items.length;d++){m=6==a||0==a?"Weekend":"Weekday";var n=i.parseISOString(h.items[d].StartTime),u=i.parseISOString(h.items[d].EndTime),c=n.getHours(),S=u.getHours(),p=n.getMinutes(),C=u.getMinutes(),I=i.parseISOString(h.items[d].StartDate);I=i.convertToLocal(I);var T=i.parseISOString(h.items[d].EndDate);T=i.convertToLocal(T);var b=!1,D=!1;c<=r?c+1<=r?b=!0:p<=l&&(b=!0):b=!1,S>=r?S-1>=r?D=!0:C>=l&&(D=!0):D=!1,"Active"==h.items[d].Status&&(h.items[d].Day==e[a]||h.items[d].Day==m||"All Days"==h.items[d].Day)&&I<=o&&T>o&&D&&b&&(h.model.RateSheetId=h.items[d].RateSheetId)}}))}),h.isTechnician&&!h.isAdmin&&!h.isFieldConnect&&!h.isDispatch&&!h.isSupervisor)var O=e.$watch("vm.techDropDown.CurrentList",function(e){e&&(O(),s.getItem("employees/getCurrent").then(function(e){var t=e.data;t&&t.Data.length>0&&(h.currentTechId=t.Data[0].Id,h.model.AssignmentTechId=t.Data[0].Id,h.techDropDown.ReadOnly=!0)}))});h.getModulePrivilege=function(e,t){return c.getModulePrivilege(e,t)}}angular.module("FieldConnectApp").controller("NewWorkOrderEditController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","restService","Notification","$window","qsService","timezoneService","cryptoStorageService","$timeout","guiPrivilegeService","dslVisitsService","rolesFactory","featuresFactory","fcGeoLocationService","currentCompanyService","customerService"]}();;!function(){"use strict";function e(e,t,a,o,l,r){var u=this;u.edit=!1,u.popoutGrid=!0,r(function(){e.$apply()}),u.customers=[],u.model={},u.$scope=e,u.close=function(){u.modalClass=!1,e.close(null,50)},u.customerId=0,u.customerName="",u.customerCode="",u.paymentTermId="",u.currencyCode="",u.creditHold=!1,u.search=function(){u.autoFilterCustomer.reset(),""!=u.customerFilter.search&&(u.autoFilterCustomer.like("CustomerName","%"+u.customerFilter.search+"%"),u.autoFilterCustomer.like("CustomerCode","%"+u.customerFilter.search+"%"),u.autoFilterCustomer.like("ContactAddress","%"+u.customerFilter.search+"%"),u.autoFilterCustomer.like("FullName","%"+u.customerFilter.search+"%"))},u.autoFilterCustomer=o.filter("or"),u.FilterStatusCustomer={filterId:"Customer"},u.moduleName="Customer",u.viewName=e.viewName,u.customerFilter={search:""},e.customerName&&""!=e.customerName&&(u.customerFilter.search=e.customerName,u.autoFilterCustomer.like("CustomerName","%"+u.customerFilter.search+"%"),u.autoFilterCustomer.like("CustomerCode","%"+u.customerFilter.search+"%"),u.autoFilterCustomer.like("ContactAddress","%"+u.customerFilter.search+"%"),u.autoFilterCustomer.like("FullName","%"+u.customerFilter.search+"%")),e.$watch("vm.model.IsDifferentBillingInfo",function(){u.model.IsDifferentBillingInfo?(u.attributesEdit[20].Type="line",u.attributesEdit[21].Type="text",u.attributesEdit[22].Type="text",u.attributesEdit[23].Type="text",u.attributesEdit[24].Type="text",u.attributesEdit[25].Type="text",u.attributesEdit[26].Type="text",u.attributesEdit[27].Type="text",u.attributesEdit[28].Type="dropdown",u.attributesEdit[29].Type="text",u.attributesEdit[30].Type="dropdown",u.attributesEdit[31].Type="text",u.attributesEdit[32].Type="text"):(u.attributesEdit[20].Type="empty",u.attributesEdit[21].Type="empty",u.attributesEdit[22].Type="empty",u.attributesEdit[23].Type="empty",u.attributesEdit[24].Type="empty",u.attributesEdit[25].Type="empty",u.attributesEdit[26].Type="empty",u.attributesEdit[27].Type="empty",u.attributesEdit[28].Type="empty",u.attributesEdit[29].Type="empty",u.attributesEdit[30].Type="empty",u.attributesEdit[31].Type="empty",u.attributesEdit[32].Type="empty")}),u.attributes=[{Name:"Customer Code",ValueName:"CustomerCode",Sortable:!0},{Name:"Customer Name",ValueName:"CustomerName",Sortable:!0},{Name:"Address",ValueName:"ContactAddress",Sortable:!0},{Name:"Contact",ValueName:"ContactName",Sortable:!0},{Name:"Phone",ValueName:"Phone",Sortable:!0},{Name:"Email",ValueName:"Email",Sortable:!0},{Name:"Bill To",ValueName:"BillContactName",Sortable:!0},{Name:"Bill Address",ValueName:"BillAddress",Sortable:!0},{Name:"Credit Hold",ValueName:"CreditHold",Sortable:!0,CellFormat:"checkbox"}],u.attributesEdit=[{Type:"text",Label:"Customer Code:",MaxLength:"50",ModelValue:"CustomerCode",Required:!0,Autofocus:"true"},{Type:"dropdown",Label:"Office:",Required:!0,ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true"},{Type:"text",Label:"Customer Name:",MaxLength:"50",ModelValue:"CustomerName",Required:!0},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"Contact Title:",MaxLength:"50",ModelValue:"ContactTitle",Requried:!0},{Type:"text",Label:"Address:",MaxLength:"100",ModelValue:"Address1"},{Type:"text",Label:"First Name:",MaxLength:"50",ModelValue:"ContactFirstName"},{Type:"text",Label:"",MaxLength:"100",ModelValue:"Address2"},{Type:"text",Label:"Last Name:",MaxLength:"50",ModelValue:"ContactLastName"},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"City"},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"ContactPhone"},{Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"StateCode"},{Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"ContactFax"},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country"},{Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"ContactCell"},{Type:"text",Label:"Postal Code",MaxLength:"20",ModelValue:"PostalCode"},{Type:"email",Label:"Contact Email:",MaxLength:"50",ModelValue:"ContactEmail"},{Type:"text",Label:"Web site:",MaxLength:"50",ModelValue:"Website"},{Type:"line",CustomClass:"col-sm-12"},{Type:"checkbox",Label:"Is different billing address?",ModelValue:"IsDifferentBillingInfo"},{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"First Name:",MaxLength:"50",ModelValue:"BillContactFirstName"},{Type:"text",Label:"Address:",MaxLength:"100",ModelValue:"BillAddress1"},{Type:"text",Label:"Last Name:",MaxLength:"50",ModelValue:"BillContactLastName"},{Type:"text",Label:"",MaxLength:"100",ModelValue:"BillAddress2"},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"BillContactPhone"},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"BillCity"},{Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"BillContactCell"},{Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"BillStateCode"},{Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"BillContactFax"},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"BillCountry"},{Type:"email",Label:"Email:",MaxLength:"50",ModelValue:"BillContactEmail"},{Type:"text",Label:"Postal Code",MaxLength:"20",ModelValue:"BillPostalCode"},{Type:"line",CustomClass:"col-sm-12"},{Type:"dropdown",Label:"Payment Term:",ApiMethod:"paymentTerms",ValueProp:"Id",TextProp:"PaymentTermName",ModelValue:"PaymentTermId",ConvertToInt:"true"},{Type:"dropdown",Label:"Tax Rate:",ApiMethod:"taxrates",ValueProp:"Id",TextProp:"TaxName",ModelValue:"TaxRateId",ConvertToInt:"true"},{Type:"checkbox",Label:"Credit Hold:",ModelValue:"CreditHold"},{Type:"datepicker",Label:"Hold Date:",ModelValue:"HoldDate",Format:"MM/dd/yy",SubType:"date"},{Type:"textarea",Label:"Hold Note",MaxLength:"500",ModelValue:"HoldNote"},{Type:"text",Label:"External ID",MaxLength:"50",ModelValue:"ExternalId"},{Type:"dropdown",Label:"Currency Code:",ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode"},{Type:"dropdown",Label:"Status:",ApiMethod:"statuses/statusbytype",Filter:u.FilterStatusCustomer,ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",Required:!0},{Type:"textarea",Label:"Note",MaxLength:"500",ModelValue:"Note"}],e.$watch("vm.model.Status",function(){null!=u.model.Status&&void 0!=u.model.Status||(u.model.Status="Active")}),e.$watch("vm.model.OfficeId",function(){u.model.OfficeId?l.getItem("offices/"+u.model.OfficeId).then(function(){u.office=l.state.item,u.model.Country=u.office.Country,u.model.CurrencyCode=u.office.CurrencyCode}):(u.model.Country=null,u.model.CurrencyCode=null)}),e.$watch("vm.edit",function(){var e={};l.getItem("settings/status?type=DefaultOffice").then(function(t){(e=t.data).Value&&r(function(){u.model.OfficeId=parseInt(e.Value)})})}),e.$watch("vm.customerId",function(){if(u.customerId>0){for(var t=0;t<u.customers.length;t++)if(u.customers[t].Id==u.customerId){u.customerName=u.customers[t].CustomerName,u.currencyCode=u.customers[t].CurrencyCode,u.paymentTermId=u.customers[t].PaymentTermId,u.customerCode=u.customers[t].CustomerCode,u.creditHold=u.customers[t].CreditHold,u.User8=u.customers[t].User8;var a=angular.copy(u.customers[t]);break}e.customer.customerId=u.customerId,e.customer.customerName=u.customerName,e.customer.customerCode=u.customerCode,e.customer.currencyCode=u.currencyCode,e.customer.paymentTermId=u.paymentTermId,e.onSelect&&e.onSelect(a),u.close()}})}angular.module("FieldConnectApp").controller("SelectCustomerController",e),e.$inject=["$scope","$location","$state","qsService","restService","$timeout"]}();;!function(){"use strict";function e(e,t,o,a,l){var r=this;r.edit=!1,r.autoFilterCustomer=l.filter("and"),0!==e.customerId&&r.autoFilterCustomer.eq("CustomerId",e.customerId),r.model={},r.siteFilter={search:""},r.sites=[],r.search=function(){r.autoFilterCustomer.reset(),0!==e.customerId&&r.autoFilterCustomer.eq("CustomerId",e.customerId);""!=r.siteFilter.search&&r.autoFilterCustomer.like("Search","%"+r.siteFilter.search+"%")},r.$scope=e,r.close=function(){r.modalClass=!1,e.close(null,50)},r.siteId=0,r.setCustomer=i;var s=!1,d=!1;function i(){e.customerId&&(a.getItem("customers/"+e.customerId).then(function(){r.customer=a.state.item,r.model.CustomerId=e.customerId,r.model.Address1=r.customer.Address1,r.model.Address2=r.customer.Address2,r.model.City=r.customer.City,r.model.StateCode=r.customer.StateCode,r.model.PostalCode=r.customer.PostalCode,r.model.Country=r.customer.Country,r.model.FirstName=r.customer.ContactFirstName,r.model.LastName=r.customer.ContactLastName,r.model.Phone=r.customer.ContactPhone,r.model.Cell=r.customer.ContactCell,r.model.Fax=r.customer.ContactFax,r.model.Email=r.customer.ContactEmail}),r.customerEdit.ReadOnly=!0)}r.siteFilter.search=e.siteName,void 0!=r.siteFilter.search&&""!=r.siteFilter.search&&r.autoFilterCustomer.like("Search","%"+r.siteFilter.search+"%"),e.customerUserSitesFilter&&e.customerUserSitesFilter.filter&&r.autoFilterCustomer.filter.push(e.customerUserSitesFilter.filter),r.moduleName="Site",r.viewName=e.viewName,r.attributes=[{Name:"Customer",ValueName:"CustomerName",Sortable:!0},{Name:"Site Code",ValueName:"SiteCode",Sortable:!0},{Name:"Site Name",ValueName:"SiteName",Sortable:!0},{Name:"Address",ValueName:"FullAddress",Sortable:!0},{Name:"Contact",ValueName:"ContactName",Edit:!1,Sortable:!1},{Name:"Phone",ValueName:"Phone",Sortable:!0},{Name:"Email",ValueName:"Email",Sortable:!0}],r.customerEdit={Type:"dropdown",Label:"Customer:",Required:!0,ApiMethod:"customers/getcustomer",ValueProp:"Id",TextProp:"CustomerName",ModelValue:"CustomerId",ConvertToInt:"true",Autofocus:"true"},r.attributesEdit=[r.customerEdit,{Type:"dropdown",Label:"Office:",Required:!0,ApiMethod:"offices",ValueProp:"Id",TextProp:"OfficeName",ModelValue:"OfficeId",ConvertToInt:"true"},{Type:"text",Label:"Site Name:",Required:!0,MaxLength:"50",ModelValue:"SiteName"},{Type:"text",CustomDivClass:"col-sm-6 col-lg-6 visibilityNone"},{Type:"textarea",Label:"Description:",MaxLength:"200",ModelValue:"Desc"},{Type:"text",Label:"Site Code:",MaxLength:"50",ModelValue:"SiteCode"},{Type:"text",Label:"Contact Title:",MaxLength:"50",ModelValue:"Title"},{Type:"text",Label:"Address:",MaxLength:"50",ModelValue:"Address1"},{Type:"text",Label:"First Name:",MaxLength:"50",ModelValue:"FirstName"},{Type:"text",Label:"",MaxLength:"50",ModelValue:"Address2"},{Type:"text",Label:"Last Name:",MaxLength:"50",ModelValue:"LastName"},{Type:"text",Label:"City:",MaxLength:"50",ModelValue:"City"},{Type:"text",Label:"Phone:",MaxLength:"20",ModelValue:"Phone"},{Type:"dropdown",Label:"State:",ApiMethod:"states",ValueProp:"StateCode",TextProp:"StateCode",ModelValue:"StateCode"},{Type:"text",Label:"Cell:",MaxLength:"20",ModelValue:"Cell"},{Type:"text",Label:"Postal Code:",MaxLength:"50",ModelValue:"PostalCode"},{Type:"text",Label:"Fax:",MaxLength:"20",ModelValue:"Fax"},{Type:"dropdown",Label:"Country:",ApiMethod:"countries",ValueProp:"CountryName",TextProp:"CountryName",ModelValue:"Country"},{Type:"email",Label:"Email:",MaxLength:"50",ModelValue:"Email"},{Type:"dropdown",Label:"Default Tech:",ApiMethod:"employees/getTechnician",ValueProp:"Id",TextProp:"FullName",ModelValue:"DefaultTechId",ConvertToInt:"true"},{Type:"dropdown",Label:"Rate Sheet:",Required:!0,ApiMethod:"ratesheets",ValueProp:"Id",TextProp:"RateSheetName",ModelValue:"RateSheetId",ConvertToInt:"true"},{Type:"dropdown",Label:"Currency Code:",Required:!0,ApiMethod:"currencies",ValueProp:"CurrencyCode",TextProp:"CurrencyCode",ModelValue:"CurrencyCode"},{Type:"dropdown",Label:"Tax Rate ID:",ApiMethod:"taxrates",ValueProp:"Id",TextProp:"TaxName",ModelValue:"TaxRateId",ConvertToInt:"true"},{Type:"dropdown",Label:"Time zone:",ApiMethod:"timezones",ValueProp:"Id",TextProp:"TimeZoneName",ModelValue:"TimeZoneId",Required:!0}],r.id&&(s=!0,d=!0),e.$watch("vm.edit",function(){r.edit&&i()}),e.$watch("vm.model.CustomerId",function(){r.model.CustomerId?s?s=!1:a.getItem("customers/"+r.model.CustomerId).then(function(){r.customer=a.state.item,r.model.OfficeId=r.customer.OfficeId}):r.model.OfficeId=null}),e.$watch("vm.model.OfficeId",function(){r.model.OfficeId?d?d=!1:a.getItem("offices/"+r.model.OfficeId).then(function(){r.office=a.state.item,r.model.Country=r.office.Country,r.model.CurrencyCode=r.office.CurrencyCode,r.model.TimeZoneId=r.office.TimeZoneId}):(r.model.Country=null,r.model.CurrencyCode=null,r.model.TimeZoneId=null)}),e.$watch("vm.siteId",function(){if(r.siteId>0){e.site.siteId=r.siteId;for(var t=0;t<r.sites.length;t++)if(r.sites[t].Id==r.siteId){e.site.siteName=r.sites[t].SiteName,e.site.siteCode=r.sites[t].SiteCode,e.site.contactId=r.sites[t].ContactId,e.site.title=r.sites[t].Title,e.site.phone=r.sites[t].Phone,e.site.contactName=r.sites[t].ContactName,e.site.techId=r.sites[t].DefaultTechId,e.site.rateSheetId=r.sites[t].RateSheetId,e.site.officeId=r.sites[t].OfficeId,e.site.salesPersonId=r.sites[t].SalesPersonId,e.onSelect&&e.onSelect(r.sites[t]);break}r.close()}})}angular.module("FieldConnectApp").controller("SelectSiteController",e),e.$inject=["$scope","$location","$state","restService","qsService"]}();;!function(){"use strict";function e(e,t,a,o,l,i,r,d,n,s){var u=this;u.id=e.id,u.focusOut=b,u.model={WoId:parseInt(e.WoId)},u.$scope=e,u.close=function(t){e.onBack&&e.onBack(t);u.modalClass=!1,e.close(null,50)},u.search=h,u.calculate=C,u.viewName=e.viewName,u.moduleName=e.moduleName,u.oldPrice=0,u.partsData=i.getTransitionParam("agreement"),u.hideSearch=!0,u.usingDSLNorthwest=s.usingDSLNorthwest,u.apiMethod="parts",u.usingDSLNorthwest&&(u.apiMethod="dslParts"),u.searchValue={filter:"",WoId:e.WoId},u.filters={WoId:e.WoId,ItemId:u.model.ItemId,Cost:u.model.Cost},u.filter={WoId:e.WoId};for(var c=n.getValue("authorizationData").userRoles.split(","),m=!0,p=0;p<c.length;p++)"FieldConnect"!==c[p]&&"Admin"!==c[p]&&"TransAdmin"!==c[p]&&"SubAdmin"!==c[p]&&"Office"!==c[p]||(m=!1);u.partsFilter=l.filter("and"),u.partsFilter.eq("SaleType","Parts"),e.subcontractorId&&(u.partsFilter.eq("SubcontractorId",e.subcontractorId),u.partsFilter.eq("CompanyId",e.woCompanyId)),u.LocationId=0,u.itemName={Type:"dropdown",Label:"Item Name:",Required:!0,ApiMethod:e.subcontractorId&&u.id?"items/itemsSubcontractor":u.id?"items/partsItems":"items/dropdown",ValueProp:"Id",TextProp:u.id?"ItemName":"Name",ModelValue:"ItemId",Autofocus:"true",Name:"parts",List:u.id?null:[""],Filter:u.partsFilter,CurrentList:[],OnOpen:function(){if(u.firstTime)for(var e=0;e<u.attributes.length;e++)if("parts"===u.attributes[e].Name){u.attributes[e].List=null,u.partsFilter.Reload++,u.firstTime=!1;break}},OnLoaded:function(){d(function(){0===u.attributes[u.itemListIndex].CurrentList.length?(r.warning({message:"No results found"}),document.getElementById("seacrhInputPart").focus()):u.attributes[u.itemListIndex].CurrentList.length>0&&0===u.attributes[u.itemListIndex].CurrentList[0].Id&&(u.attributes[u.itemListIndex].CurrentList.splice(0,u.attributes[u.itemListIndex].CurrentList.length),r.warning({message:"The number of items is too high! <br /> Please use the search to  limit the number of the items first"}),document.getElementById("seacrhInputPart").focus())})},SelectFirst:!0},u.itemNameEdit={Type:"text",Label:"Item Name:",Required:!0,MaxLength:"50",ModelValue:"ItemName",ReadOnly:!0},u.SerialNum={Type:"text",Label:"Serial Number",ModelValue:"SerialNum",MaxLength:"100",Required:!0};var I=["Admin","FieldConnect","TransAdmin","Office","Dispatch"];function L(){if(u.id?u.tempAttributes=[u.itemNameEdit,{Type:"decimal",Label:"Quantity:",Required:!0,MaxLength:"50",ModelValue:"Quantity"},{Type:"currency",Label:"Unit Cost:",Required:!m,ModelValue:"Cost",ObjectName:"fieldADPartsDetailCost",OnFocus:b},{Type:"decimal",Label:"Total Quantity:",MaxLength:"50",ModelValue:"AvailableQuantity",ReadOnly:!0},{Type:"currency",Label:"Unit Price:",Required:!m,ModelValue:"Price",ObjectName:"fieldADPartsDetailPrice",CustomDivClass:e.subcontractorId?"hidden":""},{Type:"textarea",Label:"Notes:",MaxLength:"200",ModelValue:"Note",ReadOnly:!1},{Type:"checkbox",Label:"Taxable",Required:!1,ModelValue:"Taxable",Roles:I},{Type:"checkbox",Label:"Billable",ModelValue:"Billable"},u.SerialNum]:u.tempAttributes=[u.itemName,{Type:"decimal",Label:"Quantity:",Required:!0,MaxLength:"50",ModelValue:"Quantity"},{Type:"currency",Label:"Unit Cost:",Required:!m,ModelValue:"Cost",ObjectName:"fieldADPartsDetailCost",OnFocus:b},{Type:"decimal",Label:"Total Quantity:",MaxLength:"50",ModelValue:"AvailableQuantity",ReadOnly:!0},{Type:"currency",Label:"Unit Price:",Required:!m,ModelValue:"Price",ObjectName:"fieldADPartsDetailPrice",CustomDivClass:e.subcontractorId?"hidden":""},{Type:"textarea",Label:"Note:",MaxLength:"200",ModelValue:"Note",ReadOnly:!1},{Type:"checkbox",Label:"Taxable",Required:!1,ModelValue:"Taxable",Roles:I},{Type:"checkbox",Label:"Billable",ModelValue:"Billable"},u.SerialNum],u.searchText={Type:"text",Label:"Search:",ModelValue:"searchText",MaxLength:"100",CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo"},u.searchButton={Type:"button",Label:"Search",onClick:h,CustomInputClass:"btn-primary",ObjectName:"btnSearch"},u.attDSLPostingGroup={Type:"dropdown",Label:"Posting Group:",ApiMethod:"dslInventoryPostingGroup/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"PostingGroupId",ConvertToInt:"true"},u.attDSLLine1={Type:"line",CustomClass:"col-sm-12"},u.locations={Type:"dropdown",Label:"Location:",Required:!1,ApiMethod:"locations/dropdown",ValueProp:"Id",TextProp:"LocationName",ModelValue:"LocationId",Filter:u.filter,CustomDivClass:e.subcontractorId?"hidden":""},u.usingDSLNorthwest){u.attDSLNorthwest=[u.locations,u.attDSLPostingGroup,u.searchText,u.searchButton,u.attDSLLine1],u.attDSLActionTaken={Type:"dropdown",Label:"Action Taken:",ApiMethod:"dslActionTaken/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extActionTakenId",ConvertToInt:"true"},u.attDSLFaultAreas={Type:"dropdown",Label:"Trouble Found:",ApiMethod:"dslFaultAreas/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extFaultAreasId",ConvertToInt:"true"},u.attDSLApplicableCode={Type:"dropdown",Label:"Applicable Zone:",ApiMethod:"dslApplicableCode/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extApplicableCodeId",ConvertToInt:"true"},u.attDSLInstalledRemoved={Type:"dropdown",Label:"Installed/Removed:",ApiMethod:"dslInstalledRemoved/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extInstalledRemovedId",ConvertToInt:"true"},u.attDSLWhoPays={Type:"dropdown",Label:"Who Pays:",ApiMethod:"dslWhoPays/ddList",ValueProp:"Id",TextProp:"Description",ModelValue:"extWhoPaysId",ConvertToInt:"true"},u.attDSLIndirectLaborQuantity={Type:"int",Label:"Indirect Labor Qty:",ModelValue:"extIndirectLaborQuantity"},u.attDSLIndirectPartNumber={Type:"text",Label:"Part#/TOF",ModelValue:"extIndirectPartNumber",MaxLength:"250"};var t=[u.attDSLActionTaken,u.attDSLFaultAreas,u.attDSLApplicableCode,u.attDSLInstalledRemoved,u.attDSLWhoPays,u.attDSLIndirectLaborQuantity,u.attDSLIndirectPartNumber];u.id&&(u.searchText.CustomDivClass="hidden",u.searchButton.CustomDivClass="hidden",u.attDSLPostingGroup.CustomDivClass="hidden",u.locations.ReadOnly=!0),u.attDSLNorthwest=u.attDSLNorthwest.concat(u.tempAttributes).concat(t),u.attributes=u.attDSLNorthwest,u.usingDSLNorthwest=!0,u.itemListIndex=5}else u.searchControls=[u.locations,{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},u.searchText,u.searchButton,u.attDSLLine1],u.id&&(u.searchText.CustomDivClass="hidden",u.searchButton.CustomDivClass="hidden",u.locations.ReadOnly=!0),u.attributes=u.searchControls.concat(u.tempAttributes),u.itemListIndex=5;u.usingDSLNorthwest&&e.$watch("partEdit.model.PostingGroupId",function(e,t){e===t||u.id||h()})}function b(){u.filters.Cost=u.model.Cost,u.filters.ItemId=u.model.ItemId,o.getItems("parts/initialDataForPart",u.filters).then(function(){T=o.state.items[0],u.model.Price=T.Price})}function h(){u.searchText=u.model.searchText,u.searchValue.filter=u.searchText?u.searchText.toString():"",u.model.ItemId=null,u.partsFilter.reset(),u.partsFilter.eq("SaleType","Parts"),null===u.model.LocationId&&void 0===u.model.LocationId?u.partsFilter.eq("LocationId",u.LocationId):(u.partsFilter.eq("LocationId",u.model.LocationId),u.attributes[u.itemListIndex].List=null,u.isFocus=!1),u.usingDSLNorthwest&&null!==u.model.PostingGroupId&&void 0!==u.model.PostingGroupId&&(u.partsFilter.eq("PostingGroupId",u.model.PostingGroupId),u.attributes[u.itemListIndex].List=null,u.isFocus=!1),""!==u.searchValue.filter&&(u.attributes[u.itemListIndex].List=null,u.partsFilter.like("ItemName","%"+u.searchValue.filter+"%"),u.isFocus=!1),e.subcontractorId&&(u.partsFilter.eq("SubcontractorId",e.subcontractorId),u.partsFilter.eq("CompanyId",e.woCompanyId))}m?o.getItem("settings/status?type=AllowTaxOverride").then(function(e){null!==e.data.Value&&"true"===e.data.Value&&I.push("Technician"),L()}):L(),u.firstTime=!0,e.$watch("partEdit.model.ItemId",function(e,t){e!==t&&(null!==u.model.ItemId?o.getItem("items",u.model.ItemId).then(function(){!0===o.state.item.Serialized?u.SerialNum.Type="text":(u.SerialNum.Type="empty",u.model.SerialNum=null)}):(u.SerialNum.Type="empty",u.model.SerialNum=null))}),e.$watch("partEdit.model.Taxable",function(){null!==u.model.Taxable?u.model.Taxable&&u.model.WoId&&o.getItem("wo",u.model.WoId).then(function(){var e=o.state.item;u.model.TaxRate=e.TaxRatePart}):(u.model.TaxRate=null,u.model.Taxable=!1)});var T,y=!1;function C(){u.model.ItemId?y?(u.filters.ItemId=u.model.ItemId,u.filters.Cost=null,o.getItems("parts/initialDataForPart",u.filters).then(function(){T=o.state.items[0],u.model.Price=T.Price,u.model.Cost=T.Cost,u.model.ItemId>0&&u.model.Billable&&(u.model.Taxable=T.Taxable)})):y=!0:(u.model.Price=null,u.model.Cost=null,u.model.Billable=!1)}u.id||(y=!0),e.$watch("partEdit.model.ItemId",function(){i.getTransitionParam("quoteId")?u.model.Billable=!1:u.partsData&&!u.id&&u.model.ItemId?u.partsData.partsData.partsCovered?u.model.Billable=!1:u.model.Billable=!0:u.model.ItemId&&!u.id&&(u.model.Billable=!0),C(),u.model.ItemId&&u.model.LocationId?(u.filters.ItemId=u.model.ItemId,u.filters.LocationId=u.model.LocationId,o.getItems("parts/initialLocationDataForPart",u.filters).then(function(e){void 0!=e.data&&(u.model.AvailableQuantity=e.data.quantities,u.model.Availquantity=e.data.Availquantity)})):u.model.AvailableQuantity=null}),e.$watch("partEdit.model.LocationId",function(e,t){e===t||u.id||h()}),o.getItem("employees/getCurrent").then(function(e){void 0!==e.data.Data[0]&&(u.model.LocationId=e.data.Data[0].InvLocId)})}angular.module("FieldConnectApp").controller("EditPartController",e),e.$inject=["$scope","$location","$state","restService","qsService","stateTransitionService","Notification","$timeout","cryptoStorageService","featuresFactory"]}();;!function(){"use strict";function e(e,t,a,o,l,i,r,n,d,m,s,c){var u=this;function p(){n.getItem("parts/header",e.$parent.vm.id).then(function(e){e.data&&(u.header=e.data.Header)})}function N(e,t,a,o,i){i||l.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/partModal.html",controller:"EditPartController",controllerAs:"partEdit",inputs:{modalTitle:"Part edit",id:e,WoId:t,onBack:u.responsePopup,subcontractorId:a,woCompanyId:o,moduleName:u.moduleName,viewName:u.viewName}}).then(function(e){e.close.then(function(){})})}function f(t){t&&(u.filter.Reload++,u.reloadTable=!1,o(function(){u.reloadTable=!0}),"object"==typeof t&&e.$emit("wo.itemChange"))}u.editPart=function(t,a,o,l){var i=!1;e.$watch("part.partdata",function(){t?n.getItem(u.apiMethod,t).then(function(){u.partdata=n.state.item,u.partdata&&u.partdata.InvoiceId&&!o&&(r.warning({message:"This line has been invoiced, so it may not be edited."}),i=!0),N(t,a,o,l,i)}):N(t,a,o,l,i)})},u.$state=a,u.model={},u.autoFilter={},u.editPartsSub=function(){r.warning({message:"This line has been invoiced, so it may not be edited."})},u.responsePopup=f,u.filter={filterId:null,classId:null,typeId:null,Reload:0},u.itemDeleted=function(){e.$emit("wo.itemDelete"),e.$parent.vm.quoteId&&p()},u.viewName=e.vm.viewName,u.moduleName="Parts",u.header=null,u.attributes=[{Name:"Part Num",ValueName:"PartNum",Edit:!0,Sortable:!0},{Name:"Item Name",ValueName:"ItemName",Edit:!1,Sortable:!0},{Name:"Qty",ValueName:"Quantity",CompareValueName:"QuoteQuantity",Edit:!1,Sortable:!0},{Name:"Unit Price",ValueName:"Price",CompareValueName:"QuotePrice",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colADPartsGridPrice"},{Name:"Extended Price",ValueName:"ExtendedPrice",CompareValueName:"QuoteExtendedPrice",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colADPartsGridExtendedPrice"},{Name:"Unit Cost",ValueName:"Cost",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colADPartsGridCost"},{Name:"Extended Cost",ValueName:"ExtendedCost",Edit:!1,Sortable:!0,CellFormat:"decimal",ObjectName:"colADPartsGridExtendedCost"}],u.attributesSubcontractor=[{Name:"Part Num",ValueName:"PartNum",Edit:!0,Sortable:!0},{Name:"Item Name",ValueName:"ItemName",Edit:!1,Sortable:!0},{Name:"Qty",ValueName:"Quantity",Edit:!1,Sortable:!0},{Name:"Unit Cost",ValueName:"Cost",Edit:!1,Sortable:!0,CellFormat:"decimal",Roles:["Admin","FieldConnect","TransAdmin","SubAdmin","Office"]},{Name:"Extended Cost",ValueName:"ExtendedCost",Edit:!1,Sortable:!0,CellFormat:"decimal",Roles:["Admin","FieldConnect","TransAdmin","SubAdmin","Office"]}],u.usingDSLNorthwest=c.usingDSLNorthwest,u.apiMethod="Parts",u.usingDSLNorthwest&&(u.apiMethod="dslParts"),u.reloadTable=!0,e.$on("partsmiscChange",function(e,t){u.reloadTable=!1,o(function(){u.reloadTable=!0})}),e.$watch("vm.filter.filterId",function(e){u.filter.filterId=e}),e.$watch("parts.model.ClassId",function(){u.filter.classId=u.model.ClassId}),e.$watch("parts.model.TypeId",function(){u.filter.typeId=u.model.TypeId}),e.$watch("parts.filter",function(){u.autoFilter=i.filter("and"),null==u.filter.classId||null==u.filter.typeId?u.autoFilter.eq("WoId",u.filter.filterId):u.autoFilter.eq("WoId",u.filter.filterId).eq("ClassId",u.filter.classId).eq("TypeId",u.filter.typeId)},!0),e.$on("wo.loadQuoteItemsHeaders",function(e,t){p()}),u.scanPart=function(){l.showModal({templateUrl:"Templates/Utils/barcodeScan.html",controller:"BarcodeScanController",controllerAs:"vm",inputs:{modalTitle:"Scan Barcode"}}).then(function(t){t.close.then(function(){var a=t.scope.vm.barcode,o=null,i={},r={};void 0!=a&&n.getItem("items/getItemByBarcode",a).then(function(){var t=n.state.item,a=e.$parent.vm;i.ItemId=t.Id,i.ItemName=t.ItemName,i.Quantity=1,i.Cost=t.Cost,i.WoId=a.id,i.Taxable=!1,i.Serialized=t.Serialized,i.SerialNum=null,i.Billable=!0,a.partsData.partsCovered&&(i.Billable=!a.partsData.partsCovered),r.Cost=i.Cost,r.ItemId=i.ItemId,r.WoId=i.WoId,n.getItems("parts/initialDataForPart",r).then(function(){t=n.state.items[0],i.Price=t.Price,n.getItem("employees/getCurrent").then(function(e){var t;void 0!=e.data.Data[0]&&(o=e.data.Data[0].InvLocId),i.LocationId=o,i.Serialized?((t=i).serializedAttributes=[{Type:"text",Label:"Serial Number",ModelValue:"SerialNum",MaxLength:"100",Required:!0}],l.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Part Serial Number",id:t.Id,model:t,attributes:t.serializedAttributes,apiMethod:"parts",moduleName:t.moduleName,viewName:t.viewName}}).then(function(e){e.close.then(function(){f(t)})})):n.create("parts",i).then(function(e){f(i)})})})})})})},m.$on("applyBundle",function(e){u.reloadTable=!1,o(function(){u.reloadTable=!0})})}angular.module("FieldConnectApp").controller("PartsController",e),e.$inject=["$scope","$location","$state","$timeout","ModalService","qsService","Notification","restService","$window","$rootScope","cryptoStorageService","featuresFactory"]}();;!function(){"use strict";function e(e,t,a,o,n,r,i,l,s,d,c,m){var u=this;function p(t){var a=function(e){var t;t=void 0!==e&&void 0!==e.clipboardData?e.clipboardData.getData("text/plain"):void 0!==e&&void 0!==e.originalEvent&&void 0!==e.originalEvent.clipboardData?e.originalEvent.clipboardData.getData("text/plain"):u.model.searchText;return t}(t);void 0===u.model.LocationId||null===u.model.LocationId?l.error("Location cannot be blank"):null===a||void 0===a||""===a?l.error("Scan a part or enter a part number"):function(t){var a=e.defer();return u.itemsFilter.reset(),u.itemsFilter.eq("SaleType","Parts"),u.itemsFilter.eq("PartNum",t),u.itemsFilter.eq("LocationId",u.model.LocationId),l.warning(`Searching for part number : ${t}, please wait...`),n.getItems("items/withlocation",u.itemsFilter).then(function(){0===n.state.items.length?(l.error("Part number not found"),a.resolve(null)):a.resolve(n.state.items[0])}),a.promise}(a).then(function(t){if(null!==t){var a=t;(o=t,r=e.defer(),u.partsFilter.reset(),u.partsFilter.eq("WoId",u.woId),u.partsFilter.eq("ItemId",o.Id),n.getItems(u.apiMethod,u.partsFilter).then(function(){0===n.state.items.length?r.resolve(null):r.resolve(n.state.items[0])}),r.promise).then(function(t){var o,r,i,s;null===t?(r=a,u.model.WoId=u.woId,u.model.ItemId=r.Id,u.model.Quantity=1,u.quoteId?u.model.Billable=!1:u.partsData&&u.partsData.partsData.partsCovered?u.model.Billable=!1:u.model.Billable=!0,(i=e.defer(),s={WoId:u.woId,ItemId:u.model.ItemId,Cost:null},n.getItems("parts/initialDataForPart",s).then(function(){var e=n.state.items[0];u.model.Price=e.Price,u.model.Cost=e.Cost,u.model.Billable&&(u.model.Taxable=e.Taxable),i.resolve(!0)}),i.promise).then(function(){var t;(t=e.defer(),u.model.TaxRate=null,u.model.Taxable&&u.model.Billable?n.getItem("wo",u.model.WoId).then(function(){var e=n.state.item;u.model.TaxRate=e.TaxRatePart,t.resolve(!0)}):t.resolve(!0),t.promise).then(function(){l.warning("Adding part, please wait..."),n.create(u.apiMethod,u.model).then(function(e){e&&(l.success("Part has been added"),v())})})})):(o=t,l.warning("Updating part, please wait..."),o.Quantity+=1,o.ItemName="",n.update(u.apiMethod,o).then(function(e){200===e.status&&(l.success("Part quantity has been updated"),v())}))})}var o,r}),s(function(){u.model.searchText=void 0,$("#searchText").focus()},250)}function v(){t.$parent.vm.reloadPartsTable=!1,s(function(){t.$parent.vm.reloadPartsTable=!0})}u.$scope=t,u.usingDSLNorthwest=t.$parent.vm.usingDSLNorthwest,u.woId=t.$parent.vm.model.Id,u.model={},u.apiMethod="Parts",u.itemsFilter=r.filter("and"),u.partsFilter=r.filter("and"),u.usingDSLNorthwest&&(u.apiMethod="dslParts"),u.partsData=i.getTransitionParam("agreement"),u.quoteId=i.getTransitionParam("quoteId"),m.getCompanySettings().then(function(e){u.endOfData=m.ScannerEndOfDataCharacter,u.showForm=!0,u.attributes=[{Type:"dropdown",Label:"Location:",Required:!1,ApiMethod:"locations/dropdown",ValueProp:"Id",TextProp:"LocationName",ModelValue:"LocationId",ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{onPaste:p,onClick:p,Type:"barcodeautosubmit",Label:"Scan:",ModelValue:"searchText",Autofocus:"true",HideBtn:!0,EndOfData:u.endOfData,CustomInputClass:"col-sm-8 custom-search-input-new-wo",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomDivClass:"col-sm-5"},{Type:"button",Label:"Submit",onClick:p,CustomDivClass:"col-sm-3 custom-button-barcode"}],n.getItem("employees/getCurrent").then(function(e){void 0!==e.data.Data[0]&&(u.model.LocationId=e.data.Data[0].InvLocId)})})}angular.module("FieldConnectApp").controller("PartsScanController",e),e.$inject=["$q","$scope","$location","$state","restService","qsService","stateTransitionService","Notification","$timeout","cryptoStorageService","featuresFactory","currentCompanyService"]}();;!function(){"use strict";function e(e,o,r,t,s,a,i,c,l,n){var d=this;d.$scope=o,d.filter={filterId:o.id},l.clearCustomer(),d.usingGroundBreakers=n.usingGroundBreakers,d.customReport=!1,d.serviceReportCount=0,d.serviceReportMax=99,d.serviceReportAPI="woservicereports",d.usingGroundBreakers&&(d.serviceReportAPI="gbwoservicereports"),d.woId=o.id,e.getItem("woservicereports",d.woId).then(function(){d.model=e.state.item;for(var o=0;o<d.model.ServiceReportLabors.length;o++)null!==d.model.ServiceReportLabors[o].LaborDate?(d.model.ServiceReportLabors[o].LaborDate=c.parseISOString(d.model.ServiceReportLabors[o].LaborDate),d.model.ServiceReportLabors[o].LaborDate=c.convertToLocal(d.model.ServiceReportLabors[o].LaborDate),d.model.ServiceReportLabors[o].LaborDateString=d.model.ServiceReportLabors[o].LaborDate.toLocaleDateString("en-us").replace(",","")):d.model.ServiceReportLabors[o].LaborDateString="";for(o=0;o<d.model.ServiceReportNotes.length;o++)d.model.ServiceReportNotes[o].SysModifyUTC=c.parseISOString(d.model.ServiceReportNotes[o].SysModifyUTC),d.model.ServiceReportNotes[o].SysModifyUTC=c.convertToLocal(d.model.ServiceReportNotes[o].SysModifyUTC),d.model.ServiceReportNotes[o].SysModifyUTCString=d.model.ServiceReportNotes[o].SysModifyUTC.toLocaleString("en-us").replace(",","")}),d.modalClass=!1,i(function(){d.modalClass=!0}),d.onBack=function(){d.modalClass=!1,o.close(null,200)},d.$scope.clearVal=0,d.$scope.saveVal=0}angular.module("FieldConnectApp").controller("ReportReadOnlyController",e),e.$inject=["restService","$scope","$location","$state","$stateParams","ModalService","$timeout","timezoneService","gbCustomFactory","featuresFactory"]}();;!function(){"use strict";function e(e,o,t,r,n,a,l,c,i,s){var d=this;function u(e){if(null===e.User6||void 0===e.User6){var o={WoId:parseInt(e.WoId),OriginalDate:e.Date};n.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/newServiceReport.html",controller:"WoServiceReportEditController",controllerAs:"vm",inputs:{id:e.Id,model:o,onBack:m}}).then(function(e){e.close.then(function(){})})}else i.warning({message:"Service Report has already been revised!"})}function m(e){e&&(d.reloadTable=!1,a(function(){d.reloadTable=!0,"object"==typeof e&&o.$parent.vm.checkCustomerInfoChangeEnabled&&o.$parent.vm.checkCustomerInfoChangeEnabled(!0)}))}d.editServiceReport=function(o,t,r,a){var l={WoId:parseInt(t)};r?e.getItem("wo/woandquoteprices",parseInt(t)).then(function(e){var t=e.data;t.WoPrice!==t.QuotePrice?bootbox.confirm({message:"The total work order price "+t.WoPrice+" "+t.CurrencyCode+" does not match the quote price "+t.QuotePrice+" "+t.CurrencyCode+".<br>Do you want to continue?",buttons:{confirm:{label:"Yes",className:"btn-primary"},cancel:{label:"No",className:"btn-default"}},callback:function(e){e&&n.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/newServiceReport.html",controller:"WoServiceReportEditController",controllerAs:"vm",inputs:{id:o,model:l,onBack:m}}).then(function(e){e.close.then(function(){})})}}):n.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/newServiceReport.html",controller:"WoServiceReportEditController",controllerAs:"vm",inputs:{id:o,model:l,onBack:m}}).then(function(e){e.close.then(function(){})})}):a?n.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/reports.html",controller:"WoServiceReportEditController",controllerAs:"vm",inputs:{id:o,model:l,onBack:m}}).then(function(e){e.close.then(function(){})}):n.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/newServiceReport.html",controller:"WoServiceReportEditController",controllerAs:"vm",inputs:{id:o,model:l,onBack:m}}).then(function(e){e.close.then(function(){})})},d.reloadTable=!0,d.moduleName="ServiceReports",d.usingGroundBreakers=l.usingGroundBreakers,d.usingGroundBreakers&&(d.customer=c.getCustomer(),void 0!==d.customer&&null!==d.customer||(d.customer={User4:!1})),d.attributes=[{Name:"Name",ValueName:"FileName",Sortable:!0,CellFormat:"download",DownloadValueName:"ReportUrl"},{Name:"Date",ValueName:"Date",FormatDate:"datetime",Sortable:!0},{Name:"Signed By",ValueName:"SignedBy",Sortable:!0}],d.usingGroundBreakers&&(!d.customer.User4||s.isTechnician||s.isCustomerUser||(d.gbEditButton=[{Name:"Revised Date",ValueName:"User6",FormatDate:"datetime"},{Name:"Revise",ValueName:"User6",CellFormatData:{onClick:u,Text:"Edit"},CellFormat:"custombutton",Disabled:"User6"}],d.attributes=d.attributes.concat(d.gbEditButton))),d.edit=u,d.model={},d.deleteEvent=function(){d.reloadTable=!1,a(function(){d.reloadTable=!0}),o.$parent.vm.checkCustomerInfoChangeEnabled&&o.$parent.vm.checkCustomerInfoChangeEnabled()},d.popupClose=m}angular.module("FieldConnectApp").controller("WoServiceReportController",e),e.$inject=["restService","$scope","$location","$state","ModalService","$timeout","featuresFactory","gbCustomFactory","Notification","rolesFactory"]}();;!function(){"use strict";function e(e,o,t,r,n,a,i,s,c,l,d,m,u,g,S){var v=this;function p(){return g.getLocation("ServiceReport").then(function(o){var t,r,n=v.model.SignedBy;if(v.usingGroundBreakers&&v.customer.User4){var a=v.model.gbSignatureCheck;if(!1===a||void 0===a)return void d.warning({message:"Signature acknowledgement has not been checked!"})}if(null===n)d.warning({message:"Work order serivce report must be SignedBy."});else if(t=$("#signatureCanvas")[0],(r=document.createElement("canvas")).width=t.width,r.height=t.height,t.toDataURL()===r.toDataURL())d.warning({message:"Work order serivce report must be SignedBy."}),$("#signatureCanvas")[0].style.cssText="border: 1px  solid #FF0000";else{v.isLoading=!0;var i=new Image;i.src=$("#signatureCanvas")[0].toDataURL();var s=i.src.split(",")[1];v.model.Signature=s;var c=o.coords.latitude,l=o.coords.longitude;null!==c&&(v.model.Latitude=c),null!==l&&(v.model.Longitude=l),console.log(v.model),e.create(v.serviceReportAPI,v.model).then(function(e){d.success({message:"Work order serivce report has been successfully created."}),f(e)})}})}function f(e){v.isLoading=!1,o.onBack&&o.onBack(e),v.modalClass=!1,o.close(null,200)}v.$scope=o,v.ok=p,v.id=o.id,v.woId=o.model.WoId,v.OriginalDate=o.model.OriginalDate,v.usingGroundBreakers=m.usingGroundBreakers,v.save=function(){return g.getLocation("ServiceReport").then(function(o){v.isLoading=!0;var t=o.coords.latitude,r=o.coords.longitude;null!==t&&(v.model.Latitude=t),null!==r&&(v.model.Longitude=r),console.log(v.model),e.create(v.serviceReportAPI,v.model).then(function(e){d.success({message:"Work order serivce report has been successfully created."}),f(e)})})},v.customServiceReport=!1,v.isLoading=!1,v.showWarning=!1,v.serviceReportAPI="woservicereports",v.usingGroundBreakers&&(v.customer=u.getCustomer(),v.serviceReportAPI="gbwoservicereports",void 0!==v.customer&&null!==v.customer||(v.customer={User4:!1}),v.showWarning=v.customer.User4),v.RequestServiceReportSignature=!1,S.getCompanySettings().then(function(e){v.RequestServiceReportSignature=S.RequestServiceReportSignature}),v.isLoading=!0,e.getItem("woservicereports",v.woId).then(function(){console.log(e.state.item),v.model=e.state.item,v.previewHTML=l.trustAsHtml(e.state.item.ReportHTML),v.model.Date=new Date,v.usingGroundBreakers?void 0!==v.OriginalDate&&(v.model.Date=v.OriginalDate):(v.model.Date=i.convertToUtc(v.model.Date,v.model.Date.getTimezoneOffset()),v.model.Date=i.convertToLocal(v.model.Date)),v.model.FullDateString=moment(v.model.Date).format("M/D/YYYY HH:mm:ss SSS"),v.model.DateString=moment(v.model.Date).format("M/D/YYYY");for(var o=0;o<v.model.ServiceReportLabors.length;o++)null!==v.model.ServiceReportLabors[o].LaborDate?(v.model.ServiceReportLabors[o].LaborDate=i.parseISOString(v.model.ServiceReportLabors[o].LaborDate),v.model.ServiceReportLabors[o].LaborDate=i.convertToLocal(v.model.ServiceReportLabors[o].LaborDate),v.model.ServiceReportLabors[o].LaborDateString=v.model.ServiceReportLabors[o].LaborDate.toLocaleDateString("en-us").replace(",","")):v.model.ServiceReportLabors[o].LaborDateString="";for(o=0;o<v.model.ServiceReportNotes.length;o++)v.model.ServiceReportNotes[o].SysModifyUTC=i.parseISOString(v.model.ServiceReportNotes[o].SysModifyUTC),v.model.ServiceReportNotes[o].SysModifyUTC=i.convertToLocal(v.model.ServiceReportNotes[o].SysModifyUTC),v.model.ServiceReportNotes[o].SysModifyUTCString=v.model.ServiceReportNotes[o].SysModifyUTC.toLocaleString("en-us").replace(",","");v.companySettings=[],v.companySettingsFilter=c.filter("or"),v.companySettingsFilter.eq("Name","ServiceReportEmail").eq("Name","CustomerIncludeDefault"),v.usingGroundBreakers&&null!==v.id&&void 0!==v.id&&(v.model.ExistingId=v.id,v.customServiceReport=!0,v.showWarning=!1),e.getItems("companysettings",v.companySettingsFilter).then(function(e){v.companySettings=e.data.Data;for(var o=0;o<v.companySettings.length;o++)"ServiceReportEmail"===v.companySettings[o].Name&&0!==v.companySettings[o].Id&&null!=v.companySettings[o].Value&&(v.model.DefaultCompanyEmail=v.companySettings[o].Value),"CustomerIncludeDefault"===v.companySettings[o].Name&&(v.model.Include="true"===v.companySettings[o].Value);v.isLoading=!1})}),v.modalClass=!1,a(function(){v.modalClass=!0}),v.ok=p,v.clear=function(){var e=$("#signatureCanvas")[0];e.width=e.width,v.model.SignedBy="",$("#signatureCanvas")[0].style.cssText="border: 1px  solid #000000"},v.onBack=f,v.$scope.clearVal=0,v.$scope.saveVal=0,v.requestSignature=function(){if(v.model.ContactEmail){v.isLoading=!0;var o={Email:v.model.ContactEmail,RecordId:v.woId};e.create("woservicereports/remoteSignature",o).then(function(e){d.success("The request has been sent!")}).then(function(){f()},function(e){v.isLoading=!1,d.error("There was an error sending the request!")})}else d.error("Enter an Email Address for Request Signature!")}}angular.module("FieldConnectApp").controller("WoServiceReportEditController",e),e.$inject=["restService","$scope","$location","$state","ModalService","$timeout","timezoneService","cryptoStorageService","qsService","$sce","Notification","featuresFactory","gbCustomFactory","fcGeoLocationService","currentCompanyService"]}();;!function(){"use strict";function e(e,t,o,n,a,l,i,r,d,c,u,s,m,p,b,v){var f=this;r.getValue("authorizationData");f.woId=parseInt(o.params.woId),f.assignmentId=parseInt(o.params.assId),f.parts="Parts",f.labor="Labor",f.misc="Misc",f.reloadTable=!0,f.gridAttributes=[{Name:"Name",ValueName:"BundleName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Description",Edit:!1,Sortable:!0},{Name:"Action",CellFormat:"template",CustomHeaderClass:"form-action",CustomCellClass:"form-action-cell",CellFormatData:{TemplateUrl:"bundleActionCell.html",onApplyBundle:function(e){var t={};t.Id=e.Id,t.assignmentId=f.assignmentId,v.getLocation("Bundles").then(function(o){t.Latitude=o.coords.latitude,t.Longitude=o.coords.longitude,i.create("bundle/apply",t).then(function(t){var o="Bundle "+e.BundleName+" has been applied";g(t,o)})})},onRemoveBundle:function(e){i.remove("bundle/remove/"+e.Id,e.WoId).then(function(t){C.RecordId=e.WoId,C.TableName="WO",C.ParentRecordId=e.Id,C.Note="Bundle Removed From WO",function(e){v.getLocation("WoForm").then(function(t){e.Latitude=t.coords.latitude,e.Longitude=t.coords.longitude,i.create("events",e).then(function(){})})}(C);var o="Bundle "+e.BundleName+" has been removed";g(t,o)})},disabled:{}}}];var I=['<button class="btn btn-default" ng-click="attr.CellFormatData.onApplyBundle(item)" ng-if="item.WoId == null">Apply</button>','<button class="btn btn-default" ng-click="attr.CellFormatData.onRemoveBundle(item)" ng-if="item.WoId != null">Remove</button>'].join("");function g(e,t){p.$broadcast("applyBundle",e),u.success({message:t}),f.reloadTable=!1,l(function(){f.reloadTable=!0})}b.put("bundleActionCell.html",I);var C={EventType:"DELETE",RecordId:0}}angular.module("FieldConnectApp").controller("WoBundleController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","$timeout","restService","cryptoStorageService","qsService","stateTransitionService","Notification","$window","currentUserService","$rootScope","$templateCache","fcGeoLocationService"]}();;!function(){"use strict";function e(e,o,t,i,r,a,l,s){var n=this;n.$scope=e,n.model=e.model,n.model.ParentWoId=e.parentWoId,n.apiMethod=e.apiMethod,n.viewName=e.viewName,n.moduleName=e.moduleName,n.filter=e.filter,n.modalClass=!1,n.isFirstProblemCode=!0,n.filter={siteId:n.model.SiteId},o(function(){n.modalClass=!0}),n.onBack=function(o){if(e.onBack&&!e.onBack(o))return},n.close=c,n.onSubmit=function(){if(n.isLoading)return void s.warning("Copy is in progress, please wait....");n.isLoading=!0;var e=angular.copy(n.model),o=new Date(e.PromiseDate),t=moment.tz.zone(m.tzDatebaseName).offset(o);l.convertToUtc(o,t),e.PromiseDate=l.buildISOString(o),r.getLocation("WorkOrderCopy").then(function(o){e.Longitude=o.coords.longitude,e.Latitude=o.coords.latitude,i.create("woCopy",e).then(function(e){n.isLoading=!1,c(e.data.Wo)})})};var m=a.getValue("authorizationData");m&&m.tzDatebaseName&&(n.tzName=m.tzDatebaseName,n.userTimeZone=moment.tz(n.tzName).zoneAbbr());var d=[];function c(o){n.modalClass=!1,e.close(o,200)}i.getItems("problemcodes").then(function(){d=i.state.items}),n.attributes=[{Type:"datepicker",Label:"Promised:",Required:!0,ModelValue:"PromiseDate",Format:"MM/dd/yyyy"},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"dropdown",Label:"Problem Code:",ApiMethod:"problemcodes",ValueProp:"ProblemCodeName",TextProp:"ProblemCodeName",ModelValue:"AssignmentProblemCode",Required:!0,Autofocus:"true"},{Type:"dropdown",Label:"Serviceable Item:",ApiMethod:"serviceableitems/dropdownbysite",Filter:n.filter,ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",ConvertToInt:"true",CustomDivClass:"col-sm-5",CustomLabelClass:"col-sm-3 custom-search-label-new-wo",CustomInputClass:"col-sm-8 custom-search-input-new-wo"}],e.$watch("woCopyEdit.model.AssignmentProblemCode",function(e,o){if(void 0!=n.model.AssignmentProblemCode)if(n.isFirstProblemCode){for(var t=0;t<d.length;t++)if(d[t].ProblemCodeName==n.model.AssignmentProblemCode){n.model.EstHours=d[t].DefaultHours;break}}else n.isFirstProblemCode=!0;else n.model.EstHours=null})}angular.module("FieldConnectApp").controller("WoCopyEditController",e),e.$inject=["$scope","$timeout","currentCompanyService","restService","fcGeoLocationService","cryptoStorageService","timezoneService","Notification"]}();;!function(){"use strict";function e(e,i,t,n,c,o,d){var r=this;function l(){r.tableReload=!1,i(function(){r.tableReload=!0})}r.$scope=e,r.tableReload=!1,r.showForm=!1,r.model={},r.moduleName="Deficiencies",r.deficiencyService=new d(r.model),r.deficiencyService.setSiteFilterId(e.$parent.vm.model.SiteId),r.deficiencyService.getConversionStatusNameId().then(function(e){r.conversionStatusId=e,r.conversionStatusId&&r.deficiencyService.setStatusFilterId(r.conversionStatusId),r.deficiencyEditAttributes=r.deficiencyService.getDeficiencyEditAttributes(),r.deficiencyGridAttributes=r.deficiencyService.getDeficiencyGridAttributes(),r.tableReload=!0,r.showForm=!0}),r.edit=function(i){t.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/woDeficiencyEditModal.html",controller:"WoDeficiencyEditController",controllerAs:"vm",inputs:{id:i.Id,siteId:e.$parent.vm.model.SiteId,conversionStatusId:r.conversionStatusId}}).then(function(e){e.close.then(function(){l()})})},r.newSubmit=function(){r.isLoading=!0,r.model.WoId=e.$parent.vm.model.Id,c.create("deficiency",r.model).then(function(e){o.success("Deficiency has been added!")}).then(function(){!function(){for(var e in r.model)r.model[e]=null}(),l(),r.isLoading=!1},function(e){r.isLoading=!1})},e.$watch("df.model.StatusId",function(e,i){if(e)r.deficiencyService.performStatusAction(e)})}angular.module("FieldConnectApp").controller("WoDeficiencyController",e),e.$inject=["$scope","$timeout","ModalService","qsService","restService","Notification","deficiencyService"]}();;!function(){"use strict";function e(e,t,i,n,o,c){var d=this;function l(){d.reloadTable=!1,t(function(){d.reloadTable=!0})}d.$scope=e,d.model={},d.deficiencyService=new o(d.model),d.attributes=e.attributes,d.id=e.id,d.siteId=e.siteId,d.apiMethod=e.apiMethod,d.timezone=e.timezone,d.customFocus=e.customFocus,d.viewName=e.viewName,d.moduleName=e.moduleName,d.filter=e.filter,d.conversionStatusId=e.conversionStatusId,d.isConverted=!1,d.isReadOnly=!1,d.modalClass=!1,d.noteModel={DeficiencyId:d.id},d.attachmentModel={DeficiencyId:d.id},d.isLoading=!0,d.reloadTable=!0,d.deficiencyFilter=i.filter("and"),d.deficiencyFilter.eq("DeficiencyId",d.id),d.deficiencyService.setSiteFilterId(d.siteId),t(function(){d.modalClass=!0}),d.hideSubmit=!1,e.hideSubmit&&(d.hideSubmit=e.hideSubmit),d.onBack=function(t){if(e.onBack&&!e.onBack(t))return;d.modalClass=!1,e.close(t,200)},d.editAttributes=d.deficiencyService.getDeficiencyEditAttributes(),d.noteAttributesGrid=d.deficiencyService.getDeficiencyNotesGridAttributes(),d.attachmentAttributesGrid=d.deficiencyService.getDeficiencyAttachmentsGridAttributes(),e.$watch("vm.model.Id",function(t,i){t&&(d.model.Converted?(d.deficiencyService.setStatusReadOnlyFlag(!0),d.deficiencyService.setFieldsReadOnlyFlag(!0),d.deficiencyService.setStatusFilterId(null),d.isConverted=d.model.Converted,d.isReadOnly=d.model.Converted):d.conversionStatusId&&d.model.StatusId!==d.conversionStatusId&&(d.deficiencyService.setStatusFilterId(d.conversionStatusId),d.isReadOnly=d.deficiencyService.setStatusAction(d.model.StatusId),e.$watch("vm.model.StatusId",function(e,t){if(e&&e!==t)d.deficiencyService.performStatusAction(e)})),d.isLoading=!1)}),d.editNote=function(i){d.isConverted||d.isReadOnly?c.error("The Deficiency Note cannot be edited!"):(n.showModal({templateUrl:"Templates/Utils/popupEditMini.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Deficiency Note edit",id:i,model:d.noteModel,attributes:d.deficiencyService.getDeficiencyNotesEditAttributes(),apiMethod:"deficiencyNote",moduleName:d.moduleName,viewName:d.viewName}}).then(function(e){e.close.then(function(){l()})}),e.$watch("vm.noteModel.NoteTemp",function(e,i){t(e?function(){d.noteModel.Note=e}:function(){d.noteModel.Note=null})}))},d.editAttachment=function(e){n.showModal({templateUrl:"Templates/Utils/popupEditMini.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Deficiency Attachment edit",id:e,model:d.attachmentModel,attributes:d.deficiencyService.getDeficiencyAttachmentsEditAttributes(),apiMethod:"deficiencyAttachment",moduleName:d.moduleName,viewName:d.viewName}}).then(function(e){e.close.then(function(){l()})})}}angular.module("FieldConnectApp").controller("WoDeficiencyEditController",e),e.$inject=["$scope","$timeout","qsService","ModalService","deficiencyService","Notification"]}();;!function(){"use strict";function e(e,t,a,o,i){this.edit=function(e){a.go("wositenotesEdit",{id:e})},this.moduleName=e.$parent.vm.assid?"adNotes":"wodNotes",this.attributes=[{Name:"Date Time",ValueName:"DateTime",Edit:!0,Sortable:!0},{Name:"Created By",ValueName:"CreatedBy",Edit:!1,Sortable:!0},{Name:"Viewable",ValueName:"Viewable",Edit:!1,Sortable:!0,CellFormat:"checkbox"},{Name:"Note",ValueName:"Note",Edit:!1,Sortable:!0}],this.editNoteSub=function(){i.warning({message:"The Work Order has been invoiced, so it may not be edited."})}}angular.module("FieldConnectApp").controller("WoSiteNoteController",e),e.$inject=["$scope","$location","$state","ModalService","Notification"]}();;!function(){"use strict";function e(e,t,o,a,l,r,i,n,d,m){var u=this;u.$state=o,u.editWoNote=function(e,t){u.model.WoId=parseInt(t),u.model.NoteTemp="",l.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"NoteEditController",controllerAs:"vm",inputs:{modalTitle:"Work Order Note edit",id:e,model:u.model,attributes:u.noteattributesWo,apiMethod:"wonotes",onBack:u.editData,moduleName:u.moduleName,viewName:u.viewName}}).then(function(e){e.close.then(function(){})})},u.editSiteNote=function(e,t){u.model1.SiteId=parseInt(t),u.model1.NoteTemp="",l.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"NoteEditController",controllerAs:"vm",inputs:{modalTitle:"Site Note edit",id:e,SiteId:t,model:u.model1,attributes:u.noteattributesSite,apiMethod:"sitenotes",moduleName:u.moduleName,viewName:u.viewName}}).then(function(e){e.close.then(function(){u.reloadTable=!1,r(function(){u.reloadTable=!0})})})};u.getWoNoteLength=function(){var e=!1;u.woNotesCount>0&&(e=!0);return e},u.getSiteNoteLength=function(){var e=!1;u.siteNotesCount>0&&(e=!0);return e},u.filterTab="Work Order Notes",u.filterTabWindow=!1,u.editData=function(t){t&&(u.reloadTable=!1,r(function(){u.reloadTable=!0,"object"==typeof t&&(e.$parent.vm.checkCustomerInfoChangeEnabled?e.$parent.vm.checkCustomerInfoChangeEnabled(!0):e.$parent.vd.checkCustomerInfoChangeEnabled&&e.$parent.vd.checkCustomerInfoChangeEnabled(!0))}));return!0},u.checkChildItems=function(){e.$parent.vm.checkCustomerInfoChangeEnabled&&e.$parent.vm.checkCustomerInfoChangeEnabled();c()},u.viewName=e.vm.viewName,u.moduleName="Notes",u.woNotesCount=0,u.siteNotesCount=0,u.reloadTable=!1,u.model={NoteTemp:""},u.model1={NoteTemp:""};var s=d.getValue("authorizationData").userRoles.split(",");u.customerRoles=!1;for(var N=0;N<s.length;N++)"CustAdmin"!=s[N]&&"Cust"!=s[N]||(u.customerRoles=!0);function c(){n.getItem("wonotes/header",e.$parent.vm.id).then(function(e){e.data&&(u.header=e.data.Header)})}e.$watch("wn.model.NoteTemp",function(){u.model.Note=u.model.NoteTemp}),e.$watch("wn.model1.NoteTemp",function(){u.model1.Note=u.model1.NoteTemp}),u.attributesWoatt=[{Name:"Date Time",ValueName:"SysModifyUTC",Edit:!e.$parent.vm.customerEdit,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},u.customerRoles?{CustomCellClass:"hidden",CustomHeaderClass:"hidden"}:{Name:"Customer Viewable",ValueName:"Viewable",CompareValueName:"QuViewable",Edit:!1,Sortable:!0,CellFormat:"checkbox"},{Name:"Note",ValueName:"Note",CompareValueName:"QuNote",Edit:!1,Sortable:!0}],u.attributesSiatt=[{Name:"Date Time",ValueName:"SysModifyUTC",Edit:!e.$parent.vm.customerEdit,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},u.customerRoles?{CustomCellClass:"hidden",CustomHeaderClass:"hidden"}:{Name:"Customer Viewable",ValueName:"CustomerViewable",Edit:!1,Sortable:!0,CellFormat:"checkbox"},{Name:"Note",ValueName:"Note",Edit:!1,Sortable:!0}],u.woNoteFilter=i.filter("and"),u.woNoteFilter.eq("NoteType","WorkOrder"),u.noteattributesWo=[{Type:"dropdown",Label:"Standard Note:",ApiMethod:"notelibs",ValueProp:"Note",TextProp:"NoteTitle",Autofocus:"true",ModelValue:"NoteTemp",Filter:u.woNoteFilter},{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"Viewable"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note",Required:!0,Rows:10}],u.siteNoteFilter=i.filter("and"),u.siteNoteFilter.eq("NoteType","Site"),u.noteattributesSite=[{Type:"dropdown",Label:"Standard Note:",ApiMethod:"notelibs",ValueProp:"Note",TextProp:"NoteTitle",Autofocus:"true",ModelValue:"NoteTemp",Filter:u.siteNoteFilter},{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"CustomerViewable"},{Size:250,Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note",Required:!0,Rows:10}],u.reloadTable=!0,e.$on("wo.loadQuoteItemsHeaders",function(e,t){c()}),u.header=null,u.editNoteSub=function(){m.warning({message:"The Work Order has been invoiced, so it may not be edited."})}}angular.module("FieldConnectApp").controller("WoNoteController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","$timeout","qsService","restService","cryptoStorageService","Notification"]}();;!function(){"use strict";function e(e,o,t,i){var s=this;s.$scope=e,s.attributes=e.attributes,s.id=e.id,s.apiMethod=e.apiMethod,s.timezone=e.timezone,s.customFocus=e.customFocus,s.viewName=e.viewName,s.moduleName=e.moduleName,s.filter=e.filter,s.modalClass=!1;var a=i.getValue("authorizationData"),l=!1,u=!1;t.getCompanySettings().then(function(e){s.userRoles=a.userRoles.split(","),null!==t.CustomerViewableWONotesByRole&&s.userRoles.forEach(function(e){t.CustomerViewableWONotesByRole.toLowerCase().search(e.toLowerCase())>-1&&(l=!0),t.CustomerViewableWOSiteNotesByRole.toLowerCase().search(e.toLowerCase())>-1&&(u=!0)})}),o(function(){s.modalClass=!0}),s.hideSubmit=!1,e.hideSubmit&&(s.hideSubmit=e.hideSubmit),s.onBack=function(o){if(e.onBack&&!e.onBack(o))return;s.modalClass=!1,e.close(null,200)},e.$watch(s.id,function(){void 0===s.id&&o(function(){s.$scope.model.WoId&&(s.$scope.model.Viewable=l),s.$scope.model.SiteId&&(s.$scope.model.CustomerViewable=u)})})}angular.module("FieldConnectApp").controller("NoteEditController",e),e.$inject=["$scope","$timeout","currentCompanyService","cryptoStorageService"]}();;!function(){"use strict";function e(e,t,a,n,o,r,l,i,m,c,s,u,d,S,p,f,N,b){var v=this;i.getValue("authorizationData");function $(){N.updateSettlementStatus(v.woId).then(function(t){v.reloadTable=!1,e.$parent.vm.reloadAttachmentsTable=!1,r(function(){v.reloadTable=!0,e.$parent.vm.reloadAttachmentsTable=!0})})}if(e.modal={},v.woId=parseInt(a.params.id),v.reloadTable=!0,v.transactionCount=-1,v.updateSettlementStatus=$,v.submitTransaction=function(t){v.model={},v.model.WoId=e.$parent.vm.model.Id,v.model.Token=null,v.model.PaymentType="cc",o.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/woPaymentEditModal.html",controller:"WoPaymentModalController",controllerAs:"vm",inputs:{model:v.model,modalTitle:"Submit Payment",apiMethod:"fcPayment",id:t,woId:v.model.WoId}}).then(function(e){e.close.then(function(e){e&&$()})})},v.transactionList=[],v.gridAttributes=[{Name:"Reference No",ValueName:"ReferenceNumber",Edit:!1,Sortable:!0},{Name:"Transaction Type",ValueName:"TransactionType",Edit:!1,Sortable:!0},{Name:"Amount",ValueName:"Amount",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Settlement Status",ValueName:"SettlementStatus",Edit:!1,Sortable:!0},{Name:"Settlement Date",ValueName:"SettlementDate",Edit:!1,Sortable:!0},{Name:"Response",ValueName:"ResponseText",Edit:!1,Sortable:!0},{Name:"Capture Date",ValueName:"CaptureDate",Edit:!1,Sortable:!0},{Name:"Action",CellFormat:"button",CellFormatData:{Text:"Refund",onClick:function(e){N.getPaymentBillingDetails(e.WoId).then(function(t){N.processRefund(e,v.transactionList).then(function(e){e&&r(function(){$()})})})}}}],!e.$parent.vm.isReadOnly&&e.$parent.vm.roleUsingPayments||(v.gridAttributes=b("filter")(v.gridAttributes,{Name:"!Action"},!0)),!e.$parent.vm.isReadOnly&&e.$parent.vm.roleUsingPayments)var T=e.$watch("pc.transactionCount",function(){-1!==v.transactionCount&&(v.transactionCount>0&&$(),T())})}angular.module("FieldConnectApp").controller("WoPaymentController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","$timeout","restService","cryptoStorageService","qsService","stateTransitionService","Notification","$window","currentUserService","$rootScope","$templateCache","fcGeoLocationService","fcPaymentService","$filter"]}();;!function(){"use strict";function e(e,o,t){var n=this;n.$scope=e,n.id=e.id,n.apiMethod=e.apiMethod,n.timezone=e.timezone,n.customFocus=e.customFocus,n.viewName=e.viewName,n.moduleName=e.moduleName,n.filter=e.filter,n.modalClass=!1,n.hideSubmit=!1,n.onBack=a,n.onSubmit=function(){n.isLoading=!0,t.submitPayment(n.model).then(function(e){e?o(function(){n.isLoading=!1,a(!0)}):n.isLoading=!1},function(e){n.isLoading=!1})},n.model=e.model,n.woId=e.woId,n.attributes=t.getPaymentAttributes(),n.isLoading=!0,o(function(){n.modalClass=!0,t.getPaymentBillingDetails(n.woId).then(function(e){o(function(){n.model.Amount=e.Amount,n.model.CardHolder=e.ContactName,n.model.CardHolderEmail=e.ContactEmail,n.model.PostalCode=e.PostalCode,n.isLoading=!1})},function(e){n.isLoading=!1})}),e.hideSubmit&&(n.hideSubmit=e.hideSubmit);var i=e.$watch("vm.model.PaymentType",function(o,i){o!==i&&(null==n.model.PaymentType?n.model.PaymentType="cc":n.model.PaymentType&&(e.$broadcast("clearValidationErrors"),n.model=t.clearModel(n.model),n.attributes=t.getPaymentAttributes(n.model.PaymentType)))});function a(o){e.onBack&&!e.onBack(o)||(e.$broadcast("destroyPaymentListener"),n.modalClass=!1,i(),e.close(o,200))}}angular.module("FieldConnectApp").controller("WoPaymentModalController",e),e.$inject=["$scope","$timeout","fcPaymentService"]}();;!function(){"use strict";function e(e,a,t,l){var o=this;o.$scope=e,o.tableReload=!0,o.reloadNoteTable=!0,o.reloadAttachmentTable=!0,o.showAdvanced=function(l){var m=e.$parent.vm.assignment,n=e.$parent.vm.model;t.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/woServiceableItemAdvancedModal.html",controller:"WoServiceableItemAdvancedController",controllerAs:"vm",inputs:{assignment:m,wo:n}}).then(function(t){t.close.then(function(){e.$emit("wo.assignmentChange"),e.$parent.vm.resetServiceableItemIdFilter(),o.tableReload=!1,a(function(){o.tableReload=!0})})})},o.moduleName="ServiceableItems",o.advancedButtonObjectName="btnAssignServiceableItemAdvanced",o.model={},o.attributes=[{Type:"text",Label:"Serviceable Item:",MaxLength:"50",ModelValue:"ServiceableItemName",ReadOnly:!0},{Type:"int",Label:"Year Mfr:",Required:!1,ModelValue:"YearMfr",ReadOnly:!0},{Type:"text",Label:"Manufacturer:",MaxLength:"50",ModelValue:"Mfr",ReadOnly:!0},{Type:"text",Label:"Class:",MaxLength:"50",ModelValue:"ClassName",ReadOnly:!0},{Type:"text",Label:"Model:",MaxLength:"50",ModelValue:"Model",ReadOnly:!0},{Type:"text",Label:"Type:",MaxLength:"50",ModelValue:"TypeName",ReadOnly:!0},{Type:"text",Label:"Serial Number:",MaxLength:"50",ModelValue:"SerialNum",ReadOnly:!0},{Type:"text",Label:"Location:",MaxLength:"50",ModelValue:"Location",ReadOnly:!0}],o.attributesNote=[{Name:"Date Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Customer Viewable ",ValueName:"CustomerViewable",Edit:!1,Sortable:!1,CellFormat:"checkbox"},{Name:"Note",ValueName:"Note",Edit:!0,Sortable:!0}],o.attributesAttachment=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0}],o.gridAttributes=[{Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!1,Sortable:!0},{Name:"Manufacturer",ValueName:"Mfr",Edit:!1,Sortable:!0},{Name:"Model",ValueName:"Model",Edit:!1,Sortable:!0},{Name:"Serial Number",ValueName:"SerialNum",Edit:!1,Sortable:!0},{Name:"Asset tag",ValueName:"AssetTag",Edit:!1,Sortable:!0},{Name:"Location",ValueName:"Location",Edit:!1,Sortable:!0},{Name:"Class",ValueName:"ClassName",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"TypeName",Edit:!1,Sortable:!0}],o.editNote=function(t){l.editNote(t,e.$parent.vm.assignment.ServiceableItemId).then(function(e){o.reloadNoteTable=!1,a(function(){o.reloadNoteTable=!0})})},o.editAttachment=function(t){l.editAttachment(t,e.$parent.vm.assignment.ServiceableItemId).then(function(e){o.reloadAttachmentTable=!1,a(function(){o.reloadAttachmentTable=!0})})}}angular.module("FieldConnectApp").controller("WoServiceableItemController",e),e.$inject=["$scope","$timeout","ModalService","woServiceableItemService"]}();;!function(){"use strict";function e(e,t,a,l,i,o,r,n,d,s,m,u){var c=this;c.$scope=e,c.attributes=e.attributes,c.wo=e.wo,c.assignment=e.assignment,c.apiMethod=e.apiMethod,c.timezone=e.timezone,c.customFocus=e.customFocus,c.viewName=e.viewName,c.moduleName=e.moduleName,c.filter=e.filter,c.modalClass=!1,c.reloadTable=!0,c.reloadEditForm=!0,c.reloadNewForm=!0,c.reloadServiceableItemTable=!0,c.isLoading=!1,c.reloadNotesTable=!0,c.reloadAttachmentsTable=!0,c.reloadNewDataPlateTable=!1,c.showEditTabs=!1,c.editViewName="editView",c.newViewName="newView",c.listFilter=a.filter("and"),c.listFilter.eq("SiteId",c.wo.SiteId),c.autoFilterClass=a.filter("and"),c.autoFilterClass.eq("ServiceableItemClassId",0),c.newAutoFilterClass=a.filter("and"),c.newAutoFilterClass.eq("ServiceableItemClassId",0),c.serviceableItemIdFilter=a.filter("and"),c.serviceableItemIdFilter.eq("ServiceableItemId",c.assignment.ServiceableItemId),c.woesFilter=a.filter("and"),c.woesFilter.eq("CustomerId",c.wo.CustomerId),c.woesFilter.eq("ServiceableItemId",c.assignment.ServiceableItemId),c.dataPlateList=[],c.newModel={},c.editModel={},c.noteModel={CustomerViewable:!1,Note:"",ServiceableItemId:c.assignment.ServiceableItemId},c.newNoteModel={CustomerViewable:!1,Note:"",ServiceableItemId:null},c.editNoteModel={CustomerViewable:!1,Note:"",ServiceableItemId:null},c.onBack=function(t){if(e.onBack&&!e.onBack(t))return;e.close(t,200)},c.assignItem=N,c.newSubmit=function(){c.isLoading=!0,c.newModel.CustomerId=c.wo.CustomerId,c.newModel.SiteId=c.wo.SiteId,o.create("serviceableitems",c.newModel).then(function(t){var a;r.success("Serviceable Item has been added!"),c.usingXOiIntegration&&(""!==c.newNoteModel.Note&&(c.noteModel.Note=c.newNoteModel.Note,c.noteModel.ServiceableItemId=t.data.Id,g()),a=c.newViewName,c.usingXOiIntegration&&e.$broadcast("removeSelected",a),f(c.newViewName))}).then(function(){S(),M(),c.isLoading=!1},function(e){c.isLoading=!1})},c.usingXOiIntegration=u.usingXOiIntegration(),c.hideXOi="hidden",c.usingXOiIntegration&&(c.hideXOi="");var b=new Date;function I(){if(c.woesFilter.reset(),c.woesFilter.eq("CustomerId",c.wo.CustomerId),c.woesFilter.eq("ServiceableItemId",c.woesFilter1.ServiceableItemId),""!=c.woesFilter1.startDate&&null!=c.woesFilter1.startDate){c.woesFilter1.startDate=new Date(c.woesFilter1.startDate),c.woesFilter1.startDate.setHours(0,0,0,0);var e=new Date(c.woesFilter1.startDate);s.convertToUtc(e),c.woesFilter.eq("startDate",s.buildISOString(e))}if(""!=c.woesFilter1.endDate&&null!=c.woesFilter1.endDate){c.woesFilter1.endDate=new Date(c.woesFilter1.endDate),c.woesFilter1.endDate.setHours(23,59,59,999);var t=new Date(c.woesFilter1.endDate);s.convertToUtc(t),c.woesFilter.eq("endDate",s.buildISOString(t))}}function N(e){d.assignItem(e.Id,c.assignment).then(function(e){e&&(f(c.editViewName),w())})}function w(){c.reloadEditForm=!1,t(function(){c.reloadEditForm=!0})}function S(){c.reloadNewForm=!1,t(function(){c.reloadNewForm=!0})}function v(){c.reloadNotesTable=!1,t(function(){c.reloadNotesTable=!0})}function M(){c.reloadServiceableItemTable=!1,t(function(){c.reloadServiceableItemTable=!0})}function f(t){c.usingXOiIntegration&&e.$broadcast("resetGrid",t)}function g(){""!==c.noteModel.Note&&(r.warning("Adding serviceable item note, please wait..."),o.create("serviceableitemnotes",c.noteModel).then(function(e){r.success("Serviceable Item Note added!"),c.noteModel={CustomerViewable:!1,Note:"",ServiceableItemId:c.assignment.ServiceableItemId},v()}))}b.setDate(b.getDate()-90),c.woesFilter1={startDate:b,endDate:new Date,ServiceableItemId:c.assignment.ServiceableItemId},c.assignment.ServiceableItemId&&(I(),c.showEditTabs=!0),t(function(){c.modalClass=!0}),c.listAttributes=[{Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!1,Sortable:!0},{Name:"Manufacturer",ValueName:"Mfr",Edit:!1,Sortable:!0},{Name:"Model",ValueName:"Model",Edit:!1,Sortable:!0},{Name:"Serial Number",ValueName:"SerialNum",Edit:!1,Sortable:!0},{Name:"Asset tag",ValueName:"AssetTag",Edit:!1,Sortable:!0},{Name:"Location",ValueName:"Location",Edit:!1,Sortable:!0},{Name:"Class",ValueName:"ClassName",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"TypeName",Edit:!1,Sortable:!0},{Name:"Change",CellFormat:"button",CellFormatData:{Text:"Select",onClick:N}}],c.editAttributes=[{Type:"text",Label:"Serviceable Item:",MaxLength:"50",ModelValue:"ServiceableItemName",ReadOnly:!0},{Type:"int",Label:"Year Mfr:",Required:!1,ModelValue:"YearMfr",ReadOnly:!1},{Type:"text",Label:"Manufacturer:",MaxLength:"50",ModelValue:"Mfr",ReadOnly:!1},{Type:"dropdown",Label:"Class:",ApiMethod:"serviceableItemClasses",ValueProp:"Id",TextProp:"ClassName",ModelValue:"ClassId",ConvertToInt:"true"},{Type:"text",Label:"Model:",MaxLength:"50",ModelValue:"Model",ReadOnly:!1},{Type:"dropdown",Label:"Type:",ApiMethod:"serviceableItemTypes",ValueProp:"Id",TextProp:"TypeName",ModelValue:"TypeId",ConvertToInt:"true",Filter:c.autoFilterClass},{Type:"text",Label:"Serial Number:",MaxLength:"50",ModelValue:"SerialNum",ReadOnly:!1},{Type:"text",Label:"Location:",MaxLength:"50",ModelValue:"Location",ReadOnly:!1}],c.noteAttributes=[{Name:"Date Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Customer Viewable ",ValueName:"CustomerViewable",Edit:!1,Sortable:!1,CellFormat:"checkbox"},{Name:"Note",ValueName:"Note",Edit:!0,Sortable:!0}],c.attachmentAttributes=[{Name:"Date /Time",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Type",ValueName:"AttachmentType",Edit:!1,Sortable:!0}],c.newAttributes=[{Type:"text",Label:"Serviceable Item:",MaxLength:"50",ModelValue:"ServiceableItemName",ReadOnly:!1,Required:!0},{Type:"int",Label:"Year Mfr:",Required:!1,ModelValue:"YearMfr",ReadOnly:!1},{Type:"text",Label:"Manufacturer:",MaxLength:"50",ModelValue:"Mfr",ReadOnly:!1},{Type:"dropdown",Label:"Class:",ApiMethod:"serviceableItemClasses",ValueProp:"Id",TextProp:"ClassName",ModelValue:"ClassId",ConvertToInt:"true"},{Type:"text",Label:"Model:",MaxLength:"50",ModelValue:"Model",ReadOnly:!1},{Type:"dropdown",Label:"Type:",ApiMethod:"serviceableItemTypes",ValueProp:"Id",TextProp:"TypeName",ModelValue:"TypeId",ConvertToInt:"true",Filter:c.newAutoFilterClass},{Type:"text",Label:"Serial Number:",MaxLength:"50",ModelValue:"SerialNum",ReadOnly:!1},{Type:"text",Label:"Location:",MaxLength:"50",ModelValue:"Location",ReadOnly:!1}],c.woesAttributes=[{Name:"Work Order",ValueName:"AltId",Edit:!0,Sortable:!0},{Name:"Wo Type",ValueName:"WoType",Edit:!1,Sortable:!0},{Name:"Promised Date",ValueName:"PromiseDate",FormatDate:"datetime",Edit:!1,Sortable:!0},{Name:"Time Zone",ValueName:"TimeZoneName",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0},{Name:"Customer",ValueName:"CustomerName",Edit:!1,Sortable:!0},{Name:"Site",ValueName:"SiteName",Edit:!1,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Office",ValueName:"OfficeName",Edit:!1,Sortable:!0},{Name:"Agreement",ValueName:"AgreementDesc",Edit:!1,Sortable:!0}],e.$watch("vm.assignment.ServiceableItemId",function(e,t){e&&e!==t&&(c.serviceableItemIdFilter.reset(),c.serviceableItemIdFilter.eq("ServiceableItemId",e),c.woesFilter1.ServiceableItemId=e,I(),c.showEditTabs=!0)}),c.updateNotification=function(e){e?(r.success("Serviceable Item has been updated!"),c.usingXOiIntegration&&""!==c.editNoteModel.Note&&(c.noteModel.Note=c.editNoteModel.Note,g()),f(c.editViewName),w(),M()):(f(c.editViewName),w())},c.editNote=function(e){d.editNote(e,c.assignment.ServiceableItemId).then(function(e){v()})},c.editAttachment=function(e){d.editAttachment(e,c.assignment.ServiceableItemId).then(function(e){c.reloadAttachmentsTable=!1,t(function(){c.reloadAttachmentsTable=!0})})},c.goToWo=function(t,a){e.close(null,200),m.go("workOrdersDetails",{id:t})},c.newOnBack=function(e){e||(S(),c.usingXOiIntegration&&f(c.newViewName))},c.deleteEvent=function(e){e.Id!==c.assignment.ServiceableItemId?(c.isLoading=!0,o.remove("serviceableitems",e.Id).then(function(e){M()}).then(function(){c.isLoading=!1},function(e){c.isLoading=!1})):r.error("Serviceable Item is assigned and cannot be deleted!")},e.$watch("vm.editModel.ClassId",function(e,t){if(e||t){var a=0;c.editModel.ClassId&&(a=c.editModel.ClassId),c.autoFilterClass.reset(),c.autoFilterClass.eq("ServiceableItemClassId",a)}}),e.$watch("vm.newModel.ClassId",function(e,t){if(e||t){var a=0;c.newModel.ClassId&&(a=c.newModel.ClassId),c.newAutoFilterClass.reset(),c.newAutoFilterClass.eq("ServiceableItemClassId",a)}}),c.usingXOiIntegration&&e.$watch("vm.dataPlateList",function(e,t){e!==t&&(c.reloadNewDataPlateTable=!0)})}angular.module("FieldConnectApp").controller("WoServiceableItemAdvancedController",e),e.$inject=["$scope","$timeout","qsService","guiPrivilegeService","ModalService","restService","Notification","fcGeoLocationService","woServiceableItemService","timezoneService","$state","xoiService"]}();;!function(){"use strict";function e(e,t,a,r,s,n,i,o,l,c,d,m,g,u,I,f,k,v){var T=this;T.isActive=!1,T.woId=e.woId,T.agreementId=e.agreementId,T.siteId=e.siteId;var A=o.getValue("authorizationData").userRoles.split(","),S=!1,h=I.roleTypes,p={WoId:parseInt(T.woId),Tasks:[]};T.title=e.title,T.agreementTasks=[],T.customerRoles=!1;for(var $=0;$<A.length;$++)if("CustAdmin"!==A[$]&&"Cust"!==A[$]||(T.customerRoles=!0),"Technician"===h[$]||"SubContractor"===A[$]){S=!0;break}function F(t){e.close(t,200)}T.modalClass=!1,n(function(){T.modalClass=!0}),T.isTech=S,T.$state=a,T.moduleName="AgreementTask",T.cancel=F,T.showAvailableAgreementTasks=!0,T.agreementFilter=l.filter("and"),T.agreementFilter.eq("AgreementId",T.agreementId),T.agreementFilter.page=1,T.agreementFilter.pageSize=500,T.isLoading=!0,i.getItems("agreementtasks",T.agreementFilter).then(function(e){T.agreementTasks=e.data.Data,T.isLoading=!1,0===T.agreementTasks.length&&(T.showAvailableAgreementTasks=!1)}),e.taskFilter=function(e){return null===e.ServiceableItemId||e.SiteId===T.siteId},T.addAll=function(){for(var e=0;e<T.agreementTasks.length;e++)null!==T.agreementTasks[e].ServiceableItemId&&T.agreementTasks[e].SiteId!==T.siteId||(T.agreementTasks[e].Add=!T.addAllItems)},T.onSubmit=function(){T.isLoading=!0;var e=k("filter")(T.agreementTasks,{Add:!0});if(0!==e.length){for(var t=0;t<e.length;t++)p.Tasks.push(e[t].Id);i.create("wotasks/fromAgreement",p).then(function(e){T.isLoading=!1,F(e)},function(e){T.isLoading=!1})}else d.error("No Tasks Items have been selected!")}}angular.module("FieldConnectApp").controller("WOAddAgreementTaskController",e),e.$inject=["$scope","$location","$state","$stateParams","ModalService","$timeout","restService","cryptoStorageService","qsService","stateTransitionService","Notification","$window","currentUserService","$rootScope","rolesFactory","featuresFactory","$filter","fcGeoLocationService"]}();;!function(){"use strict";function e(e,t,a,o,l,s,n,r,d){var i=this;function u(){i.newRecord&&l(function(){i.model.Status="Open"})}i.editTask=function(t,a,s,r){i.model={WoId:parseInt(a),StandardTaskId:null};i.filterBySite.siteId=s,i.newRecord=!1,t||(i.newRecord=!0,"Add Task");r?i.taskattributes=i.subContractorAttributes:t?i.taskattributes=i.editTaskattributes:(i.taskattributes=i.newTaskattributes,i.watchStandardTask=e.$watch("wt.model.StandardTaskId",function(){i.model.StandardTaskId?n.getItem("standardTask",i.model.StandardTaskId).then(function(e){var t=e.data;l(function(){i.model.TaskName=t.Name,i.model.Desc=t.Description,i.model.TaskCode=t.TaskCode,i.model.Note=t.Note})}):l(function(){i.model.TaskName=null,i.model.Desc=null,i.model.TaskCode=null,i.model.Note=null})}));o.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Task edit",id:t,model:i.model,attributes:i.taskattributes,apiMethod:"wotasks",onBack:i.editData,moduleName:i.moduleName,viewName:i.viewName}}).then(function(e){e.close.then(function(){i.filter.Reload++,i.reloadTable=!1,t||r||i.watchStandardTask(),l(function(){i.reloadTable=!0})})})},i.$state=a,i.reloadTable=!0,i.filter={Reload:0},i.filterBySite={siteId:0},i.allTasks=[],i.drilldownFilter=r.filter("and"),i.drilldownSettings={ApiMethod:"woTasks",FilterFields:{Id:"Id"},ShowDeleteColumn:!1,attributes:[{Name:"Note",ValueName:"Note",Sortable:!0}]},i.viewName=e.vm.viewName,i.moduleName="Task",i.taskAttributeStandardTask={Type:"dropdown",Label:"Standard Task:",Required:!1,ApiMethod:"standardTask/ddlist",ValueProp:"Id",TextProp:"Name",ModelValue:"StandardTaskId",ConvertToInt:"true",ReadOnly:!1},i.taskAttributeServiceableItem={Type:"dropdown",Label:"Serviceable Item:",Silent:!0,ApiMethod:"serviceableitems/dropdownbysite",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",Filter:i.filterBySite,ReadOnly:!0,OnLoaded:function(){l(function(){i.taskAttributeServiceableItem.CurrentList&&i.taskAttributeServiceableItem.CurrentList.length>0?i.taskAttributeServiceableItem.ReadOnly=!1:i.taskAttributeServiceableItem.ReadOnly=!0})},ConvertToInt:"true"},i.attChangeStatus={Name:"Change Status",CellFormat:"button",CellFormatData:{Text:"Change Status",onClick:function(e){"Closed"!==e.Status?bootbox.confirm({message:"Close Task: "+e.TaskName+"?",buttons:{confirm:{label:"Yes",className:"btn-primary"},cancel:{label:"No",className:"btn-default"}},callback:function(t){t&&(e.Status="Closed",n.update("wotasks",e).then(function(t){d.success("Task: "+e.TaskName+" has been Closed!")}))}}):bootbox.confirm({message:"Task: "+e.TaskName+" has been Closed. Do you want to reopen the Task?",buttons:{confirm:{label:"Yes",className:"btn-primary"},cancel:{label:"No",className:"btn-default"}},callback:function(t){t&&(e.Status="Open",n.update("wotasks",e).then(function(t){d.success("Task: "+e.TaskName+" has been Opened!")}))}})}}},i.attributes=[{Type:"text",Name:"Standard Task",ValueName:"TaskCode",Edit:!1,Sortable:!0},{Name:"Task Name",ValueName:"TaskName",Edit:!0,Sortable:!0},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0},{Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!1,Sortable:!0},{Name:"Status",ValueName:"Status",Edit:!1,Sortable:!0}],e.$parent.vm.addTask&&i.attributes.push(i.attChangeStatus),i.newTaskattributes=[i.taskAttributeStandardTask,{Type:"line",CustomClass:"col-sm-12"},{Type:"text",Label:"Task Name:",MaxLength:"50",ModelValue:"TaskName",Required:!0},{Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"openclose/status",ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",OnLoaded:u},{Type:"textarea",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Desc"},{Type:"textarea",Label:"Note:",Required:!1,MaxLength:"500",ModelValue:"Note"},i.taskAttributeServiceableItem],i.editTaskattributes=[{Type:"text",Label:"Standard Task:",MaxLength:"10",ModelValue:"TaskCode",Required:!1,ReadOnly:!0},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"text",Label:"Task Name:",MaxLength:"50",ModelValue:"TaskName",Required:!0},{Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"openclose/status",ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status"},{Type:"textarea",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Desc"},{Type:"textarea",Label:"Note:",Required:!1,MaxLength:"500",ModelValue:"Note"},i.taskAttributeServiceableItem],i.subContractorAttributes=[{Type:"text",Label:"Task Name:",MaxLength:"50",ModelValue:"TaskName",Required:!0},{Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"openclose/status",ValueProp:"StatusName",TextProp:"StatusName",ModelValue:"Status",OnLoaded:u},{Type:"textarea",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Desc"},{Type:"textarea",Label:"Note:",Required:!1,MaxLength:"500",ModelValue:"Note"},i.taskAttributeServiceableItem],i.taskattributes=[],i.model={},i.deleteEvent=function(){e.$parent.vm.checkCustomerInfoChangeEnabled&&e.$parent.vm.checkCustomerInfoChangeEnabled()},i.editData=function(t){t&&"object"==typeof t&&e.$parent.vm.checkCustomerInfoChangeEnabled&&e.$parent.vm.checkCustomerInfoChangeEnabled(!0);return!0},i.newRecord=!1,i.completeAll=function(e){var t={WoId:e};0!==s("filter")(i.allTasks,{Status:"Open"}).length?bootbox.confirm({message:"Close All Tasks for current Work Order?",buttons:{confirm:{label:"Yes",className:"btn-primary"},cancel:{label:"No",className:"btn-default"}},callback:function(e){e&&n.update("wotasks/completeAll",t).then(function(e){d.success("All Tasks for the Work Order have been Closed!"),i.reloadTable=!1,l(function(){i.reloadTable=!0})})}}):d.warning("All Tasks for Work Order have been Closed!")},i.importAgreementTasks=function(e,t,a){o.showModal({templateUrl:"Templates/Agreements/addAgreementTaskModal.html",controller:"WOAddAgreementTaskController",controllerAs:"vm",inputs:{woId:e,agreementId:t,siteId:a,title:"Agreement Task Import"}}).then(function(e){e.close.then(function(e){e&&(i.reloadTable=!1,l(function(){i.reloadTable=!0}))})})}}angular.module("FieldConnectApp").controller("WoTaskController",e),e.$inject=["$scope","$location","$state","ModalService","$timeout","$filter","restService","qsService","Notification"]}();;!function(){"use strict";function e(e,t,a,r,s){this.currentDate=moment(),this.getIcon=d;var o=s.getValue("authorizationData");o.tzDatebaseName;function n(e){var t=new Date(e),a=moment.tz.zone(o.tzDatebaseName).offset(t);return r.convertToLocal(t,a)}function i(e,t){var a=e;t?a.setHours(0,0,0,0):a.setHours(23,59,59,999);var s=r.convertToUtc(a);return r.buildISOString(s)}function d(e){var t="far fa-angry";switch(e){case"Pie":t="fas fa-chart-pie";break;case"Gauge":t="fas fa-tachometer-alt";break;case"Line":t="fas fa-chart-line";break;case"Bar":t="fas fa-chart-bar"}return t}this.loadReports=function(r){var s=a.filter("or"),o=t.defer();s.reset();for(var n=0;n<r.length;n++)s.eq("RoleName",r[n]);return e.getItems("dashboardReports/ddList",s).then(function(e){var t=e.data.Data;const a=document.getElementById("cardlist");for(var r=0;r<t.length;r++){const e=document.createElement("li");e.id=t[r].Id,e.innerHTML='                        <div class="card dashboard-card-chart cursor_pointer" draggable="true">                            <i class="'+d(t[r].ChartType)+'"></i>                            <div>'+t[r].ReportTypeDescription+"</div>                        </div>                    ",a.appendChild(e)}o.resolve(t)}),o.promise},this.addUserReport=function(a){var r=t.defer();return a.Filters=null,e.create("dashboardUserReports",a).then(function(t){e.getItem("dashboardUserReports",t.data.Id).then(function(e){var t=e.data;r.resolve(t)})}),r.promise},this.loadUserReports=function(){var a=t.defer();return e.getItems("dashboardUserReports").then(function(e){var t=e.data.Data;a.resolve(t)}),a.promise},this.deleteUserReport=function(a){var r=t.defer();return e.remove("dashboardUserReports",a).then(function(e){r.resolve(!0)}),r.promise},this.updateUserReport=function(a){var r=t.defer();return e.update("dashboardUserReports/"+a.Id,a).then(function(e){r.resolve(e)}),r.promise},this.getChart=function(r){(function(r){var s=t.defer(),o=function(e){for(var t=a.filter("and"),r=JSON.parse(e.Filters),s=Object.keys(r),o=0;o<s.length;o++)if(null!==r[s[o]])switch(s[o].toLowerCase()){case"wostatus":t.eq("Status",r[s[o]]),t.eq("WoStatus",r[s[o]]);break;case"assignstatus":t.eq("AssignStatus",r[s[o]]);break;case"lastdays":var d=new Date(moment().subtract(r[s[o]],"days").format("YYYY-MM-DD").split("-")),l=new Date(moment().format("YYYY-MM-DD").split("-"));t.eq("StartDate",i(d,!0)),t.eq("EndDate",i(l,!1));break;case"wotype":t.eq("WoType",r[s[o]]);break;case"labortype":t.eq("LaborType",r[s[o]]);break;case"startdate":case"payperiodstartdate":var d=n(r[s[o]]);t.eq("StartDate",i(d,!0));break;case"enddate":case"payperiodenddate":var l=n(r[s[o]]);t.eq("EndDate",i(l,!1));break;case"currentdates":var c=r[s[o]].indexOf("last");if(-1!==c){var u=r[s[o]].split("last"),p=`${u[1]}s`;d=new Date(moment().subtract(1,p).startOf(u[1]).format("YYYY-MM-DD").split("-")),l=new Date(moment().subtract(1,p).endOf(u[1]).format("YYYY-MM-DD").split("-"))}else d=new Date(moment().startOf(r[s[o]]).format("YYYY-MM-DD").split("-")),l=new Date(moment().endOf(r[s[o]]).format("YYYY-MM-DD").split("-"));t.eq("StartDate",i(d,!0)),t.eq("EndDate",i(l,!1));break;case"laborgroup":t.eq("LaborGroup",r[s[o]]);break;case"weekdays":t.eq("StartDay",r[s[o]]);break;case"numweeks":t.eq("NumWeeks",r[s[o]]);break;case"payratemulti":t.eq("PayRate",r[s[o]]);break;case"wostatusmulti":t.eq("WoStatusMulti",r[s[o]]);break;case"daysforward":var l=new Date(moment().add(r[s[o]],"days").format("YYYY-MM-DD").split("-"));t.eq("EndDate",i(l,!1));break;case"daysback":var d=new Date(moment().subtract(r[s[o]],"days").format("YYYY-MM-DD").split("-"));t.eq("StartDate",i(d,!0));break;case"servicerequeststatus":t.eq("ServiceRequestStatus",r[s[o]]);break;case"lastdates":var p=`${r[s[o]]}s`,d=new Date(moment().subtract(1,p).startOf(r[s[o]]).format("YYYY-MM-DD").split("-")),l=new Date(moment().subtract(1,p).endOf(r[s[o]]).format("YYYY-MM-DD").split("-"));t.eq("StartDate",i(d,!0)),t.eq("EndDate",i(l,!1));break;case"deficiencystatusmulti":t.eq("DeficiencyStatusMulti",r[s[o]]);break;case"deficiencyseveritymulti":t.eq("DeficiencySeverityMulti",r[s[o]]);break;case"techbygroupmulti":t.eq("TechByGroupMulti",r[s[o]])}return t.eq("Report",e.ReportIdentifier),t}(r);return e.getItems(r.Api,o).then(function(e){s.resolve(e)}),s.promise})(r).then(function(e){var t=JSON.parse(e.data),a=function(e,t){var a=JSON.parse(t),r=JSON.parse(e.Filters),s=JSON.parse(e.DatasetTemplate),o=JSON.parse(e.Configuration),n={type:null,data:null,options:null},i=[];switch(e.ChartType){case"Gauge":var d=a[0],l=d[r[s.DataValue]];void 0===l&&(l=d[s.DataValue]);var u=d[s.PercentageValue],p={};p=u?{valueColor:"#ff7143",value:`${u}%`}:{valueColor:"#ff7143",value:l};var b=d[s.TotalValue],f=[0,l,b];n.type="tsgauge",n.options={events:[],showMarkers:!0},n.data={datasets:[{backgroundColor:["#0fdc63","#fd9704","#ff7143"],borderWidth:0,gaugeData:p,gaugeLimits:f}]};break;case"Pie":var d=a[0],m=Object.keys(d),v=o.PieType,h={data:[],backgroundColor:[],borderColor:[],borderWidth:1};n.type=v,n.data={labels:[],datasets:[]};for(var D=0;D<m.length;D++)i.push(m[D]),h.data.push(d[m[D]]),h.backgroundColor.push(c(D));n.data.labels=i,n.data.datasets.push(h);break;case"Bar":var d=a,m=Object.keys(d[0]),g="true"===o.BarType,v=o.BarOrientation;void 0==v&&(v="bar"),n.type=v,n.data={labels:[],datasets:[]},void 0==s.Combo?n.options={scales:{xAxes:[{stacked:g,ticks:{beginAtZero:!0}}],yAxes:[{stacked:g,ticks:{beginAtZero:!0}}]}}:n.options={scales:{xAxes:[{stacked:g,ticks:{beginAtZero:!0}}],yAxes:[{id:"A",type:"linear",position:"left",ticks:{beginAtZero:!0},gridLines:{display:!0}}]}};for(var y={id:"B",type:"linear",position:"right",ticks:{beginAtZero:!0},gridLines:{display:!1}},D=0;D<m.length;D++)m[D]!==s.DatasetLabel&&i.push(m[D]);n.data.labels=i;for(var D=0;D<d.length;D++){for(var h={label:null,data:[],backgroundColor:[],borderColor:[],borderWidth:1,type:null,fill:null,yAxisID:null,order:1},k=0;k<m.length;k++)h.backgroundColor.push(c(D)),m[k]!==s.DatasetLabel?h.data.push(d[D][m[k]]):h.label=d[D][s.DatasetLabel];void 0!==s.Combo&&(s.Combo.DatasetLabel==h.label?(n.options.scales.yAxes.push(y),h.type=s.Combo.ChartType,h.fill=!1,h.yAxisID="B",h.lineTension=0,h.order=0):h.yAxisID="A"),n.data.datasets.push(h)}}return n}(r,t);!function(e,t){var a=document.getElementById("myChart-"+e.Id).getContext("2d");new Chart(a,{type:t.type,data:t.data,options:t.options})}(r,a)})};const l=["rgb(153, 102, 255, 1)","rgb(255, 205, 86, 1)","rgb(54, 162, 235, 1)","rgb(255, 159, 64, 1)","rgb(75, 192, 192, 1)","rgb(255, 99, 132, 1)","rgb(0, 204, 0, 1)","rgb(201, 203, 207, 1)"];function c(e){return l[e%l.length]}}angular.module("FieldConnectApp").service("dashboardService",e),e.$inject=["restService","$q","qsService","timezoneService","cryptoStorageService"]}();;!function(){"use strict";function e(e,t,n,o,r,a,i){function s(){var e=a.getValue("authorization",!0);return e?e.access_token:null}function c(){if(!u())return null;var t=a.getValue("authorization",!0),n={grant_type:"refresh_token",scope:i.clientScopes,refresh_token:t.refresh_token},o={headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:"Basic "+btoa(i.clientId+":"+i.clientSecret)},transformRequest:l};return e.post(i.apiIdentityServiceBaseUri+"token",n,o).then(function(e){var t={access_token:e.data.access_token,refresh_token:e.data.refresh_token,token_type:e.data.token_type,token_expiration:moment().add(e.data.expires_in,"seconds")};return a.setValue("authorization",t,!0),e})}function u(){var e=a.getValue("authorization",!0);return null!==e&&null!==e.refresh_token}function l(e){var t=[];for(var n in e)t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}this.login=function(t){var n={username:t.username,password:t.password,grant_type:"password",scope:i.clientScopes,response_type:"token"},o={headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:"Basic "+btoa(i.clientId+":"+i.clientSecret)},transformRequest:l};return e.post(i.apiIdentityServiceBaseUri+"token",n,o).then(function(e){var t={access_token:e.data.access_token,refresh_token:e.data.refresh_token,token_type:e.data.token_type,token_expiration:moment().add(e.data.expires_in,"seconds")};return a.setValue("authorization",t,!0),e})},this.logOut=function(e,t,i){a.removeValue("authorization"),a.removeValue("authorizationData"),e&&(n.$$search=null,t&&i?n.url("/login?isCustomer=True&token="+i):n.path("/login"),o(function(){r.location.reload()}))},this.dpsLogin=function(t){var n={headers:{Authorization:"Bearer "+t}};return e.post(i.dpsBaseUri+"Account/ExternalLoginCallback",n).then(function(e){return console.log("DPS login success."),e},function(e,t){return console.log("DPS login failure."),e})},this.dpsLogout=function(){return e.post(i.dpsBaseUri+"Account/ExternalLogoutCallback",{}).then(function(e){return e})},this.impersonate=function(t){var n={userId:t,grant_type:"ImpersonationAuth",scope:i.clientScopes,accessToken:s(),response_type:"token"},o={headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:"Basic "+btoa(i.iclientId+":"+i.iclientSecret)},transformRequest:l};return e.post(i.apiIdentityServiceBaseUri+"token",n,o).then(function(e){var t={access_token:e.data.access_token,refresh_token:e.data.refresh_token,token_type:e.data.token_type,token_expiration:moment().add(e.data.expires_in,"seconds")};return a.setValue("authorization",t,!0),e})},this.isAccessTokenValid=function(){var e=!1,n=a.getValue("authorization",!0);(e=null!=n&&null!=n.token_expiration)?moment().isAfter(moment(n.token_expiration))?i.useRefreshToken&&u()?c().then(function(){e=!0},function(){e=!1}):e=!1:e=!0:e=!1;return t.when(e)},this.getAccessToken=s,this.refreshAccessToken=c,this.canRefreshToken=u}angular.module("FieldConnectApp").service("authService",e),e.$inject=["$http","$q","$location","$timeout","$window","cryptoStorageService","ngAuthSettings"]}();;!function(){"use strict";function e(e,t,r,n,a,o,s){this.request=function(e){e.headers=e.headers||{},"GET"==e.method&&-1===e.url.indexOf(".html")&&(e.params=e.params||{},e.params.cache_buster=(new Date).toISOString());var t=r.getValue("authorization",!0);t&&!function(e){var t=!1;e.url&&(t=-1!=e.url.indexOf(s.apiIdentityServiceBaseUri));return t}(e)&&(e.headers.Authorization=t.token_type+" "+t.access_token);var n=r.getValue("remoteKey",!0);n&&(e.headers.Key=n);return e},this.responseError=function(t){var r=o.get("authService");if(401===t.status&&r.canRefreshToken()){if(i)return e.reject(t);i=!0;for(var n=e.defer(),a=[],s=o.get("httpRequestHandler"),u=s.getRequests(),c=0;c<u.length;c++)u[c].cancel(),u[c].replace(n.promise);r.refreshAccessToken().then(function(){i=!1,u=s.getRequests();for(var e=0;e<u.length;e++)a&&u[e].resend();n.resolve()},function(){i=!1,r.logOut(!0)})}else 401===t.status&&r.logOut(!0);return e.reject(t)};var i=!1}angular.module("FieldConnectApp").service("AuthorizationInterceptor",e),e.$inject=["$q","$location","cryptoStorageService","$window","$timeout","$injector","ngAuthSettings"]}();;!function(){"use strict";function e(e,t,a,r){this.generatePDF=function(t,s,o){r.success({message:"PDF report Exporting....."}),e.downloadFile(t,s).then(function(e){if(200===e.status){var t=o+"Report-"+n+".pdf",s=angular.element("<a/>").css({display:"none"});angular.element(document.body).append(s);var c=new Blob([e.data],{type:"application/pdf"});a.detectIE()?window.navigator.msSaveBlob(c,t):(s.attr({href:window.URL.createObjectURL(c),target:"_blank",download:t})[0].click(),s.remove()),r.success({message:"Export PDF report successful"})}else r.error({message:"Export PDF report failed"})})},this.generateCSV=function(t,s,o){r.success({message:"CSV report Exporting....."}),e.getItems(t,s).then(function(e){if(200===e.status){var t=o+"Report-"+n+".csv",s=angular.element("<a/>").css({display:"none"});angular.element(document.body).append(s);var c=new Blob([e.data],{type:"text/csv;charset=utf-8;"});a.detectIE()?window.navigator.msSaveBlob(c,t):(s.attr({href:"data:attachment/csv;charset=utf-8,"+encodeURIComponent(e.data),target:"_blank",download:t})[0].click(),s.remove()),r.success({message:"Export CSV report successful"})}else r.error({message:"Export CSV report failed"})})};var n=t("date")(new Date,"MMddyyyy")}angular.module("FieldConnectApp").service("baseReportService",e),e.$inject=["restService","$filter","detectIEService","Notification"]}();;!function(){"use strict";function e(e,t,a,i){var n=this;return n.statusList=[],e.getItems("deficiencyStatus").then(function(e){n.statusList=e.data.Data}),function(s){n.siteFilter=a.filter("and"),n.statusFilter=a.filter("and"),n.model=s,this.setSiteFilterId=function(e){n.siteFilter.reset(),n.siteFilter.eq("SiteId",e)},this.setStatusFilterId=function(e){n.statusFilter.reset(),n.statusFilter.neq("Id",e)},this.getConversionStatusNameId=function(){var e=t.defer(),n=a.filter("or");return n.eq("Name","DeficiencyQuoteConversionStatus"),i.getCompanySettings(n).then(function(){var t=i.DeficiencyQuoteConversionStatus;e.resolve(t)}),e.promise},this.getDeficiencies=function(a){var i=t.defer();return e.getItems("deficiency",a).then(function(e){i.resolve(e.data.Data)}),i.promise},this.setStatusAction=function(e){var t=n.statusList.findIndex(t=>t.Id===e),a=!1;if(-1!==t)switch(n.statusList[t].Action.toLowerCase()){case"readonly":this.showReasonFields(!1,!0),a=!0;break;case"readonlywnote":this.showReasonFields(!0,!0),a=!0;break;case"open":this.showReasonFields(!1,!0),a=!1}return this.setFieldsReadOnlyFlag(a),a},this.getStatusActionName=function(e){var t=n.statusList.findIndex(t=>t.Id===e);return-1!==t?n.statusList[t].Action.toLowerCase():null},this.getDeficiencyEditAttributes=function(){return n.status={Type:"dropdown",Label:"Status:",Required:!0,ApiMethod:"deficiencyStatus/ddList",ValueProp:"Id",TextProp:"StatusName",ModelValue:"StatusId",ConvertToInt:!0,ReadOnly:!1,Filter:n.statusFilter},n.severity={Type:"dropdown",Label:"Severity:",Required:!0,ApiMethod:"deficiencySeverity/ddList",ValueProp:"Id",TextProp:"SeverityName",ModelValue:"SeverityId",ConvertToInt:!0,ReadOnly:!1},n.description={Type:"textarea",Label:"Description:",Required:!0,MaxLength:"250",ModelValue:"Description",ReadOnly:!1},n.solution={Type:"textarea",Label:"Solution:",Required:!0,MaxLength:"250",ModelValue:"Solution",ReadOnly:!1},n.serviceableItem={Type:"dropdown",Label:"Serviceable Item:",Required:!1,ApiMethod:"serviceableitems",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",ConvertToInt:!0,ReadOnly:!1,Filter:n.siteFilter},n.attWoLine1={Type:"hidden",CustomClass:"col-sm-12"},n.reason={Type:"hidden",Label:"Reason:",Required:!1,MaxLength:"500",ModelValue:"Note",ReadOnly:!1},[n.status,n.severity,n.description,n.solution,n.serviceableItem,n.attWoLine1,n.reason]},this.performStatusAction=function(e){var t=n.statusList.findIndex(t=>t.Id===e);if(-1!==t)switch(n.statusList[t].Action.toLowerCase()){case"readonly":this.showReasonFields(!1,!0),this.clearReasonFields();break;case"readonlywnote":this.showReasonFields(!0,!1);break;case"open":this.showReasonFields(!1,!0),this.clearReasonFields()}return e},this.showReasonFields=function(e,t){e?(n.attWoLine1.Type="line",n.reason.Type="textarea"):(n.attWoLine1.Type="hidden",n.reason.Type="hidden"),t?(n.reason.ReadOnly=!0,n.reason.Required=!1):(n.reason.ReadOnly=!1,n.reason.Required=!0)},this.clearReasonFields=function(){n.model.Note=null},this.setStatusReadOnlyFlag=function(e){n.status.ReadOnly=e},this.setFieldsReadOnlyFlag=function(e){n.severity.ReadOnly=e,n.description.ReadOnly=e,n.solution.ReadOnly=e,n.serviceableItem.ReadOnly=e,n.reason.ReadOnly=e},this.getDeficiencyGridAttributes=function(){return[{Size:150,Name:"Description",ValueName:"Description",Edit:!0,Sortable:!0},{Size:15,Name:"Status",ValueName:"StatusName",Edit:!1,Sortable:!0},{Size:15,Name:"Severity",ValueName:"SeverityName",Edit:!1,Sortable:!0},{Size:25,Name:"Serviceable Item",ValueName:"ServiceableItemName",Edit:!1,Sortable:!0}]},this.getDeficiencyNotesGridAttributes=function(){return[{Name:"Date Time",ValueName:"SysModifyUTC",Edit:!0,Sortable:!0,FormatDate:"datetime"},{Name:"Created By",ValueName:"FullName",Edit:!1,Sortable:!0},{Name:"Note",ValueName:"Note",CompareValueName:"QuNote",Edit:!1,Sortable:!0}]},this.getDeficiencyNotesEditAttributes=function(){return[{Type:"dropdown",Label:"Standard Note:",ApiMethod:"notelibs",ValueProp:"Note",TextProp:"NoteTitle",Autofocus:"true",ModelValue:"NoteTemp",Filter:a.filter("and").eq("NoteType","Deficiency")},{Type:"empty",CustomClass:"fc-empty-control col-sm-6"},{Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note",Required:!0,Rows:10}]},this.getDeficiencyAttachmentsGridAttributes=function(){return[{Name:"Date",ValueName:"SysCreateUTC",Edit:!1,Sortable:!0,FormatDate:"datetime"},{Name:"Name",ValueName:"AttachmentName",Edit:!1,Sortable:!0,CellFormat:"download",DownloadValueName:"Attachment"},{Name:"Type",ValueName:"AttachmentTypeName",Edit:!1,Sortable:!0},{Name:"Attached To",ValueName:"AttachedTo",Edit:!1,Sortable:!1},{Name:"Description",ValueName:"Desc",Edit:!1,Sortable:!0}]},this.getDeficiencyAttachmentsEditAttributes=function(){return[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"Id",TextProp:"AttachmentTypeName",ModelValue:"AttachmentTypeId",Filter:a.filter("and").eq("attachmentCategory","Deficiency")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName",ReadOnly:!1},{Type:"text",Label:"Description:",Required:!0,MaxLength:"200",ModelValue:"Desc",ReadOnly:!1},{Type:"file",Label:"File:",ApiMethod:"deficiencyAttachment/file",Required:!0,ReadOnly:!1}]}}}angular.module("FieldConnectApp").service("deficiencyService",e),e.$inject=["restService","$q","qsService","currentCompanyService"]}();;!function(){"use strict";function e(e,a,r,t,s){var o={fromDate:new Date,toDate:new Date,technicianIds:"",omitCompletedWO:!1,onlyUnassignedWO:!1,workOrderTypeIds:"",timeZoneId:"",workOrderStatusIds:"100000000",workOrderPriorityIds:"",serviceAreaIds:"",isWo:!0,isTech:!0};function n(e){var a="",r="blue",t="home";return e.hasOwnProperty("IsTechToday")?(a=e.FullName,t="user",r="red"):a=e.SiteName+"<br/>"+e.Address+"<br/>"+e.City+", "+e.StateCode+", "+e.PostalCode,{lat:parseFloat(e.Latitude),lng:parseFloat(e.Longitude),message:a,focus:!1,draggable:!1,icon:{type:"awesomeMarker",icon:t,markerColor:r}}}this.drawMapMarkers=function(a){var t=e.defer(),i={markers:[],bounds:[]};return o.technicianIds=a.TechIds,r.getItems("woassignments/assignedgeo",a.geoFilters).then(function(e){e.data.Data.forEach(e=>{if(null!==e.Latitude){var a=n(e);i.markers.push(a)}}),r.getItems("dispatchmap",o).then(function(e){e.data.Data.forEach(e=>{if(e.IsTechToday){var a=n(e);i.markers.push(a)}}),i.bounds=function(e){var a=0,r=0,t=0,o=0,n=!1,i=[];e.forEach(e=>{n||(a=parseFloat(e.lng),r=parseFloat(e.lng),t=parseFloat(e.lat),o=parseFloat(e.lat),n=!0),(isNaN(o)||parseFloat(e.lat)<=o)&&n&&(o=parseFloat(e.lat)),(isNaN(t)||parseFloat(e.lat)>=t)&&n&&(t=parseFloat(e.lat)),(isNaN(r)||parseFloat(e.lng)<=r)&&n&&(r=parseFloat(e.lng)),(isNaN(a)||parseFloat(e.lng)>=a)&&n&&(a=parseFloat(e.lng))}),i=!isNaN(o)&&0!=o||!isNaN(r)&&0!=r||!isNaN(t)&&0!=t||!isNaN(a)&&0!=a?s.createBoundsFromArray([[o,r],[t,a]]):s.createBoundsFromArray([[28.604551,-125.117236],[47.148621,-61.150809]]);return i}(i.markers),t.resolve(i)})}),t.promise}}angular.module("FieldConnectApp").service("dispatchCalendarMapService",e),e.$inject=["$q","qsService","restService","cryptoStorageService","leafletBoundsHelpers"]}();;!function(){"use strict";function e(e){this.getAddress=function(t){return e.getAddress(t).then(function(e){this.state.address=e.data.Data}.bind(this))},this.state={address:{}}}angular.module("FieldConnectApp").service("AddressService",e),e.$inject=["AddressServiceFactory"]}();;!function(){"use strict";function n(n){this.getCompanyInfo=function(){return n.getCompanyInfo().then(function(n){this.state.companyInfo=n.data.Data}.bind(this))},this.update=function(t){return n.update(t)},this.state={companyInfo:{}}}angular.module("FieldConnectApp").service("companyInfoService",n),n.$inject=["companyInfoFactory"]}();;!function(){"use strict";function t(t){this.getContact=function(n){return t.getContact(n).then(function(t){this.state.contact=t.data.Data}.bind(this))},this.state={contact:{}}}angular.module("FieldConnectApp").service("ContactService",t),t.$inject=["ContactServiceFactory"]}();;!function(){"use strict";function t(t){var e=this;this.getCustomers=function(){return t.getCustomers().then(function(t){e.state.customers=t.data.Data,e.state.customersMeta=t.data.Meta}.bind(this))},this.getCustomer=function(e){return t.getCustomer(e).then(function(t){this.state.customer=t.data.Data}.bind(this))},this.update=function(e){t.update(e)},this.create=function(e){t.create(e)},this.state={customers:[],customersMeta:{},customer:{}}}angular.module("FieldConnectApp").service("CustomerService",t),t.$inject=["CustomerServiceFactory"]}();;!function(){"use strict";function t(t){this.getItem=function(e){return t.getItem(e).then(function(t){this.state.item=t.data}.bind(this))},this.getItems=function(e){return t.getItems(e).then(function(t){this.state.items=t.data.Data,this.state.itemsMeta=t.data.Meta}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={item:{},items:[],itemsMeta:{}}}angular.module("FieldConnectApp").service("itemService",t),t.$inject=["itemFactory"]}();;!function(){"use strict";function e(e,o,r,a,n,t){var i=this;i.model={},i.formValidation={},this.create=function(e){r.create("laborRounding",e).then(function(e){a.go("laborRoundingTable")})},this.update=function(e){r.update("laborRounding/"+e.Id,e).then(function(e){a.go("laborRoundingTable")})},this.checkValidation=function e(o,r,a){i.model=r;var n=!0;if(void 0==o)return;for(var t=0;t!=o.length;t++)switch(o[t].Type){case"group":n=e(o[t].Attributes,a);break;case"line":case"empty":break;case"file":void 0===i.files[o[t].Index]&&(n=!1);break;default:if(o[t].Required)if(i.formValidation[o[t].ModelValue]||(i.formValidation[o[t].ModelValue]={}),"email"==o[t].Type)if(void 0===i.model[o[t].ModelValue]||""===i.model[o[t].ModelValue]||null===i.model[o[t].ModelValue])i.formValidation[o[t].ModelValue].Error=!0,i.formValidation[o[t].ModelValue].Required=!0,i.formValidation[o[t].ModelValue].Email=!1,n=!1;else{/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i.test(i.model[o[t].ModelValue])?(i.formValidation[o[t].ModelValue].Error=!1,i.formValidation[o[t].ModelValue].Email=!1,i.formValidation[o[t].ModelValue].Required=!1):(i.formValidation[o[t].ModelValue].Error=!0,i.formValidation[o[t].ModelValue].Email=!0,i.formValidation[o[t].ModelValue].Required=!1,n=!1)}else void 0===i.model[o[t].ModelValue]||""===i.model[o[t].ModelValue]||null===i.model[o[t].ModelValue]||i.model[o[t].ModelValue].constructor===Array&&!i.model[o[t].ModelValue].length?(a||i.formValidation[o[t].ModelValue].Dirty)&&(i.formValidation[o[t].ModelValue].Error=!0,n=!1):(i.formValidation[o[t].ModelValue].Error=!1,i.formValidation[o[t].ModelValue].Dirty=!0)}return n},this.getLaborCostRounded=function(e){var o=t.defer();return n.getCompanySettings().then(function(a){var t=n.TrackRealTimeRoundLaborCost;if(null!==t)r.getItems("laborRounding/intervals/"+t).then(function(r){var a=r.data.Data,n=i.roundHours(e,a),t=i.convertToHours(n);o.resolve(t)});else{var l=i.convertToHours(e);o.resolve(l)}}),o.promise},this.getLaborBillingRounded=function(e){var o=t.defer();return n.getCompanySettings().then(function(a){var t=n.TrackRealTimeRoundLaborBilling;if(null!==t)r.getItems("laborRounding/intervals/"+t).then(function(r){var a=r.data.Data,n=i.roundHours(e,a),t=i.convertToHours(n);o.resolve(t)});else{var l=i.convertToHours(e);o.resolve(l)}}),o.promise},i.convertToHours=function(e){var o=(e/36e5).toFixed(2);return Number(o)},i.convertToMinutes=function(e){var o=(e/6e4).toFixed(0);return Number(o)},i.roundHours=function(e,o){var r=moment.duration(e).days(),a=moment.duration(e).hours(),n=moment.duration(e).minutes(),t=moment.duration(e).seconds(),l=i.convertToMinutes(Number(6e4*n+1e3*t)),u=e;u=864e5*r+36e5*a+6e4*l;for(var d=0;d<=o.length;d++)if(l>=o[d].FromMinutes&&l<=o[d].ToMinutes){1===o[d].Interval?u-=6e4*l:u=u-6e4*l+6e4*o[d].Interval;break}return u}}angular.module("FieldConnectApp").service("LaborRoundingService",e),e.$inject=["$http","ngAuthSettings","restService","$state","currentCompanyService","$q"]}();;!function(){"use strict";function t(t){this.getRateSheets=function(e){return t.getRateSheets(e).then(function(t){this.state.rateSheets=t.data.Data,this.state.rateSheetsMeta=t.data.Meta}.bind(this))},this.getRateSheet=function(e){return t.getRateSheet(e).then(function(t){this.state.rateSheet=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={rateSheet:{},rateSheets:[],rateSheetsMeta:{}}}angular.module("FieldConnectApp").service("rateSheetService",t),t.$inject=["rateSheetFactory"]}();;!function(){"use strict";function t(t){this.getTaxRates=function(e){return t.getTaxRates(e).then(function(t){this.state.taxRates=t.data.Data,this.state.taxRatesMeta=t.data.Meta}.bind(this))},this.getTaxRate=function(e){return t.getTaxRate(e).then(function(t){this.state.taxRate=t.data.Data}.bind(this))},this.getStates=function(){return t.getStates().then(function(t){this.state.states=t.data.Data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={taxRate:{},taxRates:[],taxRatesMeta:{},states:{}}}angular.module("FieldConnectApp").service("taxRateService",t),t.$inject=["taxRateFactory"]}();;!function(){"use strict";function e(e){this.processCoverage=function(r){var a={partsCovered:!1,miscCovered:!1,laborCovered:!1,laborMarkup:0};if(r){var t=new Array(7);t[0]="Sunday",t[1]="Monday",t[2]="Tuesday",t[3]="Wednesday",t[4]="Thursday",t[5]="Friday",t[6]="Saturday";var o=new Date;o=e.parseISOString(o.toISOString());for(var n=e.convertToLocal(o),i=n.getDay(),s=n.getHours(),v=n.getMinutes(),d="",u=0;u<r.length;u++){d=6==i||0==i?"Weekend":"Weekday";var c=e.parseISOString(r[u].StartTime),S=e.parseISOString(r[u].EndTime),g=c.getHours(),y=S.getHours(),l=c.getMinutes(),p=S.getMinutes(),C=e.parseISOString(r.StartDate);C=e.convertToLocal(C);var D=e.parseISOString(r.EndDate);D=e.convertToLocal(D);var M=!1,m=!1;g<=s?g+1<=s?M=!0:l<=v&&(M=!0):M=!1,y>=s?y-1>=s?m=!0:p>=v&&(m=!0):m=!1,"Active"==r[u].Status&&(r[u].Day==t[i]||r[u].Day==d||"All Days"==r[u].Day)&&C<=n&&D>n&&m&&M&&(a.partsCovered=r[u].PartsCovered,a.miscCovered=r[u].MiscCovered,a.laborCovered=r[u].LaborCovered,a.laborMarkup=r[u].LaborMarkup)}}return a}}angular.module("FieldConnectApp").service("agreementCoverageService",e),e.$inject=["timezoneService"]}();;!function(){"use strict";function e(e){this.prepareLineItemsData=function(r){return e.Enumerable().From(r.QuotePart).ForEach(function(e){e.Price&&(e.Price=e.Price.toFixed(2)),e.ExtendedPrice&&(e.ExtendedPrice=e.ExtendedPrice.toFixed(2))}),e.Enumerable().From(r.WoPart).ForEach(function(e){e.Price&&(e.Price=e.Price.toFixed(2)),e.ExtendedPrice&&(e.ExtendedPrice=e.ExtendedPrice.toFixed(2))}),e.Enumerable().From(r.QuoteMisc).ForEach(function(e){e.Price&&(e.Price=e.Price.toFixed(2)),e.ExtendedPrice&&(e.ExtendedPrice=e.ExtendedPrice.toFixed(2))}),e.Enumerable().From(r.WoMisc).ForEach(function(e){e.Price&&(e.Price=e.Price.toFixed(2)),e.ExtendedPrice&&(e.ExtendedPrice=e.ExtendedPrice.toFixed(2))}),e.Enumerable().From(r.QuoteLabor).ForEach(function(e){e.BillHours&&(e.BillHours=e.BillHours.toFixed(2)),e.Rate&&(e.Rate=e.Rate.toFixed(2)),e.ExtendedPrice&&(e.ExtendedPrice=e.ExtendedPrice.toFixed(2))}),e.Enumerable().From(r.WoLabor).ForEach(function(e){e.BillHours&&(e.BillHours=e.BillHours.toFixed(2)),e.Rate&&(e.Rate=e.Rate.toFixed(2)),e.ExtendedPrice&&(e.ExtendedPrice=e.ExtendedPrice.toFixed(2))}),{partLineItems:function(r){var t=e.Enumerable().From(r.QuotePart).Where(function(t){return-1!=e.Enumerable().From(r.WoPart).Where(function(e){return null!=e.QuoteItemId}).Select(function(e){return e.QuoteItemId}).ToArray().indexOf(t.Id)}).ToArray(),o=e.Enumerable().From(r.WoPart).Where(function(e){return null!=e.QuoteItemId}).ToArray(),n=e.Enumerable().From(r.QuotePart).Where(function(t){return-1==e.Enumerable().From(r.WoPart).Where(function(e){return null!=e.QuoteItemId}).Select(function(e){return e.QuoteItemId}).ToArray().indexOf(t.Id)}).ToArray(),u=e.Enumerable().From(r.WoPart).Where(function(e){return null==e.QuoteItemId}).ToArray(),d=e.Enumerable().From(n).Where(function(r){return-1!=e.Enumerable().From(u).Select(function(e){return e.ItemId}).ToArray().indexOf(r.ItemId)}).ToArray(),i=e.Enumerable().From(u).Where(function(r){return-1!=e.Enumerable().From(d).Select(function(e){return e.ItemId}).ToArray().indexOf(r.ItemId)}).ToArray(),a=e.Enumerable().From(n).Where(function(t){return-1==e.Enumerable().From(r.WoPart).Where(function(e){return null==e.QuoteItemId}).Select(function(e){return e.ItemId}).ToArray().indexOf(t.ItemId)}).ToArray(),m=e.Enumerable().From(u).Where(function(r){return-1==e.Enumerable().From(d).Select(function(e){return e.ItemId}).ToArray().indexOf(r.ItemId)}).ToArray(),I=e.Enumerable().From(t).Join(o,function(e){return e.Id},function(e){return e.QuoteItemId},function(e,r){return{QuoteId:e.QuoteId+"<br>"+r.QuoteId,WoId:e.WoId+"<br>"+r.WoId,ItemId:e.ItemId+"<br>"+r.ItemId,QuoteItemId:e.QuoteItemId+"<br>"+r.QuoteItemId,ItemName:e.ItemName+"<br>"+r.ItemName,Cost:e.Cost+"<br>"+r.Cost,Price:e.Price+"<br>"+r.Price,Quantity:e.Quantity+"<br>"+r.Quantity,ExtendedCost:e.ExtendedCost+"<br>"+r.ExtendedCost,ExtendedPrice:e.ExtendedPrice+"<br>"+r.ExtendedPrice}}).ToArray(),c=e.Enumerable().From(d).Join(i,function(e){return e.ItemId},function(e){return e.ItemId},function(e,r){return{QuoteId:e.QuoteId+"<br>"+r.QuoteId,WoId:e.WoId+"<br>"+r.WoId,ItemId:e.ItemId+"<br>"+r.ItemId,QuoteItemId:e.QuoteItemId+"<br>"+r.QuoteItemId,ItemName:e.ItemName+"<br>"+r.ItemName,Cost:e.Cost+"<br>"+r.Cost,Price:e.Price+"<br>"+r.Price,Quantity:e.Quantity+"<br>"+r.Quantity,ExtendedCost:e.ExtendedCost+"<br>"+r.ExtendedCost,ExtendedPrice:e.ExtendedPrice+"<br>"+r.ExtendedPrice}}).ToArray();return{converted:e.Enumerable().From(I).Union(c).ToArray(),avalaibleForConversion:a,onlyWo:m}}(r),miscLineItems:function(r){var t=e.Enumerable().From(r.QuoteMisc).Where(function(t){return-1!=e.Enumerable().From(r.WoMisc).Where(function(e){return null!=e.QuoteItemId}).Select(function(e){return e.QuoteItemId}).ToArray().indexOf(t.Id)}).ToArray(),o=e.Enumerable().From(r.WoMisc).Where(function(e){return null!=e.QuoteItemId}).ToArray(),n=e.Enumerable().From(r.QuoteMisc).Where(function(t){return-1==e.Enumerable().From(r.WoMisc).Where(function(e){return null!=e.QuoteItemId}).Select(function(e){return e.QuoteItemId}).ToArray().indexOf(t.Id)}).ToArray(),u=e.Enumerable().From(r.WoMisc).Where(function(e){return null==e.QuoteItemId}).ToArray(),d=e.Enumerable().From(n).Where(function(r){return-1!=e.Enumerable().From(u).Select(function(e){return e.ItemId}).ToArray().indexOf(r.ItemId)}).ToArray(),i=e.Enumerable().From(u).Where(function(r){return-1!=e.Enumerable().From(d).Select(function(e){return e.ItemId}).ToArray().indexOf(r.ItemId)}).ToArray(),a=e.Enumerable().From(n).Where(function(t){return-1==e.Enumerable().From(r.WoMisc).Where(function(e){return null==e.QuoteItemId}).Select(function(e){return e.ItemId}).ToArray().indexOf(t.ItemId)}).ToArray(),m=e.Enumerable().From(u).Where(function(r){return-1==e.Enumerable().From(d).Select(function(e){return e.ItemId}).ToArray().indexOf(r.ItemId)}).ToArray(),I=e.Enumerable().From(t).Join(o,function(e){return e.Id},function(e){return e.QuoteItemId},function(e,r){return{QuoteId:e.QuoteId+"<br>"+r.QuoteId,WoId:e.WoId+"<br>"+r.WoId,ItemId:e.ItemId+"<br>"+r.ItemId,QuoteItemId:e.QuoteItemId+"<br>"+r.QuoteItemId,ItemName:e.ItemName+"<br>"+r.ItemName,Cost:e.Cost+"<br>"+r.Cost,Price:e.Price+"<br>"+r.Price,Quantity:e.Quantity+"<br>"+r.Quantity,ExtendedCost:e.ExtendedCost+"<br>"+r.ExtendedCost,ExtendedPrice:e.ExtendedPrice+"<br>"+r.ExtendedPrice}}).ToArray(),c=e.Enumerable().From(d).Join(i,function(e){return e.ItemId},function(e){return e.ItemId},function(e,r){return{QuoteId:e.QuoteId+"<br>"+r.QuoteId,WoId:e.WoId+"<br>"+r.WoId,ItemId:e.ItemId+"<br>"+r.ItemId,QuoteItemId:e.QuoteItemId+"<br>"+r.QuoteItemId,ItemName:e.ItemName+"<br>"+r.ItemName,Cost:e.Cost+"<br>"+r.Cost,Price:e.Price+"<br>"+r.Price,Quantity:e.Quantity+"<br>"+r.Quantity,ExtendedCost:e.ExtendedCost+"<br>"+r.ExtendedCost,ExtendedPrice:e.ExtendedPrice+"<br>"+r.ExtendedPrice}}).ToArray();return{converted:e.Enumerable().From(I).Union(c).ToArray(),avalaibleForConversion:a,onlyWo:m}}(r),laborLineItems:function(r){var t=e.Enumerable().From(r.QuoteLabor).Where(function(t){return-1!=e.Enumerable().From(r.WoLabor).Where(function(e){return null!=e.QuoteLaborId}).Select(function(e){return e.QuoteLaborId}).ToArray().indexOf(t.Id)}).ToArray(),o=e.Enumerable().From(r.WoLabor).Where(function(e){return null!=e.QuoteLaborId}).ToArray(),n=e.Enumerable().From(r.QuoteLabor).Where(function(t){return-1==e.Enumerable().From(r.WoLabor).Where(function(e){return null!=e.QuoteLaborId}).Select(function(e){return e.QuoteLaborId}).ToArray().indexOf(t.Id)}).ToArray(),u=e.Enumerable().From(r.WoLabor).Where(function(e){return null==e.QuoteLaborId}).ToArray(),d=e.Enumerable().From(n).Where(function(r){return-1!=e.Enumerable().From(u).Select(function(e){return e.LaborCode}).ToArray().indexOf(r.LaborCode)}).ToArray(),i=e.Enumerable().From(u).Where(function(r){return-1!=e.Enumerable().From(d).Select(function(e){return e.LaborCode}).ToArray().indexOf(r.LaborCode)}).ToArray(),a=e.Enumerable().From(n).Where(function(t){return-1==e.Enumerable().From(r.WoLabor).Where(function(e){return null==e.QuoteLaborId}).Select(function(e){return e.LaborCode}).ToArray().indexOf(t.LaborCode)}).ToArray(),m=e.Enumerable().From(u).Where(function(r){return-1==e.Enumerable().From(d).Select(function(e){return e.LaborCode}).ToArray().indexOf(r.LaborCode)}).ToArray(),I=e.Enumerable().From(t).Join(o,function(e){return e.Id},function(e){return e.QuoteLaborId},function(e,r){return{QuoteId:e.QuoteId+"<br>"+r.QuoteId,WoId:e.WoId+"<br>"+r.WoId,QuoteLaborId:e.QuoteLaborId+"<br>"+r.QuoteLaborId,LaborCodeName:e.LaborCode+"<br>"+r.LaborCode,BillHours:e.BillHours+"<br>"+r.BillHours,Rate:e.Rate+"<br>"+r.Rate,ExtendedPrice:e.ExtendedPrice+"<br>"+r.ExtendedPrice}}).ToArray(),c=e.Enumerable().From(d).Join(i,function(e){return e.LaborCode},function(e){return e.LaborCode},function(e,r){return{QuoteId:e.QuoteId+"<br>"+r.QuoteId,WoId:e.WoId+"<br>"+r.WoId,QuoteLaborId:e.QuoteLaborId+"<br>"+r.QuoteLaborId,LaborCodeName:e.LaborCode+"<br>"+r.LaborCode,BillHours:e.BillHours+"<br>"+r.BillHours,Rate:e.Rate+"<br>"+r.Rate,ExtendedPrice:e.ExtendedPrice+"<br>"+r.ExtendedPrice}}).ToArray();return{converted:e.Enumerable().From(I).Union(c).ToArray(),avalaibleForConversion:a,onlyWo:m}}(r),noteLineItems:function(r){var t=e.Enumerable().From(r.QuoteNote).Where(function(t){return-1!=e.Enumerable().From(r.WoNote).Where(function(e){return null!=e.QuoteNoteId}).Select(function(e){return e.QuoteNoteId}).ToArray().indexOf(t.Id)}).ToArray(),o=e.Enumerable().From(r.WoNote).Where(function(e){return null!=e.QuoteNoteId}).ToArray(),n=e.Enumerable().From(t).Join(o,function(e){return e.Id},function(e){return e.QuoteNoteId},function(e,r){return{QuoteId:e.QuoteId+"<br>"+r.QuoteId,WoId:e.WoId+"<br>"+r.WoId,QuoteNoteId:e.QuoteNoteId+"<br>"+r.QuoteNoteId,CreatedBy:e.CreatedBy+"<br>"+r.CreatedBy,Note:e.Note+"<br>"+r.Note,Viewable:e.Viewable+"<br>"+r.Viewable}}).ToArray(),u=e.Enumerable().From(r.QuoteNote).Where(function(t){return-1==e.Enumerable().From(r.WoNote).Where(function(e){return null!=e.QuoteNoteId}).Select(function(e){return e.QuoteNoteId}).ToArray().indexOf(t.Id)}).ToArray(),d=e.Enumerable().From(r.WoNote).Where(function(e){return null==e.QuoteNoteId}).ToArray();return{converted:n,avalaibleForConversion:u,onlyWo:d}}(r)}}}angular.module("FieldConnectApp").service("lineItemsTransformationService",e),e.$inject=["$linq"]}();;!function(){"use strict";function t(t){this.getAssignmentStatuses=function(s){return t.getAssignmentStatuses(s).then(function(t){this.state.assignmentStatuses=t.data.Data,this.state.assignmentStatusesMeta=t.data.Meta}.bind(this))},this.getAssignmentStatus=function(s){return t.getAssignmentStatus(s).then(function(t){this.state.assignmentStatus=t.data}.bind(this))},this.create=function(s){return t.create(s)},this.update=function(s){return t.update(s)},this.remove=function(s){return t.remove(s)},this.state={assignmentStatus:{},assignmentStatuses:[],assignmentStatusesMeta:{}}}angular.module("FieldConnectApp").service("assignmentStatusService",t),t.$inject=["assignmentStatusFactory"]}();;!function(){"use strict";function t(t){this.getAttachmentCategories=function(e){return t.getAttachmentCategories(e).then(function(t){this.state.attachmentCategories=t.data.Data,this.state.attachmentCategoriesMeta=t.data.Meta}.bind(this))},this.getAttachmentCategory=function(e){return t.getAttachmentCategory(e).then(function(t){this.state.attachmentCategory=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={attachmentCategory:{},attachmentCategories:[],attachmentCategoriesMeta:{}}}angular.module("FieldConnectApp").service("attachmentCategoryService",t),t.$inject=["attachmentCategoryFactory"]}();;!function(){"use strict";function t(t){this.getAttachmentTypes=function(e){return t.getAttachmentTypes(e).then(function(t){this.state.attachmentTypes=t.data.Data,this.state.attachmentTypesMeta=t.data.Meta}.bind(this))},this.getAttachmentType=function(e){return t.getAttachmentType(e).then(function(t){this.state.attachmentType=t.data}.bind(this))},this.getAttachmentCategories=function(){return t.getAttachmentCategories().then(function(t){this.state.attachmentCategories=t.data.Data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={attachmentType:{},attachmentTypes:[],attachmentCategories:[],attachmentTypesMeta:{}}}angular.module("FieldConnectApp").service("attachmentTypeService",t),t.$inject=["attachmentTypeFactory"]}();;!function(){"use strict";function i(i){this.getBillingPeriods=function(t){return i.getBillingPeriods(t).then(function(i){this.state.billingPeriods=i.data.Data,this.state.billingPeriodsMeta=i.data.Meta}.bind(this))},this.getBillingPeriod=function(t){return i.getBillingPeriod(t).then(function(i){this.state.billingPeriod=i.data}.bind(this))},this.create=function(t){return i.create(t)},this.update=function(t){return i.update(t)},this.remove=function(t){return i.remove(t)},this.state={billingPeriod:{},billingPeriods:[],billingPeriodsMeta:{}}}angular.module("FieldConnectApp").service("billingPeriodService",i),i.$inject=["billingPeriodFactory"]}();;!function(){"use strict";function t(t){this.getBillingTypes=function(i){return t.getBillingTypes(i).then(function(t){this.state.billingTypes=t.data.Data,this.state.billingTypesMeta=t.data.Meta}.bind(this))},this.getBillingType=function(i){return t.getBillingType(i).then(function(t){this.state.billingType=t.data}.bind(this))},this.create=function(i){return t.create(i)},this.update=function(i){return t.update(i)},this.remove=function(i){return t.remove(i)},this.state={billingType:{},billingTypes:[],billingTypesMeta:{}}}angular.module("FieldConnectApp").service("billingTypeService",t),t.$inject=["billingTypeFactory"]}();;!function(){"use strict";function t(t){this.getCauses=function(e){return t.getCauses(e).then(function(t){this.state.causes=t.data.Data,this.state.causesMeta=t.data.Meta}.bind(this))},this.getCause=function(e){return t.getCause(e).then(function(t){this.state.cause=t.data}.bind(this))},this.remove=function(e){return t.remove(e)},this.update=function(e){return t.update(e)},this.create=function(e){return t.create(e)},this.state={cause:{},causes:[],causesMeta:{}}}angular.module("FieldConnectApp").service("causeService",t),t.$inject=["causeFactory"]}();;!function(){"use strict";function t(t){this.getCountries=function(e){return t.getCountries(e).then(function(t){this.state.countries=t.data.Data,this.state.countriesMeta=t.data.Meta}.bind(this))},this.getCountry=function(e){return t.getCountry(e).then(function(t){this.state.country=t.data}.bind(this))},this.remove=function(e){return t.remove(e)},this.update=function(e){return t.update(e)},this.create=function(e){return t.create(e)},this.state={country:{},countries:[],countriesMeta:{}}}angular.module("FieldConnectApp").service("countryService",t),t.$inject=["countryFactory"]}();;!function(){"use strict";function t(t){this.getCurrencies=function(e){return t.getCurrencies(e).then(function(t){this.state.currencies=t.data.Data,this.state.currenciesMeta=t.data.Meta}.bind(this))},this.getCurrency=function(e){return t.getCurrency(e).then(function(t){this.state.currency=t.data}.bind(this))},this.getCountries=function(){return t.getCountries().then(function(t){this.state.countries=t.data.Data}.bind(this))},this.remove=function(e){return t.remove(e)},this.update=function(e){return t.update(e)},this.create=function(e){return t.create(e)},this.state={currency:{},currencies:[],currenciesMeta:{}}}angular.module("FieldConnectApp").service("currencyService",t),t.$inject=["currencyFactory"]}();;!function(){"use strict";function t(t){this.getDSLActionsTaken=function(n){return t.getDSLActionsTaken(n).then(function(t){this.state.DSLActionsTaken=t.data.Data,this.state.DSLActionsTakenMeta=t.data.Meta}.bind(this))},this.getDSLActionTaken=function(n){return t.getDSLActionTaken(n).then(function(t){this.state.DSLActionTaken=t.data}.bind(this))},this.create=function(n){return t.create(n)},this.update=function(n){return t.update(n)},this.remove=function(n){return t.remove(n)},this.state={DSLActionTaken:{},DSLActionsTaken:[],DSLActionsTakenMeta:{}}}angular.module("FieldConnectApp").service("DSLActionTakenService",t),t.$inject=["DSLActionTakenFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("DSLApplicableCodeService",t),t.$inject=["DSLApplicableCodeFactory"]}();;!function(){"use strict";function t(t){this.getDSLDistributors=function(i){return t.getDSLDistributors(i).then(function(t){this.state.DSLDistributors=t.data.Data,this.state.DSLDistributorsMeta=t.data.Meta}.bind(this))},this.getDSLDistributor=function(i){return t.getDSLDistributor(i).then(function(t){this.state.DSLDistributor=t.data}.bind(this))},this.create=function(i){return t.create(i)},this.update=function(i){return t.update(i)},this.remove=function(i){return t.remove(i)},this.state={DSLDistributor:{},DSLDistributors:[],DSLDistributorsMeta:{}}}angular.module("FieldConnectApp").service("DSLDistributorService",t),t.$inject=["DSLDistributorFactory"]}();;!function(){"use strict";function t(t){this.getDSLFailureResolutions=function(e){return t.getDSLFailureResolutions(e).then(function(t){this.state.DSLFailureResolutions=t.data.Data,this.state.DSLFailureResolutionsMeta=t.data.Meta}.bind(this))},this.getDSLFailureResolution=function(e){return t.getDSLFailureResolution(e).then(function(t){this.state.DSLFailureResolution=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={DSLFailureResolution:{},DSLFailureResolutions:[],DSLFailureResolutionsMeta:{}}}angular.module("FieldConnectApp").service("DSLFailureResolutionService",t),t.$inject=["DSLFailureResolutionFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("DSLFaultAreasService",t),t.$inject=["DSLFaultAreasFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("DSLInstalledRemovedService",t),t.$inject=["DSLFaultAreasFactory"]}();;!function(){"use strict";function t(t){this.getDSLInventoryPostingGroups=function(n){return t.getDSLInventoryPostingGroups(n).then(function(t){this.state.DSLInventoryPostingGroups=t.data.Data,this.state.DSLInventoryPostingGroupsMeta=t.data.Meta}.bind(this))},this.getDSLInventoryPostingGroup=function(n){return t.getDSLInventoryPostingGroup(n).then(function(t){this.state.DSLInventoryPostingGroup=t.data}.bind(this))},this.create=function(n){return t.create(n)},this.update=function(n){return t.update(n)},this.remove=function(n){return t.remove(n)},this.state={DSLInventoryPostingGroup:{},DSLInventoryPostingGroups:[],DSLInventoryPostingGroupsMeta:{}}}angular.module("FieldConnectApp").service("DSLInventoryPostingGroupService",t),t.$inject=["DSLInventoryPostingGroupFactory"]}();;!function(){"use strict";function e(e){this.getDSLPartsReceives=function(t){return e.getDSLPartsRecieves(t).then(function(e){this.state.DSLPartsReceives=e.data.Data,this.state.DSLPartsReceivesMeta=e.data.Meta}.bind(this))},this.getDSLPartsReceived=function(t){return e.getDSLPartsReceived(t).then(function(e){this.state.DSLPartsReceived=e.data}.bind(this))},this.create=function(t){return e.create(t)},this.update=function(t){return e.update(t)},this.remove=function(t){return e.remove(t)},this.state={DSLPartsReceived:{},DSLPartsReceives:[],DSLPartsReceivesMeta:{}}}angular.module("FieldConnectApp").service("DSLPartsReceivedService",e),e.$inject=["DSLPartsReceivedFactory"]}();;!function(){"use strict";function e(e){this.getDSLRecallDueTos=function(t){return e.getDSLRecallDueTo(t).then(function(e){this.state.DSLRecallDueTos=e.data.Data,this.state.DSLRecallDueTosMeta=e.data.Meta}.bind(this))},this.getDSLRecallDueTo=function(t){return e.getDSLRecallDueTo(t).then(function(e){this.state.DSLRecallDueTo=e.data}.bind(this))},this.create=function(t){return e.create(t)},this.update=function(t){return e.update(t)},this.remove=function(t){return e.remove(t)},this.state={DSLRecallDueTo:{},DSLRecallDueTos:[],DSLRecallDueTosMeta:{}}}angular.module("FieldConnectApp").service("DSLRecallDueToService",e),e.$inject=["DSLRecallDueToFactory"]}();;!function(){"use strict";function e(e){this.getDSLServiceOrderTypes=function(r){return e.getDSLServiceOrderTypes(r).then(function(e){this.state.DSLServiceOrderTypes=e.data.Data,this.state.DSLServiceOrderTypesMeta=e.data.Meta}.bind(this))},this.getDSLServiceOrderType=function(r){return e.getDSLServiceOrderType(r).then(function(e){this.state.DSLServiceOrderType=e.data}.bind(this))},this.create=function(r){return e.create(r)},this.update=function(r){return e.update(r)},this.remove=function(r){return e.remove(r)},this.state={DSLServiceOrderType:{},DSLServiceOrderTypes:[],DSLServiceOrderTypesMeta:{}}}angular.module("FieldConnectApp").service("DSLServiceOrderTypeService",e),e.$inject=["DSLServiceOrderTypeFactory"]}();;!function(){"use strict";function e(e){this.getDSLServiceZoneCodes=function(t){return e.getDSLServiceZoneCodes(t).then(function(e){this.state.DSLServiceZoneCodes=e.data.Data,this.state.DSLServiceZoneCodesMeta=e.data.Meta}.bind(this))},this.getDSLServiceZoneCode=function(t){return e.getDSLServiceZoneCode(t).then(function(e){this.state.DSLServiceZoneCode=e.data}.bind(this))},this.create=function(t){return e.create(t)},this.update=function(t){return e.update(t)},this.remove=function(t){return e.remove(t)},this.state={DSLServiceZoneCode:{},DSLServiceZoneCodes:[],DSLServiceZoneCodesMeta:{}}}angular.module("FieldConnectApp").service("DSLServiceZoneCodeService",e),e.$inject=["DSLServiceZoneCodeFactory"]}();;!function(){"use strict";function e(e){this.getDSLServiceZoneLaborCodes=function(t){return e.getDSLServiceZoneLaborCodes(t).then(function(e){this.state.DSLServiceZoneLaborCodes=e.data.Data,this.state.DSLServiceZoneLaborCodesMeta=e.data.Meta}.bind(this))},this.getDSLServiceZoneLaborCode=function(t){return e.getDSLServiceZoneLaborCode(t).then(function(e){this.state.DSLServiceZoneLaborCode=e.data}.bind(this))},this.create=function(t){return e.create(t)},this.update=function(t){return e.update(t)},this.remove=function(t){return e.remove(t)},this.state={DSLServiceZoneLaborCode:{},DSLServiceZoneLaborCodes:[],DSLServiceZoneLaborCodesMeta:{}}}angular.module("FieldConnectApp").service("DSLServiceZoneLaborCodeService",e),e.$inject=["DSLServiceZoneLaborCodeFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("DSLWhoPaysService",t),t.$inject=["DSLWhoPaysFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("dashboardChartTypeService",t),t.$inject=["dashboardChartTypeFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("dashboardConfigDDListService",t),t.$inject=["dashboardConfigDDListFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("dashboardFilterDDListService",t),t.$inject=["dashboardFilterDDListFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("dashboardReportTypeService",t),t.$inject=["dashboardReportTypeFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("defaultDispatchCalendarSettingsService",t),t.$inject=["defaultDispatchCalendarSettingsFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("defaultStartPageService",t),t.$inject=["defaultStartPageFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("deficiencySeverityService",t),t.$inject=["deficiencySeverityFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("deficiencyStatusService",t),t.$inject=["deficiencyStatusFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("deficiencyStatusActionService",t),t.$inject=["deficiencyStatusActionFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("dispatchCalendarThemesService",t),t.$inject=["dispatchCalendarThemesFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("dispatchChartThemesService",t),t.$inject=["dispatchChartThemesFactory"]}();;!function(){"use strict";function t(t){this.getRecords=function(e){return t.getRecords(e).then(function(t){this.state.Records=t.data.Data,this.state.RecordsMeta=t.data.Meta}.bind(this))},this.getRecord=function(e){return t.getRecord(e).then(function(t){this.state.Record=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={Record:{},Records:[],RecordsMeta:{}}}angular.module("FieldConnectApp").service("dispatchMonthlyCalendarThemesService",t),t.$inject=["dispatchMonthlyCalendarThemesFactory"]}();;!function(){"use strict";function t(t){this.getDocTypes=function(e){return t.getDocTypes(e).then(function(t){this.state.docTypes=t.data.Data,this.state.docTypesMeta=t.data.Meta}.bind(this))},this.getDocType=function(e){return t.getDocType(e).then(function(t){this.state.docType=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={docType:{},docTypes:[],docTypesMeta:{}}}angular.module("FieldConnectApp").service("docTypeService",t),t.$inject=["docTypeFactory"]}();;!function(){"use strict";function t(t){this.getEquipmentClasses=function(e){return t.getEquipmentClasses(e).then(function(t){this.state.equipmentClasses=t.data.Data,this.state.equipmentClassesMeta=t.data.Meta}.bind(this))},this.getEquipmentClass=function(e){return t.getEquipmentClass(e).then(function(t){this.state.equipmentClass=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={equipmentClass:{},equipmentClasses:[],equipmentClassesMeta:{}}}angular.module("FieldConnectApp").service("equipmentClassService",t),t.$inject=["serviceableItemClassFactory"]}();;!function(){"use strict";function e(e){this.getEquipmentTypes=function(t){return e.getEquipmentType(t).then(function(e){this.state.equipmentTypes=e.data.Data,this.state.equipmentTypesMeta=e.data.Meta}.bind(this))},this.getEquipmentType=function(t){return e.getEquipmentType(t).then(function(e){this.state.equipmentType=e.data}.bind(this))},this.getEquipmentClasses=function(){return e.getEquipmentClasses().then(function(e){this.state.equipmentClasses=e.data.Data}.bind(this))},this.create=function(t){return e.create(t)},this.update=function(t){return e.update(t)},this.remove=function(t){return e.remove(t)},this.state={equipmentType:{},equipmentTypes:[],equipmentTypesMeta:{},equipmentClasses:{}}}angular.module("FieldConnectApp").service("equipmentTypeService",e),e.$inject=["serviceableItemTypeFactory"]}();;!function(){"use strict";function e(e){this.getEventTypes=function(t){return e.getEventTypes(t).then(function(e){this.state.eventTypes=e.data.Data,this.state.eventTypesMeta=e.data.Meta}.bind(this))},this.getEventType=function(t){return e.getEventType(t).then(function(e){this.state.eventType=e.data}.bind(this))},this.create=function(t){return e.create(t)},this.update=function(t){return e.update(t)},this.remove=function(t){return e.remove(t)},this.state={eventType:{},eventTypes:[],eventTypesMeta:{}}}angular.module("FieldConnectApp").service("eventTypeService",e),e.$inject=["eventTypeFactory"]}();;!function(){"use strict";function t(t){this.getIndustries=function(e){return t.getIndustries(e).then(function(t){this.state.industries=t.data.Data,this.state.industriesMeta=t.data.Meta}.bind(this))},this.getIndustry=function(e){return t.getIndustry(e).then(function(t){this.state.industry=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={industry:{},industries:[],industriesMeta:{}}}angular.module("FieldConnectApp").service("industryService",t),t.$inject=["industryFactory"]}();;!function(){"use strict";function t(t){this.getItemClasses=function(e){return t.getItemClasses(e).then(function(t){this.state.itemClasses=t.data.Data,this.state.itemClassesMeta=t.data.Meta}.bind(this))},this.getItemClass=function(e){return t.getItemClass(e).then(function(t){this.state.itemClass=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={itemClass:{},itemClasses:[],itemClassesMeta:[]}}angular.module("FieldConnectApp").service("itemClassService",t),t.$inject=["itemClassFactory"]}();;!function(){"use strict";function t(t){this.getItemTypes=function(e){return t.getItemTypes(e).then(function(t){this.state.itemTypes=t.data.Data,this.state.itemTypesMeta=t.data.Meta}.bind(this))},this.getItemClasses=function(){return t.getItemClasses().then(function(t){this.state.itemClasses=t.data.Data}.bind(this))},this.getItemType=function(e){return t.getItemType(e).then(function(t){this.state.itemType=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={itemType:{},itemTypes:[],itemTypesMeta:{},itemClasses:{}}}angular.module("FieldConnectApp").service("itemTypeService",t),t.$inject=["itemTypeFactory"]}();;!function(){"use strict";function t(t){this.getLaborCodes=function(e){return t.getLaborCodes(e).then(function(t){this.state.laborCodes=t.data.Data,this.state.laborCodesMeta=t.data.Meta}.bind(this))},this.getLaborCode=function(e){return t.getLaborCode(e).then(function(t){this.state.laborCode=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={laborCode:{},laborCodes:[],laborCodesMeta:{}}}angular.module("FieldConnectApp").service("laborCodeService",t),t.$inject=["laborCodeFactory"]}();;!function(){"use strict";function t(t){this.getLaborGroups=function(r){return t.getLaborGroups(r).then(function(t){this.state.laborGroups=t.data.Data,this.state.laborGroupsMeta=t.data.Meta}.bind(this))},this.getLaborGroup=function(r){return t.getLaborGroup(r).then(function(t){this.state.laborGroup=t.data}.bind(this))},this.create=function(r){return t.create(r)},this.update=function(r){return t.update(r)},this.remove=function(r){return t.remove(r)},this.state={laborGroup:{},laborGroups:[],laborGroupsMeta:{}}}angular.module("FieldConnectApp").service("laborGroupService",t),t.$inject=["laborGroupFactory"]}();;!function(){"use strict";function e(e){this.getLeadSources=function(t){return e.getLeadSources(t).then(function(e){this.state.leadSources=e.data.Data,this.state.leadSourcesMeta=e.data.Meta}.bind(this))},this.getLeadSource=function(t){return e.getLeadSource(t).then(function(e){this.state.leadSource=e.data}.bind(this))},this.create=function(t){return e.create(t)},this.update=function(t){return e.update(t)},this.remove=function(t){return e.remove(t)},this.state={leadSource:{},leadSources:[],leadSourcesMeta:{}}}angular.module("FieldConnectApp").service("leadSourceService",e),e.$inject=["leadSourceFactory"]}();;!function(){"use strict";function t(t){this.getLocations=function(n){return t.getLocations(n).then(function(t){this.state.locations=t.data.Data,this.state.locationsMeta=t.data.Meta}.bind(this))},this.getLocation=function(n){return t.getLocation(n).then(function(t){this.state.location=t.data}.bind(this))},this.create=function(n){return t.create(n)},this.update=function(n){return t.update(n)},this.remove=function(n){return t.remove(n)},this.state={location:{},locations:[],locationsMeta:{}}}angular.module("FieldConnectApp").service("locationService",t),t.$inject=["locationFactory"]}();;!function(){"use strict";function t(t){this.getManufacturers=function(e){return t.getManufacturers(e).then(function(t){this.state.manufacturers=t.data.Data,this.state.manufacturersMeta=t.data.Meta}.bind(this))},this.getManufacturer=function(e){return t.getManufacturer(e).then(function(t){this.state.manufacturer=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={manufacturer:{},manufacturers:[],manufacturersMeta:{}}}angular.module("FieldConnectApp").service("manufacturerService",t),t.$inject=["manufacturerFactory"]}();;!function(){"use strict";function t(t){this.getMerchants=function(e){return t.getMerchants(e).then(function(t){this.state.merchants=t.data.Data,this.state.merchantsMeta=t.data.Meta}.bind(this))},this.getMerchant=function(e){return t.getMerchant(e).then(function(t){this.state.merchant=t.data}.bind(this))},this.getContacts=function(){return t.getContacts().then(function(t){this.state.contacts=t.data.Data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={merchant:{},merchants:[],merchantsMeta:{},contacts:{}}}angular.module("FieldConnectApp").service("merchantService",t),t.$inject=["merchantFactory"]}();;!function(){"use strict";function t(t){this.getNoteLibs=function(e){return t.getNoteLibs(e).then(function(t){this.state.noteLibs=t.data.Data,this.state.noteLibsMeta=t.data.Meta}.bind(this))},this.getNoteLib=function(e){return t.getNoteLib(e).then(function(t){this.state.noteLib=t.data}.bind(this))},this.remove=function(e){return t.remove(e)},this.update=function(e){return t.update(e)},this.create=function(e){return t.create(e)},this.state={noteLib:{},noteLibs:[],noteLibsMeta:{}}}angular.module("FieldConnectApp").service("noteLibService",t),t.$inject=["noteLibFactory"]}();;!function(){"use strict";function t(t){this.getOperationGroups=function(e){return t.getOperationGroups(e).then(function(t){this.state.operationGroups=t.data.Data,this.state.operationGroupsMeta=t.data.Meta}.bind(this))},this.getOperationGroup=function(e){return t.getOperationGroup(e).then(function(t){this.state.operationGroup=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={operationGroup:{},operationGroups:[],operationGroupsMeta:{}}}angular.module("FieldConnectApp").service("operationGroupService",t),t.$inject=["operationGroupFactory"]}();;!function(){"use strict";function t(t){this.getPaymentTerms=function(e){return t.getPaymentTerms(e).then(function(t){this.state.paymentTerms=t.data.Data,this.state.paymentTermsMeta=t.data.Meta}.bind(this))},this.getPaymentTerm=function(e){return t.getPaymentTerm(e).then(function(t){this.state.paymentTerm=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={paymentTerm:{},paymentTerms:[],paymentTermsMeta:{}}}angular.module("FieldConnectApp").service("paymentTermService",t),t.$inject=["paymentTermFactory"]}();;!function(){"use strict";function t(t){this.getPriorities=function(i){return t.getPriorities(i).then(function(t){this.state.priorities=t.data.Data,this.state.prioritiesMeta=t.data.Meta}.bind(this))},this.getPriority=function(i){return t.getPriority(i).then(function(t){this.state.priority=t.data}.bind(this))},this.create=function(i){return t.create(i)},this.update=function(i){return t.update(i)},this.remove=function(i){return t.remove(i)},this.state={priority:{},priorities:[],prioritiesMeta:{}}}angular.module("FieldConnectApp").service("priorityService",t),t.$inject=["priorityFactory"]}();;!function(){"use strict";function e(e){this.getProblemCodes=function(t){return e.getProblemCodes(t).then(function(e){this.state.problemCodes=e.data.Data,this.state.problemCodesMeta=e.data.Meta}.bind(this))},this.getProblemCode=function(t){return e.getProblemCode(t).then(function(e){this.state.problemCode=e.data}.bind(this))},this.create=function(t){return e.create(t)},this.update=function(t){return e.update(t)},this.remove=function(t){return e.remove(t)},this.state={problemCode:{},problemCodes:[],problemCodesMeta:{}}}angular.module("FieldConnectApp").service("problemCodeService",e),e.$inject=["problemCodeFactory"]}();;!function(){"use strict";function e(e){this.getProblemCodeTasks=function(t){return e.getProblemCodeTasks(t).then(function(e){this.state.problemCodeTasks=e.data.Data,this.state.problemCodeTasksMeta=e.data.Meta}.bind(this))},this.getProblemCodeTask=function(t){return e.getProblemCodeTask(t).then(function(e){this.state.problemCodeTask=e.data}.bind(this))},this.getProblemCodes=function(){return e.getProblemCodes().then(function(e){this.state.problemCodes=e.data.Data}.bind(this))},this.create=function(t){return e.create(t)},this.update=function(t){return e.update(t)},this.remove=function(t){return e.remove(t)},this.state={problemCodeTask:{},problemCodeTasks:[],problemCodeTasksMeta:{},problemCodes:{}}}angular.module("FieldConnectApp").service("problemCodeTaskService",e),e.$inject=["problemCodeTaskFactory"]}();;!function(){"use strict";function t(t){this.getResolutions=function(e){return t.getResolutions(e).then(function(t){this.state.resolutions=t.data.Data,this.state.resolutionsMeta=t.data.Meta}.bind(this))},this.getResolution=function(e){return t.getResolution(e).then(function(t){this.state.resolution=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={resolution:{},resolutions:[],resolutionsMeta:{}}}angular.module("FieldConnectApp").service("resolutionService",t),t.$inject=["resolutionFactory"]}();;!function(){"use strict";function t(t){this.getRoles=function(e){return t.getRoles(e).then(function(t){this.state.roles=t.data.Data,this.state.rolesMeta=t.data.Meta}.bind(this))},this.getRole=function(e){return t.getRole(e).then(function(t){this.state.role=t.data}.bind(this))},this.getRoleTypes=function(){return t.getRoleTypes().then(function(t){this.state.roleTypes=t.data.Data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={role:{},roles:[],rolesMeta:{},roleTypes:{}}}angular.module("FieldConnectApp").service("roleService",t),t.$inject=["roleFactory"]}();;!function(){"use strict";function e(e){this.getRoleTypes=function(t){return e.getRoleTypes(t).then(function(e){this.state.roleTypes=e.data.Data,this.state.roleTypesMeta=e.data.Meta}.bind(this))},this.getRoleType=function(t){return e.getRoleType(t).then(function(e){this.state.roleType=e.data}.bind(this))},this.create=function(t){return e.create(t)},this.update=function(t){return e.update(t)},this.remove=function(t){return e.remove(t)},this.state={roleType:{},roleTypes:[],roleTypesMeta:{}}}angular.module("FieldConnectApp").service("roleTypeService",e),e.$inject=["roleTypeFactory"]}();;!function(){"use strict";function e(e){this.getServiceArea=function(t){return e.getServiceArea(t).then(function(e){this.state.serviceArea=e.data}.bind(this))},this.getServiceAreas=function(t){return e.getServiceAreas(t).then(function(e){this.state.serviceAreas=e.data.Data,this.state.serviceAreasMeta=e.data.Meta}.bind(this))},this.create=function(t){return e.create(t)},this.update=function(t){return e.update(t)},this.remove=function(t){return e.remove(t)},this.state={serviceArea:{},serviceAreas:[],serviceAreasMeta:{}}}angular.module("FieldConnectApp").service("serviceAreaService",e),e.$inject=["serviceAreaFactory"]}();;!function(){"use strict";function e(e){this.getServiceableItemClasses=function(t){return e.getServiceableItemClasses(t).then(function(e){this.state.serviceableItemClasses=e.data.Data,this.state.serviceableItemClassesMeta=e.data.Meta}.bind(this))},this.getServiceableItemClass=function(t){return e.getServiceableItemClass(t).then(function(e){this.state.serviceableItemClass=e.data}.bind(this))},this.create=function(t){return e.create(t)},this.update=function(t){return e.update(t)},this.remove=function(t){return e.remove(t)},this.state={serviceableItemClass:{},serviceableItemClasses:[],serviceableItemClassesMeta:{}}}angular.module("FieldConnectApp").service("serviceableItemClassService",e),e.$inject=["serviceableItemClassFactory"]}();;!function(){"use strict";function e(e){this.getServiceableItemTypes=function(t){return e.getServiceableItemTypes(t).then(function(e){this.state.serviceableItemTypes=e.data.Data,this.state.serviceableItemTypesMeta=e.data.Meta}.bind(this))},this.getServiceableItemType=function(t){return e.getServiceableItemType(t).then(function(e){this.state.ServiceableItemType=e.data}.bind(this))},this.getServiceableItemClasses=function(){return e.getServiceableItemClasses().then(function(e){this.state.serviceableItemClasses=e.data.Data}.bind(this))},this.create=function(t){return e.create(t)},this.update=function(t){return e.update(t)},this.remove=function(t){return e.remove(t)},this.state={serviceableItemType:{},serviceableItemTypes:[],serviceableItemTypesMeta:{},serviceableItemClasses:{}}}angular.module("FieldConnectApp").service("serviceableItemTypeService",e),e.$inject=["serviceableItemTypeFactory"]}();;!function(){"use strict";function t(t){this.getSettings=function(e){return t.getSettings(e).then(function(t){this.state.settings=t.data.Data,this.state.settingsMeta=t.data.Meta}.bind(this))},this.getSetting=function(e){return t.getSetting(e).then(function(t){this.state.setting=t.data}.bind(this))},this.remove=function(e){return t.remove(e)},this.update=function(e){return t.update(e)},this.create=function(e){return t.create(e)},this.state={setting:{},settings:[],settingsMeta:{}}}angular.module("FieldConnectApp").service("settingService",t),t.$inject=["settingFactory"]}();;!function(){"use strict";function t(t){this.getSiteTypes=function(e){return t.getSiteTypes(e).then(function(t){this.state.siteTypes=t.data.Data,this.state.siteTypesMeta=t.data.Meta}.bind(this))},this.getSiteType=function(e){return t.getSiteType(e).then(function(t){this.state.siteType=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={siteType:{},siteTypes:[],siteTypesMeta:{}}}angular.module("FieldConnectApp").service("siteTypeService",t),t.$inject=["siteTypeFactory"]}();;!function(){"use strict";function t(t){this.getSkills=function(i){return t.getSkills(i).then(function(t){this.state.skills=t.data.Data,this.state.skillsMeta=t.data.Meta}.bind(this))},this.getSkill=function(i){return t.getSkill(i).then(function(t){this.state.skill=t.data}.bind(this))},this.create=function(i){return t.create(i)},this.update=function(i){return t.update(i)},this.remove=function(i){return t.remove(i)},this.state={skill:{},skills:[],skillsMeta:{}}}angular.module("FieldConnectApp").service("skillService",t),t.$inject=["skillFactory"]}();;!function(){"use strict";function t(t){this.getStates=function(e){return t.getStates(e).then(function(t){this.state.states=t.data.Data,this.state.statesMeta=t.data.Meta}.bind(this))},this.getState=function(e){return t.getState(e).then(function(t){this.state.state=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={state:{},states:[],statesMeta:{}}}angular.module("FieldConnectApp").service("stateService",t),t.$inject=["stateFactory"]}();;!function(){"use strict";function t(t){this.getStatuses=function(s){return t.getStatuses(s).then(function(t){this.state.statuses=t.data.Data,this.state.statusesMeta=t.data.Meta}.bind(this))},this.getStatus=function(s){return t.getStatus(s).then(function(t){this.state.status=t.data}.bind(this))},this.create=function(s){return t.create(s)},this.update=function(s){return t.update(s)},this.remove=function(s){return t.remove(s)},this.state={status:{},statuses:[],statusesMeta:{}}}angular.module("FieldConnectApp").service("statusService",t),t.$inject=["statusFactory"]}();;!function(){"use strict";function t(t){this.getSubscriptionTypes=function(i){return t.getSubscriptionTypes(i).then(function(t){this.state.subscriptionTypes=t.data.Data,this.state.subscriptionTypesMeta=t.data.Meta}.bind(this))},this.getSubscriptionType=function(i){return t.getSubscriptionType(i).then(function(t){this.state.subscriptionType=t.data}.bind(this))},this.create=function(i){return t.create(i)},this.update=function(i){return t.update(i)},this.remove=function(i){return t.remove(i)},this.state={SubscriptionType:{},SubscriptionTypes:[],SubscriptionTypesMeta:{},contacts:{}}}angular.module("FieldConnectApp").service("subscriptionTypeService",t),t.$inject=["subscriptionTypeFactory"]}();;!function(){"use strict";function t(t){this.getSubscriptionTypeRoles=function(e){return t.getSubscriptionTypeRoles(e).then(function(t){this.state.subscriptionTypeRoles=t.data.Data,this.state.subscriptionTypeRolesMeta=t.data.Meta}.bind(this))},this.getSubscriptionTypeRole=function(e){return t.getSubscriptionTypeRole(e).then(function(t){this.state.subscriptionTypeRole=t.data}.bind(this))},this.getSubscriptionTypes=function(){return t.getSubscriptionTypes().then(function(t){this.state.subscriptionTypes=t.data.Data}.bind(this))},this.getRoles=function(){return t.getRoles().then(function(t){this.state.roles=t.data.Data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={SubscriptionTypeRole:{},SubscriptionTypeRoles:[],SubscriptionTypeRolesMeta:{},subscriptionTypes:[],roles:[]}}angular.module("FieldConnectApp").service("subscriptionTypeRoleService",t),t.$inject=["subscriptionTypeRoleFactory"]}();;!function(){"use strict";function t(t){this.getTagTypes=function(e){return t.getTagTypes(e).then(function(t){this.state.tagTypes=t.data.Data,this.state.tagTypesMeta=t.data.Meta}.bind(this))},this.getTagType=function(e){return t.getTagType(e).then(function(t){this.state.tagType=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={tagType:{},tagTypes:[],tagTypesMeta:{}}}angular.module("FieldConnectApp").service("tagTypeService",t),t.$inject=["tagTypeFactory"]}();;!function(){"use strict";function t(t){this.getTimeZones=function(e){return t.getTimeZones(e).then(function(t){this.state.timeZones=t.data.Data,this.state.timeZonesMeta=t.data.Meta}.bind(this))},this.getTimeZone=function(e){return t.getTimeZone(e).then(function(t){this.state.timeZone=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={timeZone:{},timeZones:[],timeZonesMeta:{}}}angular.module("FieldConnectApp").service("timeZoneService",t),t.$inject=["timeZoneFactory"]}();;!function(){"use strict";function a(a){this.getUnavailables=function(t){return a.getUnavailables(t).then(function(a){this.state.unavailables=a.data.Data,this.state.unavailablesMeta=a.data.Meta}.bind(this))},this.getUnavailable=function(t){return a.getUnavailable(t).then(function(a){this.state.unavailable=a.data}.bind(this))},this.create=function(t){return a.create(t)},this.update=function(t){return a.update(t)},this.remove=function(t){return a.remove(t)},this.state={unavailable:{},unavailables:[],unavailablesMeta:{}}}angular.module("FieldConnectApp").service("unavailableService",a),a.$inject=["unavailableFactory"]}();;!function(){"use strict";function t(t){this.getUoms=function(e){return t.getUoms(e).then(function(t){this.state.uoms=t.data.Data,this.state.uomsMeta=t.data.Meta}.bind(this))},this.getUom=function(e){return t.getUom(e).then(function(t){this.state.uom=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={uom:{},uoms:[],uomsMeta:{}}}angular.module("FieldConnectApp").service("uomService",t),t.$inject=["uomFactory"]}();;!function(){"use strict";function t(t){this.getWOStatuses=function(e){return t.getWOStatuses(e).then(function(t){this.state.woStatuses=t.data.Data,this.state.woStatusesMeta=t.data.Meta}.bind(this))},this.getWOStatus=function(e){return t.getWOStatus(e).then(function(t){this.state.woStatus=t.data}.bind(this))},this.remove=function(e){return t.remove(e)},this.update=function(e){return t.update(e)},this.create=function(e){return t.create(e)},this.state={woStatus:{},woStatuses:[],woStatusesMeta:{}}}angular.module("FieldConnectApp").service("woStatusService",t),t.$inject=["woStatusFactory"]}();;!function(){"use strict";function t(t){this.getWOStatusColors=function(o){return t.getWOStatusColors(o).then(function(t){this.state.woStatusColors=t.data.Data,this.state.woStatusColorsMeta=t.data.Meta}.bind(this))},this.getWOStatusColor=function(o){return t.getWOStatusColor(o).then(function(t){this.state.woStatusColor=t.data}.bind(this))},this.getWOStatuses=function(){return t.getWOStatuses().then(function(t){this.state.woStatuses=t.data.Data}.bind(this))},this.remove=function(o){return t.remove(o)},this.update=function(o){return t.update(o)},this.create=function(o){return t.create(o)},this.state={woStatusColor:{},woStatusColors:[],woStatusColorsMeta:{},woStatuses:{}}}angular.module("FieldConnectApp").service("woStatusColorService",t),t.$inject=["woStatusColorFactory"]}();;!function(){"use strict";function t(t){this.getWOTypes=function(e){return t.getWOTypes(e).then(function(t){this.state.woTypes=t.data.Data,this.state.woTypesMeta=t.data.Meta}.bind(this))},this.getWOType=function(e){return t.getWOType(e).then(function(t){this.state.woType=t.data}.bind(this))},this.create=function(e){return t.create(e)},this.update=function(e){return t.update(e)},this.remove=function(e){return t.remove(e)},this.state={woType:{},woTypes:[],woTypesMeta:{}}}angular.module("FieldConnectApp").service("woTypeService",t),t.$inject=["woTypeFactory"]}();;!function(){"use strict";function t(t){this.getItems=function(e){return t.getItems(e).then(function(t){this.state.items=t.data.Data}.bind(this))},this.state={items:[]}}angular.module("FieldConnectApp").service("dropdownService",t),t.$inject=["dropdownFactory"]}();;!function(){"use strict";angular.module("OfflineMode").provider("offlineService",function(){this.$get=e,this.registerDomain=function(e){if(null!==n(e))return;t.push({domain:e,methods:[]})},this.registerDomainMethod=function(t,e){var o=n(t),a={path:e,getHandlers:[i]};return o.methods.push(a),a},this.getMethod=function(t,e){"string"==typeof t&&(t=n(t));for(var i=t.methods,o=0;o!=i.length;o++)if(i[o].path===e)return i[o]},this.baseGetHandler=i,this.collectionResourceHandler=function(t,e,n,i){return{Data:t,Meta:{Links:{},Paging:{}}}},this.pageHandler=function(t,e,n,i){};var t=[];function e(e,n,i){return n,new function(t,e,n,i){function o(t){for(var e=0;e!=this.state.domains.length;e++)if(this.state.domains[e].domain==t)return this.state.domains[e];return null}function a(t,e){"string"==typeof t&&(t=o(t));for(var n=t.methods,i=0;i!=n.length;i++)if(n[i].path===e)return n[i]}function s(t,n,i,o){for(var a=e.getValue("offlineModeData"),s=0;s!=a.domains.length;s++)a.domains[s];return a[i]}this.init=function(){var t=e.getValue("offlineModeData");t?this.state.offlineMode=t.offlineMode:e.setValue("offlineModeData",{domains:[]})},this.get=function(e,i){var o,s,r,f,h,d=null;if(r=i||{},!(f=this.getDomainByUrl(e)))return t.get(e,i);o=f.domain;var u=(s=e.substring(o.length)).indexOf("?");if(-1!=u){var l=s.substring(u+1);s=s.substring(0,u),l=l.split("&");for(var g=0;g!=l.length;g++){var m=l[g].split("=");"null"===m[1]&&(m[1]=""),r[decodeURIComponent(m[0])]=decodeURIComponent(m[1])}}if(!(h=a(f,s)))return t.get(e,i);for(var g=0;g!=h.getHandlers.length;g++)d=h.getHandlers[g](d,o,s,r);return n.when({data:d})},this.post=function(t,e){},this.put=function(t,e){},this.delete=function(t,e){},this.startOfflineMode=function(){if(1==this.state.offlineMode)return;this.state.offlineMode=!0;for(var i={offlineMode:!0,domains:[]},o=this.state.domains,a=0;a!=o.length;a++){var s={domain:o[a].domain,methods:[]};i.domains.push(s);for(var r=o[a].methods,f=[],h=0;h!=r.length;h++){var d={path:r[h].path,data:[]};s.methods.push(d);var u=t.get(s.domain+r[h].path).then(function(t,e){t.data=e.data.Data}.bind(this,d));f.push(u)}n.all(f).then(function(){e.setValue("offlineModeData",i)})}},this.stopOfflineMode=function(){if(0==this.state.offlineMode)return;this.state.offlineMode=!1;var t=e.getValue("offlineModeData");t.offlineMode=!1,e.setValue("offlineModeData",t)},this.getDomain=o,this.getDomainByUrl=function(t){for(var e=0;e!=this.state.domains.length;e++)if(0==t.indexOf(this.state.domains[e].domain))return this.state.domains[e]},this.getMethod=a,this.registerDomain=function(t){if(null!==o(t))return;this.state.domains.push({domain:t,methods:[]})},this.registerDomainMethod=function(t,e){o(t).methods.push({path:e,getHandlers:[s]})},this.baseGetHandler=s,this.pageHandler=function(t,e,n,i){},this.state={offlineMode:!1,domains:i||[]},this.init()}(e,n,i,t)}function n(e){for(var n=0;n!=t.length;n++)if(t[n].domain==e)return t[n];return null}function i(t,e,n,i){for(var o=cryptoStorageService.getValue("offlineModeData"),a=0;a!=o.domains.length;a++)for(var s=o.domains[a],r=0;r!=s.methods.length;r++){var f=s.methods[r];if(f.path==n)return f.data}}e.$inject=["$http","cryptoStorageService","$q"]})}();;!function(){"use strict";function t(t,e){this.get=function(n,i){return e.state.offlineMode?e.get(n,i):t.get(n,i)},this.post=function(n,i,o){return e.state.offlineMode?e.post(n,i,o):t.post(n,i,o)},this.put=function(n,i,o){return e.state.offlineMode?e.put(n,i,o):t.put(n,i,o)},this.delete=function(n,i){return e.state.offlineMode?e.delete(n,i):t.delete(n,i)}}angular.module("OfflineMode").service("offlineHttpWrapper",t),t.$inject=["$http","offlineService"]}();;!function(){"use strict";function t(t,e,s,i,r,n,h){void 0===h&&(h=!0);this.method=t,this.url=e,this.data=s,this.config=i,this.$http=r,this.$q=n,this.sendReq=h,this.config=this.config||{},this.extPromise=this.$q.defer(),h&&this.resend()}angular.module("FieldConnectApp").provider("httpRequestHandler",function(){this.$get=function(e,s){return new function(e,s){this.$http=e,this.$q=s,this.requests=[],this.getRequests=function(){return this.requests},this.get=function(e,s){var i=this,r=new t("get",e,null,s,this.$http,this.$q);return this.requests.push(r),r.getPromise().finally(function(){var t=i.requests.indexOf(r);-1!==t&&i.requests.splice(t,1)})},this.post=function(e,s,i){var r=this,n=new t("post",e,s,i,this.$http,this.$q);return this.requests.push(n),n.getPromise().finally(function(){var t=r.requests.indexOf(n);-1!==t&&r.requests.splice(t,1)})},this.put=function(e,s,i){var r=this,n=new t("put",e,s,i,this.$http,this.$q);return this.requests.push(n),n.getPromise().finally(function(){var t=r.requests.indexOf(n);-1!==t&&r.requests.splice(t,1)})},this.remove=function(e,s){var i=this,r=new t("delete",e,null,s,this.$http,this.$q);return this.requests.push(r),r.getPromise().finally(function(){var t=i.requests.indexOf(r);-1!==t&&i.requests.splice(t,1)})}}(e,s)},this.$get.$inject=["$http","$q"]}),t.prototype.getPromise=function(){return this.extPromise.promise},t.prototype.cancel=function(){this.canceler.resolve()},t.prototype.replace=function(t){this.currPromise=t,this.listenPromise(t)},t.prototype.resend=function(){var t,e=this.canceler;return this.canceler=this.$q.defer(),this.config.timeout=this.canceler.promise,this.currPromise=(t=this.$http)[this.method].apply(t,this.getMethodParams()),this.listenPromise(this.currPromise),e&&e.resolve(),this.extPromise.promise},t.prototype.getMethodParams=function(t){switch(t=t||this.method){case"get":case"delete":return[this.url,this.config];case"post":case"put":return[this.url,this.data,this.config];default:throw new Error("Invalid HTTP method.")}},t.prototype.listenPromise=function(t){var e=this;t.then(function(s){e.currPromise===t&&e.extPromise.resolve(s)},function(s){e.currPromise===t&&e.extPromise.reject(s)})}}();;!function(){"use strict";function t(t){this.getItems=function(e,i){return t.getItems(e,i).then(function(t){return this.state.items=t.data.Data,this.state.itemsMeta=t.data.Meta,t}.bind(this))},this.getItem=function(e,i){return t.getItem(e,i).then(function(t){return this.state.item=t.data,t}.bind(this))},this.remove=function(e,i){return t.remove(e,i)},this.update=function(e,i){return t.update(e,i)},this.create=function(e,i){return t.create(e,i)},this.uploadFile=function(e,i){return t.uploadFile(e,i)},this.downloadFile=function(e,i){return t.downloadFile(e,i)},this.state={items:[],item:{},itemsMeta:{}}}angular.module("FieldConnectApp").service("restService",t),t.$inject=["restFactory"]}();;!function(){"use strict";function n(n){this.checkBrowserAgent=function(){var n=window.navigator.userAgent,e=n.indexOf("MSIE ");if(e>0)return parseInt(n.substring(e+5,n.indexOf(".",e)),10);if(n.indexOf("Trident/")>0){var r=n.indexOf("rv:");return parseInt(n.substring(r+3,n.indexOf(".",r)),10)}var i=n.indexOf("Edge/");if(i>0)return parseInt(n.substring(i+5,n.indexOf(".",i)),10);return!1}}angular.module("FieldConnectApp").service("checkBrowserService",n),n.$inject=["$window"]}();;!function(){"use strict";function e(e,o,r,t,i,l,c,d,a,n,s){var u=r.filter("and"),p=[{Type:"datepicker",Label:"Need By Date:",Required:!0,ModelValue:"NeedByDate",Format:"MM/dd/yyyy",TabIndex:1},{Type:"dropdown",Label:"Problem Code:",ApiMethod:"problemcodes",ValueProp:"Id",TextProp:"ProblemCodeName",ModelValue:"ProblemCodeId",Required:!0,TabIndex:2},{Type:"dropdown",Label:"Serviceable Item:",ApiMethod:"serviceableItems",ValueProp:"Id",TextProp:"ServiceableItemName",ModelValue:"ServiceableItemId",Filter:u,Required:!1,TabIndex:3}];this.copyServiceRequest=function(e){var r=o.defer();return u.reset(),u.eq("SiteId",e.SiteId),n.showModal({templateUrl:"Templates/ServiceRequest/serviceRequestCopyModal.html",controller:"ServiceRequestCopyController",controllerAs:"vm",inputs:{modalTitle:"Service Request Copy",id:e.Id,model:{},attributes:p,apiMethod:"servicerequests"}}).then(function(e){e.close.then(function(e){e?bootbox.confirm("Do you want to open the new Service Request?",function(o){o?r.resolve(e):r.resolve(!1)}):r.resolve(!1)})}),r.promise}}angular.module("FieldConnectApp").service("copyServiceRequestService",e),e.$inject=["Notification","$q","qsService","restService","currentCompanyService","mobileDetectService","rolesFactory","cryptoStorageService","$filter","ModalService","fcGeoLocationService"]}();;!function(){"use strict";function n(n,e,i){this.setValue=function(t,r,o){if(void 0!=t&&null!=t&&void 0!=r&&null!=r)if(void 0!=i.environment&&null!=i.environment&&(t=i.environment+"."+t),o)n.set(t,r);else{var v=e.encrypt(JSON.stringify(r));n.set(t,v)}},this.getValue=function(t,r){if(void 0!=t&&null!=t){void 0!=i.environment&&null!=i.environment&&(t=i.environment+"."+t);var o=n.get(t);if(r)return o;if(void 0!=o&&null!=o){var v=e.decrypt(o);if("string"==typeof v){var l=JSON.parse(v);return l}}return o}},this.removeValue=function(e){void 0!=e&&null!=e&&(void 0!=i.environment&&null!=i.environment&&(e=i.environment+"."+e),n.remove(e))},this.removeAll=function(){for(var e=n.keys(),t=0;t<e.length;t++)void 0!=i.environment&&null!=i.environment?-1!=e[t].indexOf(i.environment)&&n.remove(e[t]):n.remove(e[t])}}angular.module("FieldConnectApp").service("cryptoStorageService",n),n.$inject=["localStorageService","$crypto","ngAuthSettings"]}();;!function(){"use strict";function e(e,t,a){this.isContractorCompany=function(e){return this.getCurrentCompany().then(function(t){var a=t;return void 0!=e&&null!=e&&e.hasOwnProperty("CompanyId")&&(a.Id==e.CompanyId?this.isContractor=!0:this.isContractor=!1),this.isContractor}.bind(this))},this.getCurrentCompany=function(){return this.currentCompany?t.when(this.currentCompany):e.getItem("companyinfos/getCurrentCompany").then(function(e){var t=e.data;return void 0!=t&&null!=t&&(this.currentCompany=t),this.currentCompany}.bind(this))},this.getCurrentCompanyIdEncoded=function(){return this.currentCompanyId?t.when(this.currentCompanyId):e.getItem("companyinfos/getCurrentCompanyIdEncoded").then(function(e){var t=e.data;return void 0!=t&&null!=t&&(this.currentCompanyId=t.CompanyId),this.currentCompanyId}.bind(this))},this.isContractor=!1,this.currentCompany=null,this.currentCompanyId=null,this.getViewAssignmentsDaysBack=null,this.getViewAssignmentsDaysForward=null,this.getDefaultAssignmentListSortOrder=null,this.sortDesc="Descending",this.sortAsc="Ascending",this.DefaultPromiseDateToToday=!0,this.WODescMaxLength=200,this.POGrid=!1,this.TaskGrid=!1,this.AutoCompleteWO=null,this.ShowReportAfterComplete="Never",this.CustomerViewableWONotesDefault=!1,this.CustomerViewableSiteNotesDefault=!1,this.getViewWorkOrdersDaysBack=null,this.getViewWorkOrdersDaysForward=null,this.GeoCodingService=null,this.GoogleMapsAPIKey=null,this.GeoCodeFarm="GeoCodeFarm",this.GoogleMaps="GoogleMaps",this.DisableGeoCodeLookupOnSite=!1,this.TrackRealTimeRoundLaborCost=null,this.TrackRealTimeRoundLaborBilling=null,this.EnableEventDebugLog=!1,this.UseLastKnownTecGeoLocation=!1,this.DefaultAssignmentStatus=null,this.GPSClientTrackingInterval=0,this.GPSEnableBrowserBasedTracking=!1,this.CustomerViewableWONotesByRole=null,this.CustomerViewableWOSiteNotesByRole=null,this.CustomerViewableQuoteNotesByRole=null,this.PreventAssignmentCompleteIfXOiJobOpen=!1,this.SaveXOiTranscriptNote=null,this.SaveXOiDataPlateSerialNumber=!1,this.SaveXOiDataPlateMfgDate=!1,this.SaveXOiDataPlateModel=!1,this.SaveXOiDataPlateMake=!1,this.SaveXOiDataPlateNote=!1,this.DefaultPaymentReceiptTemplate=0,this.DeficiencyQuoteConversionStatus=0,this.DefaultRemoteServiceReportEmailTemplate=0,this.RequestServiceReportSignature=!1,this.TechsViewAllQuotes=!1,this.ScannerEndOfDataCharacter=13,this.getCompanySettings=function(a){var s=t.defer();return e.getItems("companysettings",a).then(function(e){for(var t=e.data.Data,a=0;a<t.length;a++)"ViewAssignmentsDaysBack"===t[a].Name&&(this.getViewAssignmentsDaysBack=t[a].Value),"ViewAssignmentsDaysForward"===t[a].Name&&(this.getViewAssignmentsDaysForward=t[a].Value),"DefaultAssignmentListSortOrder"===t[a].Name&&(this.getDefaultAssignmentListSortOrder=t[a].Value),"DefaultPromiseDateToToday"===t[a].Name&&"false"===t[a].Value&&(this.DefaultPromiseDateToToday=!1),"WODescMaxLength"===t[a].Name&&parseInt(t[a].Value)<=200&&(this.WODescMaxLength=parseInt(t[a].Value)),"POGrid"===t[a].Name&&(this.POGrid=JSON.parse(t[a].Value.toLowerCase())),"TaskGrid"===t[a].Name&&(this.TaskGrid=JSON.parse(t[a].Value.toLowerCase())),"AutoCompleteWO"===t[a].Name&&(this.AutoCompleteWO=JSON.parse(t[a].Value.toLowerCase())),"ShowReportAfterComplete"===t[a].Name&&null!==t[a].Value&&(this.ShowReportAfterComplete=t[a].Value.toLowerCase()),"CustomerViewableWONotesDefault"===t[a].Name&&(this.CustomerViewableWONotesDefault=JSON.parse(t[a].Value.toLowerCase())),"CustomerViewableSiteNotesDefault"===t[a].Name&&(this.CustomerViewableSiteNotesDefault=JSON.parse(t[a].Value.toLowerCase())),"ViewWorkOrdersDaysBack"===t[a].Name&&(this.getViewWorkOrdersDaysBack=t[a].Value),"ViewWorkOrdersDaysForward"===t[a].Name&&(this.getViewWorkOrdersDaysForward=t[a].Value),"GeoCodingService"===t[a].Name&&(this.GeoCodingService=t[a].Value),"DisableGeoCodeLookupOnSite"===t[a].Name&&(this.DisableGeoCodeLookupOnSite=JSON.parse(t[a].Value.toLowerCase())),"TrackRealTimeRoundLaborCost"===t[a].Name&&(this.TrackRealTimeRoundLaborCost=t[a].Value),"TrackRealTimeRoundLaborBilling"===t[a].Name&&(this.TrackRealTimeRoundLaborBilling=t[a].Value),"EnableEventDebugLog"===t[a].Name&&(this.EnableEventDebugLog=JSON.parse(t[a].Value.toLowerCase())),"UseLastKnownTecGeoLocation"===t[a].Name&&(this.UseLastKnownTecGeoLocation=JSON.parse(t[a].Value.toLowerCase())),"AssignmentStatus"===t[a].Name&&(this.DefaultAssignmentStatus=t[a].Value),"GPSClientTrackingInterval"===t[a].Name&&(this.GPSClientTrackingInterval=t[a].Value),"GPSEnableBrowserBasedTracking"===t[a].Name&&(this.GPSEnableBrowserBasedTracking=JSON.parse(t[a].Value.toLowerCase())),"CustomerViewableWONotesByRole"===t[a].Name&&(this.CustomerViewableWONotesByRole=t[a].Value),"CustomerViewableWOSiteNotesByRole"===t[a].Name&&(this.CustomerViewableWOSiteNotesByRole=t[a].Value),"CustomerViewableQuoteNotesByRole"===t[a].Name&&(this.CustomerViewableQuoteNotesByRole=t[a].Value),"PreventAssignmentCompleteIfXOiJobOpen"===t[a].Name&&(this.PreventAssignmentCompleteIfXOiJobOpen=JSON.parse(t[a].Value.toLowerCase())),"SaveXOiTranscriptNote"===t[a].Name&&(this.SaveXOiTranscriptNote=t[a].Value),"SaveXOiDataPlateSerialNumber"===t[a].Name&&(this.SaveXOiDataPlateSerialNumber=JSON.parse(t[a].Value.toLowerCase())),"SaveXOiDataPlateMfgDate"===t[a].Name&&(this.SaveXOiDataPlateMfgDate=JSON.parse(t[a].Value.toLowerCase())),"SaveXOiDataPlateModel"===t[a].Name&&(this.SaveXOiDataPlateModel=JSON.parse(t[a].Value.toLowerCase())),"SaveXOiDataPlateMake"===t[a].Name&&(this.SaveXOiDataPlateMake=JSON.parse(t[a].Value.toLowerCase())),"SaveXOiDataPlateNote"===t[a].Name&&(this.SaveXOiDataPlateNote=JSON.parse(t[a].Value.toLowerCase())),"DefaultPaymentReceiptTemplate"===t[a].Name&&(this.DefaultPaymentReceiptTemplate=parseInt(t[a].Value)),"DeficiencyQuoteConversionStatus"===t[a].Name&&(this.DeficiencyQuoteConversionStatus=parseInt(t[a].Value)),"DefaultRemoteServiceReportEmailTemplate"===t[a].Name&&(this.DefaultRemoteServiceReportEmailTemplate=parseInt(t[a].Value)),"RequestServiceReportSignature"===t[a].Name&&(this.RequestServiceReportSignature=JSON.parse(t[a].Value.toLowerCase())),"TechsViewAllQuotes"===t[a].Name&&(this.TechsViewAllQuotes=JSON.parse(t[a].Value.toLowerCase())),"ScannerEndOfDataCharacter"===t[a].Name&&(this.ScannerEndOfDataCharacter=parseInt(t[a].Value));s.resolve(!0)}.bind(this)),s.promise},this.getEncryptedSetting=function(s){var i=t.defer(),o=a.filter("or");return o.eq("Name",s),e.getItems("companysettings",o).then(function(t){e.getItem("companysettings/decrypt",t.data.Data[0].Id).then(function(e){i.resolve(e.data.Value)})}),i.promise}}angular.module("FieldConnectApp").service("currentCompanyService",e),e.$inject=["restService","$q","qsService"]}();;!function(){"use strict";function e(e,t,a){this.isTechnician=function(e){return this.getCurrentUserEmployeeData().then(function(t){var a=t;return void 0!=e&&null!=e&&void 0!=a&&null!=a&&e.hasOwnProperty("TechId")&&(a.Id==e.TechId?this.isTech=!0:this.isTech=!1),this.isTech}.bind(this))},this.getCurrentUserEmployeeData=function(){return this.currentUserEmployeeData?e.when(this.currentUserEmployeeData):t.getItem("employees/getCurrentEmployee").then(function(e){var t=e.data;return void 0!=t&&null!=t&&"null"!=t&&(this.currentUserEmployeeData=t),this.currentUserEmployeeData}.bind(this))},this.getCurrentUserData=function(){return this.currentUserData?e.when(this.currentUserData):t.getItem("users/getCurrent").then(function(e){var t=e.data;return void 0!=t&&null!=t&&(this.currentUserData=t),this.currentUserData}.bind(this))},this.setUserAuthData=function(n,r,s){var i=a.getValue("authorization",!0);if(null==i)return null;var u=t.getItems("users/getCurrentUserInformation"),o=t.getItem("companyinfos/getCurrentCompany"),l=t.getItems("subscriptions/getActiveUserSubscription"),c=t.getItems("users/UserMenuItems"),h=t.getItems("rolepermission/guiprivilege"),m=t.getItems("companyfeatures/currentCompany"),d=t.getItems("companysettings"),p=[];p.push(u),s||p.push(l);r||p.push(o);return p.push(c),p.push(h),p.push(m),p.push(d),e.all(p).then(function(e){for(var t=btoa(i.access_token.substring(i.access_token.length-21,i.access_token.length-1)),n=[],u="",g=!1,f=!1,v=null,y=null,U=[],D=0;D<e[0].data.Roles.length;D++)D>0&&(u+=","),u+=e[0].data.Roles[D].RoleName,n.push(e[0].data.Roles[D].RoleName),U.push(e[0].data.Roles[D].RoleTypeName);var I=!1,b=!1,C=!1;for(1==n.length&&("TransAdmin"==n[0]?I=!0:"SubAdmin"==n[0]?b=!0:"SubContractor"==n[0]&&(C=!0)),D=0;D<U.length;D++)U[D];if(!s){var S=p.indexOf(l);for(D=0;D<e[S].data.Data.length;D++)"Active"==e[S].data.Data[D].Status&&(f=!0)}if(!r&&e[S=p.indexOf(o)]&&e[S].data){var T=e[S].data.Status;v=e[S].data.CompanyLogo,y=e[S].data.CompanyURL,"Active"==T&&(g=!0)}var N=p.indexOf(c),R=e[p.indexOf(h)].data,E=e[p.indexOf(m)].data.Data;a.removeValue("featurelist"),a.setValue("featurelist",E);var O=e[p.indexOf(d)].data.Data;a.removeValue("companySettingsList"),a.setValue("companySettingsList",O);var V={userName:e[0].data.UserName,fullName:e[0].data.FullName,session:t,userRoles:u,utcMinutes:e[0].data.UtcMinutes,tzDatebaseName:e[0].data.TzDatabaseName,companyStatus:g,companyLogoUrl:v,companyLogInUrl:y,subscriptionStatus:f||C||b||I||-1!=n.indexOf("FieldConnect"),userRoleTypes:e[N].data,privileges:R};a.setValue("authorizationData",V)}.bind(this),function(e,t){return a.removeValue("authorizationData"),e}.bind(this))},this.isTech=!1,this.currentUserEmployeeData=null,this.currentUserData=null,this.getUserSetting=function(a){var n=e.defer();return t.getItems("usersettings").then(function(e){for(var t=e.data.Data,r=null,s=0;s<t.length;s++)t[s].Name==a&&(r=t[s].Value);n.resolve(r)}),n.promise}}angular.module("FieldConnectApp").service("currentUserService",e),e.$inject=["$q","restService","cryptoStorageService"]}();;!function(){"use strict";function e(e,t,i){this.getDefaultSite=function(n){var s=t.defer(),a=i.filter("and");return a.eq("CustomerId",n),e.getItems("sites",a).then(function(t){var i=t.data;1===i.Data.length?e.getItem("sites/",i.Data[0].Id).then(function(e){this.defaultSite=e.data,s.resolve(this.defaultSite)}.bind(this)):(this.defaultSite=null,s.resolve(this.defaultSite))}.bind(this)),s.promise},this.defaultSite=null}angular.module("FieldConnectApp").service("customerService",e),e.$inject=["restService","$q","qsService"]}();;!function(){"use strict";function e(e,t){this.validateDate=function(t){if(t)try{new Date(t).toISOString();if(moment(t).isBefore(new Date("1753/1/1"))||moment(t).isAfter(new Date("9999/12/31")))return e.error({message:"Invalid date, must be between 1/1/1753 and 12/31/9999!"}),!1}catch(t){return e.error({message:"Invalid date format!"}),!1}return!0},this.validateDateRange=function(t,r){if(t&&r&&moment(t).isAfter(r))return e.warning({message:n}),n="Invalid date range!",!1;return!0},this.setMessage=function(e){n=e},this.restrictToDate=function(){return"[0-9\\/]"},this.searchDateToUTC=function(e,n){var r=new Date(e);"from"===n?r.setHours(0,0,0,0):r.setHours(23,59,59,999);var a=new Date(r);return t.convertToUtc(a)};var n="Invalid date range!"}angular.module("FieldConnectApp").service("dateService",e),e.$inject=["Notification","timezoneService"]}();;!function(){"use strict";function e(){this.detectIE=function(){var e=window.navigator.userAgent;return e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0}}angular.module("FieldConnectApp").service("detectIEService",e),e.$inject=[]}();;!function(){"use strict";function e(e,t,i){this.currentDate=moment(),this.daysBack=30,this.getVisits=function(s){var n=t.defer(),a=i.filter("and");return a.eq("SiteId",s).gt("RequestDate",moment(this.currentDate).add(-1*this.daysBack,"days").format("MM/DD/YYYY")),e.getItems("wodetails",a).then(function(e){n.resolve(e.data.Data.length)}),n.promise}}angular.module("FieldConnectApp").service("dslVisitsService",e),e.$inject=["restService","$q","qsService"]}();;!function(){"use strict";angular.module("FieldConnectApp").service("emailValidationService",function(){var a=/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i;this.validateEmailAddress=function(e){var i=!1;a.test(e)&&(i=!0);return i}})}();;!function(){"use strict";function e(e,t,n){this.createEvent=function(e){n.getLocation(e.TableName).then(function(n){e.Latitude=n.coords.latitude,e.Longitude=n.coords.longitude,t.create("events",e).then(function(){})})}}angular.module("FieldConnectApp").service("fcEventService",e),e.$inject=["$q","restService","fcGeoLocationService"]}();;!function(){"use strict";function e(e,o,t,n,r,s){function i(e){switch($("#gps-icon").removeClass("gps-success"),$("#gps-icon").removeClass("gps-warning"),$("#gps-icon").removeClass("gps-error"),e.toLowerCase()){case"success":$("#gps-icon").addClass("gps-success");break;case"warning":$("#gps-icon").addClass("gps-warning");break;case"error":$("#gps-icon").addClass("gps-error")}}this.getLocation=function(t){var n,i,c=o.defer(),a={coords:{latitude:null,longitude:null}};return n=s.getValue("EnableEventDebugLog"),i=s.getValue("UseLastKnownTecGeoLocation"),e.getCurrentPosition().then(function(e){s.setValue("latitude",e.coords.latitude),s.setValue("longitude",e.coords.longitude),c.resolve(e)},function(e){var u={Code:e.error.code,Message:e.error.message,Action:t};i&&(a.coords.latitude=s.getValue("latitude"),a.coords.longitude=s.getValue("longitude")),n?function(e){var t=o.defer();return r.create("eventDebug",e).then(function(e){t.resolve(e)}),t.promise}(u).then(function(){c.resolve(a)}):c.resolve(a)}),c.promise},this.saveGPSTracking=function(){var o=s.getValue("GPSLatitude"),t=s.getValue("GPSLongitude");e.getCurrentPosition().then(function(e){var n=e.coords.latitude,c=e.coords.longitude;if(n!==o&&c!==t){s.setValue("GPSLatitude",n),s.setValue("GPSLongitude",c);var a={Latitude:n,Longitude:c};r.create("gpsTrackingLocation",a).then(function(e){i("success")},function(e){i("error")})}else i("warning")},function(e){i("error")})}}angular.module("FieldConnectApp").service("fcGeoLocationService",e),e.$inject=["$geolocation","$q","currentCompanyService","qsService","restService","cryptoStorageService"]}();;!function(){"use strict";function e(e,t,a,n,r,l,o,i){this.creditCard="cc",this.check="check",this.getPaymentAttributes=function(e){switch(e){case this.check:return[s,u,b,m,R,T,h,{Type:"empty",CustomClass:"fc-empty-control col-sm-6"}];case this.creditCard:default:return v()}},this.clearModel=function(e){return e.Expiration=null,e.SecurityCode=null,e.AccountNumber=null,e.BankABA=null,e.Token=null,e},this.processRefund=function(a,r){var o=e.defer(),i=r.find(e=>e.Id===a.Id);if(i)if("Refund"!==i.TransactionType&&i.VoidRefund){n.warning("Processing refund...");var c={Id:a.Id,ReferenceNumber:a.ReferenceNumber,ReceiptTemplateId:l.DefaultPaymentReceiptTemplate};t.create("fcPayment/processRefund",c).then(function(e){n.success("Payment has been refunded!"),o.resolve(!0)},function(e){n.error("There was a problem processing the refund!"),o.resolve(!1)})}else n.error("The Transaction cannot be refunded!"),o.resolve(!1);else n.error("There was an error processing the request! The transaction was not found."),o.resolve(!1);return o.promise},this.getPaymentBillingDetails=function(a){var n=e.defer();return t.getItem("fcPayment/billingDetails",a).then(function(e){var t={Amount:parseFloat(e.data.GrandTotal)};null===e.data.BillingContactName?(t.ContactName=e.data.ContactName,t.ContactEmail=e.data.ContactEmail,t.PostalCode=e.data.PostalCode):(t.ContactName=e.data.BillingContactName,t.ContactEmail=e.data.BillingContactEmail,t.PostalCode=e.data.BillingPostalCode),n.resolve(t)}),n.promise},this.updateSettlementStatus=function(a){var r=e.defer(),l={WoId:parseInt(a)};return n.warning("Updating settlement status..."),t.create("fcPayment/updateSettlementStatus",l).then(function(e){n.success("Settlement status has been updated!"),r.resolve(!0)},function(e){n.error("There was a problem updating the settlement status!"),r.resolve(!1)}),r.promise},this.submitPayment=function(a){var r=e.defer();parseInt(a.Amount)<=0?(n.error("The Amount must be greater than 0!"),r.resolve(!1)):(a.ReceiptTemplateId=l.DefaultPaymentReceiptTemplate,t.create("fcPayment",a).then(function(e){if(null!==e.data&&function(e){switch(e.toLowerCase()){case"approved":n.success("The Payment has been submitted!");break;case"retry":n.warning("There was a problem submitting your Payment, please try again.");break;case"declined":n.error("The Payment was declined!")}}(e.data.Status),"cc"===a.PaymentType){var t=document.getElementById("ccIFrame").src;document.getElementById("ccIFrame").src=t}r.resolve(!0)},function(e){n.error("There was a problem submitting the payment!"),r.resolve(!1)}));return r.promise},this.emailReceipt=function(t,a){var l=e.defer(),o={Id:t.Id,CardHolder:a.CardHolder,CardHolderEmail:a.CardHolderEmail},i=[u,p,g];return r.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PaymentReceiptEmailModalController",controllerAs:"vm",inputs:{model:o,modalTitle:"Email Receipt",apiMethod:"fcPayment/emailReceipt",attributes:i}}).then(function(e){e.close.then(function(e){e&&(n.success("The Receipt has been sent!"),l.resolve(!0))})}),l.promise};var c=o.filter("or");c.eq("Name","DefaultPaymentReceiptTemplate"),l.getCompanySettings(c).then(function(){});var d={Type:"ccTokenizer",Label:"Card Number:",Source:null,ModelValue:"Token",Required:!0},s={Type:"dropdown",Label:"Payment Type:",Required:!0,ApiMethod:"lookup/fcPaymentPaymentTypes",ValueProp:"Key",TextProp:"Value",ModelValue:"PaymentType",ReadOnly:!1},u={Type:"text",Label:"Card Holder:",MaxLength:"50",ModelValue:"CardHolder",ReadOnly:!1,Required:!1},m={Type:"text",Label:"Email:",MaxLength:"200",ModelValue:"CardHolderEmail",ReadOnly:!1,Required:!1},p={Type:"text",Label:"Email:",MaxLength:"200",ModelValue:"CardHolderEmail",ReadOnly:!1,Required:!0},y={Type:"text",Label:"Expiration:",MaxLength:"4",ModelValue:"Expiration",ReadOnly:!1,Required:!0},f={Type:"text",Label:"Security Code:",MaxLength:"3",ModelValue:"SecurityCode",ReadOnly:!1,Required:!0},h={Type:"decimal",Label:"Amount:",ModelValue:"Amount",ReadOnly:!1,Required:!0},T={Type:"text",Label:"Postal Code:",ModelValue:"PostalCode",ReadOnly:!1,Required:!0},b={Type:"text",Label:"Account Number:",MaxLength:"50",ModelValue:"AccountNumber",ReadOnly:!1,Required:!0},R={Type:"text",Label:"ABA Number:",MaxLength:"9",ModelValue:"BankABA",ReadOnly:!1,Required:!0},g={Type:"textarea",Label:"Note:",MaxLength:"500",ModelValue:"Note"},C=!0;function v(){return[s,u,d,m,y,f,h,T]}i.isOffice&&(C=!1,(i.isAdmin||i.isDispatch||i.isSupervisor||i.isTechnician)&&(C=!0)),C&&t.getItems("fcPayment/tokenUrl").then(function(e){var t=e.data.Data,a=null;t&&(a=t[0].Value),d.Source=a})}angular.module("FieldConnectApp").service("fcPaymentService",e),e.$inject=["$q","restService","cryptoStorageService","Notification","ModalService","currentCompanyService","qsService","rolesFactory"]}();;!function(){"use strict";function e(e){this.getModulePrivilege=function(e,i){var r=30;if(i){var t=n(e);if(t){var s=l(i,t.Modules);if(s&&(s.PrivilegeValue||0===s.PrivilegeValue))return r=s.PrivilegeValue}}return r},this.applyPrivileges=function(e,i,r,s){if(e&&i&&r){var a=n(e);if(a){var u=l(i,a.Modules);if(u)var f=u.PrivilegeValue}if(a&&u&&u.PrivilegeValue){for(var v=0;v<r.length;v++)if(f===this.permissions.Get&&"link"!=r[v].Type&&(r[v].ReadOnly=!0),r[v].ObjectName&&u.hasOwnProperty("Objects")){var o=t(u.Objects,r[v].ObjectName);o&&(o.PrivilegeValue===this.permissions.Get?"link"!=r[v].Type&&(r[v].ReadOnly=!0):0===o.PrivilegeValue&&(s?(r.splice(v,1),v-=1):r[v].Type="hidden"))}}else if(a&&u&&!u.PrivilegeValue)for(var v=0;v<r.length;v++)if(r[v].ObjectName&&u.hasOwnProperty("Objects")){var o=t(u.Objects,r[v].ObjectName);o&&(o.PrivilegeValue===this.permissions.Get?r[v].ReadOnly=!0:0===o.PrivilegeValue&&(r.splice(v,1),v-=1))}}return r},this.getVisibility=function(e,i){if(null==e)return!0;return(e&this.permissions[i])==this.permissions[i]};var i=[],r=e.getValue("authorizationData");r&&r.privileges&&(i=r.privileges),this.permissions={Get:2,Create:4,Update:8,Delete:16,ReadOnly:2,NoAccess:0};var t=function(e,i){for(var r=0;r<e.length;r++){var n=e[r];if(n.Identifier===i)return n;if(n.hasOwnProperty("Objects")){var l=t(n.Objects,i);if(l)return l}}return null};function n(e){if(e)for(var r=0;r<i.length;r++)if(i[r].Identifier===e)return i[r]}function l(e,i){if(e)for(var r=0;r<i.length;r++)if(i[r].Identifier===e)return i[r]}this.loadObjectPrivileges=function(e,r){for(var t=0;t!==i.length;t++)if(i[t].Identifier==e)for(var n=0;n!==i[t].Modules.length;n++)if(i[t].Modules[n].Identifier==r){s=i[t].Modules[n].Objects;break}},this.getObjectPrivilege=function(e){for(var i=0;i!=s.length;i++)if(s[i].Identifier==e)return s[i].PrivilegeValue;return null};var s=[]}angular.module("FieldConnectApp").service("guiPrivilegeService",e),e.$inject=["cryptoStorageService"]}();;!function(){"use strict";angular.module("FieldConnectApp").service("mobileDetectService",function(){this.onMobile=function(){var i=!1;(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4)))&&(i=!0);return i}})}();;!function(){"use strict";function e(){this.getObjectDiffAttrs=function(e,t){return Object.keys(e).reduce(function(n,i){if(t.hasOwnProperty(i)){if(e[i]===t[i]){var r=n.indexOf(i);n.splice(r,1)}}else n.push(i);return n},Object.keys(t))},this.getObjectDiffAttrsWithValues=function(e,t){var n=angular.copy(e),i=angular.copy(t),r=Object.keys(e).reduce(function(n,i){if(t.hasOwnProperty(i)){if(e[i]===t[i]){var r=n.indexOf(i);n.splice(r,1)}}else n.push(i);return n},Object.keys(t)),c={};if(r&&r.length>0)for(var o=0;o<r.length;o++)c[r[o]]={},void 0!==n[r]?c[r[o]].newVal=n[r]:c[r[o]].newVal=void 0,void 0!==i[r]?c[r[o]].oldVal=i[r]:c[r[o]].oldVal=void 0;return c}}angular.module("FieldConnectApp").service("objectsComparerService",e),e.$inject=[]}();;!function(){"use strict";function t(){function t(){function t(t){for(var r="",n=[";",":","[","]","@",","],e=0;e!=t.length;e++)-1!==n.indexOf(t[e])?r+=i(t[e]):r+=t[e];return r}function i(t){for(var i="",e=0;e!=t.length;e++){var s;(s=n(t,e))>65535&&e++,s<=127?i+=r(s):s<=2047?i+=r(192+(s>>6))+r(128+(63&s)):55296<=s&&s<=57343?i+="":s<=65535?i+=r(224+(s>>12))+r(128+(s>>6&63))+r(128+(63&s)):s<=1114111&&(i+=r(240+(s>>18))+r(128+(s>>12&63))+r(128+(s>>6&63))+r(128+(63&s)))}return i}function r(t){return"@"+t.toString(16)}function n(t,i){i=i||0;var r,n,e=t.charCodeAt(i);if(55296<=e&&e<=56319){if(r=e,n=t.charCodeAt(i+1),isNaN(n))throw"High surrogate not followed by low surrogate in fixedCharCodeAt()";return 1024*(r-55296)+(n-56320)+65536}return!(56320<=e&&e<=57343)&&e}this.filter_op="and",this.filter=[],this.filter.toString=function(){return this.join(";")},this.Reload=0,this.eq=this.equal=function(i,r){if(void 0===r||null===r)return this;if(r.constructor===Array)r="{"+r.join(",")+"}";else if("string"!=typeof r){if(!r.toString)return this;r=r.toString()}return r=t(r),this.filter.push(i+":[eq]"+r),this},this.neq=this.notEqual=function(i,r){if(void 0===r||null===r)return this;if(r.constructor===Array)r="{"+r.join(",")+"}";else if("string"!=typeof r){if(!r.toString)return this;r=r.toString()}return r=t(r),this.filter.push(i+":[-eq]"+r),this},this.lt=this.lessThan=function(i,r){if(void 0===r||null===r)return this;if("string"!=typeof r){if(!r.toString)return this;r=r.toString()}return r=t(r),this.filter.push(i+":[lt]"+r),this},this.gt=this.greaterThan=function(i,r){if(void 0===r||null===r)return this;if("string"!=typeof r){if(!r.toString)return this;r=r.toString()}return r=t(r),this.filter.push(i+":[gt]"+r),this},this.ge=this.greaterThanOrEqual=function(i,r){if(void 0===r||null===r)return this;if("string"!=typeof r){if(!r.toString)return this;r=r.toString()}return r=t(r),this.filter.push(i+":[ge]"+r),this},this.le=this.lessThenOrEqual=function(i,r){if(void 0===r||null===r)return this;if("string"!=typeof r){if(!r.toString)return this;r=r.toString()}return r=t(r),this.filter.push(i+":[le]"+r),this},this.like=function(i,r){if(void 0===r||null===r)return this;if("string"!=typeof r){if(!r.toString)return this;r=r.toString()}return r=t(r),this.filter.push(i+":[like]"+r),this},this.notLike=function(i,r){if(void 0===r||null===r)return this;if("string"!=typeof r){if(!r.toString)return this;r=r.toString()}return r=t(r),this.filter.push(i+"[-like]"+r),this},this.reset=function(){this.filter.length>0&&this.filter.splice(0,this.filter.length)}}this.filter=function(i){var r=new t;return r.filter_op=i,r},this.FilterString=t}angular.module("FCUtilsModule").service("qsService",t),t.$inject=[]}();;!function(){"use strict";function n(n){return{compile:function(e,t){angular.isFunction(t)&&(t={post:t});var o,r=e.contents().remove();return{pre:t&&t.pre?t.pre:null,post:function(e,c){o||(o=n(r)),o(e,function(n){c.append(n)}),t&&t.post&&t.post.apply(null,arguments)}}}}}angular.module("FieldConnectApp").service("recursionService",n),n.$inject=["$compile"]}();;!function(){"use strict";function n(){this.sortArray=function(n,t,r){var e=r?function(t){return r(t[n])}:function(t){return"string"==typeof t[n]?t[n].toLowerCase():t[n]};return t=t?-1:1,function(n,r){return n=e(n),r=e(r),t*((n>r)-(r>n))||(null===n)-(null===r)}}}angular.module("FieldConnectApp").service("sortArrayObjectsByAttrService",n),n.$inject=[]}();;!function(){"use strict";function t(){this.setTransitionParam=function(t,i){this.state.transitionParams[t]=i},this.getTransitionParam=function(t){return this.state.transitionParams[t]},this.popTransitionParam=function(t){var i=this.state.transitionParams[t];return delete this.state.transitionParams[t],i},this.selectiveExtend=function(t,i,n){for(var a=0;a!=n.length;a++)"object"==typeof i[n[a]]&&$.extend(!0,t[n[a]],i[n[a]]),t[n[a]]=i[n[a]]},this.state={transitionParams:{}}}angular.module("FieldConnectApp").service("stateTransitionService",t),t.$inject=[]}();;!function(){"use strict";function i(){this.splitString=function(i,n){return i.split(n)}}angular.module("FieldConnectApp").service("stringToArrayService",i),i.$inject=[]}();;!function(){"use strict";function t(t){this.convertToLocal=function(e,n){if(!e)return null;if(void 0!==n&&null!==n)"string"==typeof n&&(n=parseInt(n)),e.setMinutes(e.getMinutes()-n);else{var i=t.getValue("authorizationData");if(i&&i.tzDatebaseName){var r=moment.tz.zone(i.tzDatebaseName).offset(e);e.setMinutes(e.getMinutes()-r)}}return e},this.convertToUtc=function(e,n){if(!e)return null;if(void 0!==n&&null!==n)"string"==typeof n&&(n=parseInt(n)),e.setMinutes(e.getMinutes()+n);else{var i=t.getValue("authorizationData");if(i&&i.tzDatebaseName){var r=moment.tz.zone(i.tzDatebaseName).offset(e);e.setMinutes(e.getMinutes()+r)}}return e},this.buildISOString=function(t){if(!t)return"";var e=""+t.getFullYear(),n=("0"+(t.getMonth()+1)).slice(-2),i=("0"+t.getDate()).slice(-2),r=e+"-"+n+"-"+i,s=("0"+t.getHours()).slice(-2),a=("0"+t.getMinutes()).slice(-2);return r+"T"+s+":"+a},this.getCurrentTimezoneOffsetString=function(t){var e=new Date(t).getTimezoneOffset(),n=("0"+Math.floor(Math.abs(e/60))).slice(-2),i=("0"+Math.abs(e%60)).slice(-2);return(e>0?"-":"+")+n+":"+i},this.parseISOString=function(t){if(!t)return null;var e=new Date(864e5),n=t.split("T"),i=n[0],r=n[1];-1!=r.indexOf("+")&&(r=r.substring(0,r.indexOf("+")));-1!=r.indexOf("-")&&(r=r.substring(0,r.indexOf("-")));-1!=r.indexOf("Z")&&(r=r.substring(0,r.indexOf("Z")));var s=i.split("-");e.setFullYear(parseInt(s[0])),e.setMonth(parseInt(s[1])-1),e.setDate(parseInt(s[2]));var a=r.split(":");e.setHours(parseInt(a[0])),e.setMinutes(parseInt(a[1])),a[2]&&e.setSeconds(parseInt(a[2]));return e},this.buildDisplayString=function(t,e){switch(e){case"datetime":return n(t)+" "+i(t);case"date":return n(t);case"time":return i(t);default:return n(t)+" "+i(t)}},this.buildDateDisplayString=n,this.buildTimeDisplayString=i;var e=new Date;function n(t){return moment(t).format("MM/DD/YYYY")}function i(t){return moment(t).format("h:mm A")}moment(e).tz("America/Los_Angeles").format("Z")}angular.module("FieldConnectApp").service("timezoneService",t),t.$inject=["cryptoStorageService"]}();;!function(){"use strict";function e(e,t,n){this.checkInProgressLabor=function(r){var s=t.defer(),a=!1,i=n.filter("and");return i.eq("AssignmentId",r).eq("EndDate","NULL"),e.getItems("woLabors",i).then(function(e){e.data.Data.length>0&&(a=!0),s.resolve(a)}),s.promise},this.checkInProgressLaborByWOId=function(r){var s=t.defer(),a=!1,i=n.filter("and");return i.neq("AssignmentId","NULL").eq("EndDate","NULL").eq("WoId",r),e.getItems("woLabors",i).then(function(e){e.data.Data.length>0&&(a=!0),s.resolve(a)}),s.promise}}angular.module("FieldConnectApp").service("trackRealTimeService",e),e.$inject=["restService","$q","qsService"]}();;!function(){"use strict";function e(e,t,a,i,o,n,r,s,l,d,c){var v=this,u=void 0,b=void 0,m=void 0,g=!1,f=void 0,O=void 0,p=void 0,X=!1,D=a.filter("or");v.saveXOiTranscriptNote="none",v.preventAssignmentCompleteIfXOiJobOpen=!1,v.reportAttributes=" {ShowHideVisionLink} {FCVision}",v.saveXOiDataPlateSerialNumber=!1,v.saveXOiDataPlateMfgDate=!1,v.saveXOiDataPlateModel=!1,v.saveXOiDataPlateMake=!1,v.saveXOiDataPlateNote=!1,D.eq("Name","SaveXOiTranscriptNote").eq("Name","SaveXOiDataPlateData").eq("Name","SaveXOiDataPlateNote").eq("Name","PreventAssignmentCompleteIfXOiJobOpen"),D.eq("Name","SaveXOiDataPlateSerialNumber").eq("Name","SaveXOiDataPlateMfgDate").eq("Name","SaveXOiDataPlateModel"),D.eq("Name","SaveXOiDataPlateMake").eq("Name","SaveXOiDataPlateNote"),o.getCompanySettings(D).then(function(e){p=o.SaveXOiDataPlateData,X=o.SaveXOiDataPlateNote,v.saveXOiTranscriptNote=o.SaveXOiTranscriptNote,v.preventAssignmentCompleteIfXOiJobOpen=o.PreventAssignmentCompleteIfXOiJobOpen,v.saveXOiDataPlateSerialNumber=o.SaveXOiDataPlateSerialNumber,v.saveXOiDataPlateMfgDate=o.SaveXOiDataPlateMfgDate,v.saveXOiDataPlateModel=o.SaveXOiDataPlateModel,v.saveXOiDataPlateMake=o.SaveXOiDataPlateMake,v.saveXOiDataPlateNote=o.SaveXOiDataPlateNote}),v.getXOiJobId=function(){return b},v.setXOiJob=function(e){var a=t.defer();return O=e,g=!1,i.getItems("xoi/getJobList/"+O).then(function(e){if(0===e.data.data.listJobs.jobConnection.items.length){var t={assignmentId:O};i.create("xoi/createJob",t).then(function(e){null!==e.data.data&&(b=e.data.data.createJob.job.id,u=e.data.data.createJob.job.deepLinks.visionMobile.editJob.url)})}else b=e.data.data.listJobs.jobConnection.items[0].id,null!==e.data.data.listJobs.jobConnection.items[0].completedAt?(!0,u=e.data.data.listJobs.jobConnection.items[0].deepLinks.visionMobile.viewJob.url,null!==e.data.data.listJobs.jobConnection.items[0].integrationEntityId&&(g=!0)):u=e.data.data.listJobs.jobConnection.items[0].deepLinks.visionMobile.editJob.url;if(g){var o={JobId:b};i.create("xoi/createEntireJobShare",o).then(function(e){m=e.data.data.createJobShare.jobShare.shareLink,a.resolve(!0)})}else a.resolve(!0)}),a.promise},v.getXOiJob=function(e){var a=t.defer();return g=!1,i.getItems("xoi/getJobList/"+e).then(function(e){if(0===e.data.data.listJobs.jobConnection.items.length)a.resolve(!1);else if(b=e.data.data.listJobs.jobConnection.items[0].id,null!==e.data.data.listJobs.jobConnection.items[0].completedAt?(!0,u=e.data.data.listJobs.jobConnection.items[0].deepLinks.visionMobile.viewJob.url,null!==e.data.data.listJobs.jobConnection.items[0].integrationEntityId&&(g=!0)):u=e.data.data.listJobs.jobConnection.items[0].deepLinks.visionMobile.editJob.url,g){var t={JobId:b};i.create("xoi/createEntireJobShare",t).then(function(e){m=e.data.data.createJobShare.jobShare.shareLink,a.resolve(!0)})}else a.resolve(!0)}),a.promise},v.isXOiJobComplete=function(a){var o=t.defer();return i.getItems("xoi/getJobList/"+a).then(function(t){0===t.data.data.listJobs.jobConnection.items.length?(e.warning("The Assignment does not have a XOi Job"),o.resolve(!0)):(null!==t.data.data.listJobs.jobConnection.items[0].completedAt&&o.resolve(!0),o.resolve(!1))}),o.promise},v.setSiteAddress=function(e){f=e},v.hasJobShareLink=function(){return!!g},v.showImportDataPlate=function(){return"none"!==p||!!X},v.processXOICapturedData=function(){var a=t.defer(),o={JobId:b,AssignmentId:O};return c.getLocation("XOiIntegration").then(function(t){o.Latitude=t.coords.latitude,o.Longitude=t.coords.longitude,i.create("xoi/processCapturedData",o).then(function(t){var i="";if(0===t.data.NoteCount)e.warning(t.data.Message),a.resolve(!1);else if(0===t.data.ImportedNoteCount)e.warning(t.data.Message),a.resolve(!1);else{switch(t.data.ImportType){case"assignmentnote":i="Assignment";break;case"serviceableitemnote":i="Serviceable Item";break;case"workordernote":i="Work Order";break;case"sitenote":i="Site"}var o=`${t.data.Message} to ${i} Notes`;e.success(o),a.resolve(!0)}})}),a.promise},v.usingXOiIntegration=function(){return s.getValue("usingXOiIntegration")},v.setUsingXOiIntegration=function(){var e=t.defer();if(r.roleTypes.includes("Technician")&&n.onMobile()){var a=s.getValue("featurelist");l("filter")(a,{FeatureName:"XOiIntegration"})[0].Active?i.getItem("xoi/getUser").then(function(t){t.data.data?(s.setValue("usingXOiIntegration",!0),e.resolve(!0)):(s.setValue("usingXOiIntegration",!1),e.resolve(!1))}):(s.setValue("usingXOiIntegration",!1),e.resolve(!1))}else s.setValue("usingXOiIntegration",!1),e.resolve(!1);return e.promise},v.importXOiPlateData=function(){var e=t.defer(),o=[];if(b){var n=a.filter("and").eq("JobId",b);i.getItems("xoi/getDataPlateData/",n).then(function(t){o=t.data.Data,e.resolve(o)})}return e.promise},v.importXOiPlateDataModal=function(e){var a=t.defer();return d.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/xoiDataPlateDataModal.html",controller:"XoiDataPlateDataController",controllerAs:"vm",inputs:{item:e,SaveXOiDataPlateData:p,SaveXOiDataPlateNote:X,modalTitle:"XOi Data Plate Data",jobId:b,attributes:{},apiMethod:"xoi/getDataPlateData"}}).then(function(e){e.close.then(function(e){e&&a.resolve(!0),a.resolve(!1)})}),a.promise},v.viewXOiJob=function(){null===u&&void 0===u||window.location.replace(u)},v.viewVisionShare=function(){null===m&&void 0===m||window.open(m,"_blank")},v.viewKnowlegeBase=function(t){null!==t?i.getItem("serviceableitems",t).then(function(t){if(null===t.data.Mfr||null===t.data.Model)e.error("Manufacturer or Model is missing! Link cannot be viewed.");else{var a=`{"exactMatchFilters":{"makes":["${t.data.Mfr}"]},"search":"${t.data.Model}"}`,i=`xoi-vision://knowledge?searchKnowledgebaseContent=${encodeURIComponent(a)}`;window.location.replace(i)}}):e.error("The Assignment does not have a Serviceable Item!")},v.viewXOiVisionLive=function(){window.location.replace("xoi-vision://team")},v.viewSiteHistory=function(){if(null!==f&&void 0!==f){var t=`{"exactMatchAllTags":["${f}"]}`,a=`xoi-vision://activity/search?payload=${encodeURIComponent(t)}`;window.location.replace(a)}else e.error("Cannote view Site History!  Site Address is missing.")}}angular.module("FieldConnectApp").service("xoiService",e),e.$inject=["Notification","$q","qsService","restService","currentCompanyService","mobileDetectService","rolesFactory","cryptoStorageService","$filter","ModalService","fcGeoLocationService"]}();;!function(){"use strict";function e(e,t,i,o,a,l){this.editNote=function(e,a){var l=t.defer(),r={ServiceableItemId:a};return i.filter("and").eq("ServiceableItemId",a),o.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Serviceable Item Note Edit Form",id:e,model:r,attributes:[{Type:"textarea",Label:"Note:",Required:!0,MaxLength:"500",ModelValue:"Note"},{Type:"checkbox",Label:"Customer Viewable:",ModelValue:"CustomerViewable"}],apiMethod:"serviceableitemnotes"}}).then(function(e){e.close.then(function(){l.resolve(!0)})}),l.promise},this.editAttachment=function(e,a){var l=t.defer(),r={ServiceableItemId:a},n=i.filter("and"),c=[{Type:"dropdown",Label:"Type:",Required:!0,ApiMethod:"attachmentTypes",ValueProp:"AttachmentTypeName",TextProp:"AttachmentTypeName",ModelValue:"AttachmentType",Filter:i.filter("and").eq("attachmentCategory","WO")},{Type:"text",Label:"Name:",Required:!0,MaxLength:"50",ModelValue:"AttachmentName"},{Type:"text",Label:"Description :",MaxLength:"200",ModelValue:"Desc"},{Type:"file",Label:"File:",ApiMethod:"serviceableitemattachments/file"}];return n.eq("ServiceableItemId",a),o.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:"Serviceable Item Attachments Edit Form",id:e,model:r,attributes:c,apiMethod:"serviceableitemattachments",filter:n}}).then(function(e){e.close.then(function(){l.resolve(!0)})}),l.promise},this.assignItem=function(i,o){var r=t.defer();return i===o.ServiceableItemId?(a.warning("Serviceable Item is already on the Assignment!"),r.resolve(!1)):(o.ServiceableItemId=i,l.getLocation("WOAssignmentHeader").then(function(t){o.Latitude=t.coords.latitude,o.Longitude=t.coords.longitude,e.update("woassignments/"+o.Id,o).then(function(e){a.success("Serviceable Item has been added to the Assignment!"),r.resolve(!0)})})),r.promise}}angular.module("FieldConnectApp").service("woServiceableItemService",e),e.$inject=["restService","$q","qsService","ModalService","Notification","fcGeoLocationService"]}();;!function(){"use strict";function e(e,t){return{getAddress:function(n){return e.get(t.apiServiceBaseUri+"api/v1.0/addresses/"+n).then(function(e){return e})}}}angular.module("FieldConnectApp").factory("AddressServiceFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function n(n,t){return{getCompanyInfo:function(e){return n.get(t.apiServiceBaseUri+"api/v1.0/companyInfos").then(function(n){return n})},update:function(e){return n.post(t.apiServiceBaseUri+"api/v1.0/companyInfos",e)}}}angular.module("FieldConnectApp").factory("companyInfoFactory",n),n.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function t(t,n){return{getContact:function(e){return t.get(n.apiServiceBaseUri+"api/v1.0/Contacts/"+e).then(function(t){return t})}}}angular.module("FieldConnectApp").factory("ContactServiceFactory",t),t.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getCustomers:function(){return e.get(t.apiServiceBaseUri+"api/v1.0/customers/").then(function(e){return e})},getCustomer:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/customers/"+r).then(function(e){return e})},update:function(r){e.post(t.apiServiceBaseUri+"api/v1.0/customers",r)},create:function(r){e.put(t.apiServiceBaseUri+"api/v1.0/customers",r)}}}angular.module("FieldConnectApp").factory("CustomerServiceFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getItems:function(i){var r="";r+="?afc_filter="+i.searchText,r+="&page="+i.page,r+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?r+="&sort="+i.sortCol:r+="&sort=-"+i.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/items"+r).then(function(e){return e})},getItem:function(i){return e.get(t.apiServiceBaseUri+"api/v1.0/items/"+i).then(function(e){return e})},update:function(i){return e.post(t.apiServiceBaseUri+"api/v1.0/items",i)},create:function(i){return e.put(t.apiServiceBaseUri+"api/v1.0/items",i)},remove:function(i){return e.delete(t.apiServiceBaseUri+"api/v1.0/items/"+i)}}}angular.module("FieldConnectApp").factory("itemFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,o,l,a){var i=this,r={update:function(e){return l.update("laborRounding/"+e.Id,e).then(function(e){a.go("laborRoundingTable")}),!1},create:function(e){l.create("laborRounding",e).then(function(e){a.go("laborRoundingTable")})},checkValidation:function e(o,l,a){i.model=l;var r=!0;if(void 0==o)return;for(var d=0;d!=o.length;d++)switch(o[d].Type){case"group":r=e(o[d].Attributes,a);break;case"line":case"empty":break;case"file":void 0===i.files[o[d].Index]&&(r=!1);break;default:if(o[d].Required)if(i.formValidation[o[d].ModelValue]||(i.formValidation[o[d].ModelValue]={}),"email"==o[d].Type)if(void 0===i.model[o[d].ModelValue]||""===i.model[o[d].ModelValue]||null===i.model[o[d].ModelValue])i.formValidation[o[d].ModelValue].Error=!0,i.formValidation[o[d].ModelValue].Required=!0,i.formValidation[o[d].ModelValue].Email=!1,r=!1;else{/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i.test(i.model[o[d].ModelValue])?(i.formValidation[o[d].ModelValue].Error=!1,i.formValidation[o[d].ModelValue].Email=!1,i.formValidation[o[d].ModelValue].Required=!1):(i.formValidation[o[d].ModelValue].Error=!0,i.formValidation[o[d].ModelValue].Email=!0,i.formValidation[o[d].ModelValue].Required=!1,r=!1)}else void 0===i.model[o[d].ModelValue]||""===i.model[o[d].ModelValue]||null===i.model[o[d].ModelValue]||i.model[o[d].ModelValue].constructor===Array&&!i.model[o[d].ModelValue].length?(a||i.formValidation[o[d].ModelValue].Dirty)&&(i.formValidation[o[d].ModelValue].Error=!0,r=!1):(i.formValidation[o[d].ModelValue].Error=!1,i.formValidation[o[d].ModelValue].Dirty=!0)}return r}};return i.model={},i.formValidation={},r}angular.module("FieldConnectApp").factory("LaborRoundingFactory",e),e.$inject=["$http","ngAuthSettings","restService","$state"]}();;!function(){"use strict";function e(e,t){return{getRateSheets:function(r){var a="";a+="?afc_filter="+r.searchText,a+="&page="+r.page,a+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?a+="&sort="+r.sortCol:a+="&sort=-"+r.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/ratesheets"+a).then(function(e){return e})},getRateSheet:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/ratesheets/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/ratesheets",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/ratesheets",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/ratesheets/"+r)}}}angular.module("FieldConnectApp").factory("rateSheetFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function t(t,e){return{getTaxRates:function(r){var a="";r&&(a+="?afc_filter="+r.searchText,a+="&page="+r.page,a+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?a+="&sort="+r.sortCol:a+="&sort=-"+r.sortCol));return t.get(e.apiServiceBaseUri+"api/v1.0/taxrates"+a).then(function(t){return t})},getTaxRate:function(r){return t.get(e.apiServiceBaseUri+"api/v1.0/taxrates/"+r).then(function(t){return t})},getStates:function(){return t.get(e.apiServiceBaseUri+"api/v1.0/states").then(function(t){return t})},update:function(r){return t.post(e.apiServiceBaseUri+"api/v1.0/taxrates",r)},create:function(r){return t.put(e.apiServiceBaseUri+"api/v1.0/taxrates",r)},remove:function(r){return t.delete(e.apiServiceBaseUri+"api/v1.0/taxrates/"+r)}}}angular.module("FieldConnectApp").factory("taxRateFactory",t),t.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function t(t,e){return{getAssignmentStatuses:function(s){var n="";n+="?afc_filter="+s.searchText,n+="&page="+s.page,n+="&pagesize="+s.pageSize,""!=s.sortCol&&("asc"==s.sortDir?n+="&sort="+s.sortCol:n+="&sort=-"+s.sortCol);return t.get(e.apiServiceBaseUri+"api/v1.0/assignmentstatuses"+n).then(function(t){return t})},getAssignmentStatus:function(s){return t.get(e.apiServiceBaseUri+"api/v1.0/assignmentstatuses/"+s).then(function(t){return t})},update:function(s){return t.post(e.apiServiceBaseUri+"api/v1.0/assignmentstatuses",s)},create:function(s){return t.put(e.apiServiceBaseUri+"api/v1.0/assignmentstatuses",s)},remove:function(s){return t.delete(e.apiServiceBaseUri+"api/v1.0/assignmentstatuses/"+s)}}}angular.module("FieldConnectApp").factory("assignmentStatusFactory",t),t.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function t(t,e){return{getAttachmentCategories:function(a){var r="";r+="?afc_filter="+a.searchText,r+="&page="+a.page,r+="&pagesize="+a.pageSize,""!=a.sortCol&&("asc"==a.sortDir?r+="&sort="+a.sortCol:r+="&sort=-"+a.sortCol);return t.get(e.apiServiceBaseUri+"api/v1.0/attachmentCategories"+r).then(function(t){return t})},getAttachmentCategory:function(a){return t.get(e.apiServiceBaseUri+"api/v1.0/attachmentCategories/"+a).then(function(t){return t})},update:function(a){return t.post(e.apiServiceBaseUri+"api/v1.0/attachmentCategories",a)},create:function(a){return t.put(e.apiServiceBaseUri+"api/v1.0/attachmentCategories",a)},remove:function(a){return t.delete(e.apiServiceBaseUri+"api/v1.0/attachmentCategories/"+a)}}}angular.module("FieldConnectApp").factory("attachmentCategoryFactory",t),t.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function t(t,e){return{getAttachmentTypes:function(a){var n="";n+="?afc_filter="+a.searchText,n+="&page="+a.page,n+="&pagesize="+a.pageSize,""!=a.sortCol&&("asc"==a.sortDir?n+="&sort="+a.sortCol:n+="&sort=-"+a.sortCol);return t.get(e.apiServiceBaseUri+"api/v1.0/attachmentTypes"+n).then(function(t){return t})},getAttachmentType:function(a){return t.get(e.apiServiceBaseUri+"api/v1.0/attachmentTypes/"+a).then(function(t){return t})},getAttachmentCategories:function(){return t.get(e.apiServiceBaseUri+"api/v1.0/attachmentCategories").then(function(t){return t})},update:function(a){return t.post(e.apiServiceBaseUri+"api/v1.0/attachmentTypes",a)},create:function(a){return t.put(e.apiServiceBaseUri+"api/v1.0/attachmentTypes",a)},remove:function(a){return t.delete(e.apiServiceBaseUri+"api/v1.0/attachmentTypes/"+a)}}}angular.module("FieldConnectApp").factory("attachmentTypeFactory",t),t.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function i(i,e){return{getBillingPeriods:function(r){var t="";t+="?afc_filter="+r.searchText,t+="&page="+r.page,t+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?t+="&sort="+r.sortCol:t+="&sort=-"+r.sortCol);return i.get(e.apiServiceBaseUri+"api/v1.0/billingperiods"+t).then(function(i){return i})},getBillingPeriod:function(r){return i.get(e.apiServiceBaseUri+"api/v1.0/billingperiods/"+r).then(function(i){return i})},update:function(r){return i.post(e.apiServiceBaseUri+"api/v1.0/billingperiods",r)},create:function(r){return i.put(e.apiServiceBaseUri+"api/v1.0/billingperiods",r)},remove:function(r){return i.delete(e.apiServiceBaseUri+"api/v1.0/billingperiods/"+r)}}}angular.module("FieldConnectApp").factory("billingPeriodFactory",i),i.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,i){return{getBillingTypes:function(t){var n="";n+="?afc_filter="+t.searchText,n+="&page="+t.page,n+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?n+="&sort="+t.sortCol:n+="&sort=-"+t.sortCol);return e.get(i.apiServiceBaseUri+"api/v1.0/billingtypes"+n).then(function(e){return e})},getBillingType:function(t){return e.get(i.apiServiceBaseUri+"api/v1.0/billingtypes/"+t).then(function(e){return e})},update:function(t){return e.post(i.apiServiceBaseUri+"api/v1.0/billingtypes",t)},create:function(t){return e.put(i.apiServiceBaseUri+"api/v1.0/billingtypes",t)},remove:function(t){return e.delete(i.apiServiceBaseUri+"api/v1.0/billingtypes/"+t)}}}angular.module("FieldConnectApp").factory("billingTypeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getCauses:function(r){var a="";a+="?afc_filter="+r.searchText,a+="&page="+r.page,a+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?a+="&sort="+r.sortCol:a+="&sort=-"+r.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/causes"+a).then(function(e){return e})},getCause:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/causes/"+r).then(function(e){return e})},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/causes/"+r)},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/causes",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/causes",r)}}}angular.module("FieldConnectApp").factory("causeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getCountries:function(r){var i="";i+="?afc_filter="+r.searchText,i+="&page="+r.page,i+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?i+="&sort="+r.sortCol:i+="&sort=-"+r.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/countries"+i).then(function(e){return e})},getCountry:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/countries/"+r).then(function(e){return e})},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/countries/"+r)},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/countries",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/countries",r)}}}angular.module("FieldConnectApp").factory("countryFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,r){return{getCurrencies:function(t){var i="";t&&(i+="?afc_filter="+t.searchText,i+="&page="+t.page,i+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?i+="&sort="+t.sortCol:i+="&sort=-"+t.sortCol));return e.get(r.apiServiceBaseUri+"api/v1.0/currencies"+i).then(function(e){return e})},getCurrency:function(t){return e.get(r.apiServiceBaseUri+"api/v1.0/currencies/"+t).then(function(e){return e})},getCountries:function(){return e.get(r.apiServiceBaseUri+"api/v1.0/countries").then(function(e){return e})},remove:function(t){return e.delete(r.apiServiceBaseUri+"api/v1.0/currencies/"+t)},update:function(t){return e.post(r.apiServiceBaseUri+"api/v1.0/currencies",t)},create:function(t){return e.put(r.apiServiceBaseUri+"api/v1.0/currencies",t)}}}angular.module("FieldConnectApp").factory("currencyFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getDSLActionsTaken:function(n){var i="";n&&(i+="?afc_filter="+n.searchText,i+="&page="+n.page,i+="&pagesize="+n.pageSize,""!=n.sortCol&&("asc"==n.sortDir?i+="&sort="+n.sortCol:i+="&sort=-"+n.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/dslActionTaken"+i).then(function(e){return e})},getDSLActionTaken:function(n){return e.get(t.apiServiceBaseUri+"api/v1.0/dslActionTaken/"+n).then(function(e){return e})},update:function(n){return e.post(t.apiServiceBaseUri+"api/v1.0/dslActionTaken",n)},create:function(n){return e.put(t.apiServiceBaseUri+"api/v1.0/dslActionTaken",n)},remove:function(n){return e.delete(t.apiServiceBaseUri+"api/v1.0/dslActionTaken/"+n)}}}angular.module("FieldConnectApp").factory("DSLActionTakenFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getRecords:function(r){var i="";r&&(i+="?afc_filter="+r.searchText,i+="&page="+r.page,i+="&pagesize="+r.pageSize,""!==r.sortCol&&("asc"===r.sortDir?i+="&sort="+r.sortCol:i+="&sort=-"+r.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/dslApplicableCode"+i).then(function(e){return e})},getRecord:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/dslApplicableCode/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/dslApplicableCode",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/dslApplicableCode",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/dslApplicableCode/"+r)}}}angular.module("FieldConnectApp").factory("DSLApplicableCodeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function t(t,r){return{getDSLDistributors:function(i){var e="";i&&(e+="?afc_filter="+i.searchText,e+="&page="+i.page,e+="&pagesize="+i.pageSize,""!==i.sortCol&&("asc"===i.sortDir?e+="&sort="+i.sortCol:e+="&sort=-"+i.sortCol));return t.get(r.apiServiceBaseUri+"api/v1.0/dslDistributor"+e).then(function(t){return t})},getDSLDistributor:function(i){return t.get(r.apiServiceBaseUri+"api/v1.0/dslDistributor/"+i).then(function(t){return t})},update:function(i){return t.post(r.apiServiceBaseUri+"api/v1.0/dslDistributor",i)},create:function(i){return t.put(r.apiServiceBaseUri+"api/v1.0/dslDistributor",i)},remove:function(i){return t.delete(r.apiServiceBaseUri+"api/v1.0/dslDistributor/"+i)}}}angular.module("FieldConnectApp").factory("DSLDistributorFactory",t),t.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getDSLFailureResolutions:function(i){var r="";i&&(r+="?afc_filter="+i.searchText,r+="&page="+i.page,r+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?r+="&sort="+i.sortCol:r+="&sort=-"+i.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/dslFailureResolution"+r).then(function(e){return e})},getDSLFailureResolution:function(i){return e.get(t.apiServiceBaseUri+"api/v1.0/dslFailureResolution/"+i).then(function(e){return e})},update:function(i){return e.post(t.apiServiceBaseUri+"api/v1.0/dslFailureResolution",i)},create:function(i){return e.put(t.apiServiceBaseUri+"api/v1.0/dslFailureResolution",i)},remove:function(i){return e.delete(t.apiServiceBaseUri+"api/v1.0/dslFailureResolution/"+i)}}}angular.module("FieldConnectApp").factory("DSLFailureResolutionFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getRecords:function(r){var a="";r&&(a+="?afc_filter="+r.searchText,a+="&page="+r.page,a+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?a+="&sort="+r.sortCol:a+="&sort=-"+r.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/dslFaultAreas"+a).then(function(e){return e})},getRecord:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/dslFaultAreas/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/dslFaultAreas",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/dslFaultAreas",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/dslFaultAreas/"+r)}}}angular.module("FieldConnectApp").factory("DSLFaultAreasFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getRecords:function(r){var n="";r&&(n+="?afc_filter="+r.searchText,n+="&page="+r.page,n+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?n+="&sort="+r.sortCol:n+="&sort=-"+r.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/dslInstalledRemoved"+n).then(function(e){return e})},getRecord:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/dslInstalledRemoved/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/dslInstalledRemoved",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/dslInstalledRemoved",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/dslInstalledRemoved/"+r)}}}angular.module("FieldConnectApp").factory("DSLInstalledRemovedFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function t(t,e){return{getDSLInventoryPostingGroups:function(n){var r="";n&&(r+="?afc_filter="+n.searchText,r+="&page="+n.page,r+="&pagesize="+n.pageSize,""!=n.sortCol&&("asc"==n.sortDir?r+="&sort="+n.sortCol:r+="&sort=-"+n.sortCol));return t.get(e.apiServiceBaseUri+"api/v1.0/dslInventoryPostingGroup"+r).then(function(t){return t})},getDSLInventoryPostingGroup:function(n){return t.get(e.apiServiceBaseUri+"api/v1.0/dslInventoryPostingGroup/"+n).then(function(t){return t})},update:function(n){return t.post(e.apiServiceBaseUri+"api/v1.0/dslInventoryPostingGroup",n)},create:function(n){return t.put(e.apiServiceBaseUri+"api/v1.0/dslInventoryPostingGroup",n)},remove:function(n){return t.delete(e.apiServiceBaseUri+"api/v1.0/dslInventoryPostingGroup/"+n)}}}angular.module("FieldConnectApp").factory("DSLInventoryPostingGroupFactory",t),t.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getDSLPartsReceives:function(r){var i="";r&&(i+="?afc_filter="+r.searchText,i+="&page="+r.page,i+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?i+="&sort="+r.sortCol:i+="&sort=-"+r.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/dslPartsReceived"+i).then(function(e){return e})},getDSLPartsReceived:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/dslPartsReceived/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/dslPartsReceived",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/dslPartsReceived",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/dslPartsReceived/"+r)}}}angular.module("FieldConnectApp").factory("DSLPartsReceivedFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getDSLRecallDueTos:function(r){var a="";r&&(a+="?afc_filter="+r.searchText,a+="&page="+r.page,a+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"===r.sortDir?a+="&sort="+r.sortCol:a+="&sort=-"+r.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/dslRecallDueTo"+a).then(function(e){return e})},getDSLRecallDueTo:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/dslRecallDueTo/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/dslRecallDueTo",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/dslRecallDueTo",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/dslRecallDueTo/"+r)}}}angular.module("FieldConnectApp").factory("DSLRecallDueToFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,r){return{getDSLServiceOrderTypes:function(t){var i="";t&&(i+="?afc_filter="+t.searchText,i+="&page="+t.page,i+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?i+="&sort="+t.sortCol:i+="&sort=-"+t.sortCol));return e.get(r.apiServiceBaseUri+"api/v1.0/dslServiceOrderType"+i).then(function(e){return e})},getDSLServiceOrderType:function(t){return e.get(r.apiServiceBaseUri+"api/v1.0/dslServiceOrderType/"+t).then(function(e){return e})},update:function(t){return e.post(r.apiServiceBaseUri+"api/v1.0/dslServiceOrderType",t)},create:function(t){return e.put(r.apiServiceBaseUri+"api/v1.0/dslServiceOrderType",t)},remove:function(t){return e.delete(r.apiServiceBaseUri+"api/v1.0/dslServiceOrderType/"+t)}}}angular.module("FieldConnectApp").factory("DSLServiceOrderTypeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,r){return{getDSLServiceZoneCodes:function(t){var i="";t&&(i+="?afc_filter="+t.searchText,i+="&page="+t.page,i+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?i+="&sort="+t.sortCol:i+="&sort=-"+t.sortCol));return e.get(r.apiServiceBaseUri+"api/v1.0/dslServiceZoneCode"+i).then(function(e){return e})},getDSLServiceZoneCode:function(t){return e.get(r.apiServiceBaseUri+"api/v1.0/dslServiceZoneCode/"+t).then(function(e){return e})},update:function(t){return e.post(r.apiServiceBaseUri+"api/v1.0/dslServiceZoneCode",t)},create:function(t){return e.put(r.apiServiceBaseUri+"api/v1.0/dslServiceZoneCode",t)},remove:function(t){return e.delete(r.apiServiceBaseUri+"api/v1.0/dslServiceZoneCode/"+t)}}}angular.module("FieldConnectApp").factory("DSLServiceZoneCodeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,r){return{getDSLServiceZoneLaborCodes:function(o){var t="";o&&(t+="?afc_filter="+o.searchText,t+="&page="+o.page,t+="&pagesize="+o.pageSize,""!=o.sortCol&&("asc"==o.sortDir?t+="&sort="+o.sortCol:t+="&sort=-"+o.sortCol));return e.get(r.apiServiceBaseUri+"api/v1.0/dslLaborCodeByServiceZoneCode"+t).then(function(e){return e})},getDSLServiceZoneLaborCode:function(o){return e.get(r.apiServiceBaseUri+"api/v1.0/dslLaborCodeByServiceZoneCode/"+o).then(function(e){return e})},update:function(o){return e.post(r.apiServiceBaseUri+"api/v1.0/dslLaborCodeByServiceZoneCode",o)},create:function(o){return e.put(r.apiServiceBaseUri+"api/v1.0/dslLaborCodeByServiceZoneCode",o)},remove:function(o){return e.delete(r.apiServiceBaseUri+"api/v1.0/dslLaborCodeByServiceZoneCode/"+o)}}}angular.module("FieldConnectApp").factory("DSLServiceZoneLaborCodeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getRecords:function(r){var i="";r&&(i+="?afc_filter="+r.searchText,i+="&page="+r.page,i+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?i+="&sort="+r.sortCol:i+="&sort=-"+r.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/dslWhoPays"+i).then(function(e){return e})},getRecord:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/dslWhoPays/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/dslWhoPays",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/dslWhoPays",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/dslWhoPays/"+r)}}}angular.module("FieldConnectApp").factory("DSLWhoPaysFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,r){return{getRecords:function(t){var a="";t&&(a+="?afc_filter="+t.searchText,a+="&page="+t.page,a+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?a+="&sort="+t.sortCol:a+="&sort=-"+t.sortCol));return e.get(r.apiServiceBaseUri+"api/v1.0/dashboardChartType"+a).then(function(e){return e})},getRecord:function(t){return e.get(r.apiServiceBaseUri+"api/v1.0/dashboardChartType/"+t).then(function(e){return e})},update:function(t){return e.post(r.apiServiceBaseUri+"api/v1.0/dashboardChartType",t)},create:function(t){return e.put(r.apiServiceBaseUri+"api/v1.0/dashboardChartType",t)},remove:function(t){return e.delete(r.apiServiceBaseUri+"api/v1.0/dashboardChartType/"+t)}}}angular.module("FieldConnectApp").factory("dashboardChartTypeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getRecords:function(r){var i="";r&&(i+="?afc_filter="+r.searchText,i+="&page="+r.page,i+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?i+="&sort="+r.sortCol:i+="&sort=-"+r.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/dashboardConfigDDList"+i).then(function(e){return e})},getRecord:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/dashboardConfigDDList/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/dashboardConfigDDList",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/dashboardConfigDDList",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/dashboardConfigDDList/"+r)}}}angular.module("FieldConnectApp").factory("dashboardConfigDDListFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getRecords:function(r){var i="";r&&(i+="?afc_filter="+r.searchText,i+="&page="+r.page,i+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?i+="&sort="+r.sortCol:i+="&sort=-"+r.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/dashboardFilterDDList"+i).then(function(e){return e})},getRecord:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/dashboardFilterDDList/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/dashboardFilterDDList",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/dashboardFilterDDList",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/dashboardFilterDDList/"+r)}}}angular.module("FieldConnectApp").factory("dashboardFilterDDListFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,r){return{getRecords:function(t){var a="";t&&(a+="?afc_filter="+t.searchText,a+="&page="+t.page,a+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?a+="&sort="+t.sortCol:a+="&sort=-"+t.sortCol));return e.get(r.apiServiceBaseUri+"api/v1.0/dashboardReportType"+a).then(function(e){return e})},getRecord:function(t){return e.get(r.apiServiceBaseUri+"api/v1.0/dashboardReportType/"+t).then(function(e){return e})},update:function(t){return e.post(r.apiServiceBaseUri+"api/v1.0/dashboardReportType",t)},create:function(t){return e.put(r.apiServiceBaseUri+"api/v1.0/dashboardReportType",t)},remove:function(t){return e.delete(r.apiServiceBaseUri+"api/v1.0/dashboardReportType/"+t)}}}angular.module("FieldConnectApp").factory("dashboardReportTypeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getRecords:function(a){var r="";a&&(r+="?afc_filter="+a.searchText,r+="&page="+a.page,r+="&pagesize="+a.pageSize,""!=a.sortCol&&("asc"==a.sortDir?r+="&sort="+a.sortCol:r+="&sort=-"+a.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/defaultDispatchCalendarSettings"+r).then(function(e){return e})},getRecord:function(a){return e.get(t.apiServiceBaseUri+"api/v1.0/defaultDispatchCalendarSettings/"+a).then(function(e){return e})},update:function(a){return e.post(t.apiServiceBaseUri+"api/v1.0/defaultDispatchCalendarSettings",a)},create:function(a){return e.post(t.apiServiceBaseUri+"api/v1.0/defaultDispatchCalendarSettings",a)},remove:function(a){return e.delete(t.apiServiceBaseUri+"api/v1.0/defaultDispatchCalendarSettings/"+a)}}}angular.module("FieldConnectApp").factory("defaultDispatchCalendarSettingsFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getRecords:function(r){var a="";r&&(a+="?afc_filter="+r.searchText,a+="&page="+r.page,a+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?a+="&sort="+r.sortCol:a+="&sort=-"+r.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/defaultStartPage"+a).then(function(e){return e})},getRecord:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/defaultStartPage/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/defaultStartPage",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/defaultStartPage",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/defaultStartPage/"+r)}}}angular.module("FieldConnectApp").factory("defaultStartPageFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,i){return{getRecords:function(t){var r="";t&&(r+="?afc_filter="+t.searchText,r+="&page="+t.page,r+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?r+="&sort="+t.sortCol:r+="&sort=-"+t.sortCol));return e.get(i.apiServiceBaseUri+"api/v1.0/deficiencySeverity"+r).then(function(e){return e})},getRecord:function(t){return e.get(i.apiServiceBaseUri+"api/v1.0/deficiencySeverity/"+t).then(function(e){return e})},update:function(t){return e.post(i.apiServiceBaseUri+"api/v1.0/deficiencySeverity",t)},create:function(t){return e.put(i.apiServiceBaseUri+"api/v1.0/deficiencySeverity",t)},remove:function(t){return e.delete(i.apiServiceBaseUri+"api/v1.0/deficiencySeverity/"+t)}}}angular.module("FieldConnectApp").factory("deficiencySeverityFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getRecords:function(i){var r="";i&&(r+="?afc_filter="+i.searchText,r+="&page="+i.page,r+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?r+="&sort="+i.sortCol:r+="&sort=-"+i.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/deficiencyStatus"+r).then(function(e){return e})},getRecord:function(i){return e.get(t.apiServiceBaseUri+"api/v1.0/deficiencyStatus/"+i).then(function(e){return e})},update:function(i){return e.post(t.apiServiceBaseUri+"api/v1.0/deficiencyStatus",i)},create:function(i){return e.put(t.apiServiceBaseUri+"api/v1.0/deficiencyStatus",i)},remove:function(i){return e.delete(t.apiServiceBaseUri+"api/v1.0/deficiencyStatus/"+i)}}}angular.module("FieldConnectApp").factory("deficiencyStatusFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getRecords:function(i){var n="";i&&(n+="?afc_filter="+i.searchText,n+="&page="+i.page,n+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?n+="&sort="+i.sortCol:n+="&sort=-"+i.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/deficiencyStatusAction"+n).then(function(e){return e})},getRecord:function(i){return e.get(t.apiServiceBaseUri+"api/v1.0/deficiencyStatusAction/"+i).then(function(e){return e})},update:function(i){return e.post(t.apiServiceBaseUri+"api/v1.0/deficiencyStatusAction",i)},create:function(i){return e.put(t.apiServiceBaseUri+"api/v1.0/deficiencyStatusAction",i)},remove:function(i){return e.delete(t.apiServiceBaseUri+"api/v1.0/deficiencyStatusAction/"+i)}}}angular.module("FieldConnectApp").factory("deficiencyStatusActionFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getRecords:function(r){var a="";r&&(a+="?afc_filter="+r.searchText,a+="&page="+r.page,a+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?a+="&sort="+r.sortCol:a+="&sort=-"+r.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/dispatchCalendarThemes"+a).then(function(e){return e})},getRecord:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/dispatchCalendarThemes/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/dispatchCalendarThemes",r)},create:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/dispatchCalendarThemes",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/dispatchCalendarThemes/"+r)}}}angular.module("FieldConnectApp").factory("dispatchCalendarThemesFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getRecords:function(r){var i="";r&&(i+="?afc_filter="+r.searchText,i+="&page="+r.page,i+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?i+="&sort="+r.sortCol:i+="&sort=-"+r.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/dispatchChartThemes"+i).then(function(e){return e})},getRecord:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/dispatchChartThemes/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/dispatchChartThemes",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/dispatchChartThemes",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/dispatchChartThemes/"+r)}}}angular.module("FieldConnectApp").factory("dispatchChartThemesFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getRecords:function(r){var a="";r&&(a+="?afc_filter="+r.searchText,a+="&page="+r.page,a+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?a+="&sort="+r.sortCol:a+="&sort=-"+r.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/dispatchMonthlyCalendarThemes"+a).then(function(e){return e})},getRecord:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/dispatchMonthlyCalendarThemes/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/dispatchMonthlyCalendarThemes",r)},create:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/dispatchMonthlyCalendarThemes",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/dispatchMonthlyCalendarThemes/"+r)}}}angular.module("FieldConnectApp").factory("dispatchMonthlyCalendarThemesFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getDocTypes:function(r){var i="";i+="?afc_filter="+r.searchText,i+="&page="+r.page,i+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?i+="&sort="+r.sortCol:i+="&sort=-"+r.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/doctypes"+i).then(function(e){return e})},getDocType:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/doctypes/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/doctypes",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/doctypes",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/doctypes/"+r)}}}angular.module("FieldConnectApp").factory("docTypeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getEquipmentClasses:function(i){var n="";n+="?afc_filter="+i.searchText,n+="&page="+i.page,n+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?n+="&sort="+i.sortCol:n+="&sort=-"+i.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/equipmentClass"+n).then(function(e){return e})},getEquipmentClass:function(i){return e.get(t.apiServiceBaseUri+"api/v1.0/equipmentClass/"+i).then(function(e){return e})},update:function(i){return e.post(t.apiServiceBaseUri+"api/v1.0/equipmentClass",i)},create:function(i){return e.put(t.apiServiceBaseUri+"api/v1.0/equipmentClass",i)},remove:function(i){return e.delete(t.apiServiceBaseUri+"api/v1.0/equipmentClass/"+i)}}}angular.module("FieldConnectApp").factory("equipmentClassFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getEquipmentTypes:function(i){var r="";r+="?afc_filter="+i.searchText,r+="&page="+i.page,r+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?r+="&sort="+i.sortCol:r+="&sort=-"+i.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/equipmentType"+r).then(function(e){return e})},getEquipmentType:function(i){return e.get(t.apiServiceBaseUri+"api/v1.0/equipmentType/"+i).then(function(e){return e})},getEquipmentClasses:function(){return e.get(t.apiServiceBaseUri+"api/v1.0/equipmentClass").then(function(e){return e})},update:function(i){return e.post(t.apiServiceBaseUri+"api/v1.0/serviceableItemTypes",i)},create:function(i){return e.put(t.apiServiceBaseUri+"api/v1.0/serviceableItemTypes",i)},remove:function(i){return e.delete(t.apiServiceBaseUri+"api/v1.0/equipmentType/"+i)}}}angular.module("FieldConnectApp").factory("equipmentTypeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getEventTypes:function(n){var r="";r+="?afc_filter="+n.searchText,r+="&page="+n.page,r+="&pagesize="+n.pageSize,""!=n.sortCol&&("asc"==n.sortDir?r+="&sort="+n.sortCol:r+="&sort=-"+n.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/eventTypes"+r).then(function(e){return e})},getEventType:function(n){return e.get(t.apiServiceBaseUri+"api/v1.0/eventTypes/"+n).then(function(e){return e})},update:function(n){return e.post(t.apiServiceBaseUri+"api/v1.0/eventTypes",n)},create:function(n){return e.put(t.apiServiceBaseUri+"api/v1.0/eventTypes",n)},remove:function(n){return e.delete(t.apiServiceBaseUri+"api/v1.0/eventTypes/"+n)}}}angular.module("FieldConnectApp").factory("eventTypeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getIndustries:function(r){var i="";i+="?afc_filter="+r.searchText,i+="&page="+r.page,i+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?i+="&sort="+r.sortCol:i+="&sort=-"+r.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/industries"+i).then(function(e){return e})},getIndustry:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/industries/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/industries",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/industries",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/industries/"+r)}}}angular.module("FieldConnectApp").factory("industryFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getItemClasses:function(i){var r="";r+="?afc_filter="+i.searchText,r+="&page="+i.page,r+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?r+="&sort="+i.sortCol:r+="&sort=-"+i.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/itemClasses"+r).then(function(e){return e})},getItemClass:function(i){return e.get(t.apiServiceBaseUri+"api/v1.0/itemClasses/"+i).then(function(e){return e})},update:function(i){return e.post(t.apiServiceBaseUri+"api/v1.0/itemClasses",i)},create:function(i){return e.put(t.apiServiceBaseUri+"api/v1.0/itemClasses",i)},remove:function(i){return e.delete(t.apiServiceBaseUri+"api/v1.0/itemClasses/"+i)}}}angular.module("FieldConnectApp").factory("itemClassFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getItemTypes:function(i){var r="";r+="?afc_filter="+i.searchText,r+="&page="+i.page,r+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?r+="&sort="+i.sortCol:r+="&sort=-"+i.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/itemTypes"+r).then(function(e){return e})},getItemType:function(i){return e.get(t.apiServiceBaseUri+"api/v1.0/itemTypes/"+i).then(function(e){return e})},getItemClasses:function(){return e.get(t.apiServiceBaseUri+"api/v1.0/itemClasses").then(function(e){return e})},update:function(i){return e.post(t.apiServiceBaseUri+"api/v1.0/itemTypes",i)},create:function(i){return e.put(t.apiServiceBaseUri+"api/v1.0/itemTypes",i)},remove:function(i){return e.delete(t.apiServiceBaseUri+"api/v1.0/itemTypes/"+i)}}}angular.module("FieldConnectApp").factory("itemTypeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,r){return{getLaborCodes:function(t){var o="";o+="?afc_filter="+t.searchText,o+="&page="+t.page,o+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?o+="&sort="+t.sortCol:o+="&sort=-"+t.sortCol);return e.get(r.apiServiceBaseUri+"api/v1.0/laborCodes"+o).then(function(e){return e})},getLaborCode:function(t){return e.get(r.apiServiceBaseUri+"api/v1.0/laborCodes/"+t).then(function(e){return e})},update:function(t){return e.post(r.apiServiceBaseUri+"api/v1.0/laborCodes",t)},create:function(t){return e.put(r.apiServiceBaseUri+"api/v1.0/laborCodes",t)},remove:function(t){return e.delete(r.apiServiceBaseUri+"api/v1.0/laborCodes/"+t)}}}angular.module("FieldConnectApp").factory("laborCodeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function r(r,e){return{getLaborGroups:function(t){var o="";o+="?afc_filter="+t.searchText,o+="&page="+t.page,o+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?o+="&sort="+t.sortCol:o+="&sort=-"+t.sortCol);return r.get(e.apiServiceBaseUri+"api/v1.0/laborgroups"+o).then(function(r){return r})},getLaborGroup:function(t){return r.get(e.apiServiceBaseUri+"api/v1.0/laborgroups/"+t).then(function(r){return r})},update:function(t){return r.post(e.apiServiceBaseUri+"api/v1.0/laborgroups",t)},create:function(t){return r.put(e.apiServiceBaseUri+"api/v1.0/laborgroups",t)},remove:function(t){return r.delete(e.apiServiceBaseUri+"api/v1.0/laborgroups/"+t)}}}angular.module("FieldConnectApp").factory("laborGroupFactory",r),r.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,r){return{getLeadSources:function(t){var a="";t&&(a+="?afc_filter="+t.searchText,a+="&page="+t.page,a+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?a+="&sort="+t.sortCol:a+="&sort=-"+t.sortCol));return e.get(r.apiServiceBaseUri+"api/v1.0/leadSource"+a).then(function(e){return e})},getLeadSource:function(t){return e.get(r.apiServiceBaseUri+"api/v1.0/leadSource/"+t).then(function(e){return e})},update:function(t){return e.post(r.apiServiceBaseUri+"api/v1.0/leadSource",t)},create:function(t){return e.put(r.apiServiceBaseUri+"api/v1.0/leadSource",t)},remove:function(t){return e.delete(r.apiServiceBaseUri+"api/v1.0/leadSource/"+t)}}}angular.module("FieldConnectApp").factory("leadSourceFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function t(t,e){return{getLocations:function(i){var n="";n+="?afc_filter="+i.searchText,n+="&page="+i.page,n+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?n+="&sort="+i.sortCol:n+="&sort=-"+i.sortCol);return t.get(e.apiServiceBaseUri+"api/v1.0/locations"+n).then(function(t){return t})},getLocation:function(i){return t.get(e.apiServiceBaseUri+"api/v1.0/locations/"+i).then(function(t){return t})},update:function(i){return t.post(e.apiServiceBaseUri+"api/v1.0/locations",i)},create:function(i){return t.put(e.apiServiceBaseUri+"api/v1.0/locations",i)},remove:function(i){return t.delete(e.apiServiceBaseUri+"api/v1.0/locations/"+i)}}}angular.module("FieldConnectApp").factory("locationFactory",t),t.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,r){return{getManufacturers:function(t){var a="";a+="?afc_filter="+t.searchText,a+="&page="+t.page,a+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?a+="&sort="+t.sortCol:a+="&sort=-"+t.sortCol);return e.get(r.apiServiceBaseUri+"api/v1.0/manufacturers"+a).then(function(e){return e})},getManufacturer:function(t){return e.get(r.apiServiceBaseUri+"api/v1.0/manufacturers/"+t).then(function(e){return e})},update:function(t){return e.post(r.apiServiceBaseUri+"api/v1.0/manufacturers",t)},create:function(t){return e.put(r.apiServiceBaseUri+"api/v1.0/manufacturers",t)},remove:function(t){return e.delete(r.apiServiceBaseUri+"api/v1.0/manufacturers/"+t)}}}angular.module("FieldConnectApp").factory("manufacturerFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getMerchants:function(r){var n="";n+="?afc_filter="+r.searchText,n+="&page="+r.page,n+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?n+="&sort="+r.sortCol:n+="&sort=-"+r.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/merchants"+n).then(function(e){return e})},getMerchant:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/merchants/"+r).then(function(e){return e})},getContacts:function(){return e.get(t.apiServiceBaseUri+"api/v1.0/contacts").then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/merchants",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/merchants",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/merchants/"+r)}}}angular.module("FieldConnectApp").factory("merchantFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getNoteLibs:function(i){var r="";r+="?afc_filter="+i.searchText,r+="&page="+i.page,r+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?r+="&sort="+i.sortCol:r+="&sort=-"+i.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/notelibs"+r).then(function(e){return e})},getNoteLib:function(i){return e.get(t.apiServiceBaseUri+"api/v1.0/notelibs/"+i).then(function(e){return e})},remove:function(i){return e.delete(t.apiServiceBaseUri+"api/v1.0/notelibs/"+i)},update:function(i){return e.post(t.apiServiceBaseUri+"api/v1.0/notelibs",i)},create:function(i){return e.put(t.apiServiceBaseUri+"api/v1.0/notelibs",i)}}}angular.module("FieldConnectApp").factory("noteLibFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,r){return{getOperationGroups:function(t){var o="";o+="?afc_filter="+t.searchText,o+="&page="+t.page,o+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?o+="&sort="+t.sortCol:o+="&sort=-"+t.sortCol);return e.get(r.apiServiceBaseUri+"api/v1.0/operationGroups"+o).then(function(e){return e})},getOperationGroup:function(t){return e.get(r.apiServiceBaseUri+"api/v1.0/operationGroups/"+t).then(function(e){return e})},update:function(t){return e.post(r.apiServiceBaseUri+"api/v1.0/operationGroups",t)},create:function(t){return e.put(r.apiServiceBaseUri+"api/v1.0/operationGroups",t)},remove:function(t){return e.delete(r.apiServiceBaseUri+"api/v1.0/operationGroups/"+t)}}}angular.module("FieldConnectApp").factory("operationGroupFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getPaymentTerms:function(r){var n="";r&&(n+="?afc_filter="+r.searchText,n+="&page="+r.page,n+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?n+="&sort="+r.sortCol:n+="&sort=-"+r.sortCol));return e.get(t.apiServiceBaseUri+"api/v1.0/paymentTerms"+n).then(function(e){return e})},getPaymentTerm:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/paymentTerms/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/paymentTerms",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/paymentTerms",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/paymentTerms/"+r)}}}angular.module("FieldConnectApp").factory("paymentTermFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function i(i,e){return{getPriorities:function(r){var t="";t+="?afc_filter="+r.searchText,t+="&page="+r.page,t+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?t+="&sort="+r.sortCol:t+="&sort=-"+r.sortCol);return i.get(e.apiServiceBaseUri+"api/v1.0/priorities"+t).then(function(i){return i})},getPriority:function(r){return i.get(e.apiServiceBaseUri+"api/v1.0/priorities/"+r).then(function(i){return i})},update:function(r){return i.post(e.apiServiceBaseUri+"api/v1.0/priorities",r)},create:function(r){return i.put(e.apiServiceBaseUri+"api/v1.0/priorities",r)},remove:function(r){return i.delete(e.apiServiceBaseUri+"api/v1.0/priorities/"+r)}}}angular.module("FieldConnectApp").factory("priorityFactory",i),i.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,r){return{getProblemCodes:function(t){var o="";o+="?afc_filter="+t.searchText,o+="&page="+t.page,o+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?o+="&sort="+t.sortCol:o+="&sort=-"+t.sortCol);return e.get(r.apiServiceBaseUri+"api/v1.0/problemCodes"+o).then(function(e){return e})},getProblemCode:function(t){return e.get(r.apiServiceBaseUri+"api/v1.0/problemCodes/"+t).then(function(e){return e})},update:function(t){return e.post(r.apiServiceBaseUri+"api/v1.0/problemCodes",t)},create:function(t){return e.put(r.apiServiceBaseUri+"api/v1.0/problemCodes",t)},remove:function(t){return e.delete(r.apiServiceBaseUri+"api/v1.0/problemCodes/"+t)}}}angular.module("FieldConnectApp").factory("problemCodeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,r){return{getProblemCodeTasks:function(t){var o="";o+="?afc_filter="+t.searchText,o+="&page="+t.page,o+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?o+="&sort="+t.sortCol:o+="&sort=-"+t.sortCol);return e.get(r.apiServiceBaseUri+"api/v1.0/problemCodeTasks"+o).then(function(e){return e})},getProblemCodeTask:function(t){return e.get(r.apiServiceBaseUri+"api/v1.0/problemCodeTasks/"+t).then(function(e){return e})},getProblemCodes:function(){return e.get(r.apiServiceBaseUri+"api/v1.0/problemCodes").then(function(e){return e})},update:function(t){return e.post(r.apiServiceBaseUri+"api/v1.0/problemCodeTasks",t)},create:function(t){return e.put(r.apiServiceBaseUri+"api/v1.0/problemCodeTasks",t)},remove:function(t){return e.delete(r.apiServiceBaseUri+"api/v1.0/problemCodeTasks/"+t)}}}angular.module("FieldConnectApp").factory("problemCodeTaskFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getResolutions:function(r){var i="";i+="?afc_filter="+r.searchText,i+="&page="+r.page,i+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?i+="&sort="+r.sortCol:i+="&sort=-"+r.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/resolutions"+i).then(function(e){return e})},getResolution:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/resolutions/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/resolutions",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/resolutions",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/resolutions/"+r)}}}angular.module("FieldConnectApp").factory("resolutionFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,r){return{getRoles:function(t){var i="";i+="?afc_filter="+t.searchText,i+="&page="+t.page,i+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?i+="&sort="+t.sortCol:i+="&sort=-"+t.sortCol);return e.get(r.apiServiceBaseUri+"api/v1.0/roles"+i).then(function(e){return e})},getRole:function(t){return e.get(r.apiServiceBaseUri+"api/v1.0/roles/"+t).then(function(e){return e})},getRoleTypes:function(){return e.get(r.apiServiceBaseUri+"api/v1.0/roletypes").then(function(e){return e})},update:function(t){return e.post(r.apiServiceBaseUri+"api/v1.0/roles",t)},create:function(t){return e.put(r.apiServiceBaseUri+"api/v1.0/roles",t)},remove:function(t){return e.delete(r.apiServiceBaseUri+"api/v1.0/roles/"+t)}}}angular.module("FieldConnectApp").factory("roleFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,r){return{getRoleTypes:function(t){var i="";i+="?afc_filter="+t.searchText,i+="&page="+t.page,i+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?i+="&sort="+t.sortCol:i+="&sort=-"+t.sortCol);return e.get(r.apiServiceBaseUri+"api/v1.0/roleTypes"+i).then(function(e){return e})},getRoleType:function(t){return e.get(r.apiServiceBaseUri+"api/v1.0/roleTypes/"+t).then(function(e){return e})},update:function(t){return e.post(r.apiServiceBaseUri+"api/v1.0/roleTypes",t)},create:function(t){return e.put(r.apiServiceBaseUri+"api/v1.0/roleTypes",t)},remove:function(t){return e.delete(r.apiServiceBaseUri+"api/v1.0/roleTypes/"+t)}}}angular.module("FieldConnectApp").factory("roleTypeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,r){return{getServiceAreas:function(t){var i="";t&&(i+="?afc_filter="+t.searchText,i+="&page="+t.page,i+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?i+="&sort="+t.sortCol:i+="&sort=-"+t.sortCol));return e.get(r.apiServiceBaseUri+"api/v1.0/serviceAreas"+i).then(function(e){return e})},getServiceArea:function(t){return e.get(r.apiServiceBaseUri+"api/v1.0/serviceAreas/"+t).then(function(e){return e})},update:function(t){return e.post(r.apiServiceBaseUri+"api/v1.0/serviceAreas",t)},create:function(t){return e.put(r.apiServiceBaseUri+"api/v1.0/serviceAreas",t)},remove:function(t){return e.delete(r.apiServiceBaseUri+"api/v1.0/serviceAreas/"+t)}}}angular.module("FieldConnectApp").factory("serviceAreaFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getServiceableItemClasses:function(r){var s="";s+="?afc_filter="+r.searchText,s+="&page="+r.page,s+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?s+="&sort="+r.sortCol:s+="&sort=-"+r.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/serviceableItemClasses"+s).then(function(e){return e})},getServiceableItemClass:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/serviceableItemClasses/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/serviceableItemClasses",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/serviceableItemClasses",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/serviceableItemClasses/"+r)}}}angular.module("FieldConnectApp").factory("serviceableItemClassFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getServiceableItemTypes:function(r){var i="";i+="?afc_filter="+r.searchText,i+="&page="+r.page,i+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?i+="&sort="+r.sortCol:i+="&sort=-"+r.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/serviceableItemTypes"+i).then(function(e){return e})},getServiceableItemType:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/serviceableItemTypes/"+r).then(function(e){return e})},getServiceableItemClasses:function(){return e.get(t.apiServiceBaseUri+"api/v1.0/serviceableItemClasses").then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/serviceableItemTypes",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/serviceableItemTypes",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/serviceableItemTypes/"+r)}}}angular.module("FieldConnectApp").factory("serviceableItemTypeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function t(t,e){return{getSettings:function(i){var n="";n+="?afc_filter="+i.searchText,n+="&page="+i.page,n+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?n+="&sort="+i.sortCol:n+="&sort=-"+i.sortCol);return t.get(e.apiServiceBaseUri+"api/v1.0/settings"+n).then(function(t){return t})},getSetting:function(i){return t.get(e.apiServiceBaseUri+"api/v1.0/settings/"+i).then(function(t){return t})},remove:function(i){return t.delete(e.apiServiceBaseUri+"api/v1.0/settings/"+i)},update:function(i){return t.post(e.apiServiceBaseUri+"api/v1.0/settings",i)},create:function(i){return t.put(e.apiServiceBaseUri+"api/v1.0/settings",i)}}}angular.module("FieldConnectApp").factory("settingFactory",t),t.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getSiteTypes:function(i){var r="";r+="?afc_filter="+i.searchText,r+="&page="+i.page,r+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?r+="&sort="+i.sortCol:r+="&sort=-"+i.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/sitetypes"+r).then(function(e){return e})},getSiteType:function(i){return e.get(t.apiServiceBaseUri+"api/v1.0/sitetypes/"+i).then(function(e){return e})},update:function(i){return e.post(t.apiServiceBaseUri+"api/v1.0/sitetypes",i)},create:function(i){return e.put(t.apiServiceBaseUri+"api/v1.0/sitetypes",i)},remove:function(i){return e.delete(t.apiServiceBaseUri+"api/v1.0/sitetypes/"+i)}}}angular.module("FieldConnectApp").factory("siteTypeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getSkills:function(i){var r="";r+="?afc_filter="+i.searchText,r+="&page="+i.page,r+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?r+="&sort="+i.sortCol:r+="&sort=-"+i.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/skills"+r).then(function(e){return e})},getSkill:function(i){return e.get(t.apiServiceBaseUri+"api/v1.0/skills/"+i).then(function(e){return e})},update:function(i){return e.post(t.apiServiceBaseUri+"api/v1.0/skills",i)},create:function(i){return e.put(t.apiServiceBaseUri+"api/v1.0/skills",i)},remove:function(i){return e.delete(t.apiServiceBaseUri+"api/v1.0/skills/"+i)}}}angular.module("FieldConnectApp").factory("skillFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function t(t,e){return{getStates:function(r){var a="";a+="?afc_filter="+r.searchText,a+="&page="+r.page,a+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?a+="&sort="+r.sortCol:a+="&sort=-"+r.sortCol);return t.get(e.apiServiceBaseUri+"api/v1.0/states"+a).then(function(t){return t})},getState:function(r){return t.get(e.apiServiceBaseUri+"api/v1.0/states/"+r).then(function(t){return t})},update:function(r){return t.post(e.apiServiceBaseUri+"api/v1.0/states",r)},create:function(r){return t.put(e.apiServiceBaseUri+"api/v1.0/states",r)},remove:function(r){return t.delete(e.apiServiceBaseUri+"api/v1.0/states/"+r)}}}angular.module("FieldConnectApp").factory("stateFactory",t),t.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function t(t,e){return{getStatuses:function(r){var s="";r&&(s+="?afc_filter="+r.searchText,s+="&page="+r.page,s+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?s+="&sort="+r.sortCol:s+="&sort=-"+r.sortCol));return t.get(e.apiServiceBaseUri+"api/v1.0/statuses"+s).then(function(t){return t})},getStatus:function(r){return t.get(e.apiServiceBaseUri+"api/v1.0/statuses/"+r).then(function(t){return t})},update:function(r){return t.post(e.apiServiceBaseUri+"api/v1.0/statuses",r)},create:function(r){return t.put(e.apiServiceBaseUri+"api/v1.0/statuses",r)},remove:function(r){return t.delete(e.apiServiceBaseUri+"api/v1.0/statuses/"+r)}}}angular.module("FieldConnectApp").factory("statusFactory",t),t.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getSubscriptionTypes:function(i){var r="";r+="?afc_filter="+i.searchText,r+="&page="+i.page,r+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?r+="&sort="+i.sortCol:r+="&sort=-"+i.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/subscriptionTypes"+r).then(function(e){return e})},getSubscriptionType:function(i){return e.get(t.apiServiceBaseUri+"api/v1.0/subscriptionTypes/"+i).then(function(e){return e})},update:function(i){return e.post(t.apiServiceBaseUri+"api/v1.0/subscriptionTypes",i)},create:function(i){return e.put(t.apiServiceBaseUri+"api/v1.0/subscriptionTypes",i)},remove:function(i){return e.delete(t.apiServiceBaseUri+"api/v1.0/subscriptionTypes/"+i)}}}angular.module("FieldConnectApp").factory("subscriptionTypeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getSubscriptionTypeRoles:function(i){var r="";r+="?afc_filter="+i.searchText,r+="&page="+i.page,r+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?r+="&sort="+i.sortCol:r+="&sort=-"+i.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/subscriptionTypeRoles"+r).then(function(e){return e})},getSubscriptionTypeRole:function(i){return e.get(t.apiServiceBaseUri+"api/v1.0/subscriptionTypeRoles/"+i).then(function(e){return e})},getRoles:function(){return e.get(t.apiServiceBaseUri+"api/v1.0/roles").then(function(e){return e})},getSubscriptionTypes:function(){return e.get(t.apiServiceBaseUri+"api/v1.0/subscriptionTypes").then(function(e){return e})},update:function(i){return e.post(t.apiServiceBaseUri+"api/v1.0/subscriptionTypeRoles",i)},create:function(i){return e.put(t.apiServiceBaseUri+"api/v1.0/subscriptionTypeRoles",i)},remove:function(i){return e.delete(t.apiServiceBaseUri+"api/v1.0/subscriptionTypeRoles/"+i)}}}angular.module("FieldConnectApp").factory("subscriptionTypeRoleFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getTagTypes:function(r){var a="";a+="?afc_filter="+r.searchText,a+="&page="+r.page,a+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?a+="&sort="+r.sortCol:a+="&sort=-"+r.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/tagtypes"+a).then(function(e){return e})},getTagType:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/tagtypes/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/tagtypes",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/tagtypes",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/tagtypes/"+r)}}}angular.module("FieldConnectApp").factory("tagTypeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getTimeZones:function(i){var n="";n+="?afc_filter="+i.searchText,n+="&page="+i.page,n+="&pagesize="+i.pageSize,""!=i.sortCol&&("asc"==i.sortDir?n+="&sort="+i.sortCol:n+="&sort=-"+i.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/timezones"+n).then(function(e){return e})},getTimeZone:function(i){return e.get(t.apiServiceBaseUri+"api/v1.0/timezones/"+i).then(function(e){return e})},update:function(i){return e.post(t.apiServiceBaseUri+"api/v1.0/timezones",i)},create:function(i){return e.put(t.apiServiceBaseUri+"api/v1.0/timezones",i)},remove:function(i){return e.delete(t.apiServiceBaseUri+"api/v1.0/timezones/"+i)}}}angular.module("FieldConnectApp").factory("timeZoneFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,a){return{getUnavailables:function(t){var i="";i+="?afc_filter="+t.searchText,i+="&page="+t.page,i+="&pagesize="+t.pageSize,""!=t.sortCol&&("asc"==t.sortDir?i+="&sort="+t.sortCol:i+="&sort=-"+t.sortCol);return e.get(a.apiServiceBaseUri+"api/v1.0/unavailables"+i).then(function(e){return e})},getUnavailable:function(t){return e.get(a.apiServiceBaseUri+"api/v1.0/unavailables/"+t).then(function(e){return e})},update:function(t){return e.post(a.apiServiceBaseUri+"api/v1.0/unavailables",t)},create:function(t){return e.put(a.apiServiceBaseUri+"api/v1.0/unavailables",t)},remove:function(t){return e.delete(a.apiServiceBaseUri+"api/v1.0/unavailables/"+t)}}}angular.module("FieldConnectApp").factory("unavailableFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getUoms:function(r){var i="";i+="?afc_filter="+r.searchText,i+="&page="+r.page,i+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?i+="&sort="+r.sortCol:i+="&sort=-"+r.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/uoms"+i).then(function(e){return e})},getUom:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/uoms/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/uoms",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/uoms",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/uoms/"+r)}}}angular.module("FieldConnectApp").factory("uomFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function t(t,e){return{getWOStatuses:function(r){var a="";a+="?afc_filter="+r.searchText,a+="&page="+r.page,a+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?a+="&sort="+r.sortCol:a+="&sort=-"+r.sortCol);return t.get(e.apiServiceBaseUri+"api/v1.0/wostatuses"+a).then(function(t){return t})},getWOStatus:function(r){return t.get(e.apiServiceBaseUri+"api/v1.0/wostatuses/"+r).then(function(t){return t})},remove:function(r){return t.delete(e.apiServiceBaseUri+"api/v1.0/wostatuses/"+r)},update:function(r){return t.post(e.apiServiceBaseUri+"api/v1.0/wostatuses",r)},create:function(r){return t.put(e.apiServiceBaseUri+"api/v1.0/wostatuses",r)}}}angular.module("FieldConnectApp").factory("woStatusFactory",t),t.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function t(t,e){return{getWOStatusColors:function(r){var o="";o+="?afc_filter="+r.searchText,o+="&page="+r.page,o+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?o+="&sort="+r.sortCol:o+="&sort=-"+r.sortCol);return t.get(e.apiServiceBaseUri+"api/v1.0/wostatuscolors"+o).then(function(t){return t})},getWOStatusColor:function(r){return t.get(e.apiServiceBaseUri+"api/v1.0/wostatuscolors/"+r).then(function(t){return t})},getWOStatuses:function(){return t.get(e.apiServiceBaseUri+"api/v1.0/wostatuses").then(function(t){return t})},remove:function(r){return t.delete(e.apiServiceBaseUri+"api/v1.0/wostatuscolors/"+r)},update:function(r){return t.post(e.apiServiceBaseUri+"api/v1.0/wostatuscolors",r)},create:function(r){return t.put(e.apiServiceBaseUri+"api/v1.0/wostatuscolors",r)}}}angular.module("FieldConnectApp").factory("woStatusColorFactory",t),t.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t){return{getWOTypes:function(r){var i="";i+="?afc_filter="+r.searchText,i+="&page="+r.page,i+="&pagesize="+r.pageSize,""!=r.sortCol&&("asc"==r.sortDir?i+="&sort="+r.sortCol:i+="&sort=-"+r.sortCol);return e.get(t.apiServiceBaseUri+"api/v1.0/wotypes"+i).then(function(e){return e})},getWOType:function(r){return e.get(t.apiServiceBaseUri+"api/v1.0/wotypes/"+r).then(function(e){return e})},update:function(r){return e.post(t.apiServiceBaseUri+"api/v1.0/wotypes",r)},create:function(r){return e.put(t.apiServiceBaseUri+"api/v1.0/wotypes",r)},remove:function(r){return e.delete(t.apiServiceBaseUri+"api/v1.0/wotypes/"+r)}}}angular.module("FieldConnectApp").factory("woTypeFactory",e),e.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function t(t,n){return{getItems:function(e){return t.get(n.apiServiceBaseUri+"api/v1.0/"+e).then(function(t){return t})}}}angular.module("FieldConnectApp").factory("dropdownFactory",t),t.$inject=["$http","ngAuthSettings"]}();;!function(){"use strict";function e(e,t,r,n,o,i,s,u){return{getItems:function(e,t){var r="";if(t){for(var n in t)"function"!=typeof t[n]&&void 0!==t[n]&&("sortCol"!=n?"sortDir"!=n&&(r+="searchText"!=n?"&"+n+"="+encodeURIComponent(t[n]):"&afc_filter="+encodeURIComponent(t.searchText)):"asc"==t.sortDir?r+="&sort="+t.sortCol:r+="&sort=-"+t.sortCol);r="?"+r.slice(1)}return u.get(f()+e+r).then(function(e){return e},function(e,t){return c(e)})},getItem:function(e,t){var r="";t&&(r="/"+t);return u.get(f()+e+r).then(function(e){return e},function(e,t){return c(e)})},remove:function(e,t){return u.remove(f()+e+"/"+t).then(function(e){return e},function(e,t){return c(e)})},create:function(e,t){for(var r in t)""===t[r]&&(t[r]=null);return a(e)?u.post(f()+e,t).then(function(e){return e},function(e,t){return c(e)}):u.put(f()+e,t).then(function(e){return e},function(e,t){return c(e)})},update:function(e,t){var r=f()+e;a(e)&&(r=f()+e+"/"+t.Id);for(var n in t)""===t[n]&&(t[n]=null);return u.post(r,t).then(function(e){return e},function(e,t){return c(e)})},uploadFile:function(e,t){return u.post(f()+e,t,{transformRequest:angular.iedntity,headers:{"Content-Type":void 0}}).then(function(e){return e},function(e,t){return c(e)})},downloadFile:function(t,r){var n="";if(r){for(var o in r)"function"!=typeof r[o]&&void 0!==r[o]&&("sortCol"!=o?"sortDir"!=o&&(n+="searchText"!=o?"&"+o+"="+encodeURIComponent(r[o]):"&afc_filter="+encodeURIComponent(r.searchText)):"asc"==r.sortDir?n+="&sort="+r.sortCol:n+="&sort=-"+r.sortCol);n="?"+n.slice(1)}return e.get(f()+t+n,{responseType:"arraybuffer"}).then(function(e){return e},function(e,t){return c(e)})}};function a(e){for(var r=0;r<t.newRest.length;r++)if(t.newRest[r]===e)return!0;return!1}function c(e){if(e.data.Details){for(var t=null,o=0;o!=e.data.Details.length;o++)e.status&&406==e.status?r.warning({message:e.data.Details[o].Message}):r.error({message:e.data.Details[o].Message}),console.log(e.data.Details[o].DeveloperMessage),"redirect"==e.data.Details[o].Tag&&(t=e.data.Details[o].MoreInfo);t&&s.path(t)}else 403===e.status?r.error({message:"The user does not have access to this resource. Please contact your Administrator."}):401===e.status&&r.error({message:"The user does not have access to this resource."});return n.reject(e)}function f(e,r){return t.apiServiceBaseUri+(e||null==t.apiServiceUriSuffix?"":t.apiServiceUriSuffix+"/")+(r||null==t.apiServiceVersion?"":t.apiServiceVersion+"/")}}angular.module("FieldConnectApp").factory("restFactory",e),e.$inject=["offlineHttpWrapper","ngAuthSettings","Notification","$q","offlineService","qsService","$location","httpRequestHandler"]}();;!function(){"use strict";function e(e){var t=e.getValue("companySettingsList");return{RequestQuoteReportSignature:function(e,a){if(t){var r,n=t.find(t=>t.Name==e);switch(a){case"bool":r=JSON.parse(n.Value.toLowerCase());break;case"int":r=parseInt(n.Value);break;case"text":r=n.Value}return r}return!1}("RequestQuoteReportSignature","bool")}}angular.module("FieldConnectApp").factory("companySettingFactory",e),e.$inject=["cryptoStorageService"]}();;!function(){"use strict";function o(o,t,r,e,n){return{HasParent:function(o){var t=n.defer(),e={hasParent:!1,parentAltId:null,parentWoId:null};return r.getItem("woCopy/"+o).then(function(o){var r=o.data;"null"!==r&&(e.hasParent=!0,e.parentAltId=r.ParentAltId,e.parentWoId=r.ParentWoId),t.resolve(e)}),t.promise},CopyWo:function(r){var n=angular.copy(r);t.showModal({templateUrl:"Templates/WorkOrder/ManageWorkOrder/woCopyEditModal.html",controller:"WoCopyEditController",controllerAs:"woCopyEdit",inputs:{parentWoId:r.Id,model:n}}).then(function(t){t.close.then(function(t){t&&bootbox.confirm("Do you want to open WO#"+t.AltId+"?",function(r){r&&(e.popTransitionParam("workOrderDetails"),o.go("workOrdersDetails",{id:t.Id}))})})})}}}angular.module("FieldConnectApp").factory("copyWorkOrderFactory",o),o.$inject=["$state","ModalService","restService","stateTransitionService","$q"]}();;!function(){"use strict";function n(n){var e=n.getValue("featurelist");function t(n){return!!e&&e.find(e=>e.FeatureName==n).Active}return{usingDSLNorthwest:t("DSLNorthwest"),usingGroundBreakers:t("GroundBreakers"),usingCustomerPortal:t("CustomerPortal"),usingBaseReport:t("BaseReport"),usingQuoting:t("Quoting"),usingAdvancedReport:t("AdvancedReport"),usingBundles:t("Bundles"),usingGoogleMaps:t("GoogleMaps"),usingLaborRounding:t("LaborRounding"),usingGPSTracking:t("GPSTracking"),usingFCPayments:t("FCPayments"),usingXOiIntegration:t("XOiIntegration")}}angular.module("FieldConnectApp").factory("featuresFactory",n),n.$inject=["cryptoStorageService"]}();;!function(){"use strict";function t(t){var n;return{addCustomer:function(t){n=t},getCustomer:function(){return n},clearCustomer:function(){n=null}}}angular.module("FieldConnectApp").factory("gbCustomFactory",t),t.$inject=["cryptoStorageService"]}();;!function(){"use strict";function e(e){var r=[],s=e.getValue("authorizationData"),a=!1,i=!1,c=!1,t=!1,o=!1,n=!1,u=!1,m=!1,b=!1,l=!1,p=!1;return s&&s.userRoleTypes.forEach(function(e){switch(r.push(e.RoleTypeName),e.RoleTypeName){case"Fc":a=!0;break;case"Admin":i=!0;break;case"Office":c=!0;break;case"Dispatch":t=!0;break;case"Supervisor":o=!0;break;case"Technician":n=!0;break;case"SubContractor":u=!0;break;case"SubAdmin":m=!0;break;case"TransAdmin":b=!0;break;case"CustomerPortalAdmin":l=!0;break;case"CustomerUser":p=!0}}),{roleTypes:r,isFc:a,isAdmin:i,isOffice:c,isDispatch:t,isSupervisor:o,isTechnician:n,isSubContractor:u,isSubAdmin:m,isTransAdmin:b,isCustomerPortalAdmin:l,isCustomerUser:p,getRoles:function(){return s.userRoles.split(",")}}}angular.module("FieldConnectApp").factory("rolesFactory",e),e.$inject=["cryptoStorageService"]}();;!function(){"use strict";angular.module("FieldConnectApp").directive("powerbiReport",function(){return{restrict:"E",templateUrl:"Templates/AdvancedReports/powerbi.html",scope:{reportId:"=",embedUrl:"=",accessToken:"="},link:function(e,n,t){e.$watchCollection("[reportId, embedUrl, accessToken]",function(e,n){var t=e[0],r=e[1],o=e[2];if(null!=t&&null!=r&&null!=o){var i=window["powerbi-client"].models,l={type:"report",accessToken:o,embedUrl:r,id:t,permissions:i.Permissions.ReadWrite,viewMode:i.ViewMode.View,settings:{filterPaneEnabled:!0,navContentPaneEnabled:!0}},d=document.getElementById("reportContainer");powerbi.embed(d,l)}},!0)}}})}();;!function(){"use strict";function t(t,e){var a=this;function i(){if(t.service){var e={page:a.page,pageSize:a.pageSize,searchText:a.searchText,sortCol:a.sortCol,sortDir:a.sortDir};t.service[t.loadFunc](e).then(function(){a.meta=t.service.state[t.meta],a.items=t.service.state[t.items];for(var e=0;e!=a.attributes.length;e++){if("date"==a.attributes[e].FormatDate)for(var i=0;i!=a.items.length;i++)a.items[i][a.attributes[e].ValueName]&&(a.items[i][a.attributes[e].ValueName]=new Date(a.items[i][a.attributes[e].ValueName]).toLocaleDateString());if("datetime"==a.attributes[e].FormatDate)for(i=0;i!=a.items.length;i++)if(a.items[i][a.attributes[e].ValueName]){var r=new Date(a.items[i][a.attributes[e].ValueName]);a.items[i][a.attributes[e].ValueName]=r.toLocaleDateString(),a.items[i][a.attributes[e].ValueName]+=" "+r.toLocaleTimeString()}if("time"==a.attributes[e].FormatDate)for(i=0;i!=a.items.length;i++)a.items[i][a.attributes[e].ValueName]&&(a.items[i][a.attributes[e].ValueName]=new Date(a.items[i][a.attributes[e].ValueName]).toLocaleTimeString());if("decimal"==a.attributes[e].CellFormat)for(i=0;i!=a.items.length;i++)if(a.items[i][a.attributes[e].ValueName]){var s=a.items[i][a.attributes[e].ValueName].toFixed(2).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,");a.items[i][a.attributes[e].ValueName]=s}}a.meta&&(a.total=a.meta.Paging.TotalCount)})}}a.goHome=function(){e.go("home")},a.goBack=function(){window.history.back()},a.goToRefTable=function(){e.go("referenceTables")},a.remove=function(e,r,s){for(var o,n=0;n!=t.attributes.length;n++)if(t.attributes[n].Edit){o=t.attributes[n].ValueName;break}bootbox.confirm("Are you sure that you want to delete "+e[o]+"?",function(r){r&&(a.loadingIndicator=!0,t.service.remove(e.Id).then(function(){return i()}).then(function(){a.loadingIndicator=!1}))})},a.edit=function(e){t.onEdit({id:e})},a.search=function(){i()},t.selected||(t.selected=null),a.tableName=t.tableName,a.attributes=t.attributes,t.service&&(a.items=t.service.state[t.items],a.meta=t.service.state[t.meta]),a.searchText="",a.page=1,a.pageSize=10,a.total=0,a.firstWatchFix=!0,a.sortCol="",a.sortDir="asc",a.toggleSort=function(t,e){if(!e)return;a.sortCol!=t?(a.sortCol=t,a.sortDir="asc"):"asc"==a.sortDir?a.sortDir="desc":a.sortDir="asc";i()},a.reloadData=i,t.$watch("vm.pageSize",function(){a.firstWatchFix?a.firstWatchFix=!1:(1==a.page&&i(),a.page=1)}),t.$watch("vm.page",function(){i()})}angular.module("FieldConnectApp").directive("fcReferenceTable",function(){return{restrict:"E",templateUrl:"Templates/ReferenceTables/referenceTable.html",scope:{tableName:"@",loadFunc:"@",service:"=",attributes:"=",items:"@",meta:"@",onEdit:"&",apiMethod:"@"},link:function(t,e,a,i){},controller:t,controllerAs:"vm"}}),t.$inject=["$scope","$state"]}();;!function(){"use strict";function e(e,t,o,n,r,i){var s=this;function l(){t.onLoaded&&t.onLoaded()}s.items=[],s.$scope=t,s.open=function(){t.onOpen&&t.onOpen()},s.enter=function(){t.onEnter&&t.onEnter()},s.sortCol=t.sortCol,t.$watch("value",function(){t.value||(t.value=null)}),s.valueChanged=function(){if(n.onChange){var e=i.Enumerable().From(s.items).Where(function(e){return e[t.valueProp]==t.value}).FirstOrDefault();t.onChange({selectetObj:e})}},s.itemsLoaded=!1,t.selectFirst?s.itemsLoaded=!0:s.itemsLoaded=!1,t.$watch("filter",function(){!function(){t.selectFirst?s.itemsLoaded=!0:s.itemsLoaded=!1;if(t.list)s.items=t.list,s.itemsLoaded=!0;else{var i={sortCol:s.sortCol,sortDir:"asc"};t.filter&&t.filter&&"object"==typeof t.filter&&(i=$.extend(i,t.filter)),t.apiMethod?(s.loadingData=!0,e.getItems(t.apiMethod,i).then(function(){if(s.items=e.state.items,s.loadingData=!1,s.items){n.currentList&&(t.currentList=s.items);for(var i=0;i<s.items.length;i++)t.plural&&(s.items[i][t.textProp]+="(s)");0==s.items.length&&t.required&&!t.silent&&o.error({message:t.label+"A required dropdown is empty."}),s.items.length>0&&(t.noSort||s.items.sort(r.sortArray(t.textProp)),t.selectFirst&&(t.value=s.items[0][t.valueProp]))}s.itemsLoaded=!0,l()},function(){s.loadingData=!1})):(s.itemsLoaded=!0,l())}}()},!0)}angular.module("FieldConnectApp").directive("fcDropdown",function(){return{restrict:"E",templateUrl:"Templates/Utils/fcDropdown.html",scope:{apiMethod:"@",valueProp:"@",textProp:"@",value:"=",required:"@",convertToInt:"@",filter:"=?",label:"@",list:"=?",fcDisabled:"=",silent:"@",currentList:"=?",fcDropdown:"@",fcTabindex:"@",plural:"@",noSort:"@",onEnter:"&",selectFirst:"@",onOpen:"&",onLoaded:"&",sortCol:"@",onChange:"&"},link:function(e,t,o,n){},controller:e,controllerAs:"vm"}}),e.$inject=["restService","$scope","Notification","$attrs","sortArrayObjectsByAttrService","$linq"]}();;!function(){"use strict";function e(e,t,a,r,l,o){var n=this;function i(e,t){var a=angular.element(document.querySelector("#"+n.ddgId));if(e)a[0].className="dropdown open";else{var l=angular.element(window.document.activeElement);(l[0].id!=n.inputId&&l[0].id!=n.scrollDiv||t)&&(a[0].className="dropdown",r(function(){n.page=0,n.items=[],n.meta={},n.canLoad=!0}))}}n.$scope=t,n.toggleDdg=i,n.search=function(){n.keyDown&&function(){s&&clearTimeout(s);s=setTimeout(function(){t.$emit(n.ddgId+"Searching"),n.$scope.value&&n.$scope.value.length>=n.searchTrigger?(n.page=0,n.items=[],n.canLoad=!0,c()):i(!1,!0)},500)}()},n.getData=c,n.setSelected=function(e,a){if(a){if(1!=a.buttons&&void 0!==a.buttons)return;r(function(){document.getElementById(n.inputId).focus()})}t.valueProp&&(n.$scope.value=e[t.valueProp]);t.onSelect&&t.onSelect({item:e});i(!1,!0)},n.canLoad=!0,n.readOnly=!1,n.items=[],n.meta={},n.placeholder="",n.page=0,n.pageSize=10,n.searchTrigger=3,n.showHeader=!1,n.autofocus=!1,n.keyDown=!1,t.pageSize&&(n.pageSize=t.pageSize),t.searchTrigger&&(n.searchTrigger=t.searchTrigger),t.showHeader&&(n.showHeader=t.showHeader),t.placeHolder&&(n.placeholder=t.placeHolder),t.readOnly&&(n.readOnly=t.readOnly),t.autofocus&&(n.autofocus=t.autofocus),n.filterCols=t.searchByColumns,n.searchFilter=l.filter("or"),n.attributes=t.attributes,n.ddgId=t.ctrId,n.inputId=n.ddgId+"input",n.tableId=n.ddgId+"table",n.scrollDiv=n.ddgId+"scrollDiv",n.ddgHeaderId=n.ddgId+"header";var s=null;function c(){n.page=n.page+1;var a={page:n.page,pageSize:n.pageSize};if(n.searchFilter.reset(),n.filterCols&&n.filterCols.length>0&&n.$scope.value)for(var l=0;l<n.filterCols.length;l++)n.searchFilter.like(n.filterCols[l],"%"+n.$scope.value+"%");if(t.filter&&"object"==typeof t.filter&&t.filter.filter.length>0)for(l=0;l!=t.filter.filter.length;l++)n.searchFilter.filter.push(t.filter.filter[l]);return a=$.extend(a,n.searchFilter),e.getItems(t.apiMethod,a).then(function(e){if(0!=e.data.Data.length||1!==n.page){n.meta=e.data.Meta;for(var t=0;t!=e.data.Data.length;t++)n.items.push(e.data.Data[t]);n.meta.Paging.PagesCount==n.meta.Paging.Page&&(n.canLoad=!1);for(t=0;t!=n.attributes.length;t++)if("decimal"==n.attributes[t].CellFormat)for(var a=0;a!=n.items.length;a++)if(n.items[a][n.attributes[t].ValueName]){"string"==typeof n.items[a][n.attributes[t].ValueName]&&(n.items[a][n.attributes[t].ValueName]=parseFloat(n.items[a][n.attributes[t].ValueName]));var l=n.items[a][n.attributes[t].ValueName].toFixed(2).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,");n.items[a][n.attributes[t].ValueName]=l}1==n.page?r(function(){angular.element(document.querySelector("#"+n.tableId+"_0"))[0].className="table table-hover cursor_pointer ng-scope ddlTr";var e=angular.element(document.querySelector("#"+n.ddgHeaderId))[0].offsetTop;document.getElementById(n.scrollDiv).scrollTop=e}):r(function(){u()},100),i(!0,!1)}else i(!1,!0)})}function u(){var e=angular.element(document.querySelector("#"+d()));if(e&&e[0]){var t=e[0].offsetTop;document.getElementById(n.scrollDiv).scrollTop=t}}function d(){var e=document.getElementsByClassName("ddlTr");return e&&e[0]?e[0].id:null}t.activateKeyDown=function(e){n.keyDown=!0},t.pressSelect=function(e){d()&&angular.element(document.querySelector("#"+d())).triggerHandler("click")},t.pressEscape=function(e){t.$emit(n.ddgId+"Searching"),i(!1,!0)},t.pressDown=function(e){if(n.items&&n.items.length>0){if(d()){var t=angular.element(document.querySelector("#"+d()));t[0].nextElementSibling?(t[0].className="table cursor_pointer ng-scope",t[0].nextElementSibling.className="table cursor_pointer ng-scope ddlTr",u()):n.meta.Paging.PagesCount==n.meta.Paging.Page?n.canLoad=!1:c()}}else c()},t.pressUp=function(e){if(n.items&&n.items.length>0&&d()){var t=angular.element(document.querySelector("#"+d()));t[0].previousElementSibling&&(t[0].className="table table-hover cursor_pointer ng-scope",t[0].previousElementSibling.className="table table-hover cursor_pointer ng-scope ddlTr",u())}},t.pressPageDown=function(e){if(n.items&&n.items.length>0){var t=angular.element(document.querySelector("#"+d())),a=t[0].rowIndex,r=angular.element(document.querySelector("#"+n.tableId));if(r&&r[0]&&r[0].rows.length>0){t[0].className="table table-hover cursor_pointer ng-scope";var l=r[0].rows[a+n.pageSize];l?l.className="table table-hover cursor_pointer ng-scope ddlTr":r[0].rows[r[0].rows.length-1].className="table table-hover cursor_pointer ng-scope ddlTr",u()}}},t.pressPageUp=function(e){if(n.items&&n.items.length>0){var t=angular.element(document.querySelector("#"+d())),a=t[0].rowIndex,r=angular.element(document.querySelector("#"+n.tableId));if(r&&r[0]&&r[0].rows.length>0){if(t[0].className="table table-hover cursor_pointer ng-scope",a-n.pageSize>1)r[0].rows[a-n.pageSize].className="table table-hover cursor_pointer ng-scope ddlTr";else r[0].rows[1].className="table table-hover cursor_pointer ng-scope ddlTr";u()}}}}angular.module("FieldConnectApp").directive("fcAutoCompleteTable",function(){return{restrict:"E",templateUrl:"Templates/Utils/autoCompleteTable.html",scope:{apiMethod:"@",pageSize:"=?",searchTrigger:"=?",required:"@",filter:"=?",label:"@",attributes:"=",valueProp:"@",value:"=",fcDisabled:"=",searchByColumns:"=",fcTabindex:"@",sortCol:"@",ctrId:"@",onSelect:"&",showHeader:"=?",placeHolder:"@",readOnly:"=?",autofocus:"=?"},link:function(e,t,a,r){t.on("paste",function(t){return e.activateKeyDown(t),!0}),t.on("keydown",function(t){return e.activateKeyDown(t),9==t.which||13==t.which?(e.pressSelect(t),!0):27==t.which?(e.pressEscape(t),!0):33==t.which?(t.preventDefault(),e.pressPageUp(t),!1):34==t.which?(t.preventDefault(),e.pressPageDown(t),!1):38==t.which?(e.pressUp(t),!0):40==t.which?(e.pressDown(t),!0):void 0})},controller:e,controllerAs:"vm"}}),e.$inject=["restService","$scope","Notification","$timeout","qsService","timezoneService"]}();;!function(){"use strict";function c(c){return{restrict:"A",scope:{fcAutofocus:"="},link:function(t,u,o,n){t.fcAutofocus&&c(function(){$(u[0]).focus()})}}}angular.module("FieldConnectApp").directive("fcAutofocus",c),c.$inject=["$timeout"]}();;;!function(){"use strict";angular.module("FieldConnectApp").directive("cloakCustom",["$timeout",function(t){return{restrict:"A",link:function(o,n,c){t(function(){c.$set("cloakCustom",void 0),n.removeClass("cloak-custom")})}}}])}();;!function(){"use strict";angular.module("FieldConnectApp").directive("currencyInput",function(){return{restrict:"A",require:"ngModel",link:function(e,i,n,u){u.$parsers.push(function(e){return e=e.replace(/[^\d.\',']/g,""),isNaN(e)?null:Math.floor(100*parseFloat(e))/100}),u.$formatters.push(function(e){if(void 0!==e&&null!==e&&""!==e&&!isNaN(e)){var i=e.toString();return(i=i.split("."))[1]||(i[1]=""),i[1]+="00",i[1]=i[1].slice(0,2),i.join(".")}}),$(i[0]).focusout(function(){if(u.$viewValue=u.$modelValue,void 0!==u.$viewValue&&null!==u.$viewValue&&""!==u.$viewValue&&!isNaN(u.$viewValue)){var e=u.$viewValue.toString();(e=e.split("."))[1]||(e[1]=""),e[1]+="00",e[1]=e[1].slice(0,2),u.$viewValue=e.join("."),u.$render()}})}}})}();;!function(){"use strict";function n(){var n={};this.addListener=function(t,i){n[t]||(n[t]=[]);n[t].push(i)},this.triggerEvent=function(t){if(n[t])for(var i=0;i<n[t].length;i++)n[t][i]&&n[t][i]()}}angular.module("FieldConnectApp").directive("datepickerDiv",function(){return{restrict:"A",link:function(n,t,i,e){},controller:n}}),n.$inject=[]}();;!function(){"use strict";function e(e,t){return{restrict:"A",require:"ngModel",link:function(t,r,a,n){var i=2;"0.01"!=a.step&&(i=a.step);r.on("paste",function(t){var r=t.clipboardData||t.originalEvent.clipboardData||window.clipboardData,a=r.getData("text");return t.target.attributes.hasOwnProperty("decimals")&&(i=parseInt(t.target.attributes.decimals.value)),isNaN(a)?(t.preventDefault(),i>0?e.warning({message:"Only decimal numbers are alowed!"}):e.warning({message:"Only numbers are alowed!"}),!1):0!=i||(-1==a.indexOf(".")||(e.warning({message:"Only numbers are alowed!"}),t.preventDefault(),!1))}),r.on("keydown",function(e){var t=$(this),r=t.val();r=r.replace(/[^0-9\.]/g,"");var a=new RegExp(/\./g);if(e.target.attributes.hasOwnProperty("decimals")&&0==(i=parseInt(e.target.attributes.decimals.value))&&[110,190].indexOf(e.which)>-1)return e.preventDefault(),!1;if(e.target.attributes.hasOwnProperty("maxlength")){var n=e.target.value,u=e.target.attributes.maxlength.value;if(""!=n&""!=u){var l=n.length,s=e.which;if(l>=u&&8!=s&9!=s&46!=s&37!=s&39!=s&35!=s&36!=s)return e.preventDefault(),!1;var c=n.indexOf(".");if(c>-1&&4==n.substr(c+1).length&8!=s&9!=s&46!=s&37!=s&39!=s&35!=s&36!=s)return e.preventDefault(),!1}}var o=r.match(a);return null!=o&&[110,190].indexOf(e.which)>-1?(e.preventDefault(),!1):64!=e.which&&16!=e.which&&([8,9,13,17,27,37,38,39,40,46,110].indexOf(e.which)>-1?38!=e.which&&40!=e.which||(e.preventDefault(),!1):e.which>=48&&e.which<=57||(e.which>=96&&e.which<=105||([46,110,190].indexOf(e.which)>-1||(e.preventDefault(),!1))))}),r.on("focusout",function(e){if(n.$viewValue=n.$modelValue,void 0!==n.$viewValue&&null!==n.$viewValue&&""!==n.$viewValue&&!isNaN(n.$viewValue)&&(e.target.attributes.hasOwnProperty("precision")&&(i=parseInt(e.target.attributes.precision.value)),0!=i)){var t=n.$viewValue.toString();n.$render(t)}});var u=function(e){return l(e)>i},l=function(e){var t=""+e,r=t.indexOf(".");return r>=0?t.length-r-1:0};n.$parsers.push(function(e){return e?(n.$setValidity("number",!0),(t=function(e){if(!e)return null;e.toString().match(/-?(\d+|\d+.\d+|.\d+)([eE][-+]?\d+)?/g).join("");Math.round(100*e.toString());i&&u(e)&&(e=e.toFixed(i),n.$viewValue=e);return e}(e))!==e&&(n.$setViewValue(t),n.$render()),t):e;var t})}}}angular.module("FieldConnectApp").directive("decimal",e),e.$inject=["Notification","$timeout"]}();;!function(){"use strict";function t(t,e,o,i,n){var a=this;a.items=[],a.edit=function(t){var i={};for(var n in e.options.FilterFields)i[n]=e.item[e.options.FilterFields[n]];o.showModal({templateUrl:"Templates/Utils/popupEdit.html",controller:"PopupEditController",controllerAs:"vm",inputs:{modalTitle:e.options.Edit.ModalTitle,id:t,model:i,attributes:e.options.Edit.attributes,apiMethod:e.options.ApiMethod}}).then(function(t){t.close.then(function(){s()})})},a.remove=function(o,i,n){bootbox.confirm("Are you sure that you want to delete current record?",function(i){i&&(a.loadingIndicator=!0,t.remove(e.options.ApiMethod,o).then(function(){return s()}).then(function(){a.loadingIndicator=!1}))})},a.go=function(t){var o=null;if(a.items)for(var i=0;i<a.items.length;i++)if(a.items[i].Id==t){o=a.items[i];break}e.onDrilldownGo({id:t,item:o})},s(),a.userRoles=[],a.checkRoles=function(t){for(var e=0;e!=t.length;e++)if(-1!=a.userRoles.indexOf(t[e]))return!0;return!1};var r=n.getValue("authorizationData");function s(){var o={searchText:""};for(var r in e.options.FilterFields)o[r]=e.item[e.options.FilterFields[r]];if(e.filter&&"object"==typeof e.filter){for(var r in e.filter.reset(),e.options.FilterFields)e.filter.eq(r,e.item[e.options.FilterFields[r]]);o=$.extend(o,e.filter)}return t.getItems(e.options.ApiMethod,o).then(function(){a.drilldownOpen=[],a.meta=t.state.itemsMeta,a.items=t.state.items;for(var o=0;o!=e.options.attributes.length;o++)if(e.options.attributes[o].FormatDate)for(var r=0;r!=a.items.length;r++){var s=i.parseISOString(a.items[r][e.options.attributes[o].ValueName]);if(0!=e.options.attributes[o].IsUtc)if(e.options.Timezone){var l=e.options.Timezone.TzDatabaseName;if("undefined"!==e.options.Timezone.TzDatabaseName&&"%"==e.options.Timezone.TzDatabaseName[0]){var m;if(null==(l=a.items[r][e.options.Timezone.TzDatabaseName.substring(1,e.options.Timezone.TzDatabaseName.length-1)]))(m=n.getValue("authorizationData"))&&m.tzDatebaseName&&(l=m.tzDatebaseName);l=moment.tz.zone(l).offset(s)}s=i.convertToLocal(s,l)}else s=i.convertToLocal(s);(m=n.getValue("authorizationData"))&&m.tzDatebaseName&&(a.userTimeZone=moment.tz(m.tzDatebaseName).zoneAbbr()),"date"==e.options.attributes[o].FormatDate?a.items[r][e.options.attributes[o].ValueName]=i.buildDisplayString(s,e.options.attributes[o].FormatDate):a.items[r][e.options.attributes[o].ValueName]=i.buildDisplayString(s,e.options.attributes[o].FormatDate)+" "+a.userTimeZone}a.meta&&(a.total=a.meta.Paging.TotalCount)})}r&&(a.userRoles=r.userRoles.split(",")),a.showDeleteColumn=!0,e.$watch("$scope.options.ShowDeleteColumn",function(){void 0!=e.options.ShowDeleteColumn&&(a.showDeleteColumn=e.options.ShowDeleteColumn)})}angular.module("FieldConnectApp").directive("fcDrilldown",function(){return{restrict:"E",templateUrl:"Templates/Utils/drilldown.html",scope:{options:"=",item:"=",filter:"=?",onDrilldownGo:"&"},link:function(t,e,o,i){},controller:t,controllerAs:"vm"}}),t.$inject=["restService","$scope","ModalService","timezoneService","cryptoStorageService"]}();;!function(){"use strict";function e(e){return{restrict:"E",scope:{tree:"=",attributes:"="},templateUrl:"Templates/Utils/editableDrillDownItemRecursive.html",link:function(e,t,r,i){},controller:t,controllerAs:"vm",compile:function(t){return e.compile(t,function(e,t,r,i,l){})}}}function t(e,t,r,i,l,o,n,c,u,a,s){var d=this;d.$scope=t,d.tree=t.tree,d.drilldownOpen=[],d.toggleDrilldown=function(e){d.drilldownOpen[e]=!d.drilldownOpen[e]},d.attributes=t.attributes,d.model=t.model,d.tree=t.tree,d.model||(d.model={}),t.$watch("tree",function(){if(t.tree){for(var e=0;e!=d.attributes.length;e++)if("editable"==d.attributes[e].Type)for(var r=0;r!=t.tree.length;r++)void 0!==t.tree[r].PrivilegeId&&null!==t.tree[r].PrivilegeId&&"dropdown"==t.tree[r].Type&&d.attributes[e].ConvertToInt?d.model[t.tree[r].Name]=t.tree[r].PrivilegeId:(d.model[t.tree[r].Name]=null,t.tree[r].PrivilegeId=null);d.tree=t.tree}},!0),t.$watch("vm.model",function(e,t){for(var r in e)if(isNaN(r))for(var i=s.getObjectDiffAttrs(e,t),l=0;l<i.length;l++)for(var o=0;o<d.tree.length;o++)if(d.tree[o].Name===i[l]&&d.tree[o].PrivilegeId!==d.model[i[l]])return void(d.tree[o].PrivilegeId=d.model[i[l]])},!0),d.userRoles=[],d.checkRoles=function(e){for(var t=0;t!=e.length;t++)if(-1!=d.userRoles.indexOf(e[t]))return!0;return!1};var v=i.getValue("authorizationData");v&&(d.userRoles=v.userRoles.split(","))}angular.module("FieldConnectApp").directive("fcEditableDrillDownItemRecursive",e),e.$inject=["recursionService"],t.$inject=["restService","$scope","ngAuthSettings","cryptoStorageService","timezoneService","$attrs","Notification","$q","$http","qsService","objectsComparerService"]}();;!function(){"use strict";function e(e,t,i,r,s,o,a,l,n,m,c,f){var u=this;u.$scope=t,u.apiServiceBaseUri=i.apiServiceBaseUri,u.onSubmit=function(i){o.onSubmit?t.onSubmit({item:i}):e.update(t.apiMethod+"/"+i.Id,i).then(function(e){if(o.submitNotificationText){a.success({message:o.submitNotificationText});for(var t=0;t<u.itemsTemp.length;t++)if(u.itemsTemp[t].Id===i.Id)return void(u.itemsTemp[t]=angular.copy(i))}e.data&&(u.insertData=e.data)})},u.search=function(){p()},u.drilldownOpen=[],u.toggleDrilldown=function(i,r){if(r&&!r.Objects){var s=m.filter("and");s.reset();for(var o=0;o<t.filter.filter.length;o++)-1!=t.filter.filter[o].indexOf("RoleId")&&s.filter.push(angular.copy(t.filter.filter[o]));s.eq("ModuleId",r.Id),e.getItems(t.childApiMethod,s).then(function(e){r.Objects=e.data.Data,u.itemsTemp=angular.copy(u.items)})}u.drilldownOpen[i]=!u.drilldownOpen[i]},u.attributes=t.attributes,u.childAttributes=t.childAttributes,u.model=t.model,u.model||(u.model={}),u.searchText="",u.page=1,u.pageSize=10,u.total=0,u.firstWatchFix=!0,u.firstFilterWatch=!0,u.sortCol="",u.sortDir="asc",u.toggleSort=function(e,t){if(!t)return;u.sortCol!=e?(u.sortCol=e,u.sortDir="asc"):"asc"==u.sortDir?u.sortDir="desc":u.sortDir="asc";p()},t.sort&&(u.sortCol=t.sort),u.userRoles=[],u.checkRoles=function(e){for(var t=0;t!=e.length;t++)if(-1!=u.userRoles.indexOf(e[t]))return!0;return!1};var d=r.getValue("authorizationData");function p(){u.drilldownOpen=[];var i={page:u.page,pageSize:u.pageSize,sortCol:u.sortCol,sortDir:u.sortDir},r={};return(r=m.filter("and")).reset(),r.eq("search",u.searchText),i=$.extend(i,r),t.filter&&"object"==typeof t.filter&&(i=$.extend(i,t.filter)),e.getItems(t.apiMethod,i).then(function(){u.meta=e.state.itemsMeta,u.itemsTemp=e.state.items;for(var i=0;i!=u.attributes.length;i++)if("editable"==u.attributes[i].Type)for(var r=0;r!=u.itemsTemp.length;r++)if(void 0!==u.itemsTemp[r].PrivilegeId&&null!==u.itemsTemp[r].PrivilegeId&&"dropdown"==u.itemsTemp[r].Type&&u.attributes[i].ConvertToInt?u.model[u.itemsTemp[r].Name]=u.itemsTemp[r].PrivilegeId:(u.model[u.itemsTemp[r].Name]=null,u.itemsTemp[r].PrivilegeId=null),u.itemsTemp[r].Filter&&t.filters)for(var s=0;s!=t.filters.length;s++)if(t.filters[s][u.items[r].Filter]){u.items[r].Filter=t.filters[s][u.items[r].Filter];break}u.meta&&(u.total=u.meta.Paging.TotalCount),u.items=angular.copy(u.itemsTemp)})}d&&(u.userRoles=d.userRoles.split(",")),u.reloadData=p,u.isChanged=function(e){var t=!1;if(e)for(var i=0;i<u.itemsTemp.length;i++)if(e.Name===u.itemsTemp[i].Name){var r=c.getObjectDiffAttrs(e,u.itemsTemp[i]);-1==r.indexOf("PrivilegeId")&&angular.equals(e.Objects,u.itemsTemp[i].Objects)||(t=!0)}return t},t.$watch("filter",function(){u.firstFilterWatch?u.firstFilterWatch=!1:p()},!0),t.$watch("vm.pageSize",function(){u.firstWatchFix?u.firstWatchFix=!1:(1==u.page&&p(),u.page=1)}),t.$watch("vm.page",function(){p()}),t.$on("itemSubmited",function(e,t){p()})}angular.module("FieldConnectApp").directive("fcEditableDrillDownRecursive",function(){return{restrict:"E",templateUrl:"Templates/Utils/editableDrillDownRecursive.html",scope:{attributes:"=",childAttributes:"=",apiMethod:"@",childApiMethod:"@",onSubmit:"&?",model:"=?",submitButtonText:"@",submitNotificationText:"@",sort:"@",filters:"=",filter:"=?",list:"=?"},link:function(e,t,i,r){},controller:e,controllerAs:"vm"}}),e.$inject=["restService","$scope","ngAuthSettings","cryptoStorageService","timezoneService","$attrs","Notification","$q","$http","qsService","objectsComparerService","$timeout"]}();;!function(){"use strict";function e(e,t,i,l,a,o,r,s,u,m){var n=this;n.$scope=t,n.apiServiceBaseUri=i.apiServiceBaseUri,n.onSubmit=function(i){if("email"==i.Type&&void 0!==n.model[i.ModelValue]&&null!==n.model[i.ModelValue]&&""!==n.model[i.ModelValue]){if(!/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i.test(n.model[i.ModelValue]))return void r.warning({message:"Email is invalid"})}for(var l=0;l<n.attributes.length;l++)if(void 0!=n.attributes[l].Value){"int"==i.Type?n.model[i.ModelValue].length>0&&!isNaN(n.model[i.ModelValue])?i[n.attributes[l].Value]=String(parseInt(n.model[i.ModelValue])):i[n.attributes[l].Value]=n.model[i.ModelValue]:"decimal"==i.Type&&n.model[i.ModelValue].length>0&&!isNaN(n.model[i.ModelValue])?i[n.attributes[l].Value]=String(parseFloat(n.model[i.ModelValue]).toFixed(2)):i[n.attributes[l].Value]=n.model[i.ModelValue],n.model[i.ModelValue]=i[n.attributes[l].Value];break}t.onSubmit?t.onSubmit({item:i}):e.update(t.apiMethod+"/"+i.Id,i).then(function(e){e.data&&(n.insertData=e.data)})},n.search=function(){c()},n.attributes=t.attributes,n.model=t.model,n.model||(n.model={}),n.searchText="",n.page=1,n.pageSize=10,n.total=0,n.firstWatchFix=!0,n.firstFilterWatch=!0,n.sortCol="",n.sortDir="asc",n.toggleSort=function(e,t){if(!t)return;n.sortCol!=e?(n.sortCol=e,n.sortDir="asc"):"asc"==n.sortDir?n.sortDir="desc":n.sortDir="asc";c()},t.sort&&(n.sortCol=t.sort),n.userRoles=[],n.checkRoles=function(e){for(var t=0;t!=e.length;t++)if(-1!=n.userRoles.indexOf(e[t]))return!0;return!1};var d=l.getValue("authorizationData");function c(){var i={page:n.page,pageSize:n.pageSize,sortCol:n.sortCol,sortDir:n.sortDir},l={};if((l=m.filter("and")).reset(),l.eq("search",n.searchText),t.filter&&"object"==typeof t.filter)for(var a=0;a<t.filter.filter.length;a++)l.filter.push(angular.copy(t.filter.filter[a]));return i=$.extend(i,l),e.getItems(t.apiMethod,i).then(function(){n.meta=e.state.itemsMeta,n.items=e.state.items,t.list=n.items;for(var i=0;i!=n.attributes.length;i++)if("editable"==n.attributes[i].Type)for(var l=0;l!=n.items.length;l++)if("checkbox"==n.items[l].Type?void 0!==n.items[l].Value&&null!==n.items[l].Value&&"true"===n.items[l].Value.trim().toLowerCase()?(n.items[l].Value=!0,n.model[n.items[l].ModelValue]=!0):(n.items[l].Value=!1,n.model[n.items[l].ModelValue]=!1):n.items[l].ConvertToInt?void 0===n.items[l].Value||null===n.items[l].Value||""===n.items[l].Value.trim()||isNaN(n.items[l].Value)?(n.items[l].Value=null,n.model[n.items[l].ModelValue]=null):n.model[n.items[l].ModelValue]=parseInt(n.items[l].Value):void 0!==n.items[l].Value&&null!==n.items[l].Value&&""!==n.items[l].Value.trim()?(n.model[n.items[l].ModelValue]=n.items[l].Value.trim(),n.items[l].Value=n.items[l].Value.trim()):"dropdown"==n.items[l].Type||"int"==n.items[l].Type?(n.items[l].Value=null,n.model[n.items[l].ModelValue]=null):(n.items[l].Value="",n.model[n.items[l].ModelValue]=""),n.items[l].Filter&&t.filters)for(var a=0;a!=t.filters.length;a++)if(t.filters[a][n.items[l].Filter]){n.items[l].Filter=t.filters[a][n.items[l].Filter];break}n.meta&&(n.total=n.meta.Paging.TotalCount)})}d&&(n.userRoles=d.userRoles.split(",")),n.reloadData=c,t.$watch("filter",function(){n.firstFilterWatch?n.firstFilterWatch=!1:c()},!0),t.$watch("vm.pageSize",function(){n.firstWatchFix?n.firstWatchFix=!1:(1==n.page&&c(),n.page=1)}),t.$watch("vm.page",function(){c()}),t.$on("itemSubmited",function(e,t){c()})}angular.module("FieldConnectApp").directive("fcEditableTable",function(){return{restrict:"E",templateUrl:"Templates/Utils/editableTable.html",scope:{attributes:"=",apiMethod:"@",onSubmit:"&?",submitButtonText:"@",sort:"@",filters:"=",filter:"=?"},link:function(e,t,i,l){},controller:e,controllerAs:"vm"}}),e.$inject=["restService","$scope","ngAuthSettings","cryptoStorageService","timezoneService","$attrs","Notification","$q","$http","qsService"]}();;!function(){"use strict";function e(e,t,i,l,a,r,m,o,s,n,u,c){var d=this;d.$scope=t,d.apiServiceBaseUri=i.apiServiceBaseUri,d.model=t.model,d.model||(d.model={}),d.onSubmit=function(i){if("email"==i.Type&&void 0!==d.model[i[d.valueModelName]]&&null!==d.model[i[d.valueModelName]]&&""!==d.model[i[d.valueModelName]]&&!h.test(d.model[i[d.valueModelName]]))return void m.warning({message:"Email is invalid"});if(i[d.childCollectionName]&&i[d.childCollectionName].length>0)for(var l=0;l<i[d.childCollectionName].length;l++)if("email"==i[d.childCollectionName][l].Type&&!h.test(i[d.childCollectionName][l][d.value]))return void m.warning({message:"Email is invalid"});r.onSubmit?t.onSubmit({item:i}).then(function(e){if(e)for(var t=0;t<d.itemsTemp.length;t++)e[d.valueModelName]===d.itemsTemp[t][d.valueModelName]&&(d.itemsTemp[t]=angular.copy(e))}):e.update(t.apiMethod+"/"+i.Id,i).then(function(e){if(r.submitNotificationText){m.success({message:r.submitNotificationText});for(var t=0;t<d.itemsTemp.length;t++)d.itemsTemp[t].Id===i.Id&&(d.itemsTemp[t]=angular.copy(i))}e.data&&(d.insertData=e.data)})},d.search=function(){f()},d.drilldownOpen=[],d.toggleDrilldown=function(i,l){if(l&&!l[d.childCollectionName]){d.childFilter;d.childFilter&&d.childFilter.filter.length>0&&(d.childFilter.filter[0]=d.childFilter.filter[0].substring(0,d.childFilter.filter[0].lastIndexOf("]")+1)+l[d.childFilter.filter[0].substring(0,d.childFilter.filter[0].lastIndexOf(":"))]),e.getItems(t.childApiMethod,d.childFilter).then(function(e){l[d.childCollectionName]=e.data.Data;for(var t=0;t<d.itemsTemp.length;t++)l[d.valueModelName]===d.itemsTemp[t][d.valueModelName]&&(d.itemsTemp[t][d.childCollectionName]=angular.copy(l[d.childCollectionName]))})}d.drilldownOpen[i]=!d.drilldownOpen[i]},d.attributes=t.attributes,d.childAttributes=t.childAttributes,d.childCollectionName=t.childCollectionName,d.childIndicatorName=t.childIndicatorName,d.valueModelName=t.valueModelName,d.value=t.value,d.childValueModelName=t.childValueModelName,d.childValue=t.childValue,d.childFilter=t.childFilter,d.searchText="",d.page=1,d.pageSize=10,d.total=0,d.firstWatchFix=!0,d.firstFilterWatch=!0,d.sortCol="",d.sortDir="asc",d.toggleSort=function(e,t){if(!t)return;d.sortCol!=e?(d.sortCol=e,d.sortDir="asc"):"asc"==d.sortDir?d.sortDir="desc":d.sortDir="asc";f()},t.sort&&(d.sortCol=t.sort),d.userRoles=[],d.checkRoles=function(e){for(var t=0;t!=e.length;t++)if(-1!=d.userRoles.indexOf(e[t]))return!0;return!1};var p=l.getValue("authorizationData");p&&(d.userRoles=p.userRoles.split(",")),d.reloadData=f;var h=/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i;function f(){d.drilldownOpen=[];var i={page:d.page,pageSize:d.pageSize,sortCol:d.sortCol,sortDir:d.sortDir},l={};return(l=n.filter("and")).reset(),l.eq("search",d.searchText),i=$.extend(i,l),t.filter&&"object"==typeof t.filter&&(i=$.extend(i,t.filter)),e.getItems(t.apiMethod,i).then(function(e){d.meta=e.data.Meta,d.itemsTemp=e.data.Data;for(var i=0;i!=d.attributes.length;i++)if("editable"==d.attributes[i].Type)for(var l=0;l!=d.itemsTemp.length;l++)if("checkbox"==d.itemsTemp[l].Type?void 0!==d.itemsTemp[l][d.attributes[i].Value]&&null!==d.itemsTemp[l][d.attributes[i].Value]&&"true"===String(d.itemsTemp[l][d.attributes[i].Value]).trim().toLowerCase()?(d.itemsTemp[l][d.attributes[i].Value]=!0,d.model[d.itemsTemp[l][d.attributes[i].ValueName]]=!0):(d.itemsTemp[l][d.attributes[i].Value]=!1,d.model[d.itemsTemp[l][d.attributes[i].ValueName]]=!1):d.itemsTemp[l].ConvertToInt?void 0===d.itemsTemp[l][d.attributes[i].Value]||null===d.itemsTemp[l][d.attributes[i].Value]||""===String(d.itemsTemp[l][d.attributes[i].Value]).trim()||isNaN(d.itemsTemp[l][d.attributes[i].Value])?(d.itemsTemp[l][d.attributes[i].Value]=null,d.model[d.itemsTemp[l][d.attributes[i].ValueName]]=null):d.model[d.itemsTemp[l][d.attributes[i].ValueName]]=parseInt(d.itemsTemp[l][d.attributes[i].Value]):void 0!==d.itemsTemp[l][d.attributes[i].Value]&&null!==d.itemsTemp[l][d.attributes[i].Value]&&""!==String(d.itemsTemp[l][d.attributes[i].Value]).trim()?("int"==d.itemsTemp[l].Type?d.itemsTemp[l][d.attributes[i].Value]=parseInt(d.itemsTemp[l][d.attributes[i].Value]):d.itemsTemp[l][d.attributes[i].Value]=String(d.itemsTemp[l][d.attributes[i].Value]).trim(),d.model[d.itemsTemp[l][d.attributes[i].ValueName]]=d.itemsTemp[l][d.attributes[i].Value]):"dropdown"==d.itemsTemp[l].Type||"int"==d.itemsTemp[l].Type?(d.itemsTemp[l][d.attributes[i].Value]=null,d.model[d.itemsTemp[l][d.attributes[i].ValueName]]=null):(d.itemsTemp[l][d.attributes[i].Value]="",d.model[d.itemsTemp[l][d.attributes[i].ValueName]]=""),d.itemsTemp[l].Filter&&t.filters)for(var a=0;a!=t.filters.length;a++)if(t.filters[a][d.itemsTemp[l].Filter]){d.itemsTemp[l].Filter=t.filters[a][d.itemsTemp[l].Filter];break}d.meta&&(d.total=d.meta.Paging.TotalCount),d.items=angular.copy(d.itemsTemp)})}d.isChanged=function(e){var t=!1;if(e)for(var i=0;i<d.itemsTemp.length;i++)if(e[d.valueModelName]===d.itemsTemp[i][d.valueModelName]){if(e[d.value]!=d.itemsTemp[i][d.value]){t=!0;break}if(e[d.childCollectionName]&&e[d.childCollectionName].length>0)for(var l=0;l<e[d.childCollectionName].length;l++)if(e[d.childCollectionName][l][d.childValue]!=d.itemsTemp[i][d.childCollectionName][l][d.childValue]){t=!0;break}}return t},t.$watch("filter",function(){d.firstFilterWatch?d.firstFilterWatch=!1:f()},!0),t.$watch("vm.pageSize",function(){d.firstWatchFix?d.firstWatchFix=!1:(1==d.page&&f(),d.page=1)}),t.$watch("vm.page",function(){f()}),t.$on("itemSubmited",function(e,t){f()}),t.$watch("vm.model",function(e,t){for(var i in e)if(isNaN(i))for(var l=u.getObjectDiffAttrs(e,t),a=(u.getObjectDiffAttrsWithValues(e,t),0);a<l.length;a++)for(var r=0;r<d.items.length;r++)if(d.items[r][d.valueModelName]===l[a]&&d.items[r][d.value]!==d.model[l[a]])return void(d.items[r][d.value]=d.model[l[a]])},!0)}angular.module("FieldConnectApp").directive("fcEditableTableDrillDown",function(){return{restrict:"E",templateUrl:"Templates/Utils/editableTableDrillDown.html",scope:{attributes:"=",childAttributes:"=",childCollectionName:"@",valueModelName:"@",value:"@",childValueModelName:"@",childValue:"@",childIndicatorName:"@",apiMethod:"@",childApiMethod:"@",model:"=?",onSubmit:"&?",submitButtonText:"@",submitNotificationText:"@",sort:"@",filters:"=",filter:"=?",childFilter:"=?",list:"=?"},link:function(e,t,i,l){},controller:e,controllerAs:"vm"}}),e.$inject=["restService","$scope","ngAuthSettings","cryptoStorageService","timezoneService","$attrs","Notification","$q","$http","qsService","objectsComparerService","$timeout"]}();;!function(){"use strict";function e(){return{restrict:"E",templateUrl:"Templates/Utils/editableTableDrillDownItem.html",scope:{items:"=",attributes:"=",valueModelName:"@",value:"@"},link:function(e,t,a,i){},controller:t,controllerAs:"vm"}}function t(e,t,a,i,l,r,u,s,o,n){var m=this;m.$scope=e,m.items=e.items,m.attributes=e.attributes,m.model=e.model,m.items=e.items,m.valueModelName=e.valueModelName,m.value=e.value,m.model||(m.model={}),e.$watch("items",function(){if(e.items){for(var t=angular.copy(e.items),a=0;a!=m.attributes.length;a++)if("editable"==m.attributes[a].Type)for(var i=0;i!=t.length;i++)if("checkbox"==t[i].Type?void 0!==t[i][m.attributes[a].Value]&&null!==t[i][m.attributes[a].Value]&&"true"===String(t[i][m.attributes[a].Value]).trim().toLowerCase()?(t[i][m.attributes[a].Value]=!0,m.model[t[i][m.attributes[a].ValueName]]=!0):(t[i][m.attributes[a].Value]=!1,m.model[t[i][m.attributes[a].ValueName]]=!1):t[i].ConvertToInt?void 0===t[i][m.attributes[a].Value]||null===t[i][m.attributes[a].Value]||""===String(t[i][m.attributes[a].Value]).trim()||isNaN(t[i][m.attributes[a].Value])?(t[i][m.attributes[a].Value]=null,m.model[t[i][m.attributes[a].ValueName]]=null):m.model[t[i][m.attributes[a].ValueName]]=parseInt(t[i][m.attributes[a].Value]):void 0!==t[i][m.attributes[a].Value]&&null!==t[i][m.attributes[a].Value]&&""!==String(t[i][m.attributes[a].Value]).trim()?("int"==t[i].Type?t[i][m.attributes[a].Value]=parseInt(t[i][m.attributes[a].Value]):t[i][m.attributes[a].Value]=String(t[i][m.attributes[a].Value]).trim(),m.model[t[i][m.attributes[a].ValueName]]=t[i][m.attributes[a].Value]):"dropdown"==t[i].Type||"int"==t[i].Type?(t[i][m.attributes[a].Value]=null,m.model[t[i][m.attributes[a].ValueName]]=null):(t[i][m.attributes[a].Value]="",m.model[t[i][m.attributes[a].ValueName]]=""),t[i].Filter&&e.filters)for(var l=0;l!=e.filters.length;l++)if(e.filters[l][t[i].Filter]){t[i].Filter=e.filters[l][t[i].Filter];break}m.items=e.items}},!0),e.$watch("vm.model",function(e,t){for(var a in e)if(isNaN(a))for(var i=n.getObjectDiffAttrs(e,t),l=0;l<i.length;l++)for(var r=0;r<m.items.length;r++)if(m.items[r][m.valueModelName]===i[l]&&m.items[r][m.value]!==m.model[i[l]])return void(m.items[r][m.value]=m.model[i[l]])},!0),m.userRoles=[],m.checkRoles=function(e){for(var t=0;t!=e.length;t++)if(-1!=m.userRoles.indexOf(e[t]))return!0;return!1};var b=a.getValue("authorizationData");b&&(m.userRoles=b.userRoles.split(","))}angular.module("FieldConnectApp").directive("fcEditableTableDrillDownItem",e),e.$inject=[],t.$inject=["$scope","ngAuthSettings","cryptoStorageService","timezoneService","$attrs","Notification","$q","$http","qsService","objectsComparerService"]}();;!function(){"use strict";angular.module("FCUtilsModule").directive("fcEnter",function(){return{restrict:"A",scope:{onEnter:"&fcEnter"},link:function(n,e,t,i){e.bind("keydown keypress",function(e){13===e.which&&(n.$apply(function(){n.onEnter()}),e.preventDefault())})}}})}();;!function(){"use strict";function n(n){return{restrict:"A",link:function(t,u,c,i){c.fcFocusout&&n(function(){n(function(){u.find("input").bind("blur",function(){n(function(){t.$apply(function(){t.$eval(c.fcFocusout)})})}),u.find("select").bind("blur",function(){t.$apply(function(){t.$eval(c.fcFocusout)})}),u.find("textarea").bind("blur",function(){t.$apply(function(){t.$eval(c.fcFocusout)})})})})}}}angular.module("FieldConnectApp").directive("fcFocusout",n),n.$inject=["$timeout"]}();;!function(){"use strict";function t(t,n,e){return{restrict:"A",scope:{},link:function(t,n,e){var o=n[0].getContext("2d");t.$on("$destroy",function(){n.off("touchend"),n.off("touchstart"),n.off("touchmove")});var i=!1,u=null,c=null;function l(t,n){var e=t.getBoundingClientRect();return{x:n.clientX-e.left,y:n.clientY-e.top}}n.on("mousedown",function(t){i=!0,u=l(this,t)}),n.on("mousemove",function(t){if(i){o.beginPath(),o.moveTo(u.x,u.y);var n=l(this,t);o.lineTo(n.x,n.y),o.stroke(),u=l(this,t)}}),$(window).on("mouseup",function(t){i=!1}),n.on("touchstart",function(t){return t.preventDefault(),t=t.originalEvent,c={x:t.touches[0].clientX-n[0].getBoundingClientRect().left,y:t.touches[0].clientY-n[0].getBoundingClientRect().top},!0}),n.on("touchmove",function(t){return t=t.originalEvent,null!=c&&(o.beginPath(),o.moveTo(c.x,c.y),o.lineTo(t.touches[0].clientX-n[0].getBoundingClientRect().left,t.touches[0].clientY-n[0].getBoundingClientRect().top),o.stroke()),c={x:t.touches[0].clientX-n[0].getBoundingClientRect().left,y:t.touches[0].clientY-n[0].getBoundingClientRect().top},!0}),$(window).on("touchend",function(t){return t=t.originalEvent,i=!1,!0}),$(window).on("mouseout",function(t){t.preventDefault(),i=!1})}}}angular.module("FieldConnectApp").directive("fcSignature",t),t.$inject=["$rootScope","$document","$log"]}();;!function(){"use strict";function e(e,i,t){var n=this;n.sidebarOpen=!0,n.toggleHide=a;var r=100,s=$(window).height();function d(){var e=s-r;$("#side-bar-wrapper").css("height",e)}function a(){$(i[0].parentNode).toggleClass("sb-collapsed"),n.sidebarOpen=!n.sidebarOpen,o()}function o(){e.sidebarWidth=$("#dispatch-calendar-sidebar").width(),e.$emit("sidebar-resize",e.sidebarWidth)}$(window).resize(function(){s=$(window).height(),d()}),d(),o(),e.$on("hide-sidebar",function(e){e&&(n.sidebarOpen=!e,t(function(){a()}))})}angular.module("FieldConnectApp").directive("fcFilterSidebar",function(){return{restrict:"E",templateUrl:"Templates/Utils/filterSidebar.html",scope:{},link:function(e,i,t,n){},controller:e,controllerAs:"vm",transclude:!0}}),e.$inject=["$scope","$element","$timeout"]}();;!function(){"use strict";function e(e,t,l,n){var o=this;function s(){t.value=[];for(var e=0;e!=o.items.length;e++)t.value.push(o.items[e][t.valueProp])}function i(){t.value=[]}o.$scope=t,o.items=[],o.itemsLoaded=!1,o.selectedAll=!1,o.selectedNone=!1,o.showAll=t.showAll,o.selectAll=s,o.selectNone=i,o.enter=function(){t.onEnter&&t.onEnter()},t.$watch("filter",function(){!function(){var s;t.filter&&((s=$.extend({},t.filter)).searchText="");t.list&&(o.items=t.list,o.itemsLoaded=!0,void 0!=t.itemsLoaded&&(t.itemsLoaded=!0));t.apiMethod&&e.getItems(t.apiMethod,s).then(function(e){o.items=e.data.Data,o.items.length>0&&(t.noSort||o.items.sort(n.sortArray(t.textProp))),l.currentList&&(t.currentList=o.items,t.value.length==o.items.length&&(o.checkAllButton=!0)),o.itemsLoaded=!0,void 0!=t.itemsLoaded&&(t.itemsLoaded=!0)})}()},!0),t.$watch("list",function(){t.list&&(o.items=t.list)}),t.$watch("value",function(){t.value&&t.value.constructor===Array||(t.value=[]),t.value.length==o.items.length?(o.selectedAll=!0,o.checkAllButton=!0):(o.selectedAll=!1,o.checkAllButton=!1),0==t.value.length?(o.selectedNone=!0,o.checkAllButton=!1):o.selectedNone=!1}),t.$watch("vm.checkAllButton",function(){1==o.checkAllButton?s():i()})}angular.module("FieldConnectApp").directive("fcMultiselect",function(){return{restrict:"E",templateUrl:"Templates/Utils/multiselect.html",scope:{apiMethod:"@",valueProp:"@",textProp:"@",value:"=",required:"@",filter:"=?",list:"=?",showAll:"@",showNone:"@",currentList:"=?",className:"@class",fcDisabled:"=?",fcTabindex:"@",noSort:"@",itemsLoaded:"=?",onEnter:"&"},link:function(e,t,l,n){},controller:e,controllerAs:"vm"}}),e.$inject=["restService","$scope","$attrs","sortArrayObjectsByAttrService"]}();;!function(){"use strict";function t(t,e){}angular.module("FieldConnectApp").directive("fcPaging",function(){return{restrict:"E",templateUrl:"Templates/Utils/fcPaging.html",scope:{page:"=",pageSize:"=",total:"=",currentDataLength:"="},link:function(t,e,n,c){},controller:t,controllerAs:"vm"}}),t.$inject=["$scope","$state"]}();;!function(){"use strict";angular.module("FCUtilsModule").directive("percentageInput",function(){return{restrict:"A",require:"ngModel",link:function(e,n,r,t){t.$parsers.push(function(e){"%"==e[e.length-1]&&(e=e.slice(0,-1));var n=parseFloat(e);return isNaN(n)?null:n/100}),t.$formatters.push(function(e){if("number"==typeof e)return Math.round(100*e)+"%"})}}})}();;!function(){"use strict";angular.module("FieldConnectApp").directive("restrictTo",function(){return{restrict:"A",link:function(e,t,r){var n=RegExp(r.restrictTo),i=/Backspace|Enter|Tab|Delete|Del|ArrowUp|Up|ArrowDown|Down|ArrowLeft|Left|ArrowRight|Right/;t[0].addEventListener("keydown",function(e){i.test(e.key)||n.test(e.key)||e.preventDefault()})}}})}();;!function(){"use strict";function e(e,t,o,a,r,s,i,n,l,d,c,m,u){var p=this;p.$scope=t,p.apiServiceBaseUri=o.apiServiceBaseUri,p.gui=d,p.stringToArray=c,p.compareDiffColor=t.compareDiffColor?t.compareDiffColor:"",p.customConditionalClass=t.customConditionalClass?t.customConditionalClass:"",p.conditionalAttribute=t.conditionalAttribute?t.conditionalAttribute:"",p.modulePrivilege=30,p.viewName=t.viewName,p.onLast=function(){s.onLast&&t.onLast()},p.showEntries=t.showEntries,p.disableCustomButton=t.disableCustomButton,p.moduleName=t.moduleName,p.viewName&&p.moduleName&&(p.modulePrivilege=d.getModulePrivilege(p.viewName,p.moduleName),t.attributes=d.applyPrivileges(t.viewName,t.moduleName,t.attributes,!0)),p.showDeleteColumn=!0,t.$watch("showDeleteColumn",function(){void 0!=t.showDeleteColumn&&(p.showDeleteColumn=t.showDeleteColumn)}),p.showPagination=!0,t.$watch("showPagination",function(){void 0!=t.showPagination&&(p.showPagination=t.showPagination)}),p.showSearch=!0,t.$watch("showSearch",function(){void 0!=t.showSearch&&(p.showSearch=t.showSearch)}),p.showHref=!0,t.$watch("showHref",function(){void 0!=t.showHref&&(p.showHref=t.showHref)}),p.showAddNew=!0,t.$watch("showAddNew",function(){void 0!=t.showAddNew&&(p.showAddNew=t.showAddNew)}),p.preselectFirstRow=!1,t.$watch("preselectFirstRow",function(){void 0!=t.preselectFirstRow&&(p.preselectFirstRow=t.preselectFirstRow)}),p.disableSelectRow=!1,t.$watch("disableSelectRow",function(){void 0!=t.disableSelectRow&&(p.disableSelectRow=t.disableSelectRow)}),p.evaluateComparison=!1,t.$watch("evaluateComparison",function(){void 0!=t.evaluateComparison&&(p.evaluateComparison=t.evaluateComparison)}),p.checkSelected=function(e){"newWorkOrders"==window.location.pathname.split("/")[2]?C(e):w(e.Id)},p.edit=w,p.add=function(e){var o=null;if(p.items)for(var a=0;a<p.items.length;a++)if(p.items[a].Id==e){o=p.items[a];break}t.onAdd({id:e,item:o})},p.checkEdit="",p.secondedit=function(e,o){var a=null;if(p.items)for(var r=0;r<p.items.length;r++)if(p.items[r][o]==e){a=p.items[r];break}t.onSecondEdit({id:e,item:a})},p.search=function(){N()},p.remove=function(o){for(var a,r=0;r!=t.attributes.length;r++)if(t.attributes[r].Edit){a=t.attributes[r].ValueName;break}if(s.customeDelete){var i="";if(t.deleteMessageFormat)for(var n=t.deleteMessageFormat;""!==n;){var l=n.indexOf("%");if(-1==l){i+=n;break}i+=n.substring(0,l);var d=(n=n.substring(l+1)).indexOf("%");if(-1==d){console.error("Delete message format error: No closing '%' found!");break}var c=n.substring(0,d);i+=o[c],n=n.substring(d+1)}else i="Are you sure that you want to delete "+o[a]+"?";bootbox.confirm(i,function(e){e&&t.customeDelete({item:o})})}else{var i="";if(t.deleteMessageFormat)for(var n=t.deleteMessageFormat;""!==n;){var l=n.indexOf("%");if(-1==l){i+=n;break}i+=n.substring(0,l);var d=(n=n.substring(l+1)).indexOf("%");if(-1==d){console.error("Delete message format error: No closing '%' found!");break}var c=n.substring(0,d);i+=o[c],n=n.substring(d+1)}else i="Are you sure that you want to delete "+o[a]+"?";bootbox.confirm(i,function(a){a&&(p.loadingIndicator=!0,e.remove(t.apiMethod,o.Id).then(function(){return void 0!==t.selected&&(t.selected=null),p.checkId.Id=o.Id,function(o){var a="Delete: "+t.apiMethod;u.getLocation(a).then(function(a){var r=!1,s={EventType:"DELETE",RecordId:o.Id},i=a.coords.latitude,n=a.coords.longitude;switch(null!==i&&(s.Latitude=i),null!==n&&(s.Longitude=n),t.apiMethod.toLowerCase()){case"woassignments":r=!0,s.TableName="WoAssignment",s.ParentRecordId=o.WoId,s.Note="WoAssignment "+o.Desc+", ProblemCode: "+o.ProblemCode+", Status: "+o.AssignmentStatusName;break;case"woattachments":r=!0,s.TableName="WoAttachment",s.ParentRecordId=o.WoId,s.Note="WoAttachment "+o.AttachmentName+", Type: "+o.AttachmentType;break;case"dslwolabors":case"wolabors":r=!0,s.TableName="WoLabor",s.ParentRecordId=o.WoId,s.Note="WoLabor Tech: "+o.FullName+", Labor Code: "+o.LaborCodeName+", Work Hours: "+o.WorkHours;break;case"wonotes":r=!0,s.TableName="WoNote",s.ParentRecordId=o.WoId,s.Note="WoNote: "+o.Note+", CreatedBy: "+o.FullName;break;case"gbwoservicereports":case"woservicereports":r=!0,s.TableName="WoServiceReport",s.ParentRecordId=o.WoId,s.Note="WoServiceReport: "+o.ServiceReport+", SignedBy: "+o.SignedBy;break;case"dslparts":case"parts":r=!0,s.TableName="WoItem",s.ParentRecordId=o.WoId,s.Note="Part: "+o.ItemName+", Part Num: "+o.SerialNum+", Quantity: "+o.Quantity;break;case"dslmiscs":case"miscs":r=!0,s.TableName="WoItem",s.ParentRecordId=o.WoId,s.Note="Misc: "+o.WoItemName+", Quantity: "+o.Quantity;break;case"wotasks":r=!0,s.TableName="WoTask",s.ParentRecordId=o.WoId,s.Note="WoTask: "+o.TaskName+", Desc: "+o.Desc;break;case"siteattachments":r=!0,s.TableName="SiteAttachment",s.ParentRecordId=o.SiteId,s.Note="SiteAttachment "+o.AttachmentName+", Type: "+o.AttachmentType;break;case"equipmentattachments":r=!0,s.TableName="EquipmentAttachments",s.ParentRecordId=o.EquipmentId,s.Note="EquipmentAttachment: "+o.AttachmentName+", Type: "+o.AttachmentType;break;case"wositenotes":case"sitenotes":r=!0,s.TableName="SiteNote",s.ParentRecordId=o.SiteId,s.Note="SiteNote: "+o.Note+", CreatedBy: "+o.FullName;break;case"dslquotemisc":case"dslquotepart":case"quoteitems":r=!0,s.TableName="QuoteItem",s.ParentRecordId=o.QuoteId,s.Note="Part: "+o.ItemName+", Part Num: "+o.PartNum+", Quantity: "+o.Quantity;break;case"quotelabors":case"dslquotelabors":r=!0,s.TableName="QuoteLabor",s.ParentRecordId=o.QuoteId,s.Note="Labor Code: "+o.LaborCodeName+", Work Hours: "+o.WorkHours;break;case"quotenotes":r=!0,s.TableName="QuoteNote",s.ParentRecordId=o.QuoteId,s.Note="QuoteNote: "+o.Note+", CreatedBy: "+o.FullName;break;case"quoteattachments":r=!0,s.TableName="QuoteAttachment",s.ParentRecordId=o.QuoteId,s.Note="QuoteAttachment: "+o.AttachmentName+", Type: "+o.AttachmentType}r&&e.create("events",s).then(function(){})})}(o),N()}).then(function(){t.deleteEvent&&t.deleteEvent(),p.loadingIndicator=!1}))})}},p.go=function(e){var o=null;if(p.items)for(var a=0;a<p.items.length;a++)if(p.items[a].Id==e){o=p.items[a];break}t.onGo({id:e,item:o})},p.drilldownOpen=[],p.toggleDrilldown=function(e){p.drilldownOpen[e]=!p.drilldownOpen[e]},p.attributes=t.attributes,p.searchText="",p.checkId={Id:""},p.page=1,p.pageSize=10,p.total=0,p.firstWatchFix=!0,p.firstFilterWatch=!0,void 0!=p.showEntries&&(p.pageSize=p.showEntries);var b=t.viewName+"_sortCol",h=t.viewName+"_sortDir",g=a.getValue(b),f=a.getValue(h);switch(t.viewName,t.moduleName){case"ManageWorkOrdersGrid":null==g?(p.sortCol="AltId",p.sortDir="desc"):(p.sortCol=g,p.sortDir=f);break;case"SitesGrid":null==g?(p.sortCol="CustomerName",p.sortDir="asc"):(p.sortCol=g,p.sortDir=f);break;case"EquipmentGrid":null==g?(p.sortCol="EquipmentName",p.sortDir="asc"):(p.sortCol=g,p.sortDir=f);break;case"UsersGrid":case"EmployeesGrid":null==g?(p.sortCol="FullName",p.sortDir="asc"):(p.sortCol=g,p.sortDir=f);break;case"ManageQuoteGrid":null==g?(p.sortCol="AltId",p.sortDir="desc"):(p.sortCol=g,p.sortDir=f);break;case"CustomersGrid":null==g?(p.sortCol="CustomerName",p.sortDir="asc"):(p.sortCol=g,p.sortDir=f);break;case"ServiceableItemsGrid":null==g?(p.sortCol="ServiceableItemName",p.sortDir="asc"):(p.sortCol=g,p.sortDir=f);break;case"ItemsGrid":null==g?(p.sortCol="ItemName",p.sortDir="asc"):(p.sortCol=g,p.sortDir=f);break;case p.viewName,"Customer":null==g?(p.sortCol="CustomerName",p.sortDir="asc"):(p.sortCol=g,p.sortDir=f);break;case"RateSheetsGrid":null==g?(p.sortCol="RateSheetName",p.sortDir="asc"):(p.sortCol=g,p.sortDir=f);break;case"AgreementsGrid":null==g?(p.sortCol="CustomerName",p.sortDir="asc"):(p.sortCol=g,p.sortDir=f);break;case"AgreementTypesGrid":null==g?(p.sortCol="AgreementTypeName",p.sortDir="asc"):(p.sortCol=g,p.sortDir=f);break;case"AgreementTypesWindowsGrid":null==g?(p.sortCol="Day",p.sortDir="asc"):(p.sortCol=g,p.sortDir=f);break;case"CustomerUsersGrid":null==g?(p.sortCol="FullName",p.sortDir="asc"):(p.sortCol=g,p.sortDir=f);break;case"PaymentGrid":null==g?(p.sortCol="AltId",p.sortDir="desc"):(p.sortCol=g,p.sortDir=f);break;default:p.sortCol="",p.sortDir="asc"}if("AgreementTypesWindows"==p.viewName&&"AgreementTypesWindowsGrid"==p.moduleName){b=t.viewName+"_sortCol",h=t.viewName+"_sortDir",g=a.getValue(b),f=a.getValue(h);null==g?(p.sortCol="Day",p.sortDir="desc"):(p.sortCol=g,p.sortDir=f)}p.toggleSort=function(e,t){if(!t)return;p.sortCol!=e&&(p.sortCol=e);t&&("asc"==p.sortDir?p.sortDir="desc":p.sortDir="asc");N()},p.userRoles=[],p.checkRoles=function(e){for(var t=0;t!=e.length;t++)if(-1!=p.userRoles.indexOf(e[t]))return!0;return!1},p.hideForRoles=function(e){for(var t=0;t!=e.length;t++)if(-1!=p.userRoles.indexOf(e[t]))return!1;return!0};var v=a.getValue("authorizationData");function w(e){var o=null;if(p.items)for(var a=0;a<p.items.length;a++)if(p.items[a].Id==e){o=p.items[a];break}t.onEdit({id:e,item:o})}function N(){if(t.selected=null,t.isDeleted=!1,"ManageWorkOrders"==t.viewName&&"ManageWorkOrdersGrid"==t.moduleName){var o=a.getValue("ManageWorkOrders_sortCol"),s=a.getValue("ManageWorkOrders_sortDir");""==p.sortCol?null==o?(p.sortCol="AltId",p.sortDir="desc"):(a.setValue("ManageWorkOrders_sortCol",o),a.setValue("ManageWorkOrders_sortDir",s)):(a.setValue("ManageWorkOrders_sortCol",p.sortCol),a.setValue("ManageWorkOrders_sortDir",p.sortDir))}var n={page:p.page,pageSize:p.pageSize,searchText:p.searchText,sortCol:p.sortCol,sortDir:p.sortDir};return p.showPagination||(n.pageSize=null),t.filter&&"object"==typeof t.filter&&(n=$.extend(n,t.filter)),e.getItems(t.customApiGetMethod?t.customApiGetMethod:t.apiMethod,n).then(function(){for(void 0!==t.selected&&(t.selected=null),p.drilldownOpen=[],p.siteTimeZone="",p.meta=e.state.itemsMeta,p.items=e.state.items,t.list=p.items,0===p.items.length&&p.onLast(),o=0;o<p.items.length;o++)null!=p.items[o].RateSheetName&&p.items[o].Id==p.checkId.Id&&i.error({message:"Cannot delete a Rate Sheet that is currently being used."});p.preselectFirstRow&&p.items.length>0&&(t.selected=p.items[0].Id);for(var o=0;o!=p.attributes.length;o++){if("ManageWorkOrders"==t.viewName&&"ManageWorkOrdersGrid"==t.moduleName&&p.attributes[o],p.attributes[o].FormatDate)for(var s=0;s!=p.items.length;s++)if(p.items[s][p.attributes[o].ValueName]){var n=r.parseISOString(p.items[s][p.attributes[o].ValueName]);if((d=a.getValue("authorizationData"))&&d.tzDatebaseName&&(p.siteTimeZone=moment.tz(d.tzDatebaseName).zoneAbbr()),0!=p.attributes[o].IsUtc)if(t.timezone){var l=d.tzDatebaseName;if("undefined"!==t.timezone.TzDatabaseName&&"%"==t.timezone.TzDatabaseName[0]){var d;if(null==(l=d.tzDatebaseName))(d=a.getValue("authorizationData"))&&d.tzDatebaseName&&(l=d.tzDatebaseName);l=moment.tz.zone(l).offset(n)}n=r.convertToLocal(n,l)}else n=r.convertToLocal(n);"date"==p.attributes[o].FormatDate?p.items[s][p.attributes[o].ValueName]=r.buildDisplayString(n,p.attributes[o].FormatDate):p.items[s][p.attributes[o].ValueName]=r.buildDisplayString(n,p.attributes[o].FormatDate)+" "+p.siteTimeZone}if("decimal"==p.attributes[o].CellFormat&&"Sales_Tax_Rate"!=p.attributes[o].DisplayFor)for(s=0;s!=p.items.length;s++)if(p.items[s][p.attributes[o].ValueName]){"string"==typeof p.items[s][p.attributes[o].ValueName]&&(p.items[s][p.attributes[o].ValueName]=parseFloat(p.items[s][p.attributes[o].ValueName]));var c=p.items[s][p.attributes[o].ValueName].toFixed(2).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,");p.items[s][p.attributes[o].ValueName]=c}}p.meta&&(p.total=p.meta.Paging.TotalCount,p.rowsCount=p.total,void 0!=t.rowsCount&&(t.rowsCount=p.rowsCount))})}function C(e){p.disableSelectRow||(D(e),void 0!==t.selected&&(0==e.Id&&s.valueForSelected?t.selected=e[s.valueForSelected]:s.customSelected||(t.selected=e.Id)))}function D(e){void 0!==t.selected&&s.customSelected&&(t.selected=e[s.customSelected])}v&&(p.userRoles=v.userRoles.split(",")),p.setSelected=C,p.customSelected=D,p.reloadData=N,p.drilldownGo=function(e,o){t.onDrilldownGo({id:e,item:o})},p.rowsCount=0,t.$watch("filter",function(){p.firstFilterWatch?p.firstFilterWatch=!1:N()},!0),t.$watch("vm.pageSize",function(){p.firstWatchFix?p.firstWatchFix=!1:(1==p.page&&N(),p.page=1)}),t.$watch("vm.page",function(){N()}),p.download=function(e){return l.get(e).then(function(t){200===t.status&&window.open(e,"_blank")},function(e){if(e.data.Details)for(var t=0;t!=e.data.Details.length;t++)i.error({message:e.data.Details[t].Message});else 404!==e.status&&400!==e.status||i.error({message:e.statusText});return n.reject()})},m(function(){var e=window.location.pathname.split("/"),o=e[e.length-1],a=e[e.length-2];"Customer"!=t.moduleName&&"Site"!=t.moduleName&&"User"!=t.tableName||(p.popoutGrid=!0,t.$apply()),"agreementsEdit"==o?(p.AgreementSitesSI=!0,t.$apply()):"agreementsEdit"==a?(p.AgreementSitesSI=!0,t.$apply()):"manageWorkOrders"==o||"unappliedTime"==o||"quote"==o||"subscription"==o||"users"==o||"employees"==o||"customerUsers"==o||"offices"==o||"customers"==o||"PreventativeMaintenance"==o||"agreementTypes"==o||"items"==o||"skillTechs"==o||"laborGroups"==o||"crews"==o||"techUnavailable"==o||"dispatchScheduling"==o||"subcontractorCompanies"==o||"rateSheets"==o||"Projects"==o||"Vendors"==o||"payRates"==o||"agreements"==o||"processServiceRequest"==o||"taxRates"==o||"companyPayPeriods"==o?(p.primaryGrid=!0,t.$apply()):"manageWorkOrders"==a||"unappliedTime"==o||"quote"==a||"subscription"==a||"users"==a||"employees"==a||"customerUsers"==a||"offices"==a||"customers"==a||"PreventativeMaintenance"==a||"agreementTypes"==a||"items"==a||"skillTechs"==a||"laborGroups"==o||"crews"==a||"techUnavailable"==a||"dispatchScheduling"==a||"subcontractorCompanies"==a||"rateSheets"==a||"Projects"==a||"Vendors"==a||"payRates"==a||"agreements"==a||"processServiceRequest"==a||"taxRates"==a||"companyPayPeriods"==a?(p.primaryGrid=!0,t.$apply()):(p.AgreementSitesSI=!1,p.primaryGrid=!1,t.$apply()),"views"==o&&(p.viewsIndent=!0),"agreements"==o&&1==p.popoutGrid?(p.primaryGrid=!1,p.tableHover=!0,t.$apply()):"agreements"==a&&1==p.popoutGrid&&(p.primaryGrid=!1,p.tableHover=!0,t.$apply()),"processServiceRequest"==o&&1==p.popoutGrid?(p.primaryGrid=!1,p.tableHover=!0,t.$apply()):"processServiceRequest"==a&&1==p.popoutGrid&&(p.primaryGrid=!1,p.tableHover=!0,t.$apply()),"PreventativeMaintenance"==o&&1==p.popoutGrid?(p.primaryGrid=!1,p.tableHover=!0,t.$apply()):"PreventativeMaintenance"==a&&1==p.popoutGrid&&(p.primaryGrid=!1,p.tableHover=!0,t.$apply()),"employees"==o&&1==p.popoutGrid?(p.primaryGrid=!1,p.tableHover=!0,t.$apply()):"employees"==a&&1==p.popoutGrid&&(p.primaryGrid=!1,p.tableHover=!0,t.$apply())},0)}angular.module("FieldConnectApp").directive("fcTable",function(){return{restrict:"E",templateUrl:"Templates/Utils/table.html",scope:{attributes:"=",apiMethod:"@",onEdit:"&",onAdd:"&",onSecondEdit:"&",onGo:"&",selected:"=?",valueForSelected:"@",customSelected:"@",filter:"=?",drilldown:"=?",drilldownFilter:"=?",tableName:"@",list:"=?",deleteMessageFormat:"@",deleteEvent:"&?",timezone:"=?",customeDelete:"&?",onDrilldownGo:"&",addButtonText:"@",viewName:"@",moduleName:"@",popoutGrid:"@",rowsCount:"=?",showDeleteColumn:"=?",preselectFirstRow:"=?",showPagination:"=?",showSearch:"=?",showHref:"=?",showAddNew:"=?",disableSelectRow:"=?",compareDiffColor:"@",customApiGetMethod:"@",customConditionalClass:"@",conditionalAttribute:"@",evaluateComparison:"=?",showEntries:"=?",disableCustomButton:"=?",onLast:"&?"},link:function(e,t,o,a){},controller:e,controllerAs:"vm"}}),e.$inject=["restService","$scope","ngAuthSettings","cryptoStorageService","timezoneService","$attrs","Notification","$q","$http","guiPrivilegeService","stringToArrayService","$timeout","fcGeoLocationService"]}();;!function(){"use strict";function e(e){return{restrict:"E",templateUrl:"Templates/Utils/tableEdit.html",scope:{apiMethod:"@",id:"@",attributes:"=",onSubmit:"&?",onBack:"&",model:"=?",timezone:"=?",companyLogo:"=?",submitButtonText:"@",cancelButtonText:"@",customFocus:"&?",doFocusOut:"=",parameterless:"=",onEnter:"&",viewName:"@",moduleName:"@",hideSubmit:"=",hideCancel:"=",disableSubmit:"=",winPosition:"&",setPosition:"="},link:function(e,t,a,o){},controller:t,controllerAs:"vm"}}function t(e,t,a,o,i,l,r,n,d,s,u,m,f,c,b){var g=this;g.id=t.id,g.onSubmit=function(){t.attributes;if(g.model.ListSitesIds&&0==g.model.ListSitesIds.length)return void i.warning({message:"You must first select a Site to add."});if(g.model.ListServiceableItemIds&&0==g.model.ListServiceableItemIds.length)return void i.warning({message:"You must first select a Serviceable Item to add."});if(!h(t.attributes,!0))return void i.warning({message:"Please fill in required fields!"});if(!function e(t){var a=!0;if(void 0==t)return;for(var o=0;o!=t.length;o++)switch(t[o].Type){case"group":a=e(t[o].Attributes);break;case"line":case"empty":break;default:if(!t[o].Required&&(g.formValidation[t[o].ModelValue]||(g.formValidation[t[o].ModelValue]={}),"email"==t[o].Type))if(void 0===g.model[t[o].ModelValue]||""===g.model[t[o].ModelValue]||null===g.model[t[o].ModelValue])g.formValidation[t[o].ModelValue].Error=!1,g.formValidation[t[o].ModelValue].Required=!1,g.formValidation[t[o].ModelValue].Email=!1;else{/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i.test(g.model[t[o].ModelValue])?(g.formValidation[t[o].ModelValue].Error=!1,g.formValidation[t[o].ModelValue].Email=!1,g.formValidation[t[o].ModelValue].Required=!1):(g.formValidation[t[o].ModelValue].Error=!0,g.formValidation[t[o].ModelValue].Email=!0,g.formValidation[t[o].ModelValue].Required=!1,a=!1)}}return a}(t.attributes))return void i.warning({message:"Email format is invalid!"});""!=g.CompanyLogo&&(g.model.CompanyLogo=g.CompanyLogo,g.model.LogoUrl=g.LogoUrl);if(!m.validateDate(g.model.StartDate))return;if(!m.validateDate(g.model.EndDate))return;if(!m.validateDateRange(g.model.StartDate,g.model.EndDate))return;if("techunavailable"===g.viewName&&g.model.EndDate.getTime()===g.model.StartDate.getTime())return void i.warning({message:"The starting date/time cannot be the same as the ending date/time."});if(!m.validateDate(g.model.Date))return;g.loadingData=!0,"NewSubcontractorCompany"==t.moduleName||"NewSubcontractorUser"==t.moduleName?a():"timeReportsLabor"==t.moduleName?e.getItem("wo",g.model.WoId).then(function(e){g.woData=e.data,null!=g.woData.AgreementId&&(g.model.Billable=!1,g.model.Hours=0)}).then(function(e){a()}):a();function a(){var a,l;o.onSubmit?(g.loadingData=!1,t.onSubmit()):(a=c.defer(),l=t.moduleName,f.getLocation(l).then(function(e){g.geoLocation.Latitude=e.coords.latitude,g.geoLocation.Longitude=e.coords.longitude,a.resolve(g.geoLocation)},function(e){a.resolve(g.geoLocation)}),a.promise).then(function(){for(var a=angular.copy(g.model),o=0;o!=t.attributes.length;o++){var l=[];if("datepicker"==t.attributes[o].Type&&-1==l.indexOf(t.attributes[o].ModelValue))if(l.push(t.attributes[o].ModelValue),1==t.attributes[o].IsUtc){var n=t.attributes[o].ModelValue,d=a[n];d&&d.constructor===Date&&d.setMinutes(d.getMinutes()-d.getTimezoneOffset())}else{var n=t.attributes[o].ModelValue;if(a[n]&&a[n].constructor===Date){if("date"===t.attributes[o].SubType){var s=new Date;a[n].setHours(s.getHours()),a[n].setMinutes(s.getMinutes()),a[n].setSeconds(s.getSeconds())}var u;if(t.timezone)"undefined"!==t.timezone.TzDatabaseName?("%"==t.timezone.TzDatabaseName[0]?(u=g.model[t.timezone.TzDatabaseName.substring(1,t.timezone.TzDatabaseName.length-1)],u=moment.tz.zone(u).offset(a[n])):u=moment.tz.zone(t.timezone.TzDatabaseName).offset(a[n]),r.convertToUtc(a[n],u)):(u=t.timezone.TzDatabaseName,u=moment.tz.zone(u).offset(a[n]),r.convertToUtc(a[n],u));else r.convertToUtc(a[n]);a[n]=r.buildISOString(a[n])}}}var m=g.geoLocation.Latitude,f=g.geoLocation.Longitude;if(null!==m&&(a.Latitude=m),null!==f&&(a.Longitude=f),t.id){var c=$(".upload-file"),b=c.data("max-size");if(c[0]&&c[0].files.length){var p=c[0].files[0].size;if(p>b)return i.warning({message:"File size is larger than "+b/1048576+" MB"}),g.loadingData=!1,!1}g.submitBlock=!0,e.update(t.apiMethod,a).then(function(a){a.data?g.insertData=a.data:200==a.status&&(g.insertData=!0);for(var o=0;o!=t.attributes.length;o++)if("file"==t.attributes[o].Type&&g.files[t.attributes[o].Index]){var i=new FormData;return i.append("file",g.files[t.attributes[o].Index]),e.uploadFile(t.attributes[o].ApiMethod+"/"+g.model.Id,i)}}).then(function(){g.submitBlock=!1,g.loadingData=!1,t.onBack({insertData:g.insertData})},function(){g.submitBlock=!1,g.loadingData=!1})}else{var c=$(".upload-file"),b=c.data("max-size");if(c[0]&&c[0].files.length){var p=c[0].files[0].size;if(p>b)return i.warning({message:"File size is larger than "+b/1048576+" MB"}),g.loadingData=!1,!1}g.submitBlock=!0,e.create(t.apiMethod,a).then(function(a){a.data?g.insertData=a.data:200==a.status&&(g.insertData=!0);for(var o=0;o!=t.attributes.length;o++)if("file"==t.attributes[o].Type&&g.files[t.attributes[o].Index]){var i=new FormData;return i.append("file",g.files[t.attributes[o].Index]),e.uploadFile(t.attributes[o].ApiMethod+"/"+a.data.Id,i)}}).then(function(){g.submitBlock=!1,t.onBack({insertData:g.insertData}),g.loadingData=!1},function(){g.submitBlock=!1,g.loadingData=!1})}})}},g.onBack=function(){window.removeEventListener("message",M,!1),t.onBack()},g.customFocus=function(e){o.customFocus&&e.hasOwnProperty("FocusOut")&&e.FocusOut&&t.customFocus({attribute:e})},g.userRoles=[],g.CompanyLogo="",g.LogoUrl="",g.data="",g.checkRoles=z,g.onEnter=function(e){e&&"checkbox"===e.Type&&(g.model[e.ModelValue]=!g.model[e.ModelValue]);t.onEnter&&t.onEnter()},g.gui=s,g.hideSubmit=!1,g.hideCancel=!1,g.disableSubmit=!1,t.$watch("hideSubmit",function(){void 0!=t.hideSubmit&&(g.hideSubmit=t.hideSubmit)}),t.$watch("hideCancel",function(){void 0!=t.hideCancel&&(g.hideCancel=t.hideCancel)}),t.$watch("disableSubmit",function(){void 0!=t.disableSubmit&&(g.disableSubmit=t.disableSubmit)}),g.deviceDetect=u;var p=l.getValue("authorizationData");function V(){for(var e=[],a=0;a<t.attributes.length;a++)if("datepicker"==t.attributes[a].Type&&-1==e.indexOf(t.attributes[a].ModelValue)&&(e.push(t.attributes[a].ModelValue),"string"==typeof g.model[t.attributes[a].ModelValue]&&""!=g.model[t.attributes[a].ModelValue])){var i,l=r.parseISOString(g.model[t.attributes[a].ModelValue]);if(1!=t.attributes[a].IsUtc)if(t.timezone)"undefined"!==t.timezone.TzDatabaseName?"%"==t.timezone.TzDatabaseName[0]&&(i=p.tzDatebaseName,i=moment.tz.zone(i).offset(l)):(i=p.tzDatebaseName,i=moment.tz.zone(i).offset(l)),l=r.convertToLocal(l,i);else l=r.convertToLocal(l);g.model[t.attributes[a].ModelValue]=l}g.loadingData=!1,o.winPosition&&g.setPosition&&t.winPosition()}function v(e){var t=encodeURI('&css=.error{color:red;}input{width:100%;font-size:16px;border:0px;border-style:none;outline:none;font-family:"Open Sans",sans-serif;color:gray;margin-left:-2px;}'),a=`${e.Source}?invalidinputevent=true&fullmobilekeyboard=true&unique=true${t}`;g.trustedSource=b.trustAsResourceUrl(a),window.addEventListener("message",M,!1)}null!=p&&p.userRoles&&(g.userRoles=p.userRoles.split(",")),g.colorpickerOptions={columns:6,total:36},g.doFocus=!1,void 0!=t.doFocusOut&&(g.doFocus=Boolean(t.doFocusOut)),g.modulePrivilege=30,g.viewName=t.viewName,g.moduleName=t.moduleName,g.viewName&&g.moduleName&&(g.modulePrivilege=s.getModulePrivilege(g.viewName,g.moduleName)),g.files={},g.insertData=null,g.submitBlock=!1,g.formValidation={},g.checkValidation=h,g.checkValidationForField=function(e){if(!1===g.doFocus)return;if(!e.Required)return;g.formValidation[e.ModelValue]||(g.formValidation[e.ModelValue]={});if("email"==e.Type)if(void 0===g.model[e.ModelValue]||""===g.model[e.ModelValue]||null===g.model[e.ModelValue])g.formValidation[e.ModelValue].Error=!0,g.formValidation[e.ModelValue].Required=!0,g.formValidation[e.ModelValue].Email=!1;else{/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i.test(g.model[e.ModelValue])?(g.formValidation[e.ModelValue].Error=!1,g.formValidation[e.ModelValue].Email=!1,g.formValidation[e.ModelValue].Required=!1):(g.formValidation[e.ModelValue].Error=!0,g.formValidation[e.ModelValue].Email=!0,g.formValidation[e.ModelValue].Required=!1)}else"file"==e.Type?g.files[e.Index]?g.files[e.Index+"error"]=!1:g.files[e.Index+"error"]=!0:void 0===g.model[e.ModelValue]||""===g.model[e.ModelValue]||null===g.model[e.ModelValue]||g.model[e.ModelValue].constructor===Array&&!g.model[e.ModelValue].length?g.formValidation[e.ModelValue].Error=!0:g.formValidation[e.ModelValue].Error=!1},g.splitAttributes=null,g.loadingData=!0,g.geoLocation={Latitude:null,Longitude:null},g.trustedSource=null,t.$watch("attributes",function(){if(t.attributes){t.attributes=s.applyPrivileges(t.viewName,t.moduleName,t.attributes);for(var e=0;e<t.attributes.length;e++)t.attributes[e].Index=e,"group"===t.attributes[e].Type&&(t.attributes[e].Attributes=s.applyPrivileges(t.viewName,t.moduleName,t.attributes[e].Attributes)),"ccTokenizer"===t.attributes[e].Type&&v(t.attributes[e]);if(g.splitAttributes){var a=0;for(e=0;e<t.attributes.length;e++){var o=t.attributes[e];g.splitAttributes[Math.floor((e+a)/2)]||g.splitAttributes.push([]);var i=g.splitAttributes[Math.floor((e+a)/2)][(e+a)%2];!o.Roles||z(o.Roles)?"group"!=o.Type&&"line"!=o.Type||(e+a)%2!=0?i!=o&&(g.splitAttributes[Math.floor((e+a)/2)][(e+a)%2]=o):(a+=1,i!=o&&(g.splitAttributes[Math.floor((e+a-1)/2)][(e+a-1)%2]=o,g.splitAttributes[Math.floor((e+a)/2)][(e+a)%2]={Type:"empty"})):a--}}else{g.splitAttributes=[];for(var l=t.attributes.slice(),r=0;l.length;){var n=l[0].Type;if(!l[0].Roles||z(l[0].Roles))if(g.splitAttributes.push(l.splice(0,1)),"group"==n||"line"==n)g.splitAttributes[g.splitAttributes.length-1].push({Type:"empty",EmptyCounter:r++});else{for(;l[0]&&l[0].Roles&&!z(l[0].Roles);)l.splice(0,1);g.splitAttributes[g.splitAttributes.length-1].push(l.splice(0,1)[0])}else l.splice(0,1)}}}},!0),g.colorpickerColors=["#d1e1cf","#eee3d3","#5a1823","#8b008b","#f6dccf","#f6efcf","#d0dae9","#9b9999","#a60404","#8d0303","#14164a","#002147","#7cfd3b","#19e3d9","#ff80bf","#9a81ec","#31ffd5","#f26222","#ffeac9","#f24153","#eafbff","#d7ffff","#52a74f","#ff8000","#fedf83","#ebecf9","#fcb314","#ff7200","#067ab4","#226ce0","#00fa9a","#4d3382","#f2ff00","#416fa0","#e7e3e4","#ffcadf"],t.$watch("id",function(){!function(){g.model=t.model,g.model||(g.model={});t.id?e.getItem(t.apiMethod,t.id).then(function(){t.model=$.extend(t.model,e.state.item),g.model=t.model,V()},function(e){e.status}):t.parameterless?e.getItem(t.apiMethod).then(function(){t.model=$.extend(t.model,e.state.item),g.model=t.model,V()},function(e){e.status}):(!function e(a,o){if(!o)return;for(var i=0;i!=o.length;i++)if(!o[i].Roles||z(o[i].Roles))switch(o[i].Type){case"empty":case"line":case"checkboxAction":case"button":continue;case"multiselect":case"multiselectCheckbox":a[o[i].ModelValue]=[];break;case"checkbox":a[o[i].ModelValue]=!1;break;case"datepicker":if(o[i].ShowDefaultDate||void 0===o[i].ShowDefaultDate){if(o[i].Required||o[i].DefaultValue){var l=new Date;l=r.convertToUtc(l,l.getTimezoneOffset()),r.convertToLocal(l);var n=l.getHours(),d=(n+24)%24,s=l.getMinutes(),u=15*Math.floor(s/15);if((u+=15)>=60&&(u="00",d+=1),l.setHours(d),l.setMinutes(u),a[o[i].ModelValue]=l,"date"==o[i].SubType){var m,l=g.model[o[i].ModelValue];if(t.timezone)"undefined"!==t.timezone.TzDatabaseName?"%"==t.timezone.TzDatabaseName[0]&&(m=g.items[j][t.timezone.TzDatabaseName.substring(1,t.timezone.TzDatabaseName.length-1)],m=moment.tz.zone(m).offset(l)):(m=t.timezone.TzDatabaseName,m=moment.tz.zone(m).offset(l));g.model[o[i].ModelValue]=new Date(l.getFullYear(),l.getMonth(),l.getDate())}break}a[o[i].ModelValue]=null;break}a[o[i].ModelValue]=null;break;case"int":case"decimal":a[o[i].ModelValue]=null;break;case"group":e(a,o[i].Attributes);break;default:a[o[i].ModelValue]=null}}(g.model,t.attributes),g.loadingData=!1)}()}),g.setPosition=!1,t.$watch("setPosition",function(){t.setPosition&&(g.setPosition=t.setPosition)});var M=function(e){if(e.data&&void 0===e.data.recordedMessage){var a=JSON.parse(e.data),o=t.attributes.findIndex(e=>"ccTokenizer"==e.Type);document.getElementById("mytoken").value=a.message,o&&(g.model[t.attributes[o].ModelValue]=a.message)}};function h(e,t){var a=!0;if(void 0!=e){for(var o=0;o!=e.length;o++)switch(e[o].Type){case"group":a=h(e[o].Attributes,t);break;case"line":case"empty":break;case"multiselectCheckbox":if(void 0===g.files[e[o].Index]){a=!0;break}break;case"file":{const t=/[#%&*:<>?/{|}]/i;if(!1===e[o].Required)break;if(void 0!==g.files[e[o].Index]){t.test(g.files[e[o].Index].name)&&(i.error("Invalid Filename! Filename contains special characters"),a=!1);break}a=!1;break}default:if(e[o].Required)if(g.formValidation[e[o].ModelValue]||(g.formValidation[e[o].ModelValue]={}),"email"==e[o].Type)if(void 0===g.model[e[o].ModelValue]||""===g.model[e[o].ModelValue]||null===g.model[e[o].ModelValue])g.formValidation[e[o].ModelValue].Error=!0,g.formValidation[e[o].ModelValue].Required=!0,g.formValidation[e[o].ModelValue].Email=!1,a=!1;else{/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i.test(g.model[e[o].ModelValue])?(g.formValidation[e[o].ModelValue].Error=!1,g.formValidation[e[o].ModelValue].Email=!1,g.formValidation[e[o].ModelValue].Required=!1):(g.formValidation[e[o].ModelValue].Error=!0,g.formValidation[e[o].ModelValue].Email=!0,g.formValidation[e[o].ModelValue].Required=!1,a=!1)}else void 0===g.model[e[o].ModelValue]||""===g.model[e[o].ModelValue]||null===g.model[e[o].ModelValue]||g.model[e[o].ModelValue].constructor===Array&&!g.model[e[o].ModelValue].length?(t||g.formValidation[e[o].ModelValue].Dirty)&&(g.formValidation[e[o].ModelValue].Error=!0,a=!1):(g.formValidation[e[o].ModelValue].Error=!1,g.formValidation[e[o].ModelValue].Dirty=!0)}return a}}function z(e){for(var t=0;t!=e.length;t++)if(-1!=g.userRoles.indexOf(e[t]))return!0;return!1}t.$on("clearValidationErrors",function(){g.formValidation={}}),t.$on("destroyPaymentListener",function(){window.removeEventListener("message",M,!1)}),t.uploadImage=function(e){if(g.acceptedFile=!1,e.files&&e.files[0]){if("image"!=e.files[0].type.substring(0,5))return void i.warning({message:"Invalid image format"});if("users"==t.apiMethod&&e.files[0].size>4194304)return void i.warning({message:"Image size is larger than 4 MB"});if("users"!=t.apiMethod&&e.files[0].size>102400)return void i.warning({message:"Image size is larger than 100 KB"});if("image/jpeg"!=e.files[0].type&&"image/png"!=e.files[0].type||(g.acceptedFile=!0),1!=g.acceptedFile)return void i.warning({message:"Invalid Image type. Only .jpeg or .png files are allowed."});var a=new FileReader;a.onload=function(a){$("#photo-id").attr("src",a.target.result);var o=document.createElement("canvas"),i=document.createElement("img"),l=a.target.result,r=l.substring(11,14);i.setAttribute("src",a.target.result),o.width=i.width,o.height=i.height,o.getContext("2d").drawImage(i,0,0),g.model[e.name]="png"==r?l.replace(/data:image\/png;base64,/g,""):l.replace(/data:image\/jpeg;base64,/g,"");for(var n=0;n<e.attributes.length;n++)"bind-name-to"==e.attributes[n].nodeName&&(g.model[e.attributes[n].nodeValue]=e.files[0].name,t.$apply())},a.readAsDataURL(e.files[0])}}}angular.module("FieldConnectApp").directive("fcTableEdit",e).directive("fileModel",["$parse",function(e){return{restrict:"A",link:function(t,a,o){var i=e(o.fileModel).assign;a.bind("change",function(){t.$apply(function(){i(t,a[0].files[0])})})}}}]),e.$inject=["$timeout"],t.$inject=["restService","$scope","$location","$attrs","Notification","cryptoStorageService","timezoneService","$timeout","$state","guiPrivilegeService","deviceDetector","dateService","fcGeoLocationService","$q","$sce"]}();;!function(){"use strict";function t(t,a){var e=this;e.changeTab=function(a){if($(a.el).hasClass("disabled"))return;e.tab=a.text,t.$emit("tabsChanges",e.tab)},t.$watch("tabs",function(){e.tabs=t.tabs;for(var a=0;a!=e.tabs.length;a++)t.$watch(function(t){return $(e.tabs[t].el).hasClass("disabled")}.bind(this,a),function(t,a){e.tabs[t].disabled=a}.bind(this,a))}),t.$watch("tab",function(){void 0!==t.tab?e.tab=t.tab:e.tab=e.tabs[0].text}),t.$watch("vm.tab",function(a,e){void 0!==t.tab&&(t.tab=a),$('[fc-tab="'+e+'"]').removeClass("active"),$('[fc-tab="'+a+'"]').addClass("active")})}angular.module("FieldConnectApp").directive("fcTabs",function(){return{restrict:"E",templateUrl:"Templates/Utils/tabs.html",scope:{tab:"=?",hide:"=?"},link:function(t,a,e,s){var i=$(a[0]).find("[fc-tab]");$(a[0]).find("[fc-hide]");t.tabs=[],t.hideTabs=[],$(i[0]).addClass("tab-pane active");for(var n=0;n!=i.length;n++)$(i[n]).addClass("tab-pane"),t.tabs.push({el:i[n],text:$(i[n]).attr("fc-tab"),hide:$(i[n]).attr("fc-hide")});e.$observe("fcHide",function(){t.tabs=[],t.hideTabs=[];for(var a=0;a!=i.length;a++)$(i[a]).addClass("tab-pane"),t.tabs.push({el:i[a],text:$(i[a]).attr("fc-tab"),hide:$(i[a]).attr("fc-hide")})})},controller:t,controllerAs:"vm",transclude:!0}}),t.$inject=["$scope","$attrs"]}();;!function(){"use strict";function e(e,t,a,n){n&&n.addListener("createdDate",e.dateCreated)}function t(e,t,i){var r=this;r.items=[],e.dateCreated=function(){r.DoNotChangeTime=!0},r.internalValue=n(i),r.calculateTimeZone=a,"false"==e.predefined&&(r.internalValue=""),r.$scope=e,r.Hours=["12","01","02","03","04","05","06","07","08","09","10","11"],r.Minutes=["00","15","30","45"],$(t).on("click",function(e){e.stopPropagation()}),e.$watch("value",function(t,u){if(e.value){if("string"==typeof e.value)try{var l=Date.parse(e.value);isNaN(l)||(e.value=new Date(l))}catch(e){}if(e.value instanceof Date){var s=e.value.getHours(),o=e.value.getMinutes(),c=(e.value.getSeconds(),s>=12);if(c&&s>12?s-=12:0==s&&(s=12),"true"!=e.customEnd){var v=15*Math.floor(o/15);v!=o&&(e.value.setMinutes(v),o=v)}var f=("0"+s).slice(-2);f+=":",f+=("0"+o).slice(-2),f+=c?" PM":" AM";var m=a();if(!r.DoNotChangeTime||u?r.internalValue=f:f!==m&&(r.internalValue=f),r.DoNotChangeTime&&"false"==e.predefined&&!u&&(r.internalValue=n(i)),r.internalValue){var d=parseInt(r.internalValue.substring(0,2)),g=parseInt(r.internalValue.substring(3,5)),p=r.internalValue.substring(6,8);12==d&&(d=0),"PM"==p&&(d+=12),e.value.setHours(d),e.value.setMinutes(g)}}}else r.internalValue=n(i)},!0),angular.forEach(r.Hours,function(e){angular.forEach(r.Minutes,function(t){this.push({time:e+":"+t+" AM"})},r.items)},r.items),angular.forEach(r.Hours,function(e){angular.forEach(r.Minutes,function(t){this.push({time:e+":"+t+" PM"})},r.items)},r.items),r.changeValue=function(){e.value||(e.value=new Date);var t=r.internalValue.split(":"),a=parseInt(t[0]);t=t[1].split(" ");var n=parseInt(t[0]),i="PM"==t[1];i&&12!=a?a+=12:i||12!=a||(a=0);e.value instanceof Date&&(e.value.setHours(a),e.value.setMinutes(n))}}function a(){var e=new Date;e.setHours(0,0,0,0);var t=e.getTimezoneOffset()/60;e.setTime(e.getTime()+-1*t*60*60*1e3);var a=(e.getHours()+24)%24,n=" AM";12==a?n=" PM":0==a?a=12:a>12&&(a%=12,n=" PM");var i=a+":00"+n;return a<10&&(i="0"+i),i}function n(e){var t=new Date;t=e.convertToUtc(t,t.getTimezoneOffset()),e.convertToLocal(t);var a=(t.getHours()+24)%24,n=t.getMinutes(),i=15*Math.floor(n/15);(i+=15)>=60&&(i="00",a+=1);var r=" AM";12==a?r=" PM":0==a?a=12:a>12&&(a%=12,r=" PM");var u=a+":"+i+r;return a<10&&(u="0"+u),u}angular.module("FieldConnectApp").directive("fcTimeselect",function(){return{require:"^?datepickerDiv",restrict:"E",scope:{value:"=",required:"=?",fcDisabled:"=?",predefined:"@",fcTabindex:"@",customEnd:"@"},templateUrl:"Templates/Utils/timeselect.html",controller:t,controllerAs:"vm",link:e}}),t.$inject=["$scope","$element","timezoneService"]}();;!function(){"use strict";function e(e,t,a,i,o,n,l){var d=this;d.scope=t,d.assignmenId=t.assignmentId,d.id=t.id,d.model=t.model,d.noteModel=t.noteModel,d.dataPlateList=[],d.selected=0,d.tmpModel=angular.copy(d.model),d.viewName=t.viewName,d.hideLoadingNotification=t.hideLoadingNotification,d.itemsRemoved=[],d.list=t.list,d.useList=t.useList,t.$watch("assignmentId",function(e,a){e&&(d.assignmenId=t.assignmentId,i.usingXOiIntegration()&&(d.useList?d.dataPlateData=d.useList:(d.hideLoadingNotification||l.warning("Loading XOi DataPlates, please wait..."),i.getXOiJob(d.assignmenId).then(function(){i.importXOiPlateData().then(function(e){d.dataPlateData=e,t.list=e,d.hideLoadingNotification||l.success("XOi DataPlate Load complete!")})})),t.$on("resetGrid",function(e,t){t===d.viewName&&(d.selected=0,d.noteModel.Note="",d.noteModel.ServiceableItemId=null,d.model.SerialNum="")}),t.$on("removeSelected",function(e,t){if(t===d.viewName){var a=d.dataPlateData.findIndex(e=>e.SourceId===d.selected);-1!=a&&(d.dataPlateData[a].SourceId=null)}})))}),d.setSelected=function(e){if(d.noteModel.Note="",i.saveXOiDataPlateMake&&(d.model.Mfr=e.Make),i.saveXOiDataPlateModel&&(d.model.Model=e.Model),i.saveXOiDataPlateSerialNumber&&(d.model.SerialNum=e.Serial),i.saveXOiDataPlateMfgDate){var t=new Date(e.MfgDate).getFullYear();d.model.YearMfr=t}i.saveXOiDataPlateNote&&e.Note&&(d.noteModel.Note=`XOi Note: ${e.Note}`),d.selected=e.SourceId},d.toDate=function(e){if(e)return new Date(e)}}angular.module("FieldConnectApp").directive("xoiDataPlate",function(){return{restrict:"E",templateUrl:"Templates/Utils/xoiDataPlate.html",scope:{assignmentId:"@",id:"@",model:"=?",noteModel:"=?",viewName:"@",hideLoadingNotification:"=",list:"=?",useList:"=?"},link:function(e,t,a){},controller:e,controllerAs:"vm"}}),e.$inject=["restService","$scope","$attrs","xoiService","$timeout","qsService","Notification"]}();;!function(){"use strict";angular.module("FieldConnectApp").constant("ngAuthSettings",{apiServiceBaseUri: "https://apps2.fieldconnect.com/online/qa.API/",apiIdentityServiceBaseUri: "https://apps2.fieldconnect.com/online/qa.Accounts/identity/connect/",dpsBaseUri: "https://apps2.fieldconnect.com/online/qa.Forms/",environment: "Development",apiServiceUriSuffix:"api",apiServiceVersion:"v1.0",useRefreshToken:!0,clientId:"fieldconnectweb",clientSecret:"fieldconnectweb",clientScopes:"FieldConnectAPI offline_access",iclientId:"fieldconnectwebimpersonation",iclientSecret:"fieldconnectwebimpersonation",cryptographyKey:"FieldConnect2016",newRest:["assignmentstatuses","serviceAreas","addresses","states","countries","currencies","locations","timezones","currencies","itemClasses","manufacturers","merchants","itemTypes","serviceableItemClasses","serviceableItemTypes","equipment","equipmentClass","equipmentType","equipmentnotes","equipmentattachments","agreementtypes","attachmentTypes","industries","doctypes","billingtypes","billingperiods","paymentTerms","notelibs","roles","settings","subscriptionTypes","statuses","wostatuses","wotypes","priorities","assignmentstatuses","causes","resolutions","problemcodes","problemcodeTasks","sitetypes","wostatuscolors","uoms","skills","laborgroups","laborCodes","unavailables","operationGroups","assignmentstatuscolors","subcontractorList","subcontractorList/invitePut","subcontractorList/invitePost","subcontractorList/joinPut","subcontractorList/joinDeclined","subcontractorList/joinLogin","companyinfos","companyinfos/getCurrentCompany","companyinfos/companycontactaddress","companyinfos/trans","companypayperiods","users","users/createuserForNewCompany","subcontractorAwardWork","subcontractorAwardWork/Reject","subcontractorAwardWork/Award","subcontractorAcceptWork","subcontractorAcceptWork/accept","subcontractorAcceptWork/rejected","newworkorder","subcontractorBids","subcontractorBids/submitForBidding","subcontractorBids/assignWorkOrder","users","users/updatepassword","users/getAvailableUsers","userroles","customers","sites","wotasks","woassignments","wo","wo/filterScheduling","wo/servicerequest","woLabors","wonotes","invoices","invoices/createSubinvoice","unappliedTime","wodetails","miscs","parts","formtemplates","agreements","timeApprovals","unappliedWoLabors","agreementsites","woLabors/timeApproval","woLabors/hours","unappliedTime/timeApproval","unappliedTime/hours","agreementserviceableitems","techWoes","timeApprovals/mail","woassignments/status","subscriptionplans","subscriptions","users/userfornewcompany","companyinfos/subscribed","subcontractorList/joinDeclined","companyinfos/subcontractor","companyinfos/regular","paymenterror","subcontractorList/joinDeclined","companysettings","subscriptions/newCompany","newcompanyusers","subscriptionPayments","subscriptionPayments/trial","pm","pmTrigger","agreements/getAgreementsByCustomerForPM","pmsites","pmserviceableitems","wo/pm","forms","forms/email","users/withRoles","wo/getbyservicableitem","users/getAvailableUsersForCompany","users/getUserInformation","woassignments/email","vendors","woattachments","sitenotes","siteattachments","serviceableitemnotes","serviceableitems","serviceableitemattachments","payRates","offices","itemPrices","items","items/nonstock","employees","customerattachments","projects","wo/addProjectToWoes","wo/removeProjectFromWo","customerattachments","purchases","purchases/email","customerattachments","rolepermission","parts/item","projects/filtered","impersonation/companies","subscriptionTypeRoles","crewtechs","agreementtypesubs","impersonation/users","subItems","subcontractorCompanies","subcontractorCompanies/status","users/userfornewcompanyByFc","companysettings/getforgrid","usersettings","usersettings/getforgrid","userbasicinfo","applicationsettings","applicationsettings/getforgrid","moduleroleprivileges","servicerequests","companyinfos/companyforfeature","companyfeatures","customerusers","reports","reports/documentfilter","reports/documentpdf","reports/documentcsv","quotepriority","quotes","quotenotes","quotelabors","quoteitems","quoteapprovals","quoteconversion","quoteattachments","woassignments/sendAssignmentStatusNotification","leadSource","bundle","bundle/problemCodes","bundleDetail/labor","bundleDetail/items","bundle/apply","dslServiceOrderType","dslServiceZoneCode","dslFailureResolution","dslPartsReceived","dslRecallDueTo","dslDistributor","dslInventoryPostingGroup","wo/dsl","dslLaborCodeByServiceZoneCode","dslActionTaken","dslFaultAreas","dslApplicableCode","dslInstalledRemoved","dslWhoPays","dslWoLabors","dslParts","dslMiscs","dslQuoteLabors","dslQuoteMisc","dslQuotePart","dslQuotes","purchases/saveAsAttachment","laborRounding","reports","eventDebug","woCopy","dashboardChartType","dashboardReportType","dashboardReports","dashboardUserReports","dashboardFilterDDList","dashboardConfigDDList","dispatchCalendarThemes","dispatchChartThemes","dispatchMonthlyCalendarThemes","defaultDispatchCalendarSettings","dispatchCalendarSettings","gpsTrackingLocation","defaultStartPage","xoi/createJob","xoi/createEntireJobShare","xoi/processCapturedData","standardTask","agreementtasks","wotasks/fromAgreement","pmtasks","fcPayment","fcPayment/processRefund","fcPayment/updateSettlementStatus","fcPayment/emailReceipt","smtp","unavailablePayRateMapping","serviceRequestAttachments","serviceRequestAttachments/file","deficiencyStatusAction","deficiencyStatus","deficiencySeverity","deficiency","deficiencyNote","deficiencyAttachment","deficiencyAttachment/file","woservicereports/remoteSignature","key/validate","woservicereports/remoteReport","wodetails/dsl","quotereports/remoteSignature","quotereports/remoteReport"]})}();;!function(){"use strict";function t(t,e,o){o.interceptors.push("AuthorizationInterceptor"),e.html5Mode(!0).hashPrefix("!")}angular.module("FieldConnectApp").config(t),t.$inject=["$stateProvider","$locationProvider","$httpProvider"]}();;!function(){"use strict";function e(e,t,a,s,r,l,n,i){a.$on("$stateChangeStart",function(a,m,o,d,b){if(i.trackUserActivity&&i.googleAnalyticsTrackingId){l.ga("create",i.googleAnalyticsTrackingId,"auto");var p=t.getValue("authorizationData");if(p){var u=p.userRoles.split(",");l.ga("set","dimension1",u[0]),l.ga("set","dimension2",p.session),l.ga("send","pageview",{page:n.url()})}}r.isAccessTokenValid()||"login"===m.name||(a.preventDefault(),e.go("login"),s(function(){window.location.reload()}))})}function t(e,t,a,s,r,l,n,i,m){var o,d,b,p,u,c;l.caseInsensitive(!0),l.strictMode(!1),i.setCryptographyKey(r.cryptographyKey),m.setStorageType("localStorage"),void 0==window.ga&&(o=window,d=document,b="script",p="ga",o.GoogleAnalyticsObject=p,o.ga=o.ga||function(){(o.ga.q=o.ga.q||[]).push(arguments)},o.ga.l=1*new Date,u=d.createElement(b),c=d.getElementsByTagName(b)[0],u.async=1,u.src="",c.parentNode.insertBefore(u,c));var T=r.apiServiceBaseUri+"api/v1.0/";s.registerDomain(T);var y=s.registerDomainMethod(T,"myworkorders");y.getHandlers.push(function(e,t,a,s){var r=[];if(s.fromDate){for(var l=new Date(s.fromDate),n=0;n!=e.length;n++)new Date(e[n].EstStartDate)>l&&r.push(e[n]);e=r,r=[]}if(s.toDate){var i=new Date(s.toDate);for(n=0;n!=e.length;n++)new Date(e[n].EstStartDate)<i&&r.push(e[n]);e=r,r=[]}if(s.status){for(n=0;n!=e.length;n++)(e[n].AssignmentStatusName=s.status)&&r.push(e[n]);e=r,r=[]}if(s.search){for(n=0;n!=e.length;n++)e[n].SiteName&&e[n].AssignmentStatusName&&(-1!=e[n].SiteName.indexOf(s.search)||-1!=e[n].AssignmentStatusName.indexOf(s.search)||e[n].Address.indexOf(-1!=s.search)||-1!=(e[n].AltId+"").indexOf(s.search))&&r.push(e[n]);e=r,r=[]}return e}),y.getHandlers.push(s.collectionResourceHandler),a.interceptors.push("AuthorizationInterceptor"),t.html5Mode(!0).hashPrefix("!"),e.state("login",{url:"/login",template:"<div></div>",resolve:{test:function(){}},controller:["$location",function(e){e.search().reloaded||(e.search("reloaded","true"),window.location.reload())}]}).state("index",{url:"/",views:{bodyContainer:{templateUrl:"Templates/home.html",controller:function(){}}}}).state("notAuthorized",{url:"error",views:{bodyContainer:{templateUrl:"Templates/notAuthorized.html"}}}).state("home",{url:"/home",views:{bodyContainer:{templateUrl:"Templates/home.html"}}}).state("referenceTables",{url:"/reference-tables",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/reference-tables.html"}},data:{menuItems:["ReferenceTables"]}}).state("sites",{url:"/sites",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Sites/sites.html"}},data:{menuItems:["Sites"]}}).state("customersites",{url:"/customersites/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Sites/sites.html"}},data:{menuItems:["Sites"]}}).state("sitesEdit",{url:"/sites/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Sites/sitesEdit.html"}},data:{menuItems:["Sites"]}}).state("siteReadOnly",{url:"/master-tables/siteReadOnly/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Sites/siteReadOnly.html"}},data:{menuItems:["SiteReadOnly"]}}).state("crews",{url:"/crews",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Crew/crew.html"}},data:{menuItems:["ManageCrews"]}}).state("crewEdit",{url:"/crews/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Crew/crewEdit.html"}},data:{menuItems:["ManageCrews"]}}).state("laborGroupTech",{url:"/laborGroups",views:{bodyContainer:{templateUrl:"Templates/MasterTables/LaborGroupTech/laborGroupTech.html"}},data:{menuItems:["LaborGroups"]}}).state("laborGroupTechEdit",{url:"/laborGroups/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/LaborGroupTech/laborGroupTechEdit.html"}},data:{menuItems:["LaborGroups"]}}).state("sitesNoteEdit",{url:"/sitesNote/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Sites/sitesNoteEdit.html"}},data:{menuItems:["Sites"]}}).state("companyPayPeriods",{url:"/companyPayPeriods",views:{bodyContainer:{templateUrl:"Templates/MasterTables/CompanyPayPeriod/companyPayPeriod.html"}},data:{menuItems:["CompanyPayPeriod"]}}).state("companyPayPeriodsEdit",{url:"/companyPayPeriods/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/CompanyPayPeriod/companyPayPeriodEdit.html"}},data:{menuItems:["CompanyPayPeriod"]}}).state("countriesTable",{url:"/reference-tables/countries",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Country/countriesTable.html"}},data:{menuItems:["RefCountries"]}}).state("countriesTableEdit",{url:"/reference-tables/countries/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Country/countriesTableEdit.html"}},data:{menuItems:["RefCountries"]}}).state("serviceAreasTable",{url:"/reference-tables/serviceAreas",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/ServiceArea/serviceAreaTable.html"}},data:{menuItems:["RefServiceAreas"]}}).state("serviceAreasEdit",{url:"/reference-tables/serviceAreas/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/ServiceArea/serviceAreaTableEdit.html"}},data:{menuItems:["RefServiceAreas"]}}).state("stateTable",{url:"/reference-tables/states",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/State/stateTable.html"}},data:{menuItems:["RefStates"]}}).state("stateEdit",{url:"/reference-tables/states/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/State/stateEdit.html"}},data:{menuItems:["RefStates"]}}).state("currenciesTable",{url:"/reference-tables/currency",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Currency/currencyTable.html"}},data:{menuItems:["RefCurrency"]}}).state("locationsTable",{url:"/reference-tables/location",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Location/locationTable.html"}},data:{menuItems:["RefLocation"]}}).state("timeZonesTable",{url:"/reference-tables/timezone",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/TimeZone/timeZoneTable.html"}},data:{menuItems:["RefTimeZone"]}}).state("woStatusesTable",{url:"/reference-tables/wostatus",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/WOStatus/woStatusTable.html"}},data:{menuItems:["RefWoStatus"]}}).state("woStatusColorsTable",{url:"/reference-tables/wostatuscolor",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/WOStatusColor/woStatusColorTable.html"}},data:{menuItems:["RefWoStatusColor"]}}).state("woStatusColorsEditTable",{url:"/reference-tables/wostatuscolor/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/WOStatusColor/woStatusColorTableEdit.html"}},data:{menuItems:["RefWoStatusColor"]}}).state("woTypesTable",{url:"/reference-tables/wotypes",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/WOType/woTypeTable.html"}},data:{menuItems:["RefWoTypes"]}}).state("prioritiesTable",{url:"/reference-tables/priorities",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Priority/priorityTable.html"}},data:{menuItems:["RefPriorities"]}}).state("manufacturer",{url:"/referenceTables/manufacturers",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Manufacturer/manufacturer.html"}},data:{menuItems:["RefManufacturers"]}}).state("manufacturerEdit",{url:"/referenceTables/manufacturers/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Manufacturer/manufacturerEdit.html"}},data:{menuItems:["RefManufacturers"]}}).state("itemClass",{url:"/referenceTables/itemClasses",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/ItemClass/itemClass.html"}},data:{menuItems:["RefItemClasses"]}}).state("itemClassEdit",{url:"/referenceTables/itemClasses/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/ItemClass/itemClassEdit.html"}},data:{menuItems:["RefItemClasses"]}}).state("itemType",{url:"/referenceTables/itemTypes",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/ItemType/itemType.html"}},data:{menuItems:["RefItemTypes"]}}).state("itemTypesEdit",{url:"/referenceTables/itemTypes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/ItemType/itemTypeEdit.html"}},data:{menuItems:["RefItemTypes"]}}).state("serviceableItemClass",{url:"/referenceTables/serviceableItemClasses",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/ServiceableItemClass/serviceableItemClass.html"}},data:{menuItems:["RefServItemClasses"]}}).state("serviceableItemClassEdit",{url:"/referenceTables/serviceableItemClasses/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/ServiceableItemClass/serviceableItemClassEdit.html"}},data:{menuItems:["RefServItemClasses"]}}).state("serviceableItemType",{url:"/referenceTables/serviceableItemType",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/ServiceableItemType/serviceableItemType.html"}},data:{menuItems:["RefServItemType"]}}).state("serviceableItemTypeEdit",{url:"/referenceTables/serviceableItemTypes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/ServiceableItemType/serviceableItemTypeEdit.html"}},data:{menuItems:["RefServItemType"]}}).state("equipmentClass",{url:"/referenceTables/equipmentClass",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/EquipmentClass/equipmentClass.html"}},data:{menuItems:["RefServItemClasses"]}}).state("equipmentClassEdit",{url:"/referenceTables/equipmentClass/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/EquipmentClass/equipmentClassEdit.html"}},data:{menuItems:["RefServItemClasses"]}}).state("equipmentType",{url:"/referenceTables/equipmentType",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/EquipmentType/equipmentType.html"}},data:{menuItems:["RefServItemType"]}}).state("equipmentTypeEdit",{url:"/referenceTables/equipmentType/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/EquipmentType/equipmentTypeEdit.html"}},data:{menuItems:["RefServItemType"]}}).state("siteTypesTable",{url:"/reference-tables/siteTypes",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/SiteType/siteTypeTable.html"}},data:{menuItems:["RefSiteTypes"]}}).state("siteTypesTableEdit",{url:"/reference-tables/siteTypes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/SiteType/siteTypeEdit.html"}},data:{menuItems:["RefSiteTypes"]}}).state("billingTypesTable",{url:"/reference-tables/billingTypes",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/BillingType/billingTypeTable.html"}},data:{menuItems:["RefBillingTypes"]}}).state("billingTypesTableEdit",{url:"/reference-tables/billingTypes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/BillingType/billingTypeEdit.html"}},data:{menuItems:["RefBillingTypes"]}}).state("assigmentStatusesTable",{url:"/reference-tables/assigmentStatuses",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/AssigmentStatus/assigmentStatusTable.html"}},data:{menuItems:["RefAssignStatuses"]}}).state("assigmentStatusesTableEdit",{url:"/reference-tables/assigmentStatuses/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/AssigmentStatus/assigmentStatusEdit.html"}},data:{menuItems:["RefAssignStatuses"]}}).state("settingsTable",{url:"/reference-tables/setting",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Setting/settingsTable.html"}},data:{menuItems:["RefSettings"]}}).state("settingsTableEdit",{url:"/reference-tables/setting/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Setting/settingsTableEdit.html"}},data:{menuItems:["RefSettings"]}}).state("causesTable",{url:"/reference-tables/causes",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Cause/causeTable.html"}},data:{menuItems:["RefCauses"]}}).state("causesTableEdit",{url:"/reference-tables/causes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Cause/causeTableEdit.html"}},data:{menuItems:["RefCauses"]}}).state("currenciesTableEdit",{url:"/reference-tables/currencies/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Currency/currencyTableEdit.html"}},data:{menuItems:["RefCurrency"]}}).state("woTypeTableEdit",{url:"/reference-tables/wotypes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/WOType/woTypeTableEdit.html"}},data:{menuItems:["RefWoTypes"]}}).state("woStatusTableEdit",{url:"/reference-tables/wostatues/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/WOStatus/woStatusTableEdit.html"}},data:{menuItems:["RefWoStatus"]}}).state("priorityTableEdit",{url:"/reference-tables/priority/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Priority/priorityTableEdit.html"}},data:{menuItems:["RefPriorities"]}}).state("locationsTableEdit",{url:"/reference-tables/location/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Location/locationTableEdit.html"}},data:{menuItems:["RefLocation"]}}).state("timeZoneTableEdit",{url:"/reference-tables/timeZone/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/TimeZone/timeZoneTableEdit.html"}},data:{menuItems:["RefTimeZone"]}}).state("skillsTable",{url:"/reference-tables/skills",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Skill/skillTable.html"}},data:{menuItems:["RefSkills"]}}).state("skillsTableEdit",{url:"/reference-tables/skills/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Skill/skillEdit.html"}},data:{menuItems:["RefSkills"]}}).state("resolutionsTable",{url:"/reference-tables/resolutions",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Resolution/resolutionTable.html"}},data:{menuItems:["RefResolutions"]}}).state("resolutionsTableEdit",{url:"/reference-tables/resolutions/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Resolution/resolutionEdit.html"}},data:{menuItems:["RefResolutions"]}}).state("paymentTermsTable",{url:"/reference-tables/paymentTerms",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/PaymentTerm/paymentTermTable.html"}},data:{menuItems:["RefPaymentTerms"]}}).state("paymentTermsTableEdit",{url:"/reference-tables/paymentTerms/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/PaymentTerm/paymentTermEdit.html"}},data:{menuItems:["RefPaymentTerms"]}}).state("industriesTable",{url:"/reference-tables/industries",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Industry/industryTable.html"}},data:{menuItems:["RefIndustries"]}}).state("industriesTableEdit",{url:"/reference-tables/industries/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Industry/industryEdit.html"}},data:{menuItems:["RefIndustries"]}}).state("merchantsTable",{url:"/reference-tables/merchants",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Merchant/merchantTable.html"}},data:{menuItems:["RefMerchants"]}}).state("merchantsTableEdit",{url:"/reference-tables/merchants/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Merchant/merchantEdit.html"}},data:{menuItems:["RefMerchants"]}}).state("eventTypesTable",{url:"/reference-tables/eventTypes",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/EventType/eventTypeTable.html"}},data:{menuItems:["RefEventTypes"]}}).state("eventTypesTableEdit",{url:"/reference-tables/eventTypes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/EventType/eventTypeEdit.html"}},data:{menuItems:["RefEventTypes"]}}).state("tagTypesTable",{url:"/reference-tables/tagTypes",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/TagType/tagTypeTable.html"}},data:{menuItems:["RefTagTypes"]}}).state("tagTypesTableEdit",{url:"/reference-tables/tagTypesEdit/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/TagType/tagTypeEdit.html"}},data:{menuItems:["RefTagTypes"]}}).state("laborCode",{url:"/reference-tables/laborCodes",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/LaborCode/laborCode.html"}},data:{menuItems:["RefLaborCode"]}}).state("laborCodeEdit",{url:"/reference-tables/laborCodes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/LaborCode/laborCodeEdit.html"}},data:{menuItems:["RefLaborCode"]}}).state("laborGroupTable",{url:"/reference-tables/laborGroups",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/LaborGroup/laborGroupTable.html"}},data:{menuItems:["RefLaborGroup"]}}).state("laborGroupTableEdit",{url:"/reference-tables/laborGroups/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/LaborGroup/laborGroupEdit.html"}},data:{menuItems:["RefLaborGroup"]}}).state("attachmentCategoriesTable",{url:"/reference-tables/attachmentCategories",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/AttachmentCategory/attachmentCategoryTable.html"}},data:{menuItems:["RefAttachmentCat"]}}).state("attachmentCategoriesTableEdit",{url:"/reference-tables/attachmentCategories/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/AttachmentCategory/attachmentCategoryEdit.html"}},data:{menuItems:["RefAttachmentCat"]}}).state("attachmentTypesTable",{url:"/reference-tables/attachmentType",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/AttachmentType/attachmentTypeTable.html"}},data:{menuItems:["RefAttachmentTypes"]}}).state("attachmentTypesTableEdit",{url:"/reference-tables/attachmentTypes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/AttachmentType/attachmentTypeEdit.html"}},data:{menuItems:["RefAttachmentTypes"]}}).state("unavailablesTable",{url:"/reference-tables/unavailables",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Unavailable/unavailableTable.html"}},data:{menuItems:["RefUnavailables"]}}).state("unavailablesTableEdit",{url:"/reference-tables/unavailables/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Unavailable/unavailableEdit.html"}},data:{menuItems:["RefUnavailables"]}}).state("noteLibsTable",{url:"/reference-tables/noteLibs",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/NoteLib/noteLibTable.html"}},data:{menuItems:["RefNoteLibs"]}}).state("noteLibsTableEdit",{url:"/reference-tables/noteLibs/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/NoteLib/noteLibEdit.html"}},data:{menuItems:["RefNoteLibs"]}}).state("roleTypesTable",{url:"/reference-tables/roleTypes",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/RoleType/roleTypeTable.html"}},data:{menuItems:["RefRoleTypes"]}}).state("roleTypesTableEdit",{url:"/reference-tables/roleTypes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/RoleType/roleTypeEdit.html"}},data:{menuItems:["RefRoleTypes"]}}).state("rolesTable",{url:"/reference-tables/roles",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Role/roleTable.html"}},data:{menuItems:["RefRoles"]}}).state("rolesTableEdit",{url:"/reference-tables/roles/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Role/roleEdit.html"}},data:{menuItems:["RefRoles"]}}).state("operationGroupsTable",{url:"/reference-tables/operationGroups",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/OperationGroup/operationGroupTable.html"}},data:{menuItems:["RefOperationGroups"]}}).state("operationGroupsTableEdit",{url:"/reference-tables/operationGroups/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/OperationGroup/operationGroupEdit.html"}},data:{menuItems:["RefOperationGroups"]}}).state("problemCodeTasksTable",{url:"/reference-tables/problemCodeTasks",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/ProblemCodeTask/problemCodeTaskTable.html"}},data:{menuItems:["RefProblemCodeTasks"]}}).state("problemCodeTasksTableEdit",{url:"/reference-tables/problemCodeTasks/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/ProblemCodeTask/problemCodeTaskEdit.html"}},data:{menuItems:["RefProblemCodeTasks"]}}).state("subscriptionTypesTable",{url:"/reference-tables/subscriptionTypes",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/SubscriptionType/subscriptionTypeTable.html"}},data:{menuItems:["RefSubsTypes"]}}).state("subscriptionTypesTableEdit",{url:"/reference-tables/subscriptionTypes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/SubscriptionType/subscriptionTypeEdit.html"}},data:{menuItems:["RefSubsTypes"]}}).state("subscriptionTypeRolesTable",{url:"/reference-tables/subscriptionTypeRoles",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/SubscriptionTypeRole/subscriptionTypeRoleTable.html"}},data:{menuItems:["RefSubsTypeRole"]}}).state("subscriptionTypeRolesTableEdit",{url:"/reference-tables/subscriptionTypeRoles/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/SubscriptionTypeRole/subscriptionTypeRoleEdit.html"}},data:{menuItems:["RefSubsTypeRole"]}}).state("problemCodesTable",{url:"/reference-tables/problemCodes",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/ProblemCode/problemCodeTable.html"}},data:{menuItems:["RefProblemCodes"]}}).state("problemCodesTableEdit",{url:"/reference-tables/problemCodes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/ProblemCode/problemCodeEdit.html"}},data:{menuItems:["RefProblemCodes"]}}).state("statusesTable",{url:"/reference-tables/statuses",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Status/statusTable.html"}},data:{menuItems:["RefStatuses"]}}).state("statusesTableEdit",{url:"/reference-tables/statuses/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Status/statusEdit.html"}},data:{menuItems:["RefStatuses"]}}).state("docTypesTable",{url:"/reference-tables/docTypes",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DocType/docTypeTable.html"}},data:{menuItems:["RefDocTypes"]}}).state("docTypesTableEdit",{url:"/reference-tables/docTypes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DocType/docTypeEdit.html"}},data:{menuItems:["RefDocTypes"]}}).state("billingPeriodsTable",{url:"/reference-tables/billingPeriods",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/BillingPeriod/billingPeriodTable.html"}},data:{menuItems:["RefBillingPeriods"]}}).state("billingPeriodsTableEdit",{url:"/reference-tables/billingPeriods/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/BillingPeriod/billingPeriodEdit.html"}},data:{menuItems:["RefBillingPeriods"]}}).state("uomsTable",{url:"/reference-tables/uoms",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Uom/uomTable.html"}},data:{menuItems:["RefUOM"]}}).state("uomsTableEdit",{url:"/reference-tables/uoms/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/Uom/uomEdit.html"}},data:{menuItems:["RefUOM"]}}).state("companyInfosTableEdit",{url:"/master-tables/companyInfos/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/CompanyInfo/companyInfo.html"}},data:{menuItems:["CompanyInfo"]}}).state("taxRatesTable",{url:"/master-tables/taxRates",views:{bodyContainer:{templateUrl:"Templates/MasterTables/TaxRate/taxRateTable.html"}},data:{menuItems:["SalesTaxSetup"]}}).state("taxRatesTableEdit",{url:"/master-tables/taxRates/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/TaxRate/taxRateEdit.html"}},data:{menuItems:["SalesTaxSetup"]}}).state("rateSheetsTable",{url:"/master-tables/rateSheets",views:{bodyContainer:{templateUrl:"Templates/MasterTables/RateSheet/rateSheetTable.html"}},data:{menuItems:["ManageRateSheets"]}}).state("rateSheetsTableEdit",{url:"/master-tables/rateSheets/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/RateSheet/rateSheetEdit.html"}},data:{menuItems:["ManageRateSheets"]}}).state("officesTable",{url:"/master-tables/offices",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Office/officeTable.html"}},data:{menuItems:["Offices"]}}).state("officesTableEdit",{url:"/master-tables/offices/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Office/officeEdit.html"}},data:{menuItems:["Offices"]}}).state("customers",{url:"/master-tables/customers",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Customer/customerTable.html"}},data:{menuItems:["Customer"]}}).state("customersEdit",{url:"/master-tables/customers/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Customer/customerEdit.html"}},data:{menuItems:["Customer"]}}).state("employeeTable",{url:"/master-tables/employees",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Employee/employeeTable.html"}},data:{menuItems:["Employees"]}}).state("employeeEdit",{url:"/master-tables/employees/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Employee/employeeEdit.html"}},data:{menuItems:["Employees"]}}).state("itemTable",{url:"/master-tables/items",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Item/itemTable.html"}},data:{menuItems:["PartsAndMisc"]}}).state("itemEdit",{url:"/master-tables/items/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Item/itemEdit.html"}},data:{menuItems:["PartsAndMisc"]}}).state("serviceableItemsTable",{url:"/master-tables/serviceableItems",views:{bodyContainer:{templateUrl:"Templates/MasterTables/ServiceableItem/serviceableItemTable.html"}},data:{menuItems:["ServiceableItems"]}}).state("serviceableItems",{url:"/master-tables/serviceableItems/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/ServiceableItem/serviceableItemTable.html"}},data:{menuItems:["ServiceableItems"]}}).state("serviceableItemsTableSelected",{url:"/master-tables/serviceableItems/:customerId",views:{bodyContainer:{templateUrl:"Templates/MasterTables/ServiceableItem/serviceableItemTable.html"}},data:{menuItems:["ServiceableItems"]}}).state("serviceableItemsEdit",{url:"/master-tables/serviceableItems/:customerId/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/ServiceableItem/serviceableItemEdit.html"}},data:{menuItems:["ServiceableItems"]}}).state("serviceableItemsReadOnly",{url:"/master-tables/serviceableItemsReadOnly/:customerId/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/ServiceableItem/serviceableItemsReadOnly.html"}},data:{menuItems:["ServiceableItemsReadOnly"]}}).state("equipmentTable",{url:"/master-tables/equipment",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Equipment/equipmentTable.html"}},data:{menuItems:["ServiceableItems"]}}).state("equipmentTableSelected",{url:"/master-tables/equipment",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Equipment/equipmentTable.html"}},data:{menuItems:["ServiceableItems"]}}).state("equipmentEdit",{url:"/master-tables/equipment/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Equipment/equipmentEdit.html"}},data:{menuItems:["ServiceableItems"]}}).state("equipmentReadOnly",{url:"/master-tables/equipmentReadOnly/:customerId/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Equipment/equipmentReadOnly.html"}},data:{menuItems:["ServiceableItemsReadOnly"]}}).state("agreementTypeTable",{url:"/master-tables/agreementTypes",views:{bodyContainer:{templateUrl:"Templates/MasterTables/AgreementType/agreementTypeTable.html"}},data:{menuItems:["AgreementTypes"]}}).state("agreementTypeWindow",{url:"/master-tables/agreementTypes/:tab",views:{bodyContainer:{templateUrl:"Templates/MasterTables/AgreementType/agreementTypeTable.html"}},data:{menuItems:["AgreementTypes"]}}).state("agreementTypeSub",{url:"/master-tables/agreementTypeSub/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/AgreementTypeSub/agreementTypeSub.html"}},data:{menuItems:["AgreementTypes"]}}).state("agreementTypeEdit",{url:"/master-tables/agreementTypes/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/AgreementType/agreementTypeEdit.html"}},data:{menuItems:["AgreementTypes"]}}).state("payRates",{url:"/payRates",views:{bodyContainer:{templateUrl:"Templates/MasterTables/PayRate/payRate.html"}},data:{menuItems:["PayRates"]}}).state("payRatesEdit",{url:"/master-tables/payRates/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/PayRate/payRateEdit.html"}},data:{menuItems:["PayRates"]}}).state("agreementTypeWindowEdit",{url:"/master-tables/agreementTypeWindows/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/AgreementTypeWindow/agreementTypeWindowEdit.html"}},data:{menuItems:["AgreementTypes"]}}).state("paymentTypes",{url:"/master-tables/paymentTypes",views:{bodyContainer:{templateUrl:"Templates/MasterTables/PaymentType/paymentType.html"}},data:{menuItems:["PaymentType"]}}).state("paymentsTypeEdit",{url:"/master-tables/paymentTypes/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/PaymentType/paymentTypeEdit.html"}},data:{menuItems:["PaymentType"]}}).state("subcontractorCompanies",{url:"/master-tables/subcontractorCompanies",views:{bodyContainer:{templateUrl:"Templates/MasterTables/SubcontractorCompany/subcontractorCompany.html"}},data:{menuItems:["ManageSubContractors"]}}).state("subcontractorCompaniesEdit",{url:"/master-tables/subcontractorCompanies/:id/:selectedTab",views:{bodyContainer:{templateUrl:"Templates/MasterTables/SubcontractorCompany/subcontractorCompanyEdit.html"}},data:{menuItems:["ManageSubContractors"]}}).state("skillTechs",{url:"/master-tables/skillTechs",views:{bodyContainer:{templateUrl:"Templates/MasterTables/SkillTech/skillTech.html"}},data:{menuItems:["Skills"]}}).state("skillTechsEdit",{url:"/master-tables/skillTechs/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/SkillTech/skillTechEdit.html"}},data:{menuItems:["Skills"]}}).state("userTable",{url:"/master-tables/users",views:{bodyContainer:{templateUrl:"Templates/MasterTables/User/userTable.html"}},data:{menuItems:["Users"]}}).state("userEdit",{url:"/master-tables/usersEdit/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/User/userEdit.html"}},data:{menuItems:["Users"]}}).state("userForNewCompanyEdit",{url:"/master-tables/userForNewCompanyEdit/:newCompanyId",views:{bodyContainer:{templateUrl:"Templates/MasterTables/User/userForNewCompanyEdit.html"}},data:{menuItems:["Users"]}}).state("myWorkOrders",{url:"/myAssignments",views:{bodyContainer:{templateUrl:"Templates/WorkOrder/MyWorkOrder/myWorkOrder.html"}},data:{menuItems:["MyAssignments"]}}).state("manageWorkOrders",{url:"/manageWorkOrders",views:{bodyContainer:{templateUrl:"Templates/WorkOrder/ManageWorkOrder/manageWorkOrder.html"}},data:{menuItems:["ManageWorkOrders"]}}).state("manageWorkOrdersWoId",{url:"/manageWorkOrders/:id",views:{bodyContainer:{templateUrl:"Templates/WorkOrder/ManageWorkOrder/manageWorkOrder.html"}},data:{menuItems:["ManageWorkOrders"]}}).state("workOrdersDetails",{url:"/workOrdersDetails/:id/:assId",views:{bodyContainer:{templateUrl:"Templates/WorkOrder/ManageWorkOrder/workOrderDetails.html"}},data:{menuItems:["ManageWorkOrders"]}}).state("itemSubEdit",{url:"/master-tables/subcontractorCompanyItem/:subcontractorId/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/SubcontractorCompany/itemSubEdit.html"}},data:{menuItems:["ManageSubContractors"]}}).state("newWorkOrders",{url:"/newWorkOrders",views:{bodyContainer:{templateUrl:"Templates/WorkOrder/NewWorkOrder/newWorkOrder.html"}},data:{menuItems:["NewWorkOrder"]}}).state("dispatchCalendar",{url:"/dispatchCalendar",views:{bodyContainer:{templateUrl:"Templates/Dispatch/DispatchCalendar/dispatchCalendar.html",controller:"DispatchCalendarController",controllerAs:"vm"}},data:{menuItems:["DispatchCalendar"]}}).state("dispatchChart",{url:"/dispatchChart",views:{bodyContainer:{templateUrl:"Templates/Dispatch/DispatchCalendar/dispatchChart.html",controller:"DispatchChartController",controllerAs:"vm"}},data:{menuItems:["DispatchCalendar"]}}).state("dispatchScheduling",{url:"/dispatchScheduling",views:{bodyContainer:{templateUrl:"Templates/Dispatch/DispatchScheduling/dispatchScheduling.html"}},data:{menuItems:["Scheduling"]}}).state("dispatchSchedulingEdit",{url:"/dispatchScheduling/:WoId",views:{bodyContainer:{templateUrl:"Templates/Dispatch/DispatchScheduling/dispatchScheduling.html"}},data:{menuItems:["Scheduling"]}}).state("dispatchMap",{url:"/dispatchMap",views:{bodyContainer:{templateUrl:"Templates/Dispatch/DispatchMap/dispatchMap.html",controller:"DispatchMapController",controllerAs:"vm"}},data:{menuItems:["Map"]}}).state("techUnavailable",{url:"/techUnavailable",views:{bodyContainer:{templateUrl:"Templates/Dispatch/TechUnavailable/techUnavailable.html",controller:"TechUnavailableController",controllerAs:"vm"}},data:{menuItems:["TechUnavailable"]}}).state("techUnavailableEdit",{url:"/techUnavailable/:id",views:{bodyContainer:{templateUrl:"Templates/Dispatch/TechUnavailable/techUnavailableEdit.html",controller:"TechUnavailableController",controllerAs:"vm"}},data:{menuItems:["TechUnavailable"]}}).state("assignmentStatusColorsTable",{url:"/reference-tables/assignmentstatuscolor",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/AssignmentStatusColor/assignmentStatusColorTable.html"}},data:{menuItems:["RefAssignStatusColor"]}}).state("messages",{url:"/messages",views:{bodyContainer:{templateUrl:"Templates/Dispatch/Messaging/messaging.html",controller:"MessagingController",controllerAs:"vm"}},data:{menuItems:["Messaging"]}}).state("assignmentStatusColorsEdit",{url:"/reference-tables/assignmentstatuscolor/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/AssignmentStatusColor/assignmentStatusColorEdit.html"}},data:{menuItems:["RefAssignStatusColor"]}}).state("assignmentDetails",{url:"/assignmentDetails/:id/:assId",views:{bodyContainer:{templateUrl:"Templates/WorkOrder/MyWorkOrder/assignmentDetails.html"}},data:{menuItems:["AssignmentsDetails"]}}).state("assignmentSubcontractorDetails",{url:"/assignmentSubcontractorDetails/:id/:assId",views:{bodyContainer:{templateUrl:"Templates/WorkOrder/MyWorkOrder/assignmentSubcontractorDetails.html"}},data:{menuItems:["AssignmentsDetails"]}}).state("companyInviteInfo",{url:"/companyInviteInfo/:CompanyId/:SubcontractorId/:isInvitation/:IsActive",views:{bodyContainer:{templateUrl:"Templates/SubContractor/SubContractorList/subcintractorCompanyInfo.html"}},data:{menuItems:["AcceptWork"]}}).state("companyJoinInfo",{url:"/companyJoinInfo/:CompanyId/:InvitedEmail/:isInvitation",views:{bodyContainer:{templateUrl:"Templates/SubContractor/SubContractorList/subcintractorCompanyInfo.html"}},data:{menuItems:["AcceptWork"]}}).state("subContractorLists",{url:"/subContractorLists/",views:{bodyContainer:{templateUrl:"Templates/SubContractor/SubContractorList/subContractorList.html"}},data:{menuItems:["SubContractorList"]}}).state("subcontractorBids",{url:"/subcontractorBids/wo/{woId}/company/{companyId}",views:{bodyContainer:{templateUrl:"Templates/SubContractor/SubcontractorBid/subcontractorBid.html"}},data:{menuItems:["ManageWorkOrders"]}}).state("subcontractorAcceptWork",{url:"/subcontractorAcceptWork/{id}/{woId}",views:{bodyContainer:{templateUrl:"Templates/SubContractor/SubcontractorAcceptWork/subcontractorAcceptWork.html"}},data:{menuItems:["AcceptWork"]}}).state("acceptWO",{url:"/acceptWO/:id",views:{bodyContainer:{templateUrl:"Templates/SubContractor/SubcontractorAcceptWork/acceptWO.html"}},data:{menuItems:["AcceptWork"]}}).state("workOrdersDetailsReadOnly",{url:"/workOrderDetailsReadOnly/:id",views:{bodyContainer:{templateUrl:"Templates/WorkOrder/ManageWorkOrder/workOrderDetailsReadOnly.html"}},data:{menuItems:["ManageWorkOrdersReadOnly"]}}).state("serviceRequestWODetails",{url:"/serviceRequestWODetails/:id",views:{bodyContainer:{templateUrl:"Templates/WorkOrder/ManageWorkOrder/serviceRequestWODetails.html"}},data:{menuItems:["ManageWorkOrdersReadOnly"]}}).state("subcontractorWorkOrdersDetails",{url:"/workOrderDetailsSub/:id",views:{bodyContainer:{templateUrl:"Templates/WorkOrder/ManageWorkOrder/subcontractorWorkOrderDetails.html"}},data:{menuItems:["ManageWorkOrders"]}}).state("subcontractorAwardWork",{url:"/subcontractorAwardWork/:woId/:status",views:{bodyContainer:{templateUrl:"Templates/SubContractor/AwardSubcontractor/awardSubcontractor.html"}},data:{menuItems:["AwardWork"]}}).state("awardWO",{url:"/awardWO/:id",views:{bodyContainer:{templateUrl:"Templates/SubContractor/AwardSubcontractor/awardWO.html"}},data:{menuItems:["AwardWork"]}}).state("createInvoice",{url:"/createInvoice/:id",views:{bodyContainer:{templateUrl:"Templates/Invoices/invoiceform.html"}},data:{menuItems:["Invoicing"]}}).state("createInvoiceForSubcontractor",{url:"/createInvoiceForSubcontractor/:id",views:{bodyContainer:{templateUrl:"Templates/Invoices/invoiceformforSub.html"}},data:{menuItems:["ManageWorkOrders"]}}).state("addWoInvoice",{url:"/addWoInvoice/",views:{bodyContainer:{templateUrl:"Templates/Invoices/invoiceWO.html"}},data:{menuItems:["Invoicing"]}}).state("bills",{url:"/bills/",views:{bodyContainer:{templateUrl:"Templates/Invoices/bills.html"}},data:{menuItems:["Bills"]}}).state("invoiceReview",{url:"/invoiceReview/",views:{bodyContainer:{templateUrl:"Templates/Invoices/invoiceReview.html"}},data:{menuItems:["Invoicing"]}}).state("unappliedTime",{url:"/unappliedTime",views:{bodyContainer:{templateUrl:"Templates/ManageTime/UnappliedTime/unappliedTime.html",controller:"UnappliedTimeController",controllerAs:"vm"}},data:{menuItems:["UnappliedTime"]}}).state("unappliedTimeEdit",{url:"/unappliedTime/:id",views:{bodyContainer:{templateUrl:"Templates/ManageTime/UnappliedTime/unappliedTimeEdit.html",controller:"UnappliedTimeEditController",controllerAs:"vm"}},data:{menuItems:["UnappliedTime"]}}).state("formTemplateTable",{url:"/formTemplate",views:{bodyContainer:{templateUrl:"Templates/Form/formTemplateTable.html"}},data:{menuItems:["FormTemplates"]}}).state("formSearchTable",{url:"/formSearch",views:{bodyContainer:{templateUrl:"Templates/Form/formSearch.html"}},data:{menuItems:["SearchForm"]}}).state("formTemplateEdit",{url:"/formTemplate/:id",views:{bodyContainer:{templateUrl:"Templates/Form/formTemplateEdit.html"}},data:{menuItems:["FormTemplates"]}}).state("formTable",{url:"/form",views:{bodyContainer:{templateUrl:"Templates/Form/formTable.html"}},data:{menuItems:["MiscForms"]}}).state("formEdit",{url:"/form/:id",views:{bodyContainer:{templateUrl:"Templates/Form/formEdit.html"}},data:{menuItems:["MiscForms"]}}).state("timeReports",{url:"/timeReports",views:{bodyContainer:{templateUrl:"Templates/ManageTime/TimeReports/timeReports.html",controller:"TimeReportsController",controllerAs:"vm"}},data:{menuItems:["ManageTime"]}}).state("agreements",{url:"/agreements/",views:{bodyContainer:{templateUrl:"Templates/Agreements/agreements.html"}},data:{menuItems:["Agreements"]}}).state("agreementsEdit",{url:"/agreementsEdit/:id",views:{bodyContainer:{templateUrl:"Templates/Agreements/agreementsEdit.html"}},data:{menuItems:["Agreements"]}}).state("agreementCreateInvoice",{url:"/agreementInvoice/:agreementId",views:{bodyContainer:{templateUrl:"Templates/Agreements/agreementInvoiceForm.html"}},data:{menuItems:["Agreements"]}}).state("agreementEditInvoice",{url:"/agreementInvoice/:id/:agreementId",views:{bodyContainer:{templateUrl:"Templates/Agreements/agreementInvoiceForm.html"}},data:{menuItems:["Agreements"]}}).state("agreementAddSite",{url:"/agreementSite/:id/:agreementId",views:{bodyContainer:{templateUrl:"Templates/Agreements/agreementSiteEdit.html"}},data:{menuItems:["Agreements"]}}).state("agreementAddServiceableItem",{url:"/agreementServiceableItem/:id/:agreementId",views:{bodyContainer:{templateUrl:"Templates/Agreements/agreementServiceableItemEdit.html"}},data:{menuItems:["Agreements"]}}).state("assignmentDetailsReadOnly",{url:"/assignmentDetailsReadOnly/:id/:assId",views:{bodyContainer:{templateUrl:"Templates/WorkOrder/MyWorkOrder/assignmentDetailsReadOnly.html"}},data:{menuItems:["AssignmentsDetails"]}}).state("newCompany",{url:"/master-tables/newCompany/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/CompanyInfo/newCompany.html"}},data:{menuItems:["CreateCompany"]}}).state("subscriptionPlan",{url:"/subscriptionPlan/",views:{bodyContainer:{templateUrl:"Templates/Subscription/SubscriptionPlan/subscriptionPlan.html"}},data:{menuItems:["SubscriptionPlan"]}}).state("subscriptionPlanEdit",{url:"/subscriptionPlanEdit/:id",views:{bodyContainer:{templateUrl:"Templates/Subscription/SubscriptionPlan/subscriptionPlanEdit.html"}},data:{menuItems:["SubscriptionPlan"]}}).state("subscriptionUserBased",{url:"/subscriptionUserBased/:id",views:{bodyContainer:{templateUrl:"Templates/Subscription/SubscriptionUserBased/subscriptionUserBased.html"}},data:{menuItems:["Subscriptions"]}}).state("subscriptionTransactionBased",{url:"/subscriptionTransactionBased/:id",views:{bodyContainer:{templateUrl:"Templates/Subscription/SubscriptionTransactionBased/subscriptionTransactionBased.html"}},data:{menuItems:["Subscriptions"]}}).state("subscription",{url:"/subscription/:id",views:{bodyContainer:{templateUrl:"Templates/Subscription/subscriptions.html"}},data:{menuItems:["Subscriptions"]}}).state("subscriptionEdit",{url:"/subscriptionEdit/:id",views:{bodyContainer:{templateUrl:"Templates/Subscription/subscriptionEdit.html"}}}).state("companypayments",{url:"/companypayments/:id",views:{bodyContainer:{templateUrl:"Templates/Subscription/Payments/companypayments.html"}}}).state("companySettings",{url:"/companySettings",views:{bodyContainer:{templateUrl:"Templates/MasterTables/CompanySettings/companySettings.html"}},data:{menuItems:["CompanySettings"]}}).state("PM",{url:"/PreventativeMaintenance",views:{bodyContainer:{templateUrl:"Templates/PM/pmTable.html"}},data:{menuItems:["PM"]}}).state("pmEdit",{url:"/PreventativeMaintenanceEdit/:id",views:{bodyContainer:{templateUrl:"Templates/PM/pmEdit.html"}},data:{menuItems:["PM"]}}).state("generateWorkOrdersforPMPlans",{url:"/GenerateWorkOrdersforPMPlans",views:{bodyContainer:{templateUrl:"Templates/PM/generateWorkOrdersforPMPlans.html"}},data:{menuItems:["PM"]}}).state("vendors",{url:"/Vendors",views:{bodyContainer:{templateUrl:"Templates/Vendor/vendorTable.html"}},data:{menuItems:["Vendor"]}}).state("vendorEdit",{url:"/vendorEdit/:id",views:{bodyContainer:{templateUrl:"Templates/Vendor/vendorEdit.html"}},data:{menuItems:["Vendor"]}}).state("projects",{url:"/Projects",views:{bodyContainer:{templateUrl:"Templates/Projects/projectTable.html"}},data:{menuItems:["Projects"]}}).state("projectEdit",{url:"/projectEdit/:id",views:{bodyContainer:{templateUrl:"Templates/Projects/projectEdit.html"}},data:{menuItems:["Projects"]}}).state("addWoProject",{url:"/addWoProject/:id",views:{bodyContainer:{templateUrl:"Templates/Projects/addWoProject.html"}},data:{menuItems:["Projects"]}}).state("rolePermission",{url:"/RolePermission",views:{bodyContainer:{templateUrl:"Templates/RolePermission/rolePermission.html"}},data:{menuItems:["Role"]}}).state("impersonation",{url:"/Impersonation",views:{bodyContainer:{templateUrl:"Templates/Impersonation/impersonation.html"}},data:{menuItems:["Impersonation"]}}).state("userSetting",{url:"/userSetting",views:{bodyContainer:{templateUrl:"Templates/MasterTables/User/userSetting.html"}}}).state("applicationSettings",{url:"/applicationSettings",views:{bodyContainer:{templateUrl:"Templates/MasterTables/ApplicationSettings/applicationSettings.html"}}}).state("views",{url:"/views/",views:{bodyContainer:{templateUrl:"Templates/Views/views.html"}},data:{menuItems:["Views"]}}).state("customerServiceRequestEdit",{url:"/serviceStatusEdit/:id",views:{bodyContainer:{templateUrl:"Templates/ServiceRequest/serviceRequestEdit.html"}},data:{menuItems:["ServiceRequest"]}}).state("customerServiceRequestNew",{url:"/serviceStatusEdit/",views:{bodyContainer:{templateUrl:"Templates/ServiceRequest/serviceRequestEdit.html"}},data:{menuItems:["ServiceRequest"]}}).state("serviceRequestEdit",{url:"/serviceStatusEdit/:id",views:{bodyContainer:{templateUrl:"Templates/ServiceRequest/serviceRequestEdit.html"}},data:{menuItems:["ProcessServiceRequest"]}}).state("serviceRequest",{url:"/serviceStatus/",views:{bodyContainer:{templateUrl:"Templates/ServiceRequest/serviceRequest.html"}},data:{menuItems:["ServiceRequest"]}}).state("customerUserTable",{url:"/master-tables/customerUsers",views:{bodyContainer:{templateUrl:"Templates/MasterTables/CustomerUser/customerUserTable.html"},data:{menuItems:["CustomerUsers"]}}}).state("customerUserEdit",{url:"/master-tables/customerUserEdit/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/CustomerUser/customerUserEdit.html"}},data:{menuItems:["CustomerUsers"]}}).state("companyFeature",{url:"/CompanyFeature",views:{bodyContainer:{templateUrl:"Templates/CompanyFeature/companyFeature.html"}},data:{menuItems:["CompanyFeature"]}}).state("processServiceRequest",{url:"/processServiceRequest/",views:{bodyContainer:{templateUrl:"Templates/ServiceRequest/processServiceRequest.html"}},data:{menuItems:["ProcessServiceRequest"]}}).state("serviceRequestReadOnly",{url:"/serviceRequestReadOnly/:id",views:{bodyContainer:{templateUrl:"Templates/ServiceRequest/serviceRequestReadOnly.html"}},data:{menuItems:["ProcessServiceRequest"]}}).state("serviceRequestCustomerReadOnly",{url:"/serviceRequestReadOnly/:id",views:{bodyContainer:{templateUrl:"Templates/ServiceRequest/serviceRequestReadOnly.html"}},data:{menuItems:["ServiceRequest"]}}).state("customerUserSites",{url:"/customerUserSites",views:{bodyContainer:{templateUrl:"Templates/MasterTables/CustomerSite/CustomerSiteTable.html"}},data:{menuItems:["CustomerUserSites"]}}).state("customerUserSitesAgreementReadOnly",{url:"/customerUserSitesAgreementReadOnly/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/CustomerSite/CustomerSiteAgreement.html"}},data:{menuItems:["CustomerUserSites"]}}).state("workOrderReport",{url:"/BaseReport/workOrderReport",views:{bodyContainer:{templateUrl:"Templates/BaseReports/workOrderReport.html"}},data:{menuItems:["WorkOrderReport"]}}).state("baseReports",{url:"/BaseReport/baseReports",views:{bodyContainer:{templateUrl:"Templates/BaseReports/baseReports.html"}},data:{menuItems:["BaseReports"]}}).state("serviceableItemReport",{url:"/BaseReport/ServiceableItemReport",views:{bodyContainer:{templateUrl:"Templates/BaseReports/serviceableItemReport.html"}},data:{menuItems:["ServiceableItemReport"]}}).state("timeCardReport",{url:"/BaseReport/TimeCardReport",views:{bodyContainer:{templateUrl:"Templates/BaseReports/timeCardReport.html"}},data:{menuItems:["TimeCardReport"]}}).state("dashboard",{url:"/AdvancedReport/Dashboard",views:{bodyContainer:{templateUrl:"Templates/AdvancedReports/dashboard.html"}},data:{menuItems:["Dashboard"]}}).state("quotePriority",{url:"/reference-tables/quotePriority",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/QuotePriority/quotePriorityTable.html"}}}).state("quotePriorityEdit",{url:"/reference-tables/quotePriority/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/QuotePriority/quotePriorityEdit.html"}}}).state("newQuote",{url:"/newquote",views:{bodyContainer:{templateUrl:"Templates/Quote/quoteEdit.html"}},data:{menuItems:["NewQuote"]}}).state("manageQuote",{url:"/quote",views:{bodyContainer:{templateUrl:"Templates/Quote/manageQuotes.html"}},data:{menuItems:["ManageQuotes"]}}).state("quoteDetails",{url:"/quote/:id",views:{bodyContainer:{templateUrl:"Templates/Quote/quoteEdit.html"}},data:{menuItems:["QuoteDetails"]}}).state("customerUsersServiceableItems",{url:"/customerUserServiceableItems",views:{bodyContainer:{templateUrl:"Templates/MasterTables/CustomerServiceableitemNew/customerServiceableItemTable.html"}},data:{menuItems:["CustomerUserServiceableItems"]}}).state("customerServiceableItemsDetail",{url:"/customerUserServiceableItemsDetail/:customerId/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/CustomerServiceableitemNew/customerServiceableItemsReadOnly.html"}},data:{menuItems:["CustomerUserServiceableItems"]}}).state("leadSourceTable",{url:"/reference-tables/leadSource",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/LeadSource/leadSourceTable.html"}},data:{menuItems:["RefLeadSource"]}}).state("leadSourceTableEdit",{url:"/reference-tables/leadSource/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/LeadSource/leadSourceEdit.html"}},data:{menuItems:["RefLeadSource"]}}).state("bundle",{url:"/bundle",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Bundle/bundleTable.html"}},data:{menuItems:["Bundle"]}}).state("bundleEdit",{url:"/bundle/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/Bundle/bundleEdit.html"}},data:{menuItems:["Bundle"]}}).state("ReportBuilder",{url:"/ReportBuilder/",views:{bodyContainer:{templateUrl:"Templates/ReportBuilder/ReportBuilder.html"}},data:{menuItems:["ReportBuilder"]}}).state("reportBuilderEdit",{url:"/ReportBuilderEdit/:id",views:{bodyContainer:{templateUrl:"Templates/ReportBuilder/ReportBuilderEdit.html"}},data:{menuItems:["ReportBuilder"]}}).state("dslServiceOrderTypeTable",{url:"/reference-tables/DSLNorthwest",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslServiceOrderTypeTable.html"}},data:{menuItems:["RefDSLServiceOrderType"]}}).state("dslServiceOrderTypeTableEdit",{url:"/reference-tables/DSLNorthwest/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslServiceOrderTypeEdit.html"}},data:{menuItems:["RefDSLServiceOrderType"]}}).state("dslServiceZoneCodeTable",{url:"/reference-tables/DSLNorthwest",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslServiceZoneCodeTable.html"}},data:{menuItems:["RefDSLServiceZoneCode"]}}).state("dslServiceZoneCodeTableEdit",{url:"/reference-tables/DSLNorthwest/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslServiceZoneCodeEdit.html"}},data:{menuItems:["RefDSLServiceZoneCode"]}}).state("dslFailureResolutionTable",{url:"/reference-tables/DSLNorthwest",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslFailureResolutionTable.html"}},data:{menuItems:["RefDSLFailureResolution"]}}).state("dslFailureResolutionTableEdit",{url:"/reference-tables/DSLNorthwest/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslFailureResolutionEdit.html"}},data:{menuItems:["RefDSLFailureResolution"]}}).state("dslPartsReceivedTable",{url:"/reference-tables/DSLNorthwest",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslPartsReceivedTable.html"}},data:{menuItems:["RefDSLPartsReceived"]}}).state("dslPartsReceivedTableEdit",{url:"/reference-tables/DSLNorthwest/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslPartsReceivedEdit.html"}},data:{menuItems:["RefDSLPartsReceived"]}}).state("dslRecallDueToTable",{url:"/reference-tables/DSLNorthwest",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslRecallDueToTable.html"}},data:{menuItems:["RefDSLRecallDueTo"]}}).state("dslRecallDueToTableEdit",{url:"/reference-tables/DSLNorthwest/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslRecallDueToEdit.html"}},data:{menuItems:["RefDSLDistributor"]}}).state("dslDistributorTable",{url:"/reference-tables/DSLNorthwest",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslDistributorTable.html"}},data:{menuItems:["RefDSLDistributor"]}}).state("dslDistributorTableEdit",{url:"/reference-tables/DSLNorthwest/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslDistributorEdit.html"}},data:{menuItems:["RefDSLDistributor"]}}).state("dslInventoryPostingGroupTable",{url:"/reference-tables/DSLNorthwest",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslInventoryPostingGroupTable.html"}},data:{menuItems:["RefDSLInventoryPostingGroup"]}}).state("dslInventoryPostingGroupTableEdit",{url:"/reference-tables/DSLNorthwest/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslInventoryPostingGroupEdit.html"}},data:{menuItems:["RefDSLInventoryPostingGroup"]}}).state("dslServiceZoneLaborCodeTable",{url:"/reference-tables/DSLNorthwest",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslServiceZoneLaborCodeTable.html"}},data:{menuItems:["RefDSLServiceZoneLaborCode"]}}).state("dslServiceZoneLaborCodeTableEdit",{url:"/reference-tables/DSLNorthwest/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslServiceZoneLaborCodeEdit.html"}},data:{menuItems:["RefDSLServiceZoneLaborCode"]}}).state("dslActionTakenTable",{url:"/reference-tables/DSLActionTaken",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslActionTakenTable.html"}},data:{menuItems:["RefDSLActionTaken"]}}).state("dslActionTakenTableEdit",{url:"/reference-tables/DSLActionTaken/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslActionTakenEdit.html"}},data:{menuItems:["RefDSLActionTaken"]}}).state("dslFaultAreasTable",{url:"/reference-tables/DSLFaultAreas",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslFaultAreasTable.html"}},data:{menuItems:["RefDSLFaultAreas"]}}).state("dslFaultAreasTableEdit",{url:"/reference-tables/DSLFaultAreras/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslFaultAreasEdit.html"}},data:{menuItems:["RefDSLFaultAreas"]}}).state("dslApplicableCodeTable",{url:"/reference-tables/DSLApplicableCode",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslApplicableCodeTable.html"}},data:{menuItems:["RefDSLApplicableCode"]}}).state("dslApplicableCodeTableEdit",{url:"/reference-tables/DSLApplicableCode/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslApplicableCodeEdit.html"}},data:{menuItems:["RefDSLApplicableCode"]}}).state("dslInstalledRemovedTable",{url:"/reference-tables/DSLInstalledRemoved",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslInstalledRemovedTable.html"}},data:{menuItems:["RefDSLInstalledRemoved"]}}).state("dslInstalledRemovedTableEdit",{url:"/reference-tables/DSLInstalledRemoved/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslInstalledRemovedEdit.html"}},data:{menuItems:["RefDSLInstalledRemoved"]}}).state("dslWhoPaysTable",{url:"/reference-tables/DSLWhoPays",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslWhoPaysTable.html"}},data:{menuItems:["RefDSLWhoPays"]}}).state("dslWhoPaysTableEdit",{url:"/reference-tables/DSLWhoPays/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DSLNorthwest/dslWhoPaysEdit.html"}},data:{menuItems:["RefDSLWhoPays"]}}).state("laborRoundingTable",{url:"/master-tables/LaborRounding",views:{bodyContainer:{templateUrl:"Templates/MasterTables/LaborRounding/laborRoundingTable.html"}},data:{menuItems:["LaborRounding"]}}).state("laborRoundingTableEdit",{url:"/master-tables/LaborRounding/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/LaborRounding/laborRoundingEdit.html"}},data:{menuItems:["LaborRounding"]}}).state("eventDebugLog",{url:"/events/EventDebugLog",views:{bodyContainer:{templateUrl:"Templates/Events/EventDebugLog/eventDebugLogTable.html"}},data:{menuItems:["EventDebugLog"]}}).state("eventLog",{url:"/events/EventLog",views:{bodyContainer:{templateUrl:"Templates/Events/EventLog/eventLogTable.html"}},data:{menuItems:["EventLog"]}}).state("dashboardChartTypeTable",{url:"/reference-tables/DashboardChartType",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DashboardChartType/dashboardChartTypeTable.html"}},data:{menuItems:["ReferenceTables"]}}).state("dashboardChartTypeTableEdit",{url:"/reference-tables/DashboardChartType/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DashboardChartType/dashboardChartTypeEdit.html"}},data:{menuItems:["ReferenceTables"]}}).state("dashboardReportTypeTable",{url:"/reference-tables/DashboardReportType",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DashboardReportType/dashboardReportTypeTable.html"}},data:{menuItems:["ReferenceTables"]}}).state("dashboardReportTypeTableEdit",{url:"/reference-tables/DashboardReportType/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DashboardReportType/dashboardReportTypeEdit.html"}},data:{menuItems:["ReferenceTables"]}}).state("dashboardReportsTable",{url:"/master-tables/DashboardReports",views:{bodyContainer:{templateUrl:"Templates/MasterTables/DashboardReports/dashboardReportsTable.html"}},data:{menuItems:["ReferenceTables"]}}).state("dashboardReportsTableEdit",{url:"/master-tables/DashboardReports/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/DashboardReports/dashboardReportsEdit.html"}},data:{menuItems:["ReferenceTables"]}}).state("dashboardFilterDDListTable",{url:"/reference-tables/DashboardFilterDDList",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DashboardFilterDDList/dashboardFilterDDListTable.html"}},data:{menuItems:["ReferenceTables"]}}).state("dashboardFilterDDListTableEdit",{url:"/reference-tables/DashboardFilterDDList/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DashboardFilterDDList/dashboardFilterDDListEdit.html"}},data:{menuItems:["ReferenceTables"]}}).state("dashboardConfigDDListTable",{url:"/reference-tables/DashboardConfigDDList",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DashboardConfigDDList/dashboardConfigDDListTable.html"}},data:{menuItems:["ReferenceTables"]}}).state("dashboardConfigDDListTableEdit",{url:"/reference-tables/DashboardConfigDDList/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DashboardConfigDDList/dashboardConfigDDListEdit.html"}},data:{menuItems:["ReferenceTables"]}}).state("dispatchCalendarThemesTable",{url:"/reference-tables/DispatchCalendarThemes",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DispatchCalendarThemes/dispatchCalendarThemesTable.html"}},data:{menuItems:["ReferenceTables"]}}).state("dispatchCalendarThemesTableEdit",{url:"/reference-tables/DispatchCalendarThemes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DispatchCalendarThemes/dispatchCalendarThemesEdit.html"}},data:{menuItems:["ReferenceTables"]}}).state("dispatchChartThemesTable",{url:"/reference-tables/DispatchChartThemes",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DispatchChartThemes/dispatchChartThemesTable.html"}},data:{menuItems:["ReferenceTables"]}}).state("dispatchChartThemesTableEdit",{url:"/reference-tables/DispatchChartThemes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DispatchChartThemes/dispatchChartThemesEdit.html"}},data:{menuItems:["ReferenceTables"]}}).state("dispatchMonthlyCalendarThemesTable",{url:"/reference-tables/DispatchMonthlyCalendarThemes",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DispatchMonthlyCalendarThemes/dispatchMonthlyCalendarThemesTable.html"}},data:{menuItems:["ReferenceTables"]}}).state("dispatchMonthlyCalendarThemesTableEdit",{url:"/reference-tables/DispatchMonthlyCalendarThemes/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DispatchMonthlyCalendarThemes/dispatchMonthlyCalendarThemesEdit.html"}},data:{menuItems:["ReferenceTables"]}}).state("defaultDispatchCalendarSettingsTable",{url:"/reference-tables/DefaultDispatchCalendarSettings",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DefaultDispatchCalendarSettings/defaultDispatchCalendarSettingsTable.html"}},data:{menuItems:["ReferenceTables"]}}).state("defaultDispatchCalendarSettingsTableEdit",{url:"/reference-tables/DefaultDispatchCalendarSettings/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DefaultDispatchCalendarSettings/defaultDispatchCalendarSettingsEdit.html"}},data:{menuItems:["ReferenceTables"]}}).state("defaultStartPageTable",{url:"/reference-tables/defaultStartPage",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DefaultStartPage/defaultStartPageTable.html"}},data:{menuItems:["ReferenceTables"]}}).state("defaultStartPageTableEdit",{url:"/reference-tables/defaultStartPage/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DefaultStartPage/defaultStartPageEdit.html"}},data:{menuItems:["ReferenceTables"]}}).state("defaultStartPageRole",{url:"/defaultStartPage",views:{bodyContainer:{templateUrl:"Templates/MasterTables/DefaultStartPageRole/defaultStartPageRole.html"}},data:{menuItems:["DefaultStartPageRole"]}}).state("defaultStartPageRoleEdit",{url:"/defaultStartPage/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/DefaultStartPageRole/defaultStartPageRoleEdit.html"}},data:{menuItems:["DefaultStartPageRole"]}}).state("standardTask",{url:"/master-tables/standardtask",views:{bodyContainer:{templateUrl:"Templates/MasterTables/StandardTask/standardTask.html"}},data:{menuItems:["StandardTasks"]}}).state("standardTaskEdit",{url:"/master-tables/standardtask/:id",views:{bodyContainer:{templateUrl:"Templates/MasterTables/StandardTask/standardTaskEdit.html"}},data:{menuItems:["StandardTasks"]}}).state("paymentTable",{url:"/payment",views:{bodyContainer:{templateUrl:"Templates/Payment/paymentTable.html"}},data:{menuItems:["FCPayments"]}}).state("paymentTableEdit",{url:"/payment/:id",views:{bodyContainer:{templateUrl:"Templates/Payment/paymentTableEdit.html"}},data:{menuItems:["FCPayments"]}}).state("smtpSettings",{url:"/master-tables/smtpSettings",views:{bodyContainer:{templateUrl:"Templates/MasterTables/SMTPSettings/smtpSettings.html"}},data:{menuItems:["SMTPSettings"]}}).state("unavailablePayRate",{url:"/reference-tables/unavailablePayRate",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/UnavailablePayRate/unavailablePayRate.html"}},data:{menuItems:["UnavailablePayRates"]}}).state("unavailablePayRateEdit",{url:"/reference-tables/unavailablePayRate/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/UnavailablePayRate/unavailablePayRateEdit.html"}},data:{menuItems:["UnavailablePayRates"]}}).state("deficiencyStatusActionTable",{url:"/reference-tables/deficiencyStatusAction",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DeficiencyStatusAction/deficiencyStatusActionTable.html"}},data:{menuItems:["RefDeficiencyStatusAction"]}}).state("deficiencyStatusActionEdit",{url:"/reference-tables/defiencyStatusAction/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DeficiencyStatusAction/deficiencyStatusActionEdit.html"}},data:{menuItems:["RefDeficiencyStatusAction"]}}).state("deficiencyStatusTable",{url:"/reference-tables/deficiencyStatus",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DeficiencyStatus/deficiencyStatusTable.html"}},data:{menuItems:["RefDeficiencyStatus"]}}).state("deficiencyStatusEdit",{url:"/reference-tables/defiencyStatus/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DeficiencyStatus/deficiencyStatusEdit.html"}},data:{menuItems:["RefDeficiencyStatus"]}}).state("deficiencySeverityTable",{url:"/reference-tables/deficiencySeverity",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DeficiencySeverity/deficiencySeverityTable.html"}},data:{menuItems:["RefDeficiencySeverity"]}}).state("deficiencySeverityEdit",{url:"/reference-tables/defiencySeverity/:id",views:{bodyContainer:{templateUrl:"Templates/ReferenceTables/DeficiencySeverity/deficiencySeverityEdit.html"}},data:{menuItems:["RefDeficiencySeverity"]}}).state("manageDeficiency",{url:"/manageDeficiency",views:{bodyContainer:{templateUrl:"Templates/Deficiency/manageDeficiency.html"}},data:{menuItems:["ManageDeficiencies"]}}).state("deficiencyEdit",{url:"/manageDeficiency/defiency/:id",views:{bodyContainer:{templateUrl:"Templates/Deficiency/deficiencyEdit.html"}},data:{menuItems:["ManageDeficiencies"]}})}angular.module("FieldConnectApp").config(t).run(e),e.$inject=["$state","cryptoStorageService","$rootScope","$timeout","authService","$window","$location","ngAuthSettings"],t.$inject=["$stateProvider","$locationProvider","$httpProvider","offlineServiceProvider","ngAuthSettings","$urlMatcherFactoryProvider","$urlRouterProvider","$cryptoProvider","localStorageServiceProvider"]}();;angular.module("FieldConnectApp").run(["$templateCache",function(e){"use strict";e.put("Templates/home.html",'<div class="row">\r\n    <div class="middle-login">\r\n        <div class="block-flat">\r\n            <div class="header">\r\n                <h3 class="text-center">\r\n                    Welcome to {{vm.welcomeMsg}}\r\n                </h3>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>'),e.put("Templates/login.html",'<!DOCTYPE html>\r\n<html lang="en">\r\n  <head>\r\n    <meta charset="utf-8">\r\n    <meta name="viewport" content="width=device-width, initial-scale=1.0">\r\n    <meta name="description" content="">\r\n    <meta name="author" content="">\r\n    <link rel="shortcut icon" href="../Content/img/favicon.ico">\r\n    <title>Login</title>\r\n    <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,400italic,700,800" rel="stylesheet" type="text/css">\r\n    <link href="https://fonts.googleapis.com/css?family=Raleway:300,200,100" rel="stylesheet" type="text/css">\r\n    <link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700" rel="stylesheet" type="text/css">\r\n    <link href="../Scripts/lib/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">\r\n    <link rel="stylesheet" href="../Scripts/lib/font-awesome/css/font-awesome.min.css">\r\n    \x3c!--if lt IE 9script(src=\'https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js\')\r\n    --\x3e\r\n    <link rel="stylesheet" type="text/css" href="../Scripts/lib/jquery.nanoscroller/css/nanoscroller.css">\r\n    <link href="../Content/css/style.css" rel="stylesheet">\r\n    \r\n     \r\n    \x3c!-- custom css FC --\x3e\r\n    <link rel="stylesheet" type="text/css" href="../Content/css/fc_css.css">\r\n    \x3c!-- custom css FC --\x3e\r\n\r\n\r\n  </head>\r\n  <body>\r\n    <div id="cl-wrapper" class="login-container">\r\n      <div class="middle-login">\r\n        <div class="block-flat">\r\n          <div class="header">\r\n            <h3 class="text-center"><img src="../Content/img/logo.jpg" alt="logo" class="logo-img"></h3>\r\n          </div>\r\n          <div>\r\n            <form style="margin-bottom: 0px !important;" action="../index.html" class="form-horizontal">\r\n              <div class="content"> \r\n                <div class="form-group">\r\n                  <div class="col-sm-12">\r\n                    <div class="input-group"><span class="input-group-addon"><i class="fa fa-user"></i></span>\r\n                      <input id="username" type="text" placeholder="Username" class="form-control">\r\n                    </div>\r\n                  </div>\r\n                </div>\r\n                <div class="form-group">\r\n                  <div class="col-sm-12">\r\n                    <div class="input-group"><span class="input-group-addon"><i class="fa fa-lock"></i></span>\r\n                      <input id="password" type="password" placeholder="Password" class="form-control">\r\n                    </div>\r\n                  </div>\r\n                </div>\r\n              </div>\r\n              <div class="foot">\r\n                <button data-dismiss="modal" type="button" class="btn btn-default">Cancel</button>\r\n                <button data-dismiss="modal" type="submit" class="btn btn-primary">Log In</button> \r\n                \r\n               <div class="form-group">\r\n                  <div class="col-sm-12 text-left">\r\n                     <label>\r\n                     <input type="checkbox" class="icheck"> I\'ve forgotten my password\r\n                  </label> \r\n                  </div>\r\n                </div> \r\n                \r\n                <div class="form-group">\r\n                  <div class="col-sm-12">\r\n                    <div class="input-group"><span class="input-group-addon"><i class="fa fa-envelope"></i></span>\r\n                      <input id=" " type="text" placeholder="Email" class="form-control">\r\n                    </div>\r\n                  </div>\r\n                </div>\r\n                 \r\n              </div> \r\n            </form>\r\n          </div>\r\n        </div>\r\n        <div class="text-center out-links"><a href="#">&copy; 2016 FieldConnect</a></div>\r\n      </div>\r\n    </div>\r\n    <script type="text/javascript" src="../Scripts/lib/jquery/jquery.min.js"><\/script>\r\n    <script type="text/javascript" src="../Scripts/lib/jquery.nanoscroller/javascripts/jquery.nanoscroller.js"><\/script>\r\n    <script type="text/javascript" src="../Scripts/js/cleanzone.js"><\/script>\r\n    <script src="../Scripts/lib/bootstrap/dist/js/bootstrap.min.js"><\/script>\r\n    <script src="../Scripts/js/voice-recognition.js"><\/script>\r\n    <script type="text/javascript">\r\n      $(document).ready(function(){\r\n      \t//initialize the javascript\r\n      \tApp.init();\r\n      });\r\n      \r\n    <\/script>\r\n  </body>\r\n</html>'),e.put("Templates/menu.html",'<div id="head-nav" class="navbar navbar-default navbar-fixed-top" ng-init="vm.activate();">\r\n    <div class="container-fluid">\r\n        <div class="navbar-header">\r\n            <button type="button" data-toggle="collapse" data-target=".navbar-collapse" class="navbar-toggle">\r\n                <span class="fa fa-gear"></span>\r\n            </button><a href="#" class="navbar-brand">\r\n                <span>\r\n                    <img ng-if="vm.isCustomer" ng-src="data:image/jpeg;base64, {{vm.logo}}" height="33" alt="Field Connect">\r\n                    <img ng-if="!vm.isCustomer" src="Content/img/logo.jpg" width="226" height="33" alt="Field Connect">\r\n                </span>\r\n            </a>\r\n        </div>\r\n        <div class="navbar-collapse collapse" id="small-screen-menu">\r\n            <ul class="nav navbar-nav">\r\n                <li data-main-menu-item="Dashboard">\r\n                    <a class="cursor_pointer" ng-click="vm.goToDashboard()">Dashboard</a>\r\n                </li>\r\n                <li class="dropdown" data-main-menu-item="ServiceGroup">\r\n                    <a class="dropdown-toggle cursor_pointer">Service <b class="caret"></b></a>\r\n                    <ul class="dropdown-menu">\r\n                        \x3c!-- PBI1024 : FCO - Service Request functionality for Dispatch/Admin/Office - GroundBreakers --\x3e\r\n                        \x3c!-- <li data-main-menu-item="ServiceRequest"><a class="cursor_pointer" ng-click="vm.goToServiceRequestEdit()">Request Service</a></li> --\x3e\r\n                        <li data-main-menu-item="ServiceRequest" ng-if="vm.isCustomer"><a class="cursor_pointer" ng-click="vm.goToServiceRequestEdit()">Request Service</a></li>\r\n                        <li data-main-menu-item="ServiceStatus"><a class="cursor_pointer" ng-click="vm.goToServiceRequest()">Service Status</a></li>\r\n                        <li data-main-menu-item="CustomerUserSites"><a class="cursor_pointer" ng-click="vm.goToCustomerUserSites()">Sites</a></li>\r\n                        \x3c!-- US2564 : FCO - Web - Customer Portal - 3.3.5.5 Site Serviceable Items (FCWO-1896) --\x3e\r\n                        <li data-main-menu-item="CustomerUserServiceableItems"><a class="cursor_pointer" ng-click="vm.goToCustomerUserServiceableItems()">Serviceable Items</a></li>\r\n                        \x3c!-- US2564 : END --\x3e\r\n                        <li data-main-menu-item="MyAssignments" ng-if="vm.isTech"><a class="cursor_pointer" ng-click="vm.goToMyWorkOrder()">My Assignments</a></li>\r\n                        <li data-main-menu-item="NewWorkOrder"><a class="cursor_pointer" ng-click="vm.goToNewWorkOrder()">New Work Order</a></li>\r\n                        <li data-main-menu-item="ManageWorkOrders"><a class="cursor_pointer" ng-click="vm.goToManageWorkOrder()">Manage Work Orders</a></li>\r\n                        \x3c!-- PBI1098 : FCO - Deficiency loop (pull through work) --\x3e\r\n                        <li data-main-menu-item="ManageDeficiencies"><a class="cursor_pointer" ng-click="vm.goToManageDeficiencies()">Manage Deficiencies</a></li>\r\n                        <li data-main-menu-item="NewQuote"><a class="cursor_pointer" ng-click="vm.goToNewQuote()">New Quote</a></li>\r\n                        <li data-main-menu-item="ManageQuotes"><a class="cursor_pointer" ng-click="vm.goToManageQuotes()">Manage Quotes</a></li>\r\n                        \x3c!-- PBI1024 : FCO - Service Request functionality for Dispatch/Admin/Office - GroundBreakers --\x3e\r\n                        \x3c!-- <li data-main-menu-item="ProcessServiceRequest"><a class="cursor_pointer" ng-click="vm.goToProcessServiceRequest()">Process Service Request</a></li> --\x3e\r\n                        <li data-main-menu-item="ServiceRequestkGroup" class="dropdown-submenu" ng-if="!vm.isCustomer">\r\n                            <a class="cursor_pointer">Service Request</a>\r\n                            <ul class="dropdown-menu">\r\n                                <li data-main-menu-item="ServiceRequest"><a class="cursor_pointer" ng-click="vm.goToServiceRequestEdit()">Request Service</a></li>\r\n                                <li data-main-menu-item="ProcessServiceRequest"><a class="cursor_pointer" ng-click="vm.goToProcessServiceRequest()">Process Service Request</a></li>\r\n                            </ul>\r\n                        </li>\r\n                        <li data-main-menu-item="FormsHeading" class="dropdown-submenu">\r\n                            <a class="cursor_pointer">Forms</a>\r\n                            <ul class="dropdown-menu">\r\n                                <li data-main-menu-item="SearchForm"><a class="cursor_pointer" ng-click="vm.goToFormSearchTable()">Search Forms</a></li>\r\n                                <li data-main-menu-item="MiscForms"><a class="cursor_pointer" ng-click="vm.goToForms()">Misc Forms</a></li>\r\n                            </ul>\r\n                        </li>\r\n                        <li data-main-menu-item="SubContractorWorkGroup" class="dropdown-submenu">\r\n                            <a class="cursor_pointer">SubContractor Work</a>\r\n                            <ul class="dropdown-menu">\r\n                                <li data-main-menu-item="SubContractorList"><a class="cursor_pointer" ng-click="vm.goToSubContractorlist()">SubContractor List</a></li>\r\n                                <li data-main-menu-item="AwardWork"><a class="cursor_pointer" ng-click="vm.goToSubcontractorAwardWork()">Award Work</a></li>\r\n                                <li data-main-menu-item="AcceptWork"><a class="cursor_pointer" ng-click="vm.goToSubcontractorAcceptWork()">Accept Work</a></li>\r\n                                <li data-main-menu-item="Bills"><a class="cursor_pointer" ng-click="vm.goToBills()">Bills</a></li>\r\n                            </ul>\r\n                        </li>\r\n                        <li data-main-menu-item="Invoicing"><a class="cursor_pointer" ng-click="vm.goToInvoiceReview()">Invoicing</a></li>\r\n                        \x3c!-- PBI1043 : FCO - FCPayments --\x3e\r\n                        <li data-main-menu-item="FCPayments"><a class="cursor_pointer" ng-click="vm.goToPayment()">Payment</a></li>\r\n                    </ul>\r\n                </li>\r\n                <li class="dropdown" data-main-menu-item="DispatchGroup">\r\n                    <a class="dropdown-toggle cursor_pointer">Dispatch <b class="caret"></b></a>\r\n                    <ul class="dropdown-menu">\r\n                        <li data-main-menu-item="DispatchCalendar"><a class="cursor_pointer" ng-click="vm.goToDispatchCalendar()">Dispatch Calendar</a></li>\r\n                        <li data-main-menu-item="Scheduling"><a class="cursor_pointer" ng-click="vm.goToScheduling()">Scheduling</a></li>\r\n                        <li data-main-menu-item="Map"><a class="cursor_pointer" ng-click="vm.goToDispatchMap()">Map</a></li>\r\n                        <li data-main-menu-item="TechUnavailable"><a class="cursor_pointer" ng-click="vm.goToTechUnavailable()">Tech Unavailable</a></li>\r\n                        <li data-main-menu-item="Messaging"><a class="cursor_pointer" ng-click="vm.goToMessaging()">Messaging</a></li>\r\n                    </ul>\r\n                </li>\r\n                <li class="dropdown" data-main-menu-item="ManagementGroup">\r\n                    <a class="dropdown-toggle cursor_pointer">Management <b class="caret"></b></a>\r\n                    <ul class="dropdown-menu">\r\n                        <li data-main-menu-item="ManageTime"><a class="cursor_pointer" ng-click="vm.goToTimeReports()">Time Reports</a></li>\r\n                        <li data-main-menu-item="UnappliedTime"><a class="cursor_pointer" ng-click="vm.goToUnappliedTime()">Unapplied Time</a></li>\r\n                        <li data-main-menu-item="ManageCrews"><a class="cursor_pointer" ng-click="vm.goToCrew()">Crews</a></li>\r\n                        <li class="dropdown-submenu" data-main-menu-item="ManageCustomersGroup">\r\n                            <a class="cursor_pointer">Customers</a>\r\n                            <ul class="dropdown-menu">\r\n                                <li data-main-menu-item="Customer"><a class="cursor_pointer" ng-click="vm.goToCustomer()">Customer</a></li>\r\n                                <li data-main-menu-item="Sites"><a class="cursor_pointer" ng-click="vm.goToSite()">Sites</a></li>\r\n                                <li data-main-menu-item="ServiceableItems"><a class="cursor_pointer" ng-click="vm.goToServiceableItems()">Serviceable Items</a></li>\r\n                            </ul>\r\n                        </li>\r\n                        <li class="dropdown-submenu" data-main-menu-item="PMGroup">\r\n                            <a class="cursor_pointer">PM</a>\r\n                            <ul class="dropdown-menu">\r\n                                <li data-main-menu-item="PM"><a class="cursor_pointer" ng-click="vm.goToPM()">PM Plans</a></li>\r\n                                <li data-main-menu-item="GenerateWOs"><a class="cursor_pointer" ng-click="vm.goToGenerateWOs()">Generate WOs</a></li>\r\n                            </ul>\r\n                        </li>\r\n                        <li class="dropdown-submenu" data-main-menu-item="AgreementsGroup">\r\n                            <a class="cursor_pointer">Agreements</a>\r\n                            <ul class="dropdown-menu">\r\n                                <li data-main-menu-item="Agreements"><a class="cursor_pointer" ng-click="vm.goToAgreements()">Agreements</a></li>\r\n                                <li data-main-menu-item="AgreementTypes"><a class="cursor_pointer" ng-click="vm.goToAgreementType()">Agreement Types</a></li>\r\n                            </ul>\r\n                        </li>\r\n                        <li class="dropdown-submenu" data-main-menu-item="ManageInventoryGroup">\r\n                            <a class="cursor_pointer">Inventory</a>\r\n                            <ul class="dropdown-menu">\r\n                                <li data-main-menu-item="PartsAndMisc"><a class="cursor_pointer" ng-click="vm.goToItems()">Parts  &amp;  Misc</a></li>\r\n                            </ul>\r\n                        </li>\r\n                        <li class="dropdown-submenu" data-main-menu-item="ManageLaborGroup">\r\n                            <a class="cursor_pointer">Labor</a>\r\n                            <ul class="dropdown-menu">\r\n                                <li data-main-menu-item="Skills"><a class="cursor_pointer" ng-click="vm.goToSkillTech()">Skills</a></li>\r\n                                <li data-main-menu-item="LaborGroups"><a class="cursor_pointer" ng-click="vm.goToLaborGroupTech()">Labor Groups </a></li>\r\n                                <li data-main-menu-item="PayRates"><a class="cursor_pointer" ng-click="vm.goToPayRates()">Pay Rates</a></li>\r\n                                \x3c!-- PBI1097 : FCO - Unavailable time: create time entry --\x3e\r\n                                <li data-main-menu-item="UnavailablePayRates"><a class="cursor_pointer" ng-click="vm.goToUnavailablePayRates()">Unavailable Pay Rates</a></li>\r\n                            </ul>\r\n                        </li>\r\n                        <li><a class="cursor_pointer" ng-if="vm.equipmentAuth" ng-click="vm.goToEquipment()">Equipment</a></li>\r\n                        <li data-main-menu-item="ManageRateSheets"><a class="cursor_pointer" ng-click="vm.goToRateSheet()">Rate Sheets</a></li>\r\n                        \x3c!-- PBI1044 : FCO - Work Order Tasks --\x3e\r\n                        <li class="dropdown-submenu" data-main-menu-item="ServiceGroup">\r\n                            <a class="cursor_pointer">Service</a>\r\n                            <ul class="dropdown-menu">\r\n                                <li data-main-menu-item="StandardTasks"><a class="cursor_pointer" ng-click="vm.goToStandardTask()">Standard Tasks</a></li>\r\n                            </ul>\r\n                        </li>\r\n                        <li data-main-menu-item="ManageSubContractors"><a class="cursor_pointer" ng-click="vm.goToSubcontractorCompany()">SubContractors</a></li>\r\n                        <li data-main-menu-item="Projects"><a class="cursor_pointer" ng-click="vm.goToProjects()">Projects</a></li>\r\n                        <li data-main-menu-item="Vendor"><a class="cursor_pointer" ng-click="vm.goToVendor()">Vendor</a></li>\r\n                        <li class="dropdown-submenu" data-main-menu-item="BaseReportGroup">\r\n                            <a class="cursor_pointer">Reporting</a>\r\n                            <ul class="dropdown-menu">\r\n                                <li data-main-menu-item="ReportBuilder"><a class="cursor_pointer" ng-click="vm.goToReportBuilder()">Report Builder</a></li>\r\n                                \x3c!-- PBI688 : FCO - Assignment Report - DSL-NW --\x3e\r\n                                <li data-main-menu-item="BaseReports"><a class="cursor_pointer" ng-click="vm.goToBaseReports()">Base Reports</a></li>\r\n                                \x3c!-- PBI688 : END --\x3e\r\n                                <li data-main-menu-item="WorkOrderReport"><a class="cursor_pointer" ng-click="vm.goToWorkOrderReport()">Work Order Report</a></li>\r\n                                <li data-main-menu-item="ServiceableItemReport"><a class="cursor_pointer" ng-click="vm.goToServiceableItemReport()">Serviceable Item Report</a></li>\r\n                                <li data-main-menu-item="TimeCardReport"><a class="cursor_pointer" ng-click="vm.goToTimeCardReport()">Time Card Report</a></li>\r\n                            </ul>\r\n                        </li>\r\n                        \x3c!-- US2819 : FCO - Web - Bundles --\x3e\r\n                        <li data-main-menu-item="Bundle"><a class="cursor_pointer" ng-click="vm.goToBundles()">Bundles</a></li>\r\n                    </ul>\r\n                </li>\r\n                <li class="dropdown" data-main-menu-item="AdminGroup">\r\n                    <a class="dropdown-toggle cursor_pointer">Admin <b class="caret"></b></a>\r\n                    <ul class="dropdown-menu">\r\n                        <li class="dropdown-submenu" data-main-menu-item="CompanySetupGroup">\r\n                            <a class="cursor_pointer">Company Setup </a>\r\n                            <ul class="dropdown-menu">\r\n                                <li data-main-menu-item="CompanyInfo"><a class="cursor_pointer" ng-click="vm.goToCompanyInfo()">Company Info</a></li>\r\n                                <li data-main-menu-item="Offices"><a class="cursor_pointer" ng-click="vm.goToOffice()">Offices</a></li>\r\n                                <li data-main-menu-item="CompanySettings"><a class="cursor_pointer" ng-click="vm.goToCompanySettings()">Company Settings</a></li>\r\n                                \x3c!-- PBI1086 : FCO - Email Settings (customer managed) --\x3e\r\n                                <li data-main-menu-item="SMTPSettings"><a class="cursor_pointer" ng-click="vm.goToSMTPSettings()">SMTP Settings</a></li>\r\n                                <li data-main-menu-item="Views"><a class="cursor_pointer" ng-click="vm.goToViews()">Views</a></li>\r\n                                <li data-main-menu-item="SalesTaxSetup"><a class="cursor_pointer" ng-click="vm.goToTaxRate()">Sales Tax Setup</a></li>\r\n                                <li data-main-menu-item="CompanyPayPeriod"><a class="cursor_pointer" ng-click="vm.goToCompanyPayPeriod()">Company Pay Period</a></li>\r\n                                \x3c!-- PBI717 : FCO - Labor time to round to nearest quarter hour - DSL-NW --\x3e\r\n                                <li data-main-menu-item="LaborRounding"><a class="cursor_pointer" ng-click="vm.goToLaborRounding()">Labor Rounding</a></li>\r\n                            </ul>\r\n                        </li>\r\n                        <li data-main-menu-item="Users"><a class="cursor_pointer" ng-click="vm.goToUsers()">Users</a></li>\r\n                        <li data-main-menu-item="Impersonation"><a class="cursor_pointer" ng-click="vm.goToImpersonation()">Impersonation</a></li>\r\n                        <li data-main-menu-item="Role"><a class="cursor_pointer" ng-click="vm.goToRolePermission()">Role Permissions</a></li>\r\n                        <li data-main-menu-item="Employees"><a class="cursor_pointer" ng-click="vm.goToEmployees()">Employees</a></li>\r\n                        <li data-main-menu-item="CustomerUsers"><a class="cursor_pointer" ng-click="vm.goToCustomerUsers()">Customer Users</a></li>\r\n                        <li data-main-menu-item="FormTemplates"><a class="cursor_pointer" ng-click="vm.goToFormTemplates()">Form Templates</a></li>\r\n                        <li class="dropdown-submenu" data-main-menu-item="SubscriptionManagmentGroup">\r\n                            <a class="cursor_pointer">Subscription Management </a>\r\n                            <ul class="dropdown-menu">\r\n                                <li data-main-menu-item="SubscriptionPlan"><a class="cursor_pointer" ng-click="vm.goToSubscriptionPlan()">Subscription Plan</a></li>\r\n                                <li data-main-menu-item="Subscriptions"><a class="cursor_pointer" ng-click="vm.goToSubscription()">Subscriptions</a></li>\r\n                                <li data-main-menu-item="PaymentType"><a class="cursor_pointer" ng-click="vm.goToPaymentTypes()">Payment type</a></li>\r\n                            </ul>\r\n                        </li>\r\n                        <li class="dropdown-submenu" data-main-menu-item="ConfigurationGroup">\r\n                            <a class="cursor_pointer">Configuration</a>\r\n                            <ul class="dropdown-menu">\r\n                                <li data-main-menu-item="ApplicationSettings"><a class="cursor_pointer" ng-click="vm.goToAppSettings()">Application Settings</a></li>\r\n                                <li data-main-menu-item="CompanyFeature"><a class="cursor_pointer" ng-click="vm.goToCompanyFeature()">Company Feature</a></li>\r\n                                \x3c!-- PBI623 - TASK627 : FCO web ui: Dashboards --\x3e\r\n                                <li data-main-menu-item="DashboardReports"><a class="cursor_pointer" ng-click="vm.goToDashboardReports()">Dashboard Reports</a></li>\r\n                                \x3c!-- PBI825 : FCO - Default start page --\x3e\r\n                                <li data-main-menu-item="DefaultStartPageRole"><a class="cursor_pointer" ng-click="vm.goToDefaultStartPageRole()">Default Start Page</a></li>\r\n                                <li data-main-menu-item="ReferenceTables"><a class="cursor_pointer" ng-click="vm.goToRefTables()">Reference Tables</a></li>\r\n                            </ul>\r\n                        </li>\r\n                        \x3c!-- PBI775 : FCO - Event Log Debug for GeoLocation Services --\x3e\r\n                        <li class="dropdown-submenu" data-main-menu-item="EventsGroup">\r\n                            <a class="cursor_pointer">Events</a>\r\n                            <ul class="dropdown-menu">\r\n                                <li data-main-menu-item="EventDebugLog"><a class="cursor_pointer" ng-click="vm.goToEventDebugLog()">Debug Log</a></li>\r\n                                \x3c!-- PBI779 : FCO - Event log view - FC --\x3e\r\n                                <li data-main-menu-item="EventLog"><a class="cursor_pointer" ng-click="vm.goToEventLog()">Event Log</a></li>\r\n                            </ul>\r\n                        </li>\r\n                        \x3c!-- PBI775 : END --\x3e\r\n                        <li data-main-menu-item="CreateCompany"><a class="cursor_pointer" ng-click="vm.goToNewCompany()">Create Company</a></li>\r\n                    </ul>\r\n                </li>\r\n            </ul>\r\n\r\n            <ul class="nav navbar-nav navbar-right user-nav orange cursor_pointer">\r\n                <li><a ng-click="vm.logout()"><i class="fa fa-power-off"></i> \x3c!-- Log Out --\x3e</a></li>\r\n            </ul>\r\n            \x3c!-- EPIC814: FCO - GPS --\x3e\r\n            <ul ng-if="vm.gpsEnableBrowserBasedTracking" class="nav navbar-nav navbar-right not-nav messagesNav cursor_pointer">\r\n                <li class="button dropdown"><a><i id="gps-icon" class="fa fa-feed"></i></a></li>\r\n            </ul>\r\n            <ul ng-if="vm.messagesCount == 0" class="nav navbar-nav navbar-right not-nav messagesNav cursor_pointer">\r\n                <li class="button dropdown">\r\n                    <a><i class="fa fa-comments"></i></a>\r\n                </li>\r\n            </ul>\r\n            <ul ng-if="vm.messagesCount > 0" class="nav navbar-nav navbar-right not-nav messagesNav">\r\n                <li class="button dropdown">\r\n                    <a href="javascript:;" data-toggle="dropdown" class="dropdown-toggle cursor_pointer"><i class="fa fa-comments"></i><span class="bubble">{{vm.messagesCount}}</span></a>\r\n\r\n                    <ul class="dropdown-menu messages">\r\n                        <li>\r\n                            <div class="nano nscroller">\r\n                                <div class="content">\r\n                                    <ul>\r\n                                        <li ng-repeat="message in vm.messages">\r\n                                            <a data-modal="md-messages" class="cursor_pointer md-trigger" ng-click="vm.showMessage(message.Id, message.Note, message.UserFullName, message.DateSent, message.OwnerType)">\r\n                                                <span class="date pull-right">{{message.DateSent}}</span>\r\n                                                <span class="name">{{message.UserFullName}}</span>\r\n                                                {{message.Note}}\r\n                                            </a>\r\n                                        </li>\r\n                                        \x3c!--<li>\r\n                                          <a data-modal="md-messages" class="cursor_pointer md-trigger">\r\n                                                <span class="date pull-right">13 Sept.</span>\r\n                                                <span class="name">Daniel</span>\r\n                                                Lorem ipsum dolor sit amet, consectetur adipiscing elit\r\n                                              </a>\r\n                                        </li>--\x3e\r\n\r\n                                    </ul>\r\n                                </div>\r\n                            </div>\r\n                            <ul class="foot">\r\n                                \x3c!--<li><a href="#">View all messages </a></li>--\x3e\r\n                            </ul>\r\n                        </li>\r\n                    </ul>\r\n                </li>\r\n            </ul>\r\n\r\n            <ul class="nav navbar-nav navbar-right  cursor_pointer">\r\n                <li>\r\n                    <a ng-click="vm.editUser()">{{vm.UserFirstName}}</a>\r\n                </li>\r\n            </ul>\r\n\r\n            <ul class="nav navbar-nav navbar-right" ng-show="!vm.subscriptionStatus" style="color: red">\r\n                <li>\r\n                    <a style="color: red">Your subscription has expired or not started yet. Please contact your Administrator.</a>\r\n                </li>\r\n            </ul>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/notAuthorized.html",'<div class="row">\r\n    <div class="middle-login">\r\n        <div class="block-flat">\r\n            <div class="header">\r\n                <h3 class="text-center">\r\n                    <img src="Content/img/forbidden.jpg" alt="logo" class="logo-img">\r\n                </h3>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/AdvancedReports/dashboard.html",'<div id="pcont" class="container-fluid" style="height: 100%;">\r\n    <div class="dashboard-wrapper" ng-controller="dashboardController as vm">\r\n        <nav id="dashboard-sidebar">\r\n            <ul class="dashboard-chart-list" id=\'cardlist\'></ul>\r\n        </nav>\r\n        <div id="dashboard-workspace">\r\n            <div class="dashboard-header">\r\n                <div id="dashboard-sidebar-Icon" class="dashboard-icons"><a id="sidebarCollapse" title="Available Reports" class="cursor_pointer" ng-click="vm.showSidebar()"><i class="fas fa-bars"></i></a></div>\r\n                <div style="display: flex; flex-direction: row; justify-content: space-between;">\r\n                    <div class="dashboard-subtitle"><i style="height: 100%;" class="glyphicon glyphicon-dashboard dashboard-title-icon"></i><span>Dashboard</span></div>\r\n                    \x3c!-- <div class="dashboard-icons"><span class="cursor_pointer" ng-click="vm.loadCards()"><i class="fas fa-recycle dashboard-title-icon"></i></span><span class="cursor_pointer" ng-click=""><i class="far fa-clock"></i></span></div> --\x3e\r\n                    <div class="dashboard-icons"><span class="cursor_pointer" ng-click="vm.loadCards()" title="Refresh Charts"><i class="fas fa-recycle"></i></span></div>\r\n                </div>\r\n                <hr />\r\n                <div style="display: flex; flex-direction: row;">\r\n                    <div class="dashboard-title">{{vm.fullName}}\'s {{vm.userRoles[0]}} Dashboard</div>\r\n                </div>\r\n            </div>\r\n            <div id="dashboard-content" class="dashboard-content">\r\n                <div id="dashboard" class="row form-horizontal">\r\n                    <div ng-repeat="card in vm.cardList" id="card-{{card.Id}}" class="dashboard-card-container col-sm-4" ng-init="$last ? vm.Finished(): null">\r\n                        <div id="report-card-{{card.Id}}" class="card card-dashboard">\r\n                            <div id="report-header-{{card.Id}}" style="display: flex; flex-direction: row;justify-content: space-between;">\r\n                                <div id="report-title-{{card.Id}}" class="dashboard-title"><i class="{{vm.getIcon(card.ChartType)}} dashboard-title-icon"></i><input type="text" value="{{card.AltTitle ? card.AltTitle: card.ReportDescription}}" disabled /></div>\r\n                                \x3c!-- <div id="report-icons-{{card.Id}}"  class="dashboard-icons"><span class="cursor_pointer" ng-click="vm.showFilters(card)"><i class="fas fa-cog dashboard-title-icon"></i></span><span id="card-expand-{{card.Id}}" class="cursor_pointer" title="Expand Chart" ng-click="vm.expandCard(card)"><i class="fas fa-expand"></i></span></div> --\x3e\r\n                                <div id="report-icons-{{card.Id}}" class=""><span class="cursor_pointer" ng-click="vm.showFilters(card)" title="Chart Properties"><i class="fas fa-cog"></i></span></div>\r\n                            </div>\r\n                            <canvas id="myChart-{{card.Id}}"></canvas>\r\n                            <div id="report-info-{{card.Id}}" style="display: flex; flex-direction: row; justify-content: space-between;">\r\n                                <div id="report-link-{{card.Id}}" class="dashboard-link"><span></span></div>\r\n                                <div id="report-trash-{{card.Id}}" class="dashboard-icons"><span id="trash-icon-{{card.Id}}" class="cursor_pointer" title="Remove Chart" ng-click="vm.deleteUserReport(card)"><i class="fas fa-trash-alt"></i></span></div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>'),e.put("Templates/AdvancedReports/dashboardFiltersModal.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 80%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n                <h4 class="modal-title">Chart Filters and Configuration</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <fc-table-edit api-method="dashboardUserReports"\r\n                               id="{{vm.id}}"\r\n                               model="vm.model"\r\n                               view-name="{{vm.viewName}}"\r\n                               module-name="{{vm.moduleName}}"\r\n                               attributes="vm.attributes"\r\n                               on-back="vm.close(insertData)"\r\n                               on-submit="vm.submit()"\r\n                               hide-cancel="vm.hideCancel"\r\n                               disable-submit="vm.disableSubmit"\r\n                               ng-if="vm.show">\r\n                </fc-table-edit>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class="modal-backdrop in fade"></div>\r\n</div>\r\n'),e.put("Templates/AdvancedReports/powerbi.html",'<input type="hidden" id="reportId" value="{{reportId}}" />\r\n<input type="hidden" id="embedUrl" value="{{embedUrl}}" />\r\n<input type="hidden" id="accessToken" value="{{accessToken}}" />\r\n<div id="reportContainer" style="height: 700px;" ></div>'),e.put("Templates/Agreements/addAgreementTaskModal.html",'<div id="myModal" class="fade" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 80%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.cancel()">&times;</button>\r\n                <h4 class="modal-title">{{vm.title}}</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <div class="row" style="padding-right: 10px; padding-left: 10px;">\r\n                    <div class="col-md-12" ng-show="!vm.showAvailableAgreementTasks">\r\n                        <div>All Tasks have been added</div>\r\n                    </div>\r\n                    <div class="col-md-12" ng-show="vm.showAvailableAgreementTasks">\r\n                        <div class="form-group">\r\n                            <div class="text-right">\r\n                                <label>\r\n                                    <div class="icheckbox_square-blue checkbox" ng-class="{ \'checked\': vm.addAllItems}">\r\n                                        <input type="checkbox" class="icheck" style="position: absolute; opacity: 0;" ng-click="vm.addAll()" ng-model="vm.addAllItems" />\r\n                                        <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                    </div>\r\n                                    Check/Uncheck All\r\n                                </label>\r\n                            </div>\r\n                        </div>\r\n                        <div style="max-height: 500px;  overflow-y: auto;">\r\n                            <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" style="margin-top: 0px !important;" role="grid" aria-describedby="datatable-icons_info">\r\n                                <thead style="position: -webkit-sticky; position: sticky; top: 1px; z-index: 100; background-color: white;">\r\n                                    <tr role="row" class="disable-text-selection">\r\n                                        <th>Standard Task</th>\r\n                                        <th>Task Name</th>\r\n                                        <th>Description</th>\r\n                                        <th>Serviceable Item</th>\r\n                                        <th>Add</th>\r\n                                    </tr>\r\n                                </thead>\r\n                                <tbody>\r\n                                    <tr ng-repeat="agreementTask in vm.agreementTasks">\r\n                                        <td><div class="form-group">{{agreementTask.TaskCode}}</div></td>\r\n                                        <td><div class="form-group">{{agreementTask.TaskName}}</div></td>\r\n                                        <td><div class="form-group">{{agreementTask.Description}}</div></td>\r\n                                        <td><div class="form-group">{{agreementTask.ServiceableItemName}}</div></td>\r\n                                        <td>\r\n                                            <div class="form-group checkbox">\r\n                                                <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7" style="margin-left: -18px;">\r\n                                                    <div aria-disabled="false" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': agreementTask.Add}" fc-focusout="vm.focusOut(agreementTask)">\r\n                                                        <input type="checkbox" ng-model="agreementTask.Add" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                                        <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                    </div>\r\n                                                </label>\r\n                                            </div>\r\n                                        </td>\r\n                                    </tr>\r\n                                </tbody>\r\n                            </table>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                <div class="row" style="padding-right: 10px; padding-left: 10px; padding-top: 10px;">\r\n                    <div class="col-sm-offset-6 col-sm-6 col-md-6">\r\n                        <div class="form-group">\r\n                            <div class=" text-right">\r\n                                <button type="button" class="btn btn-default table-edit-cancel-btn" ng-click="vm.cancel()">{{cancelButtonText || "Cancel"}}</button>\r\n                                <button type="button" class="btn btn-primary table-edit-submit-btn" ng-class="{\'disabled\': vm.submitBlock}" ng-disabled="vm.disableSubmit" ng-hide="vm.hideSubmit" ng-click="vm.onSubmit()" value="Submit" ng-show="vm.showAvailableAgreementTasks">Submit</button>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div> \x3c!-- form group --\x3e\r\n                    </div> \x3c!-- columns --\x3e\r\n                </div>\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade"></div>\r\n'),e.put("Templates/Agreements/agreementInvoiceForm.html",'<div id="pcont" class="container-fluid" ng-controller="AgreementInvoiceFormController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goBack()">{{vm.AgreementInvoiceClick}}</a></li>\r\n            <li class="active">Agreement Invoice</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1 ng-if="vm.id">Edit invoice</h1>\r\n        <h1 ng-if="!vm.id">Create invoice</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <div id="createInvoice">\r\n            <div class="tableBtns text-right">\r\n                <a class="cursor_pointer" ng-click="vm.goBack()">Go Back</a>\r\n            </div>\r\n            <fc-table-edit api-method="agreementInvoices" id="{{vm.id}}" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n            \x3c!--<fc-table-edit attributes="vm.attributes" model="vm.model"></fc-table-edit>--\x3e\r\n            <div class="form-group">\r\n                <div class="class="col-sm-8 col-md-7 col-lg-7"">\r\n                    <button type="submit" class="btn btn-primary"ng-if="vm.id && vm.model.Status != \'Voided\'" ng-disabled="vm.model.Status == \'Posted\'" ng-click="vm.postInvoice()">Post</button>\r\n                    <button type="submit" class="btn btn-primary" ng-if="vm.id && vm.model.Status != \'Voided\'" ng-click="vm.voidInvoice()">Void</button>\r\n                    </div>\r\n                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4  text-right button-left">\r\n                        <button type="submit" class="btn btn-primary" ng-click="vm.saveInvoice()">Submit</button>\r\n                        <button type="submit" class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                    </div> \x3c!-- input box --\x3e\r\n            </div>\r\n        </div>\r\n        <br /><br />\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/Agreements/agreementServiceableItemEdit.html",'\x3c!--<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="AgreementAddServiceableItemController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'agreements\')">Agreement</a></li>\r\n            <li class="active"></li>\r\n        </ol>--\x3e \x3c!-- breadcrumb --\x3e\r\n        \x3c!--<h1>Agreement {{vm.model.AltId}}</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="agreementserviceableitems" on-back="vm.$state.go(\'agreementsEdit\', { id: vm.model.AgreementId })" attributes="vm.attributes" model="vm.model" ></fc-table-edit>\r\n    </div>\r\n   \r\n</div>--\x3e\r\n<div id="myModal" class="fade in modal-open" role="dialog">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px;">\r\n        <div class="modal-content">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n                <h4 class="modal-title">Agreement Serviceable Item</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <fc-table-edit api-method="agreementserviceableitems" on-back="vm.close()" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n              \r\n\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class="modal-backdrop in fade"></div>\r\n</div>'),e.put("Templates/Agreements/agreementSiteEdit.html",'\x3c!-- <div id="pcont" class="container-fluid" class="container-fluid" ng-controller="AgreementAddSiteController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'agreements\')">Agreement</a></li>\r\n            <li class="active"></li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n   \x3c!--     <h1>Agreement {{vm.model.AltId}}</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="agreementsites" on-back="vm.$state.go(\'agreementsEdit\', { id: vm.model.AgreementId })" attributes="vm.attributesEditSite" model="vm.model" ></fc-table-edit>\r\n    </div>\r\n   \r\n</div> --\x3e\r\n<div id="myModal" class="fade in modal-open" role="dialog">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px;">\r\n        <div class="modal-content">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n                <h4 class="modal-title">Agreement Sites</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n               \r\n                <fc-table-edit api-method="agreementsites" on-back="vm.close()" attributes="vm.attributesEditSite" model="vm.model"></fc-table-edit>\r\n\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class="modal-backdrop in fade"></div>\r\n</div>'),e.put("Templates/Agreements/agreementTimePopup.html",'<div id="myModal" class="fade" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n        \x3c!-- Modal content--\x3e\r\n        \x3c!-- PBI667 : FCO - Add timer buttons within Assignment screen - DSL-NW --\x3e\r\n        \x3c!-- <div class="modal-content" style="overflow-y: auto; height: 75%"> --\x3e\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 80%;">\r\n            <div class="modal-header">\r\n                <h4 class="modal-title">{{modalTitle}}</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <fc-table-edit api-method="{{vm.apiMethod}}" view-name="{{vm.viewName}}" module-name="{{vm.moduleName}}" id="{{vm.id}}" model="vm.$scope.model" on-back="vm.onBack(insertData)" attributes="vm.attributes" ng-if="!onSubmit" hide-submit="vm.hideSubmit" hide-cancel="vm.hideCancel" custom-focus="vm.customFocus(attribute)" default-value="{{attribute.DefaultValue}}" current-list="vm.currentList" filter="vm.$scope.filter"></fc-table-edit>\r\n                <fc-table-edit api-method="{{vm.apiMethod}}" view-name="{{vm.viewName}}" module-name="{{vm.moduleName}}" id="{{vm.id}}" model="vm.$scope.model" on-back="vm.onBack(insertData)" attributes="vm.attributes" on-submit="vm.submit();" hide-submit="vm.hideSubmit" hide-cancel="vm.hideCancel" ng-if="onSubmit" custom-focus="vm.customFocus(attribute)" default-value="{{attribute.DefaultValue}}" current-list="vm.currentList" filter="vm.$scope.filter"></fc-table-edit>\r\n                \x3c!-- <p>Some text in the modal.</p> --\x3e\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/Agreements/agreements.html",'<div id="pcont" class="container-fluid" ng-controller="AgreementsController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Agreements</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Agreements</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row" id="agreements">\r\n            <div class="clearfix CollapsibleTitle">\r\n                <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n            </div>\r\n\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n\r\n                    <div class="content">\r\n                        <div id="Collapsible" class="collapse in clearfix">\r\n                            <fc-table-edit api-method="agreements"\r\n                                           model="vm.model"\r\n                                           custom-focus="vm.focusOut(attribute)"\r\n                                           on-enter="vm.search()"\r\n                                           attributes="vm.attributesFilter"\r\n                                           view-name="{{vm.viewName}}"\r\n                                           module-name="{{vm.moduleName}}">\r\n                            </fc-table-edit>\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right">\r\n\r\n                                <button type="submit" class="btn btn-primary pull-right" style="margin-right:-15px;" ng-click="vm.search()">Search</button>\r\n                            </div>\r\n                        </div> \x3c!--collapsible--\x3e\r\n                        <br /><br />\r\n                        <fc-table api-method="agreements"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)"\r\n                                  filter="vm.filters"\r\n                                  view-name="{{vm.viewName}}"\r\n                                  module-name="{{vm.moduleName}}">\r\n                        </fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/Agreements/agreementsEdit.html",'<div id="pcont" class="container-fluid" ng-controller="AgreementsEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'agreements\')">Agreement</a></li>\r\n            <li class="active"></li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Agreement {{vm.model.AltId}}</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div id="agreementDetails">\r\n            <fc-table-edit custom-focus="vm.focusOut(attribute)" api-method="agreements" id="{{vm.id}}" on-back="vm.$state.go(\'agreements\')" on-submit="vm.submit()" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n\r\n        </div>\r\n\r\n        <div class="row">\r\n            <div class="col-md-6 pageViewAlign" style="margin-top: -24px !important;">\r\n                <button class="btn btn-primary table-edit-submit-btn" style="margin-top: -50px;" ng-click="vm.createInvoice()" ng-disabled=" vm.idtmp=0 || vm.id !=0 && vm.model.Invoiced">Create Invoice</button>\r\n                <button class="btn btn-primary table-edit-submit-btn" style="margin-top: -50px;" ng-click="vm.goToPM()" ng-disabled="vm.pmPlansButtonDisabled">PM Plans</button> \x3c!--ng-disabled="vm.id == null || vm.model.Status != \'Active\'"--\x3e\r\n            </div>\r\n        </div>\r\n\r\n        \x3c!-- </div> --\x3e\r\n        \x3c!-- <div class="col-md-12" ng-if="vm.id"> --\x3e\r\n        <div class="row form-horizontal">\r\n            <div class="col-md-12" ng-if="vm.id">\r\n\r\n                \x3c!-- <div ng-if="vm.id"> --\x3e\r\n                <div id="accordionSites" class="panel-group accordion" style="margin-bottom: 0px !important;">\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title">\r\n\r\n                                <a data-toggle="collapse" data-parent="#accordionSites" data-target="#collapseSites">\r\n                                    Sites\r\n                                    \x3c!-- style="margin-left:20%;" --\x3e\r\n                                    <span ng-hide="vm.allSitesCovered" style="margin-left:246px;" ng-if="vm.numSites > 1"> {{vm.numSites}} Sites covered</span>\r\n                                    <span ng-hide="vm.allSitesCovered" style="margin-left:246px;" ng-if="vm.numSites == 1"> {{vm.numSites}} Site covered</span>\r\n                                    <span ng-hide="vm.allSitesCovered" style="margin-left:246px;" ng-if="vm.numSites == 0"> {{vm.numSites}} Sites covered</span>\r\n                                    <span style="margin-left:246px;" ng-if="vm.allSitesCovered"> All Sites covered ({{vm.numSites}} Sites)</span>\r\n\r\n                                    <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                </a>\r\n                            </h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseSites" class="panel-collapse collapse in">\r\n                            <div class="panel-body">\r\n                                \x3c!-- ADD ALL SITES CHECKBOX --\x3e\r\n                                <div class="form-group checkbox">\r\n                                    <label id="AllSites">\r\n                                        <div class="icheckbox_square-blue checkbox" ng-class="{ \'checked\': vm.model.agreementAllSites }">\r\n                                            <input id="allSitesCB" type="checkbox" ng-model="vm.model.agreementAllSites" ng-click="vm.addAllSites(vm.model)" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                            <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                        </div>\r\n                                        All Sites Covered\r\n                                    </label>\r\n                                </div>\r\n                                <div class="block-flat">\r\n                                    <div>\r\n                                        <fc-table table-name="Sites"\r\n                                                  api-method="agreementsites"\r\n                                                  attributes="vm.attributesSite"\r\n                                                  filter="vm.agreementSiteFilter"\r\n                                                  ng-if="vm.reloadTable"\r\n                                                  show-search="false"\r\n                                                  on-edit="vm.edit(item)"\r\n                                                  on-add="vm.add(1)"\r\n                                                  show-delete-column="vm.showDeleteButton"\r\n                                                  show-add-new="vm.showAddButton"\r\n                                                  delete-event="vm.reloadSA()"\r\n                                                  delete-message-format="All associated Serviceable Items will also be delete for this agreement!">\r\n                                        </fc-table>\r\n\r\n                                    </div>\r\n                                </div>\x3c!-- block-flat --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel --\x3e\r\n                </div>\r\n\r\n                <div id="accordionItems" class="panel-group accordion" style="margin-bottom: 0px !important;">\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title">\r\n                                <a data-toggle="collapse" data-parent="#accordionItems" data-target="#collapseItems">\r\n                                    Serviceable\r\n                                    Items\r\n                                    \x3c!-- style="margin-left:20%;" --\x3e\r\n                                    <span ng-hide="vm.allSICovered" style="margin-left:150px;" ng-if="vm.numServItem > 1"> {{vm.numServItem}} Serviceable Items covered</span>\r\n                                    <span ng-hide="vm.allSICovered" style="margin-left:150px;" ng-if="vm.numServItem == 1"> {{vm.numServItem}} Serviceable Items covered</span>\r\n                                    <span ng-hide="vm.allSICovered" style="margin-left:150px;" ng-if="vm.numServItem == 0"> {{vm.numServItem}} Serviceable Items covered</span>\r\n                                    <span style="margin-left:150px;" ng-if="vm.allSICovered"> All Serviceable Items covered ({{vm.numServItem}} Items)</span>\r\n                                    <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                </a>\r\n                            </h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseItems" class="panel-collapse collapse in">\r\n                            <div class="panel-body">\r\n                                \x3c!-- ADD ALL SITES CHECKBOX --\x3e\r\n                                <divs class="form-group checkbox" align="left">\r\n                                    <label id="AllSI">\r\n                                        <div class="icheckbox_square-blue checkbox" ng-class="{ \'checked\': vm.model.agreementAllSI }">\r\n                                            <input id="allSICB" type="checkbox" ng-model="vm.model.agreementAllSI" ng-click="vm.addAllSI(item)" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                            <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                        </div>\r\n                                        All Serviceable Items Covered\r\n                                    </label>\r\n                                </divs>\r\n                                <div class="block-flat">\r\n                                    <div ng-if="vm.siteNumFilter.Reload">\r\n                                        <fc-table table-name="Serviceable Items"\r\n                                                  api-method="agreementserviceableitems"\r\n                                                  attributes="vm.attributesSerItems"\r\n                                                  ng-if="vm.reloadTable"\r\n                                                  show-search="false"\r\n                                                  on-add="vm.add(2)"\r\n                                                  show-delete-column="vm.showSIDeleteButton"\r\n                                                  show-add-new="vm.showSIAddButton"\r\n                                                  delete-event="vm.reloadSA()"\r\n                                                  on-edit="vm.edit(item)"\r\n                                                  filter="vm.siteNumFilter">\r\n                                        </fc-table>\r\n                                    </div>\r\n                                </div>\x3c!-- block-flat --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel --\x3e\r\n                </div>\r\n\r\n                \x3c!-- PBI1044 : FCO - Work Order Tasks --\x3e\r\n\r\n                <div id="accordionTasks" class="panel-group accordion">\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title">\r\n                                <a data-toggle="collapse" data-parent="#accordionTasks" data-target="#collapseTasks">\r\n                                    Tasks\r\n                                    <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                </a>\r\n                            </h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseTasks" class="panel-collapse collapse in">\r\n                            <div class="panel-body">\r\n                                <div class="block-flat">\r\n                                    <fc-table table-name="Tasks"\r\n                                              api-method="agreementtasks"\r\n                                              attributes="vm.attributesTask"\r\n                                              ng-if="vm.reloadTasks"\r\n                                              show-search="false"\r\n                                              on-add="vm.editTask(id)"\r\n                                              on-edit="vm.editTask(id)"\r\n                                              filter="vm.agreementFilter"></fc-table>\r\n                                </div>\x3c!-- block-flat --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel --\x3e\r\n                </div>\r\n\r\n                \x3c!-- </div> --\x3e\r\n\r\n            </div>\r\n        </div>\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/BaseReports/baseReports.html",'<div id="pcont" class="container-fluid">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Reporting</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Base Reports</h1>\r\n    </div>\r\n    <div class="cl-mcont" ng-controller="BaseReportsController as vm">\r\n        <div class="table-edit-overlay" ng-show="vm.isLoading">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <div class="row  form-horizontal">\r\n                            <div class="clearfix CollapsibleTitle">\r\n                                <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                            </div>\r\n                            <div id="Collapsible" class="collapse in clearfix" ui-if="vm.attributesFilter">\r\n                                \x3c!-- PBI730 : FCO - Revenue per tech report - GroundBreakers --\x3e\r\n                                <div style="margin-bottom: -15px">\r\n                                    <fc-table-edit attributes="vm.attributesReport"\r\n                                                   model="vm.filter"\r\n                                                   hide-submit="true"\r\n                                                   hide-cancel="true">\r\n                                    </fc-table-edit>\r\n                                </div>\r\n                                <fc-table-edit on-submit="vm.editWo()"\r\n                                               attributes="vm.attributesFilter"\r\n                                               model="vm.filter"\r\n                                               view-name="{{vm.viewName}}"\r\n                                               module-name="{{vm.moduleName}}"\r\n                                               hide-submit="true"\r\n                                               hide-cancel="true"\r\n                                               ng-if="vm.showForm">\r\n                                </fc-table-edit>\r\n                                <div class="form-group">\r\n                                    <div class="col-sm-offset-3 col-md-offset-4 col-sm-9 col-md-8 text-right">\r\n                                        <button type="submit" class="btn btn-primary" ng-click="vm.search()">Run</button>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="row  form-horizontal">\r\n                            <div class="pull-right">\r\n                                <button type="button" class="btn btn-success add-new-btn" ng-if="vm.showCSVButton" ng-disabled="vm.buttonDisabled"\r\n                                        ng-click="vm.exportCSV()">\r\n                                    Export CSV\r\n                                </button>\r\n                                <button type="button" class="btn btn-success add-new-btn" ng-if="vm.showPDFButton" ng-disabled="vm.buttonDisabled"\r\n                                        ng-click="vm.exportPDF()">\r\n                                    Export PDF\r\n                                </button>\r\n                            </div>\r\n                            <table id="datatable-icons" class="table table-bordered  dataTable no-footer" role="grid"\r\n                                   aria-describedby="datatable-icons_info">\r\n                                <thead>\r\n                                    <tr>\r\n                                        <th ng-repeat="attr in vm.attributes" ng-if="vm.hideCol(attr.pid)">{{attr.Name}}</th>\r\n                                    </tr>\r\n                                </thead>\r\n                                <tbody>\r\n                                    <tr ng-repeat="item in vm.items">\r\n                                        <td ng-repeat="attr in vm.attributes" ng-if="vm.hideCol(attr.pid)" style="position: relative">\r\n                                            <span ng-if="attr.CellFormat == \'label\'">\r\n                                                <span ng-if="attr.FormatDate">{{item[attr.ValueName] | date : \'MM/dd/yy\'}}</span>\r\n                                                <span ng-if="!attr.FormatDate">{{item[attr.ValueName]}}</span>\r\n                                            </span>\r\n                                            \x3c!-- US1232 : TechConnect - Report: Technician Productivity/Utilization --\x3e\r\n                                            <span ng-if="attr.CellFormat == \'percent\'">\r\n                                                <span>{{item[attr.ValueName] | number:0}}%</span>\r\n                                            </span>\r\n                                        </td>\r\n                                    </tr>\r\n                                </tbody>\r\n                            </table>\r\n                        </div>\r\n                        <div class="row  form-horizontal">\r\n                            <fc-paging page="vm.workOrderMeta.Paging.Page" page-size="vm.workOrderMeta.Paging.PageSize" current-data-length="vm.items.length" total="vm.workOrderMeta.Paging.TotalCount"></fc-paging>\r\n                        </div>\x3c!-- row --\x3e\r\n                        <div class="row  form-horizontal">\r\n                            <div class="dataTables_length" id="datatable-icons_length">\r\n                                <label>\r\n                                    Show\r\n                                    <select name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.workOrderMeta.Paging.PageSize">\r\n                                        <option value="50">50</option>\r\n                                    </select> entries\r\n                                </label>\r\n                            </div>\r\n                        </div>\x3c!-- row --\x3e\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/BaseReports/serviceableItemReport.html",'<div id="pcont" class="container-fluid">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Reporting</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Serviceable Item Report</h1>\r\n    </div>\r\n    <div class="cl-mcont" ng-controller="ServiceableItemReportController as vm">\r\n        <div class="table-edit-overlay" ng-show="vm.isLoading">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        <div class="clearfix CollapsibleTitle">\r\n            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n        </div>\r\n        <div id="Collapsible" class="collapse in clearfix">\r\n            <div class="row form-horizontal">\r\n                <div class="col-md-6">\r\n                    <div class="form-group" fc-enter="vm.search()">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Customer</label></div>\r\n                        <div class="col-sm-6 col-md-6">\r\n                            <fc-auto-complete-table fc-focusout="vm.focusOut(\'customer\')" name="{{vm.customerAttribute.ModelValue}}" value="vm.filter[vm.customerAttribute.ModelValue]" ng-model="vm.filter[vm.customerAttribute.ModelValue]" maxlength="{{vm.customerAttribute.MaxLength}}" ng-style="{\'display\': \'inline\', \'width\': vm.customerAttribute.InputSufix ? \'auto\' : \'100%\'}" ctr-id="{{vm.customerAttribute.Id}}" api-method="{{vm.customerAttribute.ApiMethod}}" read-only="vm.customerAttribute.ReadOnly" autofocus="vm.customerAttribute.Autofocus" place-holder="{{vm.customerAttribute.PlaceHolder}}" on-select="vm.customerAttribute.onSelect(item)" value-prop="{{vm.customerAttribute.ValueProp}}" attributes="vm.customerAttribute.GridAttributes" page-size="vm.customerAttribute.PageSize" search-by-columns="vm.customerAttribute.SearchCols" search-trigger="vm.customerAttribute.SearchTrigger" show-header="vm.customerAttribute.ShowHeader"></fc-auto-complete-table>\r\n                            \x3c!--<input type="text" name="{{vm.customerAttribute.ModelValue}}" ng-if="!vm.customerAttribute.Required && vm.customerAttribute.ReadOnly" readonly="readonly" ng-model="vm.filter[vm.customerAttribute.ModelValue]" maxlength="{{vm.customerAttribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': vm.customerAttribute.InputSufix ? \'auto\' : \'100%\'}" />--\x3e\r\n                        </div>\r\n                        <div class="col-sm-2 col-md-2">\r\n                            <button class="btn" type=\'button\' ng-click="vm.customerBtn.onClick()">{{vm.customerBtn.Label}}</button>\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group" fc-enter="vm.search()">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Site</label></div>\r\n                        <div class="col-sm-6 col-md-6">\r\n                            <fc-auto-complete-table fc-focusout="vm.focusOut(\'site\')" name="{{vm.siteAttribute.ModelValue}}" value="vm.filter[vm.siteAttribute.ModelValue]" ng-model="vm.filter[vm.siteAttribute.ModelValue]" maxlength="{{vm.siteAttribute.MaxLength}}" ng-style="{\'display\': \'inline\', \'width\': vm.siteAttribute.InputSufix ? \'auto\' : \'100%\'}" ctr-id="{{vm.siteAttribute.Id}}" api-method="{{vm.siteAttribute.ApiMethod}}" read-only="vm.siteAttribute.ReadOnly" autofocus="vm.siteAttribute.Autofocus" place-holder="{{vm.siteAttribute.PlaceHolder}}" on-select="vm.siteAttribute.onSelect(item)" value-prop="{{vm.siteAttribute.ValueProp}}" attributes="vm.siteAttribute.GridAttributes" page-size="vm.siteAttribute.PageSize" search-by-columns="vm.siteAttribute.SearchCols" search-trigger="vm.siteAttribute.SearchTrigger" show-header="vm.siteAttribute.ShowHeader" filter="vm.siteAttribute.filter"></fc-auto-complete-table>\r\n                            \x3c!--<input type="text" name="{{vm.siteAttribute.ModelValue}}" ng-if="!vm.siteAttribute.Required && vm.siteAttribute.ReadOnly" readonly="readonly" ng-model="vm.filter[vm.siteAttribute.ModelValue]" maxlength="{{vm.siteAttribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': vm.siteAttribute.InputSufix ? \'auto\' : \'100%\'}" />--\x3e\r\n                        </div>\r\n                        <div class="col-sm-2 col-md-2">\r\n                            <button class="btn {{vm.siteBtn.CustomInputClass}}" type=\'button\' ng-click="vm.siteBtn.onClick()">{{vm.siteBtn.Label}}</button>\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Office</label></div>\r\n                        <div class="col-sm-8 col-md-8">\r\n                            <fc-dropdown on-enter="vm.search()" value="vm.filter.officeId" api-method="offices" value-prop="Id" text-prop="OfficeName" label="Office"></fc-dropdown>\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Serviceable Item</label></div>\r\n                        <div class="col-sm-8 col-md-8">\r\n                            <fc-dropdown on-enter="vm.search()" value="vm.filter.serviceableItemId"\r\n                                         api-method="serviceableitems" value-prop="Id" text-prop="ServiceableItemName"\r\n                                         convert-to-int="true" label="ServiceableItem" filter="vm.autoFilterServiceableItem">\r\n                            </fc-dropdown>\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">SI Class</label></div>\r\n                        <div class="col-sm-8 col-md-8">\r\n                            <fc-dropdown on-enter="vm.search()" value="vm.filter.serviceableItemClassId"\r\n                                         api-method="serviceableItemClasses" value-prop="Id" text-prop="ClassName"\r\n                                         convert-to-int="true" label="Class"></fc-dropdown>\r\n                        </div>\r\n                    </div>\r\n\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">SI Type</label></div>\r\n                        <div class="col-sm-8 col-md-8">\r\n                            <fc-dropdown on-enter="vm.search()" value="vm.filter.serviceableItemTypeId"\r\n                                         api-method="serviceableItemTypes" value-prop="Id" text-prop="TypeName"\r\n                                         convert-to-int="true" label="Type"\r\n                                         filter="vm.autoFilterServiceableItemTypes"></fc-dropdown>\r\n                        </div>\r\n                    </div>\r\n\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">SI Manufacturer</label></div>\r\n                        <div class="col-sm-8 col-md-8">\r\n                            <input fc-enter="vm.search()" type="text" class="form-control" ng-model="vm.filter.serviceableItemManufacturer">\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">SI Model</label></div>\r\n                        <div class="col-sm-8 col-md-8">\r\n                            <input fc-enter="vm.search()" type="text" class="form-control" ng-model="vm.filter.serviceableItemModel">\r\n                        </div>\r\n                    </div>\r\n                </div>\x3c!-- col --\x3e\r\n                <div class="col-md-6">\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Agreement Type</label></div>\r\n                        <div class="col-sm-8 col-md-8">\r\n                            <fc-dropdown on-enter="vm.search()" value="vm.filter.agreementTypeId" api-method="agreementtypes"\r\n                                         value-prop="Id" text-prop="AgreementTypeName" convert-to-int="true" label="AgreementType"\r\n                                         Filter="vm.autoFilterArgeementType"></fc-dropdown>\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Agreement</label></div>\r\n                        <div class="col-sm-8 col-md-8">\r\n                            <fc-dropdown on-enter="vm.search()" value="vm.filter.agreementId" api-method="agreements"\r\n                                         value-prop="Id" text-prop="Desc" convert-to-int="true" label="Argeement"\r\n                                         Filter="vm.autoFilterArgeement"></fc-dropdown>\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">WO Type</label></div>\r\n                        <div class="col-sm-8 col-md-8">\r\n                            <fc-dropdown on-enter="vm.search()" value="vm.filter.woTypeName" api-method="wotypes" value-prop="WoTypeName" text-prop="WoTypeName" convert-to-int="true" label="WoType"></fc-dropdown>\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">WO Status</label></div>\r\n                        <div class="col-sm-8 col-md-8">\r\n                            <fc-dropdown on-enter="vm.search()" value="vm.filter.woStatusName" api-method="wostatuses" value-prop="WoStatusName" text-prop="WoStatusName" convert-to-int="true" label="WoStatus"></fc-dropdown>\r\n                        </div>\r\n                    </div>\r\n                    <br />\r\n                    <div class="form-group" fc-enter="vm.search()">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">By Date</label></div>\r\n                        <div class="col-sm-8 col-md-8" ng-init="vm.filter.byDate = 1">\r\n                            <div class="col-sm-4 col-md-4"><label class="radio-inline"><input type="radio" name="ByDate" value="1" ng-model="vm.filter.byDate">Promised</label></div>\r\n                            <div class="col-sm-4 col-md-4"><label class="radio-inline"><input type="radio" name="ByDate" value="2" ng-model="vm.filter.byDate">Request</label></div>\r\n                            <div class="col-sm-4 col-md-4"><label class="radio-inline"><input type="radio" name="ByDate" value="3" ng-model="vm.filter.byDate">Enter</label></div>\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group datepicker-div" fc-enter="vm.search()">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Start Date</label></div>\r\n                        <div data-min-view="2" class="input-group date datetime col-sm-4 col-md-4" date-time-append="">\r\n                            \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                            \x3c!-- <input name="StartDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid push-right"> --\x3e\r\n                            <input onpaste="return false;" restrict-to="{{vm.dateService.restrictToDate()}}" name="StartDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid push-right">\r\n                            \x3c!-- BUG87 : END --\x3e\r\n                            <span class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon glyphicon-calendar"></span>\r\n                            </span>\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group datepicker-div" fc-enter="vm.search()">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">End Date</label></div>\r\n                        <div data-min-view="2" class="input-group date datetime col-sm-4 col-md-4" date-time-append="">\r\n                            \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                            \x3c!-- <input name="EndDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid push-right"> --\x3e\r\n                            <input onpaste="return false;" restrict-to="{{vm.dateService.restrictToDate()}}"  name="EndDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid push-right">\r\n                            \x3c!-- BUG87 : END --\x3e\r\n                            <span class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon glyphicon-calendar"></span>\r\n                            </span>\r\n                        </div>\r\n                    </div>\r\n                </div>\x3c!-- col --\x3e\r\n            </div>\x3c!-- row --\x3e\r\n            <div class="row form-horizontal">\r\n                <div class="col-md-10">\r\n                    <div class="form-group" fc-enter="vm.search()">\r\n                        <div class="col-sm-2 col-md-2"><label class="control-label">Sort By</label></div>\r\n                        <div class="col-sm-4 col-md-4" style="margin-left:43px;">\r\n                            <select class="form-control" name="sortCol" ng-model="vm.filter.sortCol">\r\n                                <option value="AltId">Work Order</option>\r\n                                <option value="PromiseDate">Date</option>\r\n                                <option value="CustomerName">Customer</option>\r\n                            </select>\r\n                        </div>\r\n                        <div class="col-sm-4 col-md-4">\r\n                            <label class="radio-inline">\r\n                                <input id="radioAsc" type="radio" name="sortDirection" class="icheck" value="asc" ng-model="vm.filter.sortDir" fc-enter="vm.search()"> Ascending\r\n                            </label>\r\n                            <label class="radio-inline" style="margin-left: 20px;">\r\n                                <input id="radioDesc" type="radio" name="sortDirection" class="icheck" value="desc" ng-model="vm.filter.sortDir" fc-enter="vm.search()"> Descending\r\n                            </label>\r\n                        </div>\r\n                    </div>\r\n                </div>\x3c!-- col --\x3e\r\n                <div class="col-md-2">\r\n                    <div class="form-group">\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-sm-9 col-md-8 text-right">\r\n                            <button type="submit" class="btn btn-primary" ng-click="vm.search()">Run</button>\r\n                        </div>\r\n                    </div>\r\n                </div>\x3c!-- col --\x3e\r\n            </div>\x3c!-- row --\x3e\r\n        </div>\r\n\r\n        <div class="row">\r\n            <div class="col-sm-12">\r\n                <div class="pull-right">\r\n                    <button type="button" class="btn btn-success add-new-btn" ng-disabled="vm.buttonDisabled" ng-click="vm.exportCSV()">Export CSV</button>\r\n                    <button type="button" class="btn btn-success add-new-btn" ng-disabled="vm.buttonDisabled" ng-click="vm.exportPDF()">Export PDF</button>\r\n                </div>\r\n                <table id="datatable-icons" class="table table-bordered  dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr>\r\n                            <th ng-repeat="attr in vm.attributes">{{attr.Name}}</th>\r\n                        </tr>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr ng-repeat="item in vm.items">\r\n                            <td ng-repeat="attr in vm.attributes" style="position: relative">\r\n                                <span ng-if="attr.CellFormat == \'label\'">\r\n                                    <span ng-if="attr.FormatDate">{{item[attr.ValueName] | date : \'MM/dd/yy\'}}</span>\r\n                                    <span ng-if="!attr.FormatDate">{{item[attr.ValueName]}}</span>\r\n                                </span>\r\n                            </td>\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\r\n        </div>\x3c!-- row --\x3e\r\n        <div class="row" style="margin:0px;">\r\n            <fc-paging page="vm.serviceableItemMeta.Paging.Page" page-size="vm.serviceableItemMeta.Paging.PageSize" current-data-length="vm.items.length" total="vm.serviceableItemMeta.Paging.TotalCount"></fc-paging>\r\n        </div>\x3c!-- row --\x3e\r\n        <div class="row">\r\n            <div class="col-sm-5">\r\n                <div class="dataTables_length" id="datatable-icons_length">\r\n                    <label>\r\n                        Show\r\n                        <select name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.serviceableItemMeta.Paging.PageSize">\r\n                            <option value="50">50</option>\r\n                        </select> entries\r\n                    </label>\r\n                </div>\r\n            </div>\x3c!-- col --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/BaseReports/timeCardReport.html",'<div id="pcont" class="container-fluid">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Reporting</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Time Card Report</h1>\r\n    </div>\r\n    <div class="cl-mcont" ng-controller="TimeCardReportController as vm">\r\n        <div class="table-edit-overlay" ng-show="vm.isLoading">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        <div class="clearfix CollapsibleTitle">\r\n            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n        </div>\r\n        <div id="Collapsible" class="collapse in clearfix">\r\n            <div class="row form-horizontal">\r\n                <div class="col-md-6">\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Pay Period</label></div>\r\n                        <div class="col-sm-8 col-md-8 pull-left">\r\n                            <fc-dropdown on-enter="vm.search()" value="vm.filter.payPeriodId" api-method="companypayperiods/getForTimeReports" value-prop="Id" text-prop="Name" convert-to-int="true" label="Pay Period"></fc-dropdown>\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group datepicker-div" fc-enter="vm.search()">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Start Date</label></div>\r\n                        <div data-min-view="2" class="input-group date datetime col-sm-4 col-md-4" date-time-append="">\r\n                            <input name="StartDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                            <span class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon glyphicon-calendar"></span>\r\n                            </span>\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group datepicker-div" fc-enter="vm.search()">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">End Date</label></div>\r\n                        <div data-min-view="2" class="input-group date datetime col-sm-4 col-md-4" date-time-append="">\r\n                            <input name="EndDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                            <span class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon glyphicon-calendar"></span>\r\n                            </span>\r\n                        </div>\r\n                    </div>\r\n                </div>\x3c!-- col --\x3e\r\n                <div class="col-md-6">\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Technician</label></div>\r\n                        <div class="col-sm-8 col-md-8">\r\n                            <fc-multiselect value="vm.technicianIds" on-enter="vm.search()" api-method="crewtechs/GetListForCrews" value-prop="TechId" text-prop="UserFirstLastName"></fc-multiselect>\r\n                        </div>\r\n                    </div>\r\n                </div>\x3c!-- col --\x3e\r\n            </div>\x3c!-- row --\x3e\r\n            <div class="row form-horizontal">\r\n                <div class="col-md-10">\r\n                    <div class="form-group" fc-enter="vm.search()">\r\n                        <div class="col-sm-2 col-md-2"><label class="control-label">Sort By</label></div>\r\n                        <div class="col-sm-4 col-md-4 push-right-double">\r\n                            <select class="form-control" name="sortCol" ng-model="vm.filter.sortCol">\r\n                                <option value="AltId">Work Order</option>\r\n                                <option value="Date">Date</option>\r\n                                <option value="TechName">Technician</option>\r\n                            </select>\r\n                        </div>\r\n                        <div class="col-sm-4 col-md-4">\r\n                            <label class="radio-inline">\r\n                                <input id="radioAsc" type="radio" name="sortDirection" class="icheck" value="asc" ng-model="vm.filter.sortDir" fc-enter="vm.search()"> Ascending\r\n                            </label>\r\n                            <label class="radio-inline" style="margin-left: 20px;">\r\n                                <input id="radioDesc" type="radio" name="sortDirection" class="icheck" value="desc" ng-model="vm.filter.sortDir" fc-enter="vm.search()"> Descending\r\n                            </label>\r\n                        </div>\r\n                    </div>\r\n                </div>\x3c!-- col --\x3e\r\n                <div class="col-md-2">\r\n                    <div class="form-group">\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-sm-9 col-md-8 text-right">\r\n                            <button type="submit" class="btn btn-primary" ng-click="vm.search()">Run</button>\r\n                        </div>\r\n                    </div>\r\n                </div>\x3c!-- col --\x3e\r\n            </div>\x3c!-- row --\x3e\r\n        </div>\r\n\r\n        <div class="row">\r\n            <div class="col-sm-12">\r\n                <div class="pull-right">\r\n                    <button type="button" class="btn btn-success add-new-btn" ng-disabled="vm.buttonDisabled" ng-click="vm.exportCSV()">Export CSV</button>\r\n                    <button type="button" class="btn btn-success add-new-btn" ng-disabled="vm.buttonDisabled" ng-click="vm.exportPDF()">Export PDF</button>\r\n                </div>\r\n                <table id="datatable-icons" class="table table-bordered  dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr>\r\n                            <th ng-repeat="attr in vm.attributes">{{attr.Name}}</th>\r\n                        </tr>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr ng-repeat="item in vm.items">\r\n                            <td ng-repeat="attr in vm.attributes" style="position: relative">\r\n                                <span ng-if="attr.CellFormat == \'label\'">\r\n                                    \x3c!-- BUG839 : TimeCard Report and Export not converting date/time to local time --\x3e\r\n                                    \x3c!-- <span ng-if="attr.FormatDate">{{item[attr.ValueName] | date : \'MM/dd/yy\'}}</span> --\x3e\r\n                                    <span ng-if="attr.FormatDate">{{vm.getLocalTime(item[attr.ValueName]) | date : \'MM/dd/yy\'}}</span>\r\n                                    <span ng-if="!attr.FormatDate">{{item[attr.ValueName]}}</span>\r\n                                </span>\r\n                            </td>\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\x3c!-- col --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n        <div class="row" style="margin:0px;">\r\n            <fc-paging page="vm.timeCardMeta.Paging.Page" page-size="vm.timeCardMeta.Paging.PageSize" current-data-length="vm.items.length" total="vm.timeCardMeta.Paging.TotalCount"></fc-paging>\r\n        </div>\x3c!-- row --\x3e\r\n        <div class="row">\r\n            <div class="col-sm-5">\r\n                <div class="dataTables_length" id="datatable-icons_length">\r\n                    <label>\r\n                        Show\r\n                        <select name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.timeCardMeta.Paging.PageSize">\r\n                            <option value="50">50</option>\r\n                        </select> entries\r\n                    </label>\r\n                </div>\r\n            </div>\x3c!-- col --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/BaseReports/workOrderReport.html",'<div id="pcont" class="container-fluid">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Reporting</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Work Order Report</h1>\r\n    </div>\r\n    <div class="cl-mcont" ng-controller="WorkOrderReportController as vm">\r\n        <div class="table-edit-overlay" ng-show="vm.isLoading">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        <div class="clearfix CollapsibleTitle">\r\n            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n        </div>\r\n        <div id="Collapsible" class="collapse in clearfix">\r\n            <div class="row form-horizontal">\r\n                <div class="col-md-6">\r\n                    <div class="form-group" fc-enter="vm.search()">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Customer</label></div>\r\n                        <div class="col-sm-6 col-md-6">\r\n                            <fc-auto-complete-table fc-focusout="vm.focusOut(\'customer\')" name="{{vm.customerAttribute.ModelValue}}" value="vm.filter[vm.customerAttribute.ModelValue]" ng-model="vm.filter[vm.customerAttribute.ModelValue]" maxlength="{{vm.customerAttribute.MaxLength}}" ng-style="{\'display\': \'inline\', \'width\': vm.customerAttribute.InputSufix ? \'auto\' : \'100%\'}" ctr-id="{{vm.customerAttribute.Id}}" api-method="{{vm.customerAttribute.ApiMethod}}" read-only="vm.customerAttribute.ReadOnly" autofocus="vm.customerAttribute.Autofocus" place-holder="{{vm.customerAttribute.PlaceHolder}}" on-select="vm.customerAttribute.onSelect(item)" value-prop="{{vm.customerAttribute.ValueProp}}" attributes="vm.customerAttribute.GridAttributes" page-size="vm.customerAttribute.PageSize" search-by-columns="vm.customerAttribute.SearchCols" search-trigger="vm.customerAttribute.SearchTrigger" show-header="vm.customerAttribute.ShowHeader"></fc-auto-complete-table>\r\n                            \x3c!--<input type="text" name="{{vm.customerAttribute.ModelValue}}" ng-if="!vm.customerAttribute.Required && vm.customerAttribute.ReadOnly" readonly="readonly" ng-model="vm.filter[vm.customerAttribute.ModelValue]" maxlength="{{vm.customerAttribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': vm.customerAttribute.InputSufix ? \'auto\' : \'100%\'}" />--\x3e\r\n                        </div>\r\n                        <div class="col-sm-2 col-md-2">\r\n                            <button class="btn" type=\'button\' ng-click="vm.customerBtn.onClick()">{{vm.customerBtn.Label}}</button>\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group" fc-enter="vm.search()">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Site</label></div>\r\n                        <div class="col-sm-6 col-md-6">\r\n                            <fc-auto-complete-table fc-focusout="vm.focusOut(\'site\')" name="{{vm.siteAttribute.ModelValue}}" value="vm.filter[vm.siteAttribute.ModelValue]" ng-model="vm.filter[vm.siteAttribute.ModelValue]" maxlength="{{vm.siteAttribute.MaxLength}}" ng-style="{\'display\': \'inline\', \'width\': vm.siteAttribute.InputSufix ? \'auto\' : \'100%\'}" ctr-id="{{vm.siteAttribute.Id}}" api-method="{{vm.siteAttribute.ApiMethod}}" read-only="vm.siteAttribute.ReadOnly" autofocus="vm.siteAttribute.Autofocus" place-holder="{{vm.siteAttribute.PlaceHolder}}" on-select="vm.siteAttribute.onSelect(item)" value-prop="{{vm.siteAttribute.ValueProp}}" attributes="vm.siteAttribute.GridAttributes" page-size="vm.siteAttribute.PageSize" search-by-columns="vm.siteAttribute.SearchCols" search-trigger="vm.siteAttribute.SearchTrigger" show-header="vm.siteAttribute.ShowHeader" filter="vm.siteAttribute.filter"></fc-auto-complete-table>\r\n                            \x3c!--<input type="text" name="{{vm.siteAttribute.ModelValue}}" ng-if="!vm.siteAttribute.Required && vm.siteAttribute.ReadOnly" readonly="readonly" ng-model="vm.filter[vm.siteAttribute.ModelValue]" maxlength="{{vm.siteAttribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': vm.siteAttribute.InputSufix ? \'auto\' : \'100%\'}" />--\x3e\r\n                        </div>\r\n                        <div class="col-sm-2 col-md-2">\r\n                            <button class="btn {{vm.siteBtn.CustomInputClass}}" type=\'button\' ng-click="vm.siteBtn.onClick()">{{vm.siteBtn.Label}}</button>\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Office</label></div>\r\n                        <div class="col-sm-8 col-md-8">\r\n                            <fc-dropdown on-enter="vm.search()" value="vm.filter.officeId" api-method="offices" value-prop="Id" text-prop="OfficeName" label="Office"></fc-dropdown>\r\n                        </div>\r\n                    </div>\r\n                    \x3c!-- PBI713 : FCO - Work Order Report: remove Technician filter - DSL-NW --\x3e\r\n                    \x3c!--\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Technician</label></div>\r\n                        <div class="col-sm-8 col-md-8">\r\n                            <fc-dropdown on-enter="vm.search()" value="vm.filter.technicianId" api-method="crewtechs/GetListForCrews" value-prop="TechId" text-prop="UserFirstLastName" convert-to-int="true" label="Technician"></fc-dropdown>\r\n                        </div>\r\n                    </div>\r\n                    --\x3e\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">WO Type</label></div>\r\n                        <div class="col-sm-8 col-md-8">\r\n                            <fc-dropdown on-enter="vm.search()" value="vm.filter.woTypeName" api-method="wotypes" value-prop="WoTypeName" text-prop="WoTypeName" convert-to-int="true" label="WoType"></fc-dropdown>\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Status</label></div>\r\n                        <div class="col-sm-8 col-md-8">\r\n                            <fc-dropdown on-enter="vm.search()" value="vm.filter.woStatusName" api-method="wostatuses" value-prop="WoStatusName" text-prop="WoStatusName" convert-to-int="true" label="WoStatus"></fc-dropdown>\r\n                        </div>\r\n                    </div>\r\n                </div>\x3c!-- col --\x3e\r\n                <div class="col-md-6">\r\n                    <div class="form-group" fc-enter="vm.search()">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">By Date</label></div>\r\n                        <div class="col-sm-8 col-md-8" ng-init="vm.filter.byDate = 1">\r\n                            <div class="col-sm-4 col-md-4"><label class="radio-inline"><input type="radio" name="ByDate" value="1" ng-model="vm.filter.byDate">Promised</label></div>\r\n                            <div class="col-sm-4 col-md-4"><label class="radio-inline"><input type="radio" name="ByDate" value="2" ng-model="vm.filter.byDate">Request</label></div>\r\n                            \x3c!-- BUG128 :Entered date is not displayed for all Work Order report records --\x3e\r\n                            \x3c!--<div class="col-sm-4 col-md-4"><label class="radio-inline"><input type="radio" name="ByDate" value="3" ng-model="vm.filter.byDate">Enter</label></div>--\x3e\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group datepicker-div" fc-enter="vm.search()">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">Start Date</label></div>\r\n                        <div data-min-view="2" class="input-group date datetime col-sm-4 col-md-4" date-time-append="">\r\n                            \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                            \x3c!-- <input name="StartDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                            <input name="StartDate" onpaste="return false;" restrict-to="{{vm.dateService.restrictToDate()}}" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                            \x3c!-- BUG87 : END --\x3e\r\n                            <span class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon glyphicon-calendar"></span>\r\n                            </span>\r\n                        </div>\r\n                    </div>\r\n                    <div class="form-group datepicker-div" fc-enter="vm.search()">\r\n                        <div class="col-sm-4 col-md-4"><label class="control-label">End Date</label></div>\r\n                        <div data-min-view="2" class="input-group date datetime col-sm-4 col-md-4" date-time-append="">\r\n                            \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                            \x3c!-- <input name="EndDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                            <input name="EndDate" onpaste="return false;" restrict-to="{{vm.dateService.restrictToDate()}}" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                            \x3c!-- BUG87 : END --\x3e\r\n                            <span class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon glyphicon-calendar"></span>\r\n                            </span>\r\n                        </div>\r\n                    </div>\r\n                </div>\x3c!-- col --\x3e\r\n            </div>\x3c!-- row --\x3e\r\n\r\n            \x3c!--<div class="row">\r\n                <div class="form-group col-sm-6 col-md-6">\r\n                    <div class="col-sm-4 col-md-4"><label class="control-label">Work Order</label></div>\r\n                    <div class="col-sm-8 col-md-8">\r\n                        <input fc-enter="vm.search()" type="number" decimal decimals="0" class="form-control" ng-model="vm.filter.workOrdernumber">\r\n                    </div>\r\n                </div>\r\n            </div>--\x3e\x3c!-- row --\x3e\r\n            \x3c!--<div class="row">\r\n                <div class="form-group col-sm-6 col-md-6">\r\n                    <div class="col-sm-4 col-md-4"><label class="control-label">Project Id</label></div>\r\n                    <div class="col-sm-8 col-md-8">\r\n                        <input fc-enter="vm.search()" type="number" decimal decimals="0" class="form-control" ng-model="vm.filter.projectId">\r\n                    </div>\r\n                </div>\r\n            </div>--\x3e\x3c!-- row --\x3e\r\n\r\n            <div class="row form-horizontal">\r\n                <div class="col-md-10">\r\n                    <div class="form-group" fc-enter="vm.search()">\r\n                        <div class="col-sm-2 col-md-2"><label class="control-label">Sort By</label></div>\r\n                        <div class="col-sm-4 col-md-4" style="margin-left:43px;">\r\n                            <select class="form-control" name="sortCol" ng-model="vm.filter.sortCol">\r\n                                <option value="AltId">Work Order</option>\r\n                                <option value="PromiseDate">Date</option>\r\n                                <option value="CustomerName">Customer</option>\r\n                            </select>\r\n                        </div>\r\n                        <div class="col-sm-4 col-md-4">\r\n                            <label class="radio-inline">\r\n                                <input id="radioAsc" type="radio" name="sortDirection" class="icheck" value="asc" ng-model="vm.filter.sortDir" fc-enter="vm.search()"> Ascending\r\n                            </label>\r\n                            <label class="radio-inline" style="margin-left: 20px;">\r\n                                <input id="radioDesc" type="radio" name="sortDirection" class="icheck" value="desc" ng-model="vm.filter.sortDir" fc-enter="vm.search()"> Descending\r\n                            </label>\r\n                        </div>\r\n                    </div>\r\n                </div>\x3c!-- col --\x3e\r\n                <div class="col-md-2">\r\n                    <div class="form-group">\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-sm-9 col-md-8 text-right">\r\n                            <button type="submit" class="btn btn-primary" ng-click="vm.search()">Run</button>\r\n                        </div>\r\n                    </div>\r\n                </div>\x3c!-- col --\x3e\r\n            </div>\x3c!-- row --\x3e\r\n        </div>\r\n\r\n        <div class="row">\r\n            <div class="col-sm-12">\r\n                <div class="pull-right">\r\n                    <button type="button" class="btn btn-success add-new-btn" ng-disabled="vm.buttonDisabled" ng-click="vm.exportCSV()">Export CSV</button>\r\n                    <button type="button" class="btn btn-success add-new-btn" ng-disabled="vm.buttonDisabled" ng-click="vm.exportPDF()">Export PDF</button>\r\n                </div>\r\n                <table id="datatable-icons" class="table table-bordered  dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr>\r\n                            <th ng-repeat="attr in vm.attributes">{{attr.Name}}</th>\r\n                        </tr>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr ng-repeat="item in vm.items">\r\n                            <td ng-repeat="attr in vm.attributes" style="position: relative">\r\n                                <span ng-if="attr.CellFormat == \'label\'">\r\n                                    <span ng-if="attr.FormatDate">{{item[attr.ValueName] | date : \'MM/dd/yy\'}}</span>\r\n                                    <span ng-if="!attr.FormatDate">{{item[attr.ValueName]}}</span>\r\n                                </span>\r\n                            </td>\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\x3c!-- col --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n        <div class="row" style="margin:0px;">\r\n            <fc-paging page="vm.workOrderMeta.Paging.Page" page-size="vm.workOrderMeta.Paging.PageSize" current-data-length="vm.items.length" total="vm.workOrderMeta.Paging.TotalCount"></fc-paging>\r\n        </div>\x3c!-- row --\x3e\r\n        <div class="row">\r\n            <div class="col-sm-5">\r\n                <div class="dataTables_length" id="datatable-icons_length">\r\n                    <label>\r\n                        Show\r\n                        <select name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.workOrderMeta.Paging.PageSize">\r\n                            <option value="50">50</option>\r\n                        </select> entries\r\n                    </label>\r\n                </div>\r\n            </div>\x3c!-- col --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/CompanyFeature/companyFeature.html",'<div id="pcont" class="container-fluid" ng-controller="CompanyFeatureController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.goHome()">Home</a></li>\r\n            <li class="active">CompanyFeature</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n    </div>\r\n    <div class="table-edit-overlay" ng-show="vm.loadingData">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n\r\n                    <div class="content">\r\n                    <h2 style="color: #5e94ff">Companies</h2>\r\n                        <div class="col-sm-12"  id="companyFeature">\r\n                            <div id="datatable-icons_filter" class="dataTables_filter" style="text-align:left">\r\n                                <label>Search:<i class="fa fa-info-circle" style="display: none"></i><input type="search" class="form-control input-sm" placeholder="" aria-controls="datatable-icons" fc-enter="vm.searchCompanies()" ng-model="vm.searchCompaniesText"></label>\r\n                            </div>\r\n                        </div>\r\n                        <div  id="companyFeatureGrid">\r\n                            <fc-table api-method="companyinfos/companyforfeature"\r\n                                      attributes="vm.attributesCompany"\r\n                                      selected="vm.companyID"\r\n                                      filter="vm.filterCompany">\r\n                            </fc-table>\r\n                        </div>\r\n                        \r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n        <div class="row">\r\n            <div class="col-md-12"  id="hidesearch" ng-if="vm.reloadTable">\r\n                <div class="block-flat">\r\n                    <h2 style="color: #5e94ff">Features</h2>\r\n                    <div class="content">\r\n                        <div id="companyFeature">\r\n                            <fc-editable-table-drill-down \r\n                                               api-method="companyfeatures"\r\n                                               attributes="vm.attributesFeature"\r\n                                               on-submit="vm.submit(item)"\r\n                                               child-api-method="companyfeatures/parameter/getforgrid"\r\n                                               child-attributes="vm.attributesParameter"\r\n                                               model="vm.model"\r\n                                               filter="vm.filterFeatures"\r\n                                               ng-if="vm.reloadTable"\r\n                                               value-model-name="FeatureName"\r\n                                               sort="FeatureName"\r\n                                               value="Active"\r\n                                               child-value-model-name="ParameterName"\r\n                                               child-collection-name="CompanyFeatureParameters"\r\n                                               child-value="Value"\r\n                                               child-indicator-name="HasParameters"\r\n                                               child-filter="vm.childFilter"\r\n                                               submit-notification-text="{{vm.submitText}}">\r\n                            </fc-editable-table-drill-down>\r\n                        </div>\r\n\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Deficiency/deficiencyEdit.html",'<div id="pcont" class="container-fluid" ng-controller="DeficiencyEditController as vm">\r\n    <div class="table-edit-overlay" ng-show="vm.isLoading">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    \x3c!-- end --\x3e\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li ng-if="!vm.fromHome"><a class="cursor_pointer" ng-click="vm.$state.go(\'manageDeficiency\')">Manage Deficiencies</a></li>\r\n            <li class="active">Deficiency</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Deficiency</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="deficiency"\r\n                       id="{{vm.id}}"\r\n                       attributes="vm.editAttributes"\r\n                       model="vm.model"\r\n                       view-name="{{vm.viewName}}"\r\n                       module-name="{{vm.moduleName}}"\r\n                       on-back="vm.onBack(insertData)"\r\n                       hide-submit="vm.isConverted"></fc-table-edit>\r\n        <div class="row form-horizontal" ng-show="vm.id">\r\n            <div class="col-md-12">\r\n                <div id="accordion" class="panel-group accordion">\r\n                    \x3c!-- notes --\x3e\r\n\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <strong class="panel-title">\r\n                                <a id="collapseDNotesToggle" data-toggle="collapse" data-parent="#accordion" data-target="#collapseDNotes" class="collapsed" aria-expanded="false">\r\n                                    Notes<i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                </a>\r\n                            </strong>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseDNotes" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body">\r\n                                <div class="block-flat">\r\n                                    <div class="content">\r\n                                        <fc-table table-name="Deficiency Notes"\r\n                                                  api-method="deficiencyNote"\r\n                                                  attributes="vm.noteAttributesGrid"\r\n                                                  on-edit="vm.editNote(id)"\r\n                                                  filter="vm.deficiencyFilter"\r\n                                                  ng-if="vm.reloadTable"\r\n                                                  show-add-new="!vm.isReadOnly"\r\n                                                  show-delete-column="!vm.isReadOnly"\r\n                                                  delete-message-format=\'Are you sure you want to delete Note "%Note%"?\'></fc-table>\r\n                                    </div>\x3c!-- content --\x3e\r\n                                </div>\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\r\n\r\n                    \x3c!-- attachments --\x3e\r\n\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <strong class="panel-title">\r\n                                <a id="collapseDAttachmentsToggle" data-toggle="collapse" data-parent="#accordion" data-target="#collapseDAttachments" class="collapsed" aria-expanded="false">\r\n                                    Attachments<i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                </a>\r\n                            </strong>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseDAttachments" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body">\r\n                                <div class="block-flat">\r\n                                    <div class="content">\r\n                                        <fc-table table-name="Deficiency Attachments"\r\n                                                  api-method="deficiencyAttachment"\r\n                                                  attributes="vm.attachmentAttributesGrid"\r\n                                                  on-edit="vm.editAttachment(id)"\r\n                                                  filter="vm.deficiencyFilter"\r\n                                                  ng-if="vm.reloadTable"\r\n                                                  show-add-new="!vm.isReadOnly"\r\n                                                  show-delete-column="!vm.isReadOnly"\r\n                                                  delete-message-format=\'Are you sure you want to delete Attachment "%AttachmentName%"?\'></fc-table>\r\n                                    </div>\x3c!-- content --\x3e\r\n                                </div>\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\r\n                </div>\x3c!-- accordion --\x3e\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Deficiency/manageDeficiency.html",'\r\n<div id="pcont" class="container-fluid">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Manage Deficiencies</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Manage Deficiencies</h1>\r\n    </div>\r\n    <div class="cl-mcont" ng-controller="ManageDeficiencyController as vm">\r\n        \x3c!-- LOADING SPINNER --\x3e\r\n        <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        \x3c!-- LOADING SPINNER END --\x3e\r\n        <div class="clearfix CollapsibleTitle">\r\n            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n        </div>\r\n        <div id="Collapsible" class="collapse in clearfix">\r\n\r\n            <div class="panel-body">\r\n                <fc-table-edit api-method=""\r\n                               model="vm.filtermodel"\r\n                               on-enter="vm.reloadData()"\r\n                               attributes="vm.attributesFilter"\r\n                               on-submit="vm.reloadData()"\r\n                               on-back="clearFilters()"\r\n                               custom-focus="vm.focusOut(attribute)"\r\n                               back-button-text="Clear"\r\n                               submit-button-text="Search"\r\n                               hide-cancel="true"></fc-table-edit>\r\n            </div>\r\n\r\n        </div>\x3c!-- Collapsible section end --\x3e\r\n\r\n        <div class="row" id="deficienciesTable">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <fc-table api-method="deficiency/detail"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(item)"\r\n                                  ng-if="vm.loadData"\r\n                                  filter="vm.filterDeficiencies"\r\n                                  show-delete-column="false"\r\n                                  show-search="false"\r\n                                  show-add-new="false"></fc-table>\r\n                    </div>\x3c!-- content   --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>'),e.put("Templates/Dispatch/DispatchCalendar/dispatchCalendar.html",'<div class="table-edit-overlay" ng-show="vm.loadingData">\r\n    <div class="sk-circle">\r\n        <div class="sk-circle1 sk-child"></div>\r\n        <div class="sk-circle2 sk-child"></div>\r\n        <div class="sk-circle3 sk-child"></div>\r\n        <div class="sk-circle4 sk-child"></div>\r\n        <div class="sk-circle5 sk-child"></div>\r\n        <div class="sk-circle6 sk-child"></div>\r\n        <div class="sk-circle7 sk-child"></div>\r\n        <div class="sk-circle8 sk-child"></div>\r\n        <div class="sk-circle9 sk-child"></div>\r\n        <div class="sk-circle10 sk-child"></div>\r\n        <div class="sk-circle11 sk-child"></div>\r\n        <div class="sk-circle12 sk-child"></div>\r\n    </div>\r\n</div>\r\n\r\n<fc-filter-sidebar class="cl-sidebar" id="dispatch-calendar-sidebar">\r\n    <br />\r\n    <div style="margin-left:18px; margin-right:16px;">\r\n        \x3c!--<fc-tabs id="filter_tabs" ng-click="vm.getAssignedTech()" tab="vm.filterTab">--\x3e\r\n        <fc-tabs id="filter_tabs" tab="vm.filterTab" style="overflow-y: scroll;">\r\n            \x3c!--BUG 220--\x3e\r\n            <div fc-tab="Techs">\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n                            Groups\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect on-enter="vm.getAssignedTech()" class="multiselectSidebar fc-font-14" value="vm.laborGroups" api-method="laborgroups" value-prop="Id" text-prop="Name" current-list="vm.laborGroupList" items-loaded="vm.laborGroupsLoaded"></fc-multiselect>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n                            Technician\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect on-enter="vm.getAssignedTech()" ng-if="vm.initialLaborGroupsSelected" class="multiselectSidebar fc-font-14" value="vm.technicianIds" show-none="All" api-method="employees/getTechnicianByLaborGroup" value-prop="Id" text-prop="FullName" filter="vm.techsFilter" items-loaded="vm.initialTechsLoaded"></fc-multiselect>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group" style="padding-top: 10px;">\r\n                    <div class="col-md-12" style="margin-left: -4px;">\r\n                        <button class="btn btn-default fc-font-14" ng-click="vm.getAssignedTech()"><i class="fa  fa-check fc-font-14"></i>&nbsp;Apply</button>\r\n                        <button class="btn btn-default fc-font-14" ng-click="vm.clearFilters()"><i class="fa  fa-times-circle fc-font-14"></i>&nbsp;Clear</button>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n\r\n            <div fc-tab="Filters">\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n                            Assignment Status\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect class="fc-font-14" on-enter="vm.getAssignedTech()" value="vm.unformatedFilterAssigned.assignmentStatusIds" api-method="assignmentstatuses" value-prop="Id" text-prop="AssignmentStatusName" />\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n                            Work Order Type\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect class="fc-font-14" on-enter="vm.getAssignedTech()" value="vm.unformatedFilterAssigned.workOrderTypeIds" api-method="wotypes" value-prop="Id" text-prop="WoTypeName" />\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n                            Work Order Status\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect class="fc-font-14" on-enter="vm.getAssignedTech()" value="vm.unformatedFilterAssigned.workOrderStatusIds" api-method="wostatuses" value-prop="Id" text-prop="WoStatusName" />\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n                            Problem Code\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect class="fc-font-14" on-enter="vm.getAssignedTech()" value="vm.unformatedFilterAssigned.problemCodeIds" api-method="woassignments/allforproblemcode" value-prop="Id" text-prop="ProblemCodeName" />\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n                            Office\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect class="fc-font-14" on-enter="vm.getAssignedTech()" value="vm.unformatedFilterAssigned.officeIds" api-method="offices" value-prop="Id" text-prop="OfficeName" />\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group" style="padding-top: 10px;">\r\n                    <div class="col-md-12" style="margin-left: -4px;">\r\n                        <button class="btn btn-default fc-font-14" ng-click="vm.getAssignedTech()"><i class="fa  fa-check fc-font-14"></i> Apply</button>\r\n                        <button class="btn btn-default fc-font-14" ng-click="vm.clearFilters()"><i class="fa  fa-times-circle fc-font-14"></i> Clear</button>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n\r\n            \x3c!-- --\x3e\r\n            <div fc-tab="Unassign">\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n                            From Date\r\n                        </label>\r\n                    </div>\r\n                    <div class="col-md-12">\r\n                        <div data-min-view="2" class="input-group date datetime" date-time-append="">\r\n                            <input name="FromDate"\r\n                                   ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()"\r\n                                   type="datetime"\r\n                                   date-time=""\r\n                                   ng-model="vm.fromDate"\r\n                                   fc-autofocus="attribute.Autofocus"\r\n                                   format="MM/dd/yyyy"\r\n                                   auto-close="true"\r\n                                   min-view="date"\r\n                                   max-view="date"\r\n                                   class="form-control ng-scope ng-valid fc-dispatch-font-size"\r\n                                   style="height: 35px !important;">\r\n                            <span class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon glyphicon-calendar fc-dispatch-font-size"></span>\r\n                            </span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n                            To Date\r\n                        </label>\r\n                    </div>\r\n                    <div class="col-md-12">\r\n                        <div data-min-view="2" class="input-group date datetime" date-time-append="">\r\n                            <input name="ToDate"\r\n                                   ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()"\r\n                                   type="datetime"\r\n                                   date-time=""\r\n                                   ng-model="vm.toDate"\r\n                                   fc-autofocus="attribute.Autofocus"\r\n                                   format="MM/dd/yyyy"\r\n                                   auto-close="true"\r\n                                   min-view="date"\r\n                                   max-view="date"\r\n                                   class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid fc-font-14"\r\n                                   style="height: 35px !important;">\r\n                            <span class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon glyphicon-calendar fc-font-14"></span>\r\n                            </span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n\r\n                        </label>\r\n                    </div>\r\n                    <div class="col-md-12">\r\n                        <div class="icheckbox_square-blue checkbox col-md-1" ng-class="{ \'checked\': vm.showUnassignedFlag}" ng-click="vm.showUnassigned()">\r\n                            <input type="checkbox" class="icheck fc-font-14" style="position: absolute; opacity: 0;" />\r\n                            <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                        </div>\r\n\r\n                        <label class="col-md-1 disable-text-selection fc-font-14">\r\n                            Unassigned\r\n                        </label>\r\n                    </div>\r\n                </div>\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n\r\n                        </label>\r\n                    </div>\r\n                    <div class="col-md-12">\r\n                        <div class="icheckbox_square-blue checkbox col-md-1" ng-class="{ \'checked\': vm.showUnscheduledFlag}" ng-click="vm.showUnscheduled()">\r\n                            <input type="checkbox" class="icheck fc-font-14" style="position: absolute; opacity: 0;" />\r\n                            <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                        </div>\r\n\r\n                        <label class="col-md-1 disable-text-selection fc-font-14">\r\n                            Unscheduled\r\n                        </label>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n\r\n            \x3c!-- tab template\r\n\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n\r\n                        </label>\r\n                    </div>\r\n                    <div class="col-md-12">\r\n\r\n                    </div>\r\n                </div>\r\n\r\n            --\x3e\r\n        </fc-tabs>\r\n    </div>\r\n</fc-filter-sidebar>\r\n<div id="pcont" class="container-fluid sidebarTemplate">\r\n    <div style="display:table;width:100%;position:relative;height:100%;padding-bottom:20px">\r\n        <div class="page-head" style="display:table-row;">\r\n            <ol class="breadcrumb">\r\n                <li><a href="#">Home</a></li>\r\n                \x3c!--<li><a href="#">Dispatch</a></li>--\x3e\r\n                <li class="active">Dispatch Calendar</li>\r\n            </ol>\r\n            \x3c!-- breadcrumb --\x3e\r\n        </div>\r\n        <div style="height: 8px;">&nbsp;</div>\r\n        <div id="dispatch-calendar" style="display:table-row; height:100%;">\r\n            <div class="cl-mcont" style="height:100%;position:relative;">\r\n                \x3c!--<div style="display:table; height: 575px; width:100%; position:relative">--\x3e\r\n                <div style="display:table; height: 97%; width:100%; position:relative; padding-top: 6px;">\r\n                    <div style="display:table-row">\r\n                        <div id="dispatch-calendar-navigation" class="row" style="margin-left: 15px; margin-bottom: 10px; text-align:center">\r\n                            <div class="btn-group pull-left">\r\n                                <button type="button" class="btn btn-default fc-dispatch-font-size" ng-click="vm.changeView(\'day\')" ng-class="{active: vm.currentCalendarView == \'day\'}" style="outline: 0px;">Day</button>\r\n                                <button type="button" class="btn btn-default fc-dispatch-font-size" ng-click="vm.changeView(\'threedays\')" ng-class="{active: vm.currentCalendarView == \'threedays\'}">3 Days</button>\r\n                                <button type="button" class="btn btn-default fc-dispatch-font-size" ng-click="vm.changeView(\'week\')" ng-class="{active: vm.currentCalendarView == \'week\'}">Week</button>\r\n                                <button type="button" class="btn btn-default fc-dispatch-font-size" ng-click="vm.changeView(\'month\')" ng-class="{active: vm.currentCalendarView == \'month\'}">Month</button>\r\n                                <button style="margin-left: 10px;" type="button" class="btn btn-default fc-dispatch-font-size dispatch-navbar-icons" title="Chart/Calendar" ng-click="vm.toggleChart()" ng-class="{active: vm.currentCalendarView == \'calendar\'}"><i id="calendarChart" class="glyphicon glyphicon-list-alt"></i></button>\r\n                                <button id="button-unassigned-list" type="button" class="btn btn-default fc-dispatch-font-size active dispatch-navbar-icons" title="Unassigned Grid" ng-click="vm.toggleUnassignedList()"><i class="glyphicon glyphicon-th-list"></i></button>\r\n                                <button id="button-map" type="button" class="btn btn-default fc-dispatch-font-size dispatch-navbar-icons" title="Map" ng-click="vm.toggleMap()"><i class="glyphicon glyphicon-globe"></i></button>\r\n                                <button style="margin-left: 10px;" id="button-resize" type="button" class="btn btn-default fc-dispatch-font-size dispatch-navbar-icons" title="Expand Calendar" ng-click="vm.expandCalendarToggle()"><i class="glyphicon glyphicon-resize-horizontal"></i></button>\r\n                                <button style="margin-left: 10px;" id="button-settings" type="button" ng-click="vm.calendarSettings()" class="btn btn-default fc-dispatch-font-size dispatch-navbar-icons" title="Settings"><i class="glyphicon glyphicon-cog"></i></button>\r\n                            </div>\r\n                            <div class="btn-group" style="display:inline-block; padding-right: 60px;">\r\n                                <button type="button" class="btn btn-default fc-dispatch-font-size dispatch-navbar-icons" ng-click="vm.goPrevDay()"><i class="glyphicon glyphicon-arrow-left"></i></button>\r\n                                \x3c!-- US2762 : FCO - Web - Need some UI changes to Dispatch Calendar --\x3e\r\n                                \x3c!-- <button type="button" class="btn btn-default" ng-click="vm.goToday()">today</button> --\x3e\r\n                                <button type="button" class="btn btn-default fc-dispatch-font-size" ng-click="vm.goToday()">Today</button>\r\n                                \x3c!-- US2762 : END --\x3e\r\n                                <button type="button" class="btn btn-default fc-dispatch-font-size dispatch-navbar-icons" ng-click="vm.goNextDay()"><i class="glyphicon glyphicon-arrow-right"></i></button>\r\n                            </div>\r\n                            <div class="form-inline pull-right" style="margin-top: -7px;">\r\n                                <div class="form-group">\r\n                                    <label class="control-label paddingRight15 fc-dispatch-font-size">Select Date: </label>\r\n                                    <div class="input-group date datetime" style="box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.12), 1px 1px 0 rgba(255, 255, 255, 0.1) inset;" date-time-append>\r\n                                        <input type="text" style="height: 35px;" date-time ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.calendarDate" format="MM/dd/yyyy" auto-close="true" min-view="date" view="date" max-view="date" class="form-control fc-dispatch-font-size"></input>\r\n                                        <span class="input-group-addon btn btn-white " style="height: 32px;">\r\n                                            <i class="glyphicon glyphicon-calendar "></i>\r\n                                        </span>\r\n                                    </div>\r\n                                </div>\r\n                                <div class="form-group">\r\n                                    <button type="button" class="btn btn-primary form-control push-left fc-dispatch-font-size dispatch-navbar-icons" style="margin-bottom:0px !important; height: 35px !important; padding-right: 10px !important;" ng-click="vm.searchDate()"><i class="glyphicon glyphicon-search"></i></button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div id="dispatch-calendar-panel" style="display:table-row; height:100%;">\r\n                        <div id="daypilot-calendar" style="white-space: nowrap;"></div><div id="daypilot-month"></div>\r\n                        <div id="dispatch-map" ng-if="vm.mapVisible" style="width: 39%; height: 100%; border: 1px solid #999999; float: right;">\r\n                            <leaflet id="open-street-maps" defaults="vm.defaults" bounds="vm.bounds" markers="vm.markers" width="100%" style="min-height: 100%; resize: vertical;" ng-if="vm.usingGeoCodeFarm"></leaflet>\r\n                            <div id="googleContainer" ng-if="vm.usingGoogleMaps" style="height: 100% !important;" ng-controller="GoogleMapsController as map">\r\n                                <div id="map" style="height: 100% !important;"></div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n\r\n                    \x3c!-- TASK861 : FCO - Dispatch Calendar: height of calendar and grid - DSL-NW --\x3e\r\n                    \x3c!-- <div id="unassigned-grid-wrapper" style="display:table-row; height:305px;"> --\x3e\r\n                    <div id="unassigned-grid-wrapper" style="display:table-row; height: 205px;">\r\n                        \x3c!--US2601 : FCO - Web - Dispatch page enhancements --\x3e\r\n                        <div class="content" id="unassignedGrid" style="padding-top: 15px; width: 100%;">\r\n                            \x3c!-- grid definition --\x3e\r\n                            \x3c!-- <div id="unassignedGrid" class="fc-scrollable" style="height: 305px; border: 1px solid #999999;"> --\x3e\r\n                            <div id="unassignedGridList" class="fc-scrollable" style="height: 205px; border: 1px solid #999999;">\r\n                                <table id="ua-table" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info" style="margin-top: 0px !important;">\r\n                                    <thead style="position: -webkit-sticky; position: sticky; top: 1px; z-index: 100; background-color: white;">\r\n                                        <tr role="row" class="disable-text-selection">\r\n                                            <th class="fc-dispatch-font-size" ng-repeat="th in vm.gridHeader" ng-if="vm.hideCol(th.pid)" ng-click="vm.sort(th.field)" ng-class="{sorting: true, sorting_asc: !vm.reverse && vm.sortCol == th.field, sorting_desc: vm.reverse && vm.sortCol == th.field}">{{th.data}}</th>\r\n                                        </tr>\r\n                                    </thead>\r\n                                    <tbody style="margin-top: 1px;">\r\n                                        <tr class="ua-row disable-text-selection" ng-repeat="rec in vm.unassignments | orderBy:vm.sortKey:vm.reverse | filter:unassignedFilter | filter:dateFilter" id="{{rec.Id}}"\r\n                                            ng-mousedown="vm.enableCalDnD(rec.EstHours, rec.Id)" ng-click="vm.enableCalClick(rec.WoId, rec.Id)" style="cursor: pointer;">\r\n                                            \x3c!-- PBI623 - TASK628 : FCO web ui: Dispatch Calendar --\x3e\r\n                                            <td class="fc-dispatch-font-size" ng-repeat="attr in vm.gridHeader" ng-if="vm.hideCol(attr.pid)" style="position: relative; white-space: nowrap;">\r\n                                                \x3c!-- BUG1211 : FCO - Handling leap year; February 29th --\x3e\r\n                                                \x3c!-- <span ng-if="attr.FormatDate">{{rec[attr.field] | date : \'MM/dd/yy\'}}</span> --\x3e\r\n                                                <span ng-if="attr.FormatDate">{{vm.convertToLocal(rec[attr.field]) | date : \'MM/dd/yy\'}}</span>\r\n                                                <span ng-if="!attr.FormatDate">{{rec[attr.field]}}</span>\r\n                                            </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n                            </div>\r\n                        </div>\r\n                        \x3c!-- US2601 : END --\x3e\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>'),e.put("Templates/Dispatch/DispatchCalendar/dispatchChart.html",'<div class="table-edit-overlay" ng-show="vm.loadingData">\r\n    <div class="sk-circle">\r\n        <div class="sk-circle1 sk-child"></div>\r\n        <div class="sk-circle2 sk-child"></div>\r\n        <div class="sk-circle3 sk-child"></div>\r\n        <div class="sk-circle4 sk-child"></div>\r\n        <div class="sk-circle5 sk-child"></div>\r\n        <div class="sk-circle6 sk-child"></div>\r\n        <div class="sk-circle7 sk-child"></div>\r\n        <div class="sk-circle8 sk-child"></div>\r\n        <div class="sk-circle9 sk-child"></div>\r\n        <div class="sk-circle10 sk-child"></div>\r\n        <div class="sk-circle11 sk-child"></div>\r\n        <div class="sk-circle12 sk-child"></div>\r\n    </div>\r\n</div>\r\n<fc-filter-sidebar class="cl-sidebar" id="dispatch-calendar-sidebar">\r\n    <br />\r\n    <div style="margin-left:18px; margin-right:16px">\r\n\r\n        \x3c!--<fc-tabs id="filter_tabs" ng-click="vm.getAssignedTech()" tab="vm.filterTab">--\x3e\r\n        <fc-tabs id="filter_tabs" ng-click="vm.getAssignedTech()" tab="vm.filterTab">\r\n            \x3c!--BUG 220--\x3e\r\n            <div fc-tab="Techs">\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label>\r\n                            Groups\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect on-enter="vm.getAssignedTech()" class="multiselectSidebar" value="vm.laborGroups" api-method="laborgroups" value-prop="Id" text-prop="Name" current-list="vm.laborGroupList" items-loaded="vm.laborGroupsLoaded"></fc-multiselect>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label>\r\n                            Technician\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect on-enter="vm.getAssignedTech()" ng-if="vm.initialLaborGroupsSelected" class="multiselectSidebar" value="vm.technicianIds" show-none="All" api-method="employees/getTechnicianByLaborGroup" value-prop="Id" text-prop="FullName" filter="vm.techsFilter" items-loaded="vm.initialTechsLoaded"></fc-multiselect>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <button class="btn btn-default" ng-click="vm.getAssignedTech()"><i class="fa  fa-check"></i> Apply Filters</button>\r\n                        <button class="btn btn-default" ng-click="vm.clearFilters()"><i class="fa  fa-times-circle"></i>Clear</button>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n\r\n            <div fc-tab="Filters">\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label>\r\n                            Assignment Status\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect on-enter="vm.getAssignedTech()" value="vm.unformatedFilterAssigned.assignmentStatusIds" api-method="assignmentstatuses" value-prop="Id" text-prop="AssignmentStatusName" />\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label>\r\n                            Work Order Type\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect on-enter="vm.getAssignedTech()" value="vm.unformatedFilterAssigned.workOrderTypeIds" api-method="wotypes" value-prop="Id" text-prop="WoTypeName" />\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label>\r\n                            Work Order Status\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect on-enter="vm.getAssignedTech()" value="vm.unformatedFilterAssigned.workOrderStatusIds" api-method="wostatuses" value-prop="Id" text-prop="WoStatusName" />\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label>\r\n                            Problem Code\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect on-enter="vm.getAssignedTech()" value="vm.unformatedFilterAssigned.problemCodeIds" api-method="woassignments/allforproblemcode" value-prop="Id" text-prop="ProblemCodeName" />\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label>\r\n                            Office\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect on-enter="vm.getAssignedTech()" value="vm.unformatedFilterAssigned.officeIds" api-method="offices" value-prop="Id" text-prop="OfficeName" />\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <button class="btn btn-default" ng-click="vm.getAssignedTech()"><i class="fa  fa-check"></i> Apply Filters</button>\r\n                        <button class="btn btn-default" ng-click="vm.clearFilters()"><i class="fa  fa-times-circle"></i> Clear</button>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n            \x3c!-- US2601 : FCO - Web - Dispatch page enhancements --\x3e\r\n            \x3c!-- <div fc-tab="Unassigned"> --\x3e\r\n            <div fc-tab="Unassigned" ng-if="vm.showUnassignedTab">\r\n                <div class="col-md-12 fc_tab_Unassigned" style="display:inline-block; align-content:center; height:100%">\r\n                    <div class="block-flat" style="display:inline-block; align-content:center;">\r\n                        <div class="content scrollable" style="display:inline-block; align-content:center; height:700px">\r\n                            <div id="external-events" ng-repeat="opt in vm.unassignments">\r\n                                <div class="external-event external-events-class" id="{{opt.Id}}">{{ opt.ContactFullName }}</div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </fc-tabs>\r\n    </div>\r\n</fc-filter-sidebar>\r\n<div id="pcont" class="container-fluid sidebarTemplate">\r\n    <div style="display:table;width:100%;position:relative;height:100%;padding-bottom:20px">\r\n        <div class="page-head" style="display:table-row;">\r\n            <ol class="breadcrumb">\r\n                <li><a href="#">Home</a></li>\r\n                \x3c!--<li><a href="#">Dispatch</a></li>--\x3e\r\n                <li class="active">Dispatch Chart</li>\r\n            </ol>\r\n            \x3c!-- breadcrumb --\x3e\r\n        </div>\r\n        <div style="display:table-row; height:100%">\r\n            <div class="cl-mcont" style="height:100%;position:relative;">\r\n                \x3c!--<div style="display:table; height: 575px; width:100%; position:relative">--\x3e\r\n                <div style="display:table; height: 95%; width:100%; position:relative">\r\n                    <div style="display:table-row">\r\n                        <div class="row" style="margin-left: 0px; margin-right: 0px; margin-bottom: 10px; text-align:center">\r\n                            <div class="btn-group pull-left">\r\n                                <button type="button" class="btn btn-default" ng-click="vm.changeView(\'day\')" ng-class="{active: vm.currentCalendarView == \'day\'}">Day</button>\r\n                                <button type="button" class="btn btn-default" ng-click="vm.changeView(\'threedays\')" ng-class="{active: vm.currentCalendarView == \'threedays\'}">3 Days</button>\r\n                                <button type="button" class="btn btn-default" ng-click="vm.changeView(\'week\')" ng-class="{active: vm.currentCalendarView == \'week\'}">Week</button>\r\n                                <button type="button" class="btn btn-default" ng-click="vm.changeView(\'month\')" ng-class="{active: vm.currentCalendarView == \'month\'}">Month</button>\r\n                                \x3c!-- bb --\x3e\r\n                                <button style="margin-left: 10px;" type="button" class="btn btn-default" ng-click="vm.goCalendar()" ng-class="{active: vm.currentCalendarView == \'chart\'}">Calendar View</button>\r\n                            </div>\r\n                            <div style="display:inline-block">\r\n                                <button type="button" class="btn btn-default" ng-click="vm.goPrevDay()"><</button>\r\n                                \x3c!-- US2762 : FCO - Web - Need some UI changes to Dispatch Calendar --\x3e\r\n                                \x3c!-- <button type="button" class="btn btn-default" ng-click="vm.goToday()">today</button> --\x3e\r\n                                <button type="button" class="btn btn-default" ng-click="vm.goToday()">Today</button>\r\n                                \x3c!-- US2762 : END --\x3e\r\n                                <button type="button" class="btn btn-default" ng-click="vm.goNextDay()">></button>\r\n                            </div>\r\n                            <div class="form-inline pull-right">\r\n                                <div class="form-group">\r\n                                    <label class="control-label">Select Date: </label>\r\n                                    <div class="input-group date datetime paddingLeft15" date-time-append>\r\n                                        <input type="text" date-time ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.calendarDate" format="MM/dd/yyyy" auto-close="true" min-view="date" view="date" max-view="date" class="form-control"></input>\r\n                                        <span class="input-group-addon btn btn-white">\r\n                                            <i class="glyphicon glyphicon-calendar"></i>\r\n                                        </span>\r\n                                    </div>\r\n                                </div>\r\n                                <div class="form-group">\r\n                                    <button type="button" class="btn btn-primary form-control" style="margin-bottom:0px !important" ng-click="vm.searchDate()">Search</button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div style="display:table-row; height:100%">\r\n                        <div id="daypilot-calendar"></div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n        <div style="display:table-row; height:100%">\r\n            \x3c!--US2601 : FCO - Web - Dispatch page enhancements --\x3e\r\n            <div class="content" style="padding: 20px 15px 0px 15px;" id="unassignedGrid">\r\n                <div class="row" style="vertical-align: middle;">\r\n                    <div class="col-md-4">\r\n                        <div class="row">\r\n                            <label class="control-label col-md-3 disable-text-selection" style="vertical-align: middle;">From Date:</label>\r\n\r\n                            <div data-min-view="2" class="input-group date datetime col-md-4" date-time-append="">\r\n                                <input name="FromDate"\r\n                                       ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()"\r\n                                       type="datetime"\r\n                                       date-time=""\r\n                                       ng-model="vm.fromDate"\r\n                                       fc-autofocus="attribute.Autofocus"\r\n                                       format="MM/dd/yyyy"\r\n                                       auto-close="true"\r\n                                       min-view="date"\r\n                                       max-view="date"\r\n                                       class="form-control ng-scope ng-valid">\r\n                                <span class="input-group-addon btn btn-white">\r\n                                    <span class="glyphicon glyphicon-calendar"></span>\r\n                                </span>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class="col-md-4">\r\n                        <div class="row">\r\n                            <label class="control-label col-sm-3 disable-text-selection">To Date:</label>\r\n\r\n                            <div data-min-view="2" class="input-group date datetime col-md-4" date-time-append="">\r\n                                <input name="ToDate"\r\n                                       ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()"\r\n                                       type="datetime"\r\n                                       date-time=""\r\n                                       ng-model="vm.toDate"\r\n                                       fc-autofocus="attribute.Autofocus"\r\n                                       format="MM/dd/yyyy"\r\n                                       auto-close="true"\r\n                                       min-view="date"\r\n                                       max-view="date"\r\n                                       class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                <span class="input-group-addon btn btn-white">\r\n                                    <span class="glyphicon glyphicon-calendar"></span>\r\n                                </span>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class="col-md-2">\r\n                        <div class="row">\r\n                            <div class="icheckbox_square-blue checkbox col-md-1" ng-class="{ \'checked\': vm.showUnassignedFlag}" ng-click="vm.showUnassigned()">\r\n                                <input type="checkbox" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                            </div>\r\n\r\n                            <label class="col-md-1 disable-text-selection">\r\n                                Unassigned\r\n                            </label>\r\n                        </div>\r\n                    </div>\r\n                    <div class="col-md-2">\r\n                        <div class="row">\r\n                            <div class="icheckbox_square-blue checkbox col-md-1" ng-class="{ \'checked\': vm.showUnscheduledFlag}" ng-click="vm.showUnscheduled()">\r\n                                <input type="checkbox" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                            </div>\r\n\r\n                            <label class="col-md-1 disable-text-selection">\r\n                                Unscheduled\r\n                            </label>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- grid definition --\x3e\r\n\r\n                <div class="content scrollable" style="height: 300px;">\r\n                    <table id="ua-table" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                        <thead>\r\n                            <tr role="row" class="disable-text-selection">\r\n                                <th ng-repeat="th in vm.gridHeader" ng-if="vm.hideCol(th.pid)" ng-click="vm.sort(th.field)" ng-class="{sorting: true, sorting_asc: !vm.reverse && vm.sortCol == th.field, sorting_desc: vm.reverse && vm.sortCol == th.field}">{{th.data}}</th>\r\n                            </tr>\r\n                        </thead>\r\n                        <tr class="ua-row disable-text-selection" ng-repeat="rec in vm.unassignments | orderBy:vm.sortKey:vm.reverse | filter:unassignedFilter | filter:dateFilter" id="{{rec.Id}}"\r\n                            ng-mousedown="vm.enableCalDnD(rec.EstHours, rec.Id)" ng-click="vm.enableCalClick(rec.WoId, rec.Id)" style="cursor: pointer;">\r\n                            \x3c!-- this section needs to be redone! --\x3e\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[0].pid)">{{rec.AltId}}</td>\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[1].pid)">{{rec.WoType}}</td>\r\n                            \x3c!-- PBI736 : FCO - Dispatch unassigned grid: new field - DSL-NW --\x3e\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[2].pid)">{{rec.Priority}}</td>\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[3].pid)">{{rec.Desc}}</td>\r\n                            \x3c!-- BUG674 : FCO - Loading Dispatch calendar is slow --\x3e\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[4].pid)">{{vm.setDateFormat(rec.PromiseDate)}}</td>\r\n                            \x3c!-- PBI664 : FCO - Dispatch calendar assignments grid - DSL-NW --\x3e\r\n                            \x3c!-- BUG674 : FCO - Loading Dispatch calendar is slow --\x3e\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[5].pid)">{{vm.setDateFormat(rec.RequestDate)}}</td>\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[6].pid)">{{rec.CustomerName}}</td>\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[7].pid)">{{rec.SiteName}}</td>\r\n                            \x3c!-- PBI664 : FCO - Dispatch calendar assignments grid - DSL-NW --\x3e\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[8].pid)">{{rec.Address}}</td>\r\n                            \x3c!-- PBI755 : FCO - Address fields on grids - DSL-NW --\x3e\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[9].pid)">{{rec.Address1}}</td>\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[10].pid)">{{rec.Address2}}</td>\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[11].pid)">{{rec.City}}</td>\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[12].pid)">{{rec.StateCode}}</td>\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[13].pid)">{{rec.PostalCode}}</td>\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[14].pid)">{{rec.Country}}</td>\r\n                            \x3c!-- PBI755 : END --\x3e\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[15].pid)">{{rec.WOStatus}}</td>\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[16].pid)">{{rec.ProblemCode}}</td>\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[17].pid)">{{rec.Status}}</td>\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[18].pid)">{{rec.EstHours}}h</td>\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[19].pid)">{{rec.TechFullName}}</td>\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[20].pid)">{{rec.Office}}</td>\r\n                            <td ng-if="vm.hideCol(vm.gridHeader[21].pid)">{{rec.Agreement}}</td>\r\n                        </tr>\r\n                    </table>\r\n                </div>\r\n            </div>\r\n            \x3c!-- US2601 : END --\x3e\r\n        </div>\r\n    </div>\r\n</div>'),e.put("Templates/Dispatch/DispatchMap/dispatchMap.html",'<fc-filter-sidebar class="cl-sidebar" id="dispatch-calendar-sidebar">\r\n    <br />\r\n    <div style="margin-left: 18px; margin-right: 15px">\r\n        <fc-tabs tab="vm.filterTab">\r\n            <div fc-tab="Techs">\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n                            Groups\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect on-enter="vm.getTechsAndWoes()" class="multiselectSidebar fc-font-14" value="vm.laborGroupIds" api-method="laborgroups" value-prop="Id" text-prop="Name"></fc-multiselect>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n                            Technician\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect class="multiselectSidebar fc-font-14" on-enter="vm.getTechsAndWoes()" value="vm.technicianIds" api-method="employees/getTechnicianByLaborGroup" value-prop="Id" text-prop="FullName" filter="vm.Filter"></fc-multiselect>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-md-12" style="margin-left: -4px;">\r\n                        <button class="btn btn-default fc-font-14" ng-click="vm.getTechsAndWoes()"><i class="fa  fa-check fc-font-14"></i> Apply Filters</button>\r\n                        <button class="btn btn-default fc-font-14" ng-click="vm.clearTechs()"><i class="fa  fa-times-circle fc-font-14"></i> Clear</button>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n\r\n            <div fc-tab="Filters">\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="control-label fc-font-14">From Date: </label>\r\n                        <div class="input-group date datetime" date-time-append fc-enter="vm.getTechsAndWoes()">\r\n                            <input type="datetime" date-time ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterMap.fromDate" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control fc-font-14" />\r\n                            <span class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon glyphicon-calendar"></span>\r\n                            </span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="control-label fc-font-14">To Date: </label>\r\n                        <div class="input-group date datetime" date-time-append fc-enter="vm.getTechsAndWoes()">\r\n                            <input type="datetime" date-time ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterMap.toDate" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control fc-font-14" />\r\n                            <span class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon glyphicon-calendar"></span>\r\n                            </span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class="form-group checkbox" fc-enter="vm.getTechsAndWoes()">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n                            <div class="icheckbox_square-blue checkbox" ng-class="{ \'checked\': vm.filterMap.omitCompletedWO }">\r\n                                <input type="checkbox" ng-model="vm.filterMap.omitCompletedWO" class="icheck fc-font-14" style="position: absolute; opacity: 0;" />\r\n                                <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                            </div>\r\n                            Omit Completed WO’s\r\n                        </label>\r\n                    </div>\r\n                </div>\r\n                <div class="form-group checkbox" fc-enter="vm.getTechsAndWoes()">\r\n                    <div class="col-md-12">\r\n                        <label class=" fc-font-14">\r\n                            <div class="icheckbox_square-blue checkbox" ng-class="{ \'checked\': vm.filterMap.onlyUnassignedWO }">\r\n                                <input type="checkbox" ng-model="vm.filterMap.onlyUnassignedWO" class="icheck fc-font-14" style="position: absolute; opacity: 0;" />\r\n                                <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                            </div>\r\n                            Only Unassigned WO\'s\r\n                        </label>\r\n                    </div>\r\n                </div>\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class=" fc-font-14">\r\n                            Work Order Type\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect class="fc-font-14" on-enter="vm.getTechsAndWoes()" value="vm.workOrderTypeIds" api-method="wotypes" value-prop="Id" text-prop="WoTypeName" />\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n                            Work Order Status\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect class="fc-font-14" on-enter="vm.getTechsAndWoes()" value="vm.workOrderStatusIds" api-method="wostatuses" value-prop="Id" text-prop="WoStatusName" />\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n                            Work Order Priority\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect class="fc-font-14" on-enter="vm.getTechsAndWoes()" value="vm.workOrderPriorityIds" api-method="priorities" value-prop="Id" text-prop="PriorityName" />\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label class="fc-font-14">\r\n                            Service Area\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect class="fc-font-14" on-enter="vm.getTechsAndWoes()" value="vm.serviceAreaIds" api-method="wosites" value-prop="Id" text-prop="ServiceAreaName" />\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-md-12" style="margin-left: -4px;">\r\n                        <button class="btn btn-default fc-font-14" ng-click="vm.getTechsAndWoes()"><i class="fa  fa-check fc-font-14"></i> Apply Filters</button>\r\n                        <button class="btn btn-default fc-font-14" ng-click="vm.clearFilters()"><i class="fa  fa-times-circle fc-font-14"></i> Clear</button>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n        </fc-tabs>\r\n    </div>\r\n</fc-filter-sidebar>\r\n\r\n<div id="pcont" class="container-fluid sidebarTemplate">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a href="#">Home</a></li>\r\n            <li class="active">Dispatch Map</li>\r\n        </ol>\r\n        \x3c!-- breadcrumb --\x3e\r\n    </div>\r\n    <div class="cl-mcont">\r\n        \x3c!-- PBI716 : FCO - Add geo location lookup to dispatch map --\x3e\r\n        \x3c!-- LOADING SPINNER --\x3e\r\n        <div ng-hide="!vm.isLoading" class="table-edit-overlay">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <div class="row" style="margin-left: auto; margin-right: auto;">\r\n                            <div class="form-group checkbox">\r\n                                <label class="fc-dispatch-font-size">\r\n                                    <div class="icheckbox_square-blue checkbox" ng-class="{ \'checked\': vm.filterMap.isWo }">\r\n                                        <input type="checkbox" ng-model="vm.filterMap.isWo" class="icheck fc-dispatch-font-size" style="position: absolute; opacity: 0;" />\r\n                                        <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                    </div>\r\n                                    Show Work Orders\r\n                                </label>\r\n                                <label class="fc-dispatch-font-size">\r\n                                    <div class="icheckbox_square-blue checkbox" ng-class="{ \'checked\': vm.filterMap.isTech }">\r\n                                        <input type="checkbox" ng-model="vm.filterMap.isTech" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                        <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                    </div>\r\n                                    Show Techs\r\n                                </label>\r\n                                <button id="map-refresh-button" class="btn btn-default fc-dispatch-font-size" ng-click="vm.getTechsAndWoes()"><i class="fa fa-refresh fc-dispatch-font-size"></i> Refresh</button>\r\n                                <button ng-if="vm.usingGPSTracking" class="btn btn-default fc-dispatch-font-size" ng-click="vm.getTechsRealtime()"><i id="dispatch-map-tracking-icon" class="fa fa-clock fc-dispatch-font-size"></i> Realtime Mapping</button>\r\n                                \x3c!-- <span class="pull-right"><a class="cursor_pointer" ng-click="vm.showErrorModal()" style="color: red; font-size: 14px">Location errors</a></span> --\x3e\r\n                                <span class="pull-right">\r\n                                    <button class="btn btn-default fc-dispatch-font-size" ng-click="vm.showErrorModal()"><i style="color: red;" class="fa fa-exclamation-circle fc-dispatch-font-size"></i> Location Errors</button>\r\n                                </span>\r\n                            </div>\r\n                        </div>\r\n                        \x3c!-- PBI283 : FCO Maps --\x3e\r\n                        <leaflet defaults="vm.defaults" bounds="vm.bounds" markers="vm.markers" width="100%" height="600px" ng-if="vm.usingGeoCodeFarm"></leaflet>\r\n                        <div ng-if="vm.usingGoogleMaps" ng-controller="GoogleMapsController as map">\r\n                            <div id="map" style="width: 100%; height: 600px;"></div>\r\n                        </div>\r\n                        \x3c!-- PBI283 : END --\x3e\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Dispatch/DispatchMap/locationErrors.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n        \x3c!-- Modal content--\x3e\r\n        <div class="modal-content" style="height: 80%; width: 60%; margin-left: 22%; overflow-y: auto; ">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n            </div>\r\n            <div class="modal-body">\r\n                <div ng-repeat="error in vm.latAndLngErrorList">\r\n                    <div ng-if="error.isWo">\r\n                        An error occurred while finding location of call <span style="font-weight: bold">{{error.altId}}</span> - Not Found Address: \r\n                        <span style="font-weight: bold">{{error.address}}, {{error.city}}, {{error.stateCode}}, {{error.postalCode}}, {{error.country}}</span>\r\n                    </div>\r\n                    <div ng-if="!error.isWo">\r\n                        No event record found for tech <span style="font-weight: bold">{{error.fullName}}</span> in last 24 hours\r\n                        \x3c!--An error occurred while finding location of tech <span style="font-weight: bold">{{error.fullName}}</span>--\x3e\r\n                    </div>\r\n                    <br />\r\n                </div>\r\n                <div ng-if="vm.latAndLngErrorList.length == 0">\r\n                    No location errors\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop in fade"></div>\r\n'),e.put("Templates/Dispatch/DispatchScheduling/dispatchScheduling.html",'<div id="pcont" class="container-fluid" ng-controller="DispatchSchedulingController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n\r\n            <li class="active">Scheduling  </li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Scheduling </h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <fc-tabs tab="vm.selectedTab">\r\n                            <div fc-tab="Work Order List" id="manageWO">\r\n                                <div class="clearfix CollapsibleTitle">\r\n                                    <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                                </div>\r\n                                <div class="row  form-horizontal">\r\n                                    <div id="Collapsible" class="clearfix in collapse">\r\n                                        <div class="col-sm-6 col-lg-6">\r\n                                            <div class="form-group" fc-enter="vm.search()">\r\n                                                <label class="control-label  col-sm-3 col-md-4 col-lg-3 paddingLeft0">From Date:</label>\r\n                                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 push-right" date-time-append="">\r\n                                                    \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                                                    \x3c!-- <input name="StartDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterWoTableTmp.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                                                    <input name="StartDate" onpaste="return false;" type="datetime" restrict-to="{{vm.dateService.restrictToDate()}}" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterWoTableTmp.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                                    \x3c!-- BUG87 : END --\x3e\r\n                                                    <span class="input-group-addon btn btn-white">\r\n                                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                                    </span>\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div class="col-sm-6 col-lg-6">\r\n                                            <div class="form-group" fc-enter="vm.search()">\r\n                                                <label class="control-label  col-sm-3 col-md-4 col-lg-3 paddingLeft0">To Date:</label>\r\n                                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 push-right" date-time-append="">\r\n                                                    \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                                                    \x3c!-- <input name="EndDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterWoTableTmp.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                                                    <input name="EndDate" onpaste="return false;" type="datetime" restrict-to="{{vm.dateService.restrictToDate()}}" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterWoTableTmp.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                                    \x3c!-- BUG87 : END --\x3e\r\n                                                    <span class="input-group-addon btn btn-white">\r\n                                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                                    </span>\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\r\n                                        <fc-table-edit model="vm.model"\r\n                                                       attributes="vm.attributes" on-enter="vm.search()">\r\n                                        </fc-table-edit>\r\n                                        <div class="form-group">\r\n                                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                                \x3c!-- Added vm.newSearch() on Search for Bug-127 --\x3e\r\n                                                <button type="submit" class="btn btn-primary" ng-click="vm.newSearch()">Search</button>\r\n                                                <button type="submit" class="btn btn-default push-left" ng-click="vm.clear()">Clear</button>\r\n                                            </div> \x3c!-- input box --\x3e\r\n                                        </div>\r\n                                    </div>\x3c!-- collapsible --\x3e\r\n                                </div>\r\n                                <div class="row">\r\n                                    <div class="col-sm-12">\r\n                                        <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                                            <thead>\r\n                                                <tr role="row">\r\n                                                    <th></th>\r\n                                                    <th tabindex="0" class="action-col" aria-controls="datatable-icons" rowspan="1" colspan="1" aria-label="Address: activate to sort column ascending" style="width: 50px;text-align:center;padding-right:8px"></th>\r\n                                                    <th ng-repeat="attr in vm.attributestab"\r\n                                                        ng-class="{sorting: attr.Sortable && vm.filterWoTable.sortCol != attr.ValueName,\r\n                                                        sorting_asc: attr.Sortable && vm.filterWoTable.sortCol == attr.ValueName && vm.filterWoTable.sortDir == \'asc\',\r\n                                                        sorting_desc: attr.Sortable && vm.filterWoTable.sortCol == attr.ValueName && vm.filterWoTable.sortDir == \'desc\'}"\r\n                                                        ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)" ng-if="vm.hideCol(attr.ObjectName)">\r\n                                                        {{attr.Name}}\r\n                                                    </th>\r\n                                                </tr>\r\n                                            </thead>\r\n                                            <tbody>\r\n                                                <tr role="row" ng-repeat="item in vm.woDispatch" ng-click="vm.setSelected(item)" ng-class="{active: vm.$scope.selected == item.Id}">\r\n                                                    <td>\r\n                                                        <button class="btn btn-default" ng-click="vm.edit(item.Id)">Schedule</button>\r\n                                                    </td>\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[0].ObjectName)">\r\n                                                        <a class="cursor_pointer" ng-click="vm.edit(item.Id)">\r\n                                                            {{item.AltId}}\r\n                                                        </a>\r\n                                                    </td>\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[1].ObjectName)"> {{item.WoType}} </td>\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[2].ObjectName)"> {{item.PromiseDate | date: \'MM/dd/yyyy\' }} </td>\r\n                                                    \x3c!-- PBI1026 : FCO - Scheduling grid: add Promised Time column - GroundBreakers --\x3e\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[3].ObjectName)"> {{item.PromiseDate | date: \'HH:mm a\' }} </td>\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[4].ObjectName)"> {{item.Status}} </td>\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[5].ObjectName)"> {{item.CustomerName}} </td>\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[6].ObjectName)"> {{item.SiteName}} </td>\r\n                                                    \x3c!-- PBI755 : FCO - Address fields on grids - DSL-NW --\x3e\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[7].ObjectName)"> {{item.Address}} </td>\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[8].ObjectName)"> {{item.Address1}} </td>\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[9].ObjectName)"> {{item.Address2}} </td>\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[10].ObjectName)"> {{item.City}} </td>\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[11].ObjectName)"> {{item.StateCode}} </td>\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[12].ObjectName)"> {{item.PostalCode}} </td>\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[13].ObjectName)"> {{item.Country}} </td>\r\n                                                    \x3c!-- PBI755 : END --\x3e\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[14].ObjectName)"> {{item.Desc}} </td>\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[15].ObjectName)"> {{item.CompanyName}} </td>\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[16].ObjectName)"> {{item.OfficeName}} </td>\r\n                                                    <td ng-if="vm.hideCol(vm.attributestab[17].ObjectName)"> {{item.AgreementDesc}} </td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n                                </div>\r\n                                \x3c!-- Pagination start --\x3e\r\n                                <div class="row" style="margin-left:0px;">\r\n                                    \x3c!-- Added vm.nextPage() function for Bug-127 --\x3e\r\n                                    <fc-paging ng-click="vm.nextPage()" page="vm.woDispatchMeta.Paging.Page" page-size="vm.woDispatchMeta.Paging.PageSize" current-data-length="vm.woDispatch.length" total="vm.woDispatchMeta.Paging.TotalCount"></fc-paging>\r\n                                </div>\r\n                                <div class="row">\r\n                                    <div class="col-sm-5">\r\n                                        <div class="dataTables_length" id="datatable-icons_length">\r\n                                            <label>\r\n                                                Show\r\n                                                \x3c!-- Added vm.changeEntries() function  Bug-127 --\x3e\r\n                                                <select ng-change="vm.changeEntries()" name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.woDispatchMeta.Paging.PageSize">\r\n                                                    <option value="10">10</option>\r\n                                                    <option value="25">25</option>\r\n                                                    <option value="50">50</option>\r\n                                                    <option value="100">100</option>\r\n                                                </select> entries\r\n                                            </label>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n\r\n                            </div>\r\n                            <div fc-tab="Work Order Details" ng-controller="DispatchDetailsEditController as vd" class="disabled">\r\n                                <fc-table-edit api-method="wodetails" id="{{vm.filter.filterId}}" on-back="vd.goBack()" attributes="vd.attributes" model="vd.model"></fc-table-edit>\r\n                                <div id="accordion" class="panel-group accordion">\r\n                                    <div class="panel panel-default">\r\n                                        <div class="panel-heading cursor_pointer">\r\n                                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne"> Assignments &nbsp;&nbsp;  Count: {{vd.count}} &nbsp; &nbsp; Estimated hours total: {{vd.estHoursTotal}}<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                        </div>\x3c!-- panel heading --\x3e\r\n                                        <div id="collapseOne" class="panel-collapse collapse in">\r\n                                            <div class="panel-body">\r\n                                                <div class="block-flat">\r\n                                                    <div>\r\n                                                        \x3c!-- BUG744 : FCO - Scheduling: Serviceable Item value not displaying in Assignments section on Work Order Details tab - DSL-NW --\x3e\r\n                                                        \x3c!-- <div class="content" ng-controller="AssingmentController as va" id="assignments"> --\x3e\r\n                                                        <div class="content" ng-class="{\'hide-add-new-btn\' : vd.hideAddButton}" ng-controller="AssingmentController as va" id="assignments">\r\n                                                            <fc-table api-method="woassignments"\r\n                                                                      attributes="va.attributes"\r\n                                                                      on-edit="va.editAssignment(id, vm.filter.filterId, vd.filter1.siteId)"\r\n                                                                      filter="vm.filterByWorkOrder"\r\n                                                                      ng-if="va.reloadTable"\r\n                                                                      timezone="va.assignmentsTimezone"\r\n                                                                      delete-event="va.deleteEvent()"\r\n                                                                      table-name="Assingment">\r\n\r\n                                                            </fc-table>\r\n                                                        </div>\x3c!-- content --\x3e\r\n                                                    </div>\r\n                                                </div>\x3c!-- block-flat --\x3e\r\n                                            </div>\x3c!-- panel body --\x3e\r\n                                        </div>\x3c!-- panel colapse --\x3e\r\n                                    </div>\x3c!-- panel --\x3e\r\n                                </div>\x3c!-- accordion --\x3e\r\n                            </div>\r\n                            \x3c!-- Pagination end --\x3e\r\n                        </fc-tabs>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Dispatch/DispatchScheduling/techpopup.html",'<div id="myModal" class="fade" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n        \x3c!-- Modal content--\x3e\r\n        \x3c!-- PBI836 : FCO - Dispatch calendar: assign technicians by skill --\x3e\r\n        \x3c!-- <div class="modal-content" style="overflow-y: auto; height: 90%"> --\x3e\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 80%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h4 class="modal-title">Tech List</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <form ng-submit="vm.search()" class="form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Group:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <fc-dropdown value="vm.filter.groupId" api-method="laborgroups" value-prop="Id" text-prop="Name" convert-to-int="true"></fc-dropdown>\r\n                                \x3c!--<select ng-model="vm.filter.groupId" class=\'form-control\' ng-options="group.Id as group.Name for group in vm.groups">\r\n                                    <option value="Id" selected>Select</option>\r\n                                </select>--\x3e\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div> \x3c!-- form group --\x3e\r\n                    </div>\r\n                    <div class="col-sm-6 col-md-6">\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Skill:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <fc-dropdown value="vm.filter.skillId" api-method="skills" value-prop="Id" text-prop="SkillName" convert-to-int="true"></fc-dropdown>\r\n                                \x3c!--<select ng-model="vm.filter.skillId" class=\'form-control\' ng-options="skill.Id as skill.SkillName for skill in vm.skills">\r\n                                    <option value="Id" selected>Select</option>\r\n                                </select>--\x3e\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div> \x3c!-- form group --\x3e\r\n\r\n                    </div> \x3c!-- columns --\x3e\r\n                    <div class="col-sm-6 col-md-6">\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Office:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <fc-dropdown value="vm.filter.officeId" api-method="offices" value-prop="Id" text-prop="OfficeName"></fc-dropdown>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div> \x3c!-- form group --\x3e\r\n                    </div> \x3c!-- columns --\x3e\r\n                    <div class="col-sm-6 col-md-6">\r\n                        <div class="form-group ">\r\n                            <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                <input type="checkbox" ng-model="vm.filter.onlyAvailable" class="iCheck"><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                Only show available techs\r\n                            </label>\r\n                        </div>\r\n                    </div>\r\n\r\n                    <div class="form-group">\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                            <button type="submit" class="btn btn-search table-edit-submit-btn" value="Submit">Search</button>\r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n\r\n                    <div class="col-sm-12 col-md-12">\r\n                        <hr />\r\n                    </div>\r\n                    <hr />\r\n                    <div class="col-sm-6 col-md-6">\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Name:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <fc-dropdown value="vm.techId" value-prop="Id" text-prop="FullName" list="vm.techNames"></fc-dropdown>\r\n                                \x3c!--<select ng-model="va.TechId" class=\'form-control\' ng-options="techNameId.Id as techNameId.FullName for techNameId in vm.techNames">\r\n                                    <option value="TechId" selected>Select</option>\r\n                                </select>--\x3e\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div> \x3c!-- form group --\x3e\r\n                    </div> \x3c!-- columns --\x3e\r\n                    <div class="form-group">\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                            <button type="button" class="btn btn-default table-edit-cancel-btn" ng-click="vm.onBack()">Cancel</button>\r\n                            <button type="button" class="btn btn-primary table-edit-cancel-btn" ng-click="vm.ok()">OK</button>\r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n                </form>\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/Dispatch/Messaging/messagePopup.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n        \x3c!-- Modal content--\x3e\r\n        <div class="modal-content" style="height: 50%; width: 40%; margin-left: 26%; overflow-y: auto; ">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n            </div>\r\n            <div class="modal-body">\r\n                <div class="row">\r\n                    <div class="message">\r\n                        <div class="head">\r\n                            <h3>{{vm.user}}</h3>\r\n                            <h4><span>{{vm.date}}</span></h4>\r\n                        </div>\r\n                        <div class="mail">\r\n                            <p>{{vm.note}}</p>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class="modal-footer">\r\n                <button class="btn btn-default btn-flat md-close" style="" ng-click="vm.clear()">Clear</button>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop in fade"></div>\r\n'),e.put("Templates/Dispatch/Messaging/messaging.html",'\r\n<fc-filter-sidebar class="cl-sidebar" id="dispatch-calendar-sidebar">\r\n    <br />\r\n    <div style="margin-left: 18px; margin-right: 15px">\r\n        <fc-tabs id="filter_tabs" tab="vm.filterTab" ng-if="vm.companyFeature">\r\n\r\n            <div fc-tab="Techs" ng-click="vm.tabChange()">\r\n                <div class="col-md-12 fc_tab_Techs" ng-if="!vm.customerRoles">\r\n                    <div class="form-group ">\r\n                        <div class="col-md-12">\r\n                            <label>\r\n                                Groups\r\n                            </label>\r\n                        </div> \x3c!-- input box --\x3e\r\n\r\n                        <div class="col-md-12">\r\n                            <fc-multiselect class="multiselectSidebar" on-enter="vm.getTechList()" value="vm.laborGroupIds" api-method="laborgroups" value-prop="Id" text-prop="Name"></fc-multiselect>\r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n\r\n                    <div class="form-group">\r\n                        <div class="col-md-12">\r\n                            <label>\r\n                                Technician\r\n                            </label>\r\n                        </div> \x3c!-- input box --\x3e\r\n\r\n                        <div class="col-md-12">\r\n                            <fc-multiselect class="multiselectSidebar" on-enter="vm.getTechList()" value="vm.technicianIds" api-method="employees/getTechnicianByLaborGroup" filter="vm.Filter" value-prop="Id" text-prop="FullName"></fc-multiselect>\r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n                    <div class="form-group">\r\n                        <div class="col-md-12">\r\n                            <button class="btn btn-default" ng-click="vm.getTechList()"><i class="fa  fa-check"></i> Apply </button>\r\n                            <button class="btn btn-default" ng-click="vm.clearTechs()"><i class="fa  fa-times-circle"></i> Cancel</button>\r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n                </div>\r\n            </div>\r\n            <div fc-tab="Customers" ng-click="vm.tabChange()">\r\n                <div class="form-group" ng-if="!vm.customerRoles">\r\n                    <div class="col-md-12">\r\n                        <label>\r\n                            Customers\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect class="multiselectSidebar" value="vm.custIds" api-method="customers" value-prop="Id" text-prop="CustomerName"></fc-multiselect>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <label>\r\n                            Customers User\'s\r\n                        </label>\r\n                    </div> \x3c!-- input box --\x3e\r\n\r\n                    <div class="col-md-12">\r\n                        <fc-multiselect class="multiselectSidebar" value="vm.customersIds" api-method="customerusers" value-prop="Id" text-prop="FullName" filter="vm.filterCustomer"></fc-multiselect>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n\r\n\r\n                <div class="form-group">\r\n                    <div class="col-md-12">\r\n                        <button class="btn btn-default" ng-click="vm.getCustomerList()"><i class="fa  fa-check"></i> Apply </button>\r\n                        <button class="btn btn-default" ng-click="vm.clearCustomers()"><i class="fa  fa-times-circle"></i> Cancel</button>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n        </fc-tabs>\r\n        <fc-tabs id="filter_tabs" tab="vm.filterTab" ng-if="!vm.companyFeature">\r\n\r\n            <div fc-tab="Techs" ng-click="vm.tabChange()">\r\n                <div class="col-md-12 fc_tab_Techs" ng-if="!vm.customerRoles">\r\n                    <div class="form-group ">\r\n                        <div class="col-md-12">\r\n                            <label>\r\n                                Groups\r\n                            </label>\r\n                        </div> \x3c!-- input box --\x3e\r\n\r\n                        <div class="col-md-12">\r\n                            <fc-multiselect class="multiselectSidebar" on-enter="vm.getTechList()" value="vm.laborGroupIds" api-method="laborgroups" value-prop="Id" text-prop="Name"></fc-multiselect>\r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n\r\n                    <div class="form-group">\r\n                        <div class="col-md-12">\r\n                            <label>\r\n                                Technician\r\n                            </label>\r\n                        </div> \x3c!-- input box --\x3e\r\n\r\n                        <div class="col-md-12">\r\n                            <fc-multiselect class="multiselectSidebar" on-enter="vm.getTechList()" value="vm.technicianIds" api-method="employees/getTechnicianByLaborGroup" filter="vm.Filter" value-prop="Id" text-prop="FullName"></fc-multiselect>\r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n                    <div class="form-group">\r\n                        <div class="col-md-12">\r\n                            <button class="btn btn-default" ng-click="vm.getTechList()"><i class="fa  fa-check"></i> Apply </button>\r\n                            <button class="btn btn-default" ng-click="vm.clearTechs()"><i class="fa  fa-times-circle"></i> Cancel</button>\r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n                </div>\r\n            </div>\r\n\r\n        </fc-tabs>\r\n    </div>\r\n</fc-filter-sidebar>\r\n<div id="pcont" class="container-fluid sidebarTemplate">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Messaging</li>\r\n        </ol>\r\n\r\n        \x3c!-- breadcrumb --\x3e\r\n    </div>\r\n    <div class="col-md-12">\r\n\r\n        <div class="cl-mcont" ng-if="!vm.customerView">\r\n            <div class="row">\r\n                <div class="col-md-12">\r\n                    <div class="block-flat">\r\n                        <div class="header">\r\n                            <h3>Messages</h3>\r\n                        </div>\r\n                        <div class="content">\r\n\r\n\r\n                            <div class="row  form-horizontal">\r\n\r\n                                <div class="col-md-12">\r\n                                    <div id="accordion" class="panel-group accordion">\r\n                                        <div class="panel panel-default">\r\n                                            <div class="panel-heading cursor_pointer">\r\n                                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne"> Technician Message <i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                            </div>\x3c!-- panel heading --\x3e\r\n                                            <div id="collapseOne" class="panel-collapse collapse in">\r\n                                                <div class="panel-body">\r\n\r\n                                                    <div class="row  form-horizontal">\r\n                                                        <div class="col-md-12">\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*From:</label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <input id="" type="text" required ng-model="vm.modelPortal.From" parsley-type="" readonly placeholder="" class="form-control">\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*Selected Techs:</label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <input id="" type="text" required ng-model="vm.modelPortal.FullName" parsley-type="" readonly placeholder="" class="form-control">\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*Message: </label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <textarea class="form-control" required ng-model="vm.modelPortal.Note"></textarea>\r\n                                                                </div>\x3c!-- input box --\x3e\r\n                                                            </div>\x3c!-- form group --\x3e\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Message expires:</label>\r\n                                                                <div class="col-sm-9 col-md-7 col-lg-4">\r\n                                                                    <div data-min-view="2" class="input-group date datetime col-md-12 col-lg-12 col-xs-12" date-time-append="">\r\n                                                                        <input name="EstEndDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.modelPortal.ShowExpireDate" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                                                        <span class="input-group-addon btn btn-white">\r\n                                                                            <span class="glyphicon glyphicon-calendar"></span>\r\n                                                                        </span>\r\n                                                                        <fc-timeselect value="vm.modelPortal.ShowExpireDate"></fc-timeselect>\r\n                                                                    </div>\r\n                                                                </div>\r\n                                                            </div> \x3c!-- form group --\x3e\r\n                                                            <div class="form-group">\r\n                                                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-left">\r\n\r\n                                                                    <button style="margin:0px;" type="submit" ng-click="vm.sendPortal()" class="btn btn-primary">Send</button>\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n                                                        </div> \x3c!-- columns --\x3e\r\n                                                    </div>\x3c!-- row --\x3e\r\n\r\n                                                </div>\x3c!-- panel body --\x3e\r\n                                            </div>\x3c!-- panel colapse --\x3e\r\n                                        </div>\x3c!-- panel 1 --\x3e\r\n\r\n                                        <div class="panel panel-default">\r\n                                            <div class="panel-heading cursor_pointer">\r\n                                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo" aria-expanded="false" class="collapsed"> Text Message<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                            </div>\x3c!-- panel heading --\x3e\r\n                                            <div id="collapseTwo" class="panel-collapse collapse">\r\n                                                <div class="panel-body">\r\n\r\n                                                    <div class="row  form-horizontal">\r\n                                                        <div class="col-md-12">\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*From:</label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <input id="" type="text" required ng-model="vm.modelSMS.From" parsley-type="" readonly placeholder="" class="form-control">\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*Text Addresses:</label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <input id="" type="text" ng-model="vm.modelSMS.SMS" class="form-control" required>\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*Message: </label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <textarea class="form-control" ng-model="vm.modelSMS.Note"></textarea>\r\n                                                                </div>\x3c!-- input box --\x3e\r\n                                                            </div>\x3c!-- form group --\x3e\r\n\r\n\r\n                                                            <div class="form-group">\r\n                                                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-left">\r\n\r\n                                                                    <button style="margin:0px;" type="submit" ng-click="vm.sendSMS()" class="btn btn-primary">Send</button>\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n                                                        </div> \x3c!-- columns --\x3e\r\n                                                    </div>\x3c!-- row --\x3e\r\n\r\n                                                </div>\x3c!-- panel body --\x3e\r\n                                            </div>\x3c!-- panel colapse --\x3e\r\n                                        </div>\x3c!-- panel 2 --\x3e\r\n\r\n\r\n\r\n                                        <div class="panel panel-default">\r\n                                            <div class="panel-heading cursor_pointer">\r\n                                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseThree" aria-expanded="false" class="collapsed"> Email Message<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                            </div>\x3c!-- panel heading --\x3e\r\n                                            <div id="collapseThree" class="panel-collapse collapse">\r\n                                                <div class="panel-body">\r\n\r\n                                                    <div class="row  form-horizontal">\r\n                                                        <div class="col-md-12">\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*From:</label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <input id="" type="text" required ng-model="vm.modelEmail.From" parsley-type="" readonly placeholder="" class="form-control">\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*Email Addresses:</label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <input id="" type="text" required parsley-type="" ng-model="vm.modelEmail.Email" placeholder="" class="form-control">\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*Message: </label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <textarea class="form-control" required ng-model="vm.modelEmail.Note"></textarea>\r\n                                                                </div>\x3c!-- input box --\x3e\r\n                                                            </div>\x3c!-- form group --\x3e\r\n\r\n\r\n                                                            <div class="form-group">\r\n                                                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-left">\r\n\r\n                                                                    <button style="margin:0px;" type="submit" ng-click="vm.sendEmail()" class="btn btn-primary">Send</button>\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n                                                        </div> \x3c!-- columns --\x3e\r\n                                                    </div>\x3c!-- row --\x3e\r\n\r\n                                                </div>\x3c!-- panel body --\x3e\r\n                                            </div>\x3c!-- panel colapse --\x3e\r\n                                        </div>\x3c!-- panel 2 --\x3e\r\n\r\n                                    </div>\x3c!-- accordion --\x3e\r\n\r\n                                </div> \x3c!-- columns --\x3e\r\n                            </div>\r\n\r\n\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n            </div>\r\n\r\n        </div>\r\n        <div class="cl-mcont" ng-if="vm.customerView">\r\n            <div class="row">\r\n                <div class="col-md-12">\r\n                    <div class="block-flat">\r\n                        <div class="header">\r\n                            <h3>Messages</h3>\r\n                        </div>\r\n                        <div class="content">\r\n\r\n\r\n                            <div class="row  form-horizontal">\r\n\r\n                                <div class="col-md-12">\r\n                                    <div id="accordion" class="panel-group accordion">\r\n                                        <div class="panel panel-default">\r\n                                            <div class="panel-heading cursor_pointer">\r\n                                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne"> Customer Message <i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                            </div>\x3c!-- panel heading --\x3e\r\n                                            <div id="collapseOne" class="panel-collapse collapse in">\r\n                                                <div class="panel-body">\r\n\r\n                                                    <div class="row  form-horizontal">\r\n                                                        <div class="col-md-12">\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*From:</label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <input id="" type="text" required ng-model="vm.modelPortal.From" parsley-type="" readonly placeholder="" class="form-control">\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*Selected Customers:</label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <input id="" type="text" required ng-model="vm.modelCustomerPortal.FullName" parsley-type="" readonly placeholder="" class="form-control">\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*Message: </label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <textarea class="form-control" required ng-model="vm.modelCustomerPortal.Note"></textarea>\r\n                                                                </div>\x3c!-- input box --\x3e\r\n                                                            </div>\x3c!-- form group --\x3e\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Message expires:</label>\r\n                                                                <div class="col-sm-9 col-md-7 col-lg-4">\r\n                                                                    <div data-min-view="2" class="input-group date datetime col-md-12 col-lg-12 col-xs-12" date-time-append="">\r\n                                                                        <input name="EstEndDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.modelCustomerPortal.ShowExpireDate" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                                                        <span class="input-group-addon btn btn-white">\r\n                                                                            <span class="glyphicon glyphicon-calendar"></span>\r\n                                                                        </span>\r\n                                                                        <fc-timeselect value="vm.modelPortal.ShowExpireDate"></fc-timeselect>\r\n                                                                    </div>\r\n                                                                </div>\r\n                                                            </div> \x3c!-- form group --\x3e\r\n                                                            <div class="form-group">\r\n                                                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-left">\r\n\r\n                                                                    <button type="submit" ng-click="vm.sendCustomerPortal()" class="btn btn-primary">Send</button>\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n                                                        </div> \x3c!-- columns --\x3e\r\n                                                    </div>\x3c!-- row --\x3e\r\n\r\n                                                </div>\x3c!-- panel body --\x3e\r\n                                            </div>\x3c!-- panel colapse --\x3e\r\n                                        </div>\x3c!-- panel 1 --\x3e\r\n\r\n                                        <div class="panel panel-default">\r\n                                            <div class="panel-heading cursor_pointer">\r\n                                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo" aria-expanded="false" class="collapsed"> Text Message<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                            </div>\x3c!-- panel heading --\x3e\r\n                                            <div id="collapseTwo" class="panel-collapse collapse">\r\n                                                <div class="panel-body">\r\n\r\n                                                    <div class="row  form-horizontal">\r\n                                                        <div class="col-md-12">\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*From:</label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <input id="" type="text" required ng-model="vm.modelSMS.From" parsley-type="" readonly placeholder="" class="form-control">\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*Text Addresses:</label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <input id="" type="text" ng-model="vm.modelCustomerSMS.SMS" class="form-control" required>\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*Message: </label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <textarea class="form-control" ng-model="vm.modelCustomerSMS.Note"></textarea>\r\n                                                                </div>\x3c!-- input box --\x3e\r\n                                                            </div>\x3c!-- form group --\x3e\r\n\r\n\r\n                                                            <div class="form-group">\r\n                                                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-left">\r\n\r\n                                                                    <button type="submit" ng-click="vm.sendCustomerSMS()" class="btn btn-primary">Send</button>\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n                                                        </div> \x3c!-- columns --\x3e\r\n                                                    </div>\x3c!-- row --\x3e\r\n\r\n                                                </div>\x3c!-- panel body --\x3e\r\n                                            </div>\x3c!-- panel colapse --\x3e\r\n                                        </div>\x3c!-- panel 2 --\x3e\r\n\r\n\r\n\r\n                                        <div class="panel panel-default">\r\n                                            <div class="panel-heading cursor_pointer">\r\n                                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseThree" aria-expanded="false" class="collapsed"> Email Message<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                            </div>\x3c!-- panel heading --\x3e\r\n                                            <div id="collapseThree" class="panel-collapse collapse">\r\n                                                <div class="panel-body">\r\n\r\n                                                    <div class="row  form-horizontal">\r\n                                                        <div class="col-md-12">\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*From:</label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <input id="" type="text" required ng-model="vm.modelEmail.From" parsley-type="" readonly placeholder="" class="form-control">\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*Email Addresses:</label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <input id="" type="text" required parsley-type="" ng-model="vm.modelCustomerEmail.Email" placeholder="" class="form-control">\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n\r\n\r\n                                                            <div class="form-group">\r\n                                                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">*Message: </label>\r\n                                                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                    <textarea class="form-control" required ng-model="vm.modelCustomerEmail.Note"></textarea>\r\n                                                                </div>\x3c!-- input box --\x3e\r\n                                                            </div>\x3c!-- form group --\x3e\r\n\r\n\r\n                                                            <div class="form-group">\r\n                                                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-left">\r\n\r\n                                                                    <button type="submit" ng-click="vm.sendCustomerEmail()" class="btn btn-primary">Send</button>\r\n                                                                </div> \x3c!-- input box --\x3e\r\n                                                            </div> \x3c!-- form group --\x3e\r\n                                                        </div> \x3c!-- columns --\x3e\r\n                                                    </div>\x3c!-- row --\x3e\r\n\r\n                                                </div>\x3c!-- panel body --\x3e\r\n                                            </div>\x3c!-- panel colapse --\x3e\r\n                                        </div>\x3c!-- panel 2 --\x3e\r\n\r\n                                    </div>\x3c!-- accordion --\x3e\r\n\r\n                                </div> \x3c!-- columns --\x3e\r\n                            </div>\r\n\r\n\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n            </div>\r\n\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Dispatch/TechUnavailable/techUnavailable.html",'\r\n<div id="pcont" class="container-fluid sidebarTemplate">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Tech Unavailable</li>\r\n        </ol>\r\n        <h1>Tech Unavailable</h1>\r\n        \x3c!-- breadcrumb --\x3e\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n\r\n    <div class="cl-mcont" id="TechUn">\r\n\r\n        <div class="clearfix CollapsibleTitle">\r\n            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n        </div>\r\n\r\n        <div id="Collapsible" class="clearfix in collapse">\r\n\r\n            <div class="form-group">\r\n                <div class="col-sm-6">\r\n                    <label class="control-label pull-left col-sm-6 col-md-5 col-lg-4">From Date:</label>\r\n                    <div class="input-group date datetime col-sm-7 col-md-6 col-lg-4" date-time-append>\r\n                        \x3c!-- --\x3e\r\n                        \x3c!-- <input type="datetime" fc-enter="vm.getTechList()" date-time ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.TechUnavailableFilterTmp.fromDate" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-pristine ng-valid"> --\x3e\r\n                        <input type="datetime" onpaste="return false;" fc-enter="vm.getTechList()" restrict-to="{{vm.dateService.restrictToDate()}}" date-time ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.TechUnavailableFilterTmp.fromDate" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-pristine ng-valid">\r\n                        \x3c!-- BUG34 : END --\x3e\r\n                        <span class="input-group-addon btn btn-white">\r\n                            <span class="glyphicon glyphicon-calendar"></span>\r\n                        </span>\r\n                    </div>\r\n                </div>\r\n                <div class="col-sm-6">\r\n                    <label class="control-label pull-left col-sm-6 col-md-5 col-lg-4">To Date:</label>\r\n                    <div class="input-group date datetime col-sm-7 col-md-6 col-lg-4" date-time-append>\r\n                        \x3c!-- --\x3e\r\n                        \x3c!-- <input type="datetime" fc-enter="vm.getTechList()" date-time ng-model="vm.TechUnavailableFilterTmp.toDate" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-pristine ng-valid"> --\x3e\r\n                        <input type="datetime" onpaste="return false;" fc-enter="vm.getTechList()" restrict-to="{{vm.dateService.restrictToDate()}}" date-time ng-model="vm.TechUnavailableFilterTmp.toDate" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-pristine ng-valid">\r\n                        \x3c!-- BUG34 : END --\x3e\r\n                        <span class="input-group-addon btn btn-white">\r\n                            <span class="glyphicon glyphicon-calendar"></span>\r\n                        </span>\r\n                    </div>\r\n                </div>\r\n                <br /><br />\r\n            </div>\r\n\r\n            <div class="form-group">\r\n                <br /><br />\r\n                <div class="col-md-6">\r\n                    <label>\r\n                        Groups\r\n                    </label>\r\n                    <fc-multiselect value="vm.laborGroupIds" on-enter="vm.getTechList()" api-method="laborgroups" value-prop="Id" text-prop="Name" items-loaded="vm.groupsLoaded"></fc-multiselect>\r\n                </div> \x3c!-- input box --\x3e\r\n                <div class="col-md-6">\r\n                    <label>\r\n                        Technician\r\n                    </label>\r\n                    <fc-multiselect ng-if="vm.groupSelected" value="vm.technicianIds" on-enter="vm.getTechList()" api-method="employees/getTechnicianByLaborGroup" value-prop="Id" text-prop="FullName" filter="vm.Filter" items-loaded="vm.techLoaded"></fc-multiselect>\r\n                    <br />\r\n                </div> \x3c!-- input box --\x3e\r\n                <div class="col-md-6"></div>\r\n                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right">\r\n                    <button class="btn btn-primary" ng-click="vm.getTechList()"> Search</button>\r\n                    \x3c!--<button class="btn btn-default" ng-click="vm.clearTechs()"> Cancel</button>--\x3e\r\n                    <br /><br /><br />\r\n                </div> \x3c!-- input box --\x3e\r\n            </div> \x3c!-- form group --\x3e\r\n        </div>\x3c!-- collapsible --\x3e\r\n        \x3c!-- PBI1096 : FCO - Unavailable time: note field --\x3e\r\n        \x3c!-- <div class="row"> --\x3e\r\n        <div class="row" style="padding-left: 12px; padding-right: 12px;">\r\n            <div class="col-md-12"></div>\r\n            <div class="block-flat">\r\n                <div class="content">\r\n                    <fc-table table-name="Tech Unavailable"\r\n                              api-method="techUnavailable"\r\n                              attributes="vm.attributes"\r\n                              selected="vm.id"\r\n                              filter="vm.TechUnavailableFilter"\r\n                              on-edit="vm.edit(id)"\r\n                              ng-if="vm.loadTable">\r\n                    </fc-table>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/Dispatch/TechUnavailable/techUnavailableEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'techUnavailable\')">Tech Unavailable </a></li>\r\n            <li class="active">Tech Unavailable</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Tech Unavailable</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="techUnavailable"\r\n                       on-back="vm.$state.go(\'techUnavailable\')"\r\n                       id="{{vm.id}}"\r\n                       attributes="vm.attributesEdit"\r\n                       model="vm.model"\r\n                       view-name="{{vm.viewName}}"></fc-table-edit>\r\n        \x3c!--<fc-table-edit api-method="labortechgroups" id="{{vm.id}}" model="vm.model" on-back="vm.$state.go(\'laborGroupTech\')" attributes="vm.attributes"></fc-table-edit>--\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Events/EventDebugLog/eventDebugLogTable.html",'\x3c!-- PBI775 : FCO - Event Log Debug for GeoLocation Services --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="EventDebugLogController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Event Debug Log</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Event Debug Log</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <div class="clearfix CollapsibleTitle">\r\n                            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                        </div>\r\n                        <div id="Collapsible" class="collapse in clearfix">\r\n                            <fc-table-edit attributes="vm.filterattributesFilter"\r\n                                           model="vm.filterBy"\r\n                                           hide-cancel="true"\r\n                                           hide-submit="true">\r\n                            </fc-table-edit>\r\n                            <div class="form-group">\r\n                                <div class="text-right">\r\n                                    \x3c!--<button type="submit" class="btn btn-primary" ng-click="vm.delete()">Delete Log</button>--\x3e\r\n                                    <button type="submit" class="btn btn-primary" ng-click="vm.search()">Search</button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <fc-table table-name="Event Debug Log"\r\n                                  attributes="vm.attributes"\r\n                                  api-method="eventDebug"\r\n                                  show-add-new="false"\r\n                                  show-delete-column="false"\r\n                                  show-search="false"\r\n                                  filter="vm.filter" \r\n                                  view-name="{{vm.viewName}}"\r\n                                  module-name="{{vm.moduleName}}"\r\n                                  />\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>'),e.put("Templates/Events/EventLog/eventLogEdit.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 80%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="event.close()">&times;</button>\r\n                <h4 class="modal-title">Event #{{event.id}}</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <fc-table-edit api-method="eventLog"\r\n                               id="{{event.id}}"\r\n                               model="event.model"\r\n                               view-name="{{event.viewName}}"\r\n                               module-name="{{event.moduleName}}"\r\n                               attributes="event.attributes"\r\n                               on-back="event.close(insertData)"\r\n                               hide-submit="true"\r\n                               cancel-button-text="Close">\r\n                </fc-table-edit>\r\n                <hr ng-if="event.reload" />\r\n                <div class="modal-body">\r\n                    <fc-table table-name="Event Log"\r\n                              attributes="event.listAttributes"\r\n                              api-method="{{event.apiMethod}}"\r\n                              show-add-new="false"\r\n                              show-delete-column="false"\r\n                              show-search="false"\r\n                              filter="event.filter"\r\n                              ng-if="event.reload"\r\n                              view-name="{{event.viewName}}"\r\n                              module-name="{{event.moduleName}}" />\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class="modal-backdrop in fade"></div>\r\n</div>\r\n'),e.put("Templates/Events/EventLog/eventLogTable.html",'\x3c!-- PBI779 : FCO - Event log view - FC --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="EventLogController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Event Log</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Event Log</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <div class="clearfix CollapsibleTitle">\r\n                            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                        </div>\r\n                        <div id="Collapsible" class="collapse in clearfix">\r\n                            <fc-table-edit attributes="vm.filterattributesFilter"\r\n                                           model="vm.filterBy"\r\n                                           hide-cancel="true"\r\n                                           hide-submit="true">\r\n                            </fc-table-edit>\r\n                            <div class="form-group">\r\n                                <div class="text-right">\r\n                                    \x3c!--<button type="submit" class="btn btn-primary" ng-click="vm.delete()">Delete Log</button>--\x3e\r\n                                    <button type="submit" class="btn btn-primary" ng-click="vm.search()">Search</button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <fc-table table-name="Event Log"\r\n                                  attributes="vm.attributes"\r\n                                  api-method="events"\r\n                                  show-add-new="false"\r\n                                  show-delete-column="false"\r\n                                  show-search="false"\r\n                                  filter="vm.filter"\r\n                                  view-name="{{vm.viewName}}"\r\n                                  module-name="{{vm.moduleName}}"\r\n                                  on-edit="vm.edit(id)" />\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>'),e.put("Templates/Form/formEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="FormEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'formTable\')">Form Template</a></li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Forms</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="forms" id="{{vm.id}}" on-back="vm.$state.go(\'formTable\')" attributes="vm.attributes"   model="vm.model"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Form/formSearch.html",'<div id="pcont" class="container-fluid" ng-controller="FormSearchController as vm">\r\n\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Search Form</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Search Forms</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER END --\x3e\r\n    <div class="cl-mcont">\r\n        <div id="form" class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="row  form-horizontal">\r\n                        <div class="clearfix CollapsibleTitle">\r\n                            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                        </div>\r\n                        <div id="Collapsible" class="collapse in clearfix">\r\n\r\n                            <div class="col-sm-6 col-lg-6">\r\n                                <div class="form-group" fc-enter="vm.loadFilter()">\r\n                                    <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                                    <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                        \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                                        \x3c!-- <input name="StartDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterFormsTmp.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                                        <input name="StartDate" onpaste="return false;" type="datetime" restrict-to="{{vm.dateService.restrictToDate()}}" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterFormsTmp.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                        \x3c!-- BUG87 : END --\x3e\r\n                                        <span class="input-group-addon btn btn-white">\r\n                                            <span class="glyphicon glyphicon-calendar"></span>\r\n                                        </span>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class="col-sm-6 col-lg-6" fc-enter="vm.loadFilter()">\r\n                                <div class="form-group">\r\n                                    <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                                    <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft5" date-time-append="">\r\n                                        \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                                        \x3c!-- <input name="EndDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterFormsTmp.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                                        <input name="EndDate" onpaste="return false;" type="datetime" restrict-to="{{vm.dateService.restrictToDate()}}" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterFormsTmp.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                        \x3c!-- BUG87 : END --\x3e\r\n                                        <span class="input-group-addon btn btn-white">\r\n                                            <span class="glyphicon glyphicon-calendar"></span>\r\n                                        </span>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class="form-group">\r\n                                <div id="woSiteForm" class="col-lg-12 col-sm-12">\r\n                                    <fc-table-edit on-enter="vm.loadFilter()" api-method="forms" attributes="vm.attributes" custom-focus="vm.focusOut(attribute)" model="vm.model"></fc-table-edit>\r\n\r\n                                </div>\r\n\r\n                            </div>\r\n                                <div class="form-group">\r\n                                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                        <button type="submit" class="btn btn-primary push-left" ng-click="vm.loadFilter()">Search</button>\r\n                                    </div> \x3c!-- input box --\x3e\r\n                                </div>\r\n                            </div>\r\n                        </div>\x3c!-- Collapsible section end --\x3e\r\n                        <div class="content">\r\n                            <fc-table id="forms"\r\n                                      table-name="Form"\r\n                                      api-method="forms/search"\r\n                                      attributes="vm.attributesGrid"\r\n                                      filter="vm.autoFilter"\r\n                                      ng-if="vm.loadTable">\r\n                            </fc-table>\r\n                        </div>\r\n                    </div>\x3c!-- content --\x3e\r\n            </div>\x3c!-- block-flat --\x3e\r\n        </div>\x3c!-- columns --\x3e\r\n    </div>\x3c!-- row --\x3e\r\n</div>\r\n\r\n\r\n\r\n'),e.put("Templates/Form/formTable.html",'<div id="pcont" class="container-fluid" ng-controller="FormController as vm">\r\n\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Misc Form</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Misc Forms</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div id="form" class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <fc-table id="forms"\r\n                                  table-name="Form"\r\n                                  api-method="formtemplates/getformisc"\r\n                                  attributes="vm.attributes"\r\n                                  filter="vm.autoFilter"\r\n                                  selected="vm.filter.filterId"\r\n                                  ng-if="vm.reloadFilter"\r\n                                  drilldown="vm.drilldownSettings" >\r\n                        </fc-table>\r\n                    </div>\r\n                </div>\x3c!-- content --\x3e\r\n            </div>\x3c!-- block-flat --\x3e\r\n        </div>\x3c!-- columns --\x3e\r\n    </div>\x3c!-- row --\x3e\r\n</div>\r\n\r\n\r\n\r\n'),e.put("Templates/Form/formTemplateEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="FormTemplateEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'formTemplateTable\')">Form Template</a></li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Form Templates</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <div class="col-sm-12 col-lg-12">\r\n            <div class="form-group">\r\n                <br />\r\n                <label style="padding-right:1%">\r\n                    <input type="radio" ng-model="vm.type.name" value="WorkOrder">\r\n                    Work Order\r\n                </label>\r\n               \r\n                <label style="padding-right:1%">\r\n                    <input type="radio" ng-model="vm.type.name" value="SiteEquipment">\r\n                    Site Equipment\r\n                </label>\r\n                \r\n                <label>\r\n                    <input type="radio" ng-model="vm.type.name" value="Miscellaneous">\r\n                    Miscellaneous\r\n                </label>\r\n                <br /><br />\r\n            </div>\r\n        </div>\r\n        <div ng-if="vm.workOrder">\r\n            <fc-table-edit api-method="formtemplates" id="{{vm.id}}" on-back="vm.$state.go(\'formTemplateTable\')" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n        </div>\r\n        <div ng-if="vm.misc">\r\n            <fc-table-edit api-method="formtemplates" id="{{vm.id}}" on-back="vm.$state.go(\'formTemplateTable\')" attributes="vm.attributesMisc" model="vm.model"></fc-table-edit>\r\n        </div>\r\n        <div ng-if="vm.site">\r\n        <fc-table-edit api-method="formtemplates" id="{{vm.id}}" on-back="vm.$state.go(\'formTemplateTable\')" attributes="vm.attributesSite" model="vm.model"></fc-table-edit>\r\n    </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Form/formTemplateTable.html",'<div id="pcont" class="container-fluid" ng-controller="FormTemplateController as vm">\r\n\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Form Template</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Form Template</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <fc-table api-method="formtemplates"\r\n                                  attributes="vm.attributes"\r\n                                  delete-event="vm.closeDPSTemplate()"\r\n                                  ng-if="vm.reloadFilter"\r\n                                  on-edit="vm.edit(id)">\r\n                        </fc-table>\r\n                    </div>\r\n                </div>\x3c!-- content --\x3e\r\n            </div>\x3c!-- block-flat --\x3e\r\n        </div>\x3c!-- columns --\x3e\r\n    </div>\x3c!-- row --\x3e\r\n</div>\r\n\r\n\r\n\r\n'),e.put("Templates/Form/selectCustomerForForm.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n  <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n    \x3c!-- Modal content--\x3e\r\n    <div class="modal-content"  style="overflow-y: auto; height: 90%">\r\n      <div class="modal-header">\r\n        <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n      </div>\r\n        <div class="modal-body selectCustomer" ng-if="!vm.edit" id="newWorkOrder" >\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group">\r\n                    <div class="col-sm-7 col-md-6 col-lg-5">\r\n                        <input type="text" placeholder="Search" class="form-control" ng-model="vm.customerFilter.search">\r\n\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <button type="submit" class="btn btn-primary" ng-click="vm.search()">Search</button>\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n            <fc-table table-name="Customer" on-edit="vm.edit = true" api-method="customers/active" attributes="vm.attributes" selected="vm.customerId" list="vm.customers" filter="vm.autoFilterCustomer"></fc-table>\r\n        </div>\r\n        <div class="modal-body" ng-if="vm.edit">\r\n            <fc-table-edit api-method="customers" on-back="vm.edit = false" attributes="vm.attributesEdit" model="vm.model"></fc-table-edit>\r\n        </div>\r\n    </div>\r\n  </div>\r\n</div>\r\n<div class="modal-backdrop in fade" ></div>\r\n'),e.put("Templates/Form/selectSiteForForm.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n  <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n    \x3c!-- Modal content--\x3e\r\n    <div class="modal-content" style="overflow-y: auto; height: 90%">\r\n      <div class="modal-header">\r\n        <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n      </div>\r\n\r\n      <div class="modal-body selectSite"  ng-if="!vm.edit" id="newWorkOrder">\r\n          <div class="col-sm-6 col-md-6">\r\n              <div class="form-group">\r\n                  <div class="col-sm-7 col-md-6 col-lg-5">\r\n                      <input type="text" placeholder="Search" class="form-control" ng-model="vm.siteFilter.search">\r\n                    \r\n                  </div> \x3c!-- input box --\x3e\r\n                  <button type="submit" class="btn btn-primary" ng-click="vm.search()">Search</button>\r\n              </div> \x3c!-- form group --\x3e\r\n          </div>\r\n          <fc-table table-name="Site" api-method="sites/searchgrid" on-edit="vm.edit = true" attributes="vm.attributes" selected="vm.siteId" list="vm.sites" filter="vm.autoFilterCustomer"></fc-table>\r\n        </div>\r\n        <div class="modal-body" ng-if="vm.edit">\r\n            <fc-table-edit api-method="sites" on-back="vm.edit = false" attributes="vm.attributesEdit" model="vm.model"></fc-table-edit>\r\n        </div>\r\n    </div>\r\n\r\n  </div>\r\n</div>\r\n<div class="modal-backdrop in fade" ></div>\r\n'),e.put("Templates/Impersonation/impersonation.html",'<div id="pcont" class="container-fluid" ng-controller="ImpersonationController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.goHome()">Home</a></li>\r\n            <li class="active">Impersonation</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n    </div>\r\n    <div class="table-edit-overlay" ng-show="vm.loadingData">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n\r\n                    <div class="content">\r\n                    <h2 style="color: #5e94ff">Companies</h2>\r\n                        <div class="col-sm-12">\r\n                            <div id="datatable-icons_filter" class="dataTables_filter" style="text-align:left">\r\n                                <label>Search:<i class="fa fa-info-circle" style="display: none"></i><input type="search" class="form-control input-sm" placeholder="" aria-controls="datatable-icons" fc-enter="vm.searchCompanies()" ng-model="vm.searchCompaniesText"></label>\r\n                            </div>\r\n                        </div>\r\n                        <div  id="impersonation">\r\n                            <fc-table api-method="impersonation/companies"\r\n                                      attributes="vm.attributesCompany"\r\n                                      selected="vm.companyID"\r\n                                      filter="vm.filterCompany">\r\n                            </fc-table>\r\n                        </div>\r\n                        \r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n        <div class="row">\r\n\r\n            <div class="col-md-12" ng-if="vm.reloadTable">\r\n                <div class="block-flat">\r\n                    <h2 style="color: #5e94ff">Users</h2>\r\n                    <div class="content">\r\n                        <div class="col-sm-12">\r\n                            <div id="datatable-icons_filter" class="dataTables_filter" style="text-align:left">\r\n                                <label>Search:<i class="fa fa-info-circle" style="display: none"></i><input type="search" class="form-control input-sm" placeholder="" aria-controls="datatable-icons" fc-enter="vm.searchUsers()" ng-model="vm.searchUsersText"></label>\r\n                            </div>\r\n                        </div>\r\n                        <div id="impersonation">\r\n                            <fc-table api-method="impersonation/users"\r\n                                      attributes="vm.attributesUser"\r\n                                      filter="vm.filterUser"\r\n                                      ng-if="vm.reloadTable">\r\n                            </fc-table>\r\n                        </div>\r\n\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Invoices/bills.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="BillsController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Bills</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Bills</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="clearfix CollapsibleTitle">\r\n            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n        </div>\r\n\r\n        <div id="Collapsible" class="collapse in clearfix">\r\n            <div class="col-sm-12 col-lg-12">\r\n                <div class="form-group">\r\n                    <label>\r\n                        <input type="radio" ng-model="vm.postInvoice.date" value="Invoice" fc-enter="vm.reloadData()">\r\n                        Bill Date\r\n                    </label> <br />\r\n                    <label>\r\n                        <input type="radio" ng-model="vm.postInvoice.date" ng-value="Post" fc-enter="vm.reloadData()">\r\n                        Post Date\r\n                    </label>\r\n                </div>\r\n            </div>\r\n            <div class="col-sm-6 col-lg-6">\r\n                <div class="form-group" fc-enter="vm.reloadData()">\r\n                    <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                    <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                        \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                        \x3c!-- <input name="From Date" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterBills.fromDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                        <input name="From Date" onpaste="return false;" restrict-to="{{vm.dateService.restrictToDate()}}" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterBills.fromDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                        \x3c!-- BUG87 : END --\x3e\r\n                        <span class="input-group-addon btn btn-white">\r\n                            <span class="glyphicon glyphicon-calendar"></span>\r\n                        </span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class="col-sm-6 col-lg-6">\r\n                <div class="form-group" fc-enter="vm.reloadData()">\r\n                    <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                    <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                        \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                        \x3c!-- <input name="To Date" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterBills.toDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                        <input name="To Date" onpaste="return false;" restrict-to="{{vm.dateService.restrictToDate()}}" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterBills.toDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                        \x3c!-- BUG87 : END --\x3e\r\n                        <span class="input-group-addon btn btn-white">\r\n                            <span class="glyphicon glyphicon-calendar"></span>\r\n                        </span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group">\r\n                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Subcontractor</label>\r\n                    <div class="col-sm-7 col-md-6 col-lg-5">\r\n                        <input type="text" placeholder="Search" class="form-control" ng-model="vm.filterBills.search" fc-enter="vm.reloadData()">\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group">\r\n                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">WO Id</label>\r\n                    <div class="col-sm-7 col-md-6 col-lg-5">\r\n                        \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                        \x3c!-- <input type="number" placeholder="Search" class="form-control" ng-model="vm.filterBills.woAltId" fc-enter="vm.reloadData()"> --\x3e\r\n                        <input type="number" onwheel="this.blur()" placeholder="Search" class="form-control" ng-model="vm.filterBills.woAltId" fc-enter="vm.reloadData()">\r\n                        \x3c!-- BUG32 : END --\x3e\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n            <div class="col-sm-6 col-md-6 col-sm-offset-6 col-md-offset-6">\r\n                <div class="form-group">\r\n                    <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Status</label>\r\n                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                        <select class="form-control" multiple ng-model="vm.filterBills.status" fc-enter="vm.reloadData()">\r\n                            <option value="Voided">Voided</option>\r\n                            <option value="Open">Open</option>\r\n                            <option value="Posted">Posted</option>\r\n                        </select>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                        <button type="submit" class="btn btn-primary" style="margin-top:15px;margin-right:60px" ng-click="vm.reloadData()">Search</button>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div>\r\n            </div>\r\n            \r\n            </div>\x3c!-- Collapsible section end --\x3e\r\n        <br /><br />\r\n        <div class="row">\r\n            <div class="col-sm-12">\r\n                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr role="row">\r\n                            \x3c!--<th tabindex="0" aria-controls="datatable-icons" rowspan="1" colspan="1" aria-sort="ascending" aria-label="CustomerId: activate to sort column descending" style="width: 325px;">Assignment Status Id</th>--\x3e\r\n                            <th>Subcontractor</th>\r\n                            <th>Customer</th>\r\n                            <th>WO Id</th>\r\n                            <th>Bill Id</th>\r\n                            <th>Bill Date</th>\r\n                            <th>Post Date</th>\r\n                            <th>Bill Amount</th>\r\n                            <th>Status</th>\r\n                            <th>External Id</th>\r\n                            <th style="width: 25px" class="center">\r\n                            </th>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr role="row" ng-repeat-start="item in  vm.items" ng-click="vm.setSelected(item)" >\r\n                            <td> {{item.CompanyName}} </td>\r\n                            <td> {{item.CustomerName}} </td>\r\n                            <td><a class="cursor_pointer" ng-click="vm.goToWo(item)">{{item.WoAltId}}</a></td>\r\n                            <td> {{item.AltId}} </td>\r\n                            <td> {{item.InvoiceDate | date: \'MM/dd/yyyy\' }} </td>\r\n                            <td> {{item.PostDate | date: \'MM/dd/yyyy\' }} </td>\r\n                            <td> {{item.InvoiceAmount | number:2}} </td>\r\n                            <td> {{item.InvoiceStatus}} </td>\r\n                            <td> {{item.ExternalId}} </td>\r\n                            <td style="text-align:center">\r\n                                <img class="toggle-details" ng-if="vm.drilldownOpen[$index]" src="Content/img/drill-down-arrow-up.png" ng-click="vm.toggleDrilldown($index)" />\r\n                                <img class="toggle-details" ng-if="!vm.drilldownOpen[$index]" src="Content/img/drill-down-arrow-b.png" ng-click="vm.toggleDrilldown($index)" />\r\n                            </td>\r\n                        </tr>\r\n                        <tr ng-repeat-end ng-if="vm.drilldownOpen[$index]" class="details">\r\n                            <td class="details" colspan="10">\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px">\r\n                                    <tbody>\r\n                                        <tr><th colspan="10" class="text-center invoiceBackgroundColorHeader">Labor</th></tr>\r\n                                        <tr ng-hide="vm.items[$index].WoLabors.length == 0">\r\n                                            <th width="10%">WO Id</th>\r\n                                            <th width="40%">Tech</th>\r\n                                            <th width="10%">Hours</th>\r\n                                            <th width="10%">Date</th>\r\n                                            <th width="10%">Pay Rate</th>\r\n                                            <th width="10%" style="text-align: right">Cost</th>\r\n                                            <th width="10%" style="text-align: right">Ext.Cost</th>\r\n                                        </tr>\r\n                                        <tr ng-repeat="labor in vm.items[$index].WoLabors">\r\n                                            <td width="10%">{{labor.AltId}}</td>\r\n                                            <td width="40%">{{labor.FullName}}</td>\r\n                                            <td width="10%">{{labor.Hours}}</td>\r\n                                            <td width="10%">{{labor.Date | date: \'MM/dd/yyyy\'}}</td>\r\n                                            <td width="10%">{{labor.PayRateName}}</td>\r\n                                            <td width="10%" style="text-align: right">{{labor.Cost | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right">{{labor.ExtendedCost | number:2}} </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px">\r\n                                    <tbody>\r\n                                        <tr><th colspan="10" class="text-center invoiceBackgroundColorHeader">Parts</th></tr>\r\n                                        <tr colspan="10" ng-hide="vm.items[$index].Parts.length == 0">\r\n                                            <th width="10%">WO Id</th>\r\n                                            <th width="40%">Description</th>\r\n                                            <th width="30%">Qty</th>\r\n                                            <th width="10%" style="text-align: right">Unit Cost</th>\r\n                                            <th width="10%" style="text-align: right">Ext.Cost</th>  \r\n                                        </tr>\r\n                                        <tr ng-repeat="part in vm.items[$index].Parts">\r\n                                            <td width="10%">{{part.AltId}}</td>\r\n                                            <td width="40%">{{part.Desc}}</td>\r\n                                            <td width="30%">{{part.Quantity}}</td>\r\n                                            <td width="10%" style="text-align: right">{{part.Cost | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right">{{part.ExtendedCost | number:2}} </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px">\r\n                                    <tbody>\r\n                                        <tr><th colspan="10" class="text-center invoiceBackgroundColorHeader">Misc</th></tr>\r\n                                        <tr colspan="10" ng-hide="vm.items[$index].Miscellaneous.length == 0">\r\n                                            <th width="10%">WO Id</th>\r\n                                            <th width="40%">Description</th>\r\n                                            <th width="30%">Qty</th>\r\n                                            <th width="10%" style="text-align: right">Unit Cost</th>\r\n                                            <th width="10%" style="text-align: right">Ext.Cost</th>\r\n                                        </tr>\r\n                                        <tr ng-repeat="misc in vm.items[$index].Miscellaneous">\r\n                                            <td width="10%">{{misc.AltId}}</td>\r\n                                            <td width="40%">{{misc.WoItemName}}</td>\r\n                                            <td width="30%">{{misc.Quantity}}</td>\r\n                                            <td width="10%" style="text-align: right">{{misc.Cost | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right">{{misc.ExtendedCost | number:2}} </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px">\r\n                                    <tbody>\r\n                                        <tr><th colspan="10" class="text-right width80">Total</th><th class="text-right">{{vm.subTotal[$index] | number:2}}</th></tr>\r\n                                    </tbody>\r\n                                </table>\r\n                            </td>\r\n                        </tr>              \r\n                    </tbody>\r\n                 </table>\r\n            </div>\r\n        </div>  \r\n    </div>\r\n</div>'),e.put("Templates/Invoices/invoiceReview.html",'<div id="pcont" class="container-fluid" ng-controller="InvoiceReviewController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Invoice</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Invoice</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="clearfix CollapsibleTitle">\r\n            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n        </div>\r\n\r\n        <div id="Collapsible" class="collapse in clearfix">\r\n            <div class="col-sm-12 col-lg-12">\r\n                <div class="form-group">\r\n                    <label>\r\n                        <input type="radio" ng-model="vm.postInvoice.date" value="Invoice" fc-enter="vm.reloadData()">\r\n                        Invoice Date\r\n                    </label> <br />\r\n                    <label>\r\n                        <input type="radio" ng-model="vm.postInvoice.date" value="Post" fc-enter="vm.reloadData()">\r\n                        Post Date\r\n                    </label>\r\n                </div>\r\n            </div>\r\n            <div class="col-sm-6 col-lg-6">\r\n                <div class="form-group">\r\n                    <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                    <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="" fc-enter="vm.reloadData()">\r\n                        \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                        \x3c!-- <input name="From Date" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterBills.fromDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                        <input name="From Date" onpaste="return false;" type="datetime" restrict-to="{{vm.dateService.restrictToDate()}}" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterBills.fromDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                        \x3c!-- BUG87 : END --\x3e\r\n                        <span class="input-group-addon btn btn-white">\r\n                            <span class="glyphicon glyphicon-calendar"></span>\r\n                        </span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class="col-sm-6 col-lg-6">\r\n                <div class="form-group">\r\n                    <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                    <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="" fc-enter="vm.reloadData()">\r\n                        \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                        \x3c!-- <input name="To Date" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterBills.toDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                        <input name="To Date" onpaste="return false;" type="datetime" restrict-to="{{vm.dateService.restrictToDate()}}" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterBills.toDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                        \x3c!-- BUG87 : END --\x3e\r\n                        <span class="input-group-addon btn btn-white">\r\n                            <span class="glyphicon glyphicon-calendar"></span>\r\n                        </span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group">\r\n                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Bill To</label>\r\n                    <div class="col-sm-7 col-md-6 col-lg-5">\r\n                        <input type="text" placeholder="Search" class="form-control" ng-model="vm.filterBills.search" fc-enter="vm.reloadData()">\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group">\r\n                    <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Status</label>\r\n                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                        <select class="form-control" multiple ng-model="vm.filterBills.status" fc-enter="vm.reloadData()">\r\n                            <option value="Voided">Voided</option>\r\n                            <option value="Open">Open</option>\r\n                            <option value="Posted">Posted</option>\r\n                        </select>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n                <div class="form-group">\r\n                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                        \x3c!-- Added vm.newSearch() on Serch function for Bug-110 --\x3e\r\n                        <button type="submit" style="margin-top:15px;margin-right:60px" class="btn btn-primary" ng-click="vm.newSearch()">Search</button>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div>\r\n            </div>\r\n        </div>\x3c!-- Collapsible section end --\x3e\r\n        <br /><br />\r\n        <div class="form-group">\r\n            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right">\r\n                <button type="submit" class="btn btn-primary pull-right" ng-click="vm.createInvoice()" ng-if="vm.isAdmin">Create Work Order invoice</button>\r\n            </div> \x3c!-- input box --\x3e\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-sm-12">\r\n                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr role="row">\r\n\r\n                            \x3c!--<th tabindex="0" class="action-col" aria-controls="datatable-icons" rowspan="1" colspan="1" aria-label="Address: activate to sort column ascending" style="width: 50px;text-align:center;padding-right:8px"></th>--\x3e\r\n                            <th ng-repeat="attr in vm.attributes"\r\n                                ng-class="{sorting: attr.Sortable && vm.filterBills.sortCol != attr.ValueName,\r\n                                                        sorting_asc: attr.Sortable && vm.filterBills.sortCol == attr.ValueName  && vm.filterBills.sortDir == \'asc\',\r\n                                                        sorting_desc: attr.Sortable && vm.filterBills.sortCol == attr.ValueName  && vm.filterBills.sortDir == \'desc\',\r\n                                                       }"\r\n                                ng-click="vm.toggleSort(attr.ValueName, attr.Sortable, attr.Tmp)">\r\n                                {{attr.Name}}\r\n\r\n                            </th>\r\n                            <th></th>\r\n                        </tr>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr role="row" ng-repeat-start="item in  vm.items" ng-click="vm.setSelected(item)">\r\n                            <td> {{item.SubContractorId == null ? item.CustomerName : item.CompanyName}} </td>\r\n                            <td> {{item.CustomerName}} </td>\r\n                            <td ng-if="vm.isAdmin || item.InvoiceStatus != \'Posted\'"> <a class="cursor_pointer" ng-click="vm.edit(item.Id, item.SubContractorId, item.AgreementId)">{{item.AltId}}</a> </td>\r\n                            <td ng-if="!vm.isAdmin && item.InvoiceStatus == \'Posted\'"> {{item.AltId}} </td>\r\n                            <td> {{item.InvoiceDate | date: \'MM/dd/yyyy\' }} </td>\r\n                            <td> {{item.PostDate | date: \'MM/dd/yyyy\' }} </td>\r\n                            <td> {{item.InvoiceAmount | number:2}} </td>\r\n                            <td> {{item.InvoiceStatus}} </td>\r\n                            \x3c!--<td ng-if="item.AgreementId == null">Work Order</td>--\x3e\r\n                            <td>{{item.Desc}}</td>\r\n                            <td> {{item.ExternalId}} </td>\r\n                            <td style="text-align:center">\r\n                                <img class="toggle-details" ng-if="vm.drilldownOpen[$index] && item.AgreementId == null" src="Content/img/drill-down-arrow-up.png" ng-click="vm.toggleDrilldown($index)" />\r\n                                <img class="toggle-details" ng-if="!vm.drilldownOpen[$index] && item.AgreementId == null" src="Content/img/drill-down-arrow-b.png" ng-click="vm.toggleDrilldown($index)" />\r\n                            </td>\r\n                        </tr>\r\n                        <tr ng-if="vm.drilldownOpen[$index]" ng-repeat-end class="details" ng-click="vm.setSelected(item)">\r\n                            <td class="details" colspan="10">\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px" ng-hide="vm.items[$index].WoLabors.length == 0">\r\n                                    <tbody>\r\n                                        <tr><th colspan="10" class="text-center invoiceBackgroundColorHeader">Labor</th></tr>\r\n                                        <tr ng-hide="vm.items[$index].WoLabors.length == 0">\r\n                                            <th width="10%">WO Id</th>\r\n                                            <th width="30%">Tech</th>\r\n                                            <th width="10%">Hours</th>\r\n                                            <th width="10%">Date</th>\r\n                                            <th width="10%">Pay Rate</th>\r\n                                            <th width="10%" style="text-align: right" ng-if="!item.SubContractorId">Price</th>\r\n                                            <th width="10%" style="text-align: right" ng-if="item.SubContractorId">Cost</th>\r\n                                            <th width="10%" style="text-align: right" ng-if="vm.isAdmin">Tax Rate (%)</th>\r\n                                            <th width="10%" style="text-align: right" ng-if="!item.SubContractorId">Ext.Price</th>\r\n                                            <th width="10%" style="text-align: right" ng-if="item.SubContractorId">Ext.Cost</th>\r\n\r\n                                        </tr>\r\n                                        <tr ng-repeat="labor in vm.items[$index].WoLabors">\r\n                                            <td width="10%">{{labor.AltId}}</td>\r\n                                            <td width="30%">{{labor.FullName}}</td>\r\n                                            <td width="10%">{{labor.Hours}}</td>\r\n                                            <td width="10%">{{labor.Date | date: \'MM/dd/yyyy\'}}</td>\r\n                                            <td width="10%">{{labor.PayRateName}}</td>\r\n                                            <td width="10%" style="text-align: right">{{item.SubContractorId == null ? labor.RateHour : labor.Cost | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right" ng-if="vm.isAdmin">{{labor.TaxRate | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right">{{item.SubContractorId == null ? labor.ExtendedPrice : labor.ExtendedCost | number:2}} </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px" ng-hide="vm.items[$index].Parts.length == 0">\r\n                                    <tbody>\r\n                                        <tr><th colspan="10" class="text-center invoiceBackgroundColorHeader">Parts</th></tr>\r\n                                        <tr colspan="10" ng-hide="vm.items[$index].Parts.length == 0">\r\n                                            <th width="10%">WO Id</th>\r\n                                            <th width="30%">Description</th>\r\n                                            <th width="30%">Qty</th>\r\n                                            <th width="10%" style="text-align: right" ng-if="!item.SubContractorId">Unit Price</th>\r\n                                            <th width="10%" style="text-align: right" ng-if="item.SubContractorId">Unit Cost</th>\r\n                                            <th width="10%" style="text-align: right" ng-if="vm.isAdmin">Tax Rate (%)</th>\r\n                                            <th width="10%" style="text-align: right" ng-if="!item.SubContractorId">Ext.Price</th>\r\n                                            <th width="10%" style="text-align: right" ng-if="item.SubContractorId">Ext.Cost</th>\r\n                                        </tr>\r\n                                        <tr ng-repeat="part in vm.items[$index].Parts">\r\n                                            <td width="10%">{{part.AltId}}</td>\r\n                                            <td width="30%">{{part.Desc}}</td>\r\n                                            <td width="30%">{{part.Quantity}}</td>\r\n                                            <td width="10%" style="text-align: right">{{item.SubContractorId == null ? part.Price : part.Cost | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right" ng-if="vm.isAdmin">{{part.TaxRate | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right">{{item.SubContractorId == null ? part.ExtendedPrice : part.ExtendedCost | number:2}} </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px" ng-hide="vm.items[$index].Miscellaneous.length == 0">\r\n                                    <tbody>\r\n                                        <tr><th colspan="10" class="text-center invoiceBackgroundColorHeader">Misc</th></tr>\r\n                                        <tr colspan="10" ng-hide="vm.items[$index].Miscellaneous.length == 0">\r\n                                            <th width="10%">WO Id</th>\r\n                                            <th width="30%">Description</th>\r\n                                            <th width="30%">Qty</th>\r\n                                            <th width="10%" style="text-align: right" ng-if="!item.SubContractorId">Unit Price</th>\r\n                                            <th width="10%" style="text-align: right" ng-if="item.SubContractorId">Unit Cost</th>\r\n                                            <th width="10%" style="text-align: right" ng-if="vm.isAdmin">Tax Rate (%)</th>\r\n                                            <th width="10%" style="text-align: right" ng-if="!item.SubContractorId">Ext.Price</th>\r\n                                            <th width="10%" style="text-align: right" ng-if="item.SubContractorId">Ext.Cost</th>\r\n                                        </tr>\r\n                                        <tr ng-repeat="misc in vm.items[$index].Miscellaneous">\r\n                                            <td width="10%">{{misc.AltId}}</td>\r\n                                            <td width="30%">{{misc.WoItemName}}</td>\r\n                                            <td width="30%">{{misc.Quantity}}</td>\r\n                                            <td width="10%" style="text-align: right">{{item.SubContractorId == null ? misc.Price : misc.Cost | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right" ng-if="vm.isAdmin">{{misc.TaxRate | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right">{{item.SubContractorId == null ? misc.ExtendedPrice : misc.ExtendedCost | number:2}} </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px">\r\n                                    <tbody>\r\n                                        <tr ng-repeat="n in vm.total" ng-if="vm.isAdmin && vm.selected == n.id"><th colspan="10" class="text-right width80">Subtotal</th><th class="text-right">{{  n.amount  | number:2   }}</th></tr>\r\n                                        <tr ng-repeat="n in vm.total" ng-if="vm.isAdmin && vm.selected == n.id"><th colspan="10" class="text-right width80">Tax</th><th class="text-right">{{n.tax  | number:2}}</th></tr>\r\n                                        <tr ng-repeat="n in vm.total" ng-if="vm.isAdmin && vm.selected==n.id"><th colspan="10" class="text-right width80">Total</th><th class="text-right">{{n.amount + n.tax | number:2}}</th></tr>\r\n                                        <tr ng-repeat="n in vm.total" ng-if="!vm.isAdmin && vm.selected==n.id"><th colspan="10" class="text-right width80">Total</th><th class="text-right">{{n.amount  | number:2}}</th></tr>\r\n                                    </tbody>\r\n                                </table>\r\n                            </td>\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\r\n        </div>\r\n        <div class="row" style="margin-left:0px;">\r\n            \x3c!-- Added vm.nextPage() function for Bug-110 --\x3e\r\n            <fc-paging ng-click="vm.nextPage()" page="vm.invoiceMeta.Paging.Page" page-size="vm.invoiceMeta.Paging.PageSize" current-data-length="vm.items.length" total="vm.invoiceMeta.Paging.TotalCount"></fc-paging>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-sm-5">\r\n                <div class="dataTables_length" id="datatable-icons_length">\r\n                    <label>\r\n                        Show\r\n                        \x3c!-- Added vm.changeEntries() function Bug-110 --\x3e\r\n                        <select ng-change="vm.changeEntries()" name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.invoiceMeta.Paging.PageSize">\r\n                            <option value="10">10</option>\r\n                            <option value="25">25</option>\r\n                            <option value="50">50</option>\r\n                            <option value="100">100</option>\r\n                        </select> entries\r\n                    </label>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>'),e.put("Templates/Invoices/invoiceWO.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="InvoicesWOController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Invoice</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Add WO to Invoice</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div id="manageWO" class="row  form-horizontal">\r\n            <div class="tableBtns text-right">\r\n                <a class="cursor_pointer" ng-click="vm.goBack()">Go Back</a>\r\n\r\n            </div>\r\n            <div class="clearfix CollapsibleTitle">\r\n                <button type="button" class="btn btn-info pull-right Collapsible collapsed" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n            </div>\r\n\r\n            <div id="Collapsible" class="collapse in clearfix">\r\n          \r\n                <fc-table-edit api-method="wo"\r\n                               model="vm.model"\r\n                               attributes="vm.attributes">\r\n                </fc-table-edit>\r\n                <div class="col-sm-6 col-lg-6">\r\n                    <div class="form-group">\r\n                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                        <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                            <input name="StartDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterTmpDate.fromDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                            <span class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon glyphicon-calendar"></span>\r\n                            </span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class="col-sm-6 col-lg-6">\r\n                    <div class="form-group">\r\n                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                        <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                            <input name="EndDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filterTmpDate.toDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                            <span class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon glyphicon-calendar"></span>\r\n                            </span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class="form-group">\r\n                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                        <button type="submit" class="btn btn-primary" ng-click="vm.loadFilter()">Search</button>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div>\r\n            </div>\x3c!-- Collapsible section end --\x3e\r\n        </div>\x3c!-- row end --\x3e\r\n        <div class="form-group">\r\n            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right">\r\n                <button type="submit" class="btn btn-primary" ng-click="vm.addToInvoice()">Add To Invoice</button>\r\n            </div> \x3c!-- input box --\x3e\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-sm-12">\r\n                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr role="row">\r\n                            <th></th>\r\n                            \x3c!--<th tabindex="0" aria-controls="datatable-icons" rowspan="1" colspan="1" aria-sort="ascending" aria-label="CustomerId: activate to sort column descending" style="width: 325px;">Assignment Status Id</th>--\x3e\r\n                            <th>Work Order</th>\r\n                            <th>WO Type</th>\r\n                            <th>Promised Date</th>\r\n                            <th>Site</th>\r\n                            <th>Description</th>\r\n                            <th>Lead Tech</th>\r\n                            <th>Subcontractor</th>\r\n                            <th>Office</th>\r\n                            <th style="width: 25px" class="center">\r\n\r\n                            </th>\r\n\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr role="row" ng-repeat-start="item in vm.items" ng-hide="vm.items[$index].WoLabors.length == 0 && vm.items[$index].Parts.length == 0 && vm.items[$index].Miscellaneous.length == 0">\r\n                            <th><input type="checkbox" ng-model="item.AllWoItems" ng-click="vm.checkAllFromWo($index)" /></th>\r\n                            <td> {{item.AltId}} </td>\r\n                            <td> {{item.WoType}} </td>\r\n                            <td> {{item.PromiseDate | date: \'MM/dd/yyyy\' }} </td>\r\n                            <td> {{item.SiteName}} </td>\r\n                            <td> {{item.Desc}} </td>\r\n                            <td> {{item.FullName}} </td>\r\n                            <td> {{item.CompanyName}} </td>\r\n                            <td> {{item.OfficeName}} </td>\r\n                            <td style="text-align:center; margin-right: 20px">\r\n                                <img class="toggle-details" ng-if="vm.drilldownOpen[$index]" src="Content/img/drill-down-arrow-up.png" ng-click="vm.toggleDrilldown($index)" />\r\n                                <img class="toggle-details" ng-if="!vm.drilldownOpen[$index]" src="Content/img/drill-down-arrow-b.png" ng-click="vm.toggleDrilldown($index)" />\r\n                            </td>\r\n                        </tr>\r\n                        <tr ng-repeat-end ng-if="vm.drilldownOpen[$index]" class="details">\r\n                            <td class="details" colspan="10">\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px" ng-hide="vm.items[$index].WoLabors.length == 0">\r\n                                    <tbody>\r\n                                        <tr><th colspan="10" class="text-center invoiceBackgroundColorHeader">Labor</th></tr>\r\n                                        <tr>\r\n                                            <th width="2%"><input type="checkbox" ng-model="item.AllLabor" ng-click="vm.checkAllLabor($index)" /></th>\r\n                                            <th width="10%">WO Id</th>\r\n                                            <th width="28%">Tech</th>\r\n                                            <th width="10%">Hours</th>\r\n                                            <th width="10%">Date</th>\r\n                                            <th width="10%">Pay Rate</th>\r\n                                            <th width="10%" style="text-align: right">Rate Hour</th>\r\n                                            <th width="10%" style="text-align: right">Tax Rate (%)</th>\r\n                                            <th width="10%" style="text-align: right">Ext.Price</th>\r\n                                        </tr>\r\n                                        <tr ng-repeat="labor in vm.items[$index].WoLabors">\r\n                                            \x3c!--ng-repeat="attr in options.attributes" ng-click="vm.edit(item.Id)"--\x3e\r\n                                            <td width="2%"><input type="checkbox" checklist-model="vm.listOfLabor" checklist-value="labor.Id" /></td>\r\n                                            <td width="10%">{{labor.AltId}}</td>\r\n                                            <td width="28%">{{labor.FullName}}</td>\r\n                                            <td width="10%">{{labor.Hours}}</td>\r\n                                            <td width="10%">{{labor.Date | date: \'MM/dd/yyyy\'}}</td>\r\n                                            <td width="10%">{{labor.PayRateName}}</td>\r\n                                            <td width="10%" style="text-align: right">{{labor.RateHour | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right">{{labor.TaxRate | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right">{{labor.ExtendedPrice | number:2}} </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px" ng-hide="vm.items[$index].Parts.length == 0">\r\n                                    <tbody>\r\n                                        <tr><th colspan="10" class="text-center invoiceBackgroundColorHeader">Parts</th></tr>\r\n                                        <tr colspan="10">\r\n\r\n                                            <th width="2%"><input type="checkbox" ng-model="item.AllPart" ng-click="vm.checkAllPart($index)" /></th>\r\n                                            <th width="10%">WO Id</th>\r\n                                            <th width="28%">Description</th>\r\n                                            <th width="30%">Qty</th>\r\n                                            <th width="10%" style="text-align: right">Unit Price</th>\r\n                                            <th width="10%" style="text-align: right">Tax Rate (%)</th>\r\n                                            <th width="10%" style="text-align: right">Ext.Price</th>\r\n                                        </tr>\r\n                                        <tr ng-repeat="part in vm.items[$index].Parts">\r\n\r\n                                            <td width="2%"><input type="checkbox" checklist-model="vm.listOfPartsMisc" checklist-value="part.Id" /></td>\r\n                                            <td width="10%">{{part.AltId}}</td>\r\n                                            <td width="28%">{{part.Desc}}</td>\r\n                                            <td width="30%">{{part.Quantity}}</td>\r\n                                            <td width="10%" style="text-align: right">{{part.Price | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right">{{part.TaxRate | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right">{{part.ExtendedPrice | number:2}} </td>\r\n                                       \r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px" ng-hide="vm.items[$index].Miscellaneous.length == 0">\r\n                                    <tbody>\r\n                                        <tr><th colspan="10" class="text-center invoiceBackgroundColorHeader">Misc</th></tr>\r\n                                        <tr colspan="10">\r\n\r\n                                            <th width="2%"><input type="checkbox" ng-model="item.AllMisc" ng-click="vm.checkAllMisc($index)" /></th>\r\n                                            <th width="10%">WO Id</th>\r\n                                            <th width="28%">Description</th>\r\n                                            <th width="30%">Qty</th>\r\n                                            <th width="10%" style="text-align: right">UnitPrice</th>\r\n                                            <th width="10%" style="text-align: right">Tax Rate (%)</th>\r\n                                            <th width="10%" style="text-align: right">Ext.Price</th>\r\n                                          \r\n                                        </tr>\r\n                                        <tr ng-repeat="misc in vm.items[$index].Miscellaneous">\r\n\r\n                                            <td width="2%"><input type="checkbox" checklist-model="vm.listOfPartsMisc" checklist-value="misc.Id" /></td>\r\n                                            <td width="10%">{{misc.AltId}}</td>\r\n                                            <td width="28%">{{misc.WoItemName}}</td>\r\n                                            <td width="30%">{{misc.Quantity}}</td>\r\n                                            <td width="10%" style="text-align: right">{{misc.Price | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right">{{misc.TaxRate | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right">{{misc.ExtendedPrice | number:2}} </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n\r\n                            </td>\r\n                        </tr>\r\n\r\n                    </tbody>\r\n                </table>\r\n            </div>\r\n        </div>\r\n      \r\n    </div>\r\n</div>'),e.put("Templates/Invoices/invoiceform.html",'<div id="pcont" class="container-fluid" ng-controller="InvoicesController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Invoice</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Create Invoice</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div id="createInvoice">\r\n            <div class="tableBtns text-right">\r\n                \x3c!-- US3539 : FCO - WEB - Navigation links UI improvement (FCWO-2368) --\x3e\r\n                <button type="button" data-dismiss="modal" class="pull-right btn btn-primary btn-flat md-close" ng-click="vm.goBack()">Go Back</button>\r\n                \x3c!--<a class="cursor_pointer" ng-click="vm.goBack()">Go Back</a>--\x3e\r\n                \x3c!-- end --\x3e               \r\n            </div>\r\n        <fc-table-edit api-method="invoices" id="{{vm.id}}"  attributes="vm.attributes" model ="vm.model" ></fc-table-edit>   \r\n            <div class="form-group">\r\n                <div class="col-sm-8 col-md-7 col-lg-7">\r\n                    <button type="submit" class="btn btn-primary" ng-if="vm.id && vm.model.Status != \'Voided\'" ng-disabled="vm.model.Status == \'Posted\'" ng-click="vm.postInvoice()">Post</button>\r\n                    <button type="submit" class="btn btn-primary" ng-if="vm.id && vm.model.Status != \'Voided\'" ng-disabled="vm.model.Status == \'Posted\' && !vm.isAdmin" ng-click="vm.voidInvoice()">Void</button>\r\n                </div>\r\n                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4  text-right button-left">\r\n                        <button type="submit" class="btn btn-primary" ng-disabled="vm.model.Status == \'Posted\' && !vm.isAdmin" ng-click="vm.saveInvoice()">Submit</button>\r\n                        <button type="submit" class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div>\r\n     </div>\r\n        <br /><br />\r\n        <div class="form-group">\r\n            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right ">\r\n                <button type="submit" class="btn btn-primary" ng-click="vm.addWorkOrder()" ng-disabled="!vm.model.CustomerId || (vm.model.Status == \'Posted\' && !vm.isAdmin)" >Add Work Order</button>\r\n            </div> \x3c!-- input box --\x3e\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-sm-12">\r\n                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr role="row">\r\n                            \x3c!--<th tabindex="0" aria-controls="datatable-icons" rowspan="1" colspan="1" aria-sort="ascending" aria-label="CustomerId: activate to sort column descending" style="width: 325px;">Assignment Status Id</th>--\x3e\r\n                            <th>Work Order</th>\r\n                            <th>WO Type</th>\r\n                            <th>Promised Date</th>\r\n                            <th>Site</th>\r\n                            <th>Description</th>\r\n                            <th>Lead Tech</th>\r\n                            <th>Subcontractor</th>\r\n                            <th>Office</th>\r\n                            <th style="width: 25px" class="center"></th>\r\n                            <th></th>\r\n                        </tr>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr role="row" ng-repeat-start="item in vm.items" ng-if="!vm.showDetailsWO[$index]">\r\n                            <td> {{item.AltId}} </td>\r\n                            <td> {{item.WoType}} </td>\r\n                            <td> {{item.PromiseDate | date: \'MM/dd/yyyy\' }} </td>\r\n                            <td> {{item.SiteName}} </td>\r\n                            <td> {{item.Desc}} </td>\r\n                            <td> {{item.FullName}} </td>\r\n                            <td> {{item.CompanyName}} </td>\r\n                            <td> {{item.OfficeName}} </td>\r\n                            <td style="text-align:center">\r\n                                <img class="toggle-details" ng-if="vm.drilldownOpen[$index]" src="Content/img/drill-down-arrow-up.png" ng-click="vm.toggleDrilldown($index)" />\r\n                                <img class="toggle-details" ng-if="!vm.drilldownOpen[$index]" src="Content/img/drill-down-arrow-b.png" ng-click="vm.toggleDrilldown($index)" />\r\n                            </td>\r\n                            <td style="text-align:right;" class="action-col">\r\n                                <a class="btn btn-delete"  ng-disabled="vm.model.Status == \'Posted\' && !vm.isAdmin" ng-click="vm.deleteAll($index, item.AltId, vm.subTotal[$index], vm.tax[$index]);" data-original-title="Remove" data-toggle="tooltip"><i class="fa fa-times-circle"></i></a>\r\n                            </td>\r\n                        </tr>\r\n                        <tr ng-repeat-end ng-if="vm.drilldownOpen[$index]" class="details">\r\n                            <td class="details" colspan="10">\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px" ng-hide="vm.items[$index].WoLabors.length == 0">\r\n                                    <tbody>\r\n                                        <tr><th colspan="10" class="text-center invoiceBackgroundColorHeader">Labor</th></tr>\r\n                                        <tr ng-hide="vm.items[$index].WoLabors.length == 0">\r\n                                            <th width="10%">WO Id</th>\r\n                                            <th width="18%">Tech</th>\r\n                                            <th width="10%">Hours</th>\r\n                                            <th width="10%">Date</th>\r\n                                            <th width="10%">Labor Code</th>\r\n                                            <th width="10%">Pay Rate</th>\r\n                                            <th width="10%" style="text-align:right;">RateHour</th>\r\n                                            <th width="10%" style="text-align:right;">Tax Rate (%)</th>\r\n                                            <th width="10%" style="text-align:right;">Ext.Price</th>\r\n                                            <th width="2%"></th>\r\n                                        </tr>\r\n                                        <tr ng-repeat="labor in vm.items[$index].WoLabors" ng-if="!vm.showDetailsLabor[labor.AltId][$index]">\r\n                                            \x3c!--ng-repeat="attr in options.attributes" ng-click="vm.edit(item.Id)"--\x3e\r\n                                            <td width="10%">{{labor.AltId}}</td>\r\n                                            <td width="18%">{{labor.FullName}}</td>\r\n                                            <td width="10%">{{labor.Hours}}</td>\r\n                                            <td width="10%">{{labor.Date | date: \'MM/dd/yyyy\'}}</td>\r\n                                            <td width="10%">{{labor.LaborCodeName}}</td>\r\n                                            <td width="10%">{{labor.PayRateName}}</td>\r\n                                            <td width="10%" style="text-align:right;">{{labor.RateHour | number:2}}</td>\r\n                                            <td width="10%" style="text-align:right;">{{labor.TaxRate | number:2}}</td>\r\n                                            <td width="10%" style="text-align:right;">{{labor.ExtendedPrice | number:2}} </td>\r\n                                            <td width="2%" style="text-align:right;" class="action-col">\r\n                                                <a class="btn btn-delete"  ng-disabled="vm.model.Status == \'Posted\' && !vm.isAdmin" ng-click="vm.deleteLabor(vm.listOfLabor,labor.Id, labor.ExtendedPrice, labor.TaxRate, $parent.$parent.$index, $index, labor.AltId);"  data-original-title="Remove" data-toggle="tooltip"><i class="fa fa-times-circle"></i></a>\r\n                                            </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px" ng-hide="vm.items[$index].Parts.length == 0">\r\n                                    <tbody>\r\n                                        <tr><th colspan="9" class="text-center invoiceBackgroundColorHeader">Parts</th></tr>\r\n                                        <tr colspan="9" ng-hide="vm.items[$index].Parts.length == 0">\r\n                                            <th width="10%">WO Id</th>\r\n                                            <th width="18%">Description</th>\r\n                                            <th width="40%">Qty</th>\r\n                                            <th width="10%" style="text-align:right;">Unit Price</th>\r\n                                            <th width="10%" style="text-align:right;">Tax Rate (%)</th>\r\n                                            <th width="10%" style="text-align:right;">Ext.Price</th>\r\n                                            <th width="2%"></th> \r\n                                        </tr>\r\n                                        <tr ng-repeat="part in vm.items[$index].Parts" ng-if="!vm.showDetailsParts[$index]">\r\n                                            <td width="10%">{{part.AltId}}</td>\r\n                                            <td width="18%">{{part.Desc}}</td>\r\n                                            <td width="40%">{{part.Quantity}}</td>\r\n                                            <td width="10%" style="text-align:right;">{{part.Price | number:2}}</td>\r\n                                            <td width="10%" style="text-align:right;">{{part.TaxRate | number:2}}</td>\r\n                                            <td width="10%" style="text-align:right;">{{part.ExtendedPrice | number:2}} </td>\r\n                                            <td width="2%" style="text-align:right;" class="action-col">\r\n                                                <a class="btn btn-delete" ng-disabled="vm.model.Status == \'Posted\' && !vm.isAdmin" ng-click="vm.deleteParts(vm.listOfPartMisc,part.Id, part.ExtendedPrice, part.TaxRate, $parent.$parent.$index, $index);" data-original-title="Remove" data-toggle="tooltip"><i class="fa fa-times-circle"></i></a>\r\n                                            </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px" ng-hide="vm.items[$index].Miscellaneous.length == 0">\r\n                                    <tbody>\r\n                                        <tr><th colspan="9" class="text-center invoiceBackgroundColorHeader">Misc</th></tr>\r\n                                        <tr colspan="9" ng-hide="vm.items[$index].Miscellaneous.length == 0">\r\n                                            <th width="10%">WO Id</th>\r\n                                            <th width="18%">Description</th>\r\n                                            <th width="40%">Qty</th>\r\n                                            <th width="10%" style="text-align:right;">Unit Price</th>\r\n                                            <th width="10%" style="text-align:right;">Tax Rate (%)</th>\r\n                                            <th width="10%" style="text-align:right;">Ext.Price</th>\r\n                                            <th width="2%"></th>\r\n                                        </tr>\r\n                                        <tr ng-repeat="misc in vm.items[$index].Miscellaneous" ng-if="!vm.showDetailsMisc[$index]">\r\n                                            <td width="10%">{{misc.AltId}}</td>\r\n                                            <td width="18%">{{misc.WoItemName}}</td>\r\n                                            <td width="40%">{{misc.Quantity}}</td>\r\n                                            <td width="10%" style="text-align:right;">{{misc.Price | number:2}}</td>\r\n                                            <td width="10%" style="text-align:right;">{{misc.TaxRate | number:2}}</td>\r\n                                            <td width="10%" style="text-align:right;">{{misc.ExtendedPrice | number:2}} </td>\r\n                                            <td width="2%" style="text-align:right;" class="action-col">\r\n                                                <a class="btn btn-delete" ng-disabled="vm.model.Status == \'Posted\' && !vm.isAdmin" ng-click="vm.deleteMisc(vm.listOfPartMisc,misc.Id, misc.ExtendedPrice, misc.TaxRate, $parent.$parent.$index, $index);" data-original-title="Remove" data-toggle="tooltip"><i class="fa fa-times-circle"></i></a>\r\n                                            </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px">\r\n                                    <tbody>\r\n                                        <tr ng-model="vm.subTotal"><th colspan="10" class="text-right width80">Subtotal</th><th class="text-right" >{{vm.subTotal[$index] | number:2}}</th></tr>\r\n                                        <tr ng-model="vm.tax"><th colspan="10" class="text-right width80">Tax</th><th class="text-right">{{vm.tax[$index] | number:2}}</th></tr>\r\n                                        <tr><th colspan="10" class="text-right width80">Total</th><th class="text-right">{{vm.subTotal[$index] + vm.tax[$index] | number:2}}</th></tr>\r\n                                    </tbody>\r\n                                </table>\r\n                            </td>\r\n                        </tr>              \r\n                    </tbody>\r\n                 </table>\r\n            </div>\r\n        </div>  \r\n        <div class="row" ng-if="vm.reports != null && vm.reports.length > 0">\r\n            <div class="col-sm-12">\r\n                <br /><br />\r\n                <h4>Invoice reports</h4>\r\n                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr role="row">\r\n                            <th>Name</th>\r\n                            <th>Print Date</th>\r\n                            <th>Printed By</th>\r\n                            <th></th>\r\n                        </tr>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr role="row" ng-repeat="report in vm.reports">\r\n                            <td> <a class="cursor_pointer" ng-click="vm.download(vm.baseUrl + report.InvoiceReportUrl)" download> {{report.FileName}} </a> </td>\r\n                            <td> {{report.Date | date: \'MM/dd/yyyy\'}} </td>\r\n                            <td> {{report.FullName}} </td>\r\n                            <td width="5%"> <button class="btn btn-default" ng-disabled="vm.model.Status == \'Posted\' && !vm.isAdmin" ng-click="vm.printInvoice(report)" >Print</button> </td>\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>'),e.put("Templates/Invoices/invoiceformforSub.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="InvoicesSubcontractorController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Invoice</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Create Invoice</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div id="createInvoice">\r\n            <div class="tableBtns text-right">\r\n                <a class="cursor_pointer" ng-click="vm.goBack()">Go Back</a>\r\n\r\n            </div>\r\n            <fc-table-edit api-method="invoices" id="{{vm.id}}" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n            <div class="form-group">\r\n         \r\n                    <div class="col-sm-8 col-md-7 col-lg-7">\r\n                        <button type="submit" class="btn btn-primary" ng-if="vm.id && vm.model.Status != \'Voided\'" ng-disabled="vm.model.Status == \'Posted\'" ng-click="vm.postInvoice()">Post</button>\r\n                        <button type="submit" class="btn btn-primary" ng-if="vm.id && vm.model.Status != \'Voided\'" ng-click="vm.voidInvoice()">Void</button>\r\n                    </div>\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-8 col-md-7 col-lg-7 text-right">\r\n                            <button type="submit" class="btn btn-primary" ng-click="vm.saveInvoice()">Submit</button>\r\n                            <button type="submit" class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                        </div> \x3c!-- input box --\x3e\r\n            </div>\r\n        </div>\r\n        <br /><br />\r\n        <div class="row">\r\n            <div class="col-sm-12">\r\n                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr role="row">\r\n                            \x3c!--<th tabindex="0" aria-controls="datatable-icons" rowspan="1" colspan="1" aria-sort="ascending" aria-label="CustomerId: activate to sort column descending" style="width: 325px;">Assignment Status Id</th>--\x3e\r\n                            <th>Work Order</th>\r\n                            <th>WO Type</th>\r\n                            <th>Promised Date</th>\r\n                            <th>Time Zone</th>\r\n                            <th>Site</th>\r\n                            <th>Description</th>\r\n                            \x3c!--<th>Lead Tech</th>--\x3e\r\n                            <th>Subcontractor</th>\r\n                            <th>Office</th>\r\n                            <th style="width: 25px" class="center">\r\n                            </th>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr role="row" ng-repeat-start="item in  vm.items" ng-click="vm.setSelected(item)" >\r\n                            <td> {{item.AltId}} </td>\r\n                            <td> {{item.WoType}} </td>\r\n                            <td> {{vm.model.PromiseDate | date: \'MM/dd/yyyy hh:mm\' }} </td>\r\n                            <td> {{vm.model.TimeZoneName}}</td>\r\n                            <td> {{item.SiteName}} </td>\r\n                            <td> {{item.Desc}} </td>\r\n                            \x3c!--<td> {{item.FullName}} </td>--\x3e\r\n                            <td> {{item.CompanyName}} </td>\r\n                            <td> {{item.OfficeName}} </td>\r\n                            <td style="text-align:center">\r\n                                <img class="toggle-details" ng-if="vm.drilldownOpen[$index]" src="Content/img/drill-down-arrow-up.png" ng-click="vm.toggleDrilldown($index)" />\r\n                                <img class="toggle-details" ng-if="!vm.drilldownOpen[$index]" src="Content/img/drill-down-arrow-b.png" ng-click="vm.toggleDrilldown($index)" />\r\n                            </td>\r\n                        </tr>\r\n                        <tr ng-repeat-end ng-if="vm.drilldownOpen[$index]" class="details">\r\n                            <td class="details" colspan="9">\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px" ng-hide="vm.items[$index].WoLabors.length == 0">\r\n                                    <tbody>\r\n                                        <tr><th colspan="10" class="text-center invoiceBackgroundColorHeader">Labor</th></tr>\r\n                                        <tr ng-hide="vm.items[$index].WoLabors.length == 0">\r\n                                            <th width="10%">WO Id</th>\r\n                                            <th width="40%">Tech</th>\r\n                                            <th width="10%">Hours</th>\r\n                                            <th width="10%">Date</th>\r\n                                            <th width="10%">Pay Rate</th>\r\n                                            <th width="10%" style="text-align: right">Cost</th>\r\n                                            <th width="10%" style="text-align: right">Ext.Cost</th>\r\n                                        </tr>\r\n                                        <tr ng-repeat="labor in vm.items[$index].WoLabors">\r\n                                            \x3c!--ng-repeat="attr in options.attributes" ng-click="vm.edit(item.Id)"--\x3e\r\n                                            <td width="10%">{{labor.AltId}}</td>\r\n                                            <td width="40%">{{labor.FullName}}</td>\r\n                                            <td width="10%">{{labor.Hours}}</td>\r\n                                            <td width="10%">{{labor.Date | date: \'MM/dd/yyyy\'}}</td>\r\n                                            <td width="10%">{{labor.PayRateName}}</td>\r\n                                            <td width="10%" style="text-align: right">{{labor.Cost | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right">{{labor.ExtendedCost | number:2}} </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px" ng-hide="vm.items[$index].Parts.length == 0">\r\n                                    <tbody>\r\n                                        <tr><th colspan="9" class="text-center invoiceBackgroundColorHeader">Parts</th></tr>\r\n                                        <tr colspan="9" ng-hide="vm.items[$index].Parts.length == 0">\r\n                                            <th width="10%">WO Id</th>\r\n                                            <th width="40%">Description</th>\r\n                                            <th width="30%">Qty</th>\r\n                                            <th width="10%" style="text-align: right">Unit Cost</th>\r\n                                            <th width="10%" style="text-align: right">Ext.Cost</th>  \r\n                                        </tr>\r\n                                        <tr ng-repeat="part in vm.items[$index].Parts">\r\n                                            <td width="10%">{{part.AltId}}</td>\r\n                                            <td width="40%">{{part.Desc}}</td>\r\n                                            <td width="30%">{{part.Quantity}}</td>\r\n                                            <td width="10%" style="text-align: right">{{part.Cost | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right">{{part.ExtendedCost | number:2}} </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px" ng-hide="vm.items[$index].Miscellaneous.length == 0">\r\n                                    <tbody>\r\n                                        <tr><th colspan="9" class="text-center invoiceBackgroundColorHeader">Misc</th></tr>\r\n                                        <tr colspan="9" ng-hide="vm.items[$index].Miscellaneous.length == 0">\r\n                                            <th width="10%">WO Id</th>\r\n                                            <th width="40%">Description</th>\r\n                                            <th width="30%">Qty</th>\r\n                                            <th width="10%" style="text-align: right">Unit Cost</th>\r\n                                            <th width="10%" style="text-align: right">Ext.Cost</th>\r\n                                        </tr>\r\n                                        <tr ng-repeat="misc in vm.items[$index].Miscellaneous">\r\n                                            <td width="10%">{{misc.AltId}}</td>\r\n                                            <td width="40%">{{misc.WoItemName}}</td>\r\n                                            <td width="30%">{{misc.Quantity}}</td>\r\n                                            <td width="10%" style="text-align: right">{{misc.Cost | number:2}}</td>\r\n                                            <td width="10%" style="text-align: right">{{misc.ExtendedCost | number:2}} </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n                                <table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px">\r\n                                    <tbody>\r\n                                        <tr><th colspan="10" class="text-right width80">Total</th><th class="text-right">{{vm.subTotal[$index] | number:2}}</th></tr>\r\n                                    </tbody>\r\n                                </table>\r\n                            </td>\r\n                        </tr>              \r\n                    </tbody>\r\n                 </table>\r\n            </div>\r\n        </div>\r\n        <div class="row" ng-if="vm.reports != null && vm.reports.length > 0">\r\n            <div class="col-sm-12">\r\n                <br /><br />\r\n                <h4>Invoice reports</h4>\r\n                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr role="row">\r\n                            <th>Name</th>\r\n                            <th>Print Date</th>\r\n                            <th>Printed By</th>\r\n                            <th></th>\r\n                        </tr>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr role="row" ng-repeat="report in vm.reports">\r\n                            <td> <a ng-href="{{vm.baseUrl + report.InvoiceReportUrl}}" download> {{report.FileName}} </a> </td>\r\n                            <td> {{report.Date | date: \'MM/dd/yyyy\'}} </td>\r\n                            <td> {{report.FullName}} </td>\r\n                            <td width="5%"> <button class="btn btn-default" ng-click="vm.printInvoice(report)">Print</button> </td>\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\r\n        </div>  \r\n    </div>\r\n</div>'),e.put("Templates/ManageTime/TimeReports/timeReports.html",'<div id="pcont" class="container-fluid ">\r\n    <div class="table-edit-overlay" ng-show="vm.submittingApprovals; vm.isLoading">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Time reports</li>\r\n        </ol>\r\n        <h1>Time reports</h1>\r\n        \x3c!-- breadcrumb --\x3e\r\n    </div>\r\n    <div class="col-md-12" id="timeReports">\r\n        <div class="cl-mcont">\r\n            <div class="clearfix CollapsibleTitle">\r\n                <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n            </div>\r\n\r\n            <div id="Collapsible" class="clearfix in collapse">\r\n                <fc-table-edit api-method="unappliedTime" on-enter="vm.getWoUnappliedLabor()" on-back="vm.$state.go(\'unappliedTime\')" id="{{vm.id}}" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n                <div class="row">\r\n                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                        <button class="btn btn-primary" style="margin-right:10px;" ng-click="vm.getWoUnappliedLabor()"> Search</button>\r\n                        <br /><br /><br />\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div>\x3c!-- row --\x3e\r\n            </div>\r\n            <div class="row">\r\n                <div id="timeReportsaccordion" class="panel-group accordion">\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#timeReportsaccordion" data-target="#collapseMail" class="collapsed" aria-expanded="false">Email Report<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseMail" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body">\r\n                                <form name="userForm" ng-submit="vm.sendMail()" novalidate>\r\n                                    <div class="row">\r\n                                        <div class="form-group" fc-focusout="vm.checkValidationForField()">\r\n                                            <label class="col-sm-3 col-md-3 col-lg-3 control-label">Email:</label>\r\n                                            <div class="col-sm-6 col-md-5 col-lg-4" ng-class="{ \'has-error\' : vm.formValidation[\'MailTo\'].Error }">\r\n                                                <input class="form-control" type="text" placeholder="Email" name="email" ng-model="vm.modelMail.MailTo" required />\r\n                                                <p ng-show="vm.formValidation[\'MailTo\'].Error" class="help-block">Invalid email address! Please correct it and try again.</p>\r\n                                            </div>\r\n                                            <div class="col-sm-3 col-md-4 col-lg-5 text-right right">\r\n                                                <button type="submit" class="btn btn-primary" value="Submit" ng-disabled="vm.formValidation[\'MailTo\'].Email">Email Report</button>\r\n                                                <br /><br /><br />\r\n                                            </div>\r\n                                        </div> \x3c!-- form group --\x3e\r\n                                        <div class="form-group">\r\n                                            <label class="col-sm-3 col-md-3 col-lg-3 control-label">Comment:</label>\r\n                                            <div class="col-sm-6 col-md-6 col-lg-6">\r\n                                                <textarea class="form-control" ng-model="vm.modelMail.Comment"></textarea>\r\n                                            </div> \x3c!-- input box --\x3e\r\n                                        </div> \x3c!-- form group --\x3e\r\n                                        <div class="form-group">\r\n                                            <div class="col-sm-9 col-md-9 col-lg-9">\r\n                                                <div class="row form-vertical">\r\n                                                    <div class="form-group col-lg-6">\r\n                                                        <label for="signature" class="text-center">Signature:</label><br />\r\n                                                        <canvas name="signature" id="signatureCanvas" required="" fc-signature width="400" height="150" style="border: 1px  solid #585858"></canvas>\r\n                                                    </div>\r\n                                                    <div class="form-group col-lg-6">\r\n                                                        <label for="signedBy" class="text-righ">Signed By:</label>\r\n                                                        <input id="" name="signedBy" type="text" parsley-type="" placeholder="" class="form-control" ng-model="vm.modelMail.SignedBy">\r\n                                                    </div>\r\n                                                </div>\r\n                                            </div>\r\n                                            <div class="col-sm-3 col-md-3 col-lg-3 text-right">\r\n                                                <br /><br /><br />\r\n                                                <button type="button" class="btn btn-primary text-left" ng-click="vm.clearSignature()"> Clear Signature</button>\r\n                                                \x3c!--  --\x3e\r\n                                            </div>\r\n\r\n                                        </div>\x3c!-- form group --\x3e\r\n                                    </div>\r\n                                </form>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n\r\n\r\n\r\n            <div class="row">\r\n                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right pull-right">\r\n                    <button class="btn btn-primary" ng-click="vm.addWoLabor()"> Add WO Time</button>\r\n                    <button class="btn btn-primary push-left" ng-click="vm.addUnappliedLabor()"> Add Unapplied</button>\r\n                </div> \x3c!-- input box --\x3e\r\n\r\n            </div>\r\n\r\n            <div class="row">\r\n                <div class="col-md-12">\r\n                    <div class="block-flat">\r\n                        <div class="content">\r\n                            <div class="row">\r\n                                <div class="col-md-12">\r\n                                    <div class="form-group">\r\n                                        <div class="col-md-3 col-lg-3 col-sm-3 col-lg-offset-9 col-md-offset-9 col-sm-offset-9 text-right">\r\n                                            <label>\r\n                                                <div class="icheckbox_square-blue checkbox" ng-class="{ \'checked\': vm.approveAllDates}">\r\n                                                    <input type="checkbox" class="icheck" style="position: absolute; opacity: 0;" ng-click="vm.ApproveAll()" ng-model="vm.approveAllDates" />\r\n                                                    <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                </div>\r\n                                                Check/Uncheck All\r\n                                            </label>\r\n                                        </div>\r\n\r\n                                    </div>\r\n                                    <table id="datatable-icons" class="table table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info" style="border-left: none; border-right: none; border-bottom:none; border-top:none">\r\n                                        <thead>\r\n                                            <tr role="row">\r\n                                                <th ng-repeat="attr in vm.attributesTab" style="position: relative; border:solid 1px black">{{attr.Name}}</th>\r\n                                                <th colspan="2" style="position: relative; border:solid 1px black">Action</th>\r\n                                            </tr>\r\n                                        </thead>\r\n\r\n\r\n                                        <tbody ng-repeat="date in vm.uniqueDates" style="border-left: none; border-right: none; border-bottom:none; border-top:none">\r\n                                            <tr role="row" ng-repeat="item in vm.items | filter:date" ng-if="(vm.items | filter:date).length>0" style="border-left: none; border-right: none; border-bottom:solid 1px black; border-top:solid 1px black">\r\n                                                <td ng-repeat="attr in vm.attributesTab" style="position: relative;border-left: solid 1px black; border-right: solid 1px black; border-bottom:solid 1px black; border-top:solid 1px black">\r\n                                                    \x3c!-- US587 : DSL - Time Reports to include the clock-in/out time --\x3e\r\n                                                    <span ng-if="attr.CellFormat==\'time\'">\r\n                                                        {{vm.getLocalTime(item[attr.ValueName]) | date : \'shortTime\'}}\r\n                                                    </span>\r\n                                                    \x3c!-- US587 : END --\x3e\r\n                                                    <span ng-if="attr.CellFormat==\'label\' && (item.AltId !=0 || attr.ValueName !=\'AltId\')">\r\n                                                        <span ng-if="attr.FormatDate">{{item[attr.ValueName] | date : \'fullDate\' }}</span>\r\n                                                        <span ng-if="!attr.FormatDate">{{item[attr.ValueName]}}</span>\r\n                                                    </span>\r\n                                                    <span ng-if="attr.CellFormat==\'labelColor\'" ng-style="{\'background-color\': \'{{vm.diffUserBackgroundcolor(item)}}\'}">\r\n                                                        {{item[attr.ValueName]}}\r\n                                                    </span>\r\n                                                    <span ng-if="attr.CellFormat==\'editable\'" ng-style="{\'background-color\': \'{{vm.backgroundColor(item)}}\'}">\r\n                                                        \x3c!--ng-click="vm.editHour(item)"--\x3e\r\n                                                        <span ng-hide="vm.isEditable(item)">{{item[attr.ValueName]}}</span>\r\n                                                        \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                                                        \x3c!-- <input autofocus ng-blur="vm.editHour(item)" ng-disabled="vm.disableEditRemoveButton(item)" ng-show="vm.isEditable(item)" fc-enter="vm.updateHours(item)" type="number" ng-model="item[attr.ValueName]" class="form-control" /> --\x3e\r\n                                                        <input autofocus onwheel="this.blur()" ng-blur="vm.editHour(item)" ng-disabled="vm.disableEditRemoveButton(item)" ng-show="vm.isEditable(item)" fc-enter="vm.updateHours(item)" type="number" ng-model="item[attr.ValueName]" class="form-control" />\r\n                                                        \x3c!-- BUG32 : END --\x3e\r\n                                                    </span>\r\n                                                    <span ng-if="attr.CellFormat == \'checkbox\'">\r\n                                                        <div class="form-group checkbox text-center">\r\n                                                            <label>\r\n                                                                <div class="icheckbox_square-blue checkbox" ng-class="{ \'checked\': item[attr.ValueName] }">\r\n                                                                    <input type="checkbox" ng-disabled="vm.checkIfApproved(item)" class="icheck" style="position: absolute; opacity: 0;" ng-click="vm.approveTech(item)" />\r\n                                                                    <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                </div>\r\n                                                            </label>\r\n                                                        </div>\r\n                                                    </span>\r\n                                                </td>\r\n                                                <td style="text-align:center; border-left: solid 1px black; border-right: solid 1px black; border-bottom:solid 1px black; border-top:solid 1px black" class="action-col">\r\n                                                    <span>\r\n                                                        <a class="btn btn-edit" ng-click="vm.editRecord(item)" ng-disabled="vm.disableEditRemoveButton(item)" data-original-title="Edit" data-toggle="tooltip"><i class="fa fa-edit"></i></a>\r\n                                                    </span>\r\n\r\n                                                </td>\r\n                                                <td style="text-align:center border-left: solid 1px black; border-right: solid 1px black; border-bottom:solid 1px black; border-top:solid 1px black" class="action-col">\r\n                                                    <span>\r\n                                                        <a class="btn btn-delete" ng-click="vm.deleteTime(item)" ng-disabled="vm.disableEditRemoveButton(item)" data-original-title="Remove" data-toggle="tooltip"><i class="fa fa-times-circle"></i></a>\r\n                                                    </span>\r\n\r\n                                                </td>\r\n\r\n                                            </tr>\r\n                                            <tr role="row" ng-if="(vm.items | filter:date).length==0" style="border-left: none; border-right: none; border-bottom:solid 1px black; border-top:solid 1px black">\r\n                                                <td style="position: relative; border:solid 1px black">\r\n                                                    <label>\r\n                                                        {{date | date : \'fullDate\'}}\r\n                                                    </label>\r\n                                                </td>\r\n                                                \x3c!-- US587 : DSL - Time Reports to include the clock-in/out time --\x3e\r\n                                                <td style="position: relative; border:solid 1px black"></td>\r\n                                                <td style="position: relative; border:solid 1px black"></td>\r\n                                                \x3c!-- US587 : END --\x3e\r\n                                                <td style="position: relative; border:solid 1px black"></td>\r\n                                                <td style="position: relative; border:solid 1px black"></td>\r\n                                                <td style="position: relative; border:solid 1px black"></td>\r\n                                                <td style="position: relative; border:solid 1px black">\r\n                                                    <label>\r\n                                                        0.00\r\n                                                    </label>\r\n                                                </td>\r\n                                                <td style="position: relative; border:solid 1px black"></td>\r\n                                                <td style="position: relative; border:solid 1px black"></td>\r\n                                                <td style="position: relative; border:solid 1px black"></td>\r\n                                                <td style="position: relative; border:solid 1px black"></td>\r\n                                                <td style="position: relative; border:solid 1px black"></td>\r\n                                                <td style="position: relative; border:solid 1px black"></td>\r\n                                            </tr>\r\n                                            <tr style="background-color:white; border-left: none; border-right: none; border-bottom:solid 1px black; border-top:solid 1px black" ng-if="(vm.items | filter:date).length==0">\r\n                                                <td colspan="10" class="right" style="border-left: none; border-right: none; border-bottom:solid 1px black; border-top:solid 1px black">\r\n                                                    &nbsp;\r\n                                                </td>\r\n\r\n                                            </tr>\r\n                                            <tr style="background-color:white; border-left: none; border-right: none; border-bottom:none; border-top:none" ng-if="(vm.items | filter:date).length>0">\r\n                                                \x3c!-- US587 : DSL - Time Reports to include the clock-in/out time --\x3e\r\n                                                \x3c!-- <td colspan="3" style="border-left: none; border-right: none; border-bottom:none; border-top:none"></td> --\x3e\r\n                                                <td colspan="5" style="border-left: none; border-right: none; border-bottom:none; border-top:none"></td>\r\n                                                <td class="right" style="border-left: none; border-right: none; border-bottom:none; border-top:none">\r\n                                                    <label class="text-righ" style="font-weight:700">\r\n                                                        Total:\r\n                                                    </label>\r\n                                                </td>\r\n                                                <td style="border-left: none; border-right: none; border-bottom:none; border-top:none">\r\n                                                    <label class="text-left" style="font-weight:700">\r\n                                                        {{vm.getTotal(date)}}\r\n                                                    </label>\r\n                                                </td>\r\n                                                <td colspan="6" style="border-left: none; border-right: none; border-bottom:none; border-top:none"></td>\r\n                                            </tr>\r\n                                        </tbody>\r\n\r\n                                        <tfoot ng-if="vm.items.length>0" style=" background-color:white; border-left none; border-right none; border-bottom:none; border-top:none">\r\n                                            <tr style="background-color:white; border-left: none; border-right: none; border-bottom:none; border-top:none">\r\n                                                \x3c!-- US587 : DSL - Time Reports to include the clock-in/out time --\x3e\r\n                                                \x3c!-- <td colspan="11" style="background-color:white; border-left: none; border-right: none; border-bottom:none; border-top:none">&nbsp;</td> --\x3e\r\n                                                <td colspan="13" style="background-color:white; border-left: none; border-right: none; border-bottom:none; border-top:none">&nbsp;</td>\r\n                                            </tr>\r\n\r\n                                            <tr style="background-color:white; border-left: none; border-right: none; border-bottom:none; border-top:none">\r\n                                                <td colspan="3" rowspan="{{uniquePayRates.length}}" style="background-color:white; border-left: none; border-right: none; border-bottom:none; border-top:none">&nbsp;</td>\r\n                                                <td rowspan="{{uniquePayRates.length}}" style="position: relative; background-color:white; border-left: none; border-right: none; border-bottom:none; border-top:none">\r\n                                                    <label valign="middle" class="text-righ" style="font-weight:900">Summary</label>\r\n                                                </td>\r\n                                                <td style="background-color:white; border-left: none; border-right: none; border-bottom:none; border-top:none">\r\n                                                    <table style="background-color:white; border-left: none; border-right: none; border-bottom:none; border-top:none">\r\n                                                        <tr ng-repeat="payrate in vm.uniquePayRates" style="background-color:white; border-left: none; border-right: none; border-bottom:none; border-top:none">\r\n                                                            <td style="border-left: solid 1px black; border-right: solid 1px black; border-bottom:solid 1px black; border-top:solid 1px black">\r\n                                                                <label class="text-righ" style="font-weight:700">\r\n                                                                    {{vm.getTotalByPayRate(payrate)}}\r\n                                                                </label>\r\n                                                            </td>\r\n                                                            <td style="border-left: solid 1px black; border-right: solid 1px black; border-bottom:solid 1px black; border-top:solid 1px black">\r\n                                                                <label class="text-left" style="font-weight:700">{{payrate}}</label>\r\n                                                            </td>\r\n                                                        </tr>\r\n                                                    </table>\r\n\r\n                                                </td>\r\n\r\n                                                <td colspan="3" rowspan="{{uniquePayRates.length}}" style="position: relative; background-color:white; border-left: none; border-right: none; border-bottom:none; border-top:none">\r\n                                                    <button valign="middle" class="btn btn-primary text-righ" ng-disabled="vm.submittingApprovals" ng-click="vm.submitApprovals()">Submit Approvals</button>\r\n                                                </td>\r\n                                            </tr>\r\n                                            <tr></tr>\r\n                                            <tr>\r\n                                                <td colspan="3" style="background-color:white; border-left: none; border-right: none; border-bottom:none; border-top:none">&nbsp;</td>\r\n                                                <td class="text-righ" style=" background-color:white; border-left none; border-right none; border-bottom:none; border-top:none">\r\n                                                    <label class="text-righ" style="font-weight:700">\r\n                                                        Total:\r\n                                                    </label>\r\n                                                </td>\r\n                                                <td class="text-righ" style="border-left: none; border-right: none; border-bottom:none; border-top:none">\r\n                                                    <label class="text-left" style="font-weight:700">{{vm.getTotal()}}</label>\r\n                                                </td>\r\n                                            </tr>\r\n                                        </tfoot>\r\n                                    </table>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ManageTime/UnappliedTime/unappliedTime.html",'\r\n<div id="pcont" class="container-fluid ">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Unapplied Time</li>\r\n        </ol>\r\n        <h1>Unapplied Time</h1>\r\n        \x3c!-- breadcrumb --\x3e\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="col-md-12" id="UnappliedTime">\r\n        <div class="cl-mcont">\r\n            <div class="row">\r\n\r\n                <div class="clearfix CollapsibleTitle">\r\n                    <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                </div>\r\n\r\n                <div id="Collapsible" class="collapse in clearfix">\r\n\r\n                    <div class="form-group">\r\n                        <div class="col-sm-6">\r\n                            <label class="control-label pull-left col-sm-6 col-md-5 col-lg-4">From Date:</label>\r\n                            <div class="input-group date datetime col-sm-7 col-md-6 col-lg-4" date-time-append>\r\n                                \x3c!-- BUG85 : error mess for previous date like 1/11/1111 in From Date/To Date field on Unapplied Time page. --\x3e\r\n                                \x3c!-- <input type="datetime" fc-enter="vm.getUnappliedTimeList()" date-time ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter1Tmp.fromDate" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-pristine ng-valid"> --\x3e\r\n                                <input type="datetime" onpaste="return false;" fc-enter="vm.getUnappliedTimeList()" restrict-to="[0-9\\/]" date-time ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter1Tmp.fromDate" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-pristine ng-valid">\r\n                                \x3c!-- BUG85 : END --\x3e\r\n                                <span class="input-group-addon btn btn-white">\r\n                                    <span class="glyphicon glyphicon-calendar"></span>\r\n                                </span>\r\n                            </div>\r\n                        </div>\r\n                        <div class="col-sm-6">\r\n                            <label class="control-label pull-left col-sm-6 col-md-5 col-lg-4">To Date:</label>\r\n                            <div class="input-group date datetime col-sm-7 col-md-6 col-lg-4" date-time-append>\r\n                                \x3c!-- BUG85 : error mess for previous date like 1/11/1111 in From Date/To Date field on Unapplied Time page. --\x3e\r\n                                \x3c!-- <input type="datetime" fc-enter="vm.getUnappliedTimeList()" date-time ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter1Tmp.toDate" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-pristine ng-valid"> --\x3e\r\n                                <input type="datetime" onpaste="return false;" fc-enter="vm.getUnappliedTimeList()" restrict-to="[0-9\\/]" date-time ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter1Tmp.toDate" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-pristine ng-valid">\r\n                                \x3c!-- BUG85 : END --\x3e\r\n                                <span class="input-group-addon btn btn-white">\r\n                                    <span class="glyphicon glyphicon-calendar"></span>\r\n                                </span>\r\n                            </div>\r\n                        </div>\r\n                        <br /><br />\r\n                    </div>\r\n\r\n                    <div class="form-group" ng-hide="onlyTech">\r\n                        <br /><br />\r\n                        <div class="col-md-6">\r\n                            <label>\r\n                                Crews\r\n                            </label>\r\n                            <fc-multiselect value="vm.crewIds" on-enter="vm.getUnappliedTimeList()" api-method="crews/GetForLeadTech" value-prop="Id" text-prop="CrewName" current-list="vm.crewsList" items-loaded="vm.crewsLoaded"></fc-multiselect>\r\n                        </div> \x3c!-- input box --\x3e\r\n                        <div class="col-md-6">\r\n                            <label>\r\n                                Technician\r\n                            </label>\r\n                            <fc-multiselect value="vm.technicianIds" ng-if="vm.crewSelected" on-enter="vm.getUnappliedTimeList()" api-method="crewtechs/GetListForCrews" value-prop="TechId" text-prop="UserFirstLastName" filter="vm.Filter" items-loaded="vm.techLoaded"></fc-multiselect>\r\n                            <br />\r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n                    <div class="form-group">\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right">\r\n                            <button class="btn btn-primary" ng-click="vm.getUnappliedTimeList()"> Search</button>\r\n                            <button class="btn btn-default" ng-click="vm.clearUnappliedTime()"> Cancel</button>\r\n                            <br /><br /><br />\r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n                 </div>\x3c!-- collapsible --\x3e\r\n                <div class="row">\r\n                    <div class="block-flat">\r\n                        <div class="content" id="unapTime">\r\n                            <fc-table table-name="Unapplied Time"\r\n                                      api-method="unappliedTime"\r\n                                      attributes="vm.attributes"\r\n                                      selected="vm.id"\r\n                                      filter="vm.UnappliedTimeFilter"\r\n                                      on-edit="vm.edit(id)"\r\n                                      ng-if="vm.reloadTable">\r\n                            </fc-table>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>'),e.put("Templates/ManageTime/UnappliedTime/unappliedTimeEdit.html",'<div id="pcont" class="container-fluid">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'unappliedTime\')">Unapplied Time </a></li>\r\n            <li class="active">Unapplied Time Edit</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Unapplied Time Edit</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="unappliedTime" on-back="vm.$state.go(\'unappliedTime\')" id="{{vm.id}}" attributes="vm.attributesEdit" model="vm.model"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/AgreementType/agreementTypeEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="AgreementTypeEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'agreementTypeTable\')">Agreement Type</a></li>\r\n            <li class="active">{{vm.model.AgreementTypeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Agreement Type</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="agreementtypes" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'agreementTypeTable\')" attributes="vm.attributes" on-submit="vm.submit()"></fc-table-edit>\r\n    </div>\r\n    <div class="col-md-12">\r\n        <div id="accordion" class="panel-group accordion">\r\n            <div class="panel panel-default">\r\n                <div class="panel-heading cursor_pointer">\r\n                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseSub">Coverage<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                </div>\x3c!-- panel heading --\x3e\r\n                <div id="collapseSub" class="panel-collapse collapse in">\r\n                    <div class="panel-body">\r\n                        <div  class="block-flat" >\r\n                            <div fc-tab="Agreement TypeSub" ng-controller="AgreementTypeEditController as vm" >\r\n                                <div ng-class="{\'coverageBtn\' : vm.showBtn}">\r\n                                    <fc-table table-name="Coverage"\r\n                                              api-method="agreementtypesubs"\r\n                                              attributes="vm.subattributes"\r\n                                              filter="vm.filterAgreementId"\r\n                                              on-edit="vm.edit(id)"\r\n                                              timezone="vm.agreementsTypeWindowTimezone">\r\n                                    </fc-table>\r\n                                </div>\r\n                             </div>\r\n                        </div>\x3c!-- block-flat --\x3e\r\n                    </div>\x3c!-- panel body --\x3e\r\n                </div>\x3c!-- panel colapse --\x3e\r\n            </div>\x3c!-- panel --\x3e\r\n        </div>\r\n      </div>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n'),e.put("Templates/MasterTables/AgreementType/agreementTypeTable.html",'<div id="pcont" class="container-fluid">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Agreement Type</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Agreement Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content" ng-controller="AgreementController as va">\r\n                        <fc-tabs tab="va.filterTab">\r\n                            <div fc-tab="Agreement Type" ng-controller="AgreementTypeController as vm">\r\n                                <div ng-if="va.filterTabWindow == false">\r\n                                    <fc-table table-name="Agreement Type"\r\n                                              api-method="agreementTypes"\r\n                                              attributes="vm.attributes"\r\n                                              on-edit="vm.edit(id)"\r\n                                              selected="vm.filter.filterId"\r\n                                              drilldown="vm.drilldownSettings"\r\n                                              view-name="{{vm.viewName}}"\r\n                                              module-name="{{vm.moduleName}}">\r\n\r\n                                    </fc-table>\r\n                                </div>\r\n                            </div>\r\n                            <div fc-tab="Agreement Windows"  ng-controller="AgreementTypeWindowController as vm">\r\n                                <fc-table table-name="Agreement Window"\r\n                                          api-method="agreementWindows"\r\n                                          attributes="vm.attributes"\r\n                                          on-edit="vm.edit(id)"\r\n                                          timezone="vm.agreementsTypeWindowTimezone"\r\n                                          view-name="AgreementTypesWindows"\r\n                                          module-name="AgreementTypesWindowsGrid"\r\n                                          ></fc-table>\r\n\r\n                            </div>\r\n                            \x3c!--<div fc-tab="Agreement TypeSub"  ng-controller="AgreementTypeSubEditController as vm">\r\n                                <fc-table-edit api-method="agreementtypesubs" id="" on-back="vm.goBack()" attributes="vm.attributes"></fc-table-edit>\r\n                            </div>--\x3e\r\n                        </fc-tabs>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/AgreementTypeSub/agreementTypeSub.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="AgreementTypeWindowEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goBackToWindowTab()">Agreement Type</a></li>\r\n            <li class="active">Coverage</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Coverage</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        \r\n            <fc-table-edit api-method="agreementtypesubs" id="{{vm.id}}" ng-controller="AgreementTypeSubEditController as vm" model="vm.model" on-back="vm.goBack()" attributes="vm.subeditattributes"></fc-table-edit>\r\n        \r\n    </div>\r\n</div>\r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    '),e.put("Templates/MasterTables/AgreementTypeWindow/agreementTypeWindowEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="AgreementTypeWindowEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goBackToWindowTab()">Agreement Window</a></li>\r\n            <li class="active">{{vm.model.Day}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Agreement Window</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="agreementWindows" model="vm.model" id="{{vm.id}}" on-back="vm.goBackToWindowTab()" attributes="vm.attributes" timezone="vm.agreementTypeWindowTimezone"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/ApplicationSettings/applicationSettings.html",'<div id="pcont" class="container-fluid" ng-controller="ApplicationSettingsController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Application Settings</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Application Settings</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-editable-table \r\n            api-method="applicationsettings/getforgrid" \r\n            attributes="vm.attributes"              \r\n            on-submit="vm.submitSetting(item)"\r\n            sort="Name" \r\n            model="vm.model"\r\n            filters="vm.filters">\r\n        </fc-editable-table>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/Bundle/bundleEdit.html",'\x3c!-- US2819 : FCO - Web - Bundles --\x3e\r\n\r\n<div id="pcont" class="container-fluid" ng-controller="BundleEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'bundle\')">Bundle</a></li>\r\n            <li class="active">{{vm.model.BundleName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Bundle</h1>\r\n    </div>\r\n\r\n    \x3c!-- on-back="vm.$state.go(\'bundle\')" --\x3e\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="bundle"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.bundleOnBack(insertData)"\r\n                       attributes="vm.attributes"\r\n                       model="vm.model">\r\n        </fc-table-edit>\r\n\r\n        <div ng-if="!vm.newBundle">\r\n            <hr />\r\n            <div ng-if="vm.hideProblemCodes">\r\n                <h4>Assigned Problem Codes</h4>\r\n                <div class="row">\r\n                    <div class="col-md-12">\r\n                        <div class="block-flat">\r\n                            <div class="content">\r\n                                <fc-table api-method="bundle/problemCodes"\r\n                                          attributes="vm.problemCodeGridAttributes"\r\n                                          ng-if="vm.reloadProblemCodeTable"\r\n                                          filter="vm.filterByBundle"\r\n                                          on-edit="vm.problemCodeEdit(id)"\r\n                                          show-search=false>\r\n                                </fc-table>\r\n                            </div>\r\n                        </div>\x3c!-- content --\x3e\r\n                    </div>\x3c!-- block-flat --\x3e\r\n                </div>\x3c!-- columns --\x3e\r\n            </div>\r\n\r\n            <h4>Assigned Labor</h4>\r\n            <div class="row">\r\n                <div class="col-md-12">\r\n                    <div class="block-flat">\r\n                        <div class="content">\r\n                            <fc-table api-method="bundleDetail/labor"\r\n                                      ng-if="vm.reloadLaborTable"\r\n                                      attributes="vm.laborGridAttributes"\r\n                                      filter="vm.filterByBundle"\r\n                                      on-edit="vm.laborEdit(id)"\r\n                                      show-search=false>\r\n                            </fc-table>\r\n                        </div>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n\r\n            <h4>Assigned Parts</h4>\r\n            <div class="row">\r\n                <div class="col-md-12">\r\n                    <div class="block-flat">\r\n                        <div class="content">\r\n                            <fc-table api-method="bundleDetail/items"\r\n                                      ng-if="vm.reloadPartsTable"\r\n                                      attributes="vm.partsGridAttributes"\r\n                                      filter="vm.filterParts"\r\n                                      on-edit="vm.itemEdit(id, \'Parts\', vm.id)"\r\n                                      show-search=false>\r\n                            </fc-table>\r\n                        </div>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n\r\n            <h4>Assigned Miscellaneous</h4>\r\n            <div class="row">\r\n                <div class="col-md-12">\r\n                    <div class="block-flat">\r\n                        <div class="content">\r\n                            <fc-table api-method="bundleDetail/items"\r\n                                      ng-if="vm.reloadMiscTable"\r\n                                      attributes="vm.miscGridAttributes"\r\n                                      filter="vm.filterMisc"\r\n                                      on-edit="vm.itemEdit(id, \'Misc\', vm.id)"\r\n                                      show-search=false>\r\n                            </fc-table>\r\n                        </div>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/Bundle/bundleItemModal.html",'\x3c!-- US2819 : FCO - Web - Bundles --\x3e\r\n\r\n<div id="myModal" class="fade in modal-open" role="dialog">\r\n    \x3c!-- BUG642 : DSL - Scroll parts screen --\x3e\r\n    \x3c!-- <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px;"> --\x3e\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n        \x3c!-- BUG642 : DSL - Scroll parts screen --\x3e\r\n        \x3c!-- <div class="modal-content"> --\x3e\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 80%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="close()">&times;</button>\r\n                <h4 class="modal-title">{{vm.tableName}}</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <div class="row">\r\n                    <div class="col-md-12">\r\n                        <div class="block-flat">\r\n                            <div class="content">\r\n                                <fc-table-edit api-method="bundleDetail/items"\r\n                                               id="{{vm.id}}"\r\n                                               attributes="vm.itemAttributes"\r\n                                               model="vm.model"\r\n                                               on-back="vm.close(data)">\r\n                                </fc-table-edit>\r\n                            </div>\x3c!-- content --\x3e\r\n                        </div>\x3c!-- block-flat --\x3e\r\n                    </div>\x3c!-- columns --\x3e\r\n                </div>\r\n                <div class="row" ng-if="vm.newItem">\r\n                    <div class="col-md-12">\r\n                        <div class="block-flat">\r\n                            <div class="content">\r\n                                <div class="col-sm-6">\r\n                                    <div style="white-space:nowrap" class="pull-left">\r\n                                        <label for="id1">Search:&nbsp;</label>\r\n                                        <input class="input-search input-sm" type="search" fc-enter="vm.searchItems()" ng-model="vm.itemSearchText">\r\n                                    </div>\r\n                                </div>\r\n                                \x3c!-- DE1720 : added show-entries --\x3e\r\n                                <fc-table table-name="vm.tableName"\r\n                                          api-method="items/forBundle"\r\n                                          attributes="vm.itemGridAttributes"\r\n                                          selected="vm.itemId"\r\n                                          model="vm.itemModel"\r\n                                          filter="vm.filterItems"\r\n                                          show-add-new=false\r\n                                          show-delete-column=false\r\n                                          show-search=false\r\n                                          show-entries=5>\r\n                                </fc-table>\r\n                            </div>\x3c!-- content --\x3e\r\n                        </div>\x3c!-- block-flat --\x3e\r\n                    </div>\x3c!-- columns --\x3e\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class="modal-backdrop in fade"></div>\r\n</div>'),e.put("Templates/MasterTables/Bundle/bundleTable.html",'<div id="pcont" class="container-fluid" ng-controller="BundleController as vm">\r\n\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Bundles</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Bundles</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <fc-table api-method="bundle"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)"\r\n                                  selected="vm.filter.filterId">\r\n                        </fc-table>                        \r\n                    </div>\r\n                </div>\x3c!-- content --\x3e\r\n            </div>\x3c!-- block-flat --\x3e\r\n        </div>\x3c!-- columns --\x3e\r\n    </div>\x3c!-- row --\x3e\r\n</div>\r\n\r\n\r\n\r\n'),e.put("Templates/MasterTables/CompanyInfo/companyInfo.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="CompanyInfoEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Company Info</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Company Info</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="companyinfos" \r\n                       id="{{vm.id}}" \r\n                       on-back="vm.editCompany(insertData)" \r\n                       attributes="vm.attributes" \r\n                       model="vm.model">\r\n        </fc-table-edit>\r\n        <div>\r\n            <button ng-if="vm.id" ng-hide="vm.showApiClient" class="btn btn-default push-right" ng-click="vm.activateApiClient()">API Connector Client</button>\r\n        </div>\r\n        <div id="api-client">\r\n            <fc-table-edit api-method="companyinfos/apiclient" \r\n                           id="{{vm.apiClientModel.Id}}" \r\n                           ng-if="vm.id" \r\n                           ng-show="vm.showApiClient" \r\n                           model="vm.apiClientModel" \r\n                           on-back="vm.cancelApiClient()" \r\n                           attributes="vm.apiClientAttributes" \r\n                           on-submit="vm.submitApiClient()" \r\n                           submit-button-text="{{vm.submitApiBtnText}}">\r\n            </fc-table-edit>\r\n            <div class="row">\r\n                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                    <button ng-show="vm.showRevokeClient" class="btn btn-primary" ng-click="vm.revoke()">Revoke</button>\r\n                    <button ng-show="vm.showApiClient" class="btn btn-default" ng-click="vm.cancelApiClient()">Cancel</button>\r\n                    <button ng-show="vm.showApiClient" ng-click="vm.submitApiClient()" class="btn btn-primary ng-binding">{{vm.submitApiBtnText}}</button>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/CompanyInfo/newCompany.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="NewCompanyEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">New Company</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>New Company</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit  attributes="vm.attributes" model="vm.model" on-submit="vm.submitCompanyData()"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/CompanyPayPeriod/companyPayPeriod.html",'<div id="pcont" class="container-fluid" ng-controller="CompanyPayPeriodController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Company Pay Period</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Company Pay Period</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                    <div class="row">\r\n                        <div class="col-lg-5">\r\n                            <label class="control-label  col-sm-3 col-md-4 col-lg-3" >Start Date:</label>\r\n                            <div class="input-group date datetime col-sm-6 col-md-5 col-lg-4" date-time-append>\r\n                                \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                                \x3c!-- <input type="datetime" date-time ng-model="vm.filter1.startDate" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-pristine ng-valid"> --\x3e\r\n                                <input onpaste="return false;" restrict-to="{{vm.dateService.restrictToDate()}}" type="datetime" date-time ng-model="vm.filter1.startDate" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-pristine ng-valid">\r\n                                \x3c!-- BUG87 : END --\x3e\r\n                                <span class="input-group-addon btn btn-white">\r\n                                    <span class="glyphicon glyphicon-calendar"></span>\r\n                                </span>\r\n                            </div>\r\n                        </div>\r\n                        <div class="col-lg-5">\r\n                            <label class="control-label  col-sm-3 col-md-4 col-lg-3" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">End Date:</label>\r\n                            <div class="input-group date datetime col-sm-6 col-md-5 col-lg-4" date-time-append>\r\n                                \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                                \x3c!-- <input type="datetime" date-time ng-model="vm.filter1.endDate" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-pristine ng-valid"> --\x3e\r\n                                <input onpaste="return false;" restrict-to="{{vm.dateService.restrictToDate()}}" type="datetime" date-time ng-model="vm.filter1.endDate" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-pristine ng-valid">\r\n                                \x3c!-- BUG87 : END --\x3e\r\n                                <span class="input-group-addon btn btn-white">\r\n                                    <span class="glyphicon glyphicon-calendar"></span>\r\n                                </span>\r\n                            </div>\r\n                        </div>\r\n                        <div class="col-lg-2">\r\n                            <button class="btn" ng-click="vm.dofilter()">Search</button>\r\n                            </div>\r\n                        </div>\r\n                    <br />\r\n                        <fc-table table-name="Company Pay Period" api-method="companypayperiods" attributes="vm.attributes" on-edit="vm.edit(id)" filter="vm.filter2"></fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/CompanyPayPeriod/companyPayPeriodEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="CompanyPayPeriodEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'companyPayPeriods\')">Company Pay Period</a></li>\r\n            <li class="active">{{vm.model.Name}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Company Pay Period </h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="companypayperiods" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'companyPayPeriods\')" attributes="vm.attributes"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/CompanySettings/companySettings.html",'<div id="pcont" class="container-fluid" ng-controller="CompanySettingsController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Company Settings</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Company Settings</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        \x3c!-- US2708 --\x3e\r\n        <ul class="nav nav-tabs" style="margin: 15px 0 15px 0;">\r\n            <li ng-repeat="rec in vm.data | orderBy: rec.SortOrder"\r\n                class="cursor_pointer"\r\n                ng-class="{active: vm.tab == rec.Id}"\r\n                ng-click="vm.setCategory(rec.Id)">\r\n                <a>{{ rec.CategoryLabel }}</a>\r\n            </li>\r\n        </ul>\r\n\r\n        \x3c!--<fc-table-edit api-method="companysettings" attributes="vm.attributes" on-submit="vm.updateSettings()" model="vm.model"></fc-table-edit>--\x3e\r\n        \x3c!-- PBI722 : FCO - Manage Work Orders - DSL-NW --\x3e\r\n        \x3c!-- changed sort from Name to Desc --\x3e\r\n        <fc-editable-table api-method="companysettings/getforgrid"\r\n                           attributes="vm.attributes"\r\n                           on-submit="vm.submitSetting(item)"\r\n                           sort="Desc"\r\n                           model="vm.model"\r\n                           filters="vm.filters"\r\n                           filter="vm.filter">\r\n        </fc-editable-table>\r\n    </div>\r\n</div>'),e.put("Templates/MasterTables/CompanySettings/selectItem.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n  <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n    \x3c!-- Modal content--\x3e\r\n    <div class="modal-content"  style="overflow-y: auto; height: 90%">\r\n      <div class="modal-header">\r\n        <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n      </div>\r\n        <div class="modal-body selectCustomer" ng-if="!vm.edit" id="newWorkOrder">\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group">\r\n                    <div class="col-sm-7 col-md-6 col-lg-5">\r\n                        <input type="text" placeholder="Search" class="form-control" ng-model="vm.itemFilter.search">\r\n\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <button type="submit" class="btn btn-primary" ng-click="vm.search()">Search</button>\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n            <fc-table table-name="Item"  api-method="items" attributes="vm.attributes" selected="vm.itemId" list="vm.items" filter="vm.autoFilterItem"></fc-table>\r\n       \r\n    </div>\r\n  </div>\r\n</div>\r\n<div class="modal-backdrop in fade" ></div>\r\n'),e.put("Templates/MasterTables/Crew/crew.html",'<div id="pcont" class="container-fluid" >\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Crew</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Crew</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content" ng-controller="CrewController as vm">\r\n                        <fc-table                                  \r\n                                  table-name="Crew"\r\n                                  api-method="crews"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)" \r\n                                  selected="vm.filter.filterId"\r\n                                  drilldown="vm.drilldownSettings">\r\n                        </fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/MasterTables/Crew/crewEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="CrewEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'crews\')">Crew</a></li>\r\n            <li class="active">{{vm.model.CrewName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Crew</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        \x3c!-- LOADING SPINNER --\x3e\r\n        <div ng-hide="!vm.loadingIndicator" class="table-edit-overlay">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        <fc-table-edit api-method="crewtechs"\r\n                       id="{{vm.id}}"\r\n                       model="vm.model"\r\n                       on-back="vm.$state.go(\'crews\')"\r\n                       attributes="vm.attributes"\r\n                       ng-if="!vm.loadingIndicator"\r\n                       on-submit="vm.submit()"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/Customer/customerEdit.html",'<div id="pcont" class="container-fluid" ng-controller="CustomerEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'customers\')">Customer</a></li>\r\n            <li class="active">{{vm.model.CustomerName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Customer</h1>\r\n    </div>\r\n\r\n    \x3c!-- PBI689 : FCO - Technician access to Customer card - DSL-NW --\x3e\r\n    \x3c!-- <div class="cl-mcont"> --\x3e\r\n    <div class="cl-mcont" ng-if="vm.getModulePrivilege(vm.guiViewName, vm.guiModuleName) != 0">\r\n        <div class="col-md-12">\r\n            \x3c!-- US3539 : FCO - WEB - Navigation links UI improvement (FCWO-2368) --\x3e\r\n            <br />\r\n            <button type="button" data-dismiss="modal" class="pull-right btn btn-primary btn-flat md-close" ng-if="vm.id != 0" ng-click="vm.$state.go(\'customersites\',{ id: vm.id })">Sites</button>\r\n            \x3c!--<a class="pull-right cursor_pointer" ng-if="vm.id != 0" ng-click="vm.$state.go(\'customersites\',{ id: vm.id })">Sites</a>--\x3e\r\n            \x3c!-- end --\x3e\r\n        </div>\r\n        \x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n        \x3c!-- <fc-table-edit api-method="customers" id="{{vm.id}}" on-back="vm.$state.go(\'customers\')" attributes="vm.attributes"   model="vm.model"></fc-table-edit> --\x3e\r\n        \x3c!-- PBI689 : FCO - Technician access to Customer card - DSL-NW --\x3e\r\n        \x3c!-- added hide-submit attribute --\x3e\r\n        <fc-table-edit api-method="customers"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'customers\')"\r\n                       attributes="vm.attributes"\r\n                       model="vm.model"\r\n                       ng-if="vm.showForm"\r\n                       hide-submit="vm.isReadOnly">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/Customer/customerTable.html",'<div id="pcont" class="container-fluid" ng-controller="CustomerController as vm">\r\n\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Customer</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Customer</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    \x3c!-- PBI689 : FCO - Technician access to Customer card - DSL-NW --\x3e\r\n    \x3c!-- <div class="cl-mcont"> --\x3e\r\n    <div class="cl-mcont" ng-if="vm.getModulePrivilege(vm.guiViewName, vm.guiModuleName) != 0">\r\n        \x3c!-- US3171 : FCO - Add status column and ability to filter by status to Customer and Site searches - Benjamin --\x3e\r\n        <div class="clearfix CollapsibleTitle">\r\n            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n        </div>\r\n        <div id="Collapsible" class="collapse in clearfix">\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group">\r\n                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Search</label>\r\n                    <div class="col-sm-7 col-md-6 col-lg-5">\r\n                        <input class="form-control" type="search" ng-model="vm.filter1.search">\r\n                    </div>\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group ">\r\n                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Status</label>\r\n                    <div class="col-sm-7 col-md-6 col-lg-5">\r\n                        <fc-multiselect value="vm.filter1.status" filter="vm.FilterStatus" api-method="statuses/statusbytype" value-prop="StatusName" text-prop="StatusName" fc-tabindex="7"></fc-multiselect>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n            <div class="form-group">\r\n                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                    <button type="submit" tabindex="9" class="btn btn-primary" ng-click="vm.loadFilter()">Search</button>\r\n                </div>  \x3c!--input box--\x3e\r\n            </div>\r\n        </div>\r\n        \x3c!-- US3171 : END --\x3e\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        \x3c!-- US3171 : FCO - Add status column and ability to filter by status to Customer and Site searches - Benjamin\r\n                        <fc-table api-method="customers"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)"\r\n                                  selected="vm.filter.filterId"\r\n                                  view-name="{{vm.viewName}}"\r\n                                  module-name="{{vm.moduleName}}">\r\n                        </fc-table>\r\n                        --\x3e\r\n                        \x3c!-- PBI689 : FCO - Technician access to Customer card - DSL-NW --\x3e\r\n                        \x3c!-- added show-add-new and show-delte-column attributes --\x3e\r\n                        <fc-table api-method="customers/filter"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)"\r\n                                  selected="vm.filter.filterId"\r\n                                  view-name="{{vm.viewName}}"\r\n                                  filter="vm.autoFilter"\r\n                                  show-search=false\r\n                                  module-name="{{vm.moduleName}}"\r\n                                  show-add-new="!vm.isReadOnly"\r\n                                  show-Delete-Column="!vm.isReadOnly">\r\n                        </fc-table>\r\n                        \x3c!-- US3171 : END --\x3e\r\n\r\n                        <fc-tabs ng-if="vm.filter.filterId">\r\n\r\n                            <div fc-tab="Customer Attachments">\r\n                                <div class="col-md-12" id="hidesearch">\r\n                                    <div class="block-flat">\r\n                                        <div class="col-sm-6">\r\n                                            <div style="white-space:nowrap" class="pull-left">\r\n                                                <label for="id1">Search:</label>\r\n                                                <input class="input-search input-sm" type="search" fc-enter="vm.search()" ng-model="vm.searchText">\r\n                                            </div>\r\n                                        </div>\r\n\r\n\r\n                                        <fc-table api-method="customerattachments"\r\n                                                  attributes="vm.attributesAttachments"\r\n                                                  on-edit="vm.editAttachments(id)"\r\n                                                  filter="vm.filterByCustomer"\r\n                                                  delete-message-format="Are you sure that you want to delete %AttachmentName%?">\r\n                                        </fc-table>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </fc-tabs>\r\n                    </div>\r\n                </div>\x3c!-- content --\x3e\r\n            </div>\x3c!-- block-flat --\x3e\r\n        </div>\x3c!-- columns --\x3e\r\n    </div>\x3c!-- row --\x3e\r\n</div>\r\n'),e.put("Templates/MasterTables/CustomerServiceableitem/customerServiceableItemTable.html",'\x3c!-- US2564 : FCO - Web - Customer Portal - 3.3.5.5 Site Serviceable Items (FCWO-1896) --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="CustomerServiceableItemController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Serviceable Items</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Serviceable Items</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div id="hidesearch" class="hideactioncol hide-add-new-btn">\r\n            <div>\r\n                <div class="col-sm-6">\r\n                    <div style="white-space:nowrap" class="pull-left">\r\n                        <label for="id1">Search:</label>\r\n                        <input class="input-search input-sm" type="search" fc-enter="vm.search()" ng-model="vm.searchText">\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <fc-table ng-if="vm.siteFilter.siteId"\r\n                      table-name="ServiceableItem"\r\n                      api-method="serviceableitems"\r\n                      attributes="vm.attributes"\r\n                      on-edit="vm.edit(id)"\r\n                      filter="vm.saSiteFilter"\r\n                      selected="vm.filter.filterId">\r\n\r\n            </fc-table>\r\n            <fc-table ng-if="!vm.siteFilter.siteId && vm.filter1.customerId"\r\n                      table-name="ServiceableItem"\r\n                      api-method="serviceableitems"\r\n                      attributes="vm.attributes"\r\n                      on-edit="vm.edit(id)"\r\n                      filter="vm.siCustomerFilter"\r\n                      selected="vm.filter.filterId">\r\n\r\n            </fc-table>\r\n        </div>\r\n        <div fc-tab="Serviceable Item" class="hideactioncol hide-add-new-btn">\r\n            <fc-tabs>\r\n\r\n                <div fc-tab="Serviceable Item Notes">\r\n                    <div ng-if="vm.showTabs" id="showsearch">\r\n                        <fc-table table-name="ServiceableItemNotes"\r\n                                  ng-if="vm.loadTable"\r\n                                  api-method="serviceableitemnotes"\r\n                                  attributes="vm.attributesNote"\r\n                                  filter="vm.serviceableItemIdFilter">\r\n                        </fc-table>\r\n                    </div>\r\n                </div>\r\n\r\n\r\n                <div fc-tab="Serviceable Item History">\r\n                    <div ng-if="vm.showTabs">\r\n                        <div class="row  form-horizontal">\r\n                            <div class="clearfix CollapsibleTitle">\r\n                                <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                            </div>\r\n                            <div id="Collapsible" class="collapse in clearfix">\r\n                                <div class="col-sm-6 col-lg-6">\r\n                                    <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                                        <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                            <input name="StartDate" type="datetime" date-time="" ng-model="vm.woesFilter1.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                            <span class="input-group-addon btn btn-white">\r\n                                                <span class="glyphicon glyphicon-calendar"></span>\r\n                                            </span>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class="col-sm-6 col-lg-6">\r\n                                    <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                                        <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                            <input name="EndDate" type="datetime" date-time="" ng-model="vm.woesFilter1.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                            <span class="input-group-addon btn btn-white">\r\n                                                <span class="glyphicon glyphicon-calendar"></span>\r\n                                            </span>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class="form-group">\r\n                                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                        <button type="submit" class="btn btn-primary" ng-click="vm.loadWoesFilter()">Search</button>\r\n                                    </div> \x3c!-- input box --\x3e\r\n                                </div>\r\n                            </div>\x3c!-- Collapsible section end --\x3e\r\n                        </div>\x3c!-- row end --\x3e\r\n                        <div class="row  form-horizontal" id="manageWO">\r\n                            <fc-table api-method="wo/getbyservicableitem"\r\n                                      attributes="vm.attributesWoes"\r\n                                      on-edit="vm.goToWo(id, item)"\r\n                                      filter="vm.woesFilter"\r\n                                      timezone="vm.woTimezone"\r\n                                      ng-if="vm.loadTable">\r\n                            </fc-table>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                <div fc-tab="Serviceable Item Attachments">\r\n                    <div ng-if="vm.showTabs" id="showsearch">\r\n                        <fc-table table-name="ServiceableItemAttachments"\r\n                                  ng-if="vm.loadTable"\r\n                                  api-method="serviceableitemattachments"\r\n                                  attributes="vm.attributesAttachment"\r\n                                  filter="vm.serviceableItemIdFilter">\r\n                        </fc-table>\r\n                    </div>\r\n                </div>\r\n            </fc-tabs>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/CustomerServiceableitem/customerServiceableItemsReadOnly.html",'\x3c!-- US2564 : FCO - Web - Customer Portal - 3.3.5.5 Site Serviceable Items (FCWO-1896) --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="CustomerServiceableItemsReadOnlyController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goBack()">Serviceable Items</a></li>\r\n            <li class="active">{{vm.model.ServiceableItemName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Serviceable Item</h1>\r\n    </div>\r\n    <div class="cl-mcont hideactioncol hide-add-new-btn" fc-tab="Serviceable Item">\r\n        <div id="manageWO">\r\n            <fc-table-edit api-method="serviceableitems"\r\n                           id="{{vm.id}}"\r\n                           on-back="vm.goBack()"\r\n                           attributes="vm.attributes"\r\n                           model="vm.model">\r\n            </fc-table-edit>\r\n        </div>\r\n        <fc-tabs ng-if="vm.id">\r\n            <div fc-tab="Serviceable Item Notes">\r\n                <fc-table table-name="ServiceableItemNotes"\r\n                          api-method="serviceableitemnotes"\r\n                          attributes="vm.attributesNote"\r\n                          ng-if="vm.loadTable"\r\n                          filter="vm.serviceableItemIdFilter">\r\n                </fc-table>\r\n            </div>\r\n            <div fc-tab="Serviceable Item History">\r\n                <div class="row  form-horizontal">\r\n                    <div class="clearfix CollapsibleTitle">\r\n                        <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                    </div>\r\n                    <div id="Collapsible" class="collapse in clearfix">\r\n                        <div class="col-sm-6 col-lg-6">\r\n                            <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                    <input name="StartDate" type="datetime" date-time="" ng-model="vm.woesFilter1.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                    <span class="input-group-addon btn btn-white">\r\n                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                    </span>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="col-sm-6 col-lg-6">\r\n                            <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                    <input name="EndDate" type="datetime" date-time="" ng-model="vm.woesFilter1.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                    <span class="input-group-addon btn btn-white">\r\n                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                    </span>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button type="submit" class="btn btn-primary" ng-click="vm.loadWoesFilter()">Search</button>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div>\r\n                    </div>\x3c!-- Collapsible section end --\x3e\r\n                </div>\x3c!-- row end --\x3e\r\n                <div class="row  form-horizontal" id="manageWO">\r\n                    <fc-table api-method="wo/getbyservicableitem"\r\n                              attributes="vm.attributesWoes"\r\n                              on-edit="vm.goToWo(id, item)"\r\n                              filter="vm.woesFilter"\r\n                              ng-if="vm.loadTable"\r\n                              timezone="vm.woTimezone">\r\n                    </fc-table>\r\n                </div>\r\n            </div>\r\n            <div fc-tab="Serviceable Item Attachments">\r\n                <fc-table table-name="ServiceableItemAttachments"\r\n                          api-method="serviceableitemattachments"\r\n                          attributes="vm.attributesAttachment"\r\n                          ng-if="vm.loadTable"\r\n                          filter="vm.serviceableItemIdFilter">\r\n                </fc-table>\r\n            </div>\r\n        </fc-tabs>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/CustomerServiceableitemNew/customerServiceableItemTable.html",'\x3c!-- US2564 : FCO - Web - Customer Portal - 3.3.5.5 Site Serviceable Items (FCWO-1896) --\x3e\r\n\x3c!-- BUG:198 Serviceable Items menu option is not working.    --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="CustomerServiceableItemController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Serviceable Items</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Serviceable Items</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div id="hidesearch" class="hideactioncol hide-add-new-btn">\r\n            <div>\r\n                <div class="col-sm-6">\r\n                    <div style="white-space:nowrap" class="pull-left">\r\n                        <label for="id1">Search:</label>\r\n                        <input class="input-search input-sm" type="search" fc-enter="vm.search()" ng-model="vm.searchText">\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <fc-table ng-if="vm.siteFilter.siteId"\r\n                      table-name="ServiceableItem"\r\n                      api-method="serviceableitems"\r\n                      attributes="vm.attributes"\r\n                      on-edit="vm.edit(id)"\r\n                      filter="vm.saSiteFilter"\r\n                      selected="vm.filter.filterId">\r\n\r\n            </fc-table>\r\n            <fc-table ng-if="!vm.siteFilter.siteId && vm.filter1.customerId"\r\n                      table-name="ServiceableItem"\r\n                      api-method="serviceableitems"\r\n                      attributes="vm.attributes"\r\n                      on-edit="vm.edit(id)"\r\n                      filter="vm.siCustomerFilter"\r\n                      selected="vm.filter.filterId">\r\n\r\n            </fc-table>\r\n        </div>\r\n        <div fc-tab="Serviceable Item" class="hideactioncol hide-add-new-btn">\r\n            <fc-tabs>\r\n\r\n                <div fc-tab="Serviceable Item Notes">\r\n                    <div ng-if="vm.showTabs" id="showsearch">\r\n                        <fc-table table-name="ServiceableItemNotes"\r\n                                  ng-if="vm.loadTable"\r\n                                  api-method="serviceableitemnotes"\r\n                                  attributes="vm.attributesNote"\r\n                                  filter="vm.serviceableItemIdFilter">\r\n                        </fc-table>\r\n                    </div>\r\n                </div>\r\n\r\n\r\n                <div fc-tab="Serviceable Item History">\r\n                    <div ng-if="vm.showTabs">\r\n                        <div class="row  form-horizontal">\r\n                            <div class="clearfix CollapsibleTitle">\r\n                                <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                            </div>\r\n                            <div id="Collapsible" class="collapse in clearfix">\r\n                                <div class="col-sm-6 col-lg-6">\r\n                                    <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                                        <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                            <input name="StartDate" type="datetime" date-time="" ng-model="vm.woesFilter1.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                            <span class="input-group-addon btn btn-white">\r\n                                                <span class="glyphicon glyphicon-calendar"></span>\r\n                                            </span>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class="col-sm-6 col-lg-6">\r\n                                    <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                                        <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                            <input name="EndDate" type="datetime" date-time="" ng-model="vm.woesFilter1.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                            <span class="input-group-addon btn btn-white">\r\n                                                <span class="glyphicon glyphicon-calendar"></span>\r\n                                            </span>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class="form-group">\r\n                                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                        <button type="submit" class="btn btn-primary" ng-click="vm.loadWoesFilter()">Search</button>\r\n                                    </div> \x3c!-- input box --\x3e\r\n                                </div>\r\n                            </div>\x3c!-- Collapsible section end --\x3e\r\n                        </div>\x3c!-- row end --\x3e\r\n                        <div class="row  form-horizontal" id="manageWO">\r\n                            <fc-table api-method="wo/getbyservicableitem"\r\n                                      attributes="vm.attributesWoes"\r\n                                      on-edit="vm.goToWo(id, item)"\r\n                                      filter="vm.woesFilter"\r\n                                      timezone="vm.woTimezone"\r\n                                      ng-if="vm.loadTable">\r\n                            </fc-table>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                <div fc-tab="Serviceable Item Attachments">\r\n                    <div ng-if="vm.showTabs" id="showsearch">\r\n                        <fc-table table-name="ServiceableItemAttachments"\r\n                                  ng-if="vm.loadTable"\r\n                                  api-method="serviceableitemattachments"\r\n                                  attributes="vm.attributesAttachment"\r\n                                  filter="vm.serviceableItemIdFilter">\r\n                        </fc-table>\r\n                    </div>\r\n                </div>\r\n            </fc-tabs>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/CustomerServiceableitemNew/customerServiceableItemsReadOnly.html",'\x3c!-- US2564 : FCO - Web - Customer Portal - 3.3.5.5 Site Serviceable Items (FCWO-1896)    --\x3e\r\n\x3c!-- BUG:198 Serviceable Items menu option is not working.    --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="CustomerServiceableItemsReadOnlyController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goBack()">Serviceable Items</a></li>\r\n            <li class="active">{{vm.model.ServiceableItemName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Serviceable Item</h1>\r\n    </div>\r\n    <div class="cl-mcont hideactioncol hide-add-new-btn" fc-tab="Serviceable Item">\r\n        <div id="manageWO">\r\n            <fc-table-edit api-method="serviceableitems"\r\n                           id="{{vm.id}}"\r\n                           on-back="vm.goBack()"\r\n                           attributes="vm.attributes"\r\n                           model="vm.model">\r\n            </fc-table-edit>\r\n        </div>\r\n        <fc-tabs ng-if="vm.id">\r\n            <div fc-tab="Serviceable Item Notes">\r\n                <fc-table table-name="ServiceableItemNotes"\r\n                          api-method="serviceableitemnotes"\r\n                          attributes="vm.attributesNote"\r\n                          ng-if="vm.loadTable"\r\n                          filter="vm.serviceableItemIdFilter">\r\n                </fc-table>\r\n            </div>\r\n            <div fc-tab="Serviceable Item History">\r\n                <div class="row  form-horizontal">\r\n                    <div class="clearfix CollapsibleTitle">\r\n                        <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                    </div>\r\n                    <div id="Collapsible" class="collapse in clearfix">\r\n                        <div class="col-sm-6 col-lg-6">\r\n                            <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                    <input name="StartDate" type="datetime" date-time="" ng-model="vm.woesFilter1.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                    <span class="input-group-addon btn btn-white">\r\n                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                    </span>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="col-sm-6 col-lg-6">\r\n                            <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                    <input name="EndDate" type="datetime" date-time="" ng-model="vm.woesFilter1.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                    <span class="input-group-addon btn btn-white">\r\n                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                    </span>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button type="submit" class="btn btn-primary" ng-click="vm.loadWoesFilter()">Search</button>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div>\r\n                    </div>\x3c!-- Collapsible section end --\x3e\r\n                </div>\x3c!-- row end --\x3e\r\n                <div class="row  form-horizontal" id="manageWO">\r\n                    <fc-table api-method="wo/getbyservicableitem"\r\n                              attributes="vm.attributesWoes"\r\n                              on-edit="vm.goToWo(id, item)"\r\n                              filter="vm.woesFilter"\r\n                              ng-if="vm.loadTable"\r\n                              timezone="vm.woTimezone">\r\n                    </fc-table>\r\n                </div>\r\n            </div>\r\n            <div fc-tab="Serviceable Item Attachments">\r\n                <fc-table table-name="ServiceableItemAttachments"\r\n                          api-method="serviceableitemattachments"\r\n                          attributes="vm.attributesAttachment"\r\n                          ng-if="vm.loadTable"\r\n                          filter="vm.serviceableItemIdFilter">\r\n                </fc-table>\r\n            </div>\r\n        </fc-tabs>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/CustomerSite/CustomerSiteAgreement.html",'<div id="pcont" class="container-fluid" ng-controller="CustomerSiteAgreementController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'customerUserSites\')">Site</a></li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Agreement</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="agreementsites" id="{{vm.id}}" on-back="vm.$state.go(\'customerUserSites\')" attributes="vm.attributes" hide-submit="true"></fc-table-edit>\r\n    </div>\r\n    <div class="col-md-12" ng-if="vm.id">\r\n        <div id="accordionSites" class="panel-group accordion">\r\n            <div class="panel panel-default">\r\n                <div class="panel-heading cursor_pointer">\r\n                    <h4 class="panel-title">\r\n                        <a data-toggle="collapse" data-parent="#accordionSites" data-target="#collapseSites">\r\n                            Sites\r\n                            <span style="margin-left:20%;" ng-if="vm.numSites > 1"> {{vm.numSites}} Sites covered</span>\r\n                            <span style="margin-left:20%;" ng-if="vm.numSites == 1"> {{vm.numSites}} Site covered</span>\r\n                            <span style="margin-left:20%;" ng-if="vm.numSites == 0 "> All Sites covered</span>\r\n                            <i class="fa fa-chevron-circle-right pull-right"></i>\r\n                        </a>\r\n                    </h4>\r\n                </div>\x3c!-- panel heading --\x3e\r\n                <div id="collapseSites" class="panel-collapse collapse">\r\n                    <div class="panel-body">\r\n                        <div class="block-flat">\r\n                            <div class="hideactioncol coverageBtn">\r\n                                <fc-table table-name="Sites"\r\n                                          api-method="agreementsites"\r\n                                          attributes="vm.attributesAgreementSite"\r\n                                          filter="vm.filterByAgreement"\r\n                                          show-search="false">\r\n                                </fc-table>\r\n                            </div>\r\n                        </div>\x3c!-- block-flat --\x3e\r\n                    </div>\x3c!-- panel body --\x3e\r\n                </div>\x3c!-- panel colapse --\x3e\r\n            </div>\x3c!-- panel --\x3e\r\n        </div>\r\n        <div id="accordionItems" class="panel-group accordion">\r\n            <div class="panel panel-default">\r\n                <div class="panel-heading cursor_pointer">\r\n                    <h4 class="panel-title">\r\n                        <a data-toggle="collapse" data-parent="#accordionItems" data-target="#collapseItems">\r\n                            Serviceable Items\r\n                            <span style="margin-left:15%;" ng-if="vm.numServItem > 0"> {{vm.numServItem}} Serviceable Items covered</span>\r\n                            <span style="margin-left:15%;" ng-if="vm.numServItem == 0 "> All Serviceable Items covered</span>\r\n                            <i class="fa fa-chevron-circle-right pull-right"></i>\r\n                        </a>\r\n                    </h4>\r\n                </div>\x3c!-- panel heading --\x3e\r\n                <div id="collapseItems" class="panel-collapse collapse">\r\n                    <div class="panel-body">\r\n                        <div class="block-flat">\r\n                            <div class="hideactioncol coverageBtn">\r\n                                <fc-table table-name="Serviceable Items"\r\n                                          api-method="agreementserviceableitems"\r\n                                          attributes="vm.attributesAgreementServiceableItem"\r\n                                          filter="vm.filterByAgreement"\r\n                                          show-search="false">\r\n                                </fc-table>\r\n                            </div>\r\n                        </div>\x3c!-- block-flat --\x3e\r\n                    </div>\x3c!-- panel body --\x3e\r\n                </div>\x3c!-- panel colapse --\x3e\r\n            </div>\x3c!-- panel --\x3e\r\n        </div>\r\n    </div>\r\n</div>'),e.put("Templates/MasterTables/CustomerSite/CustomerSiteTable.html",'<div id="pcont" class="container-fluid" ng-controller="CustomerSiteController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Site</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Site</h1>\r\n    </div>\r\n    <div class="cl-mcont" ng-if="vm.getModulePrivilege(vm.viewName, vm.moduleName) !=0">\r\n        \x3c!-- row --\x3e\r\n        <div class="row">\r\n            \x3c!-- column --\x3e\r\n            <div class="col-md-12">\r\n                \x3c!-- block-flat --\x3e\r\n                <div class="block-flat">\r\n                    \x3c!-- content --\x3e\r\n                    <div class="content">\r\n                        <fc-table table-name="Site"\r\n                                  api-method="sites"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)"\r\n                                  selected="vm.filter.SiteId"\r\n                                  view-name="{{vm.viewName}}"\r\n                                  module-name="{{vm.moduleName}}"\r\n                                  preselect-first-row="true">\r\n                        </fc-table>\r\n                        \x3c!-- site tab --\x3e\r\n                        <fc-tabs ng-if="vm.filter.SiteId" ng-click="vm.tabChange(SiteServiceRequests)" tab="vm.filterTab">\r\n                            \r\n                            <div fc-tab="Site Notes" fc-hide={{vm.hideNotes}}>\r\n                                <div class="col-md-12" id="hidesearch">                                \r\n                                    <div class="block-flat">\r\n                                        <div>\r\n                                            <div class="col-sm-6">\r\n                                                <div style="white-space:nowrap" class="pull-left">\r\n                                                    <label for="id1">Search:</label>\r\n                                                    <input class="input-search input-sm" type="search" fc-enter="vm.search()" ng-model="vm.searchText">\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div>\r\n                                            <fc-table table-name="Site Notes"\r\n                                                      api-method="sitenotes"\r\n                                                      attributes="vm.attributesNotes"\r\n                                                      on-edit="vm.editNotes(id)"\r\n                                                      filter="vm.filterBySite"\r\n                                                      ng-if="vm.loadTable && vm.loadNotes"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{vm.moduleNameSiteNoteGrid}}">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n\r\n                            <div fc-tab="Site Agreements" fc-hide={{vm.hideAgreement}}>\r\n                                <div class="col-md-12" id="hidesearch">\r\n                                    <div class="block-flat">\r\n                                        <div>\r\n                                            <div class="col-sm-6">\r\n                                                <div style="white-space:nowrap" class="pull-left">\r\n                                                    <label for="id1">Search:</label>\r\n                                                    <input class="input-search input-sm" type="search" fc-enter="vm.search()" ng-model="vm.searchText">\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div class="hideactioncol hide-add-new-btn">\r\n                                            <fc-table table-name="Site Agreements"\r\n                                                      api-method="agreementsites/getcustomeragreementsite"\r\n                                                      attributes="vm.attributesAgreement"\r\n                                                      on-edit="vm.editAgreements(id)"\r\n                                                      filter="vm.filterBySite"\r\n                                                      ng-if="vm.loadTable && vm.loadAgreement"\r\n                                                      value-for-selected="AgreementId"\r\n                                                      custom-selected="AgreementId"\r\n                                                      selected="vm.filter.AgreementId"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{vm.moduleNameSiteAgreementGrid}}">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n\r\n                            <div fc-tab="Site Service Requests">\r\n                                <div class="content" ng-if="vm.getModulePrivilege(vm.viewName, vm.moduleNameServiceRequestGrid) !=0">\r\n                                    <div class="clearfix CollapsibleTitle">\r\n                                        <button type="button" class="btn btn-info pull-right Collapsible collapsed" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                                    </div>\r\n                                    <div id="Collapsible" class="clearfix collapse">\r\n\r\n                                        \x3c!-- filter: RequestDateFrom --\x3e\r\n                                        <div class="col-sm-6 col-md-6 col-lg-6">\r\n                                            <div class="form-group datepicker-div" fc-enter="vm.searchServiceRequests()">\r\n                                                <label class="control-label nopaddingLeft col-sm-3 col-md-4 col-lg-3">Start Date:</label>\r\n                                                <div data-min-view="2" class="input-group date datetime ccol-sm-5 col-md-4 col-lg-4 " date-time-append="">\r\n                                                    <input tabindex="1" name="From Date" type="datetime" date-time="" ng-model="vm.filterServiceRequestsModel.RequestDateFrom" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                                    <span class="input-group-addon btn btn-white">\r\n                                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                                    </span>\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\r\n\r\n                                        \x3c!-- filter: RequestDateTo --\x3e\r\n                                        <div class="col-sm-6 col-md-6 col-lg-6">\r\n                                            <div class="form-group datepicker-div" fc-enter="vm.searchServiceRequests()">\r\n                                                <label class="control-label nopaddingLeft col-sm-3 col-md-4 col-lg-3">End Date:</label>\r\n                                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft5" date-time-append="">\r\n                                                    <input tabindex="2" name="To Date" type="datetime" date-time="" ng-model="vm.filterServiceRequestsModel.RequestDateTo" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                                    <span class="input-group-addon btn btn-white">\r\n                                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                                    </span>\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\r\n\r\n                                        \x3c!-- Filter table edit: AltId, SiteId, ServiceableItemId, WoTypeName --\x3e\r\n                                        <div id="serviceRequestListCustomerSiteSearch">\r\n                                            <fc-table-edit api-method=""\r\n                                                           model="vm.filterServiceRequestsModel"\r\n                                                           on-enter="vm.searchServiceRequests()"\r\n                                                           attributes="vm.attributesServiceRequestsFilter">\r\n                                            </fc-table-edit>\r\n                                        </div>\r\n\r\n\r\n                                        \x3c!-- filter: Status --\x3e\r\n                                        <div class="block-flat" ng-init=\'content="wo"\'>\r\n                                            <div class="col-sm-10 col-md-10 col-lg-10">\r\n                                                <label class="marginRight10">\r\n                                                    <input type="radio" id="woStatusFilter" class="icheck" ng-model="content" value="wo" tabindex="6" ng-click="vm.resetStatusFilter()"> Work Order\r\n                                                </label>\r\n                                                <label>\r\n                                                    <input type="radio" id="srStatusFilter" class="icheck" ng-model="content" value="sr" tabindex="7" ng-click="vm.resetStatusFilter()"> Request Service\r\n                                                </label>\r\n                                            </div> \x3c!-- input box --\x3e\r\n                                            <div class="content" ng-show="content == \'wo\'">\r\n                                                <div class="col-sm-6 col-md-6">\r\n                                                    <div class="form-group">\r\n                                                        <label class="col-sm-3 col-md-4 col-lg-3 control-label marginTop10">Work Order Status:</label>\r\n                                                        <div class="col-sm-7 col-md-6 col-lg-5">\r\n                                                            <fc-dropdown tabindex="8"\r\n                                                                         on-enter="vm.searchServiceRequests()"\r\n                                                                         value="vm.filterServiceRequestsModel.Name"\r\n                                                                         api-method="wostatuses"\r\n                                                                         value-prop="WoStatusName"\r\n                                                                         text-prop="WoStatusName"\r\n                                                                         convert-to-int="false"\r\n                                                                         label="Work Order Status:">\r\n                                                            </fc-dropdown>\r\n                                                        </div>\r\n                                                    </div> \x3c!-- form group --\x3e\r\n                                                </div>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                            <div class="content" ng-show="content == \'sr\'">\r\n                                                <div class="col-sm-6 col-md-6">\r\n                                                    <div class="form-group">\r\n                                                        <label class="col-sm-3 col-md-4 col-lg-3 control-label marginTop10">Request Service Status:</label>\r\n                                                        <div class="col-sm-7 col-md-6 col-lg-5">\r\n                                                            <fc-dropdown tabindex="8"\r\n                                                                         on-enter="vm.searchServiceRequests()"\r\n                                                                         value="vm.filterServiceRequestsModel.Name"\r\n                                                                         api-method="statuses"\r\n                                                                         value-prop="StatusName"\r\n                                                                         text-prop="StatusName"\r\n                                                                         convert-to-int="false"\r\n                                                                         label="Service Status:"\r\n                                                                         Filter="vm.FilterStatus">\r\n                                                            </fc-dropdown>\r\n                                                        </div>\r\n                                                    </div> \x3c!-- form group --\x3e\r\n                                                </div>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\r\n                                        <div class="form-group">\r\n                                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                                <button type="submit" tabindex="9" class="btn btn-primary" ng-click="vm.searchServiceRequests()">Search</button>\r\n                                            </div>  \x3c!--input box--\x3e\r\n                                        </div>\r\n                                    </div> \x3c!--collapsible--\x3e\r\n                                    <div id="serviceRequestListCustomerSite" ng-if="vm.loadTable">\r\n                                        <fc-table api-method="servicerequests/servicerequestlist"\r\n                                                  attributes="vm.attributesServiceRequests"\r\n                                                  on-second-edit="vm.secondedit(item.WoId, item)"\r\n                                                  view-name="{{vm.viewName}}"\r\n                                                  module-name="{{vm.moduleNameServiceRequestGrid}}"\r\n                                                  on-edit="vm.editServiceRequest(id, item)"\r\n                                                  value-for-selected="WorkOrder"\r\n                                                  filter="vm.filterServiceReuests">\r\n                                        </fc-table>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </fc-tabs>\r\n                        \x3c!-- site tab --\x3e\r\n                    </div>\r\n                    \x3c!-- content --\x3e\r\n                </div>\r\n                \x3c!-- block-flat --\x3e\r\n            </div>\r\n            \x3c!-- column --\x3e\r\n        </div>\r\n        \x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/CustomerUser/customerUserEdit.html",'<div id="pcont" class="container-fluid" ng-controller="CustomerUserEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'customerUserTable\')">Customer User</a></li>\r\n            <li class="active">{{vm.userDataModel.UserName}}</li>\r\n        </ol>\x3c!-- breadcrumb --\x3e\r\n        <h1>Customer User</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div id="customerEdit">\r\n            <fc-table-edit api-method="customerusers"\r\n                           id="{{vm.id}}"\r\n                           model="vm.userDataModel"\r\n                           attributes="vm.attributes"\r\n                           on-submit="vm.submitUserData()"\r\n                           on-back="vm.cancelSubmit()"\r\n                           cancel-button-text="Back">\r\n            </fc-table-edit>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-sm-3 col-md-3 col-lg-3">\r\n                <label>Customers:</label>\r\n                 <div id="datatable-icons_filter" class="dataTables_filter" style="text-align:left">\r\n                    <label><i id="search-info" class="fa fa-info-circle" style="display: none"></i>\r\n                    <input type="search" class="form-control input-sm push-right" placeholder="Search" aria-controls="datatable-icons" ng-model="vm.model.SearchCustomer"></label>\r\n                </div>\r\n            </div>\r\n            <div class="col-sm-3 col-md-3 col-lg-3">\r\n                <label>Selected Customers:</label>\r\n            </div>\r\n            <div class="col-sm-3 col-md-3 col-lg-3">\r\n                <label>Sites:</label>\r\n                <div id="datatable-icons_filter" class="dataTables_filter" style="text-align:left">\r\n                    <label>\r\n                       <i id="search-info" class="fa fa-info-circle" style="display: none"></i>\r\n                        <input type="search" class="form-control input-sm push-right" placeholder="Search" aria-controls="datatable-icons" ng-model="vm.model.SearchSite">\r\n                    </label>\r\n                </div>\r\n            </div>\r\n            <div class="col-sm-3 col-md-3 col-lg-3">\r\n                <label>Selected Sites:</label>\r\n            </div>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-sm-2 col-md-2 col-lg-2">\r\n                <fc-multiselect value="vm.customerIds"\r\n                                list="vm.customers"\r\n                                value-prop="Id"\r\n                                text-prop="CustomerName"\r\n                                fcTabindex="12"\r\n                               \r\n                                 />\r\n            </div>\r\n            <div class="col-sm-1 col-md-1 col-lg-1">\r\n                <button type="button" ng-disabled="vm.existCustomer" class="btn btn-default" ng-click="vm.addSelectedCustomers()" style="width: 100%; font-size: 0.8em">Add &gt;&gt;</button>\r\n                <br />\r\n                <button type="button" class="btn btn-default" ng-click="vm.removeSelectedCustomers()" style="width: 100%; font-size: 0.8em">&lt;&lt; Remove</button>\r\n            </div>\r\n\r\n            <div class="col-sm-2 col-md-2 col-lg-2">\r\n                <fc-multiselect value="vm.selectedCustomerIds"\r\n                                list="vm.selectedCustomers"\r\n                                value-prop="Id"\r\n                                text-prop="CustomerName"\r\n                                required="true"\r\n                                fcTabindex="13"\r\n                               \r\n                                 />\r\n                \r\n            </div>\r\n           \r\n            <div class="col-sm-1 col-md-1 col-lg-1">\r\n                \r\n            </div>\r\n            <div class="col-sm-2 col-md-2 col-lg-2">\r\n                <fc-multiselect value="vm.siteIds"\r\n                                list="vm.sites"\r\n                                value-prop="Id"\r\n                                text-prop="SiteName"\r\n                                fcTabindex="14"\r\n                            \r\n                                 />\r\n            </div>\r\n            <div class="col-sm-1 col-md-1 col-lg-1">\r\n                <button type="button" class="btn btn-default" ng-click="vm.addSelectedSites()" style="width: 100%; font-size: 0.8em">Add &gt;&gt;</button>\r\n                <br />\r\n                <button type="button" class="btn btn-default" ng-click="vm.removeSelectedSites()" style="width: 100%; font-size: 0.8em">&lt;&lt; Remove</button>\r\n            </div>\r\n            <div class="col-sm-2 col-md-2 col-lg-2">\r\n                <fc-multiselect value="vm.selectedSiteIds"\r\n                                list="vm.selectedSites"\r\n                                value-prop="Id"\r\n                                text-prop="SiteName"\r\n                                fcTabindex="15" />\r\n            </div>\r\n\r\n            <div class="col-sm-1 col-md-1 col-lg-1">\r\n            </div>\r\n            <span ng-show="vm.showMissingCustomer" class="validation">You have to select customer first</span>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-sm-11 col-md-11 col-lg-11">\r\n                <button type="button" class="btn btn-primary pull-right" ng-click="vm.tmpSubmit()">Submit</button>\r\n                <button type="button" class="btn btn-default pull-right" ng-click="vm.cancelSubmit()">Cancel</button>\r\n            </div>\r\n            <div class="col-sm-1 col-md-1 col-lg-1">\r\n            </div>\r\n        </div>\r\n        <div class="row">\r\n            <button ng-if="vm.id" ng-hide="vm.showResetPasword" class="btn btn-default push-right" ng-click="vm.activateReset()">Reset Password</button>\r\n        </div>\r\n        <div id="user-password-reset">\r\n            <fc-table-edit ng-if="vm.id"\r\n                           ng-show="vm.showResetPasword"\r\n                           model="vm.resetPasswordModel"\r\n                           on-back="vm.cancelResetPasword()"\r\n                           attributes="vm.resetPasswordAttributes"\r\n                           on-submit="vm.submitResetPassword()"\r\n                           submit-button-text="Ok">\r\n            </fc-table-edit>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/CustomerUser/customerUserTable.html",'<div id="pcont" class="container-fluid" ng-controller="CustomerUserController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Customer User</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Customer User</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <div class="row  form-horizontal">\r\n                            <div class="clearfix CollapsibleTitle">\r\n                                <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                            </div>\r\n                            <div id="Collapsible" class="collapse in clearfix">\r\n                                <div class="col-sm-12 col-lg-12">\r\n                                    <div class="form-group col-sm-6 col-lg-6">\r\n                                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">Role:</label>\r\n                                        <div class="col-sm-9 col-md-8 col-lg-9 pull-left">\r\n                                            <fc-dropdown value="vm.searchFilter.RoleId" api-method="roles/customer" value-prop="Id" text-prop="RoleName" on-enter="vm.getUsers()" />\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class="col-sm-12 col-lg-12">\r\n                                    <div class="form-group col-sm-6 col-lg-6">\r\n                                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">Search:</label>\r\n                                        <div class="col-sm-6 col-md-4 col-lg-6 ">\r\n                                            <input type="text" ng-model="vm.searchFilter.Search" class="form-control pull-left" fc-enter="vm.getUsers()" />\r\n                                        </div>\r\n                                        <div class="col-sm-3 col-md-4 col-lg-3 text-right">\r\n                                            <button class="btn btn-primary pull-left" ng-click="vm.getUsers()">Search</button>\r\n                                        </div> \x3c!-- input box --\x3e\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="row form-horizontal" id="user">\r\n                            <fc-table id="customerUserTable" \r\n                                      table-name="CustomerUsers" \r\n                                      api-method="customerusers" \r\n                                      attributes="vm.attributes" \r\n                                      selected="vm.filter.UserId" \r\n                                      on-edit="vm.edit(id)" \r\n                                      filter="vm.roleFilter" \r\n                                      ng-if="vm.reloadTable"\r\n                                      view-name="{{vm.viewName}}"\r\n                                      module-name="{{vm.moduleName}}">\r\n                            </fc-table>\r\n                        </div>\x3c!-- row --\x3e\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\x3c!-- Collapsible section end --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/DashboardReports/dashboardReportsEdit.html",'\x3c!-- PBI623 - TASK627 : FCO web ui: Dashboards --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dashboardReportsEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dashboardReportsTable\')">Dashboard Reports</a></li>\r\n            <li class="active">{{vm.model.Identifier}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Dashboard Reports</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dashboardReports"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dashboardReportsTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/MasterTables/DashboardReports/dashboardReportsTable.html",'\x3c!-- PBI623 - TASK627 : FCO web ui: Dashboards --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dashboardReportsController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Dashboard Reports</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Dashboard Reports</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <fc-table table-name="Dashboard Reports"\r\n                                  attributes="vm.attributes"\r\n                                  api-method="dashboardReports"\r\n                                  on-edit="vm.edit(id)" />\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>'),e.put("Templates/MasterTables/DefaultStartPageRole/defaultStartPageRole.html",'<div id="pcont" class="container-fluid">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Default Start Page</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Default Start Page</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content" ng-controller="DefaultStartPageRoleController as vm">\r\n                        <fc-table id="default-start-page-role-table"\r\n                                  table-name="Default Start Page"\r\n                                  api-method="defaultStartPage"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)"\r\n                                  selected="vm.filter.filterId"\r\n                                  drilldown="vm.drilldownSettings"\r\n                                  show-Add-New="false"\r\n                                  show-Delete-Column="false">\r\n                        </fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/MasterTables/DefaultStartPageRole/defaultStartPageRoleEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="DefaultStartPageRoleEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'laborGroupTech\')">Default Start Page</a></li>\r\n            <li class="active">{{vm.model.Name}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Default Start Page</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="defaultStartPageRole"\r\n                       id="{{vm.id}}"\r\n                       model="vm.model"\r\n                       on-back="vm.$state.go(\'defaultStartPageRole\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/MasterTables/Employee/employeeEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="EmployeeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'employeeTable\')">Employees</a></li>\r\n            <li class="active">{{vm.model.FirstName}} {{vm.model.LastName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Employee Form </h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <button type="submit" class="btn btn-primary push-right" style="margin-top:15px;" ng-click="vm.importFromUser()" ng-hide="vm.employeeId>0 || vm.user.userId>0">Copy from User</button>\r\n        <fc-table-edit api-method="employees" id="{{vm.id}}" model="vm.model" on-back="vm.checkLatLong(insertData)" attributes="vm.attributes"></fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/MasterTables/Employee/employeeTable.html",'<div id="pcont" class="container-fluid" ng-controller="EmployeeController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Employees</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Employees</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <fc-table table-name="Employees" \r\n                                  api-method="employees" \r\n                                  attributes="vm.attributes" \r\n                                  on-edit="vm.edit(id)"\r\n                                  view-name="Employees"\r\n                                  module-name="EmployeesGrid"></fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/Employee/importUser.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n  <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n    \x3c!-- Modal content--\x3e\r\n    <div class="modal-content" style="overflow-y: auto; height: 90%">\r\n      <div class="modal-header">\r\n        <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n        <h4 class="modal-title">Users</h4>\r\n      </div>\r\n      <div class="modal-body">\r\n          <fc-table table-name="User" api-method="users/getAvailableUsers" filter="vm.filterAvailableUsers" attributes="vm.attributes" selected="vm.userId" id="import-user-table"></fc-table>\r\n        </div>\r\n    </div>\r\n\r\n  </div>\r\n</div>\r\n<div class="modal-backdrop in fade" ></div>\r\n'),e.put("Templates/MasterTables/Equipment/equipmentEdit.html",'<div id="pcont" class="container-fluid" ng-controller="EquipmentEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'equipmentTable\')">Equipment</a></li>\r\n            <li class="active">{{vm.model.EquipmentName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Equipment</h1>\r\n    </div>\r\n    <div class="cl-mcont" fc-tab="Equipment">\r\n        <fc-table-edit api-method="equipment" id="{{vm.id}}" on-back="vm.goBack()" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n        <fc-tabs ng-if="vm.id">\r\n\r\n            <div fc-tab="Equipment Notes" id="hidesearch">\r\n                <div class="col-sm-6">\r\n                    <div style="white-space:nowrap" class="pull-left">\r\n                        <label for="id1">Search:</label>\r\n                        <input class="input-search input-sm" placeholder="Search Note" type="search" fc-enter="vm.searchNotes()" ng-model="vm.notesSearchText">\r\n                    </div>\r\n                </div>\r\n                <fc-table table-name="EquipmentNotes" api-method="equipmentnotes" attributes="vm.attributesNote" on-edit="vm.editNote(id)" ng-if="vm.loadTable" filter="vm.serviceableItemIdFilter"></fc-table>\r\n            </div>\r\n\r\n            <div fc-tab="Equipment Attachments" id="hidesearch1">\r\n                <div class="col-sm-6">\r\n                    <div style="white-space:nowrap" class="pull-left">\r\n                        <label for="id1">Search:</label>\r\n                        <input class="input-search input-sm" placeholder="Search Name" type="search" fc-enter="vm.searchAttachments()" ng-model="vm.attachmentSearchText">\r\n                    </div>\r\n                </div>\r\n                <fc-table table-name="EquipmentAttachments" api-method="equipmentattachments" attributes="vm.attributesAttachment" on-edit="vm.editAttachment(id)" ng-if="vm.loadTable" show-search="false" filter="vm.serviceableItemIdFilter1" delete-message-format="Are you sure that you want to delete %AttachmentName%?"></fc-table>\r\n            </div>\r\n\r\n        </fc-tabs>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/Equipment/equipmentReadOnly.html",'<div id="pcont" class="container-fluid" ng-controller="EquipmentReadOnlyController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goBack()">Assignment Details</a></li>\r\n            <li class="active">{{vm.model.ServiceableItemName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Serviceable Item</h1>\r\n    </div>\r\n    <div class="cl-mcont" fc-tab="Serviceable Item">\r\n        <div id="manageWO">\r\n            <fc-table-edit api-method="serviceableitems" id="{{vm.id}}" on-back="vm.goBack()" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n        </div>\r\n        <fc-tabs ng-if="vm.id">\r\n\r\n            <div fc-tab="Serviceable Item Notes">\r\n                <div class="col-sm-6">\r\n                    <div style="white-space:nowrap" class="pull-left">\r\n                        <label for="id1">Search:</label>\r\n                        <input class="input-search input-sm" placeholder="Search Note" type="search" fc-enter="vm.searchNotes()" ng-model="vm.notesSearchText">\r\n                    </div>\r\n                </div>\r\n                <fc-table table-name="ServiceableItemNotes" show-search="false" api-method="serviceableitemnotes" attributes="vm.attributesNote" on-edit="vm.editNote(id)" ng-if="vm.loadTable" filter="vm.serviceableItemIdFilter"></fc-table>\r\n            </div>\r\n            <div fc-tab="Serviceable Item History">\r\n                <div class="row  form-horizontal">\r\n                    <div class="clearfix CollapsibleTitle">\r\n                        <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                    </div>\r\n                    <div id="Collapsible" class="collapse in clearfix">\r\n                        <div class="col-sm-6 col-lg-6">\r\n                            <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                    <input name="StartDate" type="datetime" date-time="" ng-model="vm.woesFilter1.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                    <span class="input-group-addon btn btn-white">\r\n                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                    </span>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="col-sm-6 col-lg-6">\r\n                            <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                    <input name="EndDate" type="datetime" date-time="" ng-model="vm.woesFilter1.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                    <span class="input-group-addon btn btn-white">\r\n                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                    </span>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button type="submit" class="btn btn-primary" ng-click="vm.loadWoesFilter()">Search</button>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div>\r\n                    </div>\x3c!-- Collapsible section end --\x3e\r\n                </div>\x3c!-- row end --\x3e\r\n                <div class="row  form-horizontal" id="manageWO">\r\n                    <fc-table api-method="wo/getbyservicableitem"\r\n                              attributes="vm.attributesWoes"\r\n                              on-edit="vm.goToWo(id, item)"\r\n                              filter="vm.woesFilter"\r\n                              ng-if="vm.loadTable"\r\n                              timezone="vm.woTimezone">\r\n                    </fc-table>\r\n                </div>\r\n            </div>\r\n\r\n            <div fc-tab="Serviceable Item Attachments">\r\n                <div class="col-sm-6">\r\n                    <div style="white-space:nowrap" class="pull-left">\r\n                        <label for="id1">Search:</label>\r\n                        <input class="input-search input-sm" placeholder="Search Name" type="search" fc-enter="vm.searchAttachments()" ng-model="vm.attachmentSearchText">\r\n                    </div>\r\n                </div>\r\n                <fc-table table-name="ServiceableItemAttachments" show-search="false" api-method="serviceableitemattachments" attributes="vm.attributesAttachment" on-edit="vm.editAttachment(id)" ng-if="vm.loadTable" filter="vm.serviceableItemIdFilter1"></fc-table>\r\n            </div>\r\n        </fc-tabs>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/Equipment/equipmentTable.html",'<div id="pcont" class="container-fluid" ng-controller="EquipmentController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Equipment</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Equipment</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div id="hidesearch">\r\n            <div>\r\n                <div class="col-sm-6">\r\n                    <div style="white-space:nowrap" class="pull-left">\r\n                        <label for="id1">Search:</label>\r\n                        <input class="input-search input-sm" type="search" fc-enter="vm.search()" ng-model="vm.searchText">\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <fc-table table-name="Equipment" \r\n                      api-method="equipment" \r\n                      attributes="vm.attributes" \r\n                      on-edit="vm.edit(id)" \r\n                      filter="vm.companyIdFilter" \r\n                      selected="vm.filter.filterId" \r\n                      view-name="Equipment" \r\n                      module-name="EquipmentGrid">\r\n            </fc-table>\r\n        </div>\r\n        <div fc-tab="Equipment">\r\n            <fc-tabs>\r\n                <div fc-tab="Equipment Notes">\r\n                    <div ng-if="vm.showTabs">\r\n                        <div class="col-sm-6">\r\n                            <div style="white-space:nowrap" class="pull-left">\r\n                                <label for="id1">Search:</label>\r\n                                <input class="input-search input-sm" placeholder="Search Note" type="search" fc-enter="vm.searchNotes()" ng-model="vm.notesSearchText">\r\n                            </div>\r\n                        </div>\r\n                        <fc-table table-name="EquipmentNotes" \r\n                                  show-search="false" \r\n                                  ng-show="vm.loadTable" \r\n                                  api-method="equipmentnotes" \r\n                                  attributes="vm.attributesNote" \r\n                                  on-edit="vm.editNote(id)" \r\n                                  filter="vm.serviceableItemIdFilter">\r\n\r\n                        </fc-table>\r\n                    </div>\r\n                </div>\r\n\r\n\r\n                <div fc-tab="Equipment Attachments">\r\n                    <div ng-if="vm.showTabs" id="showsearch">\r\n                        <div class="col-sm-6">\r\n                            <div style="white-space:nowrap" class="pull-left">\r\n                                <label for="id1">Search:</label>\r\n                                <input class="input-search input-sm" placeholder="Search Name" type="search" fc-enter="vm.searchAttachments()" ng-model="vm.attachmentSearchText">\r\n                            </div>\r\n                        </div>\r\n                        <fc-table table-name="EquipmentAttachment" \r\n                                  show-search="false" \r\n                                  ng-if="vm.loadTable" \r\n                                  api-method="equipmentattachments" \r\n                                  attributes="vm.attributesAttachment" \r\n                                  on-edit="vm.editAttachment(id)" \r\n                                  filter="vm.serviceableItemIdFilter1" \r\n                                  delete-message-format="Are you sure that you want to delete %AttachmentName%?">\r\n\r\n                        </fc-table>\r\n                    </div>\r\n                </div>\r\n            </fc-tabs>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/Item/itemEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="ItemEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'itemTable\')">Parts & Misc</a></li>\r\n            <li class="active">{{vm.model.ItemName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Parts  &amp;  Misc</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        \x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n        \x3c!-- <fc-table-edit api-method="items" id="{{vm.id}}" on-back="vm.$state.go(\'itemTable\')" attributes="vm.attributes" model="vm.model"></fc-table-edit> --\x3e\r\n        <fc-table-edit api-method="items"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'itemTable\')"\r\n                       attributes="vm.attributes"\r\n                       model="vm.model"\r\n                       ng-if="vm.showForm">\r\n        </fc-table-edit>\r\n        <div ng-show="vm.filter1.filterId>0" id="hidesearch">\r\n            <h3>Rate Sheet Prices</h3>\r\n            <div>\r\n                <div class="col-sm-6">\r\n                    <div style="white-space:nowrap" class="pull-left">\r\n                        <label for="id1">Search:</label>\r\n                        <input class="input-search input-sm" type="search" fc-enter="vm.searchRateSheets()" ng-model="vm.rateSheetSearchText">\r\n                    </div>\r\n                </div>\r\n            </div>\r\n\r\n            <fc-table api-method="itemPrices"\r\n                      attributes="vm.attributesPrices"\r\n                      table-name="Rate sheet prices"\r\n                      filter="vm.filterPrices"\r\n                      ng-if="vm.id"\r\n                      on-edit="vm.editItemPrice(id)">\r\n            </fc-table>\r\n        </div>\r\n        \x3c!--Start Task 260--\x3e\r\n        <div ng-show="vm.filter2.filterId>0" id="hidesearch">\r\n            <h3>Location Quantities</h3>\r\n            <div>\r\n                <div class="col-sm-6">\r\n                    <div style="white-space:nowrap" class="pull-left">\r\n                        <label for="id1">Search:</label>\r\n                        <input class="input-search input-sm" type="search" fc-enter="vm.searchLocation()" ng-model="vm.LocationSearchText">\r\n                    </div>\r\n                </div>\r\n            </div>\r\n\r\n            <fc-table api-method="locations/itemCount"\r\n                      attributes="vm.attributesInventoryCount"\r\n                      table-name="itemCount"\r\n                      filter="vm.filtercount"\r\n                     ng-if="vm.id"\r\n                      on-edit="vm.editItemcount(id)">\r\n            </fc-table>\r\n        </div>\r\n        \x3c!--End Task 260--\x3e\r\n    </div>\r\n</div>'),e.put("Templates/MasterTables/Item/itemTable.html",'<div id="pcont" class="container-fluid" ng-controller="ItemController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Parts  &amp;  Misc</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Parts  &amp;  Misc</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n\r\n                        <fc-table table-name="Parts&Misc" \r\n                                  api-method="items" \r\n                                  attributes="vm.attributes" \r\n                                  on-edit="vm.edit(id)"\r\n                                  view-name="{{vm.viewName}}"\r\n                                  module-name="{{vm.moduleName}}">\r\n\r\n                        </fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/MasterTables/LaborGroupTech/laborGroupTech.html",'<div id="pcont" class="container-fluid" >\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Labor Group</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Labor Group</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content" ng-controller="LaborGroupTechController as vm">\r\n                        <fc-table\r\n                                  id="labor-group-tech-table"\r\n                                  table-name="Labor Group"\r\n                                  api-method="laborgroups"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)" \r\n                                  selected="vm.filter.filterId"\r\n                                  drilldown="vm.drilldownSettings">\r\n                        </fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/MasterTables/LaborGroupTech/laborGroupTechEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="LaborGroupTechEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'laborGroupTech\')">Labor Group</a></li>\r\n            <li class="active">{{vm.model.Name}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Labor Group</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="labortechgroups" id="{{vm.id}}" model="vm.model" on-back="vm.$state.go(\'laborGroupTech\')" attributes="vm.attributes"></fc-table-edit>\r\n    </div>\r\n</div>\r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    '),e.put("Templates/MasterTables/LaborRounding/laborRoundingEdit.html",'\x3c!-- PBI717 : FCO - Labor time to round to nearest quarter hour - DSL-NW --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="LaborRoundingEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'laborRoundingTable\')">Labor Rounding</a></li>\r\n            <li class="active">{{vm.model.Name}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Labor Rounding</h1>\r\n\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <div id="disclaimer" style="padding-left: 15px; margin-bottom: -30px; padding-top: 10px; padding-right: 15px;">\r\n            Advisory: If set, FieldConnect will use the below Labor Rounding rules in place of the standard calculations.\r\n            Note that you are taking responsibility for the accuracy of these rounding rules.\r\n        </div>\r\n        <fc-table-edit api-method="laborRounding"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'laborRoundingTable\')"\r\n                       attributes="vm.attributes"\r\n                       on-submit="vm.submit()"\r\n                       disable-submit="vm.readOnly">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/MasterTables/LaborRounding/laborRoundingTable.html",'\x3c!-- PBI717 : FCO - Labor time to round to nearest quarter hour - DSL-NW --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="LaborRoundingController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Labor Rounding</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Labor Rounding</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <fc-table table-name="Labor Rounding"\r\n                                  attributes="vm.attributes"\r\n                                  api-method="laborRounding"\r\n                                  on-edit="vm.edit(id)" />\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>'),e.put("Templates/MasterTables/Office/officeEdit.html",'<div id="pcont" class="container-fluid" ng-controller="OfficeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'Home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'officesTable\')">Office</a></li>\r\n            <li class="active">{{vm.model.OfficeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Office  </h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="offices" id="{{vm.id}}" on-back="vm.$state.go(\'officesTable\')" attributes="vm.attributes"  model="vm.model"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/Office/officeTable.html",'<div id="pcont" class="container-fluid" ng-controller="OfficeController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Office</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Office</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n\r\n                        <fc-table table-name="Office" api-method="Offices" attributes="vm.attributes" on-edit="vm.edit(id)"></fc-table>\r\n\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/PayRate/payRate.html",'<div id="pcont" class="container-fluid" ng-controller="PayRateController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Pay Rate</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Pay Rate</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <fc-table api-method="payRates"\r\n                                    attributes="vm.attributes"\r\n                                    on-edit="vm.edit(id)"\r\n                                    selected="vm.filter.filterId">\r\n                        </fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/MasterTables/PayRate/payRateEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="PayRateEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'payRates\')">Pay Rate</a></li>\r\n            <li class="active">{{vm.model.PayRateName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Pay Rate</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="payRates" id="{{vm.id}}" on-back="vm.$state.go(\'payRates\')" attributes="vm.attributes" model="vm.model" on-submit="vm.onSubmit()"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/PaymentType/paymentType.html",'<div id="pcont" class="container-fluid" ng-controller="PaymentTypeController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Payment Type</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Payment Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <fc-table api-method="paymentTypes" attributes="vm.attributes" on-edit="vm.edit(id)"></fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/PaymentType/paymentTypeEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="PaymentTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'paymentTypes\')">Payment Type</a></li>\r\n            <li class="active">{{vm.model.PaymentTypeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Payment Type </h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="paymentTypes" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'paymentTypes\')" attributes="vm.attributes"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/RateSheet/rateSheetEdit.html",'<div id="pcont" class="container-fluid" ng-controller="RateSheetEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.goHome()">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goBack()">Rate Sheet</a></li>\r\n            <li class="active">Rate Sheet Form  </li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Rate Sheet  </h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="ratesheets" id="{{vm.id}}" on-back="vm.goBack()" attributes="vm.attributes"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/RateSheet/rateSheetTable.html",'<div id="pcont" class="container-fluid" ng-controller="RateSheetController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Rate Sheet</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Rate Sheet</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n\r\n                        <fc-table table-name="RateSheet" \r\n                                  api-method="ratesheets" \r\n                                  attributes="vm.attributes" \r\n                                  on-edit="vm.edit(id)"\r\n                                  view-name="{{vm.viewName}}"\r\n                                  module-name="{{vm.moduleName}}">\r\n                                  \r\n                        </fc-table>\r\n\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/SMTPSettings/smtpSettings.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="SMTPSettingsController as vm">\r\n    <div class="page-head">\r\n        \x3c!-- PBI1086 : FCO - Email Settings (customer managed) --\x3e\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">SMTP Settings</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>SMTP Settings</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="smtp"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.editSMTP(insertData)"\r\n                       attributes="vm.attributes"\r\n                       model="vm.model"\r\n                       ng-if="vm.show"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/ServiceableItem/serviceableItemEdit.html",'<div id="pcont" class="container-fluid" ng-controller="ServiceableItemEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'serviceableItemsTable\')">Serviceable Item</a></li>\r\n            <li class="active">{{vm.model.ServiceableItemName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Serviceable Item</h1>\r\n    </div>\r\n    <div class="cl-mcont" fc-tab="Serviceable Item">\r\n        <fc-table-edit api-method="serviceableitems" id="{{vm.id}}" on-back="vm.goBack()" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n        <fc-tabs ng-if="vm.id">\r\n\r\n            <div fc-tab="Serviceable Item Notes" id="hidesearch">\r\n                <div class="col-sm-6">\r\n                    <div style="white-space:nowrap" class="pull-left">\r\n                        <label for="id1">Search:</label>\r\n                        <input class="input-search input-sm" placeholder="Search Note" type="search" fc-enter="vm.searchNotes()" ng-model="vm.notesSearchText">\r\n                    </div>\r\n                </div>\r\n                \x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n                \x3c!-- <fc-table table-name="ServiceableItemNotes" api-method="serviceableitemnotes" attributes="vm.attributesNote" on-edit="vm.editNote(id)" ng-if="vm.loadTable" filter="vm.serviceableItemIdFilter"></fc-table> --\x3e\r\n                <fc-table table-name="ServiceableItemNotes"\r\n                          api-method="serviceableitemnotes"\r\n                          attributes="vm.attributesNote"\r\n                          on-edit="vm.editNote(id)"\r\n                          ng-if="vm.loadTable"\r\n                          filter="vm.serviceableItemIdFilter">\r\n                </fc-table>\r\n            </div>\r\n\r\n\r\n            <div fc-tab="Serviceable Item History">\r\n                <div class="row  form-horizontal">\r\n                    <div class="clearfix CollapsibleTitle">\r\n                        <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                    </div>\r\n                    <div id="Collapsible" class="collapse in clearfix">\r\n                        <div class="col-sm-6 col-lg-6">\r\n                            <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                    <input name="StartDate" type="datetime" date-time="" ng-model="vm.woesFilter1.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                    <span class="input-group-addon btn btn-white">\r\n                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                    </span>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="col-sm-6 col-lg-6">\r\n                            <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                    <input name="EndDate" type="datetime" date-time="" ng-model="vm.woesFilter1.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                    <span class="input-group-addon btn btn-white">\r\n                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                    </span>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button type="submit" class="btn btn-primary" ng-click="vm.loadWoesFilter()">Search</button>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div>\r\n                    </div>\x3c!-- Collapsible section end --\x3e\r\n                </div>\x3c!-- row end --\x3e\r\n                <div class="row  form-horizontal" id="manageWO">\r\n                    <fc-table api-method="wo/getbyservicableitem"\r\n                              attributes="vm.attributesWoes"\r\n                              on-edit="vm.goToWo(id, item)"\r\n                              filter="vm.woesFilter"\r\n                              ng-if="vm.loadTable"\r\n                              timezone="vm.woTimezone">\r\n                    </fc-table>\r\n                </div>\r\n            </div>\r\n\r\n            <div fc-tab="Serviceable Item Attachments" id="hidesearch1">\r\n                <div class="col-sm-6">\r\n                    <div style="white-space:nowrap" class="pull-left">\r\n                        <label for="id1">Search:</label>\r\n                        <input class="input-search input-sm" placeholder="Search Name" type="search" fc-enter="vm.searchAttachments()" ng-model="vm.attachmentSearchText">\r\n                    </div>\r\n                </div>\r\n                <fc-table table-name="ServiceableItemAttachments" api-method="serviceableitemattachments" attributes="vm.attributesAttachment" on-edit="vm.editAttachment(id)" ng-if="vm.loadTable" show-search="false" filter="vm.serviceableItemIdFilter1" delete-message-format="Are you sure that you want to delete %AttachmentName%?"></fc-table>\r\n            </div>\r\n\r\n        </fc-tabs>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/ServiceableItem/serviceableItemTable.html",'<div id="pcont" class="container-fluid" ng-controller="ServiceableItemController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Serviceable Item</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Serviceable Item</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    \x3c!-- PBI622 : Add Serviceable Items to View Permissions --\x3e\r\n    \x3c!-- <div class="cl-mcont"> --\x3e\r\n    <div class="cl-mcont" ng-if="vm.getModulePrivilege(vm.viewName, vm.moduleName) != 0">\r\n        <div id="hidesearch">\r\n            <div>\r\n                \x3c!--\r\n                <div class="col-sm-12 col-md-12" style="margin-bottom:10px">\r\n                    <div class="form-group" ng-if="!vm.siteFilter.siteId">\r\n                        <div class="col-sm-6 col-md-6 col-lg-6 control-label pull-right" style="margin-right:-30px">\r\n                        --\x3e\r\n                \x3c!-- PBI662 : FCO - Serviceable Item customer filter - DSL-NW --\x3e\r\n                \x3c!-- <select ng-model="vm.filter1.customerId" class=\'form-control pull-right\' ng-options="customer.Id as customer.CustomerName for customer in vm.customers"></select> --\x3e\r\n                \x3c!-- <select ng-model="vm.filter1.customerId" class=\'form-control pull-right\' ng-options="customer.Id as customer.DDLabel for customer in vm.customers"></select> --\x3e\r\n                \x3c!-- </div>\r\n                        <label class="control-label pull-right" style="padding-top:9px;">Customer:</label>\r\n                    </div>\r\n                </div> --\x3e\r\n                <div ng-if="!vm.siteFilter.siteId">\r\n                    <div class="clearfix CollapsibleTitle">\r\n                        <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                    </div>\r\n                    <div id="Collapsible" class="collapse in clearfix">\r\n                        <div style="margin-left: 0px;">\r\n                            <fc-table-edit api-method="customers/active"\r\n                                           model="vm.model"\r\n                                           attributes="vm.custAttributes"\r\n                                           on-enter="vm.loadFilter()"\r\n                                           hide-cancel="true"\r\n                                           hide-submit="true">\r\n                            </fc-table-edit>\r\n                        </div>\r\n                        \x3c!-- <hr style="margin-left: -15px; margin-right: -15px; margin-top: -25px" />--\x3e\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class="row">\r\n                <div class="col-md-12">\r\n                    <div class="block-flat">\r\n                        <div class="content">\r\n                            \x3c!-- PBI662 : END --\x3e\r\n                            <div>\r\n                                <div class="col-sm-6">\r\n                                    <div style="white-space:nowrap; margin-top: -10px;" class="pull-left">\r\n                                        <label for="id1" style="margin-right: 15px;">Search:</label>\r\n                                        <input class="input-search input-sm" type="search" fc-enter="vm.search()" ng-model="vm.searchText">\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <fc-table ng-if="vm.siteFilter.siteId"\r\n                                  table-name="ServiceableItem"\r\n                                  api-method="serviceableitems"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)"\r\n                                  filter="vm.saSiteFilter"\r\n                                  selected="vm.filter.filterId"\r\n                                  view-name="{{vm.viewName}}"\r\n                                  module-name="{{vm.moduleName}}">\r\n\r\n                        </fc-table>\r\n\r\n                        <fc-table ng-if="!vm.siteFilter.siteId && vm.filter1.customerId"\r\n                                  table-name="ServiceableItem"\r\n                                  api-method="serviceableitems"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)"\r\n                                  filter="vm.siCustomerFilter"\r\n                                  selected="vm.filter.filterId"\r\n                                  view-name="{{vm.viewName}}"\r\n                                  module-name="{{vm.moduleName}}">\r\n\r\n                        </fc-table>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n        <div fc-tab="Serviceable Item">\r\n            <fc-tabs>\r\n                <div fc-tab="Serviceable Item Notes">\r\n                    <div ng-if="vm.showTabs">\r\n                        <div class="col-sm-6">\r\n                            <div style="white-space:nowrap" class="pull-left">\r\n                                <label for="id1">Search:</label>\r\n                                <input class="input-search input-sm" placeholder="Search Note" type="search" fc-enter="vm.searchNotes()" ng-model="vm.notesSearchText">\r\n                            </div>\r\n                        </div>\r\n                        <fc-table table-name="ServiceableItemNotes" show-search="false" ng-show="vm.loadTable" api-method="serviceableitemnotes" attributes="vm.attributesNote" on-edit="vm.editNote(id)" filter="vm.serviceableItemIdFilter"></fc-table>\r\n                    </div>\r\n                </div>\r\n\r\n                <div fc-tab="Serviceable Item History">\r\n                    <div ng-if="vm.showTabs">\r\n                        <div class="row  form-horizontal">\r\n                            <div class="clearfix CollapsibleTitle">\r\n                                <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                            </div>\r\n                            <div id="Collapsible" class="collapse in clearfix">\r\n                                <div class="col-sm-6 col-lg-6">\r\n                                    <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                                        <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                            <input name="StartDate" type="datetime" date-time="" ng-model="vm.woesFilter1.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                            <span class="input-group-addon btn btn-white">\r\n                                                <span class="glyphicon glyphicon-calendar"></span>\r\n                                            </span>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class="col-sm-6 col-lg-6">\r\n                                    <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                                        <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                            <input name="EndDate" type="datetime" date-time="" ng-model="vm.woesFilter1.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                            <span class="input-group-addon btn btn-white">\r\n                                                <span class="glyphicon glyphicon-calendar"></span>\r\n                                            </span>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class="form-group">\r\n                                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                        <button type="submit" class="btn btn-primary" ng-click="vm.loadWoesFilter()">Search</button>\r\n                                    </div> \x3c!-- input box --\x3e\r\n                                </div>\r\n                            </div>\x3c!-- Collapsible section end --\x3e\r\n                        </div>\x3c!-- row end --\x3e\r\n                        <div class="row  form-horizontal" id="manageWO">\r\n                            <fc-table api-method="wo/getbyservicableitem"\r\n                                      attributes="vm.attributesWoes"\r\n                                      on-edit="vm.goToWo(id, item)"\r\n                                      filter="vm.woesFilter"\r\n                                      timezone="vm.woTimezone"\r\n                                      ng-if="vm.loadTable">\r\n                            </fc-table>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                <div fc-tab="Serviceable Item Attachments">\r\n                    <div ng-if="vm.showTabs" id="showsearch">\r\n                        <div class="col-sm-6">\r\n                            <div style="white-space:nowrap" class="pull-left">\r\n                                <label for="id1">Search:</label>\r\n                                <input class="input-search input-sm" placeholder="Search Name" type="search" fc-enter="vm.searchAttachments()" ng-model="vm.attachmentSearchText">\r\n                            </div>\r\n                        </div>\r\n                        <fc-table table-name="ServiceableItemAttachments" show-search="false" ng-if="vm.loadTable" api-method="serviceableitemattachments" attributes="vm.attributesAttachment" on-edit="vm.editAttachment(id)" filter="vm.serviceableItemIdFilter1" delete-message-format="Are you sure that you want to delete %AttachmentName%?"></fc-table>\r\n                    </div>\r\n                </div>\r\n            </fc-tabs>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/ServiceableItem/serviceableItemsReadOnly.html",'<div id="pcont" class="container-fluid" ng-controller="ServiceableItemsReadOnlyController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goBack()">Assignment Details</a></li>\r\n            <li class="active">{{vm.model.ServiceableItemName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Serviceable Item</h1>\r\n    </div>\r\n    <div class="cl-mcont" fc-tab="Serviceable Item">\r\n        <div id="manageWO">\r\n            \x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n            \x3c!-- <fc-table-edit api-method="serviceableitems" id="{{vm.id}}" on-back="vm.goBack()" attributes="vm.attributes" model="vm.model"></fc-table-edit> --\x3e\r\n            <fc-table-edit api-method="serviceableitems"\r\n                           id="{{vm.id}}"\r\n                           on-back="vm.goBack()"\r\n                           attributes="vm.attributes"\r\n                           model="vm.model"\r\n                           ng-if="vm.showForm">\r\n            </fc-table-edit>\r\n        </div>\r\n        <fc-tabs ng-if="vm.id">\r\n\r\n            <div fc-tab="Serviceable Item Notes">\r\n                <div class="col-sm-6">\r\n                    <div style="white-space:nowrap" class="pull-left">\r\n                        <label for="id1">Search:</label>\r\n                        <input class="input-search input-sm" placeholder="Search Note" type="search" fc-enter="vm.searchNotes()" ng-model="vm.notesSearchText">\r\n                    </div>\r\n                </div>\r\n                <fc-table table-name="ServiceableItemNotes" show-search="false" api-method="serviceableitemnotes" attributes="vm.attributesNote" on-edit="vm.editNote(id)" ng-if="vm.loadTable" filter="vm.serviceableItemIdFilter"></fc-table>\r\n            </div>\r\n            <div fc-tab="Serviceable Item History">\r\n                <div class="row  form-horizontal">\r\n                    <div class="clearfix CollapsibleTitle">\r\n                        <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                    </div>\r\n                    <div id="Collapsible" class="collapse in clearfix">\r\n                        <div class="col-sm-6 col-lg-6">\r\n                            <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                    <input name="StartDate" type="datetime" date-time="" ng-model="vm.woesFilter1.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                    <span class="input-group-addon btn btn-white">\r\n                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                    </span>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="col-sm-6 col-lg-6">\r\n                            <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                    <input name="EndDate" type="datetime" date-time="" ng-model="vm.woesFilter1.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                    <span class="input-group-addon btn btn-white">\r\n                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                    </span>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button type="submit" class="btn btn-primary" ng-click="vm.loadWoesFilter()">Search</button>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div>\r\n                    </div>\x3c!-- Collapsible section end --\x3e\r\n                </div>\x3c!-- row end --\x3e\r\n                <div class="row  form-horizontal" id="manageWO">\r\n                    <fc-table api-method="wo/getbyservicableitem"\r\n                              attributes="vm.attributesWoes"\r\n                              on-edit="vm.goToWo(id, item)"\r\n                              filter="vm.woesFilter"\r\n                              ng-if="vm.loadTable"\r\n                              timezone="vm.woTimezone">\r\n                    </fc-table>\r\n                </div>\r\n            </div>\r\n\r\n            <div fc-tab="Serviceable Item Attachments">\r\n                <div class="col-sm-6">\r\n                    <div style="white-space:nowrap" class="pull-left">\r\n                        <label for="id1">Search:</label>\r\n                        <input class="input-search input-sm" placeholder="Search Name" type="search" fc-enter="vm.searchAttachments()" ng-model="vm.attachmentSearchText">\r\n                    </div>\r\n                </div>\r\n                <fc-table table-name="ServiceableItemAttachments" show-search="false" api-method="serviceableitemattachments" attributes="vm.attributesAttachment" on-edit="vm.editAttachment(id)" ng-if="vm.loadTable" filter="vm.serviceableItemIdFilter1"></fc-table>\r\n            </div>\r\n        </fc-tabs>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/Sites/siteReadOnly.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="SiteReadOnyController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goBack()">Assignment Details</a></li>\r\n            <li class="active">{{vm.model.SiteName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Site</h1>\r\n    </div>\r\n    <div class="cl-mcont" fc-tab="Site">\r\n        <div id="manageWO">\r\n            <fc-table-edit api-method="sites" model="vm.model" id="{{vm.id}}" on-back="vm.checkLatLong(insertData)" attributes="vm.attributes"></fc-table-edit>\r\n        </div>\r\n\r\n        <fc-tabs ng-if="vm.id">\r\n\r\n            <div fc-tab="Site Notes" class="block-flat">\r\n                <div class="col-md-12" id="hidesearch">\r\n                    <div>\r\n                        <div class="col-sm-6">\r\n                            <div style="white-space:nowrap" class="pull-left">\r\n                                <label for="id1">Search:</label>\r\n                                <input class="input-search input-sm" type="search" fc-enter="vm.searchNotes()" ng-model="vm.notesSearchText">\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <fc-table table-name="Site Notes"\r\n                              api-method="sitenotes"\r\n                              attributes="vm.attributesNotes"\r\n                              on-edit="vm.editNotes(id)"\r\n                              ng-if="vm.loadTable"\r\n                              filter="vm.filterNotes"></fc-table>\r\n                </div>\r\n            </div>\r\n            <div fc-tab="Site History">\r\n                <div class="row  form-horizontal">\r\n                    <div class="clearfix CollapsibleTitle">\r\n                        <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                    </div>\r\n\r\n                    <div id="Collapsible" class="collapse in clearfix">\r\n                        <div class="col-sm-6 col-lg-6">\r\n                            <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                    <input name="StartDate" type="datetime" date-time="" ng-model="vm.woesFilter1.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                    <span class="input-group-addon btn btn-white">\r\n                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                    </span>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="col-sm-6 col-lg-6">\r\n                            <div class="form-group" fc-enter="vm.loadWoesFilter()">\r\n                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                    <input name="EndDate" type="datetime" date-time="" ng-model="vm.woesFilter1.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                    <span class="input-group-addon btn btn-white">\r\n                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                    </span>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button type="submit" class="btn btn-primary" ng-click="vm.loadWoesFilter()">Search</button>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div>\r\n                    </div>\x3c!-- Collapsible section end --\x3e\r\n                </div>\x3c!-- row end --\x3e\r\n                <div class="row  form-horizontal" id="manageWO">\r\n                    <fc-table api-method="wo"\r\n                              attributes="vm.attributesWoes"\r\n                              on-edit="vm.goToWo(id, item)"\r\n                              filter="vm.woesFilter"\r\n                              ng-if="vm.loadTable"\r\n                              timezone="vm.woTimezone">\r\n                    </fc-table>\r\n                </div>\r\n            </div>\r\n            <div fc-tab="Site Attachments" class="block-flat">\r\n                <div class="col-md-12" id="hidesearch">\r\n                    <div>\r\n                        <div class="col-sm-6">\r\n                            <div style="white-space:nowrap" class="pull-left">\r\n                                <label for="id1">Search:</label>\r\n                                <input class="input-search input-sm" type="search" fc-enter="vm.searchAttachment()" ng-model="vm.attachmentSearchText">\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <fc-table table-name="Site Attachments"\r\n                              api-method="siteattachments"\r\n                              attributes="vm.attributesAttachments"\r\n                              on-edit="vm.editAttachments(id)"\r\n                              ng-if="vm.loadTable"\r\n                              filter="vm.filterAttachments"></fc-table>\r\n                </div>\r\n            </div>\r\n\r\n        </fc-tabs>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/Sites/sites.html",'<div id="pcont" class="container-fluid" ng-controller="SiteController as vm">\r\n\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Site</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Site</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    \x3c!-- PBI689 : FCO - Technician access to Customer card - DSL-NW --\x3e\r\n    \x3c!-- <div class="cl-mcont"> --\x3e\r\n    <div class="cl-mcont" ng-if="vm.getModulePrivilege(vm.guiViewName, vm.guiModuleName) != 0">\r\n        \x3c!-- US3171 : FCO - Add status column and ability to filter by status to Customer and Site searches - Benjamin --\x3e\r\n        <div class="clearfix CollapsibleTitle">\r\n            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n        </div>\r\n        <div id="Collapsible" class="collapse in clearfix">\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group">\r\n                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Search</label>\r\n                    <div class="col-sm-7 col-md-6 col-lg-5">\r\n                        <input class="form-control" type="search" ng-model="vm.filter1.search">\r\n                    </div>\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group ">\r\n                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Status</label>\r\n                    <div class="col-sm-7 col-md-6 col-lg-5">\r\n                        <fc-multiselect value="vm.filter1.status" filter="vm.FilterStatus" api-method="statuses/statusbytype" value-prop="StatusName" text-prop="StatusName" fc-tabindex="7"></fc-multiselect>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n            <div class="form-group">\r\n                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                    <button type="submit" tabindex="9" class="btn btn-primary" ng-click="vm.searchSite()">Search</button>\r\n                </div>  \x3c!--input box--\x3e\r\n            </div>\r\n        </div>\r\n        \x3c!-- US3171 : END --\x3e\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <div class="col-md-12" id="hidesearch">\r\n                            <div class="block-flat">\r\n                                \x3c!-- US3171 : FCO - Add status column and ability to filter by status to Customer and Site searches - Benjamin\r\n                                <div class="col-sm-6">\r\n                                    <div style="white-space:nowrap" class="pull-left">\r\n                                        <label for="id1">Search:</label>\r\n                                        <input class="input-search input-sm" type="search" fc-enter="vm.searchSite()" ng-model="vm.searchText">\r\n                                    </div>\r\n                                </div>\r\n                                --\x3e\r\n                                \x3c!-- PBI694 : FCO - Site history - DSL-NW --\x3e\r\n                                \x3c!-- added property:  preselect-first-row --\x3e\r\n                                \x3c!-- PBI689 : FCO - Technician access to Customer card - DSL-NW --\x3e\r\n                                \x3c!-- added show-add-new and show-delte-column attributes --\x3e\r\n                                <fc-table table-name="Site"\r\n                                          api-method="sites"\r\n                                          attributes="vm.attributes"\r\n                                          on-edit="vm.edit(id)"\r\n                                          on-second-edit="vm.secondedit(item)"\r\n                                          selected="vm.filter.SiteId"\r\n                                          view-name="Sites"\r\n                                          module-name="SitesGrid"\r\n                                          filter="vm.autoFilterCustomer"\r\n                                          preselect-first-row=true\r\n                                          show-add-new="!vm.isReadOnly"\r\n                                          show-Delete-Column="!vm.isReadOnly">\r\n                                    >\r\n                                </fc-table>\r\n                            </div>\r\n                        </div>\r\n                        <fc-tabs>\r\n                            <div fc-tab="Site Notes" class="block-flat">\r\n                                <div class="col-md-12" id="hidesearch">\r\n                                    <div>\r\n                                        <div class="col-sm-6">\r\n                                            <div style="white-space:nowrap" class="pull-left">\r\n                                                <label for="id1">Search:</label>\r\n                                                <input class="input-search input-sm" type="search" fc-enter="vm.searchNotes()" ng-model="vm.notesSearchText">\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\r\n                                    <fc-table table-name="Site Notes"\r\n                                              api-method="sitenotes"\r\n                                              attributes="vm.attributesNotes"\r\n                                              on-edit="vm.editNotes(id)"\r\n                                              filter="vm.filterNotes"\r\n                                              ng-if="vm.loadTable"></fc-table>\r\n\r\n                                </div>\r\n                            </div>\r\n                            <div fc-tab="Site History">\r\n                                <div class="row  form-horizontal">\r\n                                    <div class="clearfix CollapsibleTitle">\r\n                                        <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                                    </div>\r\n\r\n                                    <div id="Collapsible" class="collapse in clearfix">\r\n                                        <div class="col-sm-6 col-lg-6">\r\n                                            <div class="form-group">\r\n                                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                                                <div data-min-view="2" fc-enter="vm.loadFilters()" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                                    <input name="StartDate" type="datetime" date-time="" ng-model="vm.woesFilter1.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                                    <span class="input-group-addon btn btn-white">\r\n                                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                                    </span>\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div class="col-sm-6 col-lg-6">\r\n                                            <div class="form-group">\r\n                                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                                                <div data-min-view="2" fc-enter="vm.loadFilters()" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                                    <input name="EndDate" type="datetime" date-time="" ng-model="vm.woesFilter1.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                                    <span class="input-group-addon btn btn-white">\r\n                                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                                    </span>\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div class="form-group">\r\n                                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                                <button type="submit" class="btn btn-primary" ng-click="vm.loadFilters()">Search</button>\r\n                                            </div> \x3c!-- input box --\x3e\r\n                                        </div>\r\n                                    </div>\x3c!-- Collapsible section end --\x3e\r\n                                </div>\x3c!-- row end --\x3e\r\n                                <div class="row  form-horizontal" id="manageWO">\r\n                                    <fc-table api-method="wo"\r\n                                              attributes="vm.attributesWoes"\r\n                                              on-edit="vm.goToWo(id, item)"\r\n                                              filter="vm.woesFilter"\r\n                                              timezone="vm.woTimezone"\r\n                                              ng-if="vm.loadTable">\r\n                                    </fc-table>\r\n                                </div>\r\n                            </div>\r\n                            <div fc-tab="Site Attachments" class="block-flat">\r\n                                <div class="col-md-12" id="hidesearch">\r\n                                    <div>\r\n                                        <div class="col-sm-6">\r\n                                            <div style="white-space:nowrap" class="pull-left">\r\n                                                <label for="id1">Search:</label>\r\n                                                <input class="input-search input-sm" type="search" fc-enter="vm.searchAttachment()" ng-model="vm.attachmentSearchText">\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\r\n                                    <fc-table table-name="Site Attachments"\r\n                                              api-method="siteattachments"\r\n                                              attributes="vm.attributesAttachments"\r\n                                              on-edit="vm.editAttachments(id)"\r\n                                              filter="vm.filterAttachments"\r\n                                              ng-if="vm.loadTable"\r\n                                              delete-message-format="Are you sure that you want to delete %AttachmentName%?"></fc-table>\r\n                                </div>\r\n                            </div>\r\n                        </fc-tabs>\r\n                    </div>\r\n                </div>\x3c!-- content --\x3e\r\n            </div>\x3c!-- block-flat --\x3e\r\n        </div>\x3c!-- columns --\x3e\r\n    </div>\x3c!-- row --\x3e\r\n</div>\r\n'),e.put("Templates/MasterTables/Sites/sitesEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="SiteEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'sites\')">Site</a></li>\r\n            <li class="active">{{vm.model.SiteName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Site</h1>\r\n    </div>\r\n    \x3c!-- PBI689 : FCO - Technician access to Customer card - DSL-NW --\x3e\r\n    \x3c!-- <div class="cl-mcont" fc-tab="Site"> --\x3e\r\n    <div class="cl-mcont" fc-tab="Site" ng-if="vm.getModulePrivilege(vm.guiViewName, vm.guiModuleName) != 0">\r\n        \x3c!-- US3539 : FCO - WEB - Navigation links UI improvement (FCWO-2368) --\x3e\r\n        <br />\r\n        <button type="button" data-dismiss="modal" class="pull-right btn btn-primary btn-flat md-close" ng-if="vm.id != 0" ng-click="vm.$state.go(\'serviceableItems\',{ id: vm.id })">Serviceable Items</button>\r\n        \x3c!--<a class="pull-right cursor_pointer" ng-if="vm.id != 0" ng-click="vm.$state.go(\'serviceableItems\',{ id: vm.id })">Serviceable Items</a>--\x3e\r\n        \x3c!-- end --\x3e\r\n        <fc-table-edit api-method="sites" model="vm.model" id="{{vm.id}}" on-back="vm.checkLatLong(insertData)" attributes="vm.attributes"></fc-table-edit>\r\n        <fc-tabs ng-if="vm.id">\r\n\r\n            <div fc-tab="Site Notes" class="block-flat">\r\n                <div class="col-md-12" id="hidesearch">\r\n                    <div>\r\n                        <div class="col-sm-6">\r\n                            <div style="white-space:nowrap" class="pull-left">\r\n                                <label for="id1">Search:</label>\r\n                                <input class="input-search input-sm" type="search" fc-enter="vm.searchNotes()" ng-model="vm.notesSearchText">\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <fc-table table-name="Site Notes"\r\n                              api-method="sitenotes"\r\n                              attributes="vm.attributesNotes"\r\n                              on-edit="vm.editNotes(id)"\r\n                              filter="vm.filterNotes"\r\n                              ng-if="vm.loadTable"></fc-table>\r\n                </div>\r\n            </div>\r\n\r\n            <div fc-tab="Site History">\r\n                <div class="row  form-horizontal">\r\n                    <div class="clearfix CollapsibleTitle">\r\n                        <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                    </div>\r\n\r\n                    <div id="Collapsible" class="collapse in clearfix">\r\n                        <div class="col-sm-6 col-lg-6">\r\n                            <div class="form-group" fc-enter="vm.loadFilters()">\r\n                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                    <input name="StartDate" type="datetime" date-time="" ng-model="vm.woesFilter1.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                    <span class="input-group-addon btn btn-white">\r\n                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                    </span>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="col-sm-6 col-lg-6">\r\n                            <div class="form-group" fc-enter="vm.loadFilters()">\r\n                                <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                                <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                    <input name="EndDate" type="datetime" date-time="" ng-model="vm.woesFilter1.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                    <span class="input-group-addon btn btn-white">\r\n                                        <span class="glyphicon glyphicon-calendar"></span>\r\n                                    </span>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button type="submit" class="btn btn-primary" ng-click="vm.loadFilters()">Search</button>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div>\r\n                    </div>\x3c!-- Collapsible section end --\x3e\r\n                </div>\x3c!-- row end --\x3e\r\n                <div class="row  form-horizontal" id="manageWO">\r\n                    <fc-table api-method="wo"\r\n                              attributes="vm.attributesWoes"\r\n                              on-edit="vm.goToWo(id, item)"\r\n                              filter="vm.woesFilter"\r\n                              ng-if="vm.loadTable"\r\n                              timezone="vm.woTimezone">\r\n                    </fc-table>\r\n                </div>\r\n            </div>\r\n\r\n            <div fc-tab="Site Attachments" class="block-flat">\r\n                <div class="col-md-12" id="hidesearch">\r\n                    <div>\r\n                        <div class="col-sm-6">\r\n                            <div style="white-space:nowrap" class="pull-left">\r\n                                <label for="id1">Search:</label>\r\n                                <input class="input-search input-sm" type="search" fc-enter="vm.searchAttachment()" ng-model="vm.attachmentSearchText">\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <fc-table table-name="Site Attachments"\r\n                              api-method="siteattachments"\r\n                              attributes="vm.attributesAttachments"\r\n                              on-edit="vm.editAttachments(id)"\r\n                              ng-if="vm.loadTable"\r\n                              filter="vm.filterAttachments"></fc-table>\r\n                </div>\r\n            </div>\r\n        </fc-tabs>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/Sites/sitesNote.html",'<div id="pcont" class="container-fluid" ng-controller="SiteNoteController as vm">\r\n\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Site</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Site</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <fc-tabs hide>\r\n                            <div fc-tab="Site" ng-controller="SiteController as vm" ng-click="vm.$state.go(\'sites\')">\r\n\r\n                            </div>\r\n                            <div  fc-tab="Site Note" >\r\n\r\n                            </div>\r\n                            <div fc-tab="Site Attachments">\r\n\r\n                            </div>\r\n                        </fc-tabs>\r\n                        <fc-table table-name="Site Note"\r\n                                  api-method="sitesnotes"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)" />\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/Sites/sitesNoteEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="SiteNoteEditController as vm">\r\n   \r\n     \r\n        <div class="page-head">\r\n\r\n            <ol class="breadcrumb">\r\n                <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n                <li><a class="cursor_pointer" ng-click="vm.$state.go(\'sites\')">Site</a></li>\r\n                <li class="active">Site Form  </li>\r\n            </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n            <h1>Site</h1>\r\n        </div>\r\n\r\n        <div class="cl-mcont">\r\n\r\n          \r\n                    <fc-table-edit api-method="sitenotes" id="{{vm.id}}" on-back="vm.$state.go(\'sites\')" attributes="vm.attributes"></fc-table-edit>\r\n\r\n            \r\n        </div>\r\n    </div>\r\n'),e.put("Templates/MasterTables/SkillTech/skillTech.html",'<div id="pcont" class="container-fluid" >\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Skill Tech</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Skill Tech</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content" ng-controller="SkillTechController as vm">\r\n                        <fc-table\r\n                                  id="skill-tech-table"\r\n                                  table-name="Skill Tech"\r\n                                  api-method="skills"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)" \r\n                                  selected="vm.filter.filterId"\r\n                                  drilldown="vm.drilldownSettings">\r\n                        </fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/MasterTables/SkillTech/skillTechEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="SkillTechEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'skillTechs\')">Skill Tech</a></li>\r\n            <li class="active">{{vm.model.SkillName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Skill Tech Form</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="skilltechs" id="{{vm.id}}" model="vm.model" on-back="vm.$state.go(\'skillTechs\')" attributes="vm.attributes"></fc-table-edit>\r\n    </div>\r\n</div>\r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    \r\n    '),e.put("Templates/MasterTables/StandardTask/standardTask.html",'<div id="pcont" class="container-fluid">\r\n    \x3c!-- PBI918 : FCO - Generate Work Order Tasks based on Agreement --\x3e\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Standard Tasks</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Standard Tasks</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content" ng-controller="StandardTaskController as vm">\r\n                        <fc-table table-name="StandardTask"\r\n                                  api-method="standardTask"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)"></fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/MasterTables/StandardTask/standardTaskEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="StandardTaskEditController as vm">\r\n    \x3c!-- PBI918 : FCO - Generate Work Order Tasks based on Agreement --\x3e\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'laborGroupTech\')">Standard Task</a></li>\r\n            <li class="active">{{vm.model.Name}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Standard Task</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="standardTask"\r\n                       id="{{vm.id}}"\r\n                       model="vm.model"\r\n                       on-back="vm.$state.go(\'standardTask\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/MasterTables/SubcontractorCompany/itemSubEdit.html",'<div id="pcont" class="container-fluid" ng-controller="ItemsSubEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'subcontractorCompanies\')">Subcontractor Company</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goBack()">Manage Subcontractor</a></li>\r\n            <li class="active">Subcontractor Item</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Subcontractor Item</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="content">\r\n            <div class="form-horizontal">\r\n                <div class="row">\r\n                    <div class="col-sm-6">\r\n                        <div class="form-group">\r\n                            <label class="col-sm-3 col-md-4 col-lg-3 control-label">Subcontractor Name:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <select class="form-control ng-scope ng-pristine ng-valid" disabled>\r\n                                    <option selected>{{vm.subcontractor.CompanyName}}</option>\r\n                                </select>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div> \x3c!-- form group --\x3e\r\n                    </div>\r\n                \r\n                </div>\r\n            </div>\r\n            <br />\r\n            <br />\r\n            <div class="col-sm-12">\r\n                <div ng-if="vm.id == \'\' " id="datatable-icons_filter" class="dataTables_filter" style="text-align:left">\r\n                    <label>Item Search:<i id="search-info" class="fa fa-info-circle" style="display: none"></i><input type="search" class="form-control input-sm" placeholder="" aria-controls="datatable-icons" fc-enter="vm.search()" ng-model="vm.searchText"></label>\r\n                </div>\r\n            </div>\r\n            <fc-table-edit api-method="subItems" id="{{vm.id}}" on-back="vm.goBack()" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n            \r\n        </div>\x3c!-- content --\x3e\r\n     \r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/MasterTables/SubcontractorCompany/subcontractorCompany.html",'<div id="pcont" class="container-fluid" ng-controller="SubcontractorCompanyController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Subcontractor Company</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Subcontractor Company</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat" id="SubcontractorCompany">\r\n                    <div class="content">\r\n                        <fc-table api-method="subcontractorCompanies"\r\n                                    attributes="vm.attributes"\r\n                                    on-edit="vm.edit(id)"\r\n                                    selected="vm.filter.filterId">\r\n                        </fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/MasterTables/SubcontractorCompany/subcontractorCompanyEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid"  ng-controller="SubcontractorCompanyEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'subcontractorCompanies\')">Subcontractor Company</a></li>\r\n            <li class="active">Manage Subcontractor</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Manage Subcontractor</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="content">\r\n            <fc-tabs tab="vm.selectedTab" >\r\n                <div fc-tab="Subcontractor Setup">\r\n                    <div class="col-sm-12">\r\n                        <div ng-if="vm.id == \'\' " id="datatable-icons_filter" class="dataTables_filter" style="text-align:left">\r\n                            <label>Search:<i id="search-info" class="fa fa-info-circle" style="display: none"></i><input type="search" class="form-control input-sm" placeholder="" aria-controls="datatable-icons" fc-enter="vm.search()" ng-model="vm.searchText"></label>\r\n                        </div>\r\n                    </div>\r\n                    <div ng-if="vm.filtertab == false"  id="manageSubc">\r\n                    <fc-table-edit  api-method="subcontractorCompanies" id="{{vm.id}}" on-back="vm.editSub(insertData)" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n                        </div>\r\n                </div>\r\n                <div  id="manageSubc" fc-tab="Labor Codes" ng-class="vm.id == \'\' ? \'disabled\' : \'\'" ng-controller="LaborCodesSubEditController as vm">\r\n                    <fc-table-edit api-method="laborsubcodes" id="{{vm.id}}" on-back="vm.editLaborCode(insertData)" attributes="vm.attributes"></fc-table-edit>\r\n                </div>\r\n                <div fc-tab="Pay Rates" ng-class="vm.id == \'\' ? \'disabled\' : \'\'" ng-controller="PayRatesSubEditController as vm">\r\n                    <div class="form-horizontal" id="manageSubc">\r\n                        <div class="row">\r\n                            <div class="col-sm-6" >\r\n                                <div class="form-group" >\r\n                                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Subcontractor Name:</label>\r\n                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                        <select class="form-control ng-scope ng-pristine ng-valid" disabled>\r\n                                            <option selected>{{vm.subcontractor.CompanyName}}</option>\r\n                                        </select>\r\n                                    </div> \x3c!-- input box --\x3e\r\n                                </div> \x3c!-- form group --\x3e\r\n                                <div class="form-group">\r\n                                    <label class="col-sm-3 col-md-4 col-lg-3 control-label"></label>\r\n                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                      \x3c!--  <input type="text" class="form-control" ng-model="vm.subcontractor.Email" readonly>  --\x3e\r\n                                    </div> \x3c!-- input box --\x3e\r\n                                </div> \x3c!-- form group --\x3e\r\n                            </div>\r\n                            <div class="col-sm-4">\r\n                                <div class="row" style="font-weight: bold">\r\n                                    <div class="col-sm-offset-1 col-sm-4">Pay Rate</div>\r\n                                    <div class="col-sm-4">Hourly Rate</div>\r\n                                </div>\r\n                                <div style="height: 400px; overflow-x: hidden; overflow-y: auto;">\r\n                                    <div class="row" ng-repeat="payRate in vm.payRates" style="height: 42px">\r\n                                        <div class="col-sm-1">\r\n                                            <input type="checkbox" ng-model="payRate.Selected" ng-checked="payRate.Selected" />\r\n                                        </div>\r\n                                        <div class="col-sm-4">\r\n                                            {{payRate.PayRateName}}\r\n                                        </div>\r\n                                        <div class="col-sm-4">\r\n                                            \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                                            \x3c!-- <input type="number" step="0.01" class="form-control" ng-class="payRate.Selected == true ? \'\' : \'hide\'" ng-model="payRate.CostHour" style="width: 65%" /> --\x3e\r\n                                            <input type="number" onwheel="this.blur()" step="0.01" class="form-control" ng-class="payRate.Selected == true ? \'\' : \'hide\'" ng-model="payRate.CostHour" style="width: 65%" />\r\n                                            \x3c!-- BUG32 : END --\x3e\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="row">\r\n                            <div class="col-sm-offset-6 col-sm-6 col-md-6">\r\n                                <div class="form-group">\r\n                                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                        <button type="button" class="btn btn-default table-edit-cancel-btn" ng-click="vm.$state.go(\'subcontractorCompanies\')">Cancel</button>\r\n                                        <button type="submit" class="btn btn-primary table-edit-submit-btn" ng-click="vm.submit()">Submit</button>\r\n                                    </div> \x3c!-- input box --\x3e\r\n                                </div> \x3c!-- form group --\x3e\r\n\r\n                            </div> \x3c!-- columns --\x3e\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                \r\n                <div fc-tab="Items" ng-class="vm.id == \'\' ? \'disabled\' : \'\'" ng-controller="ItemSubController as vm">\r\n                    <div class="form-horizontal">\r\n                        <div class="row">\r\n                            <div class="col-sm-6">\r\n                                <div class="form-group">\r\n                                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Subcontractor Name:</label>\r\n                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                        <select class="form-control ng-scope ng-pristine ng-valid" disabled>\r\n                                            <option selected>{{vm.subcontractor.CompanyName}}</option>\r\n                                        </select>\r\n                                    </div> \x3c!-- input box --\x3e\r\n                                </div> \x3c!-- form group --\x3e\r\n                            </div>\r\n                      \x3c!--      <div class="col-sm-6">\r\n                                <div class="form-group">\r\n                                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Email:</label>\r\n                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                        <input type="text" class="form-control" ng-model="vm.subcontractor.Email" readonly>\r\n                                    </div> \x3c!-- input box --\x3e\r\n                             \x3c!--   </div> \x3c!-- form group --\x3e\r\n                          \x3c!--  </div> --\x3e \r\n                        </div>\r\n                    </div>\r\n                    <br />\r\n                    <br />\r\n                    <fc-table api-method="subItems" filter="vm.Filter" on-edit="vm.edit(id)" attributes="vm.attributes"></fc-table>\r\n                </div>\r\n            </fc-tabs>\r\n        </div>\x3c!-- content --\x3e\r\n     \r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/MasterTables/TaxRate/taxRateEdit.html",'<div id="pcont" class="container-fluid" ng-controller="TaxRateEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.goHome()">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goBack()">Sales Tax Setup</a></li>\r\n            <li class="active">{{vm.model.TaxName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Sales Tax Setup</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="taxrates" model="vm.model" id="{{vm.id}}" on-back="vm.goBack()" attributes="vm.attributes"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/TaxRate/taxRateTable.html",'<div id="pcont" class="container-fluid" ng-controller="TaxRateController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Sales Tax Setup</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Sales Tax Setup</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n\r\n                        <fc-table table-name="TaxRate" api-method="taxrates" attributes="vm.attributes" on-edit="vm.edit(id)"></fc-table>\r\n\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/User/userEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="UserEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'userTable\')">User</a></li>\r\n            <li class="active">{{vm.userDataModel.UserName}} </li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>User</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="users" id="{{vm.id}}" model="vm.userDataModel" on-back="vm.$state.go(\'userTable\')" attributes="vm.attributes" on-submit="vm.submitUserData()"></fc-table-edit>\r\n        <h4 ng-if="vm.id">Additional user settings</h4>\r\n        <fc-editable-table api-method="usersettings/getforgrid"\r\n                           attributes="vm.attributesSetting"\r\n                           on-submit="vm.submitSetting(item)"\r\n                           sort="Name"\r\n                           model="vm.modelSetting"\r\n                           filter="vm.userSettingFilter"\r\n                           filters="vm.filters"\r\n                           ng-if="vm.id">\r\n        </fc-editable-table>\r\n        <hr ng-hide="vm.showResetPasword" />\r\n        <div style="padding-top:10px">\r\n            <button ng-if="vm.id" ng-hide="vm.showResetPasword" class="btn btn-default" ng-click="vm.activateReset()">Reset Password</button>\r\n        </div>\r\n        <div id="user-password-reset" >\r\n            <fc-table-edit ng-if="vm.id" ng-show="vm.showResetPasword" model="vm.resetPasswordModel" on-back="vm.cancelResetPasword()" attributes="vm.resetPasswordAttributes" on-submit="vm.submitResetPassword()" submit-button-text ="Ok"></fc-table-edit>\r\n        </div>     \r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/User/userForNewCompanyEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="UserForNewCompanyEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'userTable\')">User</a></li>\r\n            <li class="active">{{vm.userDataModel.UserName}} </li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>User</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit  model="vm.userDataModel" attributes="vm.attributes" on-submit="vm.submitUserData()"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/MasterTables/User/userSetting.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="UserSettingController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">{{vm.userDataModel.FirstName + \' \' + vm.userDataModel.LastName}} </li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>User basic info</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit \r\n            api-method="userbasicinfo"\r\n            model="vm.userDataModel"\r\n            on-back="vm.onBack(insertData)" \r\n            attributes="vm.attributesUser" \r\n            parameterless="true">\r\n        </fc-table-edit>\r\n        <div>\r\n            <hr />\r\n        </div>\r\n        <h3>User settings</h3>\r\n        <fc-editable-table api-method="usersettings/getforgrid"\r\n                           attributes="vm.attributesSetting"\r\n                           on-submit="vm.submitSetting(item)"\r\n                           sort="Name"\r\n                           model="vm.modelSetting"\r\n                           filter="vm.userSettingFilter"\r\n                           filters="vm.filters">\r\n        </fc-editable-table>\r\n    </div>\r\n</div>'),e.put("Templates/MasterTables/User/userTable.html",'<div id="pcont" class="container-fluid" ng-controller="UserController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">User</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>User</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <div class="row  form-horizontal">\r\n                            <div class="clearfix CollapsibleTitle">\r\n                                <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                            </div>\r\n\r\n                            <div id="Collapsible" class="collapse in clearfix">\r\n                                <div class="col-sm-12 col-lg-12">\r\n                                    <div class="form-group col-sm-6 col-lg-6">\r\n                                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">Role:</label>\r\n                                        <div class="col-sm-9 col-md-8 col-lg-9 ">\r\n                                            <fc-dropdown value="vm.filter1.RoleId" api-method="roles" value-prop="Id" text-prop="RoleName" on-enter="vm.getUsers()" />\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class="col-sm-12 col-lg-12">\r\n                                    <div class="form-group col-sm-6 col-lg-6">\r\n                                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">Search:</label>\r\n                                        <div class="col-sm-6 col-md-4 col-lg-6 push-right">\r\n                                            <input type="text" ng-model="vm.filter1.Search" class="form-control pull-left" fc-enter="vm.getUsers()" />\r\n                                        </div>\r\n                                        <button class="btn btn-primary" ng-click="vm.getUsers()"> Search</button>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="row form-horizontal" id="user">\r\n                            <fc-table id="userTable" \r\n                                      table-name="User" \r\n                                      api-method="users" \r\n                                      attributes="vm.attributes" \r\n                                      selected="vm.filter.UserId" \r\n                                      on-edit="vm.edit(id)" \r\n                                      filter="vm.roleFilter" \r\n                                      ng-if="vm.reloadTable"\r\n                                      view-name="Users"\r\n                                      module-name="UsersGrid">\r\n                            </fc-table>\r\n                        </div>\x3c!-- row --\x3e\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\x3c!-- Collapsible section end --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/PM/generateWoesModal.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n    <div class="popup-overlay" ng-show="vm.loadingData">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px;">\r\n        <div class="modal-content">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n                <h4 class="modal-title">PM Serviceable Item</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <fc-table-edit api-method="wo/pm" on-back="vm.close()" on-submit="vm.generateWoes()"  attributes="vm.attributesGenerateWoesPopup" model="vm.model"></fc-table-edit>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class="modal-backdrop in fade"></div>\r\n</div>\r\n'),e.put("Templates/PM/generateWorkOrdersforPMPlans.html",'<div id="pcont" class="container-fluid" ng-controller="GenerateWorkOrdersforPMPlansController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'PM\')">Preventative Maintenance</a></li>\r\n            <li class="active">Generate Work Orders for PM Plans</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Generate Work Orders for PM Plans</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="table-edit-overlay" ng-show="vm.isLoading">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        <div class="row" id="agreements">\r\n            <div class="clearfix CollapsibleTitle">\r\n                <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n            </div>\r\n\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n\r\n                    <div class="content">\r\n                        <div id="Collapsible" class="collapse in clearfix">\r\n                            <fc-table-edit api-method="pm" custom-focus="vm.focusOut(attribute)" model="vm.model" on-enter="vm.search()" attributes="vm.attributesFilter"></fc-table-edit>\r\n                        </div> \x3c!--collapsible--\x3e\r\n\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n        <div class="row text-right" style="margin-right:3px;">\r\n            <button type="submit" class="btn btn-primary table-edit-submit-btn" ng-click="vm.search()">Search for Active PM Plans</button>\r\n            <button ng-disabled="vm.generateButtonDisabled" type="button" class="btn btn-primary table-edit-submit-btn" ng-click="vm.generateWo()">Generate Work Orders</button>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-sm-12">\r\n                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr role="row">\r\n                            <th ng-repeat="attr in vm.attributes" ng-class="{sorting: attr.Sortable && vm.sortCol != attr.ValueName, sorting_asc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'asc\', sorting_desc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'desc\'}" ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)">{{attr.Name}}</th>\r\n                        </tr>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr role="row" ng-repeat="item in vm.items">\r\n                            <td ng-repeat="attr in vm.attributes" style="position: relative">\r\n                                <span ng-if="attr.CellFormat==\'label\'">\r\n                                    <span ng-if="attr.FormatDate">{{item[attr.ValueName] | date : \'MM/dd/yyyy hh:mm a\' }}</span>\r\n                                    <span ng-if="!attr.FormatDate">{{item[attr.ValueName]}}</span>\r\n                                </span>\r\n                            </td>\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\r\n        </div>\r\n        <div class="row" style="margin:0px;">\r\n            <fc-paging page="vm.args.page" page-size="vm.args.pageSize" current-data-length="vm.items.length" total="vm.itemsMeta.Paging.TotalCount"></fc-paging>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-sm-5">\r\n                <div class="dataTables_length" id="datatable-icons_length">\r\n                    <label>\r\n                        Show\r\n                        <select name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.args.pageSize">\r\n                            <option value="10">10</option>\r\n                            <option value="25">25</option>\r\n                            <option value="50">50</option>\r\n                            <option value="100">100</option>\r\n                        </select> entries\r\n                    </label>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\r\n</div>\r\n\r\n'),e.put("Templates/PM/pmEdit.html",'<div id="pcont" class="container-fluid" ng-controller="PMEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'PM\')">Preventative Maintenance</a></li>\r\n            <li class="active"></li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Preventative Maintenance {{vm.model.AltId}}</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="table-edit-overlay" ng-show="vm.loadingData">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        <div class="row">\r\n            <fc-table-edit api-method="pm" custom-focus="vm.focusOut(attribute)" id="{{vm.id}}" on-back="vm.$state.go(\'PM\')" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-md-12" ng-if="vm.id">\r\n                <div id="accordionSites" class="panel-group accordion" style="margin-bottom: 0px !important;">\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title">\r\n                                <a data-toggle="collapse" data-parent="#accordionSites" data-target="#collapseSites">\r\n                                    Sites\r\n                                    <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                </a>\r\n                            </h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseSites" class="panel-collapse collapse in">\r\n                            <div class="panel-body">\r\n                                \x3c!-- BUG59 : PM Plans Error message gets displayed when try to use search feature for Sites/Serviceable Items --\x3e\r\n                                \x3c!-- added show-search parameter to fc-table --\x3e\r\n                                <div>\r\n                                    <div class="col-sm-6">\r\n                                        <div style="white-space:nowrap" class="pull-left">\r\n                                            <label for="id1">Search:</label>\r\n                                            <input class="input-search input-sm" type="search" fc-enter="vm.siteSearch()" ng-model="vm.siteSearchText">\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                \x3c!-- BUG59 : END --\x3e\r\n                                <div class="block-flat">\r\n                                    <div>\r\n                                        <fc-table table-name="Sites"\r\n                                                  api-method="pmsites"\r\n                                                  attributes="vm.attributesSite"\r\n                                                  filter="vm.pmSiteFilter"\r\n                                                  ng-if="vm.reloadTable"\r\n                                                  on-edit="vm.editSite()"\r\n                                                  delete-event="vm.removeSA(id, item)"\r\n                                                  delete-message-format="Are you sure that you want to delete %SiteName%? All associated Serviceable Items will also be deleted."\r\n                                                  show-search=false>\r\n                                        </fc-table>\r\n                                    </div>\r\n                                </div>\x3c!-- block-flat --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel --\x3e\r\n                </div>\r\n                <div id="accordionItems" class="panel-group accordion" style="margin-bottom: 0px !important;">\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title">\r\n                                <a data-toggle="collapse" data-parent="#accordionItems" data-target="#collapseItems">\r\n                                    Serviceable Items\r\n                                    <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                </a>\r\n                            </h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseItems" class="panel-collapse collapse in">\r\n                            <div class="panel-body">\r\n                                \x3c!-- BUG59 : PM Plans Error message gets displayed when try to use search feature for Sites/Serviceable Items --\x3e\r\n                                \x3c!-- added show-search parameter to fc-table --\x3e\r\n                                <div>\r\n                                    <div class="col-sm-6">\r\n                                        <div style="white-space:nowrap" class="pull-left">\r\n                                            <label for="id1">Search:</label>\r\n                                            <input class="input-search input-sm" type="search" fc-enter="vm.siSearch()" ng-model="vm.siSearchText">\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                \x3c!-- BUG59 : END --\x3e\r\n                                <div class="block-flat">\r\n                                    <div>\r\n                                        <fc-table table-name="Serviceable Items"\r\n                                                  api-method="pmserviceableitems"\r\n                                                  attributes="vm.attributesSerItems"\r\n                                                  ng-if="vm.reloadTable"\r\n                                                  on-edit="vm.editServiceableItem()"\r\n                                                  filter="vm.pmserviceableitemsFilter"\r\n                                                  delete-message-format="Are you sure that you want to delete %ServiceableItemName%?"\r\n                                                  delete-event="vm.removeSA(id, item)"\r\n                                                  show-search=false>\r\n                                        </fc-table>\r\n                                    </div>\r\n                                </div>\x3c!-- block-flat --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel --\x3e\r\n                </div>\r\n\r\n                \x3c!-- PBI1044 : FCO - Work Order Tasks --\x3e\r\n\r\n                <div id="accordionTasks" class="panel-group accordion" style="margin-bottom: 0px !important;">\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title">\r\n                                <a data-toggle="collapse" data-parent="#accordionTasks" data-target="#collapseTasks">\r\n                                    Tasks\r\n                                    <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                </a>\r\n                            </h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseTasks" class="panel-collapse collapse in">\r\n                            <div class="panel-body">\r\n                                <div class="block-flat">\r\n                                    <div>\r\n                                        <fc-table table-name="Tasks"\r\n                                                  api-method="pmtasks"\r\n                                                  attributes="vm.attributesTasks"\r\n                                                  ng-if="vm.reloadTable"\r\n                                                  on-edit="vm.editTasks()"\r\n                                                  filter="vm.pmTaskFilter"\r\n                                                  delete-message-format="Are you sure that you want to delete %TaskName%?"\r\n                                                  show-search=false></fc-table>\r\n                                    </div>\r\n                                </div>\x3c!-- block-flat --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel --\x3e\r\n                </div>\r\n\r\n                <div id="accordionWoes" class="panel-group accordion">\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title">\r\n                                <a data-toggle="collapse" data-parent="#accordionWoes" data-target="#collapseWoes">\r\n                                    PM Work orders\r\n                                    <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                </a>\r\n                            </h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseWoes" class="panel-collapse collapse in">\r\n                            <div class="panel-body">\r\n                                <div class="block-flat">\r\n                                    <div id="manageWO">\r\n                                        <fc-table table-name="PM Work orders"\r\n                                                  api-method="wo"\r\n                                                  ng-if="vm.reloadTable"\r\n                                                  attributes="vm.attributesWoes"\r\n                                                  on-edit="vm.goToWo(id, item)"\r\n                                                  filter="vm.woesFilter">\r\n                                        </fc-table>\r\n                                    </div>\r\n                                </div>\x3c!-- block-flat --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel --\x3e\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/PM/pmServiceableItemEdit.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px;">\r\n        <div class="modal-content">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n                <h4 class="modal-title">PM Serviceable Item</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <fc-table-edit api-method="pmserviceableitems" on-back="vm.close()" attributes="vm.attributesEditServiceableItem" model="vm.modelServiceableItems"></fc-table-edit>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class="modal-backdrop in fade"></div>\r\n</div>'),e.put("Templates/PM/pmSiteEdit.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px;">\r\n        <div class="modal-content">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n                <h4 class="modal-title">PM Sites</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n\r\n                <fc-table-edit api-method="pmsites" on-back="vm.close()" attributes="vm.attributesEditSite" model="vm.modelSites"></fc-table-edit>\r\n\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class="modal-backdrop in fade"></div>\r\n</div>\r\n'),e.put("Templates/PM/pmTable.html",'<div id="pcont" class="container-fluid" ng-controller="PMController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Preventative Maintenance</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Preventative Maintenance {{vm.agreementText}}</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row" id="agreements">\r\n            <div class="clearfix CollapsibleTitle">\r\n                <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n            </div>\r\n\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n\r\n                    <div class="content">\r\n                        <div id="Collapsible" class="collapse in clearfix">\r\n                            <fc-table-edit api-method="pm"\r\n                                           model="vm.model"\r\n                                           on-enter="vm.search()"\r\n                                           custom-focus="vm.focusOut(attribute)"\r\n                                           attributes="vm.attributesFilter">\r\n                            </fc-table-edit>\r\n                        </div> \x3c!--collapsible--\x3e\r\n                        <br /><br />\r\n                        <div class="col-sm-12 col-md-12 col-lg-12 text-left">\r\n                            \x3c!--<button type="submit" class="btn btn-primary pull-right" ng-click="vm.goToGenerateWorkOrders()">Generate Work Orders</button>--\x3e\r\n                            \x3c!--<button type="submit" class="btn btn-primary" ng-click="vm.search()">Search</button>--\x3e\r\n                        </div>\r\n                        <fc-table api-method="pm"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)"\r\n                                  filter="vm.filters"\r\n                                  ng-if="vm.reloadTable">\r\n                        </fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Payment/paymentTable.html",'<div id="pcont" class="container-fluid" ng-controller="PaymentController as vm">\r\n    \x3c!-- PBI1043 : FCO - FCPayments --\x3e\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Payment</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Payment</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        \x3c!-- LOADING SPINNER --\x3e\r\n        <div ng-hide="!vm.isLoading" class="table-edit-overlay">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <div class="clearfix CollapsibleTitle">\r\n                            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                        </div>\r\n                        <div id="Collapsible" class="collapse in clearfix">\r\n                            <fc-table-edit attributes="vm.filterattributesFilter"\r\n                                           model="vm.filterBy"\r\n                                           hide-cancel="true"\r\n                                           hide-submit="true"></fc-table-edit>\r\n                            <div class="form-group">\r\n                                <div class="text-right">\r\n                                    <button type="submit" class="btn btn-primary" ng-click="vm.search()">Search</button>\r\n                                    <button type="submit" class="btn btn-primary" ng-disabled="vm.woScopeId === undefined || vm.woScopeId === null" ng-click="vm.submitPayment()">Add Payment</button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <fc-table table-name="Event Debug Log"\r\n                                  attributes="vm.attributes"\r\n                                  api-method="wo/filter"\r\n                                  show-add-new="false"\r\n                                  show-delete-column="false"\r\n                                  show-search="false"\r\n                                  filter="vm.filter"\r\n                                  view-name="{{vm.viewName}}"\r\n                                  module-name="{{vm.moduleName}}"\r\n                                  selected="vm.woScopeId"\r\n                                  ng-if="vm.loadScopes" />\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>'),e.put("Templates/Payment/paymentTableEdit.html",'<div id="pcont" class="container-fluid" ng-controller="PaymentEditController as vm">\r\n    \x3c!-- EPIC1008 : FCO - FCPayments (Company Feature) --\x3e\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Submit Payment</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Submit Payment</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        \x3c!-- LOADING SPINNER --\x3e\r\n        <div ng-hide="!vm.isLoading" class="table-edit-overlay">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                \x3c!--<div class="block-flat">--\x3e\r\n                \x3c!--<div class="content">--\x3e\r\n                <fc-table-edit api-method="fcPayment"\r\n                               attributes="vm.editAttributes"\r\n                               model="vm.model"\r\n                               submit-button-text="Submit Payment"\r\n                               on-back="vm.onBack()"\r\n                               on-submit="vm.onSubmit()"></fc-table-edit>\r\n\r\n                <div class="row">\r\n                    <div class="col-md-6 pageViewAlign">\r\n                        <button type="button" data-dismiss="modal" class="btn btn-primary btn-flat md-close" ng-click="vm.updateSettlementStatus()">Update Settlement Status</button>\r\n                    </div>\r\n                </div>\r\n\r\n                <fc-tabs>\r\n                    <div fc-tab="Payment Transactions" id="hidesearch">\r\n                        <fc-table api-method="fcPayment/transactions"\r\n                                  attributes="vm.attributes"\r\n                                  filter="vm.filter"\r\n                                  ng-if="vm.reloadTable"\r\n                                  show-add-new="false"\r\n                                  show-delete-column="false"\r\n                                  show-search="false"\r\n                                  table-name="Payments"\r\n                                  view-name="{{vm.viewName}}"\r\n                                  module-name="{{vm.moduleName}}"\r\n                                  disable-select-row="true"\r\n                                  rows-count="vm.transactionCount"\r\n                                  list="vm.transactionList">\r\n                        </fc-table>\r\n                    </div>\r\n\r\n                    <div fc-tab="Receipts" id="hidesearch">\r\n                        <fc-table api-method="woattachments"\r\n                                  attributes="vm.attributesWoatt"\r\n                                  filter="vm.filterByWorkOrder"\r\n                                  ng-if="vm.reloadTable"\r\n                                  table-name="Scope Attachments"\r\n                                  delete-message-format="Are you sure that you want to delete %AttachmentName%?"\r\n                                  delete-event="vm.deleteEvent()"\r\n                                  view-name="{{vm.viewName}}"\r\n                                  module-name="{{vm.moduleName}}"\r\n                                  show-add-new="false"></fc-table>\r\n                    </div>\r\n            </div>\r\n\r\n            \x3c!--</div>--\x3e\x3c!-- content --\x3e\r\n            \x3c!--</div>--\x3e\x3c!-- block-flat --\x3e\r\n        </div>\x3c!-- columns --\x3e\r\n    </div>\x3c!-- row --\x3e\r\n</div>\r\n</div>'),e.put("Templates/Projects/addWoProject.html",'<div id="pcont" class="container-fluid" ng-controller="ProjectAddWoController as vm">\r\n    <div class="table-edit-overlay" ng-show="vm.loadingData">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.goHome()">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goToProject()">Projects</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goToProjectEdit()">{{vm.project.ProjectName}}</a></li>\r\n            <li class="active">Add WO to {{vm.project.ProjectName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Add WO to Project</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div id="manageWO" class="row  form-horizontal">\r\n            <div class="clearfix CollapsibleTitle">\r\n                <button type="button" class="btn btn-info pull-right Collapsible collapsed" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n            </div>\r\n\r\n            <div id="Collapsible" class="collapse in clearfix">\r\n\r\n                <fc-table-edit api-method="wo"\r\n                               model="vm.model"\r\n                               attributes="vm.attributesFilter">\r\n                </fc-table-edit>\r\n                <div class="col-sm-6 col-lg-6">\r\n                    <div class="form-group">\r\n                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                        <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                            <input name="StartDate" type="datetime" date-time="" ng-model="vm.promisedDateStart" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                            <span class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon glyphicon-calendar"></span>\r\n                            </span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class="col-sm-6 col-lg-6">\r\n                    <div class="form-group">\r\n                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>\r\n                        <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                            <input name="EndDate" type="datetime" date-time="" ng-model="vm.promisedDateEnd" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                            <span class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon glyphicon-calendar"></span>\r\n                            </span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class="form-group">\r\n                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                        <button type="submit" class="btn btn-primary" ng-click="vm.getWoes()">Search</button>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div>\r\n            </div>\x3c!-- Collapsible section end --\x3e\r\n        </div>\x3c!-- row end --\x3e\r\n        <div class="form-group">\r\n            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right">\r\n                <button type="submit" class="btn btn-primary" ng-click="vm.addToProject()" ng-disabled="vm.woes.length==0">Add To Project</button>\r\n            </div> \x3c!-- input box --\x3e\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-sm-12">\r\n                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr role="row">\r\n                            <th></th>\r\n                            <th ng-repeat="attr in vm.attributes" ng-class="{sorting: attr.Sortable && vm.sortCol != attr.ValueName, sorting_asc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'asc\', sorting_desc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'desc\'}" ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)">{{attr.Name}}</th>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr role="row" ng-repeat="item in vm.items" >\r\n                            <th><input type="checkbox" ng-click="vm.checkWo(item)" /></th>\r\n                            <td ng-repeat="attr in vm.attributes">\r\n                                <span ng-if="attr.FormatDate">{{item[attr.ValueName] | date : \'MM/dd/yyyy hh:mm a\' }}</span>\r\n                                <span ng-if="!attr.FormatDate">{{item[attr.ValueName]}}</span>\r\n                            </td>\r\n                            \x3c!--<td> {{item.AltId}} </td>\r\n                            <td> {{item.WoType}} </td>\r\n                            <td> {{item.PromiseDate | date: \'MM/dd/yyyy\' }} </td>\r\n                            <td> {{item.SiteName}} </td>\r\n                            <td> {{item.Desc}} </td>\r\n                            <td> {{item.CustomerName}} </td>\r\n                            <td> {{item.CompanyName}} </td>\r\n                            <td> {{item.OfficeName}} </td>\r\n                            <td> {{item.CustomerName}} </td>--\x3e\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\r\n        </div>\r\n        <div class="row">\r\n            <fc-paging page="vm.args.page" page-size="vm.args.pageSize" current-data-length="vm.items.length" total="vm.itemsMeta.Paging.TotalCount"></fc-paging>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-sm-5">\r\n                <div class="dataTables_length" id="datatable-icons_length">\r\n                    <label>\r\n                        Show\r\n                        <select name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.args.pageSize">\r\n                            <option value="10">10</option>\r\n                            <option value="25">25</option>\r\n                            <option value="50">50</option>\r\n                            <option value="100">100</option>\r\n                        </select> entries\r\n                    </label>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>'),e.put("Templates/Projects/projectEdit.html",'<div id="pcont" class="container-fluid" ng-controller="ProjectEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.goHome()">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goToProjects()">Projects</a></li>\r\n            <li class="active">{{vm.model.ProjectName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Project</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="projects" custom-focus="vm.focusOut(attribute)" id="{{vm.id}}" on-back="vm.editResult(insertData)" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n        <div class="content" id="project">\r\n            <h3>Work Orders</h3>\r\n            <fc-table api-method="wo"\r\n                      attributes="vm.attributesWo"\r\n                      on-go="vm.go(id, item)"\r\n                      filter="vm.woesFilter"\r\n                      ng-if="vm.loadTable"\r\n                      timezone="vm.woTimezone"\r\n                      on-edit="vm.addWoes()"\r\n                      add-button-text="Add Work Order"\r\n                      custome-delete="vm.removeProjectFromWo(item)"\r\n                      delete-message-format="Are you sure you want to remove project from %Desc% ?">\r\n            </fc-table>\r\n        </div>\r\n     </div>\r\n    \r\n'),e.put("Templates/Projects/projectTable.html",'\r\n<div id="pcont" class="container-fluid">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Projects</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Projects</h1>\r\n    </div>\r\n    <div class="cl-mcont" ng-controller="ProjectController as vm">\r\n        <div class="clearfix CollapsibleTitle">\r\n            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n        </div>\r\n        \x3c!-- LOADING SPINNER --\x3e\r\n        <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        <div id="Collapsible" class="collapse in clearfix">\r\n           \r\n            \r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group">\r\n                    <ul id="projectCheck">\r\n                        <li>\r\n                            <label>\r\n                                <input type="radio" fc-enter="vm.reloadData()" ng-model="vm.filter.date" value="Estimated" tabindex="1">\r\n                                Estimated Date\r\n                            </label> \r\n                        </li>\r\n                        <li>\r\n                            <label>\r\n                                <input type="radio" fc-enter="vm.reloadData()" ng-model="vm.filter.date" ng-value="Actual" tabindex="2">\r\n                                Actual Date\r\n                            </label>\r\n                        </li>\r\n                    </ul>\r\n\r\n                </div>\r\n            </div>\r\n\r\n            <div class="col-sm-6 col-md-6" >\r\n                <div class="form-group">\r\n                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Customer</label>\r\n                    <div class="col-sm-7 col-md-6 col-lg-5" fc-enter="vm.reloadData()">\r\n                        <fc-auto-complete-table value="vm.filter.customerName"  on-select="vm.attributeCustomer.onSelect(item)" ctr-id="customerId" api-method="{{vm.attributeCustomer.ApiMethod}}"  value-prop="CustomerName" attributes="vm.attributeCustomer.GridAttributes" page-size="vm.attributeCustomer.PageSize" search-by-columns="vm.attributeCustomer.SearchCols" search-trigger="vm.attributeCustomer.SearchTrigger" show-header="vm.attributeCustomer.ShowHeader" fc-tabindex="5"></fc-auto-complete-table>\r\n                        \x3c!--<fc-dropdown tabindex="5" on-enter="vm.reloadData()" value="vm.filter.customerId" api-method="customers" value-prop="Id" text-prop="CustomerName" required="true" convert-to-int="true" label="Customer"></fc-dropdown>--\x3e\r\n                    </div>\r\n                </div> \x3c!-- form group --\x3e\r\n\r\n            </div>\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group">\r\n                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Project Name</label>\r\n                    <div class="col-sm-7 col-md-6 col-lg-5">\r\n                        <input type="text" fc-enter="vm.reloadData()" tabindex="6" placeholder="Search" class="form-control" ng-model="vm.filter.searchByName">\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n           \r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group datepicker-div" fc-enter="vm.reloadData()">\r\n                    <label class="control-label  col-sm-3 col-md-4 col-lg-3">Start Date:</label>\r\n                    <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                        \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                        \x3c!-- <input tabindex="3" name="From Date" type="datetime" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" date-time="" ng-model="vm.filter.fromDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                        <input tabindex="3" onpaste="return false;" restrict-to="{{vm.dateService.restrictToDate()}}" name="From Date" type="datetime" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" date-time="" ng-model="vm.filter.fromDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                        \x3c!-- BUG87 : END --\x3e\r\n                        <span class="input-group-addon btn btn-white">\r\n                            <span class="glyphicon glyphicon-calendar"></span>\r\n                        </span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group ">\r\n                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Project Id</label>\r\n                    <div class="col-sm-7 col-md-6 col-lg-5">\r\n                        \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                        \x3c!-- <input tabindex="6" fc-enter="vm.reloadData()" type="number" decimal decimals="0" placeholder="Search" class="form-control" ng-model="vm.filter.searchByAltId"> --\x3e\r\n                        <input tabindex="6" fc-enter="vm.reloadData()" onwheel="this.blur()" type="number" decimal decimals="0" placeholder="Search" class="form-control" ng-model="vm.filter.searchByAltId">\r\n                        \x3c!-- BUG32 : END --\x3e\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group ">\r\n                    \r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group datepicker-div" fc-enter="vm.reloadData()">\r\n                    <label class="control-label  col-sm-3 col-md-4 col-lg-3">End Date:</label>\r\n                    <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                        \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                        \x3c!-- <input tabindex="4" name="To Date" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter.toDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                        <input tabindex="4" onpaste="return false;" restrict-to="{{vm.dateService.restrictToDate()}}" name="To Date" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter.toDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                        \x3c!-- BUG87 : END --\x3e\r\n                        <span class="input-group-addon btn btn-white">\r\n                            <span class="glyphicon glyphicon-calendar"></span>\r\n                        </span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n\r\n            <div class="form-group">\r\n                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right pull-right" style="margin-right:-15px;">\r\n                    <button type="submit" tabindex="7" class="btn btn-primary" ng-click="vm.reloadData()">Search</button>\r\n                </div>  \x3c!--input box--\x3e \r\n            </div>\r\n        </div>\x3c!-- Collapsible section end --\x3e\r\n\r\n        <div class="row" id="projectTable">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <fc-table api-method="projects/filtered"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)"\r\n                                  drilldown="vm.drilldownSettings"\r\n                                  drilldown-filter="vm.drilldownFilter"\r\n                                  on-drilldown-go="vm.go(id, item)"\r\n                                  filter="vm.filterProjects"\r\n                                  add-button-text="Create Project"\r\n                                  custome-delete="vm.deleteProject(item)"\r\n                                  ng-if="vm.reloadTable">\r\n                        </fc-table>\r\n                    </div>\x3c!-- content   --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>'),e.put("Templates/Projects/selectCustomer.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n        \x3c!-- Modal content--\x3e\r\n        <div class="modal-content" style="overflow-y: auto; height: 90%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n            </div>\r\n            <div class="modal-body" id="newWorkOrder">\r\n                <div class="col-sm-6 col-md-6">\r\n                    <div class="form-group">\r\n                        <div class="col-sm-7 col-md-6 col-lg-5">\r\n                            <input type="text" placeholder="Search" class="form-control" ng-model="vm.customerFilter.search">\r\n\r\n                        </div> \x3c!-- input box --\x3e\r\n                        <button type="submit" class="btn btn-primary" ng-click="vm.search()">Search</button>\r\n                    </div> \x3c!-- form group --\x3e\r\n                </div>\r\n                <div >\r\n                    <fc-table id="customerProject" table-name="Customer" api-method="customers/active" attributes="vm.attributes" selected="vm.customerId" list="vm.customers" filter="vm.autoFilterCustomer"></fc-table>\r\n                </div>\r\n                \r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop in fade"></div>\r\n'),e.put("Templates/Projects/selectSite.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n        \x3c!-- Modal content--\x3e\r\n        <div class="modal-content" style="overflow-y: auto; height: 90%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n            </div>\r\n\r\n            <div class="modal-body"id="newWorkOrder">\r\n                <div class="col-sm-6 col-md-6">\r\n                    <div class="form-group">\r\n                        <div class="col-sm-7 col-md-6 col-lg-5">\r\n                            <input type="text" placeholder="Search" class="form-control" ng-model="vm.siteFilter.search">\r\n\r\n                        </div> \x3c!-- input box --\x3e\r\n                        <button type="submit" class="btn btn-primary" ng-click="vm.search()">Search</button>\r\n                    </div> \x3c!-- form group --\x3e\r\n                </div>\r\n                <fc-table id="siteProject" table-name="Site" api-method="sites/searchgrid" on-edit="vm.edit = true" attributes="vm.attributes" selected="vm.siteId" list="vm.sites" filter="vm.autoFilterCustomer"></fc-table>\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop in fade"></div>\r\n'),e.put("Templates/Purchase/popupEdit.html",'<div id="myModal" class="fade" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n        \x3c!-- Modal content--\x3e\r\n        \x3c!-- PBI630 : FCO - Part search box added to PO section - DSL --\x3e\r\n        \x3c!-- <div class="modal-content" style="overflow-y: auto; width:50%; height: 60%; position: fixed; left: 25%; top: 20%;"> --\x3e\r\n        \x3c!-- BUG642 : DSL - Scroll parts screen --\x3e\r\n        <div class="modal-content" style="overflow-y: auto; height: 80%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h4 class="modal-title">{{modalTitle}}</h4>\r\n            </div>\r\n            <div class="modal-body" id="purchasePopUp">\r\n                <fc-table-edit api-method="{{vm.apiMethod}}" id="{{vm.id}}" model="vm.$scope.model" on-back="vm.onBack(insertData)" attributes="vm.attributes" timezone="vm.timezone" ng-if="!onSubmit" submit-button-text="Submit Request"></fc-table-edit>\r\n                <fc-table-edit api-method="{{vm.apiMethod}}" id="{{vm.id}}" model="vm.$scope.model" on-back="vm.onBack(insertData)" attributes="vm.attributes" timezone="vm.timezone" on-submit="onSubmit()" ng-if="onSubmit" submit-button-text="Submit Request"></fc-table-edit>\r\n                \x3c!-- <p>Some text in the modal.</p> --\x3e\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/Purchase/purchase.html",'<div id="pcont" class="container-fluid" ng-controller="PurchaseController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Purchase</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Purchase</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content purchaseBtnHide">\r\n                        <div class="form-group " >\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right">\r\n                                <button type="submit" class="btn btn-primary" ng-click="vm.createPurchaseRequisition()">Create Purchase Requisition</button>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div>\r\n                        <fc-table \r\n                                    id="forms"\r\n                                    api-method="purchases"\r\n                                    attributes="vm.attributes"\r\n                                    on-edit="vm.edit(id)"\r\n                                    drilldown="vm.drilldownSettings"\r\n                                    drilldown-filter="vm.drilldownFilter"\r\n                                    >\r\n                        </fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/Quote/QuoteReport.html",'<div id="myModal" class="fade signatureCan" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n        \x3c!-- Modal content--\x3e\r\n        <div class="modal-content" style="overflow-y: auto; height: 90%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h4 class="modal-title">Report</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                \x3c!-- LOADING SPINNER --\x3e\r\n                <div ng-hide="!vm.isLoading" class="table-edit-overlay">\r\n                    <div class="sk-circle">\r\n                        <div class="sk-circle1 sk-child"></div>\r\n                        <div class="sk-circle2 sk-child"></div>\r\n                        <div class="sk-circle3 sk-child"></div>\r\n                        <div class="sk-circle4 sk-child"></div>\r\n                        <div class="sk-circle5 sk-child"></div>\r\n                        <div class="sk-circle6 sk-child"></div>\r\n                        <div class="sk-circle7 sk-child"></div>\r\n                        <div class="sk-circle8 sk-child"></div>\r\n                        <div class="sk-circle9 sk-child"></div>\r\n                        <div class="sk-circle10 sk-child"></div>\r\n                        <div class="sk-circle11 sk-child"></div>\r\n                        <div class="sk-circle12 sk-child"></div>\r\n                    </div>\r\n                </div>\r\n                <div id="cl-wrapper">\r\n                    <div id="pcont" class="container-fluid">\r\n                        <div class="cl-mcont">\r\n                            <div class="row  form-horizontal">\r\n                                <div class="col-md-12">\r\n                                    \x3c!--dodavanje emaila--\x3e\r\n                                    <div class="table-responsive" style="overflow-x: visible">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th>Email and Attachments</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <th>\r\n                                                        <div class="form-group">\r\n                                                            \x3c!-- PBI1142 : FCO - Email request for customer signature on Quote --\x3e\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11" ng-if="vm.requestQuoteRemoteSignature">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Request Signature From:</label>\r\n\r\n                                                                <div class="col-sm-10 col-md-10 col-lg-10" style="padding: 0;">\r\n                                                                    <input id="" type="text" ng-model="vm.model.ContactEmail" class="form-control ng-valid ng-valid-required">\r\n                                                                </div>\r\n                                                                <div class="col-sm-1 col-md-1 col-lg-1">\r\n                                                                    <button class="btn btn-default" ng-click="vm.requestSignature()" ng-disabled="!vm.enableRemoteSignatureButton">Send Request</button>\r\n                                                                </div>\r\n                                                            </div>\r\n                                                            \x3c!-- PBI1142 : FCO - Email request for customer signature on Quote --\x3e\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11" ng-if="vm.requestQuoteRemoteSignature">\r\n                                                                <hr />\r\n                                                            </div>\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Send To:</label>\r\n                                                                <div class="col-sm-12 col-md-12 col-lg-12">\r\n                                                                    <input id="" type="text" required ng-model="vm.model.Email" class="form-control ng-valid ng-valid-required">\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Customer Email:</label>\r\n\r\n                                                                <div class="col-sm-11 col-md-11 col-lg-11" style="padding: 0;">\r\n                                                                    <input id="" type="text" ng-model="vm.model.CustomerContactEmail" class="form-control ng-valid ng-valid-required">\r\n                                                                </div>\r\n                                                                <div class="col-sm-1 col-md-1 col-lg-1">\r\n                                                                    <input id="" type="checkbox" ng-model="vm.model.Include">\r\n                                                                    <label class="control-label">Include</label>\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Message:</label>\r\n                                                                <div class="col-sm-12 col-md-12 col-lg-12">\r\n                                                                    <textarea id="" required ng-model="vm.model.EmailMessage" class="form-control ng-valid ng-valid-required"></textarea>\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n\r\n                                                            <div class="col-sm-5 col-md-5 col-lg-5">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Select attachments to include:</label>\r\n                                                                <div class="col-sm-12 col-md-12 col-lg-12">\r\n                                                                    <select ng-model="vm.model.SelectedAttachments" class=\'form-control\' ng-options="attachments.Id as attachments.AttachmentName for attachments in vm.model.QuoteAttachments" multiple></select>\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n\r\n                                                            <div class="col-sm-5 col-md-5 col-lg-5">\r\n\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                        </div> \x3c!-- form group --\x3e\r\n                                                    </th>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n\r\n\r\n                                    <table class="table hover reportTableAdress">\r\n                                        <thead>\r\n                                            <tr>\r\n                                                <th colspan="2" width="50%">Billing Address </th>\r\n                                                <th colspan="2" width="50%">Site Address</th>\r\n                                            </tr>\r\n                                        </thead>\r\n\r\n                                        <tbody>\r\n                                            <tr>\r\n                                                <td colspan="2">\r\n                                                    <ul class="AdressList clearfix">\r\n                                                        <li>Customer</li>\r\n                                                        <li>{{vm.model.CustomerName}}</li>\r\n\r\n                                                        <li>Address</li>\r\n                                                        <li>{{vm.model.BillingAddress}}</li>\r\n\r\n                                                        <li>Phone</li>\r\n                                                        <li>{{vm.model.BillingContactPhone}}</li>\r\n                                                    </ul>\r\n                                                </td>\r\n                                                <td colspan="2">\r\n                                                    <ul class="AdressList clearfix">\r\n                                                        <li>Site</li>\r\n                                                        <li>{{vm.model.SiteName}}</li>\r\n\r\n                                                        <li>Address</li>\r\n                                                        <li>{{vm.model.SiteAddress}}</li>\r\n\r\n                                                        <li>Phone</li>\r\n                                                        <li>{{vm.model.SiteContactPhone}}</li>\r\n                                                    </ul>\r\n                                                </td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td><strong>Quote: </strong>{{vm.model.AltId}}</td>\r\n                                                \x3c!-- US2650 : FCO - Web - Quote report prints incorrect status --\x3e\r\n                                                \x3c!-- <td><strong>Status: </strong>{{vm.model.QuoteStatus}}</td> --\x3e\r\n                                                <td><strong>Status: </strong>Approved</td>\r\n                                                \x3c!-- US2650 : END --\x3e\r\n                                                <td><strong>Expire Date: </strong>{{vm.model.ExpireDate}}</td>\r\n                                                <td><strong>WO Type: </strong>{{vm.model.WoType}}</td>\r\n                                            </tr>\r\n                                        </tbody>\r\n                                    </table>\r\n\r\n                                    <div class="table-responsive">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th colspan="2">Notes</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <td>Date</td>\r\n                                                    <td>Note</td>\r\n                                                </tr>\r\n                                                <tr ng-repeat="item in vm.model.QuoteReportNotes">\r\n                                                    <td>{{item.SysModifyUTCString}}</td>\r\n                                                    <td>{{item.Note}}</td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                                    <div class="table-responsive">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th colspan="4">Labor</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <td>Labor Code</td>\r\n                                                    <td>Hours</td>\r\n                                                    <td>Unit Price</td>\r\n                                                    <td>Extended Price</td>\r\n                                                </tr>\r\n                                                <tr ng-repeat="item in vm.model.QuoteReportLabors">\r\n                                                    <td>{{item.LaborCode}}</td>\r\n                                                    <td>{{item.HoursDisplay}}</td>\r\n                                                    <td>{{item.PricePerHourDisplay}}</td>\r\n                                                    <td>{{item.PriceDisplay}}</td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                            <tfoot>\r\n                                                <tr>\r\n                                                    <td colspan="3"><strong>Sub Total:</strong></td>\r\n                                                    <td><strong>{{vm.laborPriceTotalDisplay}}</strong></td>\r\n                                                </tr>\r\n                                            </tfoot>\r\n                                        </table>\r\n                                    </div>\r\n\r\n\r\n                                    <div class="table-responsive">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th colspan="5">Parts</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <td>Part Number</td>\r\n                                                    \x3c!-- US2701 --\x3e\r\n                                                    \x3c!-- <td>Description</td> --\x3e\r\n                                                    <td>Item Name</td>\r\n                                                    \x3c!-- US2701 : END --\x3e\r\n                                                    <td>Quantity</td>\r\n                                                    <td>Price</td>\r\n                                                    <td>Extended Price</td>\r\n                                                </tr>\r\n                                                <tr ng-repeat="item in vm.model.QuoteReportParts">\r\n                                                    <td>{{item.PartNum}}</td>\r\n                                                    <td>{{item.Desc}}</td>\r\n                                                    <td>{{item.Quantity}}</td>\r\n                                                    <td>{{item.PriceDisplay}}</td>\r\n                                                    <td>{{item.ExtendedPriceDisplay}}</td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                            <tfoot>\r\n                                                <tr>\r\n                                                    <td colspan="4"><strong>Sub Total:</strong></td>\r\n                                                    <td><strong>{{vm.partTotalDisplay}}</strong></td>\r\n                                                </tr>\r\n                                            </tfoot>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                                    <div class="table-responsive">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th colspan="5">Miscellaneous</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    \x3c!-- US2701 --\x3e\r\n                                                    \x3c!-- <td>Part Number</td> --\x3e\r\n                                                    \x3c!-- US2701 : END --\x3e\r\n                                                    \x3c!-- <td>Description</td> --\x3e\r\n                                                    <td>Item Name</td>\r\n                                                    <td>Quantity</td>\r\n                                                    <td>Price</td>\r\n                                                    <td>Extended Price</td>\r\n                                                </tr>\r\n                                                <tr ng-repeat="item in vm.model.QuoteReportMiscs">\r\n                                                    \x3c!-- US2701 --\x3e\r\n                                                    \x3c!-- <td>{{item.PartNum}}</td> --\x3e\r\n                                                    \x3c!-- US2701 : END --\x3e\r\n                                                    <td>{{item.Desc}}</td>\r\n                                                    <td>{{item.Quantity}}</td>\r\n                                                    <td>{{item.PriceDisplay}}</td>\r\n                                                    <td>{{item.ExtendedPriceDisplay}}</td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                            <tfoot>\r\n                                                <tr>\r\n                                                    <td colspan="4"><strong>Sub Total:</strong></td>\r\n                                                    <td><strong>{{vm.miscTotalDisplay}}</strong></td>\r\n                                                </tr>\r\n                                            </tfoot>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                                    <div class="table-responsive">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <td colspan="4"><strong>Quote Total:</strong></td>\r\n                                                    <td><strong>{{vm.ReportTolalDisplay}}</strong></td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                                    \x3c!--@uttam - Ticket #DE1448\r\n                                        <div ng-if="!vm.model.CompanyName.toLowerCase().includes(\'albireo\')" class="row">\r\n                                        <div class="col-md-12">\r\n                                            <p>View Our Terms and Conditions <a href="">here</a></p>\r\n                                        </div>\r\n                                    </div>--\x3e\r\n\r\n                                    <div ng-if="vm.model.CompanyName.toLowerCase().includes(\'albireo\')" class="row">\r\n                                        <div class="col-md-12">\r\n                                            <p>All services and materials subject to contract minimums.</p>\r\n                                        </div>\r\n                                    </div>\r\n\r\n\r\n                                    <div class="table-responsive" style="overflow-x: visible">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th>Signed by</th>\r\n                                                    <th>Signature</th>\r\n                                                    <th>Date</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <th>\r\n                                                        <div class="form-group">\r\n                                                            <div class="col-sm-10 col-md-9 col-lg-7">\r\n                                                                <input id="" type="text" required ng-model="vm.model.SignedBy" class="form-control ng-valid ng-valid-required">\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                        </div> \x3c!-- form group --\x3e\r\n                                                    </th>\r\n                                                    <th>\r\n                                                        <div class="form-group">\r\n                                                            <div class="col-sm-10 col-md-9 col-lg-7 ">\r\n                                                                <canvas id="signatureCanvas" required fc-signature width="400" height="150" style="border: 1px  solid #000000"></canvas>\r\n                                                            </div>\x3c!-- input box --\x3e\r\n                                                        </div>\x3c!-- form group --\x3e\r\n                                                    </th>\r\n                                                    <th>\r\n                                                        <div class="form-group">\r\n                                                            <div class="col-sm-10 col-md-9 col-lg-7">\r\n                                                                <input type="text" readonly="readonly" ng-model="vm.model.DateString" class="form-control">\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                        </div> \x3c!-- form group --\x3e\r\n                                                    </th>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                        <button class="btn btn-default floatRight" ng-if="vm.model.QuoteStatus ==\'Pending Signature\'" ng-click="vm.ok()"><i class="fa  fa-check"></i> Accept Signature</button>\r\n                                        <button class="btn btn-default floatRight" style="pointer-events: auto;" title="Creation of the report is available only for quotes with status: Pending Signature." ng-if="vm.model.QuoteStatus !=\'Pending Signature\'" disabled><i class="fa  fa-check"></i> Accept Signature</button>\r\n                                        <button class="btn btn-default floatRight" ng-click="vm.clear()"><i class="fa  fa-times-circle"></i> Clear Signature</button>\r\n                                    </div>\r\n                                </div> \x3c!-- columns --\x3e\r\n                            </div> \x3c!-- row --\x3e\r\n                        </div>\x3c!-- content --\x3e\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/Quote/itemModal.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height: 100%;">\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 80%;">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n                <h4 class="modal-title">{{modalTitle}}</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                \x3c!-- PBI639 : FCO - Quotes - Parts and Miscellaneous --\x3e\r\n                \x3c!--\r\n                <div class="row" ng-hide="vm.id!=null && vm.id>0">\r\n                    <div class="col-sm-6">\r\n                        <div id="datatable-icons_filter" class="dataTables_filter" style="text-align:left">\r\n                            <label>\r\n                                Search:<i id="search-info" class="fa fa-info-circle" style="display: inline-block" title="Search by Item Name."></i>\r\n                                <input id="seacrhInputItem" type="search" class="form-control input-sm" ng-model="vm.searchText"  fc-enter="vm.search()">\r\n                                <button class="btn btn-primary add-new-btn" ng-click="vm.search()">Search</button>\r\n                            </label>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                --\x3e\r\n                \x3c!-- PBI639 : FCO - Quotes - Parts and Miscellaneous --\x3e\r\n                \x3c!-- <fc-table-edit api-method="quoteitems" --\x3e\r\n                <fc-table-edit api-method="{{vm.apiMethod}}"\r\n                               id="{{vm.id}}"\r\n                               model="vm.model"\r\n                               view-name="{{vm.viewName}}"\r\n                               module-name="{{vm.moduleName}}"\r\n                               attributes="vm.attributes"\r\n                               on-back="vm.close(insertData)"\r\n                               hide-submit="vm.hideSubmit">\r\n                </fc-table-edit>\r\n\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class="modal-backdrop in fade"></div>\r\n</div>\r\n'),e.put("Templates/Quote/manageQuotes.html",'<div id="pcont" class="container-fluid" ng-controller="ManageQuoteController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n\r\n            <li class="active">Manage Quotes</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Manage Quotes</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont" ng-if="vm.getModulePrivilege(vm.viewName, vm.moduleName) !=0">\r\n        <div class="clearfix CollapsibleTitle">\r\n            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n        </div>\r\n        <div id="Collapsible" class="collapse in clearfix">\r\n\r\n\r\n            <div class="col-sm-12 col-md-12">\r\n                <div class="form-group">\r\n                    <ul id="quoteCheck">\r\n                        <li>\r\n                            <label>\r\n                                <input type="radio" fc-enter="vm.reloadData()" ng-model="vm.filter.date" value="Create" tabindex="1">\r\n                                Create Date\r\n                            </label>\r\n                        </li>\r\n                        <li>\r\n                            <label>\r\n                                <input type="radio" fc-enter="vm.reloadData()" ng-model="vm.filter.date" value="Expire" tabindex="2">\r\n                                Expire Date\r\n                            </label>\r\n                        </li>\r\n                    </ul>\r\n                </div>\r\n            </div>\r\n            \r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group datepicker-div" fc-enter="vm.reloadData()">\r\n                    <label class="control-label  col-sm-3 col-md-4 col-lg-3">Start Date</label>\r\n                    <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                        \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                        \x3c!-- <input tabindex="3" name="From Date" type="datetime" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" date-time="" ng-model="vm.filter.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                        <input onpaste="return false;" restrict-to="{{vm.dateService.restrictToDate()}}" tabindex="3" name="From Date" type="datetime" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" date-time="" ng-model="vm.filter.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                        \x3c!-- BUG87 : END --\x3e\r\n                        <span class="input-group-addon btn btn-white">\r\n                            <span class="glyphicon glyphicon-calendar"></span>\r\n                        </span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n                        \r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group datepicker-div" fc-enter="vm.reloadData()">\r\n                    <label class="control-label  col-sm-3 col-md-4 col-lg-3">End Date</label>\r\n                    <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                        \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                        \x3c!-- <input tabindex="4" name="To Date" type="datetime" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" date-time="" ng-model="vm.filter.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                        <input onpaste="return false;" restrict-to="{{vm.dateService.restrictToDate()}}" tabindex="4" name="To Date" type="datetime" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" date-time="" ng-model="vm.filter.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                        \x3c!-- BUG87 : END --\x3e\r\n                        <span class="input-group-addon btn btn-white">\r\n                            <span class="glyphicon glyphicon-calendar"></span>\r\n                        </span>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n           \r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group">\r\n                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Search</label>\r\n                    <div class="col-sm-7 col-md-6 col-lg-5" fc-enter="vm.reloadData()">\r\n                        <input type="text" fc-enter="vm.reloadData()" tabindex="5" placeholder="Search" class="form-control" ng-model="vm.filter.search">\r\n                    </div>\r\n                </div> \x3c!-- form group --\x3e\r\n\r\n            </div>\r\n\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group">\r\n                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Quote Id</label>\r\n                    <div class="col-sm-7 col-md-6 col-lg-5" fc-enter="vm.reloadData()">\r\n                        \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                        \x3c!-- <input type="number" decimal decimals="0" fc-enter="vm.reloadData()" tabindex="6" class="form-control" ng-model="vm.filter.altId"> --\x3e\r\n                        <input type="number" onwheel="this.blur()" decimal decimals="0" fc-enter="vm.reloadData()" tabindex="6" class="form-control" ng-model="vm.filter.altId">\r\n                        \x3c!-- BUG32 : END --\x3e\r\n                    </div>\r\n                </div> \x3c!-- form group --\x3e\r\n\r\n            </div>\r\n           \r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group ">\r\n                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Status</label>\r\n                    <div class="col-sm-7 col-md-6 col-lg-5">\r\n                        <fc-multiselect on-enter="vm.reloadData()" value="vm.filter.quotestatusIds" api-method="quotestatuses" value-prop="Id" text-prop="Status" fc-tabindex="7"></fc-multiselect>\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group">\r\n                    <label class="col-sm-3 col-md-4 col-lg-3 control-label">Priority</label>\r\n                    <div class="col-sm-7 col-md-6 col-lg-5">\r\n                        \x3c!-- US2587 : FCO - Web - Consolidate Quote Priority to WO Priority reference table. --\x3e\r\n                        \x3c!-- <fc-multiselect on-enter="vm.reloadData()" value="vm.filter.priortyIds" api-method="quotepriority" value-prop="Id" text-prop="Priority" fc-tabindex="8"></fc-multiselect> --\x3e\r\n                        <fc-multiselect on-enter="vm.reloadData()" value="vm.filter.priortyIds" api-method="priorities" value-prop="Id" text-prop="PriorityName" fc-tabindex="8"></fc-multiselect>\r\n                        \x3c!-- US2587 : END --\x3e\r\n                    </div> \x3c!-- input box --\x3e\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n            <div class="form-group">\r\n                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                    <button type="submit" tabindex="9" class="btn btn-primary" ng-click="vm.reloadData()">Search</button>\r\n                </div>  \x3c!--input box--\x3e\r\n            </div>\r\n        </div>\x3c!-- Collapsible section end --\x3e\r\n        <div class="row" id="projectTable">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <fc-table api-method="quotes"\r\n                                  attributes="vm.attributestab"\r\n                                  on-edit="vm.edit(id, item)"\r\n                                  filter="vm.autoFilter"\r\n                                  show-delete-column="false"\r\n                                  show-add-new="false"\r\n                                  view-name="{{vm.viewName}}"\r\n                                  ng-if="vm.loadData"\r\n                                  module-name="{{vm.moduleName}}">\r\n                        </fc-table>\r\n                    </div>\x3c!-- content   --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n    \r\n</div>\r\n'),e.put("Templates/Quote/quoteEdit.html",'<div id="pcont" class="container-fluid" ng-controller="QuoteEditController as vm">\r\n    <div class="table-edit-overlay" ng-show="vm.isLoading">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'manageQuote\')">Manage Quotes</a></li>\r\n            <li class="active">Quote</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1 ng-show="!vm.id">New Quote</h1>\r\n        <h1 ng-show="vm.id">Quote Details</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div ng-if="vm.getModulePrivilege(vm.viewName, vm.moduleName) != 0">\r\n            <div class="row" style="color: #5e94ff">\r\n                <div class="col-md-6">\r\n                    <h2 ng-show="vm.id">Quote {{vm.model.AltId}}</h2>\r\n                    <h2 ng-show="!vm.id">Quote</h2>\r\n                </div>\r\n                <div class="col-md-5" ng-show="vm.altNumber !== 0">\r\n                    \x3c!-- US3539 : FCO - WEB - Navigation links UI improvement (FCWO-2368) --\x3e\r\n                    <button type="button" data-dismiss="modal" class="pull-right btn btn-primary btn-flat md-close" ng-click="vm.$state.go(\'quoteDetails\',{ id: vm.quoteNumber })">Open Quote {{vm.altNumber}}</button>\r\n                    \x3c!--<a class="pull-right cursor_pointer" ng-click="vm.$state.go(\'quoteDetails\',{ id: vm.quoteNumber })">Open Quote {{vm.altNumber}}</a>--\x3e\r\n                    \x3c!-- end --\x3e\r\n                </div>\r\n                \x3c!-- US2610 : FCO - Web - Display link to converted work order in quote detail --\x3e\r\n                \x3c!-- <div class="col-md-5" ng-if="vm.woId && !vm.isOnlyTech"> --\x3e\r\n                <div class="col-md-5" ng-if="vm.woId">\r\n                    \x3c!-- US3539 : FCO - WEB - Navigation links UI improvement (FCWO-2368) --\x3e\r\n                    \x3c!-- US2610 : FCO - Web - Display link to converted work order in quote detail --\x3e\r\n                    \x3c!--<a class="pull-right cursor_pointer" ng-click="vm.openWo()">Work Order {{vm.woAltId}}</a>--\x3e\r\n                    <button type="button" ng-disabled="vm.userRole == \'Technician\'" data-dismiss="modal" class="pull-right btn btn-primary btn-flat md-close" ng-click="vm.openWo()">Work Order {{vm.woAltId}}</button>\r\n                    \x3c!-- end --\x3e\r\n                </div>\r\n            </div>\r\n            \x3c!-- PBI639 : FCO - Quotes - Parts and Miscellaneous --\x3e\r\n            \x3c!-- <fc-table-edit api-method="quotes" --\x3e\r\n            <fc-table-edit api-method="{{vm.apiMethod}}"\r\n                           model="vm.model"\r\n                           id="{{vm.id}}"\r\n                           ng-if="vm.reloadTable"\r\n                           on-back="vm.submit(insertData)"\r\n                           attributes="vm.attributes"\r\n                           custom-focus="vm.focusOut(attribute)"\r\n                           view-name="{{vm.viewName}}"\r\n                           module-name="{{vm.moduleName}}"\r\n                           disable-submit="!vm.notreadOnlySubmit"\r\n                           win-position="vm.windowPos()"\r\n                           set-position="vm.setWindowPosition">\r\n            </fc-table-edit>\r\n        </div>\r\n        <div class="row form-horizontal" ng-if="vm.id">\r\n            <div class="col-md-12">\r\n                <div id="accordion" class="panel-group accordion">\r\n                    <div ng-if="vm.initialiseApprovall">\r\n                        <div ng-controller="QuoteApprovalController as qa">\r\n                            <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, qa.moduleName) !=0">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'approvalsGrid\')">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne" aria-expanded="false" class="collapsed">Approvals<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseOne" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div class="panel-body" ng-if="vm.approvalsGrid">\r\n                                        <div class="block-flat">\r\n                                            <div class="content">\r\n                                                <div>\r\n                                                    <fc-table api-method="quoteapprovals"\r\n                                                              attributes="qa.attributes"\r\n                                                              filter="qa.autoFilter"\r\n                                                              ng-if="qa.reloadTable"\r\n                                                              table-name="QuoteApprovals"\r\n                                                              timezone="vm.quoteTimezone"\r\n                                                              list="qa.list"\r\n                                                              show-delete-column="false"\r\n                                                              show-search="false"\r\n                                                              show-add-new="false"\r\n                                                              show-pagination="false">\r\n                                                    </fc-table>\r\n                                                </div>\r\n                                                <div>\r\n                                                    <button type="button" class="btn btn-default pull-right" ng-click="qa.continue()" ng-disabled="!qa.cancontinue">Continue</button>\r\n                                                    <button type="button" class="btn btn-default pull-right" ng-click="qa.cancel()" ng-disabled="!qa.cancancel">Cancel</button>\r\n                                                    <button type="button" class="btn btn-default pull-right" ng-click="qa.reopen()" ng-disabled="!qa.canreopen">Reopen</button>\r\n                                                </div>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel default --\x3e\r\n                        </div>\x3c!-- controller --\x3e\r\n                    </div>\r\n\r\n                    <div ng-controller="QuoteNoteController as qn">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, qn.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'notesGrid\')">\r\n                                <h4 class="panel-title">\r\n                                    <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo" class="collapsed" aria-expanded="false">\r\n                                        Notes\r\n                                        <span ng-show="(qn.getQuoteNoteLength())"> - Quote notes exist</span>\r\n                                        <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                    </a>\r\n                                </h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseTwo" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.reloadNotesPanel">\r\n                                    <fc-tabs tab="vm.filterNotesTab">\r\n                                        <div fc-tab="Quote Notes">\r\n                                            <fc-table table-name="Quote Note"\r\n                                                      api-method="quotenotes"\r\n                                                      attributes="qn.attributes"\r\n                                                      on-edit="qn.editNote(id, vm.id)"\r\n                                                      filter="vm.filterByQuote"\r\n                                                      ng-if="qn.reloadTable"\r\n                                                      delete-event="qn.checkChildItems()"\r\n                                                      delete-message-format="Are you sure you want to delete notes  %Note% ?"\r\n                                                      rows-count="qn.quoteNotesCount"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{qn.moduleName}}"\r\n                                                      show-delete-column="vm.notreadOnlyNote"\r\n                                                      show-add-new="vm.notreadOnlyNote">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                        \x3c!-- PBI1098 : FCO - Deficiency loop (pull through work) --\x3e\r\n                                        <div fc-tab="Deficiency Notes" fc-hide="{{vm.hideDefiencyTab}}">\r\n                                            <fc-table table-name="Deficiency Notes"\r\n                                                      api-method="deficiencyNote"\r\n                                                      attributes="vm.deficiencyNoteAttributesGrid"\r\n                                                      filter="vm.deficiencyFilter"\r\n                                                      show-delete-column="false"\r\n                                                      show-add-new="false"\r\n                                                      ng-if="vm.showDeficiencyGrid"></fc-table>\r\n                                        </div>\r\n                                    </fc-tabs>\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="QuoteLaborController as ql">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, ql.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'laborGrid\')">\r\n                                <h4 class="panel-title">\r\n                                    <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTree" class="collapsed" aria-expanded="false">\r\n                                        Labor\r\n                                        <span ng-show="(ql.getQuoteLaborLength())"> - Quote labors exist</span>\r\n                                        <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                    </a>\r\n                                </h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseTree" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body">\r\n                                    \x3c!-- PBI639 : FCO - Quotes - Parts and Miscellaneous --\x3e\r\n                                    \x3c!-- api-method="quotelabors" --\x3e\r\n                                    <fc-table table-name="Quote Labor"\r\n                                              api-method="{{ql.apiMethod}}"\r\n                                              attributes="ql.attributes"\r\n                                              on-edit="ql.edit(id, vm.id, vm.filter1.rateSheetId)"\r\n                                              filter="vm.filterByQuote"\r\n                                              ng-if="ql.reloadTable"\r\n                                              delete-event="ql.emitEvent()"\r\n                                              delete-message-format="Are you sure that you want to delete the labor  %LaborCodeName% ?"\r\n                                              rows-count="qn.quoteLaborsCount"\r\n                                              view-name="{{vm.viewName}}"\r\n                                              module-name="{{ql.moduleName}}"\r\n                                              show-delete-column="vm.notreadOnlyLabor"\r\n                                              show-add-new="vm.notreadOnlyLabor">\r\n                                    </fc-table>\r\n\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="QuotePartsController as part">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, part.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseFour" class="collapsed" aria-expanded="false">Parts<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseFour" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body">\r\n                                    <div class="block-flat">\r\n                                        <div id="partsFilter" class="content">\r\n                                            \x3c!-- PBI639 : FCO - Quotes - Parts and Miscellaneous --\x3e\r\n                                            \x3c!-- <fc-table api-method="quoteitems" --\x3e\r\n                                            <fc-table api-method="{{part.apiMethod}}"\r\n                                                      attributes="part.attributes"\r\n                                                      on-edit="part.editParts(id, vm.id)"\r\n                                                      filter="vm.filterPartsByQuote"\r\n                                                      table-name="Parts"\r\n                                                      ng-if="part.reloadTable"\r\n                                                      delete-message-format="Are you sure you want to delete the Parts  %ItemName% ?"\r\n                                                      delete-event="part.emitEvent()"\r\n                                                      view-name="{{part.viewName}}"\r\n                                                      module-name="{{part.moduleName}}"\r\n                                                      show-delete-column="vm.notreadOnlyParts"\r\n                                                      show-add-new="vm.notreadOnlyParts">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="QuoteMiscController as misc">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, misc.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseFive" class="collapsed" aria-expanded="false">Miscellaneous<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseFive" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body">\r\n                                    <div class="block-flat">\r\n                                        <div id="miscFilter" class="content">\r\n                                            \x3c!-- PBI639 : FCO - Quotes - Parts and Miscellaneous --\x3e\r\n                                            \x3c!-- <fc-table api-method="quoteitems" --\x3e\r\n                                            <fc-table api-method="{{misc.apiMethod}}"\r\n                                                      attributes="misc.attributes"\r\n                                                      on-edit="misc.editMisc(id, vm.id)"\r\n                                                      filter="vm.filterMiscByQuote"\r\n                                                      table-name="Miscellaneous "\r\n                                                      ng-if="misc.reloadTable"\r\n                                                      delete-message-format="Are you sure you want to delete the Miscellaneous  %ItemName% ?"\r\n                                                      delete-event="misc.emitEvent()"\r\n                                                      view-name="{{misc.viewName}}"\r\n                                                      module-name="{{misc.moduleName}}"\r\n                                                      show-delete-column="vm.notreadOnlyMisc"\r\n                                                      show-add-new="vm.notreadOnlyMisc">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- US2647 : FCO - Web - Quotes Attachments --\x3e\r\n\r\n                    <div ng-controller="QuoteAttachmentController as quoteatt">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, quoteatt.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'attachmentsGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseEight" class="collapsed" aria-expanded="false">Attachments<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseEight" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.attachmentsGrid">\r\n                                    <div class="block-flat" ng-init=\'content="quote"\'>\r\n                                        <div class="content" ng-show="content == \'quote\'">\r\n                                            <fc-tabs tab="vm.filterAttachmentsTab">\r\n                                                <div fc-tab="Quote Attachments">\r\n                                                    <fc-table api-method="quoteattachments"\r\n                                                              attributes="quoteatt.attributesQuoteatt"\r\n                                                              on-edit="quoteatt.editQuoteAttachment(id, vm.id)"\r\n                                                              filter="vm.filterByQuote"\r\n                                                              ng-if="quoteatt.reloadTable"\r\n                                                              table-name="Quote Attachments"\r\n                                                              delete-message-format="Are you sure that you want to delete %AttachmentName%?"\r\n                                                              delete-event="quoteatt.deleteEvent()"\r\n                                                              view-name="{{quoteatt.viewName}}"\r\n                                                              module-name="{{quoteatt.moduleName}}" ,\r\n                                                              show-delete-column="vm.notreadOnlyAttachments"\r\n                                                              show-add-new="vm.notreadOnlyAttachments">\r\n                                                    </fc-table>\r\n                                                </div>\r\n                                                \x3c!-- PBI1098 : FCO - Deficiency loop (pull through work) --\x3e\r\n                                                <div fc-tab="Deficiency Attachments" fc-hide="{{vm.hideDefiencyTab}}">\r\n                                                    <fc-table table-name="Deficiency Attachments"\r\n                                                              api-method="deficiencyAttachment"\r\n                                                              attributes="vm.deficiencyAttachmentAttributesGrid"\r\n                                                              filter="vm.deficiencyFilter"\r\n                                                              show-delete-column="false"\r\n                                                              show-add-new="false"\r\n                                                              ng-if="vm.showDeficiencyGrid"></fc-table>\r\n                                                </div>\r\n                                            </fc-tabs>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="QuoteReportController as quoteservrpts">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, quoteservrpts.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'serveportGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseSeven" class="collapsed" aria-expanded="false">Quote  Reports<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseSeven" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.serveportGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content" id="service-report">\r\n                                            <fc-table api-method="quotereports"\r\n                                                      attributes="quoteservrpts.attributes"\r\n                                                      on-edit="quoteservrpts.editServiceReport(id, vm.id)"\r\n                                                      filter="vm.filterByQuote"\r\n                                                      table-name="ServiceReports"\r\n                                                      ng-if="quoteservrpts.reloadTable"\r\n                                                      delete-event="quoteservrpts.deleteEvent()"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{quoteservrpts.moduleName}}"\r\n                                                      delete-message-format="Are you sure you want to delete %FileName%?"\r\n                                                      show-delete-column="vm.notreadOnlyReport">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                </div>\x3c!-- accordion --\x3e\r\n            </div> \x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/AssigmentStatus/assigmentStatusEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="AssignmentStatusEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'assigmentStatusesTable\')">Assignment Status</a></li>\r\n            <li class="active">{{vm.model.AssignmentStatusName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Assignment Status</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="assignmentstatuses" id="{{vm.id}}" model="vm.model" on-back="vm.$state.go(\'assigmentStatusesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/AssigmentStatus/assigmentStatusTable.html",'<div id="pcont" class="container-fluid" ng-controller="AssignmentStatusController as vm">\r\n    <fc-reference-table\r\n        table-name="Assignment Status"\r\n        api-method="assignmentstatuses"\r\n        attributes="vm.attributes"\r\n        on-edit="vm.edit(id)"\r\n        ></fc-reference-table>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/AssignmentStatusColor/assignmentStatusColorEdit.html",'<div id="pcont" class="container-fluid" ng-controller="AssignmentStatusColorEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'assignmentStatusColorsTable\')">Assignment Status Color</a></li>\r\n            <li class="active">Assignment Status Color</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Assignment Status Color</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="assignmentstatuscolors" id="{{vm.id}}" on-back="vm.$state.go(\'assignmentStatusColorsTable\')" attributes="vm.attributes"></fc-table-edit>\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/AssignmentStatusColor/assignmentStatusColorTable.html",'<div id="pcont" class="container-fluid" ng-controller="AssignmentStatusColorController as vm">\r\n    <fc-reference-table table-name="Assignment Status Color"\r\n                        api-method="assignmentstatuscolors"\r\n                        attributes="vm.attributes"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/AttachmentCategory/attachmentCategoryEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="AttachmentCategoryEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.goHome()">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goBack()">Attachment Category</a></li>\r\n            <li class="active">Attachment Category</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Attachment Category</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <form ng-submit="vm.submit()">\r\n        <div class="row  form-horizontal">\r\n\r\n\r\n            <div class="row  form-horizontal">\r\n              <div class="col-sm-6 col-md-6">\r\n\r\n                    <div class="form-group">\r\n                        <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Attachment Category:</label>\r\n                        <div class="col-sm-9 col-md-8 col-lg-7">\r\n                            <input id="" maxlength="20" type="text" required  parsley-type="" ng-model="vm.AttachmentCategoryName" class="form-control">\r\n                            \r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n                </div> \x3c!-- columns --\x3e\r\n\r\n                <div class="col-sm-6 col-md-6">\r\n\r\n                    <div class="form-group">\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">                           \r\n                            <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                            <button type="submit" class="btn btn-primary"  value="Submit">Submit</button>\r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n\r\n                </div> \x3c!-- columns --\x3e\r\n            </div>\x3c!-- row --\x3e\r\n\r\n\r\n        </div>\x3c!-- content --\x3e\r\n            </form>\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/AttachmentCategory/attachmentCategoryTable.html",'<div id="pcont" class="container-fluid" ng-controller="AttachmentCategoryController as vm">\r\n    <fc-reference-table table-name="AttachmentCategory"\r\n                        attributes="vm.attributes"\r\n                        api-method="attachmentCategories"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/AttachmentType/attachmentTypeEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="AttachmentTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'attachmentTypesTable\')">Attachment Type</a></li>\r\n            <li class="active">{{vm.model.AttachmentTypeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Attachment Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="attachmentTypes" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'attachmentTypesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n                        <div class="form-group">\r\n                            <label for=" " class="co3-sm-3 col-md-3 col-lg-3 control-label">Attachment Category:</label>\r\n                            <div class="col-sm-3 col-md-3 col-lg-3 control-label">\r\n                                \r\n                                <fc-dropdown value="vm.AttachmentCategory" api-method="attachmentCategories" value-prop="Id" text-prop="AttachmentCategoryName" />\r\n                            </div> \r\n                            <label for=" " class="col-sm-3 col-md-3 col-lg-3 control-label">Attachment Type:</label>\r\n                            <div class="col-sm-3 col-md-3 col-lg-3">\r\n                                <input id="" type="text" required="" parsley-type="" ng-model="vm.AttachmentTypeName" class="form-control">\r\n                            </div> \r\n                        </div> \r\n                    </div>\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/AttachmentType/attachmentTypeTable.html",'<div id="pcont" class="container-fluid" ng-controller="AttachmentTypeController as vm">\r\n    <fc-reference-table table-name="Attachment Type"\r\n                        attributes="vm.attributes"\r\n                        api-method="attachmentTypes"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/BillingPeriod/billingPeriodEdit.html",'<div id="pcont" class="container-fluid" ng-controller="BillingPeriodEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'billingPeriodsTable\')">Billing Period</a></li>\r\n            <li class="active">{{vm.model.BillingPeriodName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Billing Period</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="billingperiods" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'billingPeriodsTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Billing Period:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="20" type="text" required parsley-type="" ng-model="vm.BillingPeriodName" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div>\r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/BillingPeriod/billingPeriodTable.html",'<div id="pcont" class="container-fluid" ng-controller="BillingPeriodController as vm">\r\n    <fc-reference-table table-name="Billing Period"\r\n                        attributes="vm.attributes"\r\n                        api-method="billingperiods"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/BillingType/billingTypeEdit.html",'<div id="pcont" class="container-fluid" ng-controller="BillingTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'billingTypesTable\')">Billing Type</a></li>\r\n            <li class="active">{{vm.model.BillingTypeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Billing Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="billingtypes" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'billingTypesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Billing Type:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="20" type="text" required parsley-type="" ng-model="vm.BillingTypeName" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/BillingType/billingTypeTable.html",'<div id="pcont" class="container-fluid" ng-controller="BillingTypeController as vm">\r\n    <fc-reference-table table-name="Billing Type"\r\n                        attributes="vm.attributes"\r\n                        api-method="billingtypes"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Cause/causeTable.html",'<div id="pcont" class="container-fluid" ng-controller="CauseController as vm">\r\n    <fc-reference-table table-name="Cause"\r\n                        attributes="vm.attributes"\r\n                        api-method="causes"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Cause/causeTableEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="CauseEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'causesTable\')">Cause</a></li>\r\n            <li class="active">{{vm.model.CauseName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Cause</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="causes" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'causesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n        <div class="row  form-horizontal">\r\n\r\n\r\n            <div class="row  form-horizontal">\r\n                <div class="col-sm-6 col-md-6">\r\n\r\n                    <div class="form-group">\r\n                        <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Cause:</label>\r\n                        <div class="col-sm-9 col-md-8 col-lg-7">\r\n                            <input id="" type="text" maxlength="50" required="" parsley-type="" ng-model="vm.CauseName" class="form-control">\r\n\r\n                        </div> \r\n                    </div> \r\n\r\n                </div>\r\n            \r\n                <div class="col-sm-6 col-md-6">\r\n\r\n                    <div class="form-group">\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                           \r\n                            <button class="btn btn-default" ng-click="vm.goToBack()">Cancel</button>\r\n                            <button type="submit" class="btn btn-primary">Submit</button>\r\n                        </div>\r\n                    </div> \r\n\r\n                </div> \r\n            </div>\r\n\r\n\r\n        </div>\r\n            </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Country/countriesTable.html",'<div id="pcont" class="container-fluid" ng-controller="CountryController as vm">\r\n    <fc-reference-table table-name="Country"\r\n                        attributes="vm.attributes"\r\n                        api-method="countries"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/Country/countriesTableEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="CountryEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'countriesTable\')">Country</a></li>\r\n            <li class="active">{{vm.model.CountryName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Country Table Form  </h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="countries" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'countriesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Country Name:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="50" type="text" required parsley-type="" ng-model="vm.CountryName" class="form-control">\r\n\r\n                            </div>\r\n                        </div> \r\n\r\n                    </div> <\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Country ISO Code:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n\r\n                                <input id="" maxlength="5" type="text" required parsley-type="" ng-model="vm.CountryISOCode" class="form-control">\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                    <div class="col-sm-6 col-md-6">\r\n                    </div>\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                               \r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" >Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n            </form>--\x3e\r\n</div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Currency/currencyTable.html",'<div id="pcont" class="container-fluid" ng-controller="CurrencyController as vm">\r\n    <fc-reference-table table-name="Currency"\r\n                        attributes="vm.attributes"\r\n                        api-method="currencies"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/Currency/currencyTableEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="CurrencyEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'currenciesTable\')">Currency</a></li>\r\n            <li class="active">{{vm.model.CurrencyCode}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Currency</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="currencies" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'currenciesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/DSLNorthwest/dslActionTakenEdit.html",'\x3c!-- PBI534 : DSL - Add additional reference tables --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLActionTakenEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dslActionTakenTable\')">Action Taken</a></li>\r\n            <li class="active">{{vm.model.Code}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Action Taken</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dslActionTaken"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dslActionTakenTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslActionTakenTable.html",'\x3c!-- PBI534 : DSL - Add additional reference tables --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLActionTakenController as vm">\r\n    <fc-reference-table table-name="Action Taken"\r\n                        attributes="vm.attributes"\r\n                        api-method="dslActionTaken"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslApplicableCodeEdit.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLApplicableCodeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            \x3c!-- PBI636 : DSL - Edit field names in labor/parts/misc --\x3e\r\n            \x3c!-- <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dslApplicableCodeTable\')">Applicable Code</a></li> --\x3e\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dslApplicableCodeTable\')">Applicable Zone</a></li>\r\n            <li class="active">{{vm.model.Code}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        \x3c!-- PBI636 : DSL - Edit field names in labor/parts/misc --\x3e\r\n        \x3c!-- <h1>Applicable Code</h1> --\x3e\r\n        <h1>Applicable Zone</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dslApplicableCode"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dslApplicableCodeTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/DSLNorthwest/dslApplicableCodeTable.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLApplicableCodeController as vm">\r\n    \x3c!-- PBI636 : DSL - Edit field names in labor/parts/misc --\x3e\r\n    \x3c!-- <fc-reference-table table-name="Applicable Code" --\x3e\r\n    <fc-reference-table table-name="Applicable Zone"\r\n                        attributes="vm.attributes"\r\n                        api-method="DSLApplicableCode"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslDistributorEdit.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLDistributorEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dslServiceZoneCodeTable\')">Distributor</a></li>\r\n            <li class="active">{{vm.model.Code}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Distributor</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dslDistributor"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dslDistributorTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslDistributorTable.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLDistributorController as vm">\r\n    <fc-reference-table table-name="Distributor"\r\n                        attributes="vm.attributes"\r\n                        api-method="DSLDistributor"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslFailureResolutionEdit.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLFailureResolutionEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dslFailureResolutionTable\')">Failure Resolution</a></li>\r\n            <li class="active">{{vm.model.Code}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Failure Resolution</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dslFailureResolution"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dslFailureResolutionTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/DSLNorthwest/dslFailureResolutionTable.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLFailureResolutionController as vm">\r\n    <fc-reference-table table-name="Failure Resolution"\r\n                        attributes="vm.attributes"\r\n                        api-method="DSLFailureResolution"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslFaultAreasEdit.html",'\x3c!-- PBI534 : DSL - Add additional reference tables --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLFaultAreasEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            \x3c!-- PBI636 : DSL - Edit field names in labor/parts/misc --\x3e\r\n            \x3c!-- <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dslFaultAreasTable\')">Fault Areas</a></li> --\x3e\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dslFaultAreasTable\')">Trouble Found</a></li>\r\n            <li class="active">{{vm.model.Code}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        \x3c!-- PBI636 : DSL - Edit field names in labor/parts/misc --\x3e\r\n        \x3c!-- <h1>Fault Areas</h1> --\x3e\r\n        <h1>Trouble Found</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dslFaultAreas"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dslFaultAreasTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslFaultAreasTable.html",'\x3c!-- PBI534 : DSL - Add additional reference tables --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLFaultAreasController as vm">\r\n    \x3c!-- PBI636 : DSL - Edit field names in labor/parts/misc --\x3e\r\n    \x3c!-- <fc-reference-table table-name="Fault Areas" --\x3e\r\n    <fc-reference-table table-name="Trouble Found"\r\n                        attributes="vm.attributes"\r\n                        api-method="dslFaultAreas"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslInstalledRemovedEdit.html",'\x3c!-- PBI534 : DSL - Add additional reference tables --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLInstalledRemovedEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dslInstalledRemovedTable\')">Installed Removed</a></li>\r\n            <li class="active">{{vm.model.Code}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Installed Removed</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dslInstalledRemoved"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dslInstalledRemovedTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslInstalledRemovedTable.html",'\x3c!-- PBI534 : DSL - Add additional reference tables --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLInstalledRemovedController as vm">\r\n    <fc-reference-table table-name="Installed Removed"\r\n                        attributes="vm.attributes"\r\n                        api-method="dslInstalledRemoved"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslInventoryPostingGroupEdit.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLInventoryPostingGroupEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dslInventoryPostingGroupTable\')">Inventory Posting Group</a></li>\r\n            <li class="active">{{vm.model.Code}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Inventory Posting Group</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dslInventoryPostingGroup"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dslInventoryPostingGroupTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslInventoryPostingGroupTable.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLInventoryPostingGroupController as vm">\r\n    <fc-reference-table table-name="Inventory Posting Group"\r\n                        attributes="vm.attributes"\r\n                        api-method="DSLInventoryPostingGroup"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslPartsReceivedEdit.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLPartsReceivedEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dslPartsReceivedTable\')">Parts Received</a></li>\r\n            <li class="active">{{vm.model.Code}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Parts Received</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dslPartsReceived"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dslPartsReceivedTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/DSLNorthwest/dslPartsReceivedTable.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLPartsReceivedController as vm">\r\n    <fc-reference-table table-name="Parts Received"\r\n                        attributes="vm.attributes"\r\n                        api-method="DSLPartsReceived"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslRecallDueToEdit.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLRecallDueToEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dslRecallDueToTable\')">Recall Due To</a></li>\r\n            <li class="active">{{vm.model.Code}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Recall Due To</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dslRecallDueTo"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dslRecallDueToTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/DSLNorthwest/dslRecallDueToTable.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLRecallDueToController as vm">\r\n    <fc-reference-table table-name="Recall Due To"\r\n                        attributes="vm.attributes"\r\n                        api-method="DSLRecallDueTo"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslServiceOrderTypeEdit.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLServiceOrderTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dslServiceOrderTypeTable\')">Service Order Type</a></li>\r\n            <li class="active">{{vm.model.Code}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Service Order Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dslServiceOrderType"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dslServiceOrderTypeTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/DSLNorthwest/dslServiceOrderTypeTable.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLServiceOrderTypeController as vm">\r\n    <fc-reference-table table-name="Service Order Type"\r\n                        attributes="vm.attributes"\r\n                        api-method="DSLServiceOrderType"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslServiceZoneCodeEdit.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLServiceZoneCodeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dslServiceZoneCodeTable\')">Service Zone Code</a></li>\r\n            <li class="active">{{vm.model.Code}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Service Zone Code</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dslServiceZoneCode"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dslServiceZoneCodeTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/DSLNorthwest/dslServiceZoneCodeTable.html",'\x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLServiceZoneCodeController as vm">\r\n    <fc-reference-table table-name="Service Zone Code"\r\n                        attributes="vm.attributes"\r\n                        api-method="DSLServiceZoneCode"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslServiceZoneLaborCodeEdit.html",'\x3c!-- PBI471 : Service Zone Code to Labor Code Mapping --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLServiceZoneLaborCodeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dslServiceZoneLaborCodeTable\')">Labor Code by Service Zone</a></li>\r\n            <li class="active">{{vm.model.Code}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Labor Code by Service Zone</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dslLaborCodeByServiceZoneCode"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dslServiceZoneLaborCodeTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/ReferenceTables/DSLNorthwest/dslServiceZoneLaborCodeTable.html",'\x3c!-- PBI471 : Service Zone Code to Labor Code Mapping --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLServiceZoneLaborCodeController as vm">\r\n    <fc-reference-table table-name="Labor Code by Service Zone"\r\n                        attributes="vm.attributes"\r\n                        api-method="dslLaborCodeByServiceZoneCode"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslWhoPaysEdit.html",'\x3c!-- PBI534 : DSL - Add additional reference tables --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLWhoPaysEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dslWhoPaysTable\')">Who Pays</a></li>\r\n            <li class="active">{{vm.model.Code}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Who Pays</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dslWhoPays"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dslWhoPaysTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DSLNorthwest/dslWhoPaysTable.html",'\x3c!-- PBI534 : DSL - Add additional reference tables --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="DSLWhoPaysController as vm">\r\n    <fc-reference-table table-name="Who Pays"\r\n                        attributes="vm.attributes"\r\n                        api-method="dslWhoPays"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DashboardChartType/dashboardChartTypeEdit.html",'\x3c!-- PBI623 - TASK627 : FCO web ui: Dashboards --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dashboardChartTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dashboardChartTypeTable\')">Dashboard Chart Type</a></li>\r\n            <li class="active">{{vm.model.Identifier}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Dashboard Chart Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dashboardChartType"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dashboardChartTypeTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DashboardChartType/dashboardChartTypeTable.html",'\x3c!-- PBI623 - TASK627 : FCO web ui: Dashboards --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dashboardChartTypeController as vm">\r\n    <fc-reference-table table-name="Dashboard Chart Type"\r\n                        attributes="vm.attributes"\r\n                        api-method="dashboardChartType"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DashboardConfigDDList/dashboardConfigDDListEdit.html",'\x3c!-- PBI623 - TASK627 : FCO web ui: Dashboards --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dashboardConfigDDListEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dashboardConfigDDListTable\')">Dashboard Chart Configuration DDList</a></li>\r\n            <li class="active">{{vm.model.Identifier}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Dashboard Chart Configuration DDList</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dashboardConfigDDList"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dashboardConfigDDListTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DashboardConfigDDList/dashboardConfigDDListTable.html",'\x3c!-- PBI623 - TASK627 : FCO web ui: Dashboards --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dashboardConfigDDListController as vm">\r\n    <fc-reference-table table-name="Dashboard Chart Configuration DDList"\r\n                        attributes="vm.attributes"\r\n                        api-method="dashboardConfigDDList"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DashboardFilterDDList/dashboardFilterDDListEdit.html",'\x3c!-- PBI623 - TASK627 : FCO web ui: Dashboards --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dashboardFilterDDListEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dashboardFilterDDListTable\')">Dashboard Filter DDList</a></li>\r\n            <li class="active">{{vm.model.Identifier}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Dashboard Filter DDList</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dashboardFilterDDList"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dashboardFilterDDListTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DashboardFilterDDList/dashboardFilterDDListTable.html",'\x3c!-- PBI623 - TASK627 : FCO web ui: Dashboards --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dashboardFilterDDListController as vm">\r\n    <fc-reference-table table-name="Dashboard Filter DDList"\r\n                        attributes="vm.attributes"\r\n                        api-method="dashboardFilterDDList"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DashboardReportType/dashboardReportTypeEdit.html",'\x3c!-- PBI623 - TASK627 : FCO web ui: Dashboards --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dashboardReportTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dashboardReportTypeTable\')">Dashboard Report Type</a></li>\r\n            <li class="active">{{vm.model.Identifier}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Dashboard Report Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dashboardReportType"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dashboardReportTypeTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DashboardReportType/dashboardReportTypeTable.html",'\x3c!-- PBI623 - TASK627 : FCO web ui: Dashboards --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dashboardReportTypeController as vm">\r\n    <fc-reference-table table-name="Dashboard Report Type"\r\n                        attributes="vm.attributes"\r\n                        api-method="dashboardReportType"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DefaultDispatchCalendarSettings/defaultDispatchCalendarSettingsEdit.html",'\x3c!-- PBI623 - TASK628 : FCO web ui: Dispatch Calendar --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="defaultDispatchCalendarSettingsEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dispatchCalendarThemesTable\')">Default Dispatch Calendar Settings</a></li>\r\n            <li class="active">{{vm.model.Identifier}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Default Dispatch Calendar Settings</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="defaultDispatchCalendarSettings"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'defaultDispatchCalendarSettingsTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DefaultDispatchCalendarSettings/defaultDispatchCalendarSettingsTable.html",'\x3c!-- PBI623 - TASK628 : FCO web ui: Dispatch Calendar --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="defaultDispatchCalendarSettingsController as vm">\r\n    <fc-reference-table table-name="Default Dispatch Calendar Settings"\r\n                        attributes="vm.attributes"\r\n                        api-method="defaultDispatchCalendarSettings"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DefaultStartPage/defaultStartPageEdit.html",'\x3c!-- PBI825 : FCO - Default start page --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="defaultStartPageEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'defaultStartPageTable\')">Default Start Page</a></li>\r\n            <li class="active">{{vm.model.Identifier}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Default Start Page</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="defaultStartPage"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'defaultStartPageTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DefaultStartPage/defaultStartPageTable.html",'\x3c!-- PBI825 : FCO - Default start page --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="defaultStartPageController as vm">\r\n    <fc-reference-table table-name="Default Start Page"\r\n                        attributes="vm.attributes"\r\n                        api-method="defaultStartPage"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DeficiencySeverity/deficiencySeverityEdit.html",'\x3c!-- PBI1098 : FCO - Deficiency loop (pull through work) --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="deficiencySeverityEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'deficiencyStatusTable\')">Deficiency Severity</a></li>\r\n            <li class="active">{{vm.model.Identifier}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Deficiency Severity Edit</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="deficiencySeverity"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'deficiencySeverityTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DeficiencySeverity/deficiencySeverityTable.html",'\x3c!-- PBI1098 : FCO - Deficiency loop (pull through work) --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="deficiencySeverityController as vm">\r\n    <fc-reference-table table-name="Deficiency Severity"\r\n                        attributes="vm.attributes"\r\n                        api-method="deficiencySeverity"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DeficiencyStatus/deficiencyStatusEdit.html",'\x3c!-- PBI1098 : FCO - Deficiency loop (pull through work) --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="deficiencyStatusEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'deficiencyStatusTable\')">Deficiency Status</a></li>\r\n            <li class="active">{{vm.model.Identifier}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Deficiency Status Edit</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="deficiencyStatus"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'deficiencyStatusTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DeficiencyStatus/deficiencyStatusTable.html",'\x3c!-- PBI1098 : FCO - Deficiency loop (pull through work) --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="deficiencyStatusController as vm">\r\n    <fc-reference-table table-name="Deficiency Status"\r\n                        attributes="vm.attributes"\r\n                        api-method="deficiencyStatus"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DeficiencyStatusAction/deficiencyStatusActionEdit.html",'\x3c!-- PBI1098 : FCO - Deficiency loop (pull through work) --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="deficiencyStatusActionEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'deficiencyStatusActionTable\')">Deficiency Status Action</a></li>\r\n            <li class="active">{{vm.model.Identifier}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Deficiency Status Action Edit</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="deficiencyStatusAction"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'deficiencyStatusActionTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DeficiencyStatusAction/deficiencyStatusActionTable.html",'\x3c!-- PBI1098 : FCO - Deficiency loop (pull through work) --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="deficiencyStatusActionController as vm">\r\n    <fc-reference-table table-name="Deficiency Status Action"\r\n                        attributes="vm.attributes"\r\n                        api-method="deficiencyStatusAction"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DispatchCalendarThemes/dispatchCalendarThemesEdit.html",'\x3c!-- PBI623 - TASK628 : FCO web ui: Dispatch Calendar --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dispatchCalendarThemesEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dispatchCalendarThemesTable\')">Dispatch Calendar Themes</a></li>\r\n            <li class="active">{{vm.model.Identifier}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Dispatch Calendar Themes</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dispatchCalendarThemes"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dispatchCalendarThemesTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DispatchCalendarThemes/dispatchCalendarThemesTable.html",'\x3c!-- PBI623 - TASK628 : FCO web ui: Dispatch Calendar --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dispatchCalendarThemesController as vm">\r\n    <fc-reference-table table-name="Dispatch Calendar Themes"\r\n                        attributes="vm.attributes"\r\n                        api-method="dispatchCalendarThemes"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DispatchChartThemes/dispatchChartThemesEdit.html",'\x3c!-- PBI623 - TASK628 : FCO web ui: Dispatch Calendar --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dispatchChartThemesEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dispatchChartThemesTable\')">Dispatch Chart Themes</a></li>\r\n            <li class="active">{{vm.model.Identifier}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Dispatch Chart Themes</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dispatchChartThemes"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dispatchChartThemesTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DispatchChartThemes/dispatchChartThemesTable.html",'\x3c!-- PBI623 - TASK628 : FCO web ui: Dispatch Calendar --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dispatchChartThemesController as vm">\r\n    <fc-reference-table table-name="Dispatch Chart Themes"\r\n                        attributes="vm.attributes"\r\n                        api-method="dispatchChartThemes"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DispatchMonthlyCalendarThemes/dispatchMonthlyCalendarThemesEdit.html",'\x3c!-- PBI623 - TASK628 : FCO web ui: Dispatch Calendar --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dispatchMonthlyCalendarThemesEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'dispatchMonthlyCalendarThemesTable\')">Dispatch Monthly Calendar Themes</a></li>\r\n            <li class="active">{{vm.model.Identifier}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Dispatch Monthly Calendar Themes</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="dispatchMonthlyCalendarThemes"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'dispatchMonthlyCalendarThemesTable\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/DispatchMonthlyCalendarThemes/dispatchMonthlyCalendarThemesTable.html",'\x3c!-- PBI623 - TASK628 : FCO web ui: Dispatch Calendar --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="dispatchMonthlyCalendarThemesController as vm">\r\n    <fc-reference-table table-name="Dispatch Monthly Calendar Themes"\r\n                        attributes="vm.attributes"\r\n                        api-method="dispatchMonthlyCalendarThemes"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/DocType/docTypeEdit.html",'<div id="pcont" class="container-fluid" ng-controller="DocTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'docTypesTable\')">Document Type</a></li>\r\n            <li class="active">{{vm.model.DocTypeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Document Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="doctypes" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'docTypesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Document Type:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="20" type="text" required parsley-type="" ng-model="vm.DocTypeName" class="form-control">\r\n\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/DocType/docTypeTable.html",'<div id="pcont" class="container-fluid" ng-controller="DocTypeController as vm">\r\n    <fc-reference-table table-name="Document Type"\r\n                        attributes="vm.attributes"\r\n                        api-method="doctypes"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/EquipmentClass/equipmentClass.html",'<div id="pcont" class="container-fluid" ng-controller="EquipmentClassController as vm">\r\n    <fc-reference-table table-name="Equipment Class"\r\n                        attributes="vm.attributes"\r\n                        api-method="equipmentClass"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/EquipmentClass/equipmentClassEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="EquipmentClassEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'equipmentClass\')">Equipment Class</a></li>\r\n            <li class="active">{{vm.model.ClassName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Equipment Class</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="equipmentClass" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'equipmentClass\')" attributes="vm.attributes"></fc-table-edit>\r\n</div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/EquipmentType/equipmentType.html",'<div id="pcont" class="container-fluid" ng-controller="EquipmentTypeController as vm">\r\n    <fc-reference-table table-name="Equipment Type"\r\n                        attributes="vm.attributes"\r\n                        api-method="equipmentType"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/EquipmentType/equipmentTypeEdit.html",'<div id="pcont" class="container-fluid" ng-controller="EquipmentTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'equipmentType\')">Equipment Type</a></li>\r\n            <li class="active">{{vm.model.TypeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Equipment Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="equipmentType" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'equipmentType\')" attributes="vm.attributes"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/EventType/eventTypeEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="EventTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'eventTypesTable\')">Event Type</a></li>\r\n            <li class="active">{{vm.model.EventTypeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Event Type  </h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="eventTypes" id="{{vm.id}}" model="vm.model" on-back="vm.$state.go(\'eventTypesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Name:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="20" type="text" required  parsley-type="" ng-model="vm.EventTypeName" class="form-control">\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n                    <div class="col-sm-6 col-md-6">\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                \r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit"">Submit</button>\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n                </div>\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/EventType/eventTypeTable.html",'<div id="pcont" class="container-fluid" ng-controller="EventTypeController as vm">\r\n    <fc-reference-table table-name="Event Type"\r\n                        attributes="vm.attributes"\r\n                        api-method="eventTypes"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Industry/industryEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="IndustryEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'industriesTable\')">Industry</a></li>\r\n            <li class="active">{{vm.model.IndustryName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Industry</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="industries" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'industriesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Industry:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="50" type="text" required  parsley-type="" ng-model="vm.IndustryName" class="form-control">\r\n\r\n                            </div> \r\n                        </div>\r\n                    </div> \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            </div>\r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Industry/industryTable.html",'<div id="pcont" class="container-fluid" ng-controller="IndustryController as vm">\r\n    <fc-reference-table table-name="Industry"\r\n                        attributes="vm.attributes"\r\n                        api-method="industries"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/ItemClass/itemClass.html",'<div id="pcont" class="container-fluid" ng-controller="ItemClassController as vm">\r\n    <fc-reference-table table-name="Item Class"\r\n                        attributes="vm.attributes"\r\n                        api-method="itemClasses"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/ItemClass/itemClassEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="ItemClassEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'itemClass\')">Item Class</a></li>\r\n            <li class="active">{{vm.model.ClassName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Item Class</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="itemClasses" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'itemClass\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Class Name:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" type="text"  maxlength="50" required  ng-model="vm.ClassName" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label class="col-sm-3 col-md-4 col-lg-3 control-label">Taxable</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n\r\n                                <input id="" type="checkbox"  parsley-type="" ng-model="vm.Taxable">\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                    <div class="col-sm-6 col-md-6">\r\n                    </div>\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div>\r\n                </div>\r\n\r\n\r\n            </div>\r\n            </form>--\x3e\r\n</div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/ItemType/itemType.html",'<div id="pcont" class="container-fluid" ng-controller="ItemTypeController as vm">\r\n    <fc-reference-table table-name="Item Type"\r\n                        attributes="vm.attributes"\r\n                        api-method="itemTypes"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n\r\n'),e.put("Templates/ReferenceTables/ItemType/itemTypeEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="ItemTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'itemType\')">Item Type</a></li>\r\n            <li class="active">{{vm.model.TypeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Item Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="itemTypes" id="{{vm.id}}" model="vm.model" on-back="vm.$state.go(\'itemType\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Type Name:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" type="text" maxlength="50" required parsley-type="" ng-model="vm.TypeName" class="form-control">\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Item Class:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                \r\n                                <select ng-model="vm.itemClass" ng-options="c.Id as c.ClassName for c in vm.ItemClasses" class="form-control"></select>\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                    </div>\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goToBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n            </form>--\x3e\r\n</div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/LaborCode/laborCode.html",'<div id="pcont" class="container-fluid" ng-controller="LaborCodeController as vm">\r\n    <fc-reference-table table-name="Labor Code"\r\n                        attributes="vm.attributes"\r\n                        api-method="laborCodes"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/LaborCode/laborCodeEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="LaborCodeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'laborCode\')">Labor Code</a></li>\r\n            <li class="active">{{vm.model.LaborCodeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Labor Code</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="laborCodes" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'laborCode\')" attributes="vm.attributes"></fc-table-edit>\r\n\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/LaborGroup/laborGroupEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="LaborGroupEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'laborGroupTable\')">Labor Group</a></li>\r\n            <li class="active">{{vm.model.Name}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Labor Group</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="laborgroups" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'laborGroupTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Labor Group Name:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" type="text" maxlength="50" required parsley-type="" ng-model="vm.Name" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div>\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/LaborGroup/laborGroupTable.html",'<div id="pcont" class="container-fluid" ng-controller="LaborGroupController as vm">\r\n    <fc-reference-table table-name="Labor Group"\r\n                        attributes="vm.attributes"\r\n                        api-method="laborgroups"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/LeadSource/leadSourceEdit.html",'<div id="pcont" class="container-fluid" ng-controller="LeadSourceEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'leadSourceTable\')">Lead Source</a></li>\r\n            <li class="active">{{vm.model.SourceId}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Lead Source</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="leadSource" \r\n                       model="vm.model" \r\n                       id="{{vm.id}}" \r\n                       on-back="vm.$state.go(\'leadSourceTable\')" \r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>        \r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/LeadSource/leadSourceTable.html",'\x3c!-- US2812 : FCO - Web - Lead source and salesperson tracking --\x3e\r\n\r\n<div id="pcont" class="container-fluid" ng-controller="LeadSourceController as vm">\r\n    <fc-reference-table table-name="Lead Source"\r\n                        attributes="vm.attributes"\r\n                        api-method="leadSource"\r\n                        on-edit="vm.edit(id)" />\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Location/locationTable.html",'<div id="pcont" class="container-fluid" ng-controller="LocationController as vm">\r\n    <fc-reference-table table-name="Location"\r\n                        attributes="vm.attributes"\r\n                        api-method="locations"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/Location/locationTableEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="LocationEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'locationsTable\')">Location</a></li>\r\n            <li class="active">{{vm.model.LocationName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Location</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="locations" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'locationsTable\')" attributes="vm.attributes"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Manufacturer/manufacturer.html",'<div id="pcont" class="container-fluid" ng-controller="ManufacturerController as vm">\r\n    <fc-reference-table table-name="Manufacturer"\r\n                        attributes="vm.attributes"\r\n                        api-method="manufacturers"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n'),e.put("Templates/ReferenceTables/Manufacturer/manufacturerEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="ManufacturerEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'manufacturer\')">Manufacturer</a></li>\r\n            <li class="active">{{vm.model.MfrName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Manufacturer</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="manufacturers" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'manufacturer\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n        <div class="row  form-horizontal">\r\n\r\n        \r\n            <div class="row  form-horizontal">\r\n                <div class="col-sm-6 col-md-6">\r\n\r\n                    <div class="form-group">\r\n                        <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Manufacturer:</label>\r\n                        <div class="col-sm-9 col-md-8 col-lg-7">\r\n                            <input id="" type="text" maxlength="20" parsley-type="" ng-model="vm.MfrName" class="form-control">\r\n                        </div> \r\n                    </div> \r\n                </div>\r\n\r\n                <div class="col-sm-6 col-md-6">\r\n\r\n                    <div class="form-group">\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                            \r\n                            <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                            <button type="submit" class="btn btn-primary" >Submit</button>\r\n                        </div>\r\n                    </div>\r\n\r\n                </div> \r\n            </div>\r\n\r\n\r\n        </div>\r\n            </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Merchant/merchantEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="MerchantEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'merchantsTable\')">Merchant</a></li>\r\n            <li class="active">{{vm.model.Name}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Merchant</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="merchants" id="{{vm.id}}" model="vm.model" on-back="vm.$state.go(\'merchantsTable\')" attributes="vm.attributes"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Merchant/merchantTable.html",'<div id="pcont" class="container-fluid" ng-controller="MerchantController as vm">\r\n    <fc-reference-table table-name="Merchant"\r\n                        attributes="vm.attributes"\r\n                        api-method="merchants"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/NoteLib/noteLibEdit.html",'<div id="pcont" class="container-fluid" ng-controller="NoteLibEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'noteLibsTable\')">Note Library</a></li>\r\n            <li class="active">{{vm.model.NoteTitle}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Note Library</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="notelibs" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'noteLibsTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Note Type:</label>\r\n                            <iv class="col-sm-9 col-md-8 col-lg-7">\r\n                                <select ng-model="vm.NoteType" class="form-control" required>\r\n                                    <option></option>\r\n                                    <option>WorkOrder</option>\r\n                                    <option>ServiciebleItem</option>\r\n                                    <option>Site</option>\r\n                                </select>\r\n                        \r\n\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Note Title:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="50" type="text" required parsley-type="" ng-model="vm.NoteTitle" class="form-control">\r\n\r\n                            \r\n\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Note:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="200" type="text" required parsley-type="" ng-model="vm.Note" class="form-control">\r\n\r\n                         \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            \r\n        </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/NoteLib/noteLibTable.html",'<div id="pcont" class="container-fluid" ng-controller="NoteLibController as vm">\r\n    <fc-reference-table table-name="Note Library"\r\n                        attributes="vm.attributes"\r\n                        api-method="notelibs"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/OperationGroup/operationGroupEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="OperationGroupEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'operationGroupsTable\')">Operation Group</a></li>\r\n            <li class="active">{{vm.model.OperationGroupName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Operation Group</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="operationGroups" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'operationGroupsTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class=" row form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label class="col-sm-3 col-md-4 col-lg-3 control-label">Operation Group:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="20" type="text" required parsley-type="" ng-model="vm.OperationGroupName" class="form-control">\r\n                            </div> \r\n                        </div> \r\n                    </div>\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label class="col-sm-3 col-md-4 col-lg-3 control-label"> Description:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" type="text" maxlength="200" required parsley-type="" ng-model="vm.Desc" class="form-control">\r\n                            </div> \r\n                        </div> \r\n                    </div>\r\n                    <div class="col-sm-6 col-md-6">\r\n                    </div>\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary">Submit</button>\r\n                            </div> \r\n                        </div>\r\n\r\n                    </div>\r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/OperationGroup/operationGroupTable.html",'<div id="pcont" class="container-fluid" ng-controller="OperationGroupController as vm">\r\n    <fc-reference-table table-name="Operation Group"\r\n                        attributes="vm.attributes"\r\n                        api-method="operationGroups"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/PaymentTerm/paymentTermEdit.html",'<div id="pcont" class="container-fluid" ng-controller="PaymentTermEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'paymentTermsTable\')">Payment Term</a></li>\r\n            <li class="active">{{vm.model.PaymentTermName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Payment Term</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="paymentTerms" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'paymentTermsTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Name:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="20" type="text" required parsley-type="" ng-model="vm.PaymentTermName" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Days:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" type="number" required parsley-type="" ng-model="vm.Days" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Sort:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" type="number" required parsley-type="" ng-model="vm.Sort" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/PaymentTerm/paymentTermTable.html",'<div id="pcont" class="container-fluid" ng-controller="PaymentTermController as vm">\r\n    <fc-reference-table table-name="Payment Term"\r\n                        attributes="vm.attributes"\r\n                        api-method="paymentTerms"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Priority/priorityTable.html",'<div id="pcont" class="container-fluid" ng-controller="PriorityController as vm">\r\n    <fc-reference-table table-name="Priority"\r\n                        attributes="vm.attributes"\r\n                        api-method="priorities"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n\r\n\r\n\r\n\r\n'),e.put("Templates/ReferenceTables/Priority/priorityTableEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="PriorityEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'prioritiesTable\')">Priority</a></li>\r\n            <li class="active">{{vm.model.PriorityName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Priority</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="priorities" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'prioritiesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Priority:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" type="text" maxlength="10" required parsley-type="" ng-model="vm.PriorityName" class="form-control">\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n\r\n                                <button class="btn btn-default" ng-click="vm.goToBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" >Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n</div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/ProblemCode/problemCodeEdit.html",'<div id="pcont" class="container-fluid" ng-controller="ProblemCodeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a href="#">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'problemCodesTable\')">Problem Code</a></li>\r\n            <li class="active">{{vm.model.ProblemCodeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Problem Code</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="problemcodes" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'problemCodesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/ProblemCode/problemCodeTable.html",'<div id="pcont" class="container-fluid" ng-controller="ProblemCodeController as vm">\r\n    <fc-reference-table table-name="Problem Code"\r\n                        attributes="vm.attributes"\r\n                        api-method="problemCodes"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>'),e.put("Templates/ReferenceTables/ProblemCodeTask/problemCodeTaskEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="ProblemCodeTaskEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'problemCodeTasksTable\')">Problem Task</a></li>\r\n            <li class="active">{{vm.model.TaskName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Problem Code Task</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="problemcodeTasks" \r\n                       model="vm.model" \r\n                       id="{{vm.id}}" \r\n                       on-back="vm.$state.go(\'problemCodeTasksTable\')" \r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/ProblemCodeTask/problemCodeTaskTable.html",'<div id="pcont" class="container-fluid" ng-controller="ProblemCodeTaskController as vm">\r\n    <fc-reference-table table-name="Problem Code Task"\r\n                        attributes="vm.attributes"\r\n                        api-method="problemCodeTasks"\r\n                        on-edit="vm.edit(id)" />\r\n</div>\r\n'),e.put("Templates/ReferenceTables/QuotePriority/quotePriorityEdit.html",'<div id="pcont" class="container-fluid" ng-controller="QuotePriorityEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goToRefTable()">Reference Tables</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'quotePriority\')">Quote Priority</a></li>\r\n            <li class="active">{{vm.model.Priority}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Quote Priority</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="quotepriority"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'quotePriority\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/QuotePriority/quotePriorityTable.html",'<div id="pcont" class="container-fluid" ng-controller="QuotePriorityController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goToRefTable()">Reference Tables</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'quotePriority\')">Quote Priority</a></li>\r\n            <li class="active">{{vm.model.Priority}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Quote Priority</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table table-name="Quote Priority"\r\n                  attributes="vm.attributes"\r\n                  api-method="quotepriority"\r\n                  on-edit="vm.edit(id)" />\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/Resolution/resolutionEdit.html",'<div id="pcont" class="container-fluid" ng-controller="ResolutionEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a href="#">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'resolutionsTable\')">Resolution</a></li>\r\n            <li class="active">{{vm.model.ResolutionName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Resolution</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="resolutions" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'resolutionsTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Resolution:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="50" type="text" required parsley-type="" ng-model="vm.ResolutionName" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Resolution/resolutionTable.html",'<div id="pcont" class="container-fluid" ng-controller="ResolutionController as vm">\r\n    <fc-reference-table table-name="Resolution"\r\n                        attributes="vm.attributes"\r\n                        api-method="resolutions"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Role/roleEdit.html",'<div id="pcont" class="container-fluid" ng-controller="RoleEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'rolesTable\')">Role</a></li>\r\n            <li class="active">{{vm.model.RoleName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Role</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="roles" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'rolesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Role Name:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="20" type="text" required parsley-type="" ng-model="vm.RoleName" class="form-control">\r\n\r\n                            \r\n\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Role Types:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <select ng-model="vm.RoleType" ng-options="c.Id as c.RoleTypeName for c in vm.RoleTypes"></select>\r\n                            \r\n\r\n\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            \r\n        </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Role/roleTable.html",'<div id="pcont" class="container-fluid" ng-controller="RoleController as vm">\r\n    <fc-reference-table table-name="Role"\r\n                        attributes="vm.attributes"\r\n                        api-method="roles"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/RoleType/roleTypeEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="RoleTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'roleTypesTable\')">Role Type Table</a></li>\r\n            <li class="active">{{vm.model.RoleTypeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Role Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="roleTypes" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'roleTypesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Role Type:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="20" type="text" required parsley-type="" ng-model="vm.RoleTypeName" class="form-control">\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n\r\n                                <button class="btn btn-default" ng-click="vm.goToBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/RoleType/roleTypeTable.html",'<div id="pcont" class="container-fluid" ng-controller="RoleTypeController as vm">\r\n    <fc-reference-table table-name="Role Type"\r\n                        attributes="vm.attributes"\r\n                        api-method="roleTypes"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/ServiceArea/serviceAreaTable.html",'<div id="pcont" class="container-fluid" ng-controller="ServiceAreaController as vm">\r\n    <fc-reference-table table-name="Service Area"\r\n                        attributes="vm.attributes"\r\n                        api-method="serviceAreas"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/ServiceArea/serviceAreaTableEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="ServiceAreaEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'serviceAreasTable\')">Service Area</a></li>\r\n            <li class="active">{{vm.model.ServiceAreaName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Service Area</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="serviceAreas" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'serviceAreasTable\')" attributes="vm.attributes"></fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/ServiceableItemClass/serviceableItemClass.html",'<div id="pcont" class="container-fluid" ng-controller="ServiceableItemClassController as vm">\r\n    <fc-reference-table table-name="Serviceable Item Class"\r\n                        attributes="vm.attributes"\r\n                        api-method="serviceableItemClasses"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/ServiceableItemClass/serviceableItemClassEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="ServiceableItemClassEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'serviceableItemClass\')">Serviceable Item Class</a></li>\r\n            <li class="active">{{vm.model.ClassName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Serviceable Item Class</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="serviceableItemClasses" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'serviceableItemClass\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Class Name:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" type="text" maxlength="50" required parsley-type="" ng-model="vm.ClassName" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                    \r\n                    <div class="col-sm-6 col-md-6">\r\n                    </div>\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n            </form>--\x3e\r\n</div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/ServiceableItemType/serviceableItemType.html",'<div id="pcont" class="container-fluid" ng-controller="ServiceableItemTypeController as vm">\r\n    <fc-reference-table table-name="Serviceable Item Type"\r\n                        attributes="vm.attributes"\r\n                        api-method="serviceableItemTypes"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/ServiceableItemType/serviceableItemTypeEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="ServiceableItemTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'serviceableItemType\')">Serviceable Item Type</a></li>\r\n            <li class="active">{{vm.model.TypeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Serviceable Item Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="serviceableItemTypes" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'serviceableItemType\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Type Name:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" type="text" maxlength="50" parsley-type="" ng-model="vm.TypeName" class="form-control">\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Serviceable Item Class:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                \r\n                                <select ng-model="vm.serviceableItemClass" ng-options="c.Id as c.ClassName for c in vm.ServiceableItemClasses" class="form-control"></select>\r\n\r\n                            </div>\r\n                        </div> \r\n                    </div> \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n                    </div> \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div>\r\n                </div>\r\n\r\n\r\n            </div>\r\n            </form>--\x3e\r\n</div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Setting/settingsTable.html",'<div id="pcont" class="container-fluid" ng-controller="SettingController as vm">\r\n    <fc-reference-table table-name="Setting"\r\n                        attributes="vm.attributes"\r\n                        api-method="settings"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Setting/settingsTableEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="SettingEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'settingsTable\')">Setting</a></li>\r\n            <li class="active">{{vm.model.SettingName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Setting</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="settings" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'settingsTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Name:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="20" type="text" required parsley-type="" ng-model="vm.SettingName" class="form-control">\r\n\r\n                            </div>\r\n                        </div>\r\n\r\n                    </div> \r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Description:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n\r\n                                <input id="" maxlength="200" type="text" required parsley-type="" ng-model="vm.Description" class="form-control">\r\n                            </div>\r\n                        </div> \r\n\r\n                    </div> \r\n                    <div class="col-sm-6 col-md-6">\r\n                    </div>\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                               \r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" >Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div>\r\n                </div>\r\n\r\n\r\n            </div>\r\n            </form>--\x3e\r\n</div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/SiteType/siteTypeEdit.html",'<div id="pcont" class="container-fluid" ng-controller="SiteTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a href="#">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'siteTypesTable\')">Site Type</a></li>\r\n            <li class="active">{{vm.model.SiteTypeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Site Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="sitetypes" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'siteTypesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Site Type:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" type="text" maxlength="50" required parsley-type="" ng-model="vm.SiteTypeName" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/SiteType/siteTypeTable.html",'<div id="pcont" class="container-fluid" ng-controller="SiteTypeController as vm">\r\n    <fc-reference-table table-name="Site Type"\r\n                        attributes="vm.attributes"\r\n                        api-method="sitetypes"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>'),e.put("Templates/ReferenceTables/Skill/skillEdit.html",'<div id="pcont" class="container-fluid" ng-controller="SkillEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'skillsTable\')">Skill</a></li>\r\n            <li class="active">{{vm.model.SkillName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Skill</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="skills" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'skillsTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Skill:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" type="text" maxlength="50" required parsley-type="" ng-model="vm.SkillName" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div>\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Skill/skillTable.html",'<div id="pcont" class="container-fluid" ng-controller="SkillController as vm">\r\n    <fc-reference-table table-name="Skill"\r\n                        attributes="vm.attributes"\r\n                        api-method="skills"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/State/stateEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="StateEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'stateTable\')">State</a></li>\r\n            <li class="active">{{vm.model.StateName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>State</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="states" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'stateTable\')" attributes="vm.attributes"></fc-table-edit>   \r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/State/stateTable.html",'<div id="pcont" class="container-fluid" ng-controller="StateController as vm">\r\n    <fc-reference-table table-name="State"\r\n                        attributes="vm.attributes"\r\n                        api-method="states"\r\n                        on-edit="vm.edit(id)" />\r\n</div>'),e.put("Templates/ReferenceTables/Status/statusEdit.html",'<div id="pcont" class="container-fluid" ng-controller="StatusEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'statusesTable\')">Status</a></li>\r\n            <li class="active">{{vm.model.StatusName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Status</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="statuses" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'statusesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Status Name:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="15" type="text" required parsley-type="" ng-model="vm.StatusName" class="form-control">\r\n\r\n                            </div>\r\n                        </div> \r\n                    </div>\r\n\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Type:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="20" type="text" required parsley-type="" ng-model="vm.Type" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div>\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Sort:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" type="number" required parsley-type="" ng-model="vm.Sort" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Status/statusTable.html",'<div id="pcont" class="container-fluid" ng-controller="StatusController as vm">\r\n    <fc-reference-table table-name="Status"\r\n                        attributes="vm.attributes"\r\n                        api-method="statuses"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/SubscriptionType/subscriptionTypeEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="SubscriptionTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'subscriptionTypesTable\')">Subscription Type</a></li>\r\n            <li class="active">{{vm.model.TypeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Subscription Type</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="subscriptionTypes" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'subscriptionTypesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Type Name:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="50" type="text" required parsley-type="" ng-model="vm.TypeName" class="form-control">\r\n\r\n                            </div>\r\n                        </div>\r\n                    </div> \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Duration:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" type="number" required parsley-type="" ng-model="vm.Duration" class="form-control">\r\n\r\n                            </div>\r\n                        </div> \r\n                    </div>\r\n\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Price:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id=""  maxlength="18"  type="number" step="0.01" required parsley-type="" ng-model="vm.Price" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Status:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="10" type="text" required parsley-type="" ng-model="vm.Status" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n                    </div>\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/SubscriptionType/subscriptionTypeTable.html",'<div id="pcont" class="container-fluid" ng-controller="SubscriptionTypeController as vm">\r\n    <fc-reference-table table-name="Subscription Type"\r\n                        attributes="vm.attributes"\r\n                        api-method="subscriptionTypes"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/SubscriptionTypeRole/subscriptionTypeRoleEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="SubscriptionTypeRoleEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'subscriptionTypeRolesTable\')">Subscription Type</a></li>\r\n            <li class="active">{{vm.model.TypeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Subscription Type Role</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="subscriptionTypeRoles" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'subscriptionTypeRolesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Subscription Type:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <select ng-model="vm.SubscriptionType" ng-options="st.Id as st.TypeName for st in vm.SubscriptionTypes"></select>\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Subscription Role:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <select ng-model="vm.Role" ng-options="r.Id as r.RoleName for r in vm.Roles"></select>\r\n\r\n                            </div>\r\n                        </div> \r\n                    </div>\r\n\r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n                    </div> \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            </div> \r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/SubscriptionTypeRole/subscriptionTypeRoleTable.html",'<div id="pcont" class="container-fluid" ng-controller="SubscriptionTypeRoleController as vm">\r\n    <fc-reference-table table-name="Subscription Type Role"\r\n                        attributes="vm.attributes"\r\n                        api-method="subscriptionTypeRoles"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/TagType/tagTypeEdit.html",'<div id="pcont" class="container-fluid" ng-controller="TagTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'tagTypesTable\')">Tag Type</a></li>\r\n            <li class="active">{{vm.model.TagTypeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Tag Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="tagtypes" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'tagTypesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n            <div class="row  form-horizontal">\r\n\r\n\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Tag Type:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" maxlength="20" type="text" required parsley-type="" ng-model="vm.TagTypeName" class="form-control">\r\n\r\n                            </div> \r\n                        </div> \r\n                    </div> \r\n\r\n                    <div class="col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary" value="Submit">Submit</button>\r\n                            </div>\r\n                        </div> \r\n\r\n                    </div> \r\n                </div>\r\n\r\n\r\n            </div>\r\n        </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/TagType/tagTypeTable.html",'<div id="pcont" class="container-fluid" ng-controller="TagTypeController as vm">\r\n    <fc-reference-table table-name="Tag Type"\r\n                        attributes="vm.attributes"\r\n                        api-method="tagtypes"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/TimeZone/timeZoneTable.html",'<div id="pcont" class="container-fluid" ng-controller="TimeZoneController as vm">\r\n    <fc-reference-table table-name="Time Zone"\r\n                        attributes="vm.attributes"\r\n                        api-method="timezones"\r\n                        on-edit="vm.edit(id)" />\r\n</div>\r\n'),e.put("Templates/ReferenceTables/TimeZone/timeZoneTableEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="TimeZoneEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'timeZonesTable\')">Time Zone</a></li>\r\n            <li class="active">{{vm.model.TimeZoneName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Time Zone</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="timezones" \r\n                       model="vm.model" \r\n                       id="{{vm.id}}" \r\n                       on-back="vm.$state.go(\'timeZonesTable\')" \r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n</div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Unavailable/unavailableEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="UnavailableEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'unavailablesTable\')">Unavailable Type</a></li>\r\n            <li class="active">{{vm.model.UnavailableName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Unavailable Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="unavailables" id="{{vm.id}}" model="vm.model" on-back="vm.$state.go(\'unavailablesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n        <div class="row  form-horizontal">\r\n\r\n\r\n            <div class="row  form-horizontal">\r\n                <div class="col-sm-6 col-md-6">\r\n\r\n                    <div class="form-group">\r\n                        <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Unavailable Type:</label>\r\n                        <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" type="text" maxlength="50" required parsley-type="" ng-model="vm.UnavailableName" class="form-control">\r\n                        </div> \r\n                    </div> \r\n                </div>\r\n                <div class="col-sm-6 col-md-6">\r\n                    <div class="form-group">\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                            <button class="btn btn-default" ng-click="vm.goToBack()">Cancel</button>\r\n                            <button type="submit" class="btn btn-primary" >Submit</button>\r\n                        </div\r\n                    </div> \r\n                </div> \r\n            </div>\r\n        </div>\r\n        </form>--\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Unavailable/unavailableTable.html",'<div id="pcont" class="container-fluid" ng-controller="UnavailableController as vm">\r\n    <fc-reference-table table-name="Unavailable"\r\n                        attributes="vm.attributes"\r\n                        api-method="unavailables"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/UnavailablePayRate/unavailablePayRate.html",'<div id="pcont" class="container-fluid">\r\n    \x3c!-- PBI1097 : FCO - Unavailable time: create time entry --\x3e\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Unavailable Pay Rate</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Unavailable Pay Rate</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content" ng-controller="UnavailablePayRateController as vm">\r\n                        <fc-table table-name="UnavailablePayRate"\r\n                                  api-method="unavailablePayRateMapping"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)"></fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/ReferenceTables/UnavailablePayRate/unavailablePayRateEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="UnavailablePayRateEditController as vm">\r\n    \x3c!-- PBI1097 : FCO - Unavailable time: create time entry --\x3e\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'unavailablePayRate\')">Unavailable Pay Rate</a></li>\r\n            <li class="active">{{vm.model.Name}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Unavailable Pay Rate</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="unavailablePayRateMapping"\r\n                       id="{{vm.id}}"\r\n                       model="vm.model"\r\n                       on-back="vm.$state.go(\'unavailablePayRate\')"\r\n                       attributes="vm.attributes">\r\n        </fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/ReferenceTables/Uom/uomEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="UomEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'uomsTable\')">UOM</a></li>\r\n            <li class="active">{{vm.model.UOMName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>UOM</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="uoms" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'uomsTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n        <div class="row  form-horizontal">\r\n\r\n\r\n            <div class="row  form-horizontal">\r\n                <div class="col-sm-6 col-md-6">\r\n\r\n                    <div class="form-group">\r\n                        <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">UOM:</label>\r\n                        <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                <input id="" type="text" maxlength="10" required parsley-type="" ng-model="vm.UOMName" class="form-control">\r\n                        </div> \r\n                    </div>\r\n                </div> \r\n                <div class="col-sm-6 col-md-6">\r\n                    <div class="form-group">\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                            <button class="btn btn-default" ng-click="vm.goToBack()">Cancel</button>\r\n                            <button type="submit" class="btn btn-primary" >Submit</button>\r\n                        </div> \r\n                    </div> \r\n                </div> \r\n            </div>\r\n        </div><\r\n        </form>--\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ReferenceTables/Uom/uomTable.html",'<div id="pcont" class="container-fluid" ng-controller="UomController as vm">\r\n    <fc-reference-table table-name="UOM"\r\n                        attributes="vm.attributes"\r\n                        api-method="uoms"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/WOStatus/woStatusTable.html",'<div id="pcont" class="container-fluid" ng-controller="WOStatusController as vm">\r\n    <fc-reference-table table-name="WO Status "\r\n                        attributes="vm.attributes"\r\n                        api-method="wostatuses"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n\r\n\r\n\r\n'),e.put("Templates/ReferenceTables/WOStatus/woStatusTableEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="WOStatusEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'woStatusesTable\')">WO Status</a></li>\r\n            <li class="active">{{vm.model.WoStatusName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>WO Status</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="wostatuses" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'woStatusesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n        <div class="row  form-horizontal">\r\n\r\n\r\n            <div class="row  form-horizontal">\r\n                <div class="col-sm-6 col-md-6">\r\n\r\n                    <div class="form-group">\r\n                        <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Wo Status:</label>\r\n                        <div class="col-sm-9 col-md-8 col-lg-7">\r\n                            <input id="" type="text" maxlength="15" required="" parsley-type="" ng-model="vm.WoStatusName" class="form-control">\r\n                        </div> \r\n                    </div> \r\n                </div> \r\n\r\n                <div class="col-sm-6 col-md-6">\r\n\r\n                    <div class="form-group">\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                            <button class="btn btn-default" ng-click="vm.goToBack()">Cancel</button>\r\n                            <button type="submit" class="btn btn-primary" >Submit</button>\r\n                        </div> \r\n                    </div> \r\n\r\n                </div>\r\n            </div>\r\n\r\n\r\n        </div>\r\n            </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/WOStatusColor/woStatusColorTable.html",'<div id="pcont" class="container-fluid" ng-controller="WOStatusColorController as vm">\r\n    <fc-reference-table table-name="WOStatus Color"\r\n                        attributes="vm.attributes"\r\n                        api-method="wostatuscolors"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/WOStatusColor/woStatusColorTableEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="WOStatusColorEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'woStatusColorsTable\')">WO Status Color</a></li>\r\n            <li class="active">{{vm.model.WoStatusName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>WO Status Color</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="wostatuscolors" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'woStatusColorsTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n        <div class="row  form-horizontal">\r\n\r\n\r\n            <div class="row  form-horizontal">\r\n                <div class="col-sm-6 col-md-6">\r\n                    <div class="form-group">\r\n                        <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">WO Status:</label>\r\n                        <div class="col-sm-9 col-md-8 col-lg-7">\r\n                            <select ng-model="vm.WoStatus" ng-options="w.Id as w.WoStatusName for w in vm.WoStatuses" class="form-control"></select>\r\n                            \r\n                        </div> \r\n                    </div> \r\n                </div>\r\n              \r\n                <div class="col-sm-6 col-md-6">\r\n                    <div class="form-group">\r\n                        <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Color Code:</label>\r\n                        <div class="col-sm-9 col-md-8 col-lg-7">\r\n                            \r\n                            <ngjs-color-picker  selected="vm.ColorCode" options="customOptions"></ngjs-color-picker>\r\n                            <input type="text"   ng-model="vm.ColorCode" class="ng-pristine ng-valid ng-touched">\r\n                            \r\n                        </div> \r\n                    </div> \r\n                </div>\r\n            \r\n            <div class="col-sm-6 col-md-6">\r\n               \r\n            </div>\r\n\r\n\r\n    <div class="col-sm-6 col-md-6">\r\n\r\n        <div class="form-group">\r\n            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                <button class="btn btn-default" ng-click="vm.goToBack()">Cancel</button>\r\n                <button type="submit" class="btn btn-primary">Submit</button>\r\n            </div>\r\n        </div>\r\n\r\n    </div> \r\n</div>\r\n\r\n\r\n        </div>\r\n            </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/WOType/woTypeTable.html",'<div id="pcont" class="container-fluid" ng-controller="WOTypeController as vm">\r\n    <fc-reference-table table-name="WO Type"\r\n                        attributes="vm.attributes"\r\n                        api-method="wotypes"\r\n                        on-edit="vm.edit(id)" />\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/WOType/woTypeTableEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="WOTypeEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'woTypesTable\')">WO Type</a></li>\r\n            <li class="active">{{vm.model.WoTypeName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>WO Type</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="wotypes" model="vm.model" id="{{vm.id}}" on-back="vm.$state.go(\'woTypesTable\')" attributes="vm.attributes"></fc-table-edit>\r\n        \x3c!--<form ng-submit="vm.submit()">\r\n        <div class="row  form-horizontal">\r\n\r\n\r\n            <div class="row  form-horizontal">\r\n                <div class="col-sm-6 col-md-6">\r\n\r\n                    <div class="form-group">\r\n                        <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Wo Type:</label>\r\n                        <div class="col-sm-9 col-md-8 col-lg-7">\r\n                            <input id="" type="text" maxlength="20" required parsley-type="" ng-model="vm.WoTypeName" class="form-control">\r\n                        </div> \r\n                    </div>\r\n                </div> \r\n                <div class="col-sm-6 col-md-6">\r\n\r\n                    <div class="form-group">\r\n                        <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Default:</label>\r\n                        <div class="col-sm-9 col-md-8 col-lg-7">\r\n                            <input id="" type="checkbox" ng-model="vm.Default" >\r\n                        </div> \r\n                    </div> \r\n                </div>\r\n                <div class="col-sm-6 col-md-6">\r\n\r\n                    <div class="form-group">\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                           \r\n                            <button class="btn btn-default" ng-click="vm.goToBack()">Cancel</button>\r\n                            <button type="submit" class="btn btn-primary" >Submit</button>\r\n                        </div> \r\n                    </div>\r\n\r\n                </div>\r\n            </div>\r\n\r\n\r\n        </div>\r\n    </form>--\x3e\r\n    </div>\r\n\r\n</div>\r\n'),e.put("Templates/ReferenceTables/reference-tables.html",'\x3c!-- EPIC387 --\x3e\r\n\x3c!--<div id="cl-wrapper" ng-controller="ReferenceTablesController as vm">--\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="ReferenceTablesController as vm">\r\n    \x3c!--<div id="pcont" class="container-fluid">--\x3e\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.goToHome();">Home</a></li>\r\n            <li class="active">Reference Tables</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Reference Tables</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n\r\n        <div class="row  form-horizontal">\r\n\r\n            <div class="col-sm-4 col-md-4">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <div id="list1" class="dd">\r\n                            <ol ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin" class="dd-list">\r\n\r\n                                <li data-id="3" ng-show="vm.isFC" class="dd-item">\r\n                                    <div class="dd-handle">Location </div>\r\n                                    <ol class="dd-list">\r\n                                        <li data-id="4" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToState()">State</a>\r\n                                        </li>\r\n                                        <li data-id="5" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToCountries()">Country </a>\r\n                                        </li>\r\n                                        <li data-id="6" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToCurrency()">Currency</a>\r\n                                        </li>\r\n\r\n                                        <li data-id="7" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToTimeZone()">Time Zone</a>\r\n                                        </li>\r\n                                    </ol>\r\n                                </li>\r\n\r\n                                <li data-id="3" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin" class="dd-item">\r\n                                    <div class="dd-handle">WO</div>\r\n                                    <ol class="dd-list">\r\n                                        <li data-id="4" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToWOStatus()">WO Status</a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToWOType()">WO Type</a>\r\n                                        </li>\r\n                                        <li data-id="5" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToPriority()">Priority </a>\r\n                                        </li>\r\n                                        <li data-id="6" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToAssigmentStatus()">Assignment Status </a>\r\n                                        </li>\r\n                                        <li data-id="7" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToCause()">Cause </a>\r\n                                        </li>\r\n                                        <li data-id="7" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToResolution()">Resolution </a>\r\n                                        </li>\r\n                                        <li data-id="7" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToProblemCode()">Problem Code </a>\r\n                                        </li>\r\n                                        \x3c!-- PBI1044 : FCO - Work Order Tasks --\x3e\r\n                                        \x3c!--\r\n                                        <li data-id="7" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToProblemCodeTask()">Problem Code Task </a>\r\n                                        </li>\r\n                                        --\x3e\r\n                                        <li data-id="7" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToSiteType()">Site Type </a>\r\n                                        </li>\r\n                                        <li data-id="7" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToWOStatusColor()">WO Status Color </a>\r\n                                        </li>\r\n                                        <li data-id="7" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToAssignmentStatusColor()">\r\n                                                Assignment Status Color\r\n                                            </a>\r\n                                        </li>\r\n                                        \x3c!-- US2812 : FCO - Web - Lead source and salesperson tracking --\x3e\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin || vm.isOffice" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToLeadSource()">Lead Source</a>\r\n                                        </li>\r\n                                    </ol>\r\n                                </li>\r\n\r\n\r\n                                <li data-id="3" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin || vm.isOffice"\r\n                                    class="dd-item">\r\n                                    <div class="dd-handle">Inventory</div>\r\n                                    <ol class="dd-list">\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin || vm.isOffice"\r\n                                            class="dd-item">\r\n                                            <a href="" ng-click="vm.goToItemClass()">Item Class</a>\r\n                                        </li>\r\n                                        <li data-id="5" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin || vm.isOffice"\r\n                                            class="dd-item">\r\n                                            <a href="" ng-click="vm.goToItemType()">Item Type </a>\r\n                                        </li>\r\n                                        <li data-id="8" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToUom()">UOM</a>\r\n                                        </li>\r\n                                        <li data-id="7" ng-show="vm.isFC || vm.isAdmin || vm.isOffice" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToLocation()">Location</a>\r\n                                        </li>\r\n\r\n                                    </ol>\r\n                                </li>\r\n                            </ol>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n            </div> \x3c!-- columns --\x3e\r\n\r\n            <div class="col-sm-4 col-md-4">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <div id="list1" class="dd">\r\n                            <ol class="dd-list">\r\n\r\n                                <li data-id="3" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin || vm.isOffice"\r\n                                    class="dd-item">\r\n                                    <div class="dd-handle">Equipment</div>\r\n                                    <ol class="dd-list">\r\n\r\n                                        <li data-id="5" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin || vm.isOffice"\r\n                                            class="dd-item">\r\n                                            <a href="" ng-click="vm.goToEquipmentClass()">Equipment Class </a>\r\n                                        </li>\r\n                                        <li data-id="6" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin || vm.isOffice"\r\n                                            class="dd-item">\r\n                                            <a href="" ng-click="vm.goToEquipmentType()">Equipment Type </a>\r\n                                        </li>\r\n\r\n                                    </ol>\r\n                                </li>\r\n\r\n                                <li data-id="3" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin || vm.isOffice"\r\n                                    class="dd-item">\r\n                                    <div class="dd-handle">Serviceable Items</div>\r\n                                    <ol class="dd-list">\r\n\r\n                                        <li data-id="5" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin || vm.isOffice"\r\n                                            class="dd-item">\r\n                                            <a href="" ng-click="vm.goToServiceableItemClass()">Serviceable Item Class </a>\r\n                                        </li>\r\n                                        <li data-id="6" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin || vm.isOffice"\r\n                                            class="dd-item">\r\n                                            <a href="" ng-click="vm.goToServiceableItemType()">Serviceable Item Type </a>\r\n                                        </li>\r\n\r\n                                    </ol>\r\n                                </li>\r\n\r\n                                <li data-id="3" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin || vm.isOffice"\r\n                                    class="dd-item">\r\n                                    <div class="dd-handle">Labor </div>\r\n                                    <ol class="dd-list">\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToSkill()">Skill </a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin || vm.isOffice" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToLaborGroup()">Labor Group</a>\r\n                                        </li>\r\n                                        <li data-id="5" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToLaborCode()">Labor Code</a>\r\n                                        </li>\r\n                                        <li data-id="7" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToUnavailableType()">Unavailable Type</a>\r\n                                        </li>\r\n                                    </ol>\r\n                                </li>\r\n                                \x3c!-- US2587 : FCO - Web - Consolidate Quote Priority to WO Priority reference table. --\x3e\r\n                                \x3c!-- removed section for now since there are no other reference tables for quotes --\x3e\r\n                                \x3c!-- <li data-id="3" ng-show="vm.isQuotingEnabled && (vm.isFC || vm.isAdmin || vm.isTransAdmin || vm.isOffice)" class="dd-item"> --\x3e\r\n                                <li data-id="3" ng-show="false" class="dd-item">\r\n                                    <div class="dd-handle">Quoting</div>\r\n                                    <ol class="dd-list">\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToQuotePriority()">Quote Priority</a>\r\n                                        </li>\r\n                                    </ol>\r\n                                </li>\r\n                                \x3c!-- PBI623 - TASK627 : FCO web ui: Dashboards --\x3e\r\n                                <li data-id="3" ng-show="vm.isFC"\r\n                                    class="dd-item">\r\n                                    <div class="dd-handle">Dashboards</div>\r\n                                    <ol class="dd-list">\r\n                                        <li data-id="4" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDashboardChartType()">Chart Type</a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDashboardReportType()">Report Type</a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDashboardConfigDDList()">Configuration DD-List</a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDashboardFilterDDList()">Filter DD-List</a>\r\n                                        </li>\r\n                                    </ol>\r\n                                </li>\r\n                                \x3c!-- PBI623 - TASK628 : FCO web ui: Dispatch Calendar --\x3e\r\n                                <li data-id="3" ng-show="vm.isFC"\r\n                                    class="dd-item">\r\n                                    <div class="dd-handle">Dispatch</div>\r\n                                    <ol class="dd-list">\r\n                                        <li data-id="4" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDispatchCalendarThemes()">Calendar Themes</a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDispatchChartThemes()">Chart Themes</a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDispatchMonthlyCalendarThemes()">Monthly Calendar Themes</a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDefaultDispatchCalendarSettings()">Default Calendar Settings</a>\r\n                                        </li>\r\n                                    </ol>\r\n                                </li>\r\n                            </ol>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n            </div> \x3c!-- columns --\x3e\r\n\r\n            <div class="col-sm-4 col-md-4">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <div id="list1" class="dd">\r\n                            <ol class="dd-list">\r\n\r\n\r\n                                <li data-id="3" class="dd-item">\r\n                                    <div class="dd-handle">General </div>\r\n                                    <ol class="dd-list">\r\n                                        <li data-id="5" class="dd-item" ng-show="vm.isFC">\r\n                                            <a href="" ng-click="vm.goToMerchant()">Merchant </a>\r\n                                        </li>\r\n                                        <li data-id="6" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToAttachmentType()">Attachment Type</a>\r\n                                        </li>\r\n                                        <li data-id="5" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToIndustry()">Industry </a>\r\n                                        </li>\r\n                                        <li data-id="5" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDocType()">Document Type </a>\r\n                                        </li>\r\n                                        <li data-id="5" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToBillingPeriod()">Billing Period </a>\r\n                                        </li>\r\n                                        <li data-id="5" ng-show="vm.isFC || vm.isAdmin || vm.isTransAdmin || vm.isSubAdmin"\r\n                                            class="dd-item">\r\n                                            <a href="" ng-click="vm.goToPaymentTerm()">Payment Term </a>\r\n                                        </li>\r\n                                        <li data-id="5" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToNoteLib()">Note Library </a>\r\n                                        </li>\r\n                                        <li data-id="5" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToRole()">Role </a>\r\n                                        </li>\r\n                                        <li data-id="5" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToSetting()">Setting </a>\r\n                                        </li>\r\n                                        <li data-id="5" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToSubscriptionType()">Subscription Type </a>\r\n                                        </li>\r\n                                        <li data-id="5" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToStatus()">Status </a>\r\n                                        </li>\r\n                                        \x3c!-- PBI825 : FCO - Default start page --\x3e\r\n                                        <li data-id="5" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDefaultStartPage()">Default Start Page </a>\r\n                                        </li>\r\n                                    </ol>\r\n                                </li>\r\n                                \x3c!-- PBI1098 : FCO - Deficiency loop (pull through work) --\x3e\r\n                                <li data-id="3" ng-show="vm.isQuotingEnabled" class="dd-item">\r\n                                    <div class="dd-handle">Deficiency</div>\r\n                                    <ol class="dd-list">\r\n                                        <li data-id="5" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDeficiencySeverity()">Severity</a>\r\n                                        </li>\r\n                                        <li data-id="5" ng-show="vm.isFC" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDeficiencyStatusAction()">Status Action</a>\r\n                                        </li>\r\n                                        <li data-id="5" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDeficiencyStatus()">Status</a>\r\n                                        </li>\r\n                                    </ol>\r\n                                </li>\r\n                                \x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n                                <li data-id="3" ng-show="vm.usingDSLNorthwest" class="dd-item">\r\n                                    <div class="dd-handle">DSL Northwest</div>\r\n                                    <ol class="dd-list">\r\n                                        \x3c!-- PBI534 : DSL - Add additional reference tables --\x3e\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDSLActionTaken()">Action Taken</a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            \x3c!-- PBI636 : DSL - Edit field names in labor/parts/misc --\x3e\r\n                                            \x3c!-- <a href="" ng-click="vm.goToDSLApplicableCode()">Applicable Code</a> --\x3e\r\n                                            <a href="" ng-click="vm.goToDSLApplicableCode()">Applicable Zone</a>\r\n                                        </li>\r\n                                        \x3c!-- PBI534 : END --\x3e\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDSLDistributor()">Distributor List</a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDSLFailureResolution()">Failure/Resolution List</a>\r\n                                        </li>\r\n                                        \x3c!-- PBI534 : DSL - Add additional reference tables --\x3e\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            \x3c!-- PBI636 : DSL - Edit field names in labor/parts/misc --\x3e\r\n                                            \x3c!-- <a href="" ng-click="vm.goToDSLFaultAreas()">Fault Areas</a> --\x3e\r\n                                            <a href="" ng-click="vm.goToDSLFaultAreas()">Trouble Found</a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDSLInstalledRemoved()">Installed Removed</a>\r\n                                        </li>\r\n                                        \x3c!-- PBI534 : END --\x3e\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDSLInventoryPostingGroup()">\r\n                                                Inventory Posting\r\n                                                Group\r\n                                            </a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDSLServiceZoneLaborCode()">\r\n                                                Labor Code by Service\r\n                                                Zone\r\n                                            </a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDSLPartsReceived()">Parts Received</a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDSLServiceOrderType()">Service Order Types</a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDSLServiceZoneCode()">Service Zone Codes</a>\r\n                                        </li>\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDSLRecallDueTo()">Recall Due To</a>\r\n                                        </li>\r\n                                        \x3c!-- PBI534 : DSL - Add additional reference tables --\x3e\r\n                                        <li data-id="4" ng-show="vm.isFC || vm.isAdmin" class="dd-item">\r\n                                            <a href="" ng-click="vm.goToDSLWhoPays()">Who Pays</a>\r\n                                        </li>\r\n                                    </ol>\r\n                                </li>\r\n                            </ol>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n            </div>\r\n        </div>\r\n    </div>\r\n    \x3c!--</div>--\x3e\r\n</div>\r\n'),e.put("Templates/ReferenceTables/referenceTable.html",'<div class="page-head">\r\n\r\n    <ol class="breadcrumb">\r\n        <li><a class="cursor_pointer" ng-click="vm.goHome();">Home</a></li>\r\n        <li><a class="cursor_pointer" ng-click="vm.goToRefTable()">Reference Tables</a></li>\r\n        <li class="active">{{vm.tableName}}</li>\r\n    </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n    <h1>{{vm.tableName}}</h1>\r\n</div>\r\n<div class="cl-mcont">\r\n    <div class="row">\r\n        <div class="col-md-12">\r\n\r\n            <div class="block-flat">\r\n                <div class="content">\r\n\r\n                    <div ng-if="apiMethod">\r\n                        <fc-table attributes="vm.attributes" api-method="{{apiMethod}}" on-edit="vm.edit(id)" selected="vm.$scope.selected" table-name="{{tableName}}" confirmation-value-name="{{confirmationValueName}}" />\r\n                    </div>\r\n                    <div ng-if="service" class="table-responsive" style="overflow-x:visible">\r\n                        <div id="datatable-icons_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">\r\n                            <div class="row">\r\n                                <div class="col-sm-6">\r\n                                    <div id="datatable-icons_filter" class="dataTables_filter" style="text-align:left">\r\n                                        <label>Search:<input type="search" class="form-control input-sm" placeholder="" aria-controls="datatable-icons" fc-enter="vm.search()" ng-model="vm.searchText"></label>\r\n                                    </div>\r\n                                </div>\r\n                                <div class="col-sm-6">\r\n                                    <div class="tableBtns text-right">\r\n                                        <button type="submit" class="btn btn-primary" ng-click="vm.edit()">Add New</button>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class="row">\r\n                                <div class="col-sm-12">\r\n                                    <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                                        <thead>\r\n                                            <tr role="row">\r\n                                                \x3c!--<th tabindex="0" aria-controls="datatable-icons" rowspan="1" colspan="1" aria-sort="ascending" aria-label="CustomerId: activate to sort column descending" style="width: 325px;">Assignment Status Id</th>--\x3e\r\n                                                <th ng-repeat="attr in vm.attributes" ng-class="{sorting: attr.Sortable && vm.sortCol != attr.ValueName, sorting_asc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'asc\', sorting_desc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'desc\'}" ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)">{{attr.Name}}</th>\r\n\r\n                                                <th tabindex="0" aria-controls="datatable-icons" rowspan="1" colspan="1" aria-label="Address: activate to sort column ascending" style="width: 50px;text-align:center;padding-right:8px">Action</th>\r\n                                        </thead>\r\n                                        <tbody>\r\n                                            <tr role="row" ng-repeat="item in  vm.items">\r\n\r\n                                                <td ng-repeat="attr in vm.attributes" style="position:relative;height:35px">\r\n                                                    <span ng-if="!attr.CellFormat">\r\n                                                        <a class="cursor_pointer" ng-if="attr.Edit" ng-click="vm.edit(item.Id)">\r\n                                                            {{item[attr.ValueName]}}\r\n                                                        </a>\r\n                                                        <span ng-if="!attr.Edit">\r\n                                                            {{item[attr.ValueName]}}\r\n                                                        </span>\r\n                                                    </span>\r\n                                                    <span ng-if="attr.CellFormat == \'decimal\'">\r\n                                                        <span>\r\n                                                            {{item[attr.ValueName]}}\r\n                                                        </span>\r\n                                                    </span>\r\n                                                    <div ng-if="attr.CellFormat == \'percent\'">\r\n                                                        {{item[attr.ValueName]*100}}%\r\n                                                    </div>\r\n                                                    <div style="width: 100%; height: 100%; vertical-align: middle; display: inline-block" ng-if="attr.CellFormat == \'color\' " ng-style="{\'background-color\': item[attr.ValueName]}">\r\n                                                    </div>\r\n                                                    <div ng-if="attr.CellFormat == \'checkbox\'">\r\n                                                        <div class="checkbox text-center">\r\n                                                            <label>\r\n                                                                <div class="icheckbox_square-blue checkbox cellformatCh" ng-class="{ \'checked\': item[attr.ValueName] }">\r\n                                                                    <input type="checkbox" ng-disabled="true" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                                                    <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                </div>\r\n                                                            </label>\r\n                                                        </div>\r\n                                                    </div>\r\n                                                </td>\r\n\r\n                                                <td style="text-align:center">\r\n                                                    <a class="btn btn-delete" ng-click="vm.remove(item)" data-original-title="Remove" data-toggle="tooltip"><i class="fa fa-times-circle"></i></a>\r\n                                                </td>\r\n                                            </tr>\r\n\r\n                                        </tbody>\r\n                                    </table>\r\n                                </div>\r\n                            </div>\r\n                            \x3c!-- Pagination start --\x3e\r\n                            <div class="row">\r\n                                <fc-paging page="vm.page" page-size="vm.pageSize" current-data-length="vm.items.length" total="vm.total"></fc-paging>\r\n                            </div>\r\n                            <div class="row">\r\n                                <div class="col-sm-5">\r\n                                    <div class="dataTables_length" id="datatable-icons_length">\r\n                                        <label>\r\n                                            Show\r\n                                            <select name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.pageSize">\r\n                                                <option value="10">10</option>\r\n                                                <option value="25">25</option>\r\n                                                <option value="50">50</option>\r\n                                                <option value="100">100</option>\r\n                                            </select> entries\r\n                                        </label>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            \x3c!-- Pagination end --\x3e\r\n                        </div>\r\n                    </div>\r\n                </div>\x3c!-- content --\x3e\r\n            </div>\x3c!-- block-flat --\x3e\r\n        </div>\x3c!-- columns --\x3e\r\n    </div>\x3c!-- row --\x3e\r\n</div>\r\n'),e.put("Templates/ReportBuilder/ReportBuilder.html",'\x3c!-- PBI653 : FCO - Dispatch notifications using SMS - GroundBreakers --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="ReportBuilderController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Report Builder</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Report Builder</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <fc-table table-name="Report Builder"\r\n                                  attributes="vm.attributes"\r\n                                  api-method="reports"\r\n                                  on-edit="vm.edit(id)" />\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>'),e.put("Templates/ReportBuilder/ReportBuilderEdit.html",'\x3c!-- PBI717 : FCO - Labor time to round to nearest quarter hour - DSL-NW --\x3e\r\n<div id="pcont" class="container-fluid" ng-controller="ReportBuilderEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'ReportBuilder\')">Report Builder</a></li>\r\n            <li class="active">{{vm.model.ReportName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Report Builder</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        \x3c!-- LOADING SPINNER --\x3e\r\n        <div ng-hide="!vm.isLoading" class="table-edit-overlay">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        <fc-table-edit api-method="reports"\r\n                       model="vm.model"\r\n                       id="{{vm.id}}"\r\n                       on-back="vm.$state.go(\'ReportBuilder\')"\r\n                       attributes="vm.attributes"\r\n                       hide-submit="true"\r\n                       hide-cancel="true">\r\n        </fc-table-edit>\r\n\r\n        <form name="reports" class="form-horizontal" novalidate style="margin-top: -15px;">\r\n            <div ng-if="!vm.showSections">\r\n                <div class="row" style="padding-left: 15px; padding-right: 20px;">\r\n                    <div class="col-sm-12">\r\n                        <u><strong>Predefined Attributes and Sections:</strong></u><br />\r\n                        <u>Attributes:</u>&nbsp;{{vm.reportAttributes}}<br />\r\n                        <u>Sections:</u>&nbsp;{{vm.reportSections}}<br /><br />\r\n                    </div>\r\n                </div>\r\n                <div class="row" style="padding-left: 15px; padding-right: 20px;">\r\n                    <div class="col-sm-12">\r\n                        <textarea ckeditor="vm.editorOptions" ng-model="vm.model.ReportHTML" ng-change="vm.updateHtml()"></textarea>\r\n                    </div>\r\n                </div>\r\n                <div class="row">\r\n                    <div class="col-sm-offset-6 col-sm-6 col-md-6">\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button type="button" ng-class="{\'disabled\': vm.cancelBlock}" ng-if="vm.isServiceReport"\r\n                                        class="btn btn-default table-edit-cancel-btn"\r\n                                        ng-click="vm.showSectionsEdit()">\r\n                                    {{cancelButtonText || "Edit Sections"}}\r\n                                </button>\r\n                                <button type="button" ng-class="{\'disabled\': vm.cancelBlock}"\r\n                                        class="btn btn-default table-edit-cancel-btn" ng-click="vm.onBack()">\r\n                                    {{\r\ncancelButtonText ||\r\n                                    "Cancel"\r\n                                    }}\r\n                                </button>\r\n                                <button type="button" class="btn btn-primary table-edit-submit-btn push-left"\r\n                                        ng-class="{\'disabled\': vm.submitBlock}" ng-disabled="vm.disableSubmit" ng-click="vm.onSubmit()"\r\n                                        value="Submit">\r\n                                    {{submitButtonText || "Submit"}}\r\n                                </button>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class="row" style="padding-left: 15px; padding-right: 20px;" ng-if="vm.showSections">\r\n                <div ng-controller="ReportSectionController as vs">\r\n                    <form name="reportSection" class="form-horizontal" novalidate>\r\n                        <div class="row" style="padding-left: 15px; padding-right: 20px;">\r\n                            <div class="col-sm-12">\r\n                                <select ng-model="vs.itemSection" ng-change="vs.selectedSection(vs.itemSection)" class=\'form-control\'\r\n                                        ng-options="x.SectionName for x in vs.ReportSectionList">\r\n                                    <option value="">--Select Report Section--</option>\r\n                                </select>\r\n                            </div>\r\n                        </div>\r\n                        <div class="row" ng-show="vs.itemSection != null" ng-hide="vs.itemSection == null" style="padding-left: 15px; padding-right: 20px;">\r\n                            <div class="col-sm-12">\r\n                                <div id="sectionVariables"></div>\r\n                                <br />\r\n                            </div>\r\n                        </div>\r\n                        <div class="row" ng-show="vs.itemSection != null" ng-hide="vs.itemSection == null" style="padding-left: 15px; padding-right: 20px;">\r\n                            <div class="col-sm-12">\r\n                                <textarea ckeditor="vs.editorOptions" ng-model="vs.model.SectionHTML"\r\n                                          ng-change="vs.updateHtml()"></textarea>\r\n                            </div>\r\n                        </div>\r\n                        <div class="row">\r\n                            <div class="col-sm-offset-6 col-sm-6 col-md-6">\r\n                                <div class="form-group">\r\n                                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                        <button type="button" class="btn btn-default table-edit-cancel-btn"\r\n                                                ng-click="vm.hideSectionsEdit()">\r\n                                            Cancel\r\n                                        </button>\r\n                                        <button type="button" ng-show="vs.itemSection != null" ng-hide="vs.itemSection == null"\r\n                                                class="btn btn-primary table-edit-submit-btn push-left"\r\n                                                ng-class="{\'disabled\': vs.submitBlock}" ng-disabled="vs.disableSubmit"\r\n                                                ng-click="vs.onSubmit()" value="Submit">\r\n                                            {{submitButtonText || "Save Section"}}\r\n                                        </button>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        \x3c!--\r\n                        <div class="row" ng-show="vs.itemSection != null" ng-hide="vs.itemSection == null" style="padding-left: 15px; padding-right: 20px;">\r\n                            <div class="col-sm-12">\r\n                                <p><u><strong>Preview:</strong></u></p>\r\n                                <div ng-bind-html="vs.tinymceHtml" style="border-style:dotted; ">\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        --\x3e\r\n                    </form>\r\n                </div>\r\n            </div>\r\n            <div class="row" style="padding-left: 15px; padding-right: 20px;" ng-if="vm.showSections">\r\n                <br />\r\n            </div>\r\n        </form>\r\n    </div>\r\n</div>'),e.put("Templates/RolePermission/rolePermission.html",'<div id="pcont" class="container-fluid" ng-controller="RolePermissionController as vm">\r\n    <div class="table-edit-overlay" ng-show="vm.loadingData">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Role Permission</li>\r\n        </ol>\x3c!-- breadcrumb --\x3e\r\n        <h1>Role Permission</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        \x3c!-- row --\x3e\r\n        <div class="row">\r\n            <div class="col-sm-12 col-lg-12">\r\n                <div class="form-group col-sm-6 col-lg-6">\r\n                    <label class="control-label  col-sm-3 col-md-4 col-lg-3">Role:</label>\r\n                    <div class="col-sm-9 col-md-8 col-lg-9 ">\r\n                        \x3c!--<select ng-model="rolemodel" class="form-control" ng-options="item as item.RoleTypeName for item in roleslist track by item.RoleTypeId"></select>--\x3e\r\n                        <fc-dropdown value="vm.filter.RoleId" filter="vm.roleFilter" api-method="roles" value-prop="Id" text-prop="RoleName"></fc-dropdown>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n        \x3c!-- row --\x3e\r\n        <div class="row form-horizontal">\r\n            \x3c!-- col --\x3e\r\n            <div class="col-md-12">\r\n                \x3c!-- panel-group --\x3e\r\n                <div id="accordion" class="panel-group accordion">\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne">Get<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseOne" class="panel-collapse collapse in">\r\n                            <div class="panel-body">\r\n                                <div class="content">\r\n                                    <form name="foorm" novalidate>\r\n                                        <div class="col-sm-2 col-md-2 col-lg-1">Current role permissions:</div>\r\n                                        <div class="col-sm-3 col-md-3 col-lg-4">\r\n                                            <div>\r\n                                                <select ng-model="rightGet" class="form-control" multiple ng-options="itemg as itemg.Name for itemg in itemsRightGet track by itemg.Id"></select>\r\n                                            </div>\r\n                                            <div class="row  form-horizontal"></div>\r\n                                            <div>\r\n                                                <button class="btn" ng-click="vm.moveLeftGet()">Remove <i class="fa  fa-chevron-circle-right"></i></button>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div class="col-sm-2 col-md-2 col-lg-1">Available permissions:</div>\r\n                                        <div class="col-sm-3 col-md-3 col-lg-4">\r\n                                            <div>\r\n                                                <select ng-model="leftGet" class="form-control" multiple ng-options="itemg as itemg.Name for itemg in itemsLeftGet track by itemg.Id"></select>\r\n                                            </div>\r\n                                            <div class="row  form-horizontal"></div>\r\n                                            <div>\r\n                                                <button class="btn" ng-click="vm.moveRightGet()"><i class="fa  fa-chevron-circle-left"></i> Add </button>\r\n                                            </div>\r\n                                        </div>\r\n                                    </form>\r\n                                </div>\x3c!-- content --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel --\x3e\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo" class="collapsed">Create<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseTwo" class="panel-collapse collapse">\r\n                            <div class="panel-body">\r\n                                <div class="content">\r\n                                    <form name="foorm" novalidate>\r\n                                        <div class="col-sm-2 col-md-2 col-lg-1">Current role permissions:</div>\r\n                                        <div class="col-sm-3 col-md-3 col-lg-4">\r\n                                            <div>\r\n                                                <select ng-model="rightCreate" class="form-control" multiple ng-options="itemc as itemc.Name for itemc in itemsRightCreate track by itemc.Id"></select>\r\n                                            </div>\r\n                                            <div class="row  form-horizontal"></div>\r\n                                            <div>\r\n                                                <button class="btn" ng-click="vm.moveLeftCreate()">Remove <i class="fa  fa-chevron-circle-right"></i></button>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div class="col-sm-2 col-md-2 col-lg-1">Available permissions:</div>\r\n                                        <div class="col-sm-3 col-md-3 col-lg-4">\r\n                                            <div>\r\n                                                <select ng-model="leftCreate" class="form-control" multiple ng-options="itemc as itemc.Name for itemc in itemsLeftCreate track by itemc.Id"></select>\r\n                                            </div>\r\n                                            <div class="row  form-horizontal"></div>\r\n                                            <div>\r\n                                                <button class="btn" ng-click="vm.moveRightCreate()"><i class="fa  fa-chevron-circle-left"></i> Add</button>\r\n                                            </div>\r\n                                        </div>\r\n                                    </form>\r\n                                </div>\x3c!-- content --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel --\x3e\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseThree" class="collapsed">Update<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseThree" class="panel-collapse collapse">\r\n                            <div class="panel-body">\r\n                                <div class="content">\r\n                                    <form name="foorm" novalidate>\r\n                                        <div class="col-sm-2 col-md-2 col-lg-1">Current role permissions:</div>\r\n                                        <div class="col-sm-3 col-md-3 col-lg-4">\r\n                                            <div>\r\n                                                <select ng-model="rightUpdate" class="form-control" multiple ng-options="itemu as itemu.Name for itemu in itemsRightUpdate track by itemu.Id"></select>\r\n                                            </div>\r\n                                            <div class="row form-horizontal">\r\n                                                <button class="btn" ng-click="vm.moveLeftUpdate()">Remove <i class="fa  fa-chevron-circle-right"></i></button>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div class="col-sm-2 col-md-2 col-lg-1">Available permissions:</div>\r\n                                        <div class="col-sm-3 col-md-3 col-lg-4">\r\n                                            <div>\r\n                                                <select ng-model="leftUpdate" class="form-control" multiple ng-options="itemu as itemu.Name for itemu in itemsLeftUpdate track by itemu.Id"></select>\r\n                                            </div>\r\n                                            <div class="row form-horizontal"></div>\r\n                                            <div>\r\n                                                <button class="btn" ng-click="vm.moveRightUpdate()"><i class="fa  fa-chevron-circle-left"></i> Add </button>\r\n                                            </div>\r\n                                        </div>\r\n                                    </form>\r\n                                </div>\x3c!-- content --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel --\x3e\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseFour" class="collapsed">Delete<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseFour" class="panel-collapse collapse">\r\n                            <div class="panel-body">\r\n                                <div class="content">\r\n                                    <form name="foorm" novalidate>\r\n                                        <div class="col-sm-2 col-md-2 col-lg-1">Current role permissions:</div>\r\n                                        <div class="col-sm-3 col-md-3 col-lg-4">\r\n                                            <div>\r\n                                                <select ng-model="rightDelete" class="form-control" multiple ng-options="itemd as itemd.Name for itemd in itemsRightDelete track by itemd.Id"></select>\r\n                                            </div>\r\n                                            <div class="row form-horizontal"></div>\r\n                                            <div>\r\n                                                <button class="btn" ng-click="vm.moveLeftDelete()">Remove <i class="fa  fa-chevron-circle-right"></i></button>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div class="col-sm-2 col-md-2 col-lg-1">Available permissions:</div>\r\n                                        <div class="col-sm-3 col-md-3 col-lg-4">\r\n                                            <div>\r\n                                                <select ng-model="leftDelete" class="form-control" multiple ng-options="itemd as itemd.Name for itemd in itemsLeftDelete track by itemd.Id"></select>\r\n                                            </div>\r\n                                            <div class="row form-horizontal">\r\n                                                <button class="btn" ng-click="vm.moveRightDelete()"><i class="fa  fa-chevron-circle-left"></i> Add </button>\r\n                                            </div>\r\n                                        </div>\r\n                                    </form>\r\n                                </div>\x3c!-- content --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel --\x3e\r\n                </div>\r\n                \x3c!-- panel-group --\x3e\r\n            </div>\r\n            \x3c!-- col --\x3e\r\n            <div class="col-md-12">\r\n                <div class="pull-right"><button class="btn btn-primary" ng-click="vm.submit()">Submit</button></div>\r\n            </div> \r\n            \x3c!-- col --\x3e         \r\n        </div>\r\n    </div>\r\n</div>'),e.put("Templates/ServiceRequest/processServiceRequest.html",'\r\n<div id="pcont" class="container-fluid">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Process Service Requests</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Process Service Requests</h1>\r\n    </div>\r\n    <div class="cl-mcont" ng-controller="ProcessServiceRequestController as vm">\r\n        \x3c!-- LOADING SPINNER --\x3e\r\n        <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        \x3c!-- LOADING SPINNER END --\x3e\r\n        <div class="clearfix CollapsibleTitle">\r\n            <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n        </div>\r\n        <div id="Collapsible" class="collapse in clearfix">\r\n            <div id="hideCancelBtn">\r\n                <fc-table-edit api-method=""\r\n                               model="vm.filtermodel"\r\n                               on-enter="vm.reloadData()"\r\n                               attributes="vm.attributesFilter"\r\n                               on-submit="vm.reloadData()"\r\n                               on-back="clearFilters()"\r\n                               custom-focus="vm.focusOut(attribute)"\r\n                               back-button-text="Clear"\r\n                               submit-button-text="Search">\r\n                </fc-table-edit>\r\n            </div>\r\n        </div>\x3c!-- Collapsible section end --\x3e\r\n\r\n        <div class="row" id="projectTable">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content" id="sprocessServiceRequestGrid">\r\n                        \x3c!-- PBI1024 : FCO - Service Request functionality for Dispatch/Admin/Office - GroundBreakers --\x3e\r\n                        \x3c!-- on-edit="vm.edit(id)" --\x3e\r\n                        <fc-table api-method="servicerequests"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(item)"\r\n                                  ng-if="vm.loadData"\r\n                                  filter="vm.filterServiceRequests">\r\n                        </fc-table>\r\n                    </div>\x3c!-- content   --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>'),e.put("Templates/ServiceRequest/serviceRequest.html",'\r\n<div id="pcont" class="container-fluid">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Service Status</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Service Status</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row" id="agreements">\r\n            <div class="clearfix CollapsibleTitle">\r\n                <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n            </div>\r\n            <div class="col-md-12 ">\r\n                <div class="block-fla">\r\n\r\n                    <div class="content" ng-controller="ServiceRequestController as vm" id="hideactioncol">\r\n                        <div id="Collapsible" class="collapse in clearfix">\r\n\r\n                            \x3c!-- filter: RequestDateFrom --\x3e\r\n                            <div class="col-sm-6 col-md-6 col-lg-6">\r\n                                <div class="form-group datepicker-div" fc-enter="vm.search()">\r\n                                    <label class="control-label nopaddingLeft col-sm-3 col-md-4 col-lg-3">Start Date:</label>\r\n                                    <div data-min-view="2" class="input-group date datetime ccol-sm-5 col-md-4 col-lg-4 " date-time-append="">\r\n                                        <input tabindex="1" name="From Date" type="datetime" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" date-time="" ng-model="vm.filtermodel.RequestDateFrom" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                        <span class="input-group-addon btn btn-white">\r\n                                            <span class="glyphicon glyphicon-calendar"></span>\r\n                                        </span>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n\r\n                            \x3c!-- filter: RequestDateTo --\x3e\r\n                            <div class="col-sm-6 col-md-6 col-lg-6">\r\n                                <div class="form-group datepicker-div" fc-enter="vm.search()">\r\n                                    <label class="control-label nopaddingLeft col-sm-3 col-md-4 col-lg-3">End Date:</label>\r\n                                    <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft5" date-time-append="">\r\n                                        <input tabindex="2" name="To Date" type="datetime" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" date-time="" ng-model="vm.filtermodel.RequestDateTo" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                        <span class="input-group-addon btn btn-white">\r\n                                            <span class="glyphicon glyphicon-calendar"></span>\r\n                                        </span>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n\r\n                            \x3c!-- Filter table edit: AltId, SiteId, ServiceableItemId, WoTypeName --\x3e\r\n                            <fc-table-edit api-method=""\r\n                                           model="vm.filtermodel"\r\n                                           on-enter="vm.search()"\r\n                                           attributes="vm.attributesFilter">\r\n                            </fc-table-edit>\r\n\r\n                            \x3c!-- filter: Status --\x3e\r\n                            <div class="block-flat" ng-init=\'content="sr"\'>\r\n                                <div class="col-sm-10 col-md-10 col-lg-10">\r\n                                    <label class="marginRight10">\r\n                                        <input type="radio" id="srStatusFilter" class="icheck" ng-model="content" value="sr" tabindex="6" ng-click="vm.resetStatusFilter()"> Service Request \r\n                                    </label>\r\n                                    <label>\r\n                                        <input type="radio" id="woStatusFilter" class="icheck" ng-model="content" value="wo" tabindex="7" ng-click="vm.resetStatusFilter()"> Work Order\r\n                                    </label>\r\n                                </div> \x3c!-- input box --\x3e\r\n                                <div class="content" ng-show="content == \'wo\'">\r\n                                    <div class="col-sm-6 col-md-6">\r\n                                        <div class="form-group">\r\n                                            <label class="col-sm-3 col-md-4 col-lg-3 control-label marginTop10">Work Order Status:</label>\r\n                                            <div class="col-sm-7 col-md-6 col-lg-5">\r\n                                                <fc-dropdown tabindex="8"\r\n                                                             on-enter="vm.search()"\r\n                                                             value="vm.filtermodel.Name"\r\n                                                             api-method="wostatuses"\r\n                                                             value-prop="WoStatusName"\r\n                                                             text-prop="WoStatusName"\r\n                                                             convert-to-int="false"\r\n                                                             label="Work Order Status:">\r\n                                                </fc-dropdown>\r\n                                            </div>\r\n                                        </div> \x3c!-- form group --\x3e\r\n                                    </div>\r\n                                </div>\x3c!-- content --\x3e\r\n                                <div class="content" ng-show="content == \'sr\'">\r\n                                    <div class="col-sm-6 col-md-6">\r\n                                        <div class="form-group">\r\n                                            <label class="col-sm-3 col-md-4 col-lg-3 control-label marginTop10">Request Service Status:</label>\r\n                                            <div class="col-sm-7 col-md-6 col-lg-5">\r\n                                                <fc-dropdown tabindex="8"\r\n                                                             on-enter="vm.search()"\r\n                                                             value="vm.filtermodel.Name"\r\n                                                             api-method="statuses"\r\n                                                             value-prop="StatusName"\r\n                                                             text-prop="StatusName"\r\n                                                             convert-to-int="false"\r\n                                                             label="Service Status:"\r\n                                                             Filter="vm.FilterStatus">\r\n                                                </fc-dropdown>\r\n                                            </div>\r\n                                        </div> \x3c!-- form group --\x3e\r\n                                    </div>\r\n                                </div>\x3c!-- content --\x3e\r\n                            </div>\r\n                            <div class="form-group">\r\n                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                    <button type="submit" tabindex="9" class="btn btn-primary" ng-click="vm.search()">Search</button>\r\n                                </div>  \x3c!--input box--\x3e\r\n                            </div>\r\n                        </div> \x3c!--collapsible--\x3e\r\n                        <div id="serviceRequestList">\r\n                            <fc-table api-method="servicerequests/servicerequestlist"\r\n                                      attributes="vm.attributes"\r\n                                      on-second-edit="vm.secondedit(item.WoId, item)"\r\n                                      on-edit="vm.edit(id, item)"\r\n                                      ng-if="vm.loadData"\r\n                                      filter="vm.filters"\r\n                                      view-name="CustomerUserServiceStatus"\r\n                                      value-for-selected="WorkOrder"\r\n                                      module-name="ServiceRequestGrid"\r\n                                      >\r\n                            </fc-table>\r\n                        </div>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ServiceRequest/serviceRequestCopyModal.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 80%; min-height: 25%;">\r\n            \x3c!-- LOADING SPINNER --\x3e\r\n            <div ng-hide="!vm.isLoading" class="table-edit-overlay">\r\n                <div class="sk-circle">\r\n                    <div class="sk-circle1 sk-child"></div>\r\n                    <div class="sk-circle2 sk-child"></div>\r\n                    <div class="sk-circle3 sk-child"></div>\r\n                    <div class="sk-circle4 sk-child"></div>\r\n                    <div class="sk-circle5 sk-child"></div>\r\n                    <div class="sk-circle6 sk-child"></div>\r\n                    <div class="sk-circle7 sk-child"></div>\r\n                    <div class="sk-circle8 sk-child"></div>\r\n                    <div class="sk-circle9 sk-child"></div>\r\n                    <div class="sk-circle10 sk-child"></div>\r\n                    <div class="sk-circle11 sk-child"></div>\r\n                    <div class="sk-circle12 sk-child"></div>\r\n                </div>\r\n            </div>\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n                <h4 class="modal-title">Work Order Copy - Default Assignment</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <fc-table-edit api-method="{{vm.apiMethod}}"\r\n                               id="{{vm.id}}"\r\n                               model="vm.$scope.model"\r\n                               view-name="{{vm.viewName}}"\r\n                               module-name="{{vm.moduleName}}"\r\n                               attributes="vm.attributes"\r\n                               on-back="vm.onBack(insertData)"\r\n                               submit-button-text="Copy"\r\n                               on-submit="vm.onSubmit()">\r\n                </fc-table-edit>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class="modal-backdrop in fade"></div>\r\n</div>'),e.put("Templates/ServiceRequest/serviceRequestEdit.html",'<div id="pcont" class="container-fluid" ng-controller="ServiceRequestEditController as vm">\r\n    \x3c!-- FCWO-2592 : We are able to create same Service Request multiple time --\x3e\r\n    <div class="table-edit-overlay" ng-show="vm.submittingNewServiceRequest">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    \x3c!-- end --\x3e\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li ng-if="!vm.isCustomerSite && !vm.fromHome"><a class="cursor_pointer" ng-click="vm.$state.go(\'serviceRequest\')">Service Status</a></li>\r\n            <li ng-if="vm.isCustomerSite && !vm.fromHome"><a class="cursor_pointer" ng-click="vm.$state.go(\'customerUserSites\')">Site</a></li>\r\n            <li class="active">Request Service</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Request Service</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        \x3c!-- FCWO-2592 : We are able to create same Service Request multiple time\r\n        <fc-table-edit api-method="servicerequests"\r\n                    id="{{vm.id}}"\r\n                    on-submit="vm.submit()"\r\n                    on-back="vm.goBack()"\r\n                    attributes="vm.attributes"\r\n                    model="vm.model">\r\n        </fc-table-edit>\r\n        --\x3e\r\n        <fc-table-edit disable-submit="vm.disableSubmit"\r\n                       api-method="servicerequests"\r\n                       id="{{vm.id}}"\r\n                       on-submit="vm.submit()"\r\n                       on-back="vm.goBack()"\r\n                       attributes="vm.attributes"\r\n                       model="vm.model">\r\n        </fc-table-edit>\r\n        \x3c!-- PBI1051 : FCO - Copy Service Request - GroundBreakers --\x3e\r\n        <div class="row">\r\n            <div class="col-md-6 pageViewAlign" ng-if="vm.model.Id && !vm.customerRoles">\r\n                <button type="button" data-dismiss="modal" class="btn btn-primary btn-flat md-close" ng-click="vm.copyServiceRequest()">Copy</button>\r\n            </div>\r\n        </div>\r\n        \x3c!-- PBI1091 : FCO - Attach Items to Service Request in Customer Portal --\x3e\r\n        <div class="row form-horizontal" ng-show="vm.id">\r\n            <div class="col-md-12">\r\n                <div id="accordion" class="panel-group accordion">\r\n                    <div>\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'serviceRequestAttachmentGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseAttachment" class="collapsed" aria-expanded="false">Attachments<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseAttachment" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.serviceRequestAttachmentGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content">\r\n                                            <fc-table api-method="serviceRequestAttachments"\r\n                                                      attributes="vm.attachmentGridAttributes"\r\n                                                      on-edit="vm.editAttachment(id)"\r\n                                                      filter="vm.serviceRequestFilter"\r\n                                                      ng-if="vm.reloadTable"\r\n                                                      table-name="Attachments"\r\n                                                      show-search="false"></fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                </div>\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n'),e.put("Templates/ServiceRequest/serviceRequestReadOnly.html",'<div id="pcont" class="container-fluid" ng-controller="ServiceRequestReadOnlyController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li ng-if="!vm.isServicRequest && !vm.isCustomerSite"><a class="cursor_pointer" ng-click="vm.$state.go(\'processServiceRequest\')">Process Service Request</a></li>\r\n            <li ng-if="vm.isServicRequest && !vm.isCustomerSite"><a class="cursor_pointer" ng-click="vm.$state.go(\'serviceRequest\')">Service Status</a></li>\r\n            <li ng-if="vm.isCustomerSite"><a class="cursor_pointer" ng-click="vm.$state.go(\'customerUserSites\')">Site</a></li>\r\n            <li class="active"></li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Service Request</h1>\r\n    </div>\r\n    <div class="cl-mcont" id="serviceRequest">\r\n        <fc-table-edit api-method="servicerequests" id="{{vm.id}}" on-back="vm.goBack()" attributes="vm.attributes" model="vm.model" cancel-button-text="{{vm.cancelBtnText}}"></fc-table-edit>\r\n        \x3c!-- PBI1051 : FCO - Copy Service Request - GroundBreakers --\x3e\r\n        <div class="row" ng-if="vm.model.Id && !vm.customerRoles">\r\n            <div class="col-md-6 pageViewAlign">\r\n                <button type="button" data-dismiss="modal" class="btn btn-primary btn-flat md-close" ng-click="vm.copyServiceRequest()">Copy</button>\r\n            </div>\r\n        </div>\r\n        \x3c!-- PBI1091 : FCO - Attach Items to Service Request in Customer Portal --\x3e\r\n        <div class="row form-horizontal" ng-show="vm.id">\r\n            <div class="col-md-12">\r\n                <div id="accordion" class="panel-group accordion">\r\n                    <div>\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'serviceRequestAttachmentGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseAttachment" class="collapsed" aria-expanded="false">Attachments<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseAttachment" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.serviceRequestAttachmentGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content">\r\n                                            <fc-table api-method="serviceRequestAttachments"\r\n                                                      attributes="vm.attachmentGridAttributes"\r\n                                                      on-edit="vm.editAttachment(id)"\r\n                                                      filter="vm.serviceRequestFilter"\r\n                                                      ng-if="vm.reloadTable"\r\n                                                      table-name="Attachments"\r\n                                                      show-search="false"\r\n                                                      show-delete-column=false\r\n                                                      show-add-new=false>\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                </div>\r\n            </div>\r\n        </div>\r\n\r\n        <div class="row form-horizontal">\r\n            <div class="col-md-12" style="margin-top: -45px !important">\r\n                <div id="accordion" class="panel-group accordion" ng-if="vm.model.WorkOrderId">\r\n                    <div ng-controller="ServiceRequestNoteController as wn">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(wn.moduleName) !=\'NoAccess\'">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'notesGrid\')">\r\n                                <h4 class="panel-title">\r\n                                    <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo" class="collapsed" aria-expanded="false">\r\n                                        Notes\r\n\r\n                                        <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                    </a>\r\n                                </h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseTwo" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body">\r\n                                    <div fc-tab="Service Request Notes">\r\n                                        <div>\r\n                                            <fc-table table-name="Service Request Notes"\r\n                                                      api-method="wonotes"\r\n                                                      attributes="wn.attributes"\r\n                                                      on-edit="wn.edit(id, vm.model.WorkOrderId)"\r\n                                                      ng-if="wn.reloadTable"\r\n                                                      filter="vm.filterByWo"\r\n                                                      delete-message-format="Are you sure you want to delete notes  %Note% ?"\r\n                                                      module-name="{{wn.moduleName}}">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                    </div>\r\n\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\r\n\r\n</div>\r\n'),e.put("Templates/SubContractor/AwardSubcontractor/awardSubcontractor.html",'<div id="pcont" class="container-fluid" ng-controller="AwardSubcontractorController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n\r\n            <li class="active">Award Subcontractor Work</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Award Subcontractor Work</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n\r\n        <div class="row" id="awardSub">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <div class="row  form-horizontal">\r\n                            <div class="clearfix CollapsibleTitle">\r\n                                <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                            </div>\r\n\r\n                            <div id="Collapsible" class="collapse in clearfix">\r\n                                <div class="row">\r\n                                    <div class="col-sm-6 col-lg-6">\r\n                                        <div class="form-group">\r\n                                            <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Status:</label>\r\n                                            <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                <select id="selected" ng-model="vm.args.status" class=\'form-control\' fc-enter="vm.get()">\r\n                                                    <option value="" selected></option>\r\n                                                    <option value="Accepted">Accepted</option>\r\n                                                    <option value="Awarded">Awarded</option>\r\n                                                    <option value="Rejected">Rejected</option>\r\n                                                    <option value="Submitted">Submitted</option>\r\n                                                </select>\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class="row">\r\n                                    <div class="col-sm-6 col-lg-6">\r\n                                        <div class="form-group" fc-enter="vm.get()">\r\n                                            <label class="control-label  col-sm-3 col-md-4 col-lg-3">Promised Date Start:</label>\r\n                                            <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 push-right" date-time-append="">\r\n                                                \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                                                \x3c!-- <input name="PromisedDateStart" type="datetime" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" date-time="" ng-model="vm.promisedDateStart" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                                                <input name="PromisedDateStart" onpaste="return false;" type="datetime" restrict-to="{{vm.dateService.restrictToDate()}}" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" date-time="" ng-model="vm.promisedDateStart" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                                \x3c!-- BUG87 : END --\x3e\r\n                                                <span class="input-group-addon btn btn-white">\r\n                                                    <span class="glyphicon glyphicon-calendar"></span>\r\n                                                </span>\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class="col-sm-6 col-lg-6">\r\n                                        <div class="form-group" fc-enter="vm.get()">\r\n                                            <label class="control-label  col-sm-3 col-md-4 col-lg-3">Promised Date End:</label>\r\n                                            <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 " date-time-append="">\r\n                                                \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                                                \x3c!-- <input name="PromisedDateEnd" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.promisedDateEnd" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                                                <input name="PromisedDateEnd" onpaste="return false;" type="datetime" restrict-to="{{vm.dateService.restrictToDate()}}" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.promisedDateEnd" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                                \x3c!-- BUG87 : END --\x3e\r\n                                                <span class="input-group-addon btn btn-white">\r\n                                                    <span class="glyphicon glyphicon-calendar"></span>\r\n                                                </span>\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\r\n\r\n                                </div>\r\n                                <div class="form-group">\r\n                                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                        <button type="submit" class="btn btn-primary" ng-click="vm.get()">Search</button>\r\n                                    </div> \x3c!-- input box --\x3e\r\n                                </div>\r\n                            </div>\x3c!-- Collapsible section end --\x3e\r\n                        </div>\x3c!-- row end --\x3e\r\n                        <div class="cl-mcont">\r\n                            <div class="row">\r\n                                <div class="col-md-12">\r\n                                    <div class="block-flat">\r\n                                        <div class="content">\r\n                                            <div class="row">\r\n                                                <div class="col-sm-12">\r\n                                                    <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                                                        <thead>\r\n                                                            <tr role="row">\r\n                                                                <th ng-repeat="attr in vm.attributes" ng-class="{sorting: attr.Sortable && vm.sortCol != attr.ValueName, sorting_asc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'asc\', sorting_desc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'desc\'}" ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)">{{attr.Name}}</th>\r\n                                                            </tr>\r\n                                                        </thead>\r\n                                                        <tbody>\r\n                                                            <tr role="row" ng-repeat="item in vm.items">\r\n                                                                <td ng-repeat="attr in vm.attributes" style="position: relative">\r\n                                                                    <span ng-if="attr.CellFormat==\'label\'">\r\n                                                                        <span ng-if="attr.FormatDate">{{item[attr.ValueName] | date : \'MM/dd/yyyy hh:mm a\' }}</span>\r\n                                                                        <span ng-if="!attr.FormatDate">{{item[attr.ValueName]}}</span>\r\n                                                                    </span>\r\n                                                                    <span ng-if="attr.CellFormat == \'button\'">\r\n                                                                        <button type="button" class="btn btn-default" ng-click="attr.Action(item)" ng-if="(item.BiddingStatus.trim() !=\'Rejected\' && item.BiddingStatus.trim() !=\'Awarded\') || attr.ValueName ==\'WoAltId\'">\r\n                                                                            <span ng-if="attr.Text">{{attr.Text}}</span>\r\n                                                                            <span ng-if="!attr.Text">{{item[attr.ValueName]}}</span>\r\n                                                                        </button>\r\n                                                                    </span>\r\n                                                                </td>\r\n                                                            </tr>\r\n                                                        </tbody>\r\n                                                    </table>\r\n                                                </div>\r\n                                            </div>\r\n                                            <div class="row">\r\n                                                <fc-paging page="vm.args.page" page-size="vm.args.pageSize" current-data-length="vm.items.length" total="vm.itemsMeta.Paging.TotalCount"></fc-paging>\r\n                                            </div>\r\n                                            <div class="row">\r\n                                                <div class="col-sm-5">\r\n                                                    <div class="dataTables_length" id="datatable-icons_length">\r\n                                                        <label>\r\n                                                            Show\r\n                                                            <select name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.args.pageSize">\r\n                                                                <option value="10">10</option>\r\n                                                                <option value="25">25</option>\r\n                                                                <option value="50">50</option>\r\n                                                                <option value="100">100</option>\r\n                                                            </select> entries\r\n                                                        </label>\r\n                                                    </div>\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n\r\n                        </div>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>'),e.put("Templates/SubContractor/AwardSubcontractor/awardWO.html",'<div id="pcont" class="container-fluid" ng-controller="AcceptWOController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'subcontractorAwardWork\')">Award Work Order</a></li>\r\n            <li class="active"> Work Order Details  </li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Work Order Details</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-6" style="color: #5e94ff">\r\n                <h2>Work Order {{vm.altId}}</h2>\r\n            </div>\r\n            \x3c!--<div class="col-md-6">\r\n                <a href="#" class="pull-right">WO number {{vm.woNumber}}</a>\r\n            </div>--\x3e\r\n        </div>\r\n        <div id="acceptWoDetails">\r\n            <fc-table-edit api-method="wodetails" id="{{vm.id}}" on-back="vm.$state.go(\'subcontractorAwardWork\')" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n            <div class="row  form-horizontal">\r\n\r\n                <div class="col-md-12">\r\n                    <div id="accordionAcceptWO" class="panel-group accordion">\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseOne" aria-expanded="false" class="collapsed"> Assignment<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseOne" class="panel-collapse collapse in" aria-expanded="true">\r\n                                <div class="panel-body">\r\n                                    <div class="block-flat">\r\n                                        <div class="content" ng-controller="AssingmentController as va">\r\n                                            <fc-table api-method="woassignments"\r\n                                                      attributes="va.attributes"\r\n                                                      filter="vm.filter"\r\n                                                      ng-if="va.reloadTable"\r\n                                                      table-name="Assingment"\r\n                                                      delete-message-format="Are you sure you want to delete Assingment %Desc% ?">\r\n\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel --\x3e\r\n\r\n\r\n\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseFour" class="collapsed" aria-expanded="false">Notes<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseFour" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">\r\n                                <div class="panel-body">\r\n\r\n\r\n                                    <div class="block-flat" ng-init=\'content="wo"\'>\r\n                                        <div class="col-sm-9">\r\n                                            <label>\r\n                                                <input type="radio" class="icheck" ng-model="content" value="wo"> Work Order&nbsp;&nbsp;\r\n                                            </label>\r\n                                            <label>\r\n                                                <input type="radio" class="icheck" ng-model="content" value="site"> Site\r\n                                            </label>\r\n                                        </div>\r\n                                        <div class="content" ng-controller="WoNoteController as wn" ng-show="content == \'wo\'">\r\n                                            <fc-table table-name="Work Order Note"\r\n                                                      api-method="wonotes"\r\n                                                      attributes="wn.attributesWoatt"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="wn.reloadTable"\r\n                                                      delete-message-format="Are you sure you want to delete notes  %Note% ?">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                        <div class="content" ng-controller="WoNoteController as sn" ng-show="content == \'site\'">\r\n                                            <fc-table table-name="Site Note"\r\n                                                      api-method="wositenotes"\r\n                                                      attributes="sn.attributesSiatt"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="sn.reloadTable"\r\n                                                      delete-message-format="Are you sure you want to delete notes  %Note% ?">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel 1 --\x3e\r\n\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseThree" class="collapsed" aria-expanded="false">Labor<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseThree" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">\r\n                                <div class="panel-body">\r\n                                    <div class="block-flat">\r\n                                        <div class="content" ng-controller="WoLaborController as vl">\r\n                                            <fc-table api-method="woLabors"\r\n                                                      attributes="vl.attributes"\r\n                                                      filter="vm.filter"\r\n                                                      ng-if="vl.reloadTable"\r\n                                                      table-name="Labor"\r\n                                                      delete-message-format="Are you sure you want to delete the labor  %FullName% ?">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel --\x3e\r\n\r\n\r\n\r\n\r\n\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseSix" class="collapsed" aria-expanded="false">Parts<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseSix" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">\r\n                                <div class="panel-body">\r\n                                    <div class="block-flat">\r\n                                        <div id="partsFilter" class="content" ng-controller="PartsController as parts">\r\n                                            <fc-table-edit api-method="parts"\r\n                                                           attributes="parts.filterAtrtributes"\r\n                                                           model="parts.model"\r\n                                                           filter="parts.filter">\r\n\r\n                                            </fc-table-edit>\r\n                                            <fc-table api-method="parts"\r\n                                                      attributes="parts.attributes"\r\n                                                      filter="parts.filter"\r\n                                                      table-name="Parts"\r\n                                                      ng-if="parts.reloadTable"\r\n                                                      delete-message-format="Are you sure you want to delete the Parts  %ItemName% ?">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel --\x3e\r\n\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseFive" class="collapsed" aria-expanded="false">Miscellaneous<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseFive" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">\r\n                                <div class="panel-body">\r\n                                    <div class="block-flat">\r\n                                        <div id="miscFilter" class="content" ng-controller="MiscController as misc">\r\n                                            <fc-table-edit api-method="miscs"\r\n                                                           attributes="misc.filterAtrtributes"\r\n                                                           model="misc.model"\r\n                                                           filter="misc.filter">\r\n\r\n                                            </fc-table-edit>\r\n                                            <fc-table api-method="miscs"\r\n                                                      attributes="misc.attributes"\r\n                                                      filter="misc.filter"\r\n                                                      table-name="Miscellaneous"\r\n                                                      ng-if="misc.reloadTable"\r\n                                                      delete-message-format="Are you sure you want to delete the Miscellaneous  %ItemName% ?">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel --\x3e\r\n\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseTwo" class="collapsed" aria-expanded="false">Task<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseTwo" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">\r\n                                <div class="panel-body">\r\n\r\n                                    <div class="block-flat">\r\n                                        <div class="content" ng-controller="WoTaskController as wt">\r\n                                            <fc-table api-method="wotasks"\r\n                                                      attributes="wt.attributes"\r\n                                                      filter="vm.filter"\r\n                                                      ng-if="wt.reloadTable"\r\n                                                      table-name="Task"\r\n                                                      delete-message-format="Are you sure you want to delete Task %TaskName% ?">\r\n\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel --\x3e\r\n\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseSeven" class="collapsed" aria-expanded="false">Service Reports<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseSeven" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">\r\n                                <div class="panel-body">\r\n                                    <div class="block-flat">\r\n                                        <div class="content" ng-controller="WoServiceReportController as woservrpts">\r\n                                            <fc-table api-method="woservicereports"\r\n                                                      attributes="woservrpts.attributes"\r\n                                                      filter="vm.filter"\r\n                                                      table-name="ServiceReports"\r\n                                                      ng-if="woservrpts.reloadTable">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel --\x3e\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseEight" class="collapsed" aria-expanded="false">Attachments<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseEight" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">\r\n                                <div class="panel-body">\r\n                                    <div class="block-flat" ng-init=\'content="wo"\'>\r\n                                        \x3c!--<div class="form-group">--\x3e\r\n                                        <div class="col-sm-9">\r\n                                            <label>\r\n                                                <input type="radio" class="icheck" ng-model="content" value="wo"> Work Order&nbsp;&nbsp;\r\n                                            </label>\r\n                                            <label>\r\n                                                <input type="radio" class="icheck" ng-model="content" value="site"> Site\r\n                                            </label>\r\n                                        </div> \x3c!-- input box --\x3e\r\n                                        \x3c!--</div>--\x3e \x3c!-- form group --\x3e\r\n                                        <div class="content" ng-controller="WoAttachmentController as woatt" ng-show="content == \'wo\'">\r\n                                            <fc-table api-method="woattachments"\r\n                                                      attributes="woatt.attributesWoatt"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="woatt.reloadTable"\r\n                                                      table-name="Work Order Attachments">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                        <div class="content" ng-controller="WoAttachmentController as siatt" ng-show="content == \'site\'">\r\n                                            <fc-table api-method="siteattachments"\r\n                                                      attributes="siatt.attributesSiatt"\r\n                                                      filter="vm.filter1"\r\n                                                      ng-if="siatt.reloadTable"\r\n                                                      table-name="Site Attachment">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel --\x3e\r\n                    </div>\x3c!-- accordion --\x3e\r\n\r\n                </div> \x3c!-- columns --\x3e\r\n            </div>\r\n        </div>\r\n    </div>\r\n'),e.put("Templates/SubContractor/SubContractorList/inviteModal.html",'\r\n<div id="myModal" class="fade" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; width: 600px; height:100%">\r\n\r\n        \x3c!-- Modal content--\x3e\r\n        <div class="modal-content" >\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h4 class="modal-title">{{modalTitle}}</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                \x3c!--<fc-table-edit api-method="{{vm.apiMethod}}" id="{{vm.id}}" model="vm.$scope.model" on-back="vm.onBack(insertData)" attributes="vm.attributes" timezone="vm.timezone" ng-if="!vm.submitJoin"></fc-table-edit>\r\n                <fc-table-edit api-method="{{vm.apiMethod}}" id="{{vm.id}}" model="vm.$scope.model" on-back="vm.onBack(insertData)" attributes="vm.attributes" timezone="vm.timezone" on-submit="vm.submitJoin()" ng-if="vm.submitJoin"></fc-table-edit>--\x3e\r\n                \x3c!-- <p>Some text in the modal.</p> --\x3e\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-md-12 col-lg-12 col-sm-12">\r\n                        <div class="form-group">\r\n                            <label for="" class="col-sm-3 col-md-4 col-lg-3 control-label">*Email:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-9">\r\n                                <input id="" type="text" required ng-model="vm.model.Email" class="form-control" ng-blur="vm.emailValidated()" autofocus tabindex="1">\r\n                                <span ng-show="vm.emailInvalid" class="validation">\r\n                                    <span ng-show="vm.emailInvalid">Email is invalid</span>\r\n                                </span>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div>\r\n                        <div class="form-group">\r\n                            <label for="" class="col-sm-3 col-md-4 col-lg-3 control-label">Contact:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-9">\r\n                                <input id="" type="text" required ng-model="vm.model.FirstName" class="form-control"  tabindex="2">\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div>\r\n                        <div class="form-group">\r\n                            <label for="" class="col-sm-3 col-md-4 col-lg-3 control-label">Company:</label>\r\n                            <div class="col-sm-9 col-md-8 col-lg-9">\r\n                                <input id="" type="text" required ng-model="vm.model.SubcontractorName" class="form-control"  tabindex="3">\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div> \x3c!-- form group --\x3e\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-7 col-md-offset-7 col-lg-offset-8 col-sm-5 col-md-5 col-lg-4 text-right">\r\n                                <button type="button" class="btn btn-default table-edit-cancel-btn" ng-click="vm.onBack()">Cancel</button>\r\n                                <button type="button" class="btn btn-primary table-edit-submit-btn" ng-click="vm.submitJoin()" tabindex="4">Submit</button>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div> \x3c!-- form group --\x3e\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n\r\n'),e.put("Templates/SubContractor/SubContractorList/newSubcontractorCompany.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="NewSubcontractorCompanyController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Create Subcontractor Company</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Create Subcontractor Company</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit on-back="vm.$state.go(\'home\')" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n    </div>\r\n</div>'),e.put("Templates/SubContractor/SubContractorList/subContractorList.html",'<div id="pcont" class="container-fluid"  ng-controller="SubContractorListController as vm">\r\n<div class="page-head">\r\n\r\n    <ol class="breadcrumb">\r\n        <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n\r\n        <li class="active">Subcontractor List </li>\r\n    </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n    <h1>Subcontractor List  </h1>\r\n</div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n<div class="cl-mcont">\r\n    <div class="row" >\r\n        <div class="col-md-12">\r\n            <div class="block-flat">\r\n                <div class="content">\r\n                    <div class="clearfix CollapsibleTitle">\r\n                        <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                    </div>\r\n\r\n                    <div id="Collapsible" class="collapse in clearfix">\r\n                        <div class="col-sm-6 col-md-6">\r\n                            <div class="form-group">\r\n                                <label class="col-sm-3 col-md-4 col-lg-3 control-label">Subcontractor List</label>\r\n                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                    <select id="selected" ng-model="vm.filterSubcontractorList.subcontractorList" class=\'form-control\' fc-enter="vm.getSubcontractorList()">\r\n                                        <option value="allSubcontractors">All Subcontractors</option>\r\n                                        <option value="mySubcontractors">My Subcontractors</option>\r\n                                        <option value="unaffiliatedSubcontractors">Unaffiliated Subcontractors</option>\r\n                                    </select>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="col-sm-6 col-md-6">\r\n                            <div class="form-group">\r\n                                <label class="col-sm-3 col-md-4 col-lg-3 control-label">Search</label>\r\n                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                    <input type="text" placeholder="Search" class="form-control" ng-model="vm.filterSubcontractorList.search" fc-enter="vm.getSubcontractorList()">\r\n\r\n                                </div> \x3c!-- input box --\x3e\r\n\r\n                            </div> \x3c!-- form group --\x3e\r\n                        </div>\r\n                        <div class="col-sm-6 col-md-6">\r\n\r\n                            <div class="form-group">\r\n                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Industry</label>\r\n                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                    <select ng-model="vm.filterSubcontractorList.industry" class=\'form-control\' ng-options="industry.Id as industry.IndustryName for industry in vm.industries" multiple fc-enter="vm.getSubcontractorList()"></select>\r\n                                    \x3c!--<fc-multiselect  show-none="All" filter="vm.filterSubcontractorList.industry" api-method="industries" value="Id" text-prop="IndustryName" ></fc-multiselect>--\x3e\r\n                                </div> \x3c!-- input box --\x3e\r\n                            </div> \x3c!-- form group --\x3e\r\n                        </div>\r\n                        <div class="col-sm-6 col-md-6">\r\n                            <div class="form-group">\r\n                                <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">Status</label>\r\n                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                    <select class="form-control" multiple ng-model="vm.filterSubcontractorList.status" fc-enter="vm.getSubcontractorList()">\r\n                                        <option value="Active">Active</option>\r\n                                        <option value="Decline">Decline</option>\r\n                                        <option ng-if="vm.filterSubcontractorList.subcontractorList == \'\' || vm.filterSubcontractorList.subcontractorList == \'unaffiliatedSubcontractors\' || vm.filterSubcontractorList.subcontractorList == \'mySubcontractors\'" value="Inactive">Inactive</option>\r\n                                        <option value="Pending">Pending</option>\r\n                                    </select>\r\n                                </div> \x3c!-- input box --\x3e\r\n                            </div> \x3c!-- form group --\x3e\r\n                            <div class="form-group">\r\n                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                    <br />\r\n                                    <button type="submit" class="btn btn-primary" ng-click="vm.getSubcontractorList()">Search</button>\r\n\r\n                                </div> \x3c!-- input box --\x3e\r\n                            </div> \x3c!-- form group --\x3e\r\n\r\n                        </div> \x3c!-- columns --\x3e\r\n                    </div>\x3c!-- Collapsible section end --\x3e\r\n                        <div class="row">\r\n                            <div class="col-sm-6">\r\n                                <div id="datatable-icons_filter" class="dataTables_filter" style="text-align:left">\r\n                                </div>\r\n                            </div>\r\n                            <div class="col-sm-6">\r\n                                <div class="tableBtns text-right">\r\n                                    <button type="submit" class="btn btn-primary add-new-btn push-left" ng-click="vm.inviteNew()">Invite New</button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    <div class="row">\r\n                        <div class="col-sm-12">\r\n                            <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                                <thead>\r\n                                    <tr role="row">\r\n                                        <th></th>\r\n                                        <th ng-repeat="attr in vm.attributes"\r\n                                            ng-class="{sorting: attr.Sortable && vm.filterSubcontractorList.sortCol != attr.ValueName,\r\n                                                    sorting_asc: attr.Sortable && vm.filterSubcontractorList.sortCol == attr.ValueName && vm.filterSubcontractorList.sortDir == \'asc\',\r\n                                                    sorting_desc: attr.Sortable && vm.filterSubcontractorList.sortCol == attr.ValueName && vm.filterSubcontractorList.sortDir == \'desc\'}"\r\n                                            ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)">\r\n                                            {{attr.Name}}\r\n                                        </th>\r\n                                    </tr>\r\n                                </thead>\r\n                                <tbody>\r\n                                    <tr role="row" ng-repeat="item in vm.SubcontractorList" ng-click="vm.setSelected(item)" ng-class="{active: vm.$scope.selected == item.Id}">\r\n                                        <td>\r\n                                            <button class="btn btn-default" ng-click="vm.invite(item.Id)" ng-if="!item.SubcontractorCompanyStatus || item.SubcontractorCompanyStatus == \'Decline\'">Invite</button>\r\n\t\t\t\t\t\t\t\t\t\t\t<button class="btn btn-default" ng-click="vm.invite(item.Id)" ng-if="item.SubcontractorCompanyStatus == \'Pending\' && item.Id !=0" disabled="disabled">Invite</button>\r\n                                        </td>\r\n                                        <td> {{item.SubcontractorName}} </td>\r\n                                        <td> {{item.SubcontractorMainAddress}} </td>\r\n                                        <td> {{item.SubcontractorContact}} </td>\r\n                                        <td> {{item.SubcontractorCompanyStatus}} </td>\r\n                                        <td> {{item.Industries}} </td>\r\n\r\n                                    </tr>\r\n                                </tbody>\r\n                            </table>\r\n                        </div>\r\n                    </div>\r\n                    \x3c!-- Pagination start --\x3e\r\n                    <div class="row">\r\n                        <fc-paging page="vm.SubcontractorListMeta.Paging.Page" page-size="vm.SubcontractorListMeta.Paging.PageSize" current-data-length="vm.SubcontractorList.length" total="vm.SubcontractorListMeta.Paging.TotalCount"></fc-paging>\r\n                    </div>\r\n                    <div class="row">\r\n                        <div class="col-sm-5">\r\n                            <div class="dataTables_length" id="datatable-icons_length">\r\n                                <label>\r\n                                    Show\r\n                                    <select name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.SubcontractorListMeta.Paging.PageSize">\r\n                                        <option value="10">10</option>\r\n                                        <option value="25">25</option>\r\n                                        <option value="50">50</option>\r\n                                        <option value="100">100</option>\r\n                                    </select> entries\r\n                                </label>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n        </div>\x3c!-- columns --\x3e\r\n    </div>\x3c!-- row --\x3e\r\n      \r\n      \r\n</div>\r\n</div>\r\n'),e.put("Templates/SubContractor/SubContractorList/subcintractorCompanyInfo.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="CompanyInviteController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Company Info</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Company Info</h1>\r\n    </div>\r\n    <div id="companyInvite" class="cl-mcont">\r\n        <fc-table-edit api-method="companyinfos" id="{{vm.urlParams.CompanyId}}" on-back="vm.$state.go(\'home\')" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/SubContractor/SubcontractorAcceptWork/BidForm.html",'<div id="myModal" class="fade" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n        \x3c!-- Modal content--\x3e\r\n        <div class="modal-content" style="overflow-y: auto; height: 50%; width: 90%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h4 class="modal-title">{{modalTitle}}</h4>\r\n            </div>\r\n            <div id="bidForm" class="modal-body">\r\n                <fc-table-edit submit-button-text="Accept" api-method="{{vm.apiMethod}}" id="{{vm.$scope.model.Id}}" model="vm.$scope.model" timezone="vm.timezone" on-back="vm.onBack(insertData)" attributes="vm.attributes" ng-if="!onSubmit"></fc-table-edit>\r\n                <fc-table-edit submit-button-text="Accept" api-method="{{vm.apiMethod}}" id="{{vm.$scope.model.Id}}" model="vm.$scope.model" timezone="vm.timezone" on-back="vm.onBack(insertData)" attributes="vm.attributes" on-submit="onSubmit()" ng-if="onSubmit"></fc-table-edit>\r\n                \x3c!-- <p>Some text in the modal.</p> --\x3e\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/SubContractor/SubcontractorAcceptWork/acceptWO.html",'<div id="pcont" class="container-fluid" ng-controller="AcceptWOController as vm">\r\n            <div class="page-head">\r\n\r\n                <ol class="breadcrumb">\r\n                    <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n                    <li><a class="cursor_pointer" ng-click="vm.$state.go(\'subcontractorAcceptWork\')">Accept Work Order</a></li>\r\n                    <li class="active"> Work Order Details  </li>\r\n                </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n                <h1>Work Order Details</h1>\r\n            </div>\r\n            <div class="cl-mcont">\r\n                <div class="row">\r\n                    <div class="col-md-6" style="color: #5e94ff">\r\n                        <h2>Work Order {{vm.altId}}</h2>\r\n                    </div>\r\n                    \x3c!--<div class="col-md-6">\r\n                    <a href="#" class="pull-right">WO number {{vm.woNumber}}</a>\r\n                </div>--\x3e\r\n                </div>\r\n                <div id="acceptWoDetails">\r\n                <fc-table-edit api-method="wodetails" id="{{vm.id}}" on-back="vm.$state.go(\'subcontractorAcceptWork\')" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n                <div class="row  form-horizontal">\r\n\r\n                    <div class="col-md-12">\r\n                        <div id="accordionAcceptWO" class="panel-group accordion">\r\n                            <div class="panel panel-default">\r\n                                <div class="panel-heading">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseOne" aria-expanded="false" class="collapsed"> Assignment<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseOne" class="panel-collapse collapse in" aria-expanded="true">\r\n                                    <div class="panel-body">\r\n                                        <div class="block-flat">\r\n                                            <div class="content" ng-controller="AssingmentController as va">\r\n                                                <fc-table api-method="woassignments"\r\n                                                          attributes="va.attributes"\r\n                                                        \r\n                                                          filter="vm.filter"\r\n                                                          ng-if="va.reloadTable"\r\n                                                          table-name="Assingment"\r\n                                                          delete-message-format="Are you sure you want to delete Assingment %Desc% ?">\r\n\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel --\x3e\r\n\r\n\r\n\r\n                            <div class="panel panel-default">\r\n                                <div class="panel-heading">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseFour" class="collapsed" aria-expanded="false">Notes<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseFour" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">\r\n                                    <div class="panel-body">\r\n\r\n\r\n                                        <div class="block-flat" ng-init=\'content="wo"\'>\r\n                                            <div class="col-sm-9">\r\n                                                <label>\r\n                                                    <input type="radio" class="icheck" ng-model="content" value="wo"> Work Order&nbsp;&nbsp;\r\n                                                </label>\r\n                                                <label>\r\n                                                    <input type="radio" class="icheck" ng-model="content" value="site"> Site\r\n                                                </label>\r\n                                            </div>\r\n                                            <div class="content" ng-controller="WoNoteController as wn" ng-show="content == \'wo\'">\r\n                                                <fc-table table-name="Work Order Note"\r\n                                                          api-method="wonotes"\r\n                                                          attributes="wn.attributesWoatt"\r\n                                                       \r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          ng-if="wn.reloadTable"\r\n                                                          delete-message-format="Are you sure you want to delete notes  %Note% ?">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                            <div class="content" ng-controller="WoNoteController as sn" ng-show="content == \'site\'">\r\n                                                <fc-table table-name="Site Note"\r\n                                                          api-method="wositenotes"\r\n                                                          attributes="sn.attributesSiatt"\r\n                                                       \r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          ng-if="sn.reloadTable"\r\n                                                          delete-message-format="Are you sure you want to delete notes  %Note% ?">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel 1 --\x3e\r\n\r\n                            <div class="panel panel-default">\r\n                                <div class="panel-heading">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseThree" class="collapsed" aria-expanded="false">Labor<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseThree" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">\r\n                                    <div class="panel-body">\r\n                                        <div class="block-flat">\r\n                                            <div class="content" ng-controller="WoLaborController as vl">\r\n                                                <fc-table api-method="woLabors"\r\n                                                          attributes="vl.attributes"\r\n                                                         \r\n                                                          filter="vm.filter"\r\n                                                          ng-if="vl.reloadTable"\r\n                                                          table-name="Labor"\r\n                                                          delete-message-format="Are you sure you want to delete the labor  %FullName% ?">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel --\x3e\r\n\r\n\r\n\r\n\r\n\r\n                            <div class="panel panel-default">\r\n                                <div class="panel-heading">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseSix" class="collapsed" aria-expanded="false">Parts<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseSix" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">\r\n                                    <div class="panel-body">\r\n                                        <div class="block-flat">\r\n                                            <div id="partsFilter" class="content" ng-controller="PartsController as parts">\r\n                                                <fc-table-edit api-method="parts"\r\n                                                               attributes="parts.filterAtrtributes"\r\n                                                               model="parts.model"\r\n                                                               filter="parts.filter">\r\n\r\n                                                </fc-table-edit>\r\n                                                <fc-table api-method="parts"\r\n                                                          attributes="parts.attributes"\r\n                                                        \r\n                                                          filter="parts.filter"\r\n                                                          table-name="Parts"\r\n                                                          ng-if="parts.reloadTable"\r\n                                                          delete-message-format="Are you sure you want to delete the Parts  %ItemName% ?">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel --\x3e\r\n\r\n                            <div class="panel panel-default">\r\n                                <div class="panel-heading">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseFive" class="collapsed" aria-expanded="false">Miscellaneous<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseFive" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">\r\n                                    <div class="panel-body">\r\n                                        <div class="block-flat">\r\n                                            <div id="miscFilter" class="content" ng-controller="MiscController as misc">\r\n                                                <fc-table-edit api-method="miscs"\r\n                                                               attributes="misc.filterAtrtributes"\r\n                                                               model="misc.model"\r\n                                                               filter="misc.filter">\r\n\r\n                                                </fc-table-edit>\r\n                                                <fc-table api-method="miscs"\r\n                                                          attributes="misc.attributes"\r\n                                                         \r\n                                                          filter="misc.filter"\r\n                                                          table-name="Miscellaneous"\r\n                                                          ng-if="misc.reloadTable"\r\n                                                          delete-message-format="Are you sure you want to delete the Miscellaneous  %ItemName% ?">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel --\x3e\r\n\r\n                            <div class="panel panel-default">\r\n                                <div class="panel-heading">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseTwo" class="collapsed" aria-expanded="false">Task<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseTwo" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">\r\n                                    <div class="panel-body">\r\n\r\n                                        <div class="block-flat">\r\n                                            <div class="content" ng-controller="WoTaskController as wt">\r\n                                                <fc-table api-method="wotasks"\r\n                                                          attributes="wt.attributes"\r\n                                                         \r\n                                                          filter="vm.filter"\r\n                                                          ng-if="wt.reloadTable"\r\n                                                          table-name="Task"\r\n                                                          delete-message-format="Are you sure you want to delete Task %TaskName% ?">\r\n\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel --\x3e\r\n\r\n                            <div class="panel panel-default">\r\n                                <div class="panel-heading">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseSeven" class="collapsed" aria-expanded="false">Service Reports<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseSeven" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">\r\n                                    <div class="panel-body">\r\n                                        <div class="block-flat">\r\n                                            <div class="content" ng-controller="WoServiceReportController as woservrpts">\r\n                                                <fc-table api-method="woservicereports"\r\n                                                          attributes="woservrpts.attributes"\r\n                                                         \r\n                                                          filter="vm.filter"\r\n                                                          table-name="ServiceReports"\r\n                                                          ng-if="woservrpts.reloadTable">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel --\x3e\r\n                            <div class="panel panel-default">\r\n                                <div class="panel-heading">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="/workOrdersDetails{{id}}#collapseEight" class="collapsed" aria-expanded="false">Attachments<i class="fa  fa-chevron-circle-down pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseEight" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">\r\n                                    <div class="panel-body">\r\n                                        <div class="block-flat" ng-init=\'content="wo"\'>\r\n                                            \x3c!--<div class="form-group">--\x3e\r\n                                            <div class="col-sm-9">\r\n                                                <label>\r\n                                                    <input type="radio" class="icheck" ng-model="content" value="wo"> Work Order&nbsp;&nbsp;\r\n                                                </label>\r\n                                                <label>\r\n                                                    <input type="radio" class="icheck" ng-model="content" value="site"> Site\r\n                                                </label>\r\n                                            </div> \x3c!-- input box --\x3e\r\n                                            \x3c!--</div>--\x3e \x3c!-- form group --\x3e\r\n                                            <div class="content" ng-controller="WoAttachmentController as woatt" ng-show="content == \'wo\'">\r\n                                                <fc-table api-method="woattachments"\r\n                                                          attributes="woatt.attributesWoatt"\r\n                                                        \r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          ng-if="woatt.reloadTable"\r\n                                                          table-name="Work Order Attachments">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                            <div class="content" ng-controller="WoAttachmentController as siatt" ng-show="content == \'site\'">\r\n                                                <fc-table api-method="siteattachments"\r\n                                                          attributes="siatt.attributesSiatt"\r\n                                                         \r\n                                                          filter="vm.filter1"\r\n                                                          ng-if="siatt.reloadTable"\r\n                                                          table-name="Site Attachment">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel --\x3e\r\n                        </div>\x3c!-- accordion --\x3e\r\n\r\n                    </div> \x3c!-- columns --\x3e\r\n                </div>\r\n            </div>\r\n        </div>\r\n'),e.put("Templates/SubContractor/SubcontractorAcceptWork/subcontractorAcceptWork.html",'<div id="pcont" class="container-fluid" ng-controller="SubcontractorAcceptWorkController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Accept Work Order</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>List of Submitted Work Orders</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <div class="row">\r\n                            <div class="col-md-12">\r\n                                <a class="pull-right cursor_pointer" ng-show="vm.awarded" ng-click="vm.$state.go(\'subcontractorWorkOrdersDetails\',{ id: vm.woIdTemp })">Open Work Order {{vm.woAltIdTemp}}</a>\r\n                            </div>\r\n                        </div>\r\n                        <div class="row">\r\n                            <div class="col-sm-12">\r\n                                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                                    <thead>\r\n                                        <tr role="row">\r\n                                            <th ng-repeat="attr in vm.attributes" ng-class="{sorting: attr.Sortable && vm.sortCol != attr.ValueName, sorting_asc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'asc\', sorting_desc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'desc\'}" ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)">{{attr.Name}}</th>\r\n                                        </tr>\r\n                                    </thead>\r\n                                    <tbody>\r\n                                        <tr role="row" ng-repeat="item in vm.items">\r\n                                            <td ng-repeat="attr in vm.attributes" style="position: relative">\r\n                                                <span ng-if="attr.CellFormat==\'label\'">\r\n                                                    <span ng-if="attr.FormatDate">{{item[attr.ValueName] | date : \'MM/dd/ hh:mm a\' }}</span>\r\n                                                    <span ng-if="!attr.FormatDate">{{item[attr.ValueName]}}</span>  \r\n                                                </span>\r\n                                                <span ng-if="attr.CellFormat == \'button\'">\r\n                                                    <button type="button" class="btn btn-default" ng-click="attr.Action(item)">\r\n                                                        <span ng-if="attr.Text">{{attr.Text}}</span>\r\n                                                        <span ng-if="!attr.Text">{{item[attr.ValueName]}}</span>\r\n                                                    </button>\r\n                                                </span>\r\n                                            </td>\r\n                                        </tr>\r\n                                    </tbody>\r\n                                </table>\r\n                            </div>\r\n                        </div>\r\n                        <div class="row">\r\n                            <fc-paging page="vm.args.page" page-size="vm.args.pageSize" current-data-length="vm.items.length" total="vm.itemsMeta.Paging.TotalCount"></fc-paging>\r\n                        </div>\r\n                        <div class="row">\r\n                            <div class="col-sm-5">\r\n                                <div class="dataTables_length" id="datatable-icons_length">\r\n                                    <label>\r\n                                        Show\r\n                                        <select name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.args.pageSize">\r\n                                            <option value="10">10</option>\r\n                                            <option value="25">25</option>\r\n                                            <option value="50">50</option>\r\n                                            <option value="100">100</option>\r\n                                        </select> entries\r\n                                    </label>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/SubContractor/SubcontractorBid/bidPopUp.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px;">\r\n        <div class="modal-content invite-modal">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h4 class="modal-title">Add Not to Exceed Amount</h4>\r\n            </div>\r\n            <form name="userForm" ng-submit="vm.submit()">\r\n                <div class="row">\r\n                    <div class="col-sm-12 col-lg-12">\r\n                        <label class="control-lable col-sm-3 col-md-4 col-lg-3">Not to Exceed Amount:</label>\r\n                        <div class="col-sm-6 col-md-5 col-lg-4">\r\n                            \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                            \x3c!-- <input class="form-control" type="number" placeholder="Not to Exceed Amount" ng-model="vm.model.NotToExceedAmount" maxlength="50" step="0.01" min="0" /> --\x3e\r\n                            <input class="form-control" type="number" onwheel="this.blur()" placeholder="Not to Exceed Amount" ng-model="vm.model.NotToExceedAmount" maxlength="50" step="0.01" min="0" />\r\n                            \x3c!-- BUG32 : END --\x3e\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class="row">\r\n                    <div class="col-sm-offset-6 col-sm-6 col-md-6">\r\n\r\n                        <div class="form-group">\r\n                            <br /><br /><br /><br />\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button type="button" class="btn btn-default table-edit-cancel-btn" ng-click="vm.onBack()">Cancel</button>\r\n                                <button type="submit" class="btn btn-primary table-edit-submit-btn" value="Submit">Submit</button>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div> \x3c!-- form group --\x3e\r\n\r\n                    </div> \x3c!-- columns --\x3e\r\n                </div>\r\n            </form>\r\n        </div>\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade"></div>'),e.put("Templates/SubContractor/SubcontractorBid/subcontractorBid.html",'<div id="pcont" class="container-fluid" ng-controller="SubcontractorBidController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'manageWorkOrders\')">Manage Work Orders</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.goBack()">Work Order Details</a></li>\r\n            <li class="active">Company Subcontractors</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Subcontractors</h1>\r\n        \r\n    </div>\r\n        <div class="cl-mcont">\r\n            <div class="row">\r\n                <div class="col-md-12">\r\n                    <div class="block-flat">\r\n                        <div class="content">\r\n                            <div class="row">\r\n                                <div class="col-sm-6">\r\n                                    <div id="datatable-icons_filter" class="dataTables_filter" style="text-align: left">\r\n                                        <label>Search:<input type="search" class="form-control input-sm" placeholder="" aria-controls="datatable-icons" fc-enter="vm.get()" ng-model="vm.args.searchText"></label>\r\n                                    </div>\r\n                                </div>\r\n                                <div class="col-sm-6">\r\n                                    <div class="col-sm-12">\r\n                                        <div class="tableBtns text-right">\r\n                                            <a class="cursor_pointer" ng-click="vm.goBack()">Go Back</a>\r\n                                            <button type="submit" class="btn btn-primary" ng-click="vm.submitForBidding()">Submit for Bids</button>\r\n                                            <button type="submit" class="btn" ng-click="vm.assign()" ng-disabled="vm.assignButtonDisabled">Assign Work Order</button>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class="row">\r\n                                <div class="col-sm-12">\r\n                                    <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                                        <thead>\r\n                                            <tr role="row">\r\n                                                <th ng-repeat="attr in vm.attributes" ng-class="{sorting: attr.Sortable && vm.sortCol != attr.ValueName, sorting_asc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'asc\', sorting_desc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'desc\'}" ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)">{{attr.Name}}</th>\r\n                                            </tr>\r\n                                        </thead>\r\n                                        <tbody>\r\n                                            <tr role="row" ng-repeat="item in vm.items">\r\n                                                <td ng-repeat="attr in vm.attributes" style="position: relative">\r\n                                                    <span ng-if="attr.CellFormat==\'checkbox\'">\r\n                                                        <input type="checkbox" ng-model="item.Checked" ng-change="vm.checkboxChanged(item)" />\r\n                                                    </span>\r\n                                                    <span ng-if="attr.CellFormat==\'label\'">\r\n                                                        {{item[attr.ValueName]}}\r\n                                                    </span>\r\n                                                </td>\r\n                                            </tr>\r\n                                        </tbody>\r\n                                    </table>\r\n                                </div>\r\n                            </div>\r\n                            <div class="row">\r\n                                <fc-paging page="vm.args.page" page-size="vm.args.pageSize" current-data-length="vm.items.length" total="vm.itemsMeta.Paging.TotalCount"></fc-paging>\r\n                            </div>\r\n                            <div class="row">\r\n                                <div class="col-sm-5">\r\n                                    <div class="dataTables_length" id="datatable-icons_length">\r\n                                        <label>\r\n                                            Show\r\n                                            <select name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.args.pageSize">\r\n                                                <option value="10">10</option>\r\n                                                <option value="25">25</option>\r\n                                                <option value="50">50</option>\r\n                                                <option value="100">100</option>\r\n                                            </select> entries\r\n                                        </label>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n\r\n        </div>\r\n    </div>\r\n\r\n'),e.put("Templates/Subscription/Payments/companypayments.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="PaymentCompanyController as vm"  ng-show="false">\r\n    <div class="page-head" >\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Payments</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1> Process Payments</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="block-flat">\r\n            <div class="content">\r\n                <form id="submitForm" name="sendMerchant" method="POST"  action="{{vm.model.url}}">\r\n                    <input type="text" name="ssl_merchant_id" ng-model="vm.model.ssl_merchant_id" />\r\n                    <input type="text" name="ssl_user_id" ng-model="vm.model.ssl_user_id" />\r\n                    <input type="text" name="ssl_pin" ng-model="vm.model.ssl_pin" />\r\n                    <input type="text" name="ssl_transaction_type" ng-model="vm.model.ssl_transaction_type" />\r\n                    <input type="text" name="ssl_show_form" ng-model="vm.model.ssl_show_form" />\r\n                    <input type="text" name="ssl_amount" ng-model="vm.model.ssl_amount" />\r\n                    <input type="text" name="ssl_cvv2cvc2" ng-model="vm.model.ssl_cvv2cvc2" />\r\n                    <input type="text" name="ssl_email" ng-model="vm.model.ssl_email" />\r\n                    <input type="text" name="ssl_company" ng-model="vm.model.ssl_company" />\r\n                    <input type="text" name="token" ng-model="vm.model.token" />\r\n                </form>\r\n            </div>\r\n        </div>\r\n    </div>\r\n        </div>\r\n'),e.put("Templates/Subscription/SubscriptionPlan/subscriptionPlan.html",'<div id="pcont" class="container-fluid" ng-controller="SubscriptionPlanController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Subscription Plan</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Subscription Plan</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <fc-table api-method="subscriptionplans"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)"\r\n                                  >\r\n                        </fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>'),e.put("Templates/Subscription/SubscriptionPlan/subscriptionPlanEdit.html",'<div id="pcont" class="container-fluid"  ng-controller="SubscriptionPlanEditController as vm">\r\n<div class="page-head">\r\n\r\n    <ol class="breadcrumb">\r\n        <li><a class="cursor_pointer" ng-click="vm.goHome()">Home</a></li>\r\n        <li><a class="cursor_pointer" ng-click="vm.goBack()">Subscription Plan </a></li>\r\n        <li class="active">{{vm.model.Plan}}</li>\r\n    </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n    <h1>Subscription Plan  </h1>\r\n</div>\r\n<div class="cl-mcont">\r\n    <form class="form-horizontal" name="vm.subscription" ng-submit="vm.createUpdate()" novalidate >\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <div class="col-sm-6 col-md-6" >\r\n                            <div class="form-group" >\r\n                                <label class="col-sm-3 col-md-4 col-lg-3 control-label">*Subscription Plan</label>\r\n                                <div class="col-sm-7 col-md-6 col-lg-5" ng-class="{ \'has-error\': vm.formValidation.plan}" fc-focusout="vm.formValidation.plan = vm.subscription.plan.$error.required && vm.subscription.plan.$dirty">\r\n                                    <input type="text" placeholder="" name="plan" class="form-control" ng-model="vm.model.Plan"  required>\r\n                                    <span ng-show="vm.formValidation.plan" class="validation">This field is required</span>\r\n                                </div> \x3c!-- input box --\x3e\r\n                            </div> \x3c!-- form group --\x3e\r\n                        </div>\r\n                        <div class="col-sm-6 col-md-6">\r\n                            <div class="form-group">\r\n                                <label class="col-sm-3 col-md-4 col-lg-3 control-label">*Description</label>\r\n                                <div class="col-sm-7 col-md-6 col-lg-5"  ng-class="{ \'has-error\': vm.subscription.desc.$error.required && required}" fc-focusout="vm.formValidation.desc = vm.subscription.desc.$error.required && vm.subscription.desc.$dirty">\r\n                                    <textarea class="form-control" name="desc" ng-model="vm.model.Desc" required></textarea>\r\n                                    <span ng-show="vm.formValidation.desc" class="validation">This field is required</span>\r\n                                </div> \x3c!-- input box --\x3e\r\n                            </div> \x3c!-- form group --\x3e\r\n                        </div>\r\n                        <div class="col-sm-6 col-md-6">\r\n                            <div class="form-group">\r\n                                <label class="col-sm-3 col-md-4 col-lg-3 control-label">*Subscription Type</label>\r\n                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                    <select id="selected" ng-init="vm.model.Type = \'User\' " ng-model="vm.model.Type" class=\'form-control\'>\r\n                                        <option value="User">User</option>\r\n                                        <option value="Transaction">Transaction</option>\r\n                                    </select>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="col-sm-6 col-md-6" ng-show="vm.showMonths">\r\n                            <div class="form-group">\r\n                                <label class="col-sm-3 col-md-4 col-lg-3 control-label" >*Months</label>\r\n                                <div class="col-sm-7 col-md-6 col-lg-5" ng-class="{ \'has-error\': vm.formValidation.month}" fc-focusout="vm.formValidation.month = vm.subscription.month.$error.required && vm.subscription.month.$dirty">\r\n                                    \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                                    \x3c!-- <input type="number" class="form-control" name="month" ng-model="vm.model.Months" ng-required="vm.showMonths"> --\x3e\r\n                                    <input type="number" onwheel="this.blur()" class="form-control" name="month" ng-model="vm.model.Months" ng-required="vm.showMonths">\r\n                                    \x3c!-- BUG32 : END --\x3e\r\n                                    <span ng-show="vm.formValidation.month" class="validation">This field is required</span>\r\n                                </div> \x3c!-- input box --\x3e\r\n                            </div> \x3c!-- form group --\x3e\r\n                        </div>\r\n                        <div class="col-sm-6 col-md-6" ng-show="vm.showMonths">\r\n                            <div class="form-group">\r\n                                <label class="col-sm-3 col-md-4 col-lg-3 control-label">Minimum Users</label>\r\n                                <div class="col-sm-7 col-md-6 col-lg-5">\r\n                                    \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                                    \x3c!-- <input type="number" class="form-control" ng-model="vm.model.MinimumUsers"> --\x3e\r\n                                    <input type="number" onwheel="this.blur()" class="form-control" ng-model="vm.model.MinimumUsers">\r\n                                    \x3c!-- BUG32 : END --\x3e\r\n                                </div> \x3c!-- input box --\x3e\r\n                            </div> \x3c!-- form group --\x3e\r\n                        </div>\r\n                        <div class="col-sm-6 col-md-6" ng-show="vm.showTransaction">\r\n                            <div class="form-group">\r\n                                <label class="col-sm-3 col-md-4 col-lg-3 control-label" >*Transactions</label>\r\n                                <div class="col-sm-7 col-md-6 col-lg-5" ng-class="{ \'has-error\': vm.formValidation.transactions}" fc-focusout="vm.formValidation.transactions = vm.subscription.transactions.$error.required && vm.subscription.transactions.$dirty">\r\n                                    \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                                    \x3c!-- <input type="number" class="form-control" name="transactions" ng-model="vm.model.Transactions" ng-required="vm.showTransaction"> --\x3e\r\n                                    <input type="number" onwheel="this.blur()" class="form-control" name="transactions" ng-model="vm.model.Transactions" ng-required="vm.showTransaction">\r\n                                    \x3c!-- BUG32 : END --\x3e\r\n                                    <span ng-show="vm.formValidation.transactions" class="validation">This field is required</span>\r\n                                </div> \x3c!-- input box --\x3e\r\n                            </div> \x3c!-- form group --\x3e\r\n                        </div>\r\n                        <div class="col-sm-6 col-md-6">\r\n                            <div class="form-group">\r\n                                <label class="col-sm-3 col-md-4 col-lg-3 control-label" required>*Billing Option</label>\r\n                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                    <select id="selected" ng-init="vm.model.BillingOption = \'CreditCardOnly\' " ng-model="vm.model.BillingOption" class=\'form-control\'>\r\n                                        <option value="InvoiceOnly">Invoice Only</option>\r\n                                        <option value="CreditCardOnly">Credit Card Only</option>\r\n                                        <option value="Both">Both</option>\r\n                                    </select>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class="col-sm-6 col-md-6 marginLeft12">\r\n                            <div class="form-group checkbox">\r\n                                <label>\r\n                                    <div class=" icheckbox_square-blue checkbox" ng-class="{ \'checked\':vm.model.Trial }">\r\n                                        <input type="checkbox" ng-model="vm.model.Trial" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                        <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                    </div>\r\n                                    Trial\r\n                                </label>\r\n                            </div> \x3c!-- form group --\x3e\r\n                        </div>\r\n                        <div class="col-sm-6 col-md-6">\r\n                            <div class="form-group">\r\n                                <label class="col-sm-3 col-md-4 col-lg-3 control-label">Auto Renew Trigger</label>\r\n                                <div class="col-sm-7 col-md-6 col-lg-5">\r\n                                    \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                                    \x3c!-- <input type="number" class="form-control" ng-model="vm.model.AutoRenewTrigger"> --\x3e\r\n                                    <input type="number" onwheel="this.blur()" class="form-control" ng-model="vm.model.AutoRenewTrigger">\r\n                                    \x3c!-- BUG32 : END --\x3e\r\n                                </div> \x3c!-- input box --\x3e\r\n                            </div> \x3c!-- form group --\x3e\r\n                        </div>\r\n                        <div class="col-sm-6 col-md-6 marginLeft12">\r\n                            <div class="form-group checkbox">\r\n                                <label>\r\n                                    <div class=" icheckbox_square-blue checkbox" ng-class="{ \'checked\':vm.model.AutoRenew }">\r\n                                        <input type="checkbox" ng-model="vm.model.AutoRenew" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                        <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                    </div>\r\n                                    Auto Renew\r\n                                </label>\r\n                            </div> \x3c!-- form group --\x3e\r\n                        </div>\r\n                        <div class="col-sm-6 col-md-6">\r\n                            <div class="form-group">\r\n                                <label class="col-sm-3 col-md-4 col-lg-3 control-label" >{{vm.labelPrice}}</label>\r\n                                <div class="col-sm-7 col-md-6 col-lg-5" ng-class="{ \'has-error\': vm.formValidation.price}" fc-focusout="vm.formValidation.price = vm.subscription.price.$error.required && vm.subscription.price.$dirty">\r\n                                    <input type="text" currency-input ng-disabled="vm.disablePrice" class="form-control" name="price" step="0.01" ng-model="vm.model.Price" required>\r\n                                    <span ng-show="vm.formValidation.price" class="validation">This field is required</span>\r\n                                </div> \x3c!-- input box --\x3e\r\n                            </div> \x3c!-- form group --\x3e\r\n                        </div>\r\n                        <div class="col-sm-6 col-md-6">\r\n                        </div>\r\n                        <div class="col-sm-6 col-md-6">\r\n                            <div class="form-group">\r\n                                <label class="col-sm-3 col-md-4 col-lg-3 control-label" required>Status*</label>\r\n                                <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                    <select id="selected" ng-init="vm.model.Status = \'Active\' " ng-model="vm.model.Status" class=\'form-control\'>\r\n                                        <option value="Active">Active</option>\r\n                                        <option value="Inactive">Inactive</option>\r\n                                    </select>\r\n                                </div>\r\n                            </div>\r\n                            <div class="form-group">\r\n                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                    <br />\r\n                                    <button type="button" class="btn btn-default" ng-click="vm.goBack()">Cancel</button>\r\n                                    <button type="submit" class="btn btn-primary">Submit</button>\r\n\r\n                                </div> \x3c!-- input box --\x3e\r\n                            </div> \x3c!-- form group --\x3e\r\n\r\n                        </div> \x3c!-- columns --\x3e\r\n\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n\r\n        </form>\r\n</div>\r\n</div>\r\n'),e.put("Templates/Subscription/SubscriptionTransactionBased/subscriptionTransactionBased.html",'<div id="pcont" class="container-fluid" ng-controller="SubscriptionTransactionBasedController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'subscription\')">Subscription</a></li>\r\n            \r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Select a Subscription Plan</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="block-flat">\r\n            <div class="content">\r\n                <div id="subscriptionBased">\r\n                    <fc-table-edit api-method="subscriptionTransactionBased" id="{{vm.id}}" on-back="vm.$state.go(\'\')" attributes="vm.attributes" model="vm.model" submit-button-text="Proceed to Checkout" on-submit="vm.onSubmit()"></fc-table-edit>\r\n                   \r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n        </div>\r\n'),e.put("Templates/Subscription/SubscriptionUserBased/subscriptionUserBased.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="SubscriptionUserBased as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'subscription\')">Subscription</a></li>\r\n            <li class="active">Subscription User Based</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Subscription User Based</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div id="subscriptionBased">\r\n            <fc-table-edit api-method="subscriptionUserBased" id="{{vm.id}}" on-back="vm.$state.go(\'\')" attributes="vm.attributes" model="vm.model" submit-button-text="Proceed to Checkout" on-submit="vm.onSubmit()"></fc-table-edit>\r\n            <h3 ng-if="vm.model.SubscriptionPlanId"> Total Price is {{vm.model.UserCount*vm.model.TmpPrice | number:2}} for {{vm.StartDate}} to {{vm.EndDate}} </h3>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Subscription/subscriptionEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="SubscriptionEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'subscription\')">Subscription</a></li>\r\n            <li class="active">Subscription Details</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Subscription Details</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="subscriptions" id="{{vm.id}}" on-back="vm.$state.go(\'subscription\')" attributes="vm.attributes" model="vm.model" ></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Subscription/subscriptions.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="SubscriptionController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Subscription</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Subscription</h1>\r\n    </div>\r\n    \x3c!-- LOADING SPINNER --\x3e\r\n    <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="block-flat">\r\n            <div class="content">\r\n                <div id="subscriptionReview">\r\n                    <div class="clearfix CollapsibleTitle">\r\n                        <button type="button" class="btn btn-info pull-right Collapsible collapsed" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                    </div>\r\n                    <div id="Collapsible" class="collapse clearfix">\r\n                        <fc-table-edit api-method=""\r\n                                       model="vm.model"\r\n                                       on-enter="vm.search()"\r\n                                       attributes="vm.attributesFilter">\r\n                        </fc-table-edit>\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right subscriptionSearchBtn">\r\n                            <button type="button" class="btn btn-primary" ng-click="vm.search()">Search</button><br /><br /><br />\r\n                        </div>\r\n                    </div>\r\n                    <div id="subscription">\r\n                        <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right pull-right addTransactionPlanBtn">\r\n                            <button type="button" class="btn btn-primary" ng-click="vm.goToTransactions()" ng-if="vm.isFC || vm.showTransAdmin">Add Transactions</button>\r\n                            <button type="button" class="btn btn-primary" ng-click="vm.goToUserSubscription()" ng-if="vm.isFC || vm.showAdmin">Add Users</button>\r\n                        </div>\r\n                        <fc-table api-method="subscriptions/getSubscriptionForReview"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)"\r\n                                  filter="vm.filterSubscription">\r\n                        </fc-table>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Utils/autoCompleteTable.html",'<div id="{{vm.ddgId}}" class="dropdown">\r\n    <input ng-if="vm.readOnly" autocomplete="off" fc-autofocus="vm.autofocus" readonly id="{{vm.inputId}}" type="text" ng-disabled="vm.readOnly" tabindex="{{fcTabindex}}" class="form-control" placeholder="{{vm.placeholder}}" aria-controls="datatable-icons" ng-model="vm.$scope.value" />\r\n    <input ng-if="!vm.readOnly" autocomplete="off" fc-autofocus="vm.autofocus" id="{{vm.inputId}}" type="text" ng-disabled="vm.readOnly" tabindex="{{fcTabindex}}" class="form-control" placeholder="{{vm.placeholder}}" aria-controls="datatable-icons" ng-change="vm.search()" ng-blur="vm.toggleDdg()" ng-model="vm.$scope.value" />\r\n    <div ng-if="!vm.readOnly" ng-blur="vm.toggleDdg()" id="{{vm.scrollDiv}}" infinite-scroll="vm.getData()" style="margin:0px; padding:0px; z-index:1050; background-color:white; width: auto; height: auto; max-height:400px; overflow-x:hidden; position:absolute;" class="dropdown-menu content scrollable scroll-loader" can-load="vm.canLoad" threshold="0">\r\n        <table ng-if="!vm.readOnly" id="{{vm.tableId}}" class="table table-hover" style="margin:0px; padding:0px; width:100%; top:0px; z-index:1050;" aria-labelledby="dropdownddl">\r\n            <thead ng-if="vm.showHeader" id="{{vm.ddgHeaderId}}" style="position:relative; top:0px; width: 100%;">\r\n                <tr role="row">\r\n                    <th ng-repeat="attr in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true" class="{{attr.CustomHeaderClass}}">{{attr.Name}}</th>\r\n                </tr>\r\n            </thead>\r\n            <tbody>\r\n                <tr id="{{vm.tableId + \'_\' + $index}}" style="position:relative;" class="table table-hover cursor_pointer" ng-repeat="item in  vm.items" ng-click="vm.setSelected(item)" ng-mousedown="vm.setSelected(item, $event)">\r\n                    <td ng-repeat="attr in vm.attributes" style="position:relative; height:40px;" class="{{attr.CustomCellClass}}">\r\n\r\n                        <span ng-if="attr.CellFormat==\'label\'">\r\n                            <span style="font-size:small" ng-if="attr.FormatDate">{{item[attr.ValueName] | date : \'MM/dd/yyyy hh:mm a\' }}</span>\r\n                            <span style="font-size:small" ng-if="!attr.FormatDate">{{item[attr.ValueName]}}</span>\r\n                        </span>\r\n                        <div ng-if="attr.CellFormat == \'checkbox\'">\r\n                            <div class="checkbox text-center">\r\n                                <label>\r\n                                    <div class="icheckbox_square-blue checkbox cellformatCh" ng-class="{ \'checked\': item[attr.ValueName] }">\r\n                                        <input type="checkbox" ng-disabled="true" class="icheck" style="position:absolute; opacity: 0;" />\r\n                                        <ins style="position:absolute; top:0%; left:0%; display:block; width:100%; height:100%; margin:0px; padding:0px; background:rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                    </div>\r\n                                </label>\r\n                            </div>\r\n                        </div>\r\n                        <div style="font-size:small" ng-if="attr.CellFormat == \'percent\'">\r\n                            {{item[attr.ValueName]*100 | number:0}}%\r\n                        </div>\r\n                    </td>\r\n                </tr>\r\n            </tbody>\r\n        </table>\r\n    </div>\r\n</div>'),e.put("Templates/Utils/barcodeScan.html",'\x3c!-- US2797 : FCO - Web - Allow parts association to barcode --\x3e\r\n<div id="myModal" class="fade" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div id="barcode-modal-dialog" class="modal-dialog" ng-class="{\'barcode-modal-dialog-desktop\': !vm.isMobile, \'barcode-modal-dialog-mobile\': vm.isMobile}" ng-if="vm.useCamera">\r\n        \x3c!-- Modal content--\x3e\r\n        <div class="modal-content barcode-modal-content">\r\n            <div class="modal-header">\r\n                <button class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h4 class="modal-title">{{modalTitle}}</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <div id="interactive" ng-class="{\'viewport-desktop\': !vm.isMobile, \'viewport-mobile\': vm.isMobile}"></div>                \r\n            </div>\r\n        </div>\r\n    </div>\r\n    \x3c!-- US2869 : FCO - Web - Non-camera barcode scanning support --\x3e\r\n    <div id="barcode-modal-dialog" class="modal-dialog barcode-modal-dialog-scanner" ng-if="!vm.useCamera">\r\n        \x3c!-- Modal content--\x3e\r\n        <div class="modal-content barcode-modal-content">\r\n            <div class="modal-header">\r\n                <button class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h4 class="modal-title">{{modalTitle}}</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <div id="interactive" class="viewport-scanner">\r\n                    <fc-table-edit attributes="vm.attributes"\r\n                                   model="vm.model"\r\n                                   hide-submit=true\r\n                                   hide-cancel=true>\r\n                    </fc-table-edit>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/Utils/drilldown.html",'<table class="drilldown" cellspacing="0" cellpading="5" border="0" style="padding-left:50px">\r\n    <tbody>\r\n        <tr>\r\n            <th ng-repeat="attr in options.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true" class="{{attr.CustomHeaderClass}}">\r\n                {{attr.Name}}\r\n            </th>\r\n            \x3c!-- PBI1044 : FCO - Work Order Tasks --\x3e\r\n            \x3c!-- added ng-if="vm.showDeleteColumn" --\x3e\r\n            <th tabindex="0" ng-if="vm.showDeleteColumn" class="action-col" aria-controls="datatable-icons" rowspan="1" colspan="1" aria-label="Address: activate to sort column ascending" style="width: 50px;text-align:center;padding-right:8px">Action</th>\r\n        </tr>\r\n        <tr class="cursor_pointer grid-table-hover" ng-repeat="item in vm.items">\r\n            <td ng-repeat="attr in options.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true" ng-click="vm.edit(item.Id)" class="{{attr.CustomCellClass}}">\r\n                <span ng-if="!attr.CellFormat">\r\n                    <a class="cursor_pointer" ng-if="attr.Edit" ng-click="vm.edit(item.Id)">\r\n                        {{item[attr.ValueName]}}\r\n                    </a>\r\n                    <span ng-if="!attr.Edit">\r\n                        {{item[attr.ValueName]}}\r\n                    </span>\r\n                </span>\r\n                <div ng-if="attr.CellFormat == \'checkbox\'">\r\n                    <div class="checkbox text-center">\r\n                        <label>\r\n                            <div class="icheckbox_square-blue checkbox cellformatCh" ng-class="{ \'checked\': item[attr.ValueName] }">\r\n                                <input type="checkbox" ng-disabled="true" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                            </div>\r\n                        </label>\r\n                    </div>\r\n                </div>\r\n                <div ng-if="attr.CellFormat == \'template\'">\r\n                    <ng-include src="attr.CellFormatData.TemplateUrl"></ng-include>\r\n                </div>\r\n                <div ng-if="attr.CellFormat == \'percent\'">\r\n                    {{item[attr.ValueName]*100 | number:0}}%\r\n                </div>\r\n                <div ng-if="attr.CellFormat == \'link\'">\r\n                    <a class="cursor_pointer" ng-click="vm.go(item.Id)">{{item[attr.ValueName]}}</a>\r\n                </div>\r\n            </td>\r\n            \x3c!-- PBI1044 : FCO - Work Order Tasks --\x3e\r\n            \x3c!-- added ng-if="vm.showDeleteColumn" --\x3e\r\n            <td style="text-align:center" ng-if="vm.showDeleteColumn" class="action-col">\r\n                <a class="btn btn-delete" ng-click="vm.remove(item.Id)" data-original-title="Remove" data-toggle="tooltip"><i class="fa fa-times-circle"></i></a>\r\n            </td>\r\n        </tr>\r\n    </tbody>\r\n</table>\r\n\x3c!-- <div class="tableBtns text-right">\r\n    <button class="btn btn-primary" ng-click="vm.edit()">Add New</button>\r\n</div> --\x3e\r\n'),e.put("Templates/Utils/editableDrillDownItemRecursive.html",'<div class="drilldown" style="overflow-x:visible">\r\n    <div id="datatable-icons_wrapper" class="dataTables_wrapper  dt-bootstrap no-footer">\r\n        <div class="row">\r\n            <div class="col-sm-12">\r\n                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr role="row">\r\n                            <th style="width: 25px" class="center">\r\n\r\n                            </th>\r\n                            <th ng-repeat="attr in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true" class="{{attr.CustomHeaderClass}}" ng-class="{sorting: attr.Sortable && vm.sortCol != attr.ValueName, sorting_asc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'asc\', sorting_desc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'desc\'}" ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)">{{attr.Name}}</th>\r\n                        </tr>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr role="row" ng-repeat-start="item in vm.tree  track by $index" ng-init="itemIndex = $index">\r\n                            <td style="text-align:center">\r\n                                <img class="toggle-details" ng-if="vm.drilldownOpen[$index] && item.Objects" src="Content/img/drill-down-arrow-up.png" ng-click="vm.toggleDrilldown($index)" />\r\n                                <img class="toggle-details" ng-if="!vm.drilldownOpen[$index] && item.Objects" src="Content/img/drill-down-arrow-b.png" ng-click="vm.toggleDrilldown($index)" />\r\n                            </td>\r\n                            <td ng-repeat="attribute in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true" style="position:relative;height:40px" class="{{attr.CustomCellClass}}">\r\n                                <span ng-if="attribute.Type === \'label\'">\r\n                                    {{item[attribute.ValueName]}}\r\n                                </span>\r\n                                \x3c!-- Text --\x3e\r\n                                <input type="text" name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'text\'" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n\r\n                                \x3c!-- Email --\x3e\r\n                                <input type="text" name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'email\'" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n\r\n                                \x3c!-- Int --\x3e\r\n                                \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                                \x3c!-- <input type="number" decimal decimals="0" name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'int\'" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" /> --\x3e\r\n                                <input type="number" onwheel="this.blur()" decimal decimals="0" name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'int\'" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                                \x3c!-- BUG32 : END --\x3e\r\n                                \x3c!-- Decimal --\x3e\r\n                                <input type="text" decimal name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\'  && item.Type === \'decimal\'" fc-autofocus="attribute.Autofocus" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n\r\n                                \x3c!-- Dropdown --\x3e\r\n                                <span ng-if="attribute.Type === \'editable\' && item.Type === \'dropdown\'" style="width:100% !important">\r\n                                    <fc-dropdown name="{{vm.model[item.Name]}}" ng-model="vm.model[item.Name]" filter="item.Filter" value="vm.model[item.Name]" api-method="{{item.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" convert-to-int="{{attribute.ConvertToInt}}" label="{{item.Required?"*":""}}" list="item.List"></fc-dropdown>\r\n\r\n                                </span>\r\n                                \x3c!-- Checkbox --\x3e\r\n                                <div class="form-inline">\r\n                                    <div class="form-group checkbox" ng-if="attribute.Type === \'editable\'  && item.Type === \'checkbox\'">\r\n                                        <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                            <div aria-disabled="false" aria-checked="{{vm.model[item.ModelValue]}}" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': vm.model[item.ModelValue]}" fc-focusout="vm.customFocus(attribute)">\r\n                                                <input type="checkbox" ng-model="vm.model[item.ModelValue]" fc-autofocus="attribute.Autofocus" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                            </div>\r\n                                        </label>\r\n                                    </div>\r\n                                </div>\r\n\r\n                            </td>\r\n                        </tr>\r\n                        <tr ng-repeat-end ng-if="vm.drilldownOpen[$index]" class="details">\r\n                            <td class="details" colspan="{{vm.attributes.length + 2}}">\r\n                                <fc-editable-drill-down-item-recursive attributes="vm.attributes"\r\n                                                                       tree="item.Objects">\r\n                                </fc-editable-drill-down-item-recursive>\r\n\r\n                            </td>\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>'),e.put("Templates/Utils/editableDrillDownRecursive.html",'\r\n\r\n<div class="drilldown" style="overflow-x:visible">\r\n    <div id="datatable-icons_wrapper" class="dataTables_wrapper  dt-bootstrap no-footer">\r\n        <div class="row">\r\n            <div class="col-sm-6">\r\n                <div id="datatable-icons_filter" class="dataTables_filter" style="text-align:left">\r\n                    <label>Search:<i id="search-info" class="fa fa-info-circle" style="display: none"></i><input type="search" class="form-control input-sm" placeholder="" aria-controls="datatable-icons" fc-enter="vm.search()" ng-model="vm.searchText"></label>\r\n                </div>\r\n            </div>\r\n            <div class="col-sm-6">\r\n            </div>\r\n        </div>\r\n\r\n        <div class="row">\r\n            <div class="col-sm-12">\r\n                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr role="row">\r\n                            <th style="width: 25px" class="center">\r\n\r\n                            </th>\r\n                            <th ng-repeat="attr in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true" class="{{attr.CustomHeaderClass}}" ng-class="{sorting: attr.Sortable && vm.sortCol != attr.ValueName, sorting_asc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'asc\', sorting_desc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'desc\'}" ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)">{{attr.Name}}</th>\r\n\r\n                            <th tabindex="0" class="action-col" aria-controls="datatable-icons" rowspan="1" colspan="1" aria-label="Address: activate to sort column ascending" style="width: 50px;text-align:center;padding-right:8px">Action</th>\r\n                        </tr>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr role="row" ng-repeat-start="item in  vm.items" ng-class="{active: vm.$scope.selected == item.Id}" ng-init="itemIndex = $index">\r\n                            <td style="text-align:center">\r\n                                <img class="toggle-details" ng-if="vm.drilldownOpen[$index] && item.HasChild" src="Content/img/drill-down-arrow-up.png" ng-click="vm.toggleDrilldown($index)" />\r\n                                <img class="toggle-details" ng-if="!vm.drilldownOpen[$index] && item.HasChild" src="Content/img/drill-down-arrow-b.png" ng-click="vm.toggleDrilldown($index, item)" />\r\n                            </td>\r\n                            <td ng-repeat="attribute in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true" style="position:relative;height:40px" class="{{attr.CustomCellClass}}">\r\n                                <span ng-if="attribute.Type === \'label\'">\r\n                                    {{item[attribute.ValueName]}}\r\n                                </span>\r\n                                \x3c!-- Text --\x3e\r\n                                <input type="text" name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'text\'" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n\r\n                                \x3c!-- Email --\x3e\r\n                                <input type="text" name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'email\'" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n\r\n                                \x3c!-- Int --\x3e\r\n                                \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                                \x3c!-- <input type="number" decimal decimals="0" name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'int\'" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" /> --\x3e\r\n                                <input type="number" onwheel="this.blur()" decimal decimals="0" name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'int\'" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                                \x3c!-- BUG32 : END --\x3e\r\n                                \x3c!-- Decimal --\x3e\r\n                                <input type="text" decimal name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\'  && item.Type === \'decimal\'" fc-autofocus="attribute.Autofocus" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n\r\n                                \x3c!-- Dropdown --\x3e\r\n                                <span ng-if="attribute.Type === \'editable\' && item.Type === \'dropdown\'" style="width:100% !important">\r\n                                    <fc-dropdown name="{{vm.model[attribute.ValueName]}}" ng-model="vm.model[attribute.ValueName]" filter="item.Filter" value="item[attribute.Value]" api-method="{{item.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" convert-to-int="{{attribute.ConvertToInt}}" label="{{attribute.Required?"*":""}}" list="item[attribute.List]"></fc-dropdown>\r\n                                </span>\r\n\r\n                                \x3c!-- Checkbox --\x3e\r\n                                \x3c!-- <div ng-if="attribute.Type === \'editable\'  && item.Type === \'checkbox\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">--\x3e\r\n                                <div class="form-inline">\r\n                                    <div class="form-group checkbox" ng-if="attribute.Type === \'editable\'  && item.Type === \'checkbox\'">\r\n                                        <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                            <div aria-disabled="false" aria-checked="{{vm.model[item.ModelValue]}}" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': vm.model[item.ModelValue]}" fc-focusout="vm.customFocus(attribute)">\r\n                                                <input type="checkbox" ng-model="vm.model[item.ModelValue]" fc-autofocus="attribute.Autofocus" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                            </div>\r\n                                        </label>\r\n                                    </div>\r\n                                </div>\r\n                                \x3c!-- </div> --\x3e\r\n\r\n                            </td>\r\n\r\n                            <td style="text-align:center" class="action-col">\r\n                                <button type="button" id="enableBtn" ng-if="vm.isChanged(item)" class="btn btn-primary table-edit-submit-btn" ng-class="{\'disabled\': vm.submitBlock}" ng-click="vm.onSubmit(item)" value="Submit">{{submitButtonText || "Submit"}}</button>\r\n                                <button type="button" id="disableBtn" ng-if="!vm.isChanged(item)" class="btn btn-default table-edit-submit-btn" ng-class="{\'disabled\': vm.submitBlock}" ng-click="vm.onSubmit(item)" disabled value="Submit">{{submitButtonText || "Submit"}}</button>\r\n                            </td>\r\n                        </tr>\r\n                        <tr ng-repeat-end ng-if="vm.drilldownOpen[$index]" class="details">\r\n                            <td class="details" colspan="{{vm.attributes.length + 2}}">\r\n                                <fc-editable-drill-down-item-recursive \r\n                                                                       attributes="vm.childAttributes"\r\n                                                                       ng-if="item.Objects"\r\n                                                                       tree="item.Objects">\r\n                                </fc-editable-drill-down-item-recursive>\r\n\r\n                            </td>\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\r\n        </div>\r\n        \x3c!-- Pagination start --\x3e\r\n        <div class="row" style="margin:0px;">\r\n            <fc-paging page="vm.page" page-size="vm.pageSize" current-data-length="vm.items.length" total="vm.total"></fc-paging>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-sm-5">\r\n                <div class="dataTables_length" id="datatable-icons_length">\r\n                    <label>\r\n                        Show\r\n                        <select name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.pageSize">\r\n                            <option value="10">10</option>\r\n                            <option value="25">25</option>\r\n                            <option value="50">50</option>\r\n                            <option value="100">100</option>\r\n                        </select> entries\r\n                    </label>\r\n                </div>\r\n            </div>\r\n        </div>\r\n        \x3c!-- Pagination end --\x3e\r\n    </div>\r\n</div>'),e.put("Templates/Utils/editableTable.html",'<div class="table-responsive" style="overflow-x:visible">\r\n    <div id="datatable-icons_wrapper" class="dataTables_wrapper  dt-bootstrap no-footer">\r\n        <div class="row">\r\n            <div class="col-sm-6">\r\n                <div id="datatable-icons_filter" class="dataTables_filter" style="text-align:left">\r\n                    <label>Search:<i id="search-info" class="fa fa-info-circle" style="display: none"></i><input type="search" class="form-control input-sm" placeholder="" aria-controls="datatable-icons" fc-enter="vm.search()" ng-model="vm.searchText"></label>\r\n                </div>\r\n            </div>\r\n            <div class="col-sm-6">\r\n                \x3c!--<div class="tableBtns text-right">\r\n                    <button type="submit" class="btn btn-primary add-new-btn" ng-click="vm.edit()">{{addButtonText || "Add New"}}</button>\r\n                </div>--\x3e\r\n            </div>\r\n        </div>\r\n       \r\n         <div class="row">\r\n            <div class="col-sm-12">\r\n                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr role="row">\r\n                            <th ng-repeat="attr in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true" class="{{attr.CustomHeaderClass}}" ng-class="{sorting: attr.Sortable && vm.sortCol != attr.ValueName, sorting_asc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'asc\', sorting_desc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'desc\'}" ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)">{{attr.Name}}</th>\r\n\r\n                            <th tabindex="0" class="action-col" aria-controls="datatable-icons" rowspan="1" colspan="1" aria-label="Address: activate to sort column ascending" style="width: 50px;text-align:center;padding-right:8px">Action</th>\r\n                        </tr>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr role="row" ng-repeat="item in  vm.items">\r\n                            <td ng-repeat="attribute in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true" style="position:relative;height:40px" class="{{attr.CustomCellClass}}">\r\n                                <span ng-if="attribute.Type === \'label\'">\r\n                                    {{item[attribute.ValueName]}}\r\n                                </span>\r\n                                \x3c!-- PBI283 : FCO Maps --\x3e\r\n                                \x3c!-- Password --\x3e\r\n                                <input type="password" name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'password\'" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n\r\n                                \x3c!-- Text --\x3e\r\n                                <input type="text" name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'text\'" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                                \x3c!--<div ng-if="attribute.Type === \'editable\' && item.Type === \'text\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n        <div class="form-group" >\r\n            <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}</label>\r\n            <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}">\r\n                <input type="text" name="{{item.ModelValue}}" ng-if="item.Required" required maxlength="{{item.MaxLength}}" ng-model="vm.model[item.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                <input type="text" name="{{item.ModelValue}}" ng-if="!item.Required" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                <span ng-show="vm.formValidation[item.ModelValue].Required"> This field is required</span>\r\n                <span ng-show="vm.formValidation[item.ModelValue].Error" class="validation">This field is required</span>\r\n            </div>\r\n        </div>\r\n    </div>--\x3e\r\n                                \x3c!-- Email --\x3e\r\n                                <input type="text" name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'email\'" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                                \x3c!--<div ng-if="attribute.Type === \'editable\' && item.Type === \'email\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': item.Required && vm.formValidation[item.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n        <div class="form-group" >\r\n            <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}</label>\r\n            <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                <input type="text" name="{{item.ModelValue}}" ng-if="item.Required" required maxlength="{{item.MaxLength}}" ng-model="vm.model[item.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                <input type="text" name="{{item.ModelValue}}" ng-if="!item.Required" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                <span ng-show="vm.formValidation[attribute.ModelValue].Error" class="validation">\r\n                    <span ng-show="vm.formValidation[item.ModelValue].Required"> This field is required</span>\r\n                    <span ng-show="vm.formValidation[item.ModelValue].Email">Email is invalid</span>\r\n                </span>\r\n            </div>\r\n        </div>\r\n    </div>--\x3e\r\n                                \x3c!-- Int --\x3e\r\n                                \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                                \x3c!-- <input type="number" decimal decimals="0" name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'int\'" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" /> --\x3e\r\n                                <input type="number" onwheel="this.blur()" decimal decimals="0" name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'int\'" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                                \x3c!-- BUG32 : END --\x3e\r\n                                \x3c!--<div ng-if="attribute.Type === \'editable\' && item.Type === \'int\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': item.Required && vm.formValidation[item.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n        <div class="form-group" >\r\n            <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}</label>\r\n            <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                <input type="number" decimal decimals="0" name="{{item.ModelValue}}" ng-if="item.Required" required ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                <input type="number" decimal decimals="0" name="{{item.ModelValue}}" ng-if="!item.Required" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                <span ng-show="vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n            </div>\r\n        </div>\r\n    </div>--\x3e\r\n                                \x3c!-- Decimal --\x3e\r\n                                <input type="text" decimal name="{{vm.model[item.ModelValue]}}" ng-if="attribute.Type === \'editable\'  && item.Type === \'decimal\'" fc-autofocus="attribute.Autofocus" ng-model="vm.model[item.ModelValue]" maxlength="{{item.MaxLength}}" step="{{item.Step ==\'\' ? 0.01 : item.Step}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                                \x3c!--<div ng-if="attribute.Type === \'editable\'  && item.Type === \'decimal\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': item.Required && vm.formValidation[item.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n        <div class="form-group" >\r\n            <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}</label>\r\n            <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                <input type="text" decimal name="{{item.ModelValue}}" ng-if="item.Required && !item.ReadOnly" fc-autofocus="attribute.Autofocus" required ng-model="vm.model[attribute.ModelValue]" maxlength="{{item.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                <input type="text" decimal name="{{item.ModelValue}}" ng-if="!item.Required && !item.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" maxlength="{{item.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n\r\n                <span ng-show="item.Required && vm.formValidation[item.ModelValue].Error" class="validation">This field is required</span>\r\n            </div>\r\n        </div>\r\n    </div>--\x3e\r\n                                \x3c!-- Dropdown --\x3e\r\n                                <span ng-if="attribute.Type === \'editable\' && item.Type === \'dropdown\'" style="width:100% !important">\r\n                                    <fc-dropdown name="{{item.Value}}" filter="item.Filter" value="vm.model[item.ModelValue]" api-method="{{item.ApiMethod}}" value-prop="{{item.ValueProp}}" text-prop="{{item.TextProp}}" convert-to-int="{{item.ConvertToInt}}" label="{{item.Required?"*":""}}" current-list="attribute.CurrentList" list="attribute.List"></fc-dropdown>\r\n                                </span>\r\n\r\n                                \x3c!--<div ng-if="attribute.Type === \'editable\'  && item.Type === \'dropdown\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': item.Required && vm.formValidation[item.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n        <div class="form-group" >\r\n            <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{item.Required?"*":""}}</label>\r\n            <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                <fc-dropdown name="{{item.ModelValue}}" plural="{{item.Plural}}" ng-if="item.Required" silent="item.Silent" fc-disabled="item.ReadOnly" list="item.List" filter="item.Filter" value="vm.model[item.ModelValue]" api-method="{{item.ApiMethod}}" value-prop="{{item.ValueProp}}" text-prop="{{item.TextProp}}" required="true" convert-to-int="{{item.ConvertToInt}}" label="{{item.Required?"*":""}}" current-list="attribute.CurrentList" ></fc-dropdown>\r\n                <fc-dropdown name="{{item.ModelValue}}" plural="{{item.Plural}}" ng-if="!item.Required" fc-disabled="item.ReadOnly" list="item.List" filter="item.Filter" value="vm.model[item.ModelValue]" api-method="{{item.ApiMethod}}" value-prop="{{item.ValueProp}}" text-prop="{{item.TextProp}}" convert-to-int="{{item.ConvertToInt}}" label="{{item.Required?"*":""}}" current-list="attribute.CurrentList"></fc-dropdown>\r\n                <span ng-show="item.Required && vm.formValidation[item.ModelValue].Error" class="validation">This field is required</span>\r\n            </div>\r\n        </div>\r\n    </div>--\x3e\r\n                                \x3c!-- Checkbox --\x3e\r\n                                \x3c!-- <div ng-if="attribute.Type === \'editable\'  && item.Type === \'checkbox\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">--\x3e\r\n                                <div class="form-inline">\r\n                                    <div class="form-group checkbox" ng-if="attribute.Type === \'editable\'  && item.Type === \'checkbox\'">\r\n                                        <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                            <div aria-disabled="false" aria-checked="{{vm.model[item.ModelValue]}}" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': vm.model[item.ModelValue]}" fc-focusout="vm.customFocus(attribute)">\r\n                                                <input type="checkbox" ng-model="vm.model[item.ModelValue]" fc-autofocus="attribute.Autofocus" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                            </div>\r\n                                        </label>\r\n                                    </div>\r\n                                </div>\r\n                                \x3c!-- </div> --\x3e\r\n\r\n                            </td>\r\n\r\n                            <td style="text-align:center" class="action-col">\r\n                                <button type="button" ng-if="item.Value != vm.model[item.ModelValue]" class="btn btn-primary table-edit-submit-btn" ng-class="{\'disabled\': vm.submitBlock}" ng-click="vm.onSubmit(item)" value="Submit">{{submitButtonText || "Submit"}}</button>\r\n                                <button type="button" ng-if="item.Value == vm.model[item.ModelValue]" class="btn btn-default table-edit-submit-btn" ng-class="{\'disabled\': vm.submitBlock}" ng-click="vm.onSubmit(item)" disabled value="Submit">{{submitButtonText || "Submit"}}</button>\r\n                            </td>\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\r\n        </div>\r\n        \x3c!-- Pagination start --\x3e\r\n        <div class="row" style="margin:0px;">\r\n            <fc-paging page="vm.page" page-size="vm.pageSize" current-data-length="vm.items.length" total="vm.total"></fc-paging>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-sm-5">\r\n                <div class="dataTables_length pull-left" id="datatable-icons_length">\r\n                    <label>\r\n                        Show\r\n                        <select name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.pageSize">\r\n                            <option value="10">10</option>\r\n                            <option value="25">25</option>\r\n                            <option value="50">50</option>\r\n                            <option value="100">100</option>\r\n                        </select> entries\r\n                    </label>\r\n                </div>\r\n            </div>\r\n        </div>\r\n        \x3c!-- Pagination end --\x3e\r\n    </div>\r\n</div>'),e.put("Templates/Utils/editableTableDrillDown.html",'<div class="table-responsive" style="overflow-x:visible">\r\n    <div id="datatable-icons_wrapper" class="dataTables_wrapper  dt-bootstrap no-footer">\r\n        <div class="row">\r\n            <div class="col-sm-6">\r\n                <div id="datatable-icons_filter" class="dataTables_filter" style="text-align:left">\r\n                    <label>Search:<i id="search-info" class="fa fa-info-circle" style="display: none"></i><input type="search" class="form-control input-sm" placeholder="" aria-controls="datatable-icons" fc-enter="vm.search()" ng-model="vm.searchText"></label>\r\n                </div>\r\n            </div>\r\n            <div class="col-sm-6">\r\n            </div>\r\n        </div>\r\n\r\n        <div class="row">\r\n            <div class="col-sm-12">\r\n                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr role="row">\r\n                            <th style="width: 25px" class="center">\r\n\r\n                            </th>\r\n                            <th ng-repeat="attr in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true" class="{{attr.CustomHeaderClass}}" ng-class="{sorting: attr.Sortable && vm.sortCol != attr.ValueName, sorting_asc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'asc\', sorting_desc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'desc\'}" ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)">{{attr.Name}}</th>\r\n\r\n                            <th tabindex="0" class="action-col" aria-controls="datatable-icons" rowspan="1" colspan="1" aria-label="Address: activate to sort column ascending" style="width: 50px;text-align:center;padding-right:8px">Action</th>\r\n                            </tr>\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr role="row" ng-repeat-start="item in  vm.items">\r\n                            <td style="text-align:center">\r\n                                <img class="toggle-details" ng-if="vm.drilldownOpen[$index] && item[vm.childIndicatorName]" src="Content/img/drill-down-arrow-up.png" ng-click="vm.toggleDrilldown($index)" />\r\n                                <img class="toggle-details" ng-if="!vm.drilldownOpen[$index] && item[vm.childIndicatorName]" src="Content/img/drill-down-arrow-b.png" ng-click="vm.toggleDrilldown($index, item)" />\r\n                            </td>\r\n                            <td ng-repeat="attribute in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true" style="position:relative;height:40px" class="{{attr.CustomCellClass}}">\r\n                                <span ng-if="attribute.Type === \'label\'">\r\n                                    {{item[attribute.ValueName]}}\r\n                                </span>\r\n                                \x3c!-- Text --\x3e\r\n                                <input type="text" name="{{vm.model[item[vm.valueModelName]]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'text\'" ng-model="vm.model[item[vm.valueModelName]]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n\r\n                                \x3c!-- Email --\x3e\r\n                                <input type="text" name="{{vm.model[item[vm.valueModelName]]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'email\'" ng-model="vm.model[item[vm.valueModelName]]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n\r\n                                \x3c!-- Int --\x3e\r\n                                \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                                \x3c!-- <input type="number" decimal decimals="0" name="{{vm.model[item[vm.valueModelName]]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'int\'" ng-model="vm.model[item[vm.valueModelName]]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" /> --\x3e\r\n                                <input type="number" onwheel="this.blur()" decimal decimals="0" name="{{vm.model[item[vm.valueModelName]]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'int\'" ng-model="vm.model[item[vm.valueModelName]]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                                \x3c!-- BUG32 : END --\x3e\r\n                                \x3c!-- Decimal --\x3e\r\n                                <input type="text" decimal name="{{vm.model[item[vm.valueModelName]]}}" ng-if="attribute.Type === \'editable\'  && item.Type === \'decimal\'" fc-autofocus="attribute.Autofocus" ng-model="vm.model[item[vm.valueModelName]]" maxlength="{{item.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n\r\n                                \x3c!-- Dropdown --\x3e\r\n                                <span ng-if="attribute.Type === \'editable\' && item.Type === \'dropdown\'" style="width:100% !important">\r\n                                    <fc-dropdown name="{{item.Value}}" filter="item.Filter" value="vm.model[item[vm.valueModelName]]" api-method="{{item.ApiMethod}}" value-prop="{{item.ValueProp}}" text-prop="{{item.TextProp}}" convert-to-int="{{item.ConvertToInt}}" label="{{item.Required?"*":""}}" current-list="attribute.CurrentList" list="attribute.List"></fc-dropdown>\r\n                                </span>\r\n\r\n                                \x3c!-- Checkbox --\x3e\r\n                                \x3c!-- <div ng-if="attribute.Type === \'editable\'  && item.Type === \'checkbox\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute[vm.valueModelName]].Error}" class="{{attribute.CustomDivClass}}">--\x3e\r\n                                <div class="form-inline">\r\n                                    <div class="form-group checkbox" ng-if="attribute.Type === \'editable\'  && item.Type === \'checkbox\'">\r\n                                        <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                            <div aria-disabled="false" aria-checked="{{vm.model[item[vm.valueModelName]]}}" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': vm.model[item[vm.valueModelName]]}" fc-focusout="vm.customFocus(attribute)">\r\n                                                <input type="checkbox" ng-model="vm.model[item[vm.valueModelName]]" fc-autofocus="attribute.Autofocus" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                            </div>\r\n                                        </label>\r\n                                    </div>\r\n                                </div>\r\n                                \x3c!-- </div> --\x3e\r\n\r\n                            </td>\r\n\r\n                            <td style="text-align:center" class="action-col">\r\n                                <button type="button" id="enableBtn" ng-if="vm.isChanged(item)" class="btn btn-primary table-edit-submit-btn" ng-class="{\'disabled\': vm.submitBlock}" ng-click="vm.onSubmit(item)" value="Submit">{{submitButtonText || "Submit"}}</button>\r\n                                <button type="button" id="disableBtn" ng-if="!vm.isChanged(item)" class="btn btn-default table-edit-submit-btn" ng-class="{\'disabled\': vm.submitBlock}" ng-click="vm.onSubmit(item)" disabled value="Submit">{{submitButtonText || "Submit"}}</button>\r\n                            </td>\r\n                        </tr>\r\n                        <tr ng-repeat-end ng-if="vm.drilldownOpen[$index]" class="details">\r\n                            <td class="details" colspan="{{vm.attributes.length + 2}}">\r\n                                <fc-editable-table-drill-down-item \r\n                                            attributes="vm.childAttributes"\r\n                                            items="item[vm.childCollectionName]"\r\n                                            value-model-name="{{vm.childValueModelName}}"\r\n                                            value="{{vm.childValue}}">\r\n                                </fc-editable-table-drill-down-item>\r\n                            </td>\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\r\n        </div>\r\n        \x3c!-- Pagination start --\x3e\r\n        <div class="row">\r\n            <fc-paging page="vm.page" page-size="vm.pageSize" current-data-length="vm.items.length" total="vm.total"></fc-paging>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-sm-5">\r\n                <div class="dataTables_length" id="datatable-icons_length">\r\n                    <label>\r\n                        Show\r\n                        <select name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.pageSize">\r\n                            <option value="10">10</option>\r\n                            <option value="25">25</option>\r\n                            <option value="50">50</option>\r\n                            <option value="100">100</option>\r\n                        </select> entries\r\n                    </label>\r\n                </div>\r\n            </div>\r\n        </div>\r\n        \x3c!-- Pagination end --\x3e\r\n    </div>\r\n</div>'),e.put("Templates/Utils/editableTableDrillDownItem.html",'<div class="table-responsive" style="overflow-x:visible">\r\n    <div id="datatable-icons_wrapper" class="dataTables_wrapper  dt-bootstrap no-footer">\r\n\r\n        <div class="row">\r\n            <div class="col-sm-12">\r\n                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr role="row">\r\n                            <th ng-repeat="attr in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true" class="{{attr.CustomHeaderClass}}" ng-class="{sorting: attr.Sortable && vm.sortCol != attr.ValueName, sorting_asc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'asc\', sorting_desc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'desc\'}" ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)">{{attr.Name}}</th>\r\n                        </tr>\r\n\r\n                    </thead>\r\n                    <tbody>\r\n                        <tr role="row" ng-repeat="item in  vm.items">\r\n                            \r\n                            <td ng-repeat="attribute in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true" style="position:relative;height:40px" class="{{attr.CustomCellClass}}">\r\n                                <span ng-if="attribute.Type === \'label\'">\r\n                                    {{item[attribute.ValueName]}}\r\n                                </span>\r\n                                \x3c!-- Text --\x3e\r\n                                <input type="text" name="{{vm.model[item[vm.valueModelName]]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'text\'" ng-model="vm.model[item[vm.valueModelName]]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n\r\n                                \x3c!-- Email --\x3e\r\n                                <input type="text" name="{{vm.model[item[vm.valueModelName]]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'email\'" ng-model="vm.model[item[vm.valueModelName]]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n\r\n                                \x3c!-- Int --\x3e\r\n                                \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                                \x3c!-- <input type="number" decimal decimals="0" name="{{vm.model[item[vm.valueModelName]]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'int\'" ng-model="vm.model[item[vm.valueModelName]]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" /> --\x3e\r\n                                <input type="number" onwheel="this.blur()" decimal decimals="0" name="{{vm.model[item[vm.valueModelName]]}}" ng-if="attribute.Type === \'editable\' && item.Type === \'int\'" ng-model="vm.model[item[vm.valueModelName]]" maxlength="{{item.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                                \x3c!-- BUG32 : END --\x3e\r\n                                \x3c!-- Decimal --\x3e\r\n                                <input type="text" decimal name="{{vm.model[item[vm.valueModelName]]}}" ng-if="attribute.Type === \'editable\'  && item.Type === \'decimal\'" fc-autofocus="attribute.Autofocus" ng-model="vm.model[item[vm.valueModelName]]" maxlength="{{item.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n\r\n                                \x3c!-- Dropdown --\x3e\r\n                                <span ng-if="attribute.Type === \'editable\' && item.Type === \'dropdown\'" style="width:100% !important">\r\n                                    <fc-dropdown name="{{item.Value}}" filter="item.Filter" value="vm.model[item[vm.valueModelName]]" api-method="{{item.ApiMethod}}" value-prop="{{item.ValueProp}}" text-prop="{{item.TextProp}}" convert-to-int="{{item.ConvertToInt}}" label="{{item.Required?"*":""}}" current-list="attribute.CurrentList" list="attribute.List"></fc-dropdown>\r\n                                </span>\r\n\r\n                                \x3c!-- Checkbox --\x3e\r\n                                \x3c!-- <div ng-if="attribute.Type === \'editable\'  && item.Type === \'checkbox\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute[vm.valueModelName]].Error}" class="{{attribute.CustomDivClass}}">--\x3e\r\n                                <div class="form-inline">\r\n                                    <div class="form-group checkbox" ng-if="attribute.Type === \'editable\'  && item.Type === \'checkbox\'">\r\n                                        <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                            <div aria-disabled="false" aria-checked="{{vm.model[item[vm.valueModelName]]}}" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': vm.model[item[vm.valueModelName]]}" fc-focusout="vm.customFocus(attribute)">\r\n                                                <input type="checkbox" ng-model="vm.model[item[vm.valueModelName]]" fc-autofocus="attribute.Autofocus" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                            </div>\r\n                                        </label>\r\n                                    </div>\r\n                                </div>\r\n                                \x3c!-- </div> --\x3e\r\n\r\n                            </td>\r\n\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>'),e.put("Templates/Utils/fcDropdown.html",'\r\n<div ng-if="vm.itemsLoaded" >\r\n   \r\n    <select ng-if="!fcDisabled && required && !vm.$scope.selectFirst" tabindex="{{fcTabindex}}" ng-change="vm.valueChanged(option)" ng-model="vm.$scope.value" class=\'form-control\' ng-options="item[valueProp] as item[textProp] for item in vm.items" required  ng-focus="vm.open()" fc-enter="vm.enter()">\r\n        <option value="" ng-selected="!vm.$scope.value"></option>\r\n        \x3c!-- <option ng-if="!required && convertToInt" value="-1" ng-selected="vm.$scope.value == -1"></option>\r\n        <option ng-repeat="item in vm.items" value="{{item[valueProp]}}" ng-selected="vm.$scope.value == item[valueProp]">{{item[textProp]}}</option> --\x3e\r\n    </select>\r\n    <select ng-if="!fcDisabled && required && vm.$scope.selectFirst" tabindex="{{fcTabindex}}" ng-change="vm.valueChanged()" ng-model="vm.$scope.value" class=\'form-control\' ng-options="item[valueProp] as item[textProp] for item in vm.items" required ng-focus="vm.open()" fc-enter="vm.enter()">\r\n        \x3c!-- <option ng-if="!required && convertToInt" value="-1" ng-selected="vm.$scope.value == -1"></option>\r\n        <option ng-repeat="item in vm.items" value="{{item[valueProp]}}" ng-selected="vm.$scope.value == item[valueProp]">{{item[textProp]}}</option> --\x3e\r\n    </select>\r\n    <select ng-if="!fcDisabled && !required && !vm.$scope.selectFirst" tabindex="{{fcTabindex}}" ng-change="vm.valueChanged()" ng-model="vm.$scope.value" class=\'form-control\' ng-options="item[valueProp] as item[textProp] for item in vm.items"  ng-focus="vm.open()" fc-enter="vm.enter()">\r\n        <option value="" ng-selected="!vm.$scope.value"></option>\r\n        \x3c!-- <option ng-if="!required && convertToInt" value="-1" ng-selected="vm.$scope.value == -1"></option>\r\n        <option ng-repeat="item in vm.items" value="{{item[valueProp]}}" ng-selected="vm.$scope.value == item[valueProp]">{{item[textProp]}}</option> --\x3e\r\n    </select>\r\n    <select ng-if="!fcDisabled && !required && vm.$scope.selectFirst" tabindex="{{fcTabindex}}" ng-change="vm.valueChanged()" ng-model="vm.$scope.value" class=\'form-control\' ng-options="item[valueProp] as item[textProp] for item in vm.items" ng-focus="vm.open()" fc-enter="vm.enter()">\r\n        \x3c!-- <option ng-if="!required && convertToInt" value="-1" ng-selected="vm.$scope.value == -1"></option>\r\n        <option ng-repeat="item in vm.items" value="{{item[valueProp]}}" ng-selected="vm.$scope.value == item[valueProp]">{{item[textProp]}}</option> --\x3e\r\n    </select>\r\n    <select ng-if="fcDisabled" tabindex="{{fcTabindex}}" ng-change="vm.valueChanged()" ng-model="vm.$scope.value" class=\'form-control\' ng-options="item[valueProp] as item[textProp] for item in vm.items" disabled  ng-focus="vm.open()" fc-enter="vm.enter()">\r\n        <option value="" ng-selected="!vm.$scope.value"></option>\r\n        \x3c!-- <option ng-if="!required && convertToInt" value="-1" ng-selected="vm.$scope.value == -1"></option>\r\n        <option ng-repeat="item in vm.items" value="{{item[valueProp]}}" ng-selected="vm.$scope.value == item[valueProp]">{{item[textProp]}}</option> --\x3e\r\n    </select>\r\n    <div ng-show="vm.loadingData" class="sk-circle" style="\r\n            top: 0px !important;\r\n            right: 30px;\r\n            display:  inline;\r\n            margin:  0px;\r\n            left: auto !important;\r\n        ">\r\n        <div class="sk-circle1 sk-child"></div>\r\n        <div class="sk-circle2 sk-child"></div>\r\n        <div class="sk-circle3 sk-child"></div>\r\n        <div class="sk-circle4 sk-child"></div>\r\n        <div class="sk-circle5 sk-child"></div>\r\n        <div class="sk-circle6 sk-child"></div>\r\n        <div class="sk-circle7 sk-child"></div>\r\n        <div class="sk-circle8 sk-child"></div>\r\n        <div class="sk-circle9 sk-child"></div>\r\n        <div class="sk-circle10 sk-child"></div>\r\n        <div class="sk-circle11 sk-child"></div>\r\n        <div class="sk-circle12 sk-child"></div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Utils/fcPaging.html",'<div class="col-sm-5">\r\n    <div class="dataTables_info pull-left" id="datatable-icons_info" role="status" aria-live="polite">\r\n        <span ng-if="total>0">\r\n            Showing {{(page - 1) * pageSize + 1}} to {{(page - 1) * pageSize + currentDataLength}}  of {{total}}  entries\r\n        </span>\r\n        <span ng-if="total===0">\r\n            No results\r\n        </span>\r\n    </div>\r\n</div>\r\n<div class="col-sm-7">\r\n    <div class="dataTables_paginate paging_simple_numbers pull-right-additional">\r\n        <paging\r\n            page="page"\r\n            page-size="pageSize"\r\n            total="total"\r\n            adjacent="2"\r\n            dots="..."\r\n            scroll-top="true"\r\n            ul-class="pagination"\r\n            active-class="active"\r\n            disabled-class="disabled"\r\n            show-prev-next="true"\r\n            prev-text="Previous"\r\n            next-text="Next"\r\n            ></paging>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Utils/filterSidebar.html",'<div id="side-bar-wrapper" class="cl-navblock">\r\n    <div class="collapse-button" style="z-index:10">\r\n        \x3c!-- US2762 : FCO - Web - Need some UI changes to Dispatch Calendar --\x3e\r\n        \x3c!-- <button id="sidebar-collapse" class="btn btn-default" ng-click="vm.toggleHide()"> --\x3e\r\n        <button id="sidebar-collapse" class="btn btn-default" ng-click="vm.toggleHide()" style="position: absolute; right: -5px; outline: 0px;">\r\n            \x3c!-- US2762 : END --\x3e\r\n            <i class="fa fa-bar" ng-class="{\'fa-angle-left\': vm.sidebarOpen, \'fa-angle-right\': !vm.sidebarOpen }">\r\n            </i>\r\n        </button>\r\n    </div>\r\n    <div class="menu-space" style="overflow-y: auto; overflow-x: hidden; height: 100%;">\r\n        <div class="content">\r\n            <div class="sidebarContent">\r\n                <div class="row form-horizontal">\r\n                    <div class="" ng-transclude>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>'),e.put("Templates/Utils/multiselect.html",'<select ng-if="vm.itemsLoaded && !required" tabindex="{{fcTabindex}}" ng-model="vm.$scope.value" class="form-control {{className}}" multiple ng-options="item[valueProp] as item[textProp] for item in vm.items" ng-disabled="fcDisabled" no-sort ="{{attribute.NoSort}}" items-loaded ="attribute.ItemsLoaded" fc-enter="vm.enter()"></select>\r\n<select ng-if="vm.itemsLoaded && required" tabindex="{{fcTabindex}}" ng-model="vm.$scope.value" class="form-control {{className}}" multiple required ng-options="item[valueProp] as item[textProp] for item in vm.items" ng-disabled="fcDisabled" no-sort ="{{attribute.NoSort}}" items-loaded ="attribute.ItemsLoaded" fc-enter="vm.enter()"></select>\r\n<select ng-if="!vm.itemsLoaded" tabindex="{{fcTabindex}}" class="form-control {{className}}" multiple></select>\r\n<div class="form-group checkbox pull-right" ng-show="vm.showAll">\r\n    <label>\r\n        <div aria-disabled="false" class="icheckbox_square-blue checkbox"  ng-class="{\'checked\': vm.checkAllButton}" aria-checked="{{vm.checkAllButton}}">\r\n            <input type="checkbox" ng-model="vm.checkAllButton" class="icheck" style="position: absolute; opacity: 0;" />\r\n            <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n        </div>\r\n        Check All\r\n        </label>\r\n</div>\r\n'),e.put("Templates/Utils/popupEdit.html",'<div id="myModal" class="fade" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n        \x3c!-- Modal content--\x3e\r\n        \x3c!-- BUG642 : DSL - Scroll parts screen --\x3e\r\n        \x3c!-- <div class="modal-content" style="overflow-y: auto; height: 70%"> --\x3e\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 80%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h4 class="modal-title">{{modalTitle}}</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <fc-table-edit api-method="{{vm.apiMethod}}" view-name="{{vm.viewName}}" module-name="{{vm.moduleName}}" id="{{vm.id}}" model="vm.$scope.model" on-back="vm.onBack(insertData)" attributes="vm.attributes" timezone="vm.timezone" ng-if="!onSubmit" hide-submit="vm.hideSubmit" custom-focus="vm.customFocus(attribute)" default-value="{{attribute.DefaultValue}}" current-list="vm.currentList" filter="vm.$scope.filter"></fc-table-edit>\r\n                <fc-table-edit api-method="{{vm.apiMethod}}" view-name="{{vm.viewName}}" module-name="{{vm.moduleName}}" id="{{vm.id}}" model="vm.$scope.model" on-back="vm.onBack(insertData)" attributes="vm.attributes" timezone="vm.timezone" on-submit="onSubmit()" hide-submit="vm.hideSubmit" ng-if="onSubmit" custom-focus="vm.customFocus(attribute)" default-value="{{attribute.DefaultValue}}" current-list="vm.currentList" filter="vm.$scope.filter"></fc-table-edit>\r\n                \x3c!-- <p>Some text in the modal.</p> --\x3e\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/Utils/popupEditMini.html",'<div id="myModal" class="fade" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 75px; left: 100px; width: auto; right: 100px; height:100%">\r\n        \x3c!-- Modal content--\x3e\r\n        \x3c!-- BUG642 : DSL - Scroll parts screen --\x3e\r\n        \x3c!-- <div class="modal-content" style="overflow-y: auto; height: 70%"> --\x3e\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 80%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h4 class="modal-title">{{modalTitle}}</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <fc-table-edit api-method="{{vm.apiMethod}}" view-name="{{vm.viewName}}" module-name="{{vm.moduleName}}" id="{{vm.id}}" model="vm.$scope.model" on-back="vm.onBack(insertData)" attributes="vm.attributes" timezone="vm.timezone" ng-if="!onSubmit" hide-submit="vm.hideSubmit" custom-focus="vm.customFocus(attribute)" default-value="{{attribute.DefaultValue}}" current-list="vm.currentList" filter="vm.$scope.filter"></fc-table-edit>\r\n                <fc-table-edit api-method="{{vm.apiMethod}}" view-name="{{vm.viewName}}" module-name="{{vm.moduleName}}" id="{{vm.id}}" model="vm.$scope.model" on-back="vm.onBack(insertData)" attributes="vm.attributes" timezone="vm.timezone" on-submit="onSubmit()" hide-submit="vm.hideSubmit" ng-if="onSubmit" custom-focus="vm.customFocus(attribute)" default-value="{{attribute.DefaultValue}}" current-list="vm.currentList" filter="vm.$scope.filter"></fc-table-edit>\r\n                \x3c!-- <p>Some text in the modal.</p> --\x3e\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/Utils/table.html",'<div class="table-responsive" style="overflow-x:visible" ng-if="vm.gui.getVisibility(vm.modulePrivilege, \'Get\')">\r\n    <div id="datatable-icons_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">\r\n        <div class="row">\r\n            <div class="col-sm-6">\r\n                <div id="datatable-icons_filter" class="dataTables_filter" style="text-align:left" ng-if="vm.showSearch">\r\n                    <label>Search:<i id="search-info" class="fa fa-info-circle" style="display: none"></i><input type="search" class="form-control input-sm" placeholder="" aria-controls="datatable-icons" fc-enter="vm.search()" ng-model="vm.searchText"></label>\r\n                </div>\r\n            </div>\r\n            <div class="col-sm-6">\r\n                <div ng-if="vm.AgreementSitesSI" class="tableBtns text-right">\r\n                    <button type="submit" ng-if="vm.gui.getVisibility(vm.modulePrivilege, \'Create\') && vm.showAddNew" class="btn btn-primary add-new-btn" ng-click="vm.add()">{{addButtonText || "Add New"}}</button>\r\n                </div>\r\n                <div ng-show="!vm.AgreementSitesSI" class="tableBtns text-right">\r\n                    <button type="submit" ng-if="vm.gui.getVisibility(vm.modulePrivilege, \'Create\') && vm.showAddNew" class="btn btn-primary add-new-btn" ng-click="vm.edit()">{{addButtonText || "Add New"}}</button>\r\n                </div>\r\n            </div>\r\n        </div>\r\n        <div class="row">\r\n            <div class="col-sm-12">                \r\n                <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                    <thead>\r\n                        <tr role="row" ng-if="viewName === \'ManageWorkOrders\'">\r\n                            <th ng-if="drilldown" style="width: 25px" class="center">\r\n                            </th>\r\n                            <th ng-repeat="attr in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true && attr.HideRoles ? vm.hideRoles(attr.HideRoles) : true" class="{{attr.CustomHeaderClass}}"\r\n                                ng-class="{sorting: attr.Sortable && vm.sortCol != attr.ValueName, sorting_asc: vm.sortCol == attr.ValueName && vm.sortDir == \'desc\', sorting_desc: vm.sortCol == attr.ValueName && vm.sortDir == \'asc\'}"\r\n                                ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)">{{attr.Name}}</th>\r\n\r\n                            <th tabindex="0" ng-if="vm.gui.getVisibility(vm.modulePrivilege, \'Delete\') && vm.showDeleteColumn" class="action-col" aria-controls="datatable-icons" rowspan="1" colspan="1" aria-label="Address: activate to sort column ascending" style="width: 50px;text-align:center;padding-right:8px">Action</th>\r\n                        </tr>\r\n                        <tr role="row" ng-if="viewName != \'ManageWorkOrders\'">\r\n                            <th ng-if="drilldown" style="width: 25px" class="center">\r\n\r\n                            </th>\r\n                            \x3c!--<th tabindex="0" aria-controls="datatable-icons" rowspan="1" colspan="1" aria-sort="ascending" aria-label="CustomerId: activate to sort column descending" style="width: 325px;">Assignment Status Id</th>--\x3e\r\n                            \x3c!-- BUG41 : Manage Quotes Sort Direction icon gets displayed Incorrectly --\x3e\r\n                            \x3c!--<th ng-repeat="attr in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true && attr.HideRoles ? vm.hideRoles(attr.HideRoles) : true" class="{{attr.CustomHeaderClass}}" ng-class="{sorting: attr.Sortable && vm.sortCol != attr.ValueName, sorting_asc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'asc\', sorting_desc: attr.Sortable && vm.sortCol == attr.ValueName && vm.sortDir == \'desc\'}" ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)">{{attr.Name}}</th>--\x3e\r\n\r\n                            <th ng-repeat="attr in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true && attr.HideRoles ? vm.hideRoles(attr.HideRoles) : true" class="{{attr.CustomHeaderClass}}"\r\n                                ng-class="{sorting: attr.Sortable && vm.sortCol != attr.ValueName, sorting_asc: vm.sortCol == attr.ValueName && vm.sortDir == \'desc\', sorting_desc: vm.sortCol == attr.ValueName && vm.sortDir == \'asc\'}"\r\n                                ng-click="vm.toggleSort(attr.ValueName, attr.Sortable)">{{attr.Name}}</th>\r\n                            \x3c!-- BUG41 : END --\x3e\r\n\r\n                            <th tabindex="0" ng-if="vm.gui.getVisibility(vm.modulePrivilege, \'Delete\') && vm.showDeleteColumn" class="action-col" aria-controls="datatable-icons" rowspan="1" colspan="1" aria-label="Address: activate to sort column ascending" style="width: 50px;text-align:center;padding-right:8px">Action</th>\r\n                        </tr>\r\n                    </thead>\r\n\r\n                    \x3c!-- PRIMARY ROW SELECT GRIDS --\x3e\r\n                    <tbody ng-if="vm.primaryGrid">\r\n                        \x3c!-- PBI807 : FCO - Manage work orders - DSL-NW --\x3e\r\n                        \x3c!-- <tr class="table-hover" role="row" ng-repeat-start="item in  vm.items" ng-class="{active: (vm.$scope.selected == item.Id) || (vm.$scope.selected && vm.$scope.valueForSelected && vm.$scope.selected == item[vm.$scope.valueForSelected] && item.Id == 0) || (vm.$scope.selected == item.Id) || (vm.$scope.selected && vm.$scope.customSelected && vm.$scope.selected == item[vm.$scope.customSelected])}" ng-init="itemIndex = $index"> --\x3e\r\n                        <tr class="table-hover" role="row" ng-repeat-start="item in  vm.items" ng-class="{active: (vm.$scope.selected == item.Id) || (vm.$scope.selected && vm.$scope.valueForSelected && vm.$scope.selected == item[vm.$scope.valueForSelected] && item.Id == 0) || (vm.$scope.selected == item.Id) || (vm.$scope.selected && vm.$scope.customSelected && vm.$scope.selected == item[vm.$scope.customSelected])}" ng-init="itemIndex = $index; $last ? vm.onLast(): null">\r\n                            <td ng-if="drilldown" style="text-align:center">\r\n                                <img class="toggle-details" ng-if="vm.drilldownOpen[$index]" src="Content/img/drill-down-arrow-up.png" ng-click="vm.toggleDrilldown($index)" />\r\n                                <img class="toggle-details" ng-if="!vm.drilldownOpen[$index]" src="Content/img/drill-down-arrow-b.png" ng-click="vm.toggleDrilldown($index)" />\r\n                            </td>\r\n                            \x3c!-- if !popout --\x3e\r\n                            <td ng-click="vm.edit(item.Id)" ng-repeat="attr in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true && attr.HideRoles ? vm.hideRoles(attr.HideRoles) : true" style="position:relative;height:40px" class="{{attr.CustomCellClass}}" ng-class="{\'{{vm.compareDiffColor}}\': vm.evaluateComparison && attr.CompareValueName != null && vm.compareDiffColor != null && item[attr.ValueName] != null && item[attr.CompareValueName] != null && item[attr.ValueName] != item[attr.CompareValueName],  \'{{vm.customConditionalClass}}\':  vm.evaluateComparison && !item[vm.conditionalAttribute]}">\r\n                                <span ng-if="attr.SecondEdit">\r\n                                    <a class="cursor_pointer" ng-if="attr.Edit || (attr.ConditionalEdit && item[attr.BindedTo] != attr.BindValue || (attr.SecondEdit && item[attr.BindedTo] != attr.BindValue) )" ng-click="vm.secondedit(item[attr.BindedTo], attr.BindedTo)">\r\n                                        {{item[attr.ValueName]}}\r\n                                    </a>\r\n                                    <span ng-if="(!attr.Edit && !attr.ConditionalEdit && !attr.SecondEdit) || (attr.ConditionalEdit && item[attr.BindedTo] == attr.BindValue) || (attr.SecondEdit && item[attr.BindedTo] == attr.BindValue)">\r\n                                        {{item[attr.ValueName]}}\r\n                                    </span>\r\n                                </span>\r\n                                <span ng-if="!attr.CellFormat && !attr.SecondEdit">\r\n                                    <a class="cursor_pointer" ng-if="attr.Edit || (attr.ConditionalEdit && item[attr.BindedTo] != attr.BindValue )" ng-click="vm.edit(item.Id)">\r\n                                        {{item[attr.ValueName]}}\r\n                                    </a>\r\n                                    <span ng-if="(!attr.Edit && !attr.ConditionalEdit && !attr.SecondEdit) || (attr.ConditionalEdit && item[attr.BindedTo] == attr.BindValue)">\r\n                                        {{item[attr.ValueName]}}\r\n                                    </span>\r\n                                </span>\r\n                                <div ng-if="attr.CellFormat == \'multiline\'">\r\n                                    <div ng-repeat="listItem in vm.stringToArray.splitString(item[attr.ValueName], attr.Separator)">\r\n                                        <span>{{listItem}}</span>\r\n                                        <br />\r\n                                    </div>\r\n\r\n                                </div>\r\n                                <span ng-if="attr.CellFormat == \'decimal\'">\r\n                                    <span>\r\n                                        {{item[attr.ValueName]}}\r\n                                    </span>\r\n                                </span>\r\n                                <div style="width: 100%; height: 100%; vertical-align: middle; display: inline-block" ng-if="attr.CellFormat == \'color\' " ng-style="{\'background-color\': item[attr.ValueName]}">\r\n                                </div>\r\n                                <div ng-if="attr.CellFormat == \'download\'">\r\n                                    <a class="cursor_pointer" ng-if="item[attr.DownloadValueName] != \'??\' && item[attr.DownloadValueName]" ng-click="vm.download(vm.apiServiceBaseUri + item[attr.DownloadValueName])">{{item[attr.ValueName]}}</a>\r\n                                    <span ng-if="item[attr.DownloadValueName] == \'??\' || !item[attr.DownloadValueName]">{{item[attr.ValueName]}}</span>\r\n                                </div>\r\n                                <div ng-if="attr.CellFormat == \'button\'">\r\n                                    <button type="button" class="btn btn-default" ng-click="attr.CellFormatData.onClick(item)">{{attr.CellFormatData.Text}}</button>\r\n                                </div>\r\n\r\n                                \x3c!-- PBI555 : FCO - Carry over customer signature on revised service report - GroundBreakers --\x3e\r\n                                <div ng-if="attr.CellFormat == \'custombutton\' && !item[attr.Hidden]">\r\n                                    <button type="button" class="btn btn-default" ng-click="attr.CellFormatData.onClick(item)" ng-disabled="item[attr.Disabled] || vm.disableCustomButton">{{attr.CellFormatData.Text}}</button>\r\n                                </div>\r\n                                \x3c!-- PBI555 : END --\x3e\r\n\r\n                                <div ng-if="attr.CellFormat == \'template\'">\r\n                                    <ng-include src="attr.CellFormatData.TemplateUrl"></ng-include>\r\n                                </div>\r\n                                <div ng-if="attr.CellFormat == \'checkbox\'">\r\n                                    <div class="checkbox text-center">\r\n                                        <label>\r\n                                            <div class="icheckbox_square-blue checkbox cellformatCh" ng-class="{ \'checked\': item[attr.ValueName], \'redCheckBox\': vm.evaluateComparison && attr.CompareValueName != null && vm.compareDiffColor != null && item[attr.ValueName] != null && item[attr.CompareValueName] != null && item[attr.ValueName] != item[attr.CompareValueName] && item[vm.conditionalAttribute]}">\r\n                                                <input type="checkbox" ng-disabled="true" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                                <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                            </div>\r\n                                        </label>\r\n                                    </div>\r\n                                </div>\r\n                                <div ng-if="attr.CellFormat == \'percent\'">\r\n                                    {{item[attr.ValueName]*100 | number:0}}%\r\n                                </div>\r\n                                <div ng-if="attr.CellFormat == \'link\'">\r\n                                    <a class="cursor_pointer" ng-click="vm.go(item.Id)">{{item[attr.ValueName]}}</a>\r\n                                </div>\r\n                            </td>\r\n\r\n\r\n                            <td style="text-align:center" class="action-col" ng-if="vm.gui.getVisibility(vm.modulePrivilege, \'Delete\') && vm.showDeleteColumn">\r\n                                <a class="btn btn-delete" ng-click="vm.remove(item)" data-original-title="Remove" data-toggle="tooltip"><i class="fa fa-times-circle"></i></a>\r\n                            </td>\r\n                        </tr>\r\n                        <tr ng-repeat-end ng-if="vm.drilldownOpen[$index]" class="details">\r\n                            <td class="details" colspan="{{vm.attributes.length + 2}}">\r\n                                <fc-drilldown options="drilldown" item="item" filter="drilldownFilter" on-drilldown-go="vm.drilldownGo(id, item)"></fc-drilldown>\r\n                            </td>\r\n                        </tr>\r\n                    </tbody>\r\n\r\n\r\n                    \x3c!-- NON-PRIMARY DEFAULT GRID --\x3e\r\n                    <tbody ng-if="!vm.primaryGrid">\r\n                        <tr role="row" ng-repeat-start="item in  vm.items" ng-click="vm.setSelected(item)" ng-class="{\'table-hover\': vm.tableHover, active: (vm.$scope.selected == item.Id) || (vm.$scope.selected && vm.$scope.valueForSelected && vm.$scope.selected == item[vm.$scope.valueForSelected] && item.Id == 0) || (vm.$scope.selected == item.Id) || (vm.$scope.selected && vm.$scope.customSelected && vm.$scope.selected == item[vm.$scope.customSelected])}" ng-init="itemIndex = $index">\r\n                            <td ng-if="drilldown" style="text-align:center">\r\n                                <img class="toggle-details" ng-if="vm.drilldownOpen[$index]" src="Content/img/drill-down-arrow-up.png" ng-click="vm.toggleDrilldown($index)" />\r\n                                <img class="toggle-details" ng-if="!vm.drilldownOpen[$index]" src="Content/img/drill-down-arrow-b.png" ng-click="vm.toggleDrilldown($index)" />\r\n                            </td>\r\n                            <td ng-repeat="attr in vm.attributes" ng-if="attr.Roles ? vm.checkRoles(attr.Roles) : true && attr.HideRoles ? vm.hideRoles(attr.HideRoles) : true" style="position:relative;height:40px" class="{{attr.CustomCellClass}}" ng-class="{\'{{vm.compareDiffColor}}\': vm.evaluateComparison && attr.CompareValueName != null && vm.compareDiffColor != null && item[attr.ValueName] != null && item[attr.CompareValueName] != null && item[attr.ValueName] != item[attr.CompareValueName],  \'{{vm.customConditionalClass}}\':  vm.evaluateComparison && !item[vm.conditionalAttribute]}">\r\n                                <span ng-if="attr.SecondEdit">\r\n                                    <a class="cursor_pointer" ng-if="attr.Edit || (attr.ConditionalEdit && item[attr.BindedTo] != attr.BindValue || (attr.SecondEdit && item[attr.BindedTo] != attr.BindValue) )" ng-click="vm.secondedit(item[attr.BindedTo], attr.BindedTo)">\r\n                                        {{item[attr.ValueName]}}\r\n                                    </a>\r\n                                    <span ng-if="(!attr.Edit && !attr.ConditionalEdit && !attr.SecondEdit) || (attr.ConditionalEdit && item[attr.BindedTo] == attr.BindValue) || (attr.SecondEdit && item[attr.BindedTo] == attr.BindValue)">\r\n                                        {{item[attr.ValueName]}}\r\n                                    </span>\r\n                                </span>\r\n                                <span ng-if="!attr.CellFormat && !attr.SecondEdit">\r\n                                    <a class="cursor_pointer" ng-if="attr.Edit || (attr.ConditionalEdit && item[attr.BindedTo] != attr.BindValue )" ng-click="vm.edit(item.Id)">\r\n                                        {{item[attr.ValueName]}}\r\n                                    </a>\r\n                                    <span ng-if="(!attr.Edit && !attr.ConditionalEdit && !attr.SecondEdit) || (attr.ConditionalEdit && item[attr.BindedTo] == attr.BindValue)">\r\n                                        {{item[attr.ValueName]}}\r\n                                    </span>\r\n                                </span>\r\n                                <div ng-if="attr.CellFormat == \'multiline\'">\r\n                                    <div ng-repeat="listItem in vm.stringToArray.splitString(item[attr.ValueName], attr.Separator)">\r\n                                        <span>{{listItem}}</span>\r\n                                        <br />\r\n                                    </div>\r\n\r\n                                </div>\r\n                                <span ng-if="attr.CellFormat == \'decimal\'">\r\n                                    <span>\r\n                                        {{item[attr.ValueName]}}\r\n                                    </span>\r\n                                </span>\r\n                                <div style="width: 100%; height: 100%; vertical-align: middle; display: inline-block" ng-if="attr.CellFormat == \'color\' " ng-style="{\'background-color\': item[attr.ValueName]}">\r\n                                </div>\r\n                                <div ng-if="attr.CellFormat == \'download\'">\r\n                                    <a class="cursor_pointer" ng-if="item[attr.DownloadValueName] != \'??\' && item[attr.DownloadValueName]" ng-click="vm.download(vm.apiServiceBaseUri + item[attr.DownloadValueName])">{{item[attr.ValueName]}}</a>\r\n                                    <span ng-if="item[attr.DownloadValueName] == \'??\' || !item[attr.DownloadValueName]">{{item[attr.ValueName]}}</span>\r\n                                </div>\r\n                                <div ng-if="attr.CellFormat == \'button\'">\r\n                                    <button type="button" class="btn btn-default" ng-click="attr.CellFormatData.onClick(item)">{{attr.CellFormatData.Text}}</button>\r\n                                </div>\r\n\r\n                                \x3c!-- PBI555 : FCO - Carry over customer signature on revised service report - GroundBreakers --\x3e\r\n                                <div ng-if="attr.CellFormat == \'custombutton\' && !item[attr.Hidden]">\r\n                                    <button type="button" class="btn btn-default" ng-click="attr.CellFormatData.onClick(item)" ng-disabled="item[attr.Disabled] || vm.disableCustomButton">{{attr.CellFormatData.Text}}</button>\r\n                                </div>\r\n                                \x3c!-- PBI555 : END --\x3e\r\n\r\n                                <div ng-if="attr.CellFormat == \'template\'">\r\n                                    <ng-include src="attr.CellFormatData.TemplateUrl"></ng-include>\r\n                                </div>\r\n                                <div ng-if="attr.CellFormat == \'checkbox\'">\r\n                                    <div class="checkbox text-center">\r\n                                        <label>\r\n                                            <div class="icheckbox_square-blue checkbox cellformatCh" ng-class="{ \'checked\': item[attr.ValueName], \'redCheckBox\': vm.evaluateComparison && attr.CompareValueName != null && vm.compareDiffColor != null && item[attr.ValueName] != null && item[attr.CompareValueName] != null && item[attr.ValueName] != item[attr.CompareValueName] && item[vm.conditionalAttribute]}">\r\n                                                <input type="checkbox" ng-disabled="true" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                                <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                            </div>\r\n                                        </label>\r\n                                    </div>\r\n                                </div>\r\n                                <div ng-if="attr.CellFormat == \'percent\'">\r\n                                    {{item[attr.ValueName]*100 | number:0}}%\r\n                                </div>\r\n                                <div ng-if="attr.CellFormat == \'link\'">\r\n                                    <a class="cursor_pointer" ng-click="vm.go(item.Id)">{{item[attr.ValueName]}}</a>\r\n                                </div>\r\n                            </td>\r\n\r\n                            <td style="text-align:center" class="action-col" ng-if="vm.gui.getVisibility(vm.modulePrivilege, \'Delete\') && vm.showDeleteColumn">\r\n                                <a class="btn btn-delete" ng-click="vm.remove(item)" data-original-title="Remove" data-toggle="tooltip"><i class="fa fa-times-circle"></i></a>\r\n                            </td>\r\n                        </tr>\r\n                        <tr ng-repeat-end ng-if="vm.drilldownOpen[$index]" class="details">\r\n                            <td class="details" colspan="{{vm.attributes.length + 2}}">\r\n                                <fc-drilldown options="drilldown" item="item" filter="drilldownFilter" on-drilldown-go="vm.drilldownGo(id, item)"></fc-drilldown>\r\n                            </td>\r\n                        </tr>\r\n                    </tbody>\r\n                </table>\r\n            </div>\r\n        </div>\r\n        \x3c!-- Pagination start --\x3e\r\n        <div ng-if="vm.showPagination">\r\n            <div class="row">\r\n                <fc-paging page="vm.page" page-size="vm.pageSize" current-data-length="vm.items.length" total="vm.total"></fc-paging>\r\n            </div>\r\n            <div class="row" ng-if="vm.total>0">\r\n                <div class="col-sm-5">\r\n                    <div class="dataTables_length pull-left" id="datatable-icons_length">\r\n                        <label>\r\n                            Show\r\n                            <select name="datatable-icons_length" aria-controls="datatable-icons" class="form-control input-sm" ng-model="vm.pageSize">\r\n                                \x3c!-- DE1720 : added 5 option --\x3e\r\n                                <option value="5">5</option>\r\n                                <option value="10">10</option>\r\n                                <option value="25">25</option>\r\n                                <option value="50">50</option>\r\n                                <option value="100">100</option>\r\n                            </select> entries\r\n                        </label>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n        \x3c!-- Pagination end --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Utils/tableEdit.html",'\x3c!--<div class="cl-mcont">--\x3e\r\n<style type="text/css">\r\n    .validation {\r\n        font-style: italic;\r\n        color: #ff5502;\r\n        margin-top: 7px;\r\n        display: inline-block;\r\n    }\r\n</style>\r\n<form class="form-horizontal" novalidate ng-if="vm.gui.getVisibility(vm.modulePrivilege, \'Get\')">\r\n    <div class="table-edit-overlay" ng-show="vm.loadingData">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="row">\r\n        <div ng-repeat="array in vm.splitAttributes" ng-init="$parentIndex = $index" class="col-sm-12">\r\n            <div ng-repeat="attribute in array">\r\n                \x3c!-- Text --\x3e\r\n                <div ng-if="attribute.Type === \'text\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <input type="text" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Text and button--\x3e\r\n                <div ng-if="attribute.Type === \'textbutton\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <input type="text" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\', \'padding-right\': \'80px;\'}" />\r\n\r\n                            <input type="text" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'80%\'}" />\r\n                            <input type="text" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'80%\', \'padding-right\': \'80px;\'}" />\r\n                            <input type="text" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'80%\', \'padding-right\': \'80px;\'}" />\r\n                            <button class="btn" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-style="{\'position\': \'absolute\', \'width\':\'78px\' ,\'top\':\'0\'}" type=\'button\' ng-if="attribute.HideBtn" ng-click="attribute.onClick()">Search</button>\r\n\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- US2797 : FCO - Web - Allow parts association to barcode --\x3e\r\n                <div ng-if="attribute.Type === \'barcode\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div id="teBarcode" class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'input-group date col-sm-9 col-md-8 col-lg-7 paddingLeft30\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <input type="text" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" />\r\n                            <span class="input-group-addon btn btn-white" ng-click="attribute.onClick()">\r\n                                <span class="glyphicon glyphicon-barcode"></span>\r\n                            </span>\r\n                        </div>\r\n                        <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- $event.clipboardData.getData(\'text/plain\') --\x3e\r\n                \x3c!-- US1223 : FCO - Part: add new using item barcode scan - DSL-NW --\x3e\r\n                <div ng-if="attribute.Type === \'barcodeautosubmit\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <input id="{{attribute.ModelValue}}" type="text" ng-paste="attribute.onPaste($event)" ng-keyup="$event.keyCode == attribute.EndOfData && attribute.onClick($event)" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input id="{{attribute.ModelValue}}" type="text" ng-paste="attribute.onPaste($event)" ng-keyup="$event.keyCode == attribute.EndOfData && attribute.onClick($event)" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input id="{{attribute.ModelValue}}" type="text" ng-paste="attribute.onPaste($event)" ng-keyup="$event.keyCode == attribute.EndOfData && attribute.onClick($event)" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input id="{{attribute.ModelValue}}" type="text" ng-paste="attribute.onPaste($event)" ng-keyup="$event.keyCode == attribute.EndOfData && attribute.onClick($event)" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n\r\n                \x3c!-- Email --\x3e\r\n                <div ng-if="attribute.Type === \'email\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <input type="text" name="{{attribute.ModelValue}}" placeholder="{{attribute.placeholder}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" name="{{attribute.ModelValue}}" placeholder="{{attribute.placeholder}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" name="{{attribute.ModelValue}}" placeholder="{{attribute.placeholder}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" name="{{attribute.ModelValue}}" placeholder="{{attribute.placeholder}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Required" class="validation">This field is required</span>\r\n                            <span ng-show="vm.formValidation[attribute.ModelValue].Email" class="validation">Email is invalid</span>\r\n                            \x3c!--<span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">\r\n\r\n                            </span>--\x3e\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Int --\x3e\r\n                <div ng-if="attribute.Type === \'int\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                            \x3c!--\r\n                            <input type="number" decimal decimals="0" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" decimal decimals="0" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" decimal decimals="0" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" decimal decimals="0" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            --\x3e\r\n                            <input type="number" onwheel="this.blur()" decimal decimals="0" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" onwheel="this.blur()" decimal decimals="0" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" onwheel="this.blur()" decimal decimals="0" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" onwheel="this.blur()" decimal decimals="0" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            \x3c!-- BUG32 : END --\x3e\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Decimal --\x3e\r\n                <div ng-if="attribute.Type === \'decimal\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                            \x3c!--\r\n                            <input type="number" ng-blur="attribute.OnFocus()" decimal name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="{{attribute.Step ? attribute.Step : 0.01}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" ng-blur="attribute.OnFocus()" decimal name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="{{attribute.Step ? attribute.Step : 0.01}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" ng-blur="attribute.OnFocus()" decimal name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="{{attribute.Step ? attribute.Step : 0.01}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" ng-blur="attribute.OnFocus()" decimal name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="{{attribute.Step ? attribute.Step : 0.01}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            --\x3e\r\n                            <input type="number" onwheel="this.blur()" ng-blur="attribute.OnFocus()" decimal name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="{{attribute.Step ? attribute.Step : 0.01}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" onwheel="this.blur()" ng-blur="attribute.OnFocus()" decimal name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="{{attribute.Step ? attribute.Step : 0.01}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" onwheel="this.blur()" ng-blur="attribute.OnFocus()" decimal name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="{{attribute.Step ? attribute.Step : 0.01}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" onwheel="this.blur()" ng-blur="attribute.OnFocus()" decimal name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="{{attribute.Step ? attribute.Step : 0.01}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            \x3c!-- BUG32 : END --\x3e\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Currency --\x3e\r\n                <div ng-if="attribute.Type === \'currency\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <input type="text" ng-blur="attribute.OnFocus()" currency-input name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" ng-blur="attribute.OnFocus()" currency-input name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" ng-blur="attribute.OnFocus()" currency-input name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" ng-blur="attribute.OnFocus()" currency-input name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Dropdown --\x3e\r\n                <div ng-if="attribute.Type === \'dropdown\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <fc-dropdown name="{{attribute.ModelValue}}" plural="{{attribute.Plural}}" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && !attribute.ReadOnly" silent="attribute.Silent" fc-disabled="attribute.ReadOnly" list="attribute.List" filter="attribute.Filter" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" required="true" convert-to-int="{{attribute.ConvertToInt}}" label="{{attribute.Required?"*":""}}{{attribute.Label}}" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" on-enter="vm.onEnter()" select-first="{{attribute.SelectFirst}}" on-open="attribute.OnOpen()" on-loaded="attribute.OnLoaded()" sort-col="{{attribute.SortCol}}"></fc-dropdown>\r\n                            <fc-dropdown name="{{attribute.ModelValue}}" plural="{{attribute.Plural}}" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-disabled="attribute.ReadOnly" list="attribute.List" filter="attribute.Filter" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" convert-to-int="{{attribute.ConvertToInt}}" label="{{attribute.Required?"*":""}}{{attribute.Label}}" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" on-enter="vm.onEnter()" select-first="{{attribute.SelectFirst}}" on-open="attribute.OnOpen()" on-loaded="attribute.OnLoaded()" sort-col="{{attribute.SortCol}}"></fc-dropdown>\r\n                            <fc-dropdown name="{{attribute.ModelValue}}" plural="{{attribute.Plural}}" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && attribute.ReadOnly" silent="attribute.Silent" fc-disabled="attribute.ReadOnly" list="attribute.List" filter="attribute.Filter" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" required="true" convert-to-int="{{attribute.ConvertToInt}}" label="{{attribute.Required?"*":""}}{{attribute.Label}}" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" on-enter="vm.onEnter()" select-first="{{attribute.SelectFirst}}" on-open="attribute.OnOpen()" on-loaded="attribute.OnLoaded()" sort-col="{{attribute.SortCol}}"></fc-dropdown>\r\n                            <fc-dropdown name="{{attribute.ModelValue}}" plural="{{attribute.Plural}}" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-disabled="attribute.ReadOnly" list="attribute.List" filter="attribute.Filter" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" convert-to-int="{{attribute.ConvertToInt}}" label="{{attribute.Required?"*":""}}{{attribute.Label}}" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" on-enter="vm.onEnter()" select-first="{{attribute.SelectFirst}}" on-open="attribute.OnOpen()" on-loaded="attribute.OnLoaded()" sort-col="{{attribute.SortCol}}"></fc-dropdown>\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Dropdown and Link --\x3e\r\n                <div ng-if="attribute.Type === \'dropdownandlink\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-8 col-md-7 col-lg-6\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <fc-dropdown name="{{attribute.ModelValue}}" plural="{{attribute.Plural}}" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && !attribute.ReadOnly" silent="attribute.Silent" fc-disabled="attribute.ReadOnly" list="attribute.List" filter="attribute.Filter" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" required="true" convert-to-int="{{attribute.ConvertToInt}}" label="{{attribute.Required?"*":""}}{{attribute.Label}}" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" on-enter="vm.onEnter()" select-first="{{attribute.SelectFirst}}" on-open="attribute.OnOpen()" on-loaded="attribute.OnLoaded()" sort-col="{{attribute.SortCol}}"></fc-dropdown>\r\n                            <fc-dropdown name="{{attribute.ModelValue}}" plural="{{attribute.Plural}}" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-disabled="attribute.ReadOnly" list="attribute.List" filter="attribute.Filter" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" convert-to-int="{{attribute.ConvertToInt}}" label="{{attribute.Required?"*":""}}{{attribute.Label}}" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" on-enter="vm.onEnter()" select-first="{{attribute.SelectFirst}}" on-open="attribute.OnOpen()" on-loaded="attribute.OnLoaded()" sort-col="{{attribute.SortCol}}"></fc-dropdown>\r\n                            <fc-dropdown name="{{attribute.ModelValue}}" plural="{{attribute.Plural}}" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && attribute.ReadOnly" silent="attribute.Silent" fc-disabled="attribute.ReadOnly" list="attribute.List" filter="attribute.Filter" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" required="true" convert-to-int="{{attribute.ConvertToInt}}" label="{{attribute.Required?"*":""}}{{attribute.Label}}" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" on-enter="vm.onEnter()" select-first="{{attribute.SelectFirst}}" on-open="attribute.OnOpen()" on-loaded="attribute.OnLoaded()" sort-col="{{attribute.SortCol}}"></fc-dropdown>\r\n                            <fc-dropdown name="{{attribute.ModelValue}}" plural="{{attribute.Plural}}" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-disabled="attribute.ReadOnly" list="attribute.List" filter="attribute.Filter" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" convert-to-int="{{attribute.ConvertToInt}}" label="{{attribute.Required?"*":""}}{{attribute.Label}}" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" on-enter="vm.onEnter()" select-first="{{attribute.SelectFirst}}" on-open="attribute.OnOpen()" on-loaded="attribute.OnLoaded()" sort-col="{{attribute.SortCol}}"></fc-dropdown>\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                        <a class="cursor_pointer {{attribute.CustomInputClass}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-click="attribute.onClick(\'link\')"><i class="{{attribute.ICustomInputClass}}"></i></a>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Checkbox --\x3e\r\n                <div ng-if="attribute.Type === \'checkbox\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group checkbox" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter(attribute)">\r\n                        <label class="{{attribute.CustomLabelClass}}" ng-class="{\'col-sm-offset-3 col-sm-9 col-md-8 col-lg-7\': !attribute.CustomLabelClass}">\r\n                            <div aria-disabled="false" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" aria-checked="{{vm.model[attribute.ModelValue]}}" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': vm.model[attribute.ModelValue]}" fc-focusout="vm.customFocus(attribute)">\r\n                                <input type="checkbox" ng-disabled="attribute.ReadOnly" ng-model="vm.model[attribute.ModelValue]" fc-autofocus="attribute.Autofocus" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                            </div>\r\n                            {{attribute.Required?"*":""}}{{attribute.Label}}\r\n                        </label>\r\n                        <a class="cursor_pointer" ng-click="attribute.LinkOnClick()">{{attribute.Link}}</a>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Colorpicker --\x3e\r\n                <div ng-if="attribute.Type === \'colorpicker\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <ngjs-color-picker selected="vm.model[attribute.ModelValue]" options="vm.colorpickerOptions" custom-colors="vm.colorpickerColors"></ngjs-color-picker>\r\n                            <input name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required" type="text" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" required />\r\n                            <input name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required" type="text" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" />\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Empty --\x3e\r\n                <div ng-if="attribute.Type === \'empty\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomClass}" class="{{attribute.CustomClass}}">\r\n                    <div></div>\r\n                </div>\r\n\r\n                \x3c!-- Line --\x3e\r\n                <div ng-if="attribute.Type === \'line\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomClass}" class="{{attribute.CustomClass}}">\r\n                    <hr />\r\n                </div>\r\n\r\n                \x3c!-- Multiselect --\x3e\r\n                <div ng-if="attribute.Type === \'multiselect\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <fc-multiselect ng-if="attribute.Required && attribute.ShowAll" list="attribute.List" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" show-all="true" fc-disabled="attribute.ReadOnly" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" required="true" convert-to-int="{{attribute.ConvertToInt}}" filter="attribute.Filter" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" items-loaded="attribute.ItemsLoaded" on-enter="vm.onEnter()"></fc-multiselect>\r\n                            <fc-multiselect ng-if="!attribute.Required && attribute.ShowAll" list="attribute.List" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" show-all="true" fc-disabled="attribute.ReadOnly" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" convert-to-int="{{attribute.ConvertToInt}}" filter="attribute.Filter" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" items-loaded="attribute.ItemsLoaded" on-enter="vm.onEnter()"></fc-multiselect>\r\n                            <fc-multiselect ng-if="attribute.Required && !attribute.ShowAll" list="attribute.List" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" fc-disabled="attribute.ReadOnly" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" required="true" convert-to-int="{{attribute.ConvertToInt}}" filter="attribute.Filter" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" items-loaded="attribute.ItemsLoaded" on-enter="vm.onEnter()"></fc-multiselect>\r\n                            <fc-multiselect ng-if="!attribute.Required && !attribute.ShowAll" list="attribute.List" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" fc-disabled="attribute.ReadOnly" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" convert-to-int="{{attribute.ConvertToInt}}" filter="attribute.Filter" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" items-loaded="attribute.ItemsLoaded" on-enter="vm.onEnter()"></fc-multiselect>\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Multiselect dropdown Checkbox @US--\x3e\r\n                \x3c!--<div id="multiselectCheckboxid" ng-if="attribute.Type === \'multiselectCheckbox\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" convert-to-int="{{attribute.ConvertToInt}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <div ng-dropdown-multiselect="" api-method="employees/getTechnician" extra-settings="dropdownSetting" convert-to-int="{{attribute.ConvertToInt}}"\r\n                                 filter="attribute.Filter" options="vm.multiselectCheckbox" value="vm.model[attribute.ModelValue]" selected-model="vm.selectedCheckbox" checkboxes="true">\r\n                            </div>\r\n                        </div>\r\n                        <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                    </div>\r\n                </div>--\x3e\r\n                \x3c!-- Datepicker --\x3e\r\n                <div ng-if="attribute.Type === \'datepicker\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" datepicker-div fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div data-min-view="2" class="{{attribute.CustomInputClass}}" ng-class="{\'input-group date datetime col-sm-9 col-md-8 col-lg-7 paddingLeft30\': !attribute.CustomInputClass}" date-time-append fc-focusout="vm.customFocus(attribute)">\r\n                            \x3c!-- BUG85 : error message for previous date like 1/11/1111 in From Date/To Date field on Unapplied Time page --\x3e\r\n                            \x3c!-- <input ng-disabled="attribute.ReadOnly" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.SubType == \'date\' || !attribute.SubType" name="{{attribute.ModelValue}}" type="datetime" date-time ng-model="vm.model[attribute.ModelValue]" fc-autofocus="attribute.Autofocus" format="{{attribute.Format}}" auto-close="true" min-view="date" max-view="date" class="form-control" /> --\x3e\r\n                            <input onpaste="return false;" ng-disabled="attribute.ReadOnly" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" restrict-to="[0-9\\/]" ng-if="attribute.SubType == \'date\' || !attribute.SubType" name="{{attribute.ModelValue}}" type="datetime" date-time ng-model="vm.model[attribute.ModelValue]" fc-autofocus="attribute.Autofocus" format="{{attribute.Format}}" auto-close="true" min-view="date" max-view="date" class="form-control" />\r\n                            \x3c!-- BUG85 : END --\x3e\r\n                            <span ng-if="attribute.SubType == \'date\' || !attribute.SubType" class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon" ng-class="{\'glyphicon-time\': attribute.SubType == \'time\', \'glyphicon-calendar\': attribute.SubType != \'time\'}"></span>\r\n                            </span>\r\n                            <fc-timeselect fc-disabled="attribute.ReadOnly" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.SubType == \'time\' || !attribute.SubType" value="vm.model[attribute.ModelValue]" required="attribute.Required" default-value="{{attribute.DefaultValue}}" predefined="{{attribute.Predefined}}" custom-end="{{attribute.CustomEnd}}"></fc-timeselect>\r\n                        </div>\r\n                        <span class="col-lg-4 col-lg-offset-3" ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" style="color:#A94442">This field is required</span>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Checkbox action --\x3e\r\n                <div ng-if="attribute.Type === \'checkboxAction\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group checkbox" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter(attribute)">\r\n                        <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                            <div aria-disabled="false" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" aria-checked="{{attribute.Value}}" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': attribute.Value}" fc-focusout="vm.customFocus(attribute)">\r\n                                <input type="checkbox" ng-model="attribute.Value" fc-autofocus="attribute.Autofocus" ng-change="attribute.onChange()" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                            </div>\r\n                            {{attribute.Required?"*":""}}{{attribute.Label}}\r\n                        </label>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Textarea --\x3e\r\n                <div ng-if="attribute.Type === \'textarea\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <textarea ng-disabled="attribute.ReadOnly" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" name="{{attribute.ModelValue}}" id="{{attribute.Id}}" ng-if="attribute.Required" required maxlength="{{attribute.MaxLength}}" fc-autofocus="attribute.Autofocus" rows="{{attribute.Rows}}" cols="{{attribute.Cols}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" /></textarea>\r\n                            <textarea ng-disabled="attribute.ReadOnly" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" name="{{attribute.ModelValue}}" id="{{attribute.Id}}" ng-if="!attribute.Required" ng-model="vm.model[attribute.ModelValue]" fc-autofocus="attribute.Autofocus" maxlength="{{attribute.MaxLength}}" rows="{{attribute.Rows}}" cols="{{attribute.Cols}}" class="form-control"></textarea>\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- FileUpload --\x3e\r\n                <div ng-if="attribute.Type === \'file\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass,  \'has-error\': attribute.Required && vm.files[attribute.Index + \'error\']}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            \x3c!-- PBI851 : FCO Attachments: select photo from library - DSL-NW --\x3e\r\n                            \x3c!--\r\n                            <input class="upload-file" data-max-size="4194304" ng-if="attribute.Required" type="file" capture="camera" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" accept="{{attribute.Accept}};capture=camera" fc-autofocus="attribute.Autofocus" file-model="vm.files[attribute.Index]" required />\r\n                            <input class="upload-file" data-max-size="4194304" ng-if="!attribute.Required" type="file" capture="camera" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" accept="{{attribute.Accept}};capture=camera" fc-autofocus="attribute.Autofocus" file-model="vm.files[attribute.Index]" />\r\n                            --\x3e\r\n                            \x3c!-- PBI1091 : FCO - Attach Items to Service Request in Customer Portal --\x3e\r\n                            \x3c!-- added ng-disabled attribute --\x3e\r\n                            <input ng-disabled="attribute.ReadOnly" class="upload-file" data-max-size="4194304" ng-if="attribute.Required" type="file" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" accept="{{attribute.Accept}};capture=camera" fc-autofocus="attribute.Autofocus" file-model="vm.files[attribute.Index]" required />\r\n                            <input ng-disabled="attribute.ReadOnly" class="upload-file" data-max-size="4194304" ng-if="!attribute.Required" type="file" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" accept="{{attribute.Accept}};capture=camera" fc-autofocus="attribute.Autofocus" file-model="vm.files[attribute.Index]" />\r\n                            <span ng-show="attribute.Required && vm.files[attribute.Index + \'error\']" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Hidden field --\x3e\r\n                <div ng-if="attribute.Type === \'hidden\'">\r\n                    <input type="hidden" ng-model="vm.model[attribute.ModelValue]" />\r\n                </div>\r\n\r\n                \x3c!-- Password --\x3e\r\n                <div ng-if="attribute.Type === \'password\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <input name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" type="password" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" type="password" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" type="password" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" type="password" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- EPIC1008 : FCO - FCPayments (Company Feature) --\x3e\r\n                \x3c!-- CardConnect Tokenizer --\x3e\r\n                \x3c!-- https://developer.cardpointe.com/hosted-iframe-tokenizer#implementation-examples --\x3e\r\n                <div ng-if="attribute.Type === \'ccTokenizer\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <form name="tokenform" id="tokenform">\r\n                        <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                            <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                            <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                                <iframe id="ccIFrame" ng-src="{{vm.trustedSource}}" scrolling="no" frameborder="1" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" style="padding-top: 1px; padding-left: 0px; margin-bottom: -7px;"></iframe>\r\n                                <input type="hidden" name="mytoken" id="mytoken" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                                {{attribute.InputSufix}}\r\n                                <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                            </div>\r\n                        </div>\r\n                    </form>\r\n                </div>\r\n\r\n                \x3c!-- Button --\x3e\r\n                <div ng-if="attribute.Type == \'button\'" ng-class="{\'form-group col-sm-6 col-lg-6\': !attribute.CustomDivClass}" class="{{attribute.CustomDivClass}}">\r\n                    <button class="btn {{attribute.CustomInputClass}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" type=\'button\' ng-if="attribute.ReadOnly" disabled ng-click="attribute.onClick()">{{attribute.Required?"*":""}}{{attribute.Label}}</button>\r\n                    <button class="btn {{attribute.CustomInputClass}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" type=\'button\' ng-if="!attribute.ReadOnly" ng-click="attribute.onClick()">{{attribute.Required?"*":""}}{{attribute.Label}}</button>\r\n                </div>\r\n\r\n                \x3c!-- Button and Link --\x3e\r\n                <div ng-if="attribute.Type == \'buttonandlink\'" ng-class="{\'form-group col-sm-6 col-lg-6\': !attribute.CustomDivClass}" class="{{attribute.CustomDivClass}}">\r\n                    <button class="btn {{attribute.CustomInputClass}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" type=\'button\' ng-if="attribute.ReadOnly" disabled ng-click="attribute.onClick(\'button\')">{{attribute.Label}}</button>\r\n                    <button class="btn {{attribute.CustomInputClass}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" type=\'button\' ng-if="!attribute.ReadOnly" ng-click="attribute.onClick(\'button\')">{{attribute.Label}}</button>\r\n                    <a class="cursor_pointer {{attribute.CustomInputClass}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-click="attribute.onClick(\'link\')"><i class="{{attribute.ICustomInputClass}}"></i></a>\r\n                </div>\r\n\r\n                \x3c!-- PBI1145 : FCO - Crews - Screen layout change --\x3e\r\n                \x3c!-- button and label --\x3e\r\n                <div ng-if="attribute.Type === \'buttonandlabel\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <button class="btn {{attribute.CustomInputClass}}" style="margin-left: 0px !important;" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" type=\'button\' ng-if="attribute.ReadOnly" disabled ng-click="attribute.onClick()"><i ng-if="attribute.PrefixIcon" class="{{attribute.PrefixIcon}}"></i>&nbsp;{{attribute.Required?"*":""}}{{attribute.ButtonLabel}}&nbsp;<i ng-if="attribute.SuffixIcon" class="{{attribute.SuffixIcon}}"></i></button>\r\n                            <button class="btn {{attribute.CustomInputClass}}" style="margin-left: 0px !important;" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" type=\'button\' ng-if="!attribute.ReadOnly" ng-click="attribute.onClick()"><i ng-if="attribute.PrefixIcon" class="{{attribute.PrefixIcon}}"></i>&nbsp;{{attribute.Required?"*":""}}{{attribute.ButtonLabel}}&nbsp;<i ng-if="attribute.SuffixIcon" class="{{attribute.SuffixIcon}}"></i></button>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Link --\x3e\r\n                <div ng-if="attribute.Type == \'link\'" ng-class="{\'form-group col-sm-6 col-lg-6\': !attribute.CustomDivClass}" class="{{attribute.CustomDivClass}}">\r\n                    <a class="cursor_pointer {{attribute.CustomInputClass}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-click="attribute.onClick()"><i class="{{attribute.ICustomInputClass}}"></i> {{attribute.Label}}</a>\r\n                </div>\r\n\r\n                \x3c!-- Percent --\x3e\r\n                <div ng-if="attribute.Type === \'percent\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <input type="text" percentage-input name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" percentage-input name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" percentage-input name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" percentage-input name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- dropdowngrid --\x3e\r\n                <div ng-if="attribute.Type === \'dropdowngrid\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)" autofocus="attribute.Autofocus">\r\n                            <fc-auto-complete-table ng-if="attribute.ReadOnly" filter="attribute.filter" value="vm.model[attribute.ModelValue]" ctr-id="{{attribute.Id}}" api-method="{{attribute.ApiMethod}}" read-only="attribute.ReadOnly" autofocus="attribute.Autofocus" place-holder="{{attribute.PlaceHolder}}" on-select="attribute.onSelect(item)" value-prop="{{attribute.ValueProp}}" attributes="attribute.GridAttributes" page-size="attribute.PageSize" search-by-columns="attribute.SearchCols" search-trigger="attribute.SearchTrigger" show-header="attribute.ShowHeader" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}"></fc-auto-complete-table>\r\n                            <fc-auto-complete-table ng-if="!attribute.ReadOnly" filter="attribute.filter" value="vm.model[attribute.ModelValue]" ctr-id="{{attribute.Id}}" api-method="{{attribute.ApiMethod}}" read-only="attribute.ReadOnly" autofocus="attribute.Autofocus" place-holder="{{attribute.PlaceHolder}}" on-select="attribute.onSelect(item)" value-prop="{{attribute.ValueProp}}" attributes="attribute.GridAttributes" page-size="attribute.PageSize" search-by-columns="attribute.SearchCols" search-trigger="attribute.SearchTrigger" show-header="attribute.ShowHeader" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}"></fc-auto-complete-table>\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                \x3c!-- dropdowngrid and button--\x3e\r\n                <div ng-if="attribute.Type === \'dropdowngridbutton\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <fc-auto-complete-table ng-if="attribute.ReadOnly" filter="attribute.filter" value="vm.model[attribute.ModelValue]" ctr-id="{{attribute.Id}}" api-method="{{attribute.ApiMethod}}" read-only="attribute.ReadOnly" autofocus="attribute.Autofocus" place-holder="{{attribute.PlaceHolder}}" on-select="attribute.onSelect(item)" value-prop="{{attribute.ValueProp}}" attributes="attribute.GridAttributes" page-size="attribute.PageSize" search-by-columns="attribute.SearchCols" search-trigger="attribute.SearchTrigger" show-header="attribute.ShowHeader" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" style="width:80%; display:inline-block; position:relative;"></fc-auto-complete-table>\r\n                            <fc-auto-complete-table ng-if="!attribute.ReadOnly" filter="attribute.filter" value="vm.model[attribute.ModelValue]" ctr-id="{{attribute.Id}}" api-method="{{attribute.ApiMethod}}" read-only="attribute.ReadOnly" autofocus="attribute.Autofocus" place-holder="{{attribute.PlaceHolder}}" on-select="attribute.onSelect(item)" value-prop="{{attribute.ValueProp}}" attributes="attribute.GridAttributes" page-size="attribute.PageSize" search-by-columns="attribute.SearchCols" search-trigger="attribute.SearchTrigger" show-header="attribute.ShowHeader" fc-tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" style="width:80%; display:inline-block; position:relative;"></fc-auto-complete-table>\r\n                            <button class="btn" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" type=\'button\' ng-click="attribute.onClick()" ng-style="{\'position\': \'absolute\', \'width\':\'78px\' ,\'top\':\'0\'}">Search</button>\r\n\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n\r\n                \x3c!-- ByteImageClientUpload --\x3e\r\n                <div ng-if="attribute.Type === \'byteimage\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n\r\n                            <div ng-hide="attribute.ModelValue == \'UserImg\' && vm.model[attribute.ModelValue] == \'AAAAAA==\' || attribute.ModelValue == \'UserImg\' && !vm.model[attribute.ModelValue]">\r\n                                <img id="photo-id" class="default-image-placeholder" ng-src="data:image/jpeg;base64, {{vm.model[attribute.ModelValue]}}" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required" fc-autofocus="attribute.Autofocus" required ng-model="vm.model[attribute.ModelValue]" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'50%\'}" />\r\n                                <img id="photo-id" class="default-image-placeholder" ng-src="data:image/jpeg;base64, {{vm.model[attribute.ModelValue]}}" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'50%\'}" />\r\n                            </div>\r\n\r\n                            \x3c!-- Placeholder Image for User Profile --\x3e\r\n                            <div ng-if="attribute.ModelValue == \'UserImg\' && vm.model[attribute.ModelValue] == \'AAAAAA==\' || attribute.ModelValue == \'UserImg\' && !vm.model[attribute.ModelValue]">\r\n                                <img id="photo-id" ng-model="vm.model[attribute.ModelValue]" class="default-image-placeholder logo-img" src="Content/img/blank_male_avatar.jpg" alt="Upload Image">\r\n                            </div>\r\n                            <br />\r\n                            \x3c!-- Browse / Upload button --\x3e\r\n                            <div>\r\n                                <label ng-if="attribute.ModelValue == \'UserImg\'" class="btn btn-default btn-file" style="margin-left:0!important">\r\n                                    <i class="fa fa-camera" style="color:grey;"></i>&nbsp;Upload <input align="left" type="file" onchange="angular.element(this).scope().uploadImage(this)" name="{{attribute.ModelValue}}" bind-name-to="{{attribute.BindTo}}" id="photo-upload" style="display: none;" accept="image/*" />\r\n                                </label>\r\n                                <label ng-if="attribute.ModelValue != \'UserImg\'" class="btn btn-default btn-file" style="margin-left:0!important">\r\n                                    Browse <input align="left" type="file" onchange="angular.element(this).scope().uploadImage(this)" name="{{attribute.ModelValue}}" bind-name-to="{{attribute.BindTo}}" id="photo-upload" style="display: none;" accept="image/*" />\r\n                                </label>\r\n                            </div>\r\n                            <br />\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- SubHeader --\x3e\r\n                <div ng-if="attribute.Type === \'subheader\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomClass}" class="{{attribute.CustomDivClass}}">\r\n                    <h5 class="{{attribute.CustomLabelClass}}">{{attribute.Label}}</h5>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\r\n    <div class="row">\r\n        \x3c!------------------------------------------------------------------------------------------------------------\x3e\r\n        \x3c!-- GROUPS --------------------------------------------------------------------------------------------------\x3e\r\n        \x3c!------------------------------------------------------------------------------------------------------------\x3e\r\n        \x3c!-- PBI623 : FCO web ui --\x3e\r\n        \x3c!-- <div ng-repeat="group in attributes" ng-if="group.Type === \'group\'" class="row {{group.CustomClass}}"> --\x3e\r\n        \x3c!-- added: ng-class="group.CustomClass" --\x3e\r\n        <div ng-repeat="group in attributes" ng-if="group.Type === \'group\'" ng-init="$parentIndex = $Index" class="col-sm-12" ng-class="group.CustomClass">\r\n            \x3c!-- <h4>{{group.Label}}</h4> --\x3e\r\n            <div ng-repeat="attribute in group.Attributes">\r\n                \x3c!-- Text --\x3e\r\n                <div ng-if="attribute.Type === \'text\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}} fixed-height-56">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <input type="text" name="{{attribute.ModelValue}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" name="{{attribute.ModelValue}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" name="{{attribute.ModelValue}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" name="{{attribute.ModelValue}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            {{attribute.InputSufix}}\r\n                            \x3c!-- <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span> --\x3e\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Email --\x3e\r\n                <div ng-if="attribute.Type === \'email\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}} fixed-height-56">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <input type="text" name="{{attribute.ModelValue}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" name="{{attribute.ModelValue}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" name="{{attribute.ModelValue}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" name="{{attribute.ModelValue}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">\r\n                                <span ng-show="vm.formValidation[attribute.ModelValue].Required"> This field is required</span>\r\n                                <span ng-show="vm.formValidation[attribute.ModelValue].Email">Email is invalid</span>\r\n                            </span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Int --\x3e\r\n                <div ng-if="attribute.Type === \'int\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}} fixed-height-56">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                            \x3c!--\r\n                            <input type="number" decimal decimals="0" name="{{attribute.ModelValue}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" decimal decimals="0" name="{{attribute.ModelValue}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" decimal decimals="0" name="{{attribute.ModelValue}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" decimal decimals="0" name="{{attribute.ModelValue}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            --\x3e\r\n                            <input type="number" onwheel="this.blur()" decimal decimals="0" name="{{attribute.ModelValue}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" onwheel="this.blur()" decimal decimals="0" name="{{attribute.ModelValue}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" onwheel="this.blur()" decimal decimals="0" name="{{attribute.ModelValue}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" onwheel="this.blur()" decimal decimals="0" name="{{attribute.ModelValue}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            \x3c!-- BUG32 : END --\x3e\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Decimal --\x3e\r\n                <div ng-if="attribute.Type === \'decimal\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}} fixed-height-56">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <input type="text" decimal name="{{attribute.ModelValue}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" decimal name="{{attribute.ModelValue}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" decimal name="{{attribute.ModelValue}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="text" decimal name="{{attribute.ModelValue}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Currency --\x3e\r\n                <div ng-if="attribute.Type === \'currency\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}} fixed-height-56">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            \x3c!-- BUG32 : Quote Details/Work Order/Assignment > Negative value is accepted in Quantity and Hours field in FF browser only --\x3e\r\n                            \x3c!--\r\n                            <input type="number" currency-input name="{{attribute.ModelValue}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" currency-input name="{{attribute.ModelValue}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" currency-input name="{{attribute.ModelValue}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" currency-input name="{{attribute.ModelValue}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            --\x3e\r\n                            <input type="number" onwheel="this.blur()" currency-input name="{{attribute.ModelValue}}" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" onwheel="this.blur()" currency-input name="{{attribute.ModelValue}}" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" onwheel="this.blur()" currency-input name="{{attribute.ModelValue}}" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input type="number" onwheel="this.blur()" currency-input name="{{attribute.ModelValue}}" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" max="{{attribute.Max}}" maxlength="{{attribute.MaxLength}}" step="0.01" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            \x3c!-- BUG32 : END --\x3e\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Dropdown --\x3e\r\n                <div ng-if="attribute.Type === \'dropdown\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}} fixed-height-56">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <fc-dropdown name="{{attribute.ModelValue}}" plural="{{attribute.Plural}}" ng-if="attribute.Required" silent="attribute.Silent" fc-disabled="attribute.ReadOnly" list="attribute.List" filter="attribute.Filter" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" required="true" convert-to-int="{{attribute.ConvertToInt}}" label="{{attribute.Required?"*":""}}{{attribute.Label}}" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" on-enter="vm.onEnter()" select-first="{{attribute.SelectFirst}}" on-open="attribute.OnOpen()" on-loaded="attribute.OnLoaded()" on-change="attribute.OnChange()"></fc-dropdown>\r\n                            <fc-dropdown name="{{attribute.ModelValue}}" plural="{{attribute.Plural}}" ng-if="!attribute.Required" fc-disabled="attribute.ReadOnly" list="attribute.List" filter="attribute.Filter" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" convert-to-int="{{attribute.ConvertToInt}}" label="{{attribute.Required?"*":""}}{{attribute.Label}}" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" on-enter="vm.onEnter()" select-first="{{attribute.SelectFirst}}" on-open="attribute.OnOpen()" on-loaded="attribute.OnLoaded()" on-change="attribute.OnChange()"></fc-dropdown>\r\n                            \x3c!-- <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span> --\x3e\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Checkbox --\x3e\r\n                <div ng-if="attribute.Type === \'checkbox\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}} fixed-height-56">\r\n                    <div class="form-group checkbox" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter(attribute)">\r\n                        <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                            <div aria-disabled="false" aria-checked="{{vm.model[attribute.ModelValue]}}" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': vm.model[attribute.ModelValue]}" fc-focusout="vm.customFocus(attribute)">\r\n                                <input type="checkbox" ng-model="vm.model[attribute.ModelValue]" fc-autofocus="attribute.Autofocus" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                            </div>\r\n                            {{attribute.Required?"*":""}}{{attribute.Label}}\r\n                        </label>\r\n                        <a class="cursor_pointer" ng-click="attribute.LinkOnClick()">{{attribute.Link}}</a>\r\n                    </div>\r\n                </div>\r\n\r\n\r\n                \x3c!-- Colorpicker --\x3e\r\n                <div ng-if="attribute.Type === \'colorpicker\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}} fixed-height-56">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <ngjs-color-picker selected="vm.model[attribute.ModelValue]" options="vm.colorpickerOptions" custom-colors="vm.colorpickerColors"></ngjs-color-picker>\r\n                            <input name="{{attribute.ModelValue}}" ng-if="attribute.Required" type="text" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" required />\r\n                            <input name="{{attribute.ModelValue}}" ng-if="!attribute.Required" type="text" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" />\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Empty --\x3e\r\n                <div ng-if="attribute.Type === \'empty\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomClass}" class="{{attribute.CustomClass}}">\r\n                    <div></div>\r\n                </div>\r\n\r\n                \x3c!-- Line --\x3e\r\n                <div ng-if="attribute.Type === \'line\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomClass}" class="{{attribute.CustomClass}}">\r\n                    <hr />\r\n                </div>\r\n\r\n                \x3c!-- Multiselect --\x3e\r\n                <div ng-if="attribute.Type === \'multiselect\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}} fixed-height-56">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <fc-multiselect ng-if="attribute.Required" list="attribute.List" fc-disabled="attribute.ReadOnly" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" required="true" convert-to-int="{{attribute.ConvertToInt}}" filter="attribute.Filter" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" items-loaded="attribute.ItemsLoaded" on-enter="vm.onEnter()"></fc-multiselect>\r\n                            <fc-multiselect ng-if="!attribute.Required" list="attribute.List" fc-disabled="attribute.ReadOnly" value="vm.model[attribute.ModelValue]" api-method="{{attribute.ApiMethod}}" value-prop="{{attribute.ValueProp}}" text-prop="{{attribute.TextProp}}" convert-to-int="{{attribute.ConvertToInt}}" filter="attribute.Filter" current-list="attribute.CurrentList" no-sort="{{attribute.NoSort}}" items-loaded="attribute.ItemsLoaded" on-enter="vm.onEnter()"></fc-multiselect>\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- PBI717 : FCO - Labor time to round to nearest quarter hour - DSL-NW --\x3e\r\n                \x3c!-- signature --\x3e\r\n                <div ng-if="attribute.Type === \'signature\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <canvas id="signatureCanvas" required="" fc-signature width="500" height="150" style="border: 1px  solid #000000"></canvas>\r\n                            <button class="btn {{attribute.CustomInputClass}}" type=\'button\' ng-click="attribute.onClick()" style="margin-left: -1px;">Clear Signature</button>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Datepicker --\x3e\r\n                <div ng-if="attribute.Type === \'datepicker\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}} fixed-height-56">\r\n                    <div class="form-group" datepicker-div fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div data-min-view="2" class="{{attribute.CustomInputClass}}" ng-class="{\'input-group date datetime col-sm-9 col-md-8 col-lg-7 paddingLeft30\': !attribute.CustomInputClass}" date-time-append fc-focusout="vm.customFocus(attribute)">\r\n                            \x3c!-- BUG87 : Invalid date is not removed from �From Date/To Date� field on Unapplied Time page --\x3e\r\n                            \x3c!-- <input ng-disabled="attribute.ReadOnly" ng-if="attribute.SubType == \'date\' || !attribute.SubType" name="{{attribute.ModelValue}}" type="datetime" date-time ng-model="vm.model[attribute.ModelValue]" fc-autofocus="attribute.Autofocus" format="{{attribute.Format}}" auto-close="true" min-view="date" max-view="date" class="form-control" /> --\x3e\r\n                            <input onpaste="return false;" ng-disabled="attribute.ReadOnly" ng-if="attribute.SubType == \'date\' || !attribute.SubType" name="{{attribute.ModelValue}}" type="datetime" date-time ng-model="vm.model[attribute.ModelValue]" fc-autofocus="attribute.Autofocus" format="{{attribute.Format}}" auto-close="true" min-view="date" max-view="date" class="form-control" />\r\n                            \x3c!-- BUG87 : END --\x3e\r\n                            <span ng-if="attribute.SubType == \'date\' || !attribute.SubType" class="input-group-addon btn btn-white">\r\n                                <span class="glyphicon" ng-class="{\'glyphicon-time\': attribute.SubType == \'time\', \'glyphicon-calendar\': attribute.SubType != \'time\'}"></span>\r\n                            </span>\r\n                            <fc-timeselect fc-disabled="attribute.ReadOnly" ng-if="attribute.SubType == \'time\' || !attribute.SubType" value="vm.model[attribute.ModelValue]" required="attribute.Required" predefined="{{attribute.Predefined}}"></fc-timeselect>\r\n                        </div>\r\n                        <span class="col-lg-4 col-lg-offset-3" ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" style="color:#A94442">This field is required</span>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Checkbox action --\x3e\r\n                <div ng-if="attribute.Type === \'checkboxAction\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass}" class="{{attribute.CustomDivClass}} fixed-height-56">\r\n                    <div class="form-group checkbox" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter(attribute)">\r\n                        <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                            <div aria-disabled="false" aria-checked="{{attribute.Value}}" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': attribute.Value}" fc-focusout="vm.customFocus(attribute)">\r\n                                <input type="checkbox" ng-model="attribute.Value" fc-autofocus="attribute.Autofocus" ng-change="attribute.onChange()" class="icheck" style="position: absolute; opacity: 0;" />\r\n                                <ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                            </div>\r\n                            {{attribute.Required?"*":""}}{{attribute.Label}}\r\n                        </label>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Textarea --\x3e\r\n                <div ng-if="attribute.Type === \'textarea\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}} fixed-height-56">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <textarea ng-disabled="attribute.ReadOnly" name="{{attribute.ModelValue}}" id="{{attribute.Id}}" ng-if="attribute.Required" required maxlength="{{attribute.MaxLength}}" fc-autofocus="attribute.Autofocus" rows="{{attribute.Rows}}" cols="{{attribute.Cols}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" /></textarea>\r\n                            <textarea ng-disabled="attribute.ReadOnly" name="{{attribute.ModelValue}}" id="{{attribute.Id}}" ng-if="!attribute.Required" ng-model="vm.model[attribute.ModelValue]" fc-autofocus="attribute.Autofocus" maxlength="{{attribute.MaxLength}}" rows="{{attribute.Rows}}" cols="{{attribute.Cols}}" class="form-control"></textarea>\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- FileUpload --\x3e\r\n                <div ng-if="attribute.Type === \'file\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass}" class="{{attribute.CustomDivClass}} fixed-height-56">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <input class="upload-file" data-max-size="4194304" ng-if="attribute.Required" type="file" accept="{{attribute.Accept}}" fc-autofocus="attribute.Autofocus" file-model="vm.files[attribute.Index]" required />\r\n                            <input class="upload-file" data-max-size="4194304" ng-if="!attribute.Required" type="file" accept="{{attribute.Accept}}" fc-autofocus="attribute.Autofocus" file-model="vm.files[attribute.Index]" />\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Hidden field --\x3e\r\n                <div ng-if="attribute.Type === \'hidden\'">\r\n                    <input type="hidden" ng-model="vm.model[attribute.ModelValue]" />\r\n                </div>\r\n\r\n                \x3c!-- Password --\x3e\r\n                <div ng-if="attribute.Type === \'password\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}} fixed-height-56">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <input name="{{attribute.ModelValue}}" type="password" ng-if="attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input name="{{attribute.ModelValue}}" type="password" ng-if="!attribute.Required && !attribute.ReadOnly" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input name="{{attribute.ModelValue}}" type="password" ng-if="attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" required readonly="readonly" maxlength="{{attribute.MaxLength}}" ng-model="vm.model[attribute.ModelValue]" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            <input name="{{attribute.ModelValue}}" type="password" ng-if="!attribute.Required && attribute.ReadOnly" fc-autofocus="attribute.Autofocus" readonly="readonly" ng-model="vm.model[attribute.ModelValue]" maxlength="{{attribute.MaxLength}}" class="form-control" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'100%\'}" />\r\n                            {{attribute.InputSufix}}\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                \x3c!-- Button --\x3e\r\n                <div ng-if="attribute.Type == \'button\'" ng-class="{\'form-group col-sm-6 col-lg-6\': !attribute.CustomDivClass}" class="{{attribute.CustomDivClass}}">\r\n                    <button class="btn {{attribute.CustomInputClass}}" type=\'button\' ng-disabled="attribute.Disabled" ng-click="attribute.onClick()">{{attribute.Required?"*":""}}{{attribute.Label}}</button>\r\n                </div>\r\n\r\n                \x3c!-- Link --\x3e\r\n                <div ng-if="attribute.Type == \'link\'" ng-class="{\'form-group col-sm-6 col-lg-6\': !attribute.CustomDivClass}" class="{{attribute.CustomDivClass}}">\r\n                    <a class="cursor_pointer {{attribute.CustomInputClass}}" ng-click="attribute.onClick()"><i class="{{attribute.ICustomInputClass}}"></i> {{attribute.Label}}</a>\r\n                </div>\r\n                \x3c!-- ByteImageClientUpload --\x3e\r\n                <div ng-if="attribute.Type === \'byteimage\'" ng-class="{\'col-sm-6 col-lg-6\': !attribute.CustomDivClass, \'has-error\': attribute.Required && vm.formValidation[attribute.ModelValue].Error}" class="{{attribute.CustomDivClass}}">\r\n                    <div class="form-group" fc-focusout="vm.checkValidationForField(attribute)" fc-enter="vm.onEnter()">\r\n                        <label class="control-label {{attribute.CustomLabelClass}}" ng-class="{\'col-sm-3 col-md-4 col-lg-3\': !attribute.CustomLabelClass}">{{attribute.Required?"*":""}}{{attribute.Label}}</label>\r\n                        <div class="{{attribute.CustomInputClass}}" ng-class="{\'col-sm-9 col-md-8 col-lg-7\': !attribute.CustomInputClass}" fc-focusout="vm.customFocus(attribute)">\r\n                            <div ng-hide="attribute.ModelValue == \'UserImg\'">\r\n                                <img id="photo-id" class="default-image-placeholder" ng-src="data:image/jpeg;base64, {{vm.model[attribute.ModelValue]}}" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="attribute.Required" fc-autofocus="attribute.Autofocus" required ng-model="vm.model[attribute.ModelValue]" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'60%\'}" />\r\n                                <img id="photo-id" class="default-image-placeholder" ng-src="data:image/jpeg;base64, {{vm.model[attribute.ModelValue]}}" name="{{attribute.ModelValue}}" tabindex="{{attribute.TabIndex ? attribute.TabIndex : vm.splitAttributes.length*($index + 1) + $parentIndex}}" ng-if="!attribute.Required" fc-autofocus="attribute.Autofocus" ng-model="vm.model[attribute.ModelValue]" ng-style="{\'display\': \'inline\', \'width\': attribute.InputSufix ? \'auto\' : \'60%\'}" />\r\n                            </div>\r\n                            \x3c!-- Placeholder Image for User Profile --\x3e\r\n                            <div ng-if="attribute.ModelValue == \'UserImg\' && !vm.model[attribute.ModelValue]">\r\n                                <img id="photo-id" ng-model="vm.model[attribute.ModelValue]" class="default-image-placeholder logo-img" src="Content/img/blank_male_avatar.jpg" alt="Upload Image">\r\n                            </div>\r\n\r\n                            <br />\r\n                            <div ng-if="attribute.ModelValue == \'UserImg\'">\r\n                                <label class="btn btn-default btn-file" style="margin-left:0!important">\r\n                                    <i class="fa fa-camera" style="color:grey;"></i>&nbsp;Upload <input align="left" type="file" onchange="angular.element(this).scope().uploadImage(this)" name="{{attribute.ModelValue}}" bind-name-to="{{attribute.BindTo}}" id="photo-upload" style="display: none;" accept="image/*" />\r\n                                </label>\r\n                            </div>\r\n                            <div ng-if="attribute.ModelValue != \'UserImg\'">\r\n                                <label class="btn btn-default btn-file" style="margin-left:0!important">\r\n                                    Browse <input type="file" onchange="angular.element(this).scope().uploadImage(this)" name="{{attribute.ModelValue}}" bind-name-to="{{attribute.BindTo}}" id="photo-upload" style="display: none;" accept="image/*" />\r\n                                </label>\r\n                            </div>\r\n                            <br />\r\n                            <span ng-show="attribute.Required && vm.formValidation[attribute.ModelValue].Error" class="validation">This field is required</span>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                \x3c!-- PBI623 : FCO web ui --\x3e\r\n                \x3c!-- SubHeader --\x3e\r\n                <div ng-if="attribute.Type === \'subheader\'" ng-class="{\'col-sm-12 col-lg-12\': !attribute.CustomClass}" class="{{attribute.CustomDivClass}}">\r\n                    <h5 class="{{attribute.CustomLabelClass}}">{{attribute.Label}}</h5>\r\n                </div>\r\n                \x3c!-- PBI623 : END --\x3e\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class="row">\r\n        <div class="col-sm-offset-6 col-sm-6 col-md-6">\r\n\r\n            <div class="form-group">\r\n                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                    <button type="button" ng-class="{\'disabled\': vm.cancelBlock}" ng-disabled="vm.disableCancel" ng-hide="vm.hideCancel" class="btn btn-default table-edit-cancel-btn" ng-click="vm.onBack()">{{cancelButtonText || "Cancel"}}</button>\r\n                    <button type="button" ng-if="((!vm.id && vm.gui.getVisibility(vm.modulePrivilege, \'Create\')) || (vm.id && vm.gui.getVisibility(vm.modulePrivilege, \'Update\')))" class="btn btn-primary table-edit-submit-btn push-left" ng-class="{\'disabled\': vm.submitBlock}" ng-disabled="vm.disableSubmit" ng-hide="vm.hideSubmit" ng-click="vm.onSubmit()" value="Submit">{{submitButtonText || "Submit"}}</button>\r\n                </div> \x3c!-- input box --\x3e\r\n            </div> \x3c!-- form group --\x3e\r\n\r\n        </div> \x3c!-- columns --\x3e\r\n    </div>\r\n</form>\r\n\r\n\x3c!--</div>--\x3e\r\n\x3c!--\r\nNote: ? means it is optional\r\n\r\n{Type: "text", Label?: "LabelText", Required?: true, MaxLength?: "", ModelValue: "valueName", CustomDivClass?: "", CustomLabelClass?: "", CustomInputClass?: "", InputSufix?: "%", ReadOnly?: true}\r\n{Type: "email", Label?: "LabelText", Required?: true, MaxLength?: "", ModelValue: "valueName", CustomDivClass?: "", CustomLabelClass?: "", CustomInputClass?: "", InputSufix?: "%", ReadOnly?: true}\r\n{Type: "int", Label?: "LabelText", Required?: true, MaxLength?: "3", Max?: "255", ModelValue: "valueName", CustomDivClass?: "", CustomLabelClass?: "", CustomInputClass?: "", InputSufix?: "%", ReadOnly?: true}\r\n{Type: "decimal", Label?: "LabelText", Required?: true, MaxLength?: "3", Max?: "255", ModelValue: "valueName", CustomDivClass?: "", CustomLabelClass?: "", CustomInputClass?: "", InputSufix?: "%", ReadOnly?: true}\r\n{Type: "dropdown", Label?: "LabelText", Required?: true, ApiMethod: "contacts", ValueProp: "Id", TextProp: "Name", ModelValue: "valueName", CustomDivClass?: "", CustomLabelClass?: "", CustomInputClass?: "", ConvertToInt?: "true", Filter?: {CountryId: 1}}\r\n{Type: "checkbox", Label?: "LabelText", ModelValue: "valueName", CustomDivClass?: ""}\r\n{Type: "colorpicker", Label?: "LabelText", Required? : false, ModelValue: "valueName", CustomDivClass?: "", CustomLabelClass?: "", CustomInputClass?: ""}\r\n{Type: "empty", CustomClass?: ""}\r\n{Type: "line", CustomClass?: ""}\r\n{Type: "group", Label?: "", CustomClass?: "", Attributes: [lista atributa osim grupe]}\r\n{Type: "multiselect", Label?: "LabelText", Required?: true, ApiMethod: "contacts", ValueProp: "Id", TextProp: "Name", ModelValue: "valueName", CustomDivClass?: "", CustomLabelClass?: "", CustomInputClass?: ""}\r\n{Type: "datepicker", Label?: "LabelText", Format: "MM/dd/yy" Required?: true, SubType: "date za datum a sve ostalo ide do minuta", CustomDivClass?: "", CustomLabelClass?: "", CustomInputClass?: ""}\r\n{Type: "checkboxAction", Label?: "LabelText", onChange: function, Value?: value}\r\n{Type: "textarea", Label?: "LabelText", Required?: true, MaxLength?: "", ModelValue: "valueName", CustomDivClass?: "", CustomLabelClass?: "", CustomInputClass?: "", Rows?: 3, Cols?: 3}\r\n{Type: "file", Label?: "LabelText", Required?: true, Accept?: "image", CustomDivClass?: "", CustomLabelClass?: "", CustomInputClass?: "", ApiMethod: "sites"}\r\n --\x3e\r\n'),e.put("Templates/Utils/tabs.html",'<ul class="nav nav-tabs">\r\n    <li ng-repeat="tab in vm.tabs" class="cursor_pointer fc_tab_{{tab.text}} {{tab.hide}}" ng-class="{active: vm.tab == tab.text, disabled: tab.disabled}" ng-click="vm.changeTab(tab)"><a>{{tab.text}}</a></li>\r\n</ul>\r\n<div class="tab-content" ng-transclude>\r\n\r\n</div>\r\n'),e.put("Templates/Utils/timeselect.html",'<select ng-disabled="fcDisabled" tabindex="{{fcTabindex}}" class=\'form-control\' ng-model="vm.internalValue" ng-options="time.time as time.time for time in vm.items" ng-change="vm.changeValue()" style="width:111px">\r\n    \x3c!-- <option value="" ng-if="required">Select</option> --\x3e\r\n</select>\r\n'),e.put("Templates/Utils/xoiDataPlate.html",'\x3c!-- EPIC981 : FCO - XOi Integration --\x3e\r\n<div class="table-responsive" style="overflow-x:visible">\r\n    <div id="datatable-icons_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div style="max-height: 243px; overflow-y: auto; margin-left: -15px; margin-right: -15px;">\r\n                    <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" style="margin-top: 0px !important;" role="grid" aria-describedby="datatable-icons_info">\r\n                        <thead style="position: -webkit-sticky; position: sticky; top: 1px; z-index: 100; background-color: white;">\r\n                            <tr role="row" class="disable-text-selection">\r\n                                <th>Make</th>\r\n                                <th>Model</th>\r\n                                <th>Serial Number</th>\r\n                                <th>Mfr Date</th>\r\n                            </tr>\r\n                        </thead>\r\n                        <tbody>\r\n                            <tr class="table-hover" role="row" ng-repeat="dataPlate in vm.dataPlateData | filter:{ SourceId:\'!!\'}" ng-click="vm.setSelected(dataPlate)" ng-class="{active: (vm.selected == dataPlate.SourceId)}">\r\n                                <td><span>{{dataPlate.Make}}</span>\r\n                                <td><span>{{dataPlate.Model}}</span></td>\r\n                                <td><span>{{dataPlate.Serial}}</span></td>\r\n                                <td><span>{{vm.toDate(dataPlate.MfgDate)  | date : \'MM/dd/yyyy\'}}</span></td>\r\n                            </tr>\r\n                        </tbody>\r\n                    </table>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Vendor/vendorEdit.html",'<div id="pcont" class="container-fluid" class="container-fluid" ng-controller="VendorEditController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'vendors\')">Vendor</a></li>\r\n            <li class="active">{{vm.model.VendorName}}</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Vendor</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <fc-table-edit api-method="vendors" id="{{vm.id}}" on-back="vm.$state.go(\'vendors\')" attributes="vm.attributes" model="vm.model" ></fc-table-edit>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/Vendor/vendorTable.html",'\r\n<div id="pcont" class="container-fluid" >\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Vendor</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Vendor</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content" ng-controller="VendorController as vm">\r\n                        \x3c!-- LOADING SPINNER --\x3e\r\n                        <div ng-if="vm.isLoading;" class="table-edit-overlay">\r\n                            <div class="sk-circle">\r\n                                <div class="sk-circle1 sk-child"></div>\r\n                                <div class="sk-circle2 sk-child"></div>\r\n                                <div class="sk-circle3 sk-child"></div>\r\n                                <div class="sk-circle4 sk-child"></div>\r\n                                <div class="sk-circle5 sk-child"></div>\r\n                                <div class="sk-circle6 sk-child"></div>\r\n                                <div class="sk-circle7 sk-child"></div>\r\n                                <div class="sk-circle8 sk-child"></div>\r\n                                <div class="sk-circle9 sk-child"></div>\r\n                                <div class="sk-circle10 sk-child"></div>\r\n                                <div class="sk-circle11 sk-child"></div>\r\n                                <div class="sk-circle12 sk-child"></div>\r\n                            </div>\r\n                        </div>\r\n                        <fc-table api-method="vendors"\r\n                                  attributes="vm.attributes"\r\n                                  on-edit="vm.edit(id)">\r\n                        </fc-table>\r\n                    </div>\x3c!-- content --\x3e\r\n                </div>\x3c!-- block-flat --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>'),e.put("Templates/Views/views.html",'<div id="pcont" class="container-fluid" ng-controller="ViewsController as vm" >\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">Views</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Views</h1>\r\n    </div>\r\n    <div class="cl-mcont" ng-if="vm.isLoadedPrivilege " >\r\n        <div id="hidebtn">\r\n            <fc-table-edit model="vm.modeldropdown"\r\n                           on-enter="vm.search()"\r\n                           attributes="vm.attributesdropdown">\r\n\r\n            </fc-table-edit>\r\n        </div>\r\n        <div class="form-group">\r\n            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                <button type="submit" ng-disabled="vm.searchBtn" class="btn btn-primary" ng-click="vm.search()">Search</button>\r\n            </div> \x3c!-- input box --\x3e\r\n        </div>\r\n        <div id="hidesearch">\r\n            <fc-editable-drill-down-recursive \r\n                                    api-method="moduleroleprivileges"\r\n                                    child-api-method="objectroleprivileges"\r\n                                    attributes="vm.attributes"\r\n                                    child-attributes="vm.childAttributes"\r\n                                    submit-notification-text="{{vm.submitText}}"\r\n                                    filter="vm.viewFilter">\r\n            </fc-editable-drill-down-recursive>\r\n        </div>\r\n        </div>\r\n    </div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/assignmentEmail.html",'<div id="myModal" class="fade signatureCan" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n                    <div id="pcont" class="container-fluid" style=" position: fixed; left: 20%; top: 30%;">\r\n                        <div class="cl-mcont" >\r\n                            <div class="row  form-horizontal" >\r\n                                <div class="col-md-12">\r\n                                \x3c!--dodavanje emaila--\x3e\r\n                                    <div class="table-responsive" style="overflow-x: visible">\r\n                                        <table class="table hover reportTableTitle" style="background-color: #fff;">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th>Notify Dispatcher</th>\r\n                                                </tr>\r\n                                            </thead>\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <th>\r\n                                                        <div class="form-group">\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Email</label>\r\n                                                                <div class="col-sm-12 col-md-12 col-lg-12">\r\n                                                                    <input id="" type="text" required ng-model="vm.model.Email" class="form-control ng-valid ng-valid-required" disabled>\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Message</label>\r\n                                                                <br />\r\n                                                                <div class="col-sm-12 col-md-12 col-lg-12">\r\n                                                                    <textarea style="min-width:20%" id="" required ng-model="vm.model.EmailMessage" class="form-control ng-valid ng-valid-required"></textarea>\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                        </div> \x3c!-- form group --\x3e\r\n                                                    </th>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                                    <div class="table-responsive"  style="overflow-x: visible">\r\n                                        <button class="btn btn-default floatRight"  ng-click="vm.ok()"><i class="fa  fa-check"></i> Send email</button>\r\n                                        <button class="btn btn-default floatRight" ng-click="vm.onBack()"><i class="fa  fa-times-circle"></i> Close</button>\r\n                                    </div>\r\n                                </div> \x3c!-- columns --\x3e\r\n                            </div> \x3c!-- row --\x3e\r\n                        </div>\x3c!-- content --\x3e\r\n                    </div>\r\n                \r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/formEmail.html",'<div id="myModal" class="fade signatureCan" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n                    <div id="pcont" class="container-fluid" style=" position: fixed; left: 20%; top: 30%;">\r\n                        <div class="cl-mcont">\r\n                            <div class="row  form-horizontal">\r\n                                <div class="col-md-12">\r\n                                \x3c!--dodavanje emaila--\x3e\r\n                                    <div class="table-responsive" style="overflow-x: visible">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th>Email</th>\r\n                                                </tr>\r\n                                            </thead>\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <th>\r\n                                                        <div class="form-group">\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Send To:</label>\r\n                                                                <div class="col-sm-12 col-md-12 col-lg-12">\r\n                                                                    <input id="" type="text" required ng-model="vm.model.EmailAddress" class="form-control ng-valid ng-valid-required">\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Message:</label>\r\n                                                                <div class="col-sm-12 col-md-12 col-lg-12">\r\n                                                                    <textarea id="" required ng-model="vm.model.EmailMessage" class="form-control ng-valid ng-valid-required"></textarea>\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                        </div> \x3c!-- form group --\x3e\r\n                                                    </th>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                                    <div class="table-responsive"  style="overflow-x: visible">\r\n                                        <button class="btn btn-default floatRight"  ng-click="vm.ok()"><i class="fa  fa-check"></i> Send email</button>\r\n                                        <button class="btn btn-default floatRight" ng-click="vm.onBack()"><i class="fa  fa-times-circle"></i> Close</button>\r\n                                    </div>\r\n                                </div> \x3c!-- columns --\x3e\r\n                            </div> \x3c!-- row --\x3e\r\n                        </div>\x3c!-- content --\x3e\r\n                    </div>\r\n                \r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/manageWorkOrder.html",'<div id="pcont" class="container-fluid" ng-controller="ManageWorkOrderController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n\r\n            <li class="active">Manage Work Order  </li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Manage Work Order {{}}</h1>\r\n    </div>\r\n    <div class="cl-mcont" ng-if="vm.getModulePrivilege(vm.viewName, vm.moduleName) !=0">\r\n        \x3c!-- LOADING SPINNER --\x3e\r\n        <div ng-hide="!vm.isLoading" class="table-edit-overlay">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        <div class="row" id="manageWO">\r\n            <div class="col-md-12">\r\n                <div class="block-flat">\r\n                    <div class="content">\r\n                        <div class="row  form-horizontal">\r\n                            <div class="clearfix CollapsibleTitle">\r\n                                <button type="button" class="btn btn-info pull-right Collapsible" data-toggle="collapse" data-target="#Collapsible"><i class="fa fa-search-minus"></i></button>\r\n                            </div>\r\n\r\n                            <div id="Collapsible" class="collapse in clearfix">\r\n                                <div class="col-sm-6 col-lg-6">\r\n                                    <div class="form-group" fc-enter="vm.loadFilter()">\r\n                                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">From Date:</label>\r\n                                        <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                            \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                                            \x3c!-- <input name="StartDate" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" type="datetime" date-time="" ng-model="vm.filter1.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                                            <input name="StartDate" onpaste="return false;" restrict-to="{{vm.dateService.restrictToDate()}}" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" type="datetime" date-time="" ng-model="vm.filter1.startDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                            \x3c!-- BUG87 : END --\x3e\r\n                                            <span class="input-group-addon btn btn-white">\r\n                                                <span class="glyphicon glyphicon-calendar"></span>\r\n                                            </span>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class="col-sm-6 col-lg-6">\r\n                                    <div class="form-group" fc-enter="vm.loadFilter()">\r\n                                        <label class="control-label  col-sm-3 col-md-4 col-lg-3">To Date:</label>                                        \r\n                                        <div data-min-view="2" class="input-group date datetime col-sm-5 col-md-4 col-lg-4 paddingLeft15" date-time-append="">\r\n                                            \x3c!-- BUG87 : Invalid date is not removed from “From Date/To Date” field on Unapplied Time page --\x3e\r\n                                            \x3c!-- <input name="EndDate" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter1.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid"> --\x3e\r\n                                            <input name="EndDate" onpaste="return false;" restrict-to="{{vm.dateService.restrictToDate()}}" type="datetime" date-time="" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" ng-model="vm.filter1.endDate" fc-autofocus="attribute.Autofocus" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control ng-scope ng-isolate-scope ng-pristine ng-valid">\r\n                                            \x3c!-- BUG87 : END --\x3e\r\n                                            <span class="input-group-addon btn btn-white">\r\n                                                <span class="glyphicon glyphicon-calendar"></span>\r\n                                            </span>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <fc-table-edit api-method="wo"\r\n                                               model="vm.model"\r\n                                               attributes="vm.attributes"\r\n                                               on-enter="vm.loadFilter()">\r\n                                </fc-table-edit>\r\n                                <div class="form-group">\r\n                                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                        <button type="submit" class="btn btn-primary push-left" ng-click="vm.loadFilter()">Search</button>\r\n                                    </div> \x3c!-- input box --\x3e\r\n                                </div>\r\n                            </div>\x3c!-- Collapsible section end --\x3e\r\n                        </div>\x3c!-- row end --\x3e\r\n                        \x3c!-- PBI807 : FCO - Manage work orders - DSL-NW --\x3e\r\n                        \x3c!-- aded on-last property --\x3e\r\n                        <div class="row  form-horizontal">\r\n                            <fc-table api-method="wo/filter"\r\n                                      attributes="vm.attributestab"\r\n                                      on-edit="vm.edit(id, item)"\r\n                                      selected="vm.filter.filterId"\r\n                                      list="vm.list"\r\n                                      filter="vm.autoFilter"\r\n                                      timezone="vm.manageWOTimezone"\r\n                                      ng-if="vm.loadWoes"\r\n                                      view-name="ManageWorkOrders"\r\n                                      module-name="ManageWorkOrdersGrid"\r\n                                      on-last="vm.onLast()"\r\n                                >\r\n                            </fc-table>\r\n                        </div>\r\n                        </div>\x3c!-- content --\x3e\r\n                        </div>\x3c!-- block-flat --\x3e\r\n                    </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/miscModal.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n    \x3c!-- BUG642 : DSL - Scroll parts screen --\x3e\r\n    \x3c!-- <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px;"> --\x3e\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n        \x3c!-- BUG642 : DSL - Scroll parts screen --\x3e\r\n        \x3c!-- <div class="modal-content"> --\x3e\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 80%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="miscEdit.close()">&times;</button>\r\n                <h4 class="modal-title">Miscellaneous</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                \x3c!-- PBI638 : FCO - Miscellaneous fields --\x3e\r\n                \x3c!--\r\n                <div class="row" ng-hide="miscEdit.id!=null && miscEdit.id>0">\r\n                    <div class="col-sm-6">\r\n                        <div id="datatable-icons_filter" class="dataTables_filter" style="text-align:left">\r\n                            <label>\r\n                                Search:<i id="search-info" class="fa fa-info-circle" style="display: inline-block" title="Search by Misc Item."></i>\r\n                                <input id="seacrhInputMisc" type="search" class="form-control input-sm" ng-model="miscEdit.searchText" fc-enter="miscEdit.search()">\r\n                                <button class="btn btn-primary add-new-btn" ng-click="miscEdit.search()">Search</button>\r\n                            </label>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                --\x3e\r\n                \x3c!-- PBI601 : DSL - Add additional fields to the Miscellaneous screen --\x3e\r\n                \x3c!-- <fc-table-edit api-method="miscs" --\x3e\r\n                <fc-table-edit api-method="{{miscEdit.apiMethod}}"\r\n                               id="{{miscEdit.id}}"\r\n                               model="miscEdit.model"\r\n                               view-name="{{miscEdit.viewName}}"\r\n                               module-name="{{miscEdit.moduleName}}"\r\n                               attributes="miscEdit.attributes"\r\n                               on-back="miscEdit.close(insertData)">\r\n                </fc-table-edit>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class="modal-backdrop in fade"></div>\r\n</div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/newServiceReport.html",'<div id="myModal" class="fade signatureCan" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n        \x3c!-- Modal content--\x3e\r\n        <div class="modal-content" style="overflow-y: auto; height: 90%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h4 class="modal-title">Report</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                \x3c!-- LOADING SPINNER --\x3e\r\n                <div ng-hide="!vm.isLoading" class="table-edit-overlay">\r\n                    <div class="sk-circle">\r\n                        <div class="sk-circle1 sk-child"></div>\r\n                        <div class="sk-circle2 sk-child"></div>\r\n                        <div class="sk-circle3 sk-child"></div>\r\n                        <div class="sk-circle4 sk-child"></div>\r\n                        <div class="sk-circle5 sk-child"></div>\r\n                        <div class="sk-circle6 sk-child"></div>\r\n                        <div class="sk-circle7 sk-child"></div>\r\n                        <div class="sk-circle8 sk-child"></div>\r\n                        <div class="sk-circle9 sk-child"></div>\r\n                        <div class="sk-circle10 sk-child"></div>\r\n                        <div class="sk-circle11 sk-child"></div>\r\n                        <div class="sk-circle12 sk-child"></div>\r\n                    </div>\r\n                </div>\r\n                <div id="cl-wrapper">\r\n                    <div id="pcont" class="container-fluid">\r\n                        <div class="cl-mcont">\r\n                            <div class="row  form-horizontal">\r\n                                <div class="col-md-12">\r\n                                    \x3c!--dodavanje emaila--\x3e\r\n                                    <div class="table-responsive" style="overflow-x: visible">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th>Email and Attachments</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <th>\r\n                                                        <div class="form-group">\r\n                                                            \x3c!-- PBI1143 : FCO - Email Service Report to the customer for their signature --\x3e\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11" ng-if="vm.RequestServiceReportSignature">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Request Signature From:</label>\r\n\r\n                                                                <div class="col-sm-10 col-md-10 col-lg-10" style="padding: 0;">\r\n                                                                    <input id="" type="text" ng-model="vm.model.ContactEmail" class="form-control ng-valid ng-valid-required">\r\n                                                                </div>\r\n                                                                <div class="col-sm-1 col-md-1 col-lg-1">\r\n                                                                    <button class="btn btn-default" ng-click="vm.requestSignature()">Send Request</button>\r\n                                                                </div>\r\n                                                            </div>\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11" ng-if="vm.RequestServiceReportSignature">\r\n                                                                <hr />\r\n                                                            </div>\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Send To:</label>\r\n                                                                <div class="col-sm-12 col-md-12 col-lg-12">\r\n                                                                    <input id="" type="text" required ng-model="vm.model.DefaultCompanyEmail" class="form-control ng-valid ng-valid-required">\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Customer Email:</label>\r\n\r\n                                                                <div class="col-sm-11 col-md-11 col-lg-11" style="padding: 0;">\r\n                                                                    <input id="" type="text" ng-model="vm.model.SiteContactEmail" class="form-control ng-valid ng-valid-required">\r\n                                                                </div>\r\n                                                                <div class="col-sm-1 col-md-1 col-lg-1">\r\n                                                                    <input id="" type="checkbox" ng-model="vm.model.Include">\r\n                                                                    <label class="control-label">Include</label>\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Message:</label>\r\n                                                                <div class="col-sm-12 col-md-12 col-lg-12">\r\n                                                                    <textarea id="" required ng-model="vm.model.EmailMessage" class="form-control ng-valid ng-valid-required"></textarea>\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n\r\n                                                            <div class="col-sm-5 col-md-5 col-lg-5">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Select attachments to include:</label>\r\n                                                                <div class="col-sm-12 col-md-12 col-lg-12">\r\n                                                                    <select ng-model="vm.model.SelectedAttachments" class=\'form-control\' ng-options="attachments.Id as attachments.AttachmentName for attachments in vm.model.ServiceReportAttachments" multiple></select>\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n\r\n                                                            <div class="col-sm-5 col-md-5 col-lg-5">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Select forms to include:</label>\r\n                                                                <div class="col-sm-12 col-md-12 col-lg-12">\r\n                                                                    <select ng-model="vm.model.SelectedForms" class=\'form-control\' ng-options="forms.Id as forms.DPSDocumentName for forms in vm.model.ServiceReportForms" multiple></select>\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                        </div> \x3c!-- form group --\x3e\r\n                                                    </th>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                                    <div class="row">\r\n                                        <div class="col-md-12" ng-bind-html="vm.previewHTML">\r\n                                        </div>\r\n                                    </div>\r\n\r\n                                    <div ng-if="vm.model.CompanyName.toLowerCase().includes(\'albireo\')" class="row">\r\n                                        <div class="col-md-12">\r\n                                            <p>All services and materials subject to contract minimums.</p>\r\n                                        </div>\r\n                                    </div>\r\n\r\n                                    \x3c!-- PBI555 : FCO - Carry over customer signature on revised service report - GroundBreakers --\x3e\r\n                                    <div class="table-responsive" style="overflow-x: visible">\r\n                                        <table class="table hover reportTableTitle reportTableTitleRed" ng-if="vm.showWarning">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th colspan="2">Acknowledgement</th>\r\n                                                </tr>\r\n                                            </thead>\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <td style="width: 10%;">\r\n                                                        <div>\r\n                                                            <input id="" ng-model="vm.model.gbSignatureCheck" type="checkbox" required class="form-control ng-valid ng-valid-required">\r\n                                                        </div>\r\n                                                    </td>\r\n                                                    <td style="width: 90%;">\r\n                                                        <div class="col-md-12">\r\n                                                            This certifies the work performed by GroundBreakers.\r\n                                                            I acknowledge that the values presented, on this report, are estimates, and the final report and invoice will reflect the actual time and material charges.\r\n                                                            My signature will be included on the final report that accompanies the invoice.\r\n                                                        </div>\x3c!-- input box --\x3e\r\n                                                    </td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n\r\n                                        \x3c!-- PBI555 : FCO - Carry over customer signature on revised service report - GroundBreakers --\x3e\r\n                                        \x3c!-- <table class="table hover reportTableTitle"> --\x3e\r\n                                        <table class="table hover reportTableTitle" ng-if="!vm.customServiceReport">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th>Signed by</th>\r\n                                                    <th>Signature</th>\r\n                                                    <th>Date</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <th>\r\n                                                        <div class="form-group">\r\n                                                            <div class="col-sm-10 col-md-9 col-lg-7">\r\n                                                                <input id="" type="text" required ng-model="vm.model.SignedBy" class="form-control ng-valid ng-valid-required">\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                        </div> \x3c!-- form group --\x3e\r\n                                                    </th>\r\n                                                    <th>\r\n                                                        <div class="form-group">\r\n                                                            <div class="col-sm-10 col-md-9 col-lg-7 ">\r\n                                                                <canvas id="signatureCanvas" required="" fc-signature width="400" height="150" style="border: 1px  solid #000000"></canvas>\r\n                                                            </div>\x3c!-- input box --\x3e\r\n                                                        </div>\x3c!-- form group --\x3e\r\n                                                    </th>\r\n                                                    <th>\r\n                                                        <div class="form-group">\r\n                                                            <div class="col-sm-10 col-md-9 col-lg-7">\r\n                                                                <input type="text" readonly="readonly" ng-model="vm.model.DateString" class="form-control">\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                        </div> \x3c!-- form group --\x3e\r\n                                                    </th>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                        \x3c!-- PBI555 : FCO - Carry over customer signature on revised service report - GroundBreakers --\x3e\r\n                                        \x3c!-- <button class="btn btn-default floatRight" ng-click="vm.ok()"><i class="fa  fa-check"></i> Accept Signature</button> --\x3e\r\n                                        \x3c!-- <button class="btn btn-default floatRight" ng-click="vm.clear()"><i class="fa  fa-times-circle"></i> Clear Signature</button> --\x3e\r\n                                        <button class="btn btn-default floatRight" ng-click="vm.save()" ng-if="vm.customServiceReport"><i class="fa  fa-check"></i> Save Report</button>\r\n                                        <button class="btn btn-default floatRight" ng-click="vm.ok()" ng-if="!vm.customServiceReport"><i class="fa  fa-check"></i> Accept Signature</button>\r\n                                        <button class="btn btn-default floatRight" ng-click="vm.clear()" ng-if="!vm.customServiceReport"><i class="fa  fa-times-circle"></i> Clear Signature</button>\r\n                                    </div>\r\n                                </div> \x3c!-- columns --\x3e\r\n                            </div> \x3c!-- row --\x3e\r\n                        </div>\x3c!-- content --\x3e\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/partModal.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n    \x3c!-- BUG642 : DSL - Scroll parts screen --\x3e\r\n    \x3c!-- <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px;"> --\x3e\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n        \x3c!-- BUG642 : DSL - Scroll parts screen --\x3e\r\n        \x3c!-- <div class="modal-content"> --\x3e\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 80%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="partEdit.close()">&times;</button>\r\n                <h4 class="modal-title">Part</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                \x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n                \x3c!-- <div class="row" ng-hide="partEdit.id!=null && partEdit.id>0"> --\x3e\r\n                <div class="row" ng-hide="partEdit.hideSearch">\r\n                    <div class="col-sm-6">\r\n                        \x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n                        \x3c!-- <div id="datatable-icons_filter" class="dataTables_filter" style="text-align:left"> --\x3e\r\n                        <div id="searchbox_filter" class="dataTables_filter searchbox_filter" style="text-align:left">\r\n                            <label>\r\n                                Search:<i id="search-info" class="fa fa-info-circle" style="display: inline-block" title="Search by Item Name."></i>\r\n                                <input id="seacrhInputPart" type="search" class="form-control input-sm" ng-model="partEdit.searchText" fc-enter="partEdit.search()">\r\n                                <button class="btn btn-primary add-new-btn" ng-click="partEdit.search()">Search</button>\r\n                            </label>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                \x3c!-- PBI543 : DSL - Add additional fields to the Work Order and Assignment screens --\x3e\r\n                \x3c!-- <fc-table-edit api-method="parts" --\x3e\r\n                <fc-table-edit api-method="{{partEdit.apiMethod}}"\r\n                               id="{{partEdit.id}}"\r\n                               model="partEdit.model"\r\n                               view-name="{{partEdit.viewName}}"\r\n                               module-name="{{partEdit.moduleName}}"\r\n                               attributes="partEdit.attributes"\r\n                               on-back="partEdit.close(insertData)">\r\n                </fc-table-edit>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class="modal-backdrop in fade"></div>\r\n</div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/quoteConversionLineItemsModal.html",'\r\n<div id="myModal" class="fade" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n        <div class="table-edit-overlay" ng-show="vm.loadingData">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        \x3c!-- Modal content--\x3e\r\n        <div class="modal-content" style="overflow-y: auto; height: 90%">\r\n            <div class="modal-header">\r\n                <h4>Import Quote Items</h4>\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n            </div>\r\n            <div class="modal-body">\r\n                <div class="form-horizontal" novalidate>\r\n                    <div class="row">\r\n                        <div class="col-md-12">\r\n                            <div id="accordion" class="panel-group accordion">\r\n\r\n                                <div class="panel panel-default">\r\n                                    <div class="panel-heading cursor_pointer">\r\n                                        <strong class="panel-title">\r\n                                            <a id="collapseConversionOneToogle" data-toggle="collapse" data-parent="#accordion" data-target="#collapseConversionOne" class="collapsed" aria-expanded="false">\r\n                                                Notes &nbsp;&nbsp;\r\n                                                <span ng-if="vm.lineItems.noteLineItems.converted.length>0">{{vm.lineItems.noteLineItems.converted.length}} Converted</span>&nbsp;&nbsp;\r\n                                                \x3c!-- DE1556 : FCO - Web - Typo on quote conversion panels --\x3e\r\n                                                \x3c!-- <span ng-if="vm.lineItems.noteLineItems.avalaibleForConversion.length>0">{{vm.lineItems.noteLineItems.avalaibleForConversion.length}} Avalaible for conversion</span>&nbsp;&nbsp; --\x3e\r\n                                                <span ng-if="vm.lineItems.noteLineItems.avalaibleForConversion.length>0">{{vm.lineItems.noteLineItems.avalaibleForConversion.length}} Available for conversion</span>&nbsp;&nbsp;\r\n                                                \x3c!-- DE1556 : END --\x3e\r\n                                                <span ng-if="vm.lineItems.noteLineItems.onlyWo.length>0">{{vm.lineItems.noteLineItems.onlyWo.length}} WO only</span>\r\n                                                <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                            </a>\r\n                                        </strong>\r\n                                    </div>\x3c!-- panel heading --\x3e\r\n                                    <div id="collapseConversionOne" class="panel-collapse collapse" aria-expanded="false">\r\n                                        <div class="panel-body">\r\n                                            <div class="block-flat">\r\n                                                <div class="content">\r\n                                                    <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                                                        <thead>\r\n                                                            <tr>\r\n                                                                <td>State</td>\r\n                                                                <td>Created By</td>\r\n                                                                <td>Customer Viewable</td>\r\n                                                                <td>Note</td>\r\n                                                                <td>Convert</td>\r\n                                                            </tr>\r\n                                                        </thead>\r\n                                                        <tbody>\r\n                                                            <tr style="background-color:cornflowerblue">\r\n                                                                <td colspan="5">Converted</td>\r\n                                                            </tr>\r\n                                                            <tr ng-repeat="converted in vm.lineItems.noteLineItems.converted">\r\n                                                                <td>\r\n                                                                    <span>Quote</span>\r\n                                                                    <br />\r\n                                                                    <span>Wo</span>\r\n                                                                </td>\r\n                                                                <td>\r\n                                                                    <div ng-repeat="listItem in vm.stringToArray.splitString(converted.CreatedBy, \'<br>\') track by $index">\r\n                                                                        <span>{{listItem}}</span>\r\n                                                                        <br />\r\n                                                                    </div>\r\n                                                                </td>\r\n\r\n                                                                <td>\r\n                                                                    <div ng-repeat="listItem in vm.stringToArray.splitString(converted.Viewable, \'<br>\') track by $index">\r\n                                                                        <div aria-disabled="false" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': {{listItem}}}">\r\n                                                                            <input type="checkbox" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                        </div>\r\n                                                                        <br />\r\n                                                                    </div>\r\n                                                                </td>\r\n                                                                <td>\r\n                                                                    <div ng-repeat="listItem in vm.stringToArray.splitString(converted.Note, \'<br>\') track by $index">\r\n                                                                        <span>{{listItem}}</span>\r\n                                                                        <br />\r\n                                                                    </div>\r\n                                                                </td>\r\n                                                                <td></td>\r\n                                                            </tr>\r\n                                                            <tr style="background-color:cornflowerblue">\r\n                                                                \x3c!-- DE1556 : FCO - Web - Typo on quote conversion panels --\x3e\r\n                                                                \x3c!-- <td colspan="5">Avalaible for conversion</td> --\x3e\r\n                                                                <td colspan="5">Available for conversion</td>\r\n                                                                \x3c!-- DE1556 : END --\x3e\r\n                                                            </tr>\r\n                                                            <tr ng-repeat-start="avalaible in vm.lineItems.noteLineItems.avalaibleForConversion track by avalaible.Id">\r\n                                                                <td>\r\n                                                                    <img class="toggle-details" ng-if="vm.drilldownOpenNote[avalaible.Id] && avalaible.Convert" src="Content/img/drill-down-arrow-up.png" ng-click="vm.toggleDrilldown(avalaible.Id, \'Note\')" />\r\n                                                                    <img class="toggle-details" ng-if="!vm.drilldownOpenNote[avalaible.Id] && avalaible.Convert" src="Content/img/drill-down-arrow-b.png" ng-click="vm.toggleDrilldown(avalaible.Id, \'Note\')" />\r\n                                                                </td>\r\n                                                                <td><span>{{avalaible.CreatedBy}}</span></td>\r\n                                                                <td>\r\n                                                                    <div aria-disabled="false" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': {{avalaible.Viewable.toLowerCase()}}}">\r\n                                                                        <input type="checkbox" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                    </div>\r\n                                                                </td>\r\n                                                                <td><span>{{avalaible.Note}}</span></td>\r\n                                                                <td>\r\n                                                                    <div class="form-group checkbox">\r\n                                                                        <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                                                            <div aria-disabled="false" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': avalaible.Convert}" fc-focusout="vm.customFocus(attribute)">\r\n                                                                                <input type="checkbox" ng-click="vm.prepareWoNote(avalaible)" ng-model="avalaible.Convert" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                            </div>\r\n                                                                        </label>\r\n                                                                    </div>\r\n                                                                </td>\r\n                                                            </tr>\r\n                                                            <tr ng-repeat-end ng-if="avalaible.Convert" ng-show="vm.drilldownOpenNote[avalaible.Id]">\r\n                                                                <td colspan="5">\r\n                                                                    <form class="form-horizontal">\r\n                                                                        <div class="row">\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getNoteFormsValidation(avalaible.Id).Note}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">*Note</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <textarea type="text" ng-model="vm.getNoteLineItemModel(avalaible.Id).Note" tabindex="1" fc-autofocus="false" required class="form-control" style="display:inline; width:100%" />\r\n                                                                                        <span ng-show="vm.getNoteFormsValidation(avalaible.Id).Note" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getNoteFormsValidation(avalaible.Id).Viewable}">\r\n                                                                                <div class="form-group checkbox">\r\n                                                                                    <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <div aria-disabled="false" tabindex="4" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': vm.getNoteLineItemModel(avalaible.Id).Viewable}">\r\n                                                                                            <input type="checkbox" ng-model="vm.getNoteLineItemModel(avalaible.Id).Viewable" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                                        </div>\r\n                                                                                        Viewable\r\n                                                                                    </label>\r\n                                                                                    <span ng-show="vm.getNoteFormsValidation(avalaible.Id).Viewable" class="validation">This field is required</span>\r\n                                                                                </div>\r\n                                                                            </div>\r\n\r\n                                                                        </div>\r\n                                                                    </form>\r\n                                                                </td>\r\n                                                            </tr>\r\n\r\n                                                            <tr>\r\n                                                                <td colspan="5" style="background-color:cornflowerblue">WO only</td>\r\n                                                            </tr>\r\n                                                            <tr ng-repeat="onlyWo in vm.lineItems.noteLineItems.onlyWo">\r\n                                                                <td></td>\r\n                                                                <td><span>{{onlyWo.CreatedBy}}</span></td>\r\n                                                                <td>\r\n                                                                    <div aria-disabled="false" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': {{onlyWo.Viewable.toLowerCase()}}}">\r\n                                                                        <input type="checkbox" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                    </div>\r\n                                                                </td>\r\n                                                                <td><span>{{onlyWo.Note}}</span></td>\r\n                                                                <td></td>\r\n                                                            </tr>\r\n                                                        </tbody>\r\n                                                    </table>\r\n                                                </div>\x3c!-- content --\x3e\r\n                                            </div>\x3c!-- block-flat --\x3e\r\n                                        </div>\x3c!-- panel body --\x3e\r\n                                    </div>\x3c!-- panel colapse --\x3e\r\n                                </div>\r\n\r\n                                <div class="panel panel-default">\r\n                                    <div class="panel-heading cursor_pointer">\r\n                                        <strong class="panel-title">\r\n                                            <a id="collapseConversionTwoToogle" data-toggle="collapse" data-parent="#accordion" data-target="#collapseConversionTwo" class="collapsed" aria-expanded="false">\r\n                                                Labor &nbsp;&nbsp;\r\n                                                <span ng-if="vm.lineItems.laborLineItems.converted.length>0">{{vm.lineItems.laborLineItems.converted.length}} Converted</span>&nbsp;&nbsp;\r\n                                                \x3c!-- DE1556 : FCO - Web - Typo on quote conversion panels --\x3e\r\n                                                \x3c!-- <span ng-if="vm.lineItems.laborLineItems.avalaibleForConversion.length>0">{{vm.lineItems.laborLineItems.avalaibleForConversion.length}} Avalaible for conversion</span>&nbsp;&nbsp; --\x3e\r\n                                                <span ng-if="vm.lineItems.laborLineItems.avalaibleForConversion.length>0">{{vm.lineItems.laborLineItems.avalaibleForConversion.length}} Available for conversion</span>&nbsp;&nbsp;\r\n                                                \x3c!-- DE1556 : END --\x3e\r\n                                                <span ng-if="vm.lineItems.laborLineItems.onlyWo.length>0">{{vm.lineItems.laborLineItems.onlyWo.length}} WO only</span>\r\n                                                <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                            </a>\r\n                                        </strong>\r\n                                    </div>\x3c!-- panel heading --\x3e\r\n                                    <div id="collapseConversionTwo" class="panel-collapse collapse" aria-expanded="false">\r\n                                        <div class="panel-body">\r\n                                            <div class="block-flat">\r\n                                                <div class="content">\r\n\r\n                                                    <table id="datatable-icons" class="table table-bordered" role="grid" aria-describedby="datatable-icons_info">\r\n                                                        <thead>\r\n                                                            <tr>\r\n                                                                <td>State</td>\r\n                                                                <td>Labor Code</td>\r\n                                                                <td>Unit Price</td>\r\n                                                                <td>Hours</td>\r\n                                                                <td>Extended Price</td>\r\n                                                                <td>Convert</td>\r\n                                                            </tr>\r\n                                                        </thead>\r\n                                                        <tbody>\r\n                                                            <tr style="background-color:cornflowerblue">\r\n                                                                <td colspan="6">Converted</td>\r\n                                                            </tr>\r\n                                                            <tr ng-repeat="converted in vm.lineItems.laborLineItems.converted">\r\n                                                                <td>\r\n                                                                    <span>Quote</span>\r\n                                                                    <br />\r\n                                                                    <span>Wo</span>\r\n                                                                </td>\r\n                                                                <td>\r\n                                                                    <div ng-repeat="listItem in vm.stringToArray.splitString(converted.LaborCodeName, \'<br>\') track by $index">\r\n                                                                        <span>{{listItem}}</span>\r\n                                                                        <br />\r\n                                                                    </div>\r\n                                                                </td>\r\n\r\n                                                                <td>\r\n                                                                    <div ng-repeat="listItem in vm.stringToArray.splitString(converted.Rate, \'<br>\') track by $index">\r\n                                                                        <span>{{listItem}}</span>\r\n                                                                        <br />\r\n                                                                    </div>\r\n                                                                </td>\r\n                                                                <td>\r\n                                                                    <div ng-repeat="listItem in vm.stringToArray.splitString(converted.BillHours, \'<br>\') track by $index">\r\n                                                                        <span>{{listItem}}</span>\r\n                                                                        <br />\r\n                                                                    </div>\r\n                                                                </td>\r\n\r\n                                                                <td>\r\n                                                                    <div ng-repeat="listItem in vm.stringToArray.splitString(converted.ExtendedPrice, \'<br>\') track by $index">\r\n                                                                        <span>{{listItem}}</span>\r\n                                                                        <br />\r\n                                                                    </div>\r\n                                                                </td>\r\n                                                                <td></td>\r\n                                                            </tr>\r\n                                                            <tr style="background-color:cornflowerblue">\r\n                                                                \x3c!-- DE1556 : FCO - Web - Typo on quote conversion panels --\x3e\r\n                                                                \x3c!-- <td colspan="6">Avalaible for conversion</td> --\x3e\r\n                                                                <td colspan="6">Available for conversion</td>\r\n                                                                \x3c!-- DE1556 : END --\x3e\r\n                                                            </tr>\r\n                                                            <tr ng-repeat-start="avalaible in vm.lineItems.laborLineItems.avalaibleForConversion track by avalaible.Id">\r\n                                                                <td>\r\n                                                                    <img class="toggle-details" ng-if="vm.drilldownOpenLabor[avalaible.Id] && avalaible.Convert" src="Content/img/drill-down-arrow-up.png" ng-click="vm.toggleDrilldown(avalaible.Id, \'Labor\')" />\r\n                                                                    <img class="toggle-details" ng-if="!vm.drilldownOpenLabor[avalaible.Id] && avalaible.Convert" src="Content/img/drill-down-arrow-b.png" ng-click="vm.toggleDrilldown(avalaible.Id, \'Labor\')" />\r\n                                                                </td>\r\n                                                                <td><span>{{avalaible.LaborCode}}</span></td>\r\n                                                                <td><span>{{avalaible.Rate}}</span></td>\r\n                                                                <td><span>{{avalaible.BillHours}}</span></td>\r\n                                                                <td><span>{{avalaible.ExtendedPrice}}</span></td>\r\n                                                                <td>\r\n                                                                    <div class="form-group checkbox">\r\n                                                                        <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                                                            <div aria-disabled="false" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': avalaible.Convert}">\r\n                                                                                <input type="checkbox" ng-click="vm.prepareWoLabor(avalaible)" ng-model="avalaible.Convert" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                            </div>\r\n                                                                        </label>\r\n                                                                    </div>\r\n                                                                </td>\r\n                                                            </tr>\r\n                                                            <tr ng-repeat-end ng-if="avalaible.Convert" ng-show="vm.drilldownOpenLabor[avalaible.Id]">\r\n                                                                <td colspan="8">\r\n                                                                    <form class="form-horizontal">\r\n                                                                        <div class="row">\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getLaborFormsValidation(avalaible.Id).LaborCodeName}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">*Labor Code</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <input type="text" ng-model="vm.getLaborLineItemModel(avalaible.Id).LaborCodeName" readonly class="form-control" style="display:inline; width:100%" />\r\n                                                                                        <span ng-show="vm.getLaborFormsValidation(avalaible.Id).LaborCodeName" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getLaborFormsValidation(avalaible.Id).ListEmployeeIds}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">*Tech</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <fc-multiselect fc-tabindex="2" ng-if="vm.getLaborLineItemModel(avalaible.Id)" api-method="employees/getTechForLabor" value="vm.getLaborLineItemModel(avalaible.Id).ListEmployeeIds" value-prop="Id" text-prop="FullName"></fc-multiselect>\r\n                                                                                        <span ng-show="vm.getLaborFormsValidation(avalaible.Id).ListEmployeeIds" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getLaborFormsValidation(avalaible.Id).WorkHours}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">*Work Hours</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <input type="text" decimal decimals="2" ng-blur="vm.workHoursChanged(vm.getLaborLineItemModel(avalaible.Id))" ng-model="vm.getLaborLineItemModel(avalaible.Id).WorkHours" tabindex="3" required class="form-control" style="display:inline; width:100%" />\r\n                                                                                        <span ng-show="vm.getLaborFormsValidation(avalaible.Id).WorkHours" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div ng-show="vm.isBackOffice" class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getLaborFormsValidation(avalaible.Id).Hours}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">*Bill Hours</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <input type="text" decimal decimals="2" ng-model="vm.getLaborLineItemModel(avalaible.Id).Hours" tabindex="4" required class="form-control" style="display:inline; width:100%" />\r\n                                                                                        <span ng-show="vm.getLaborFormsValidation(avalaible.Id).Hours" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-lg-6" ng-class="{\'has-error\': vm.getLaborFormsValidation(avalaible.Id).Date}">\r\n\r\n                                                                                <div class="form-group calll">\r\n                                                                                    <label class="control-label  col-sm-3 col-md-4 col-lg-3">*Date:</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <div data-min-view="2" date-time-append class="input-group date datetime col-sm-12 col-md-12 col-lg-12">\r\n                                                                                            <input tabindex="5" name="Date" type="datetime" date-time ng-model="vm.getLaborLineItemModel(avalaible.Id).Date" fc-autofocus="false" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control">\r\n                                                                                            <span class="input-group-addon btn btn-white">\r\n                                                                                                <span class="glyphicon glyphicon-calendar"></span>\r\n                                                                                            </span>\r\n                                                                                        </div>\r\n                                                                                        <span ng-show="vm.getLaborFormsValidation(avalaible.Id).Date" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getLaborFormsValidation(avalaible.Id).PayRateId}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">*Pay Rate</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <fc-dropdown ng-model="vm.getLaborLineItemModel(avalaible.Id).PayRateId" on-change="vm.payRateChanged(selectetObj,vm.getLaborLineItemModel(avalaible.Id))" fc-tabindex="6" ng-if="vm.getLaborLineItemModel(avalaible.Id)" api-method="payRates" value="vm.getLaborLineItemModel(avalaible.Id).PayRateId" value-prop="Id" text-prop="PayRateName" convert-to-int="true" label="Pay Rate"></fc-dropdown>\r\n                                                                                        <span ng-show="vm.getLaborFormsValidation(avalaible.Id).PayRateId" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getLaborFormsValidation(avalaible.Id).Rate}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">*Rate Hour</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <input type="text" decimal decimals="2" ng-model="vm.getLaborLineItemModel(avalaible.Id).Rate" tabindex="7" required class="form-control" style="display:inline; width:100%" />\r\n                                                                                        <span ng-show="vm.getLaborFormsValidation(avalaible.Id).Rate" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getLaborFormsValidation(avalaible.Id).Taxable}">\r\n                                                                                <div class="form-group checkbox">\r\n                                                                                    <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <div aria-disabled="false" tabindex="4" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': vm.getLaborLineItemModel(avalaible.Id).Taxable}">\r\n                                                                                            <input type="checkbox" ng-click="vm.taxRateLaborClick(vm.getMiscLineItemModel(avalaible.Id))" ng-model="vm.getLaborLineItemModel(avalaible.Id).Taxable" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                                        </div>\r\n                                                                                        Taxable\r\n                                                                                    </label>\r\n                                                                                    <span ng-show="vm.getLaborFormsValidation(avalaible.Id).Taxable" class="validation">This field is required</span>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6">\r\n                                                                                &nbsp;\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getLaborFormsValidation(avalaible.Id).Billable}">\r\n                                                                                <div class="form-group checkbox">\r\n                                                                                    <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <div aria-disabled="false" tabindex="5" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': vm.getLaborLineItemModel(avalaible.Id).Billable}">\r\n                                                                                            <input type="checkbox" ng-model="vm.getLaborLineItemModel(avalaible.Id).Billable" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                                        </div>\r\n                                                                                        Billable\r\n                                                                                    </label>\r\n                                                                                    <span ng-show="vm.getLaborFormsValidation(avalaible.Id).Billable" class="validation">This field is required</span>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                        </div>\r\n                                                                    </form>\r\n                                                                </td>\r\n                                                            </tr>\r\n                                                            <tr>\r\n                                                                <td colspan="6" style="background-color:cornflowerblue">WO only</td>\r\n                                                            </tr>\r\n                                                            <tr ng-repeat="onlyWo in vm.lineItems.laborLineItems.onlyWo">\r\n                                                                <td></td>\r\n                                                                <td><span>{{onlyWo.LaborCode}}</span></td>\r\n                                                                <td><span>{{onlyWo.Rate}}</span></td>\r\n                                                                <td><span>{{onlyWo.BillHours}}</span></td>\r\n                                                                <td><span>{{onlyWo.Rate * onlyWo.BillHours}}</span></td>\r\n                                                                <td></td>\r\n                                                            </tr>\r\n                                                        </tbody>\r\n                                                    </table>\r\n                                                </div>\x3c!-- content --\x3e\r\n                                            </div>\x3c!-- block-flat --\x3e\r\n                                        </div>\x3c!-- panel body --\x3e\r\n                                    </div>\x3c!-- panel colapse --\x3e\r\n                                </div>\r\n\r\n                                <div class="panel panel-default">\r\n                                    <div class="panel-heading cursor_pointer">\r\n                                        <strong class="panel-title">\r\n                                            <a id="collapseConversionTreeToogle" data-toggle="collapse" data-parent="#accordion" data-target="#collapseConversionTree" class="collapsed" aria-expanded="false">\r\n                                                Parts &nbsp;&nbsp;\r\n                                                <span ng-if="vm.lineItems.partLineItems.converted.length>0">{{vm.lineItems.partLineItems.converted.length}} Converted</span>&nbsp;&nbsp;\r\n                                                \x3c!-- DE1556 : FCO - Web - Typo on quote conversion panels --\x3e\r\n                                                \x3c!-- <span ng-if="vm.lineItems.partLineItems.avalaibleForConversion.length>0">{{vm.lineItems.partLineItems.avalaibleForConversion.length}} Avalaible for conversion</span>&nbsp;&nbsp; --\x3e\r\n                                                <span ng-if="vm.lineItems.partLineItems.avalaibleForConversion.length>0">{{vm.lineItems.partLineItems.avalaibleForConversion.length}} Available for conversion</span>&nbsp;&nbsp;\r\n                                                \x3c!-- DE1556 : END --\x3e\r\n                                                <span ng-if="vm.lineItems.partLineItems.onlyWo.length>0">{{vm.lineItems.partLineItems.onlyWo.length}} WO only</span>\r\n                                                <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                            </a>\r\n                                        </strong>\r\n                                    </div>\x3c!-- panel heading --\x3e\r\n                                    <div id="collapseConversionTree" class="panel-collapse collapse" aria-expanded="false">\r\n                                        <div class="panel-body">\r\n                                            <div class="block-flat">\r\n                                                <div class="content">\r\n                                                    <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                                                        <thead>\r\n                                                            <tr>\r\n                                                                <td>State</td>\r\n                                                                <td>Item Name</td>\r\n                                                                <td>Price</td>\r\n                                                                <td>Quantity</td>\r\n                                                                <td>Extended Price</td>\r\n                                                                <td>Convert</td>\r\n                                                            </tr>\r\n                                                        </thead>\r\n                                                        <tbody>\r\n                                                            <tr style="background-color:cornflowerblue">\r\n                                                                <td colspan="6">Converted</td>\r\n                                                            </tr>\r\n                                                            <tr ng-repeat="converted in vm.lineItems.partLineItems.converted">\r\n                                                                <td>\r\n                                                                    <span>Quote</span>\r\n                                                                    <br />\r\n                                                                    <span>Wo</span>\r\n                                                                </td>\r\n                                                                <td>\r\n                                                                    <div ng-repeat="listItem in vm.stringToArray.splitString(converted.ItemName, \'<br>\') track by $index">\r\n                                                                        <span>{{listItem}}</span>\r\n                                                                        <br />\r\n                                                                    </div>\r\n                                                                </td>\r\n\r\n                                                                <td>\r\n                                                                    <div ng-repeat="listItem in vm.stringToArray.splitString(converted.Price, \'<br>\') track by $index">\r\n                                                                        <span>{{listItem}}</span>\r\n                                                                        <br />\r\n                                                                    </div>\r\n                                                                </td>\r\n                                                                <td>\r\n                                                                    <div ng-repeat="listItem in vm.stringToArray.splitString(converted.Quantity, \'<br>\') track by $index">\r\n                                                                        <span>{{listItem}}</span>\r\n                                                                        <br />\r\n                                                                    </div>\r\n                                                                </td>\r\n\r\n                                                                <td>\r\n                                                                    <div ng-repeat="listItem in vm.stringToArray.splitString(converted.ExtendedPrice, \'<br>\') track by $index">\r\n                                                                        <span>{{listItem}}</span>\r\n                                                                        <br />\r\n                                                                    </div>\r\n                                                                </td>\r\n                                                                <td></td>\r\n                                                            </tr>\r\n                                                            <tr style="background-color:cornflowerblue">\r\n                                                                \x3c!-- DE1556 : FCO - Web - Typo on quote conversion panels --\x3e\r\n                                                                \x3c!-- <td colspan="6">Avalaible for conversion</td> --\x3e\r\n                                                                <td colspan="6">Available for conversion</td>\r\n                                                                \x3c!-- DE1556 : END --\x3e\r\n                                                            </tr>\r\n                                                            <tr ng-repeat-start="avalaible in vm.lineItems.partLineItems.avalaibleForConversion track by avalaible.Id">\r\n                                                                <td>\r\n                                                                    <img class="toggle-details" ng-if="vm.drilldownOpenPart[avalaible.Id] && avalaible.Convert" src="Content/img/drill-down-arrow-up.png" ng-click="vm.toggleDrilldown(avalaible.Id, \'Parts\')" />\r\n                                                                    <img class="toggle-details" ng-if="!vm.drilldownOpenPart[avalaible.Id] && avalaible.Convert" src="Content/img/drill-down-arrow-b.png" ng-click="vm.toggleDrilldown(avalaible.Id, \'Parts\')" />\r\n                                                                </td>\r\n                                                                <td><span>{{avalaible.ItemName}}</span></td>\r\n                                                                <td><span>{{avalaible.Price}}</span></td>\r\n                                                                <td><span>{{avalaible.Quantity}}</span></td>\r\n                                                                <td><span>{{avalaible.ExtendedPrice}}</span></td>\r\n                                                                <td>\r\n                                                                    <div class="form-group checkbox">\r\n                                                                        <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                                                            <div aria-disabled="false" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': avalaible.Convert}" fc-focusout="vm.customFocus(attribute)">\r\n                                                                                <input type="checkbox" ng-click="vm.prepareWoPart(avalaible)" ng-model="avalaible.Convert" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                            </div>\r\n                                                                        </label>\r\n                                                                    </div>\r\n                                                                </td>\r\n                                                            </tr>\r\n                                                            <tr ng-repeat-end ng-if="avalaible.Convert" ng-show="vm.drilldownOpenPart[avalaible.Id]">\r\n                                                                <td colspan="8">\r\n                                                                    <form class="form-horizontal">\r\n                                                                        <div class="row">\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.formValidation[vm.getPartLineItemModel(avalaible.Id).ItemName].Error}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">*Item Name</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <input type="text" ng-model="vm.getPartLineItemModel(avalaible.Id).ItemName" tabindex="1" fc-autofocus="false" readonly class="form-control" style="display:inline; width:100%" />\r\n                                                                                        <span ng-show="vm.formValidation[vm.getPartLineItemModel(avalaible.Id).ItemName].ItemName" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getPartFormsValidation(avalaible.Id).Quantity}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">*Quantity</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <input type="text" decimal decimals="0" ng-model="vm.getPartLineItemModel(avalaible.Id).Quantity" tabindex="2" fc-autofocus="true" required class="form-control" style="display:inline; width:100%" />\r\n                                                                                        <span ng-show="vm.getPartFormsValidation(avalaible.Id).Quantity" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getPartFormsValidation(avalaible.Id).Price}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">*Unit Price</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <input type="text" decimal decimals="2" ng-model="vm.getPartLineItemModel(avalaible.Id).Price" tabindex="3" required class="form-control" style="display:inline; width:100%" />\r\n                                                                                        <span ng-show="vm.getPartFormsValidation(avalaible.Id).Price" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getPartFormsValidation(avalaible.Id).LocationId}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">Location</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        \x3c!-- PBI639 : FCO - Quotes - Parts and Miscellaneous --\x3e\r\n                                                                                        \x3c!-- <fc-dropdown fc-tabindex="4" ng-if="vm.getPartLineItemModel(avalaible.Id)" api-method="locations" value="vm.getPartLineItemModel(avalaible.Id).LocationId" value-prop="Id" text-prop="LocationName" convert-to-int="true" label="Location"></fc-dropdown> --\x3e\r\n                                                                                        <input type="text" ng-model="vm.getPartLineItemModel(avalaible.Id).LocationName" tabindex="1" fc-autofocus="false" readonly class="form-control" style="display:inline; width:100%" />\r\n                                                                                        <span ng-show="vm.getPartFormsValidation(avalaible.Id).LocationId" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getPartFormsValidation(avalaible.Id).Taxable}">\r\n                                                                                <div class="form-group checkbox">\r\n                                                                                    <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <div aria-disabled="false" tabindex="5" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': vm.getPartLineItemModel(avalaible.Id).Taxable}">\r\n                                                                                            <input type="checkbox" ng-click="vm.taxRatePartClick(vm.getPartLineItemModel(avalaible.Id))" ng-model="vm.getPartLineItemModel(avalaible.Id).Taxable" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                                        </div>\r\n                                                                                        Taxable\r\n                                                                                    </label>\r\n                                                                                    <span ng-show="vm.getPartFormsValidation(avalaible.Id).Taxable" class="validation">This field is required</span>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            \x3c!-- PBI639 : FCO - Quotes - Parts and Miscellaneous --\x3e\r\n                                                                            \x3c!--\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6">\r\n                                                                                &nbsp;\r\n                                                                            </div>\r\n                                                                            --\x3e\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getPartFormsValidation(avalaible.Id).Billable}">\r\n                                                                                <div class="form-group checkbox">\r\n                                                                                    <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <div aria-disabled="false" tabindex="6" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': vm.getPartLineItemModel(avalaible.Id).Billable}">\r\n                                                                                            <input type="checkbox" ng-model="vm.getPartLineItemModel(avalaible.Id).Billable" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                                        </div>\r\n                                                                                        Billable\r\n                                                                                    </label>\r\n                                                                                    <span ng-show="vm.getPartFormsValidation(avalaible.Id).Billable" class="validation">This field is required</span>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-if="vm.getPartLineItemModel(avalaible.Id).Serialized" ng-class="{\'has-error\': vm.getPartFormsValidation(avalaible.Id).SerialNum}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">*Serial Number</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <input type="text" ng-model="vm.getPartLineItemModel(avalaible.Id).SerialNum" tabindex="7" required class="form-control" style="display:inline; width:100%" />\r\n                                                                                        <span ng-show="vm.getPartFormsValidation(avalaible.Id).SerialNum" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                        </div>\r\n                                                                    </form>\r\n                                                                </td>\r\n                                                            </tr>\r\n\r\n                                                            <tr>\r\n                                                                <td colspan="6" style="background-color:cornflowerblue">WO only</td>\r\n                                                            </tr>\r\n                                                            <tr ng-repeat="onlyWo in vm.lineItems.partLineItems.onlyWo">\r\n                                                                <td></td>\r\n                                                                <td><span>{{onlyWo.ItemName}}</span></td>\r\n                                                                <td><span>{{onlyWo.Price}}</span></td>\r\n                                                                <td><span>{{onlyWo.Quantity}}</span></td>\r\n                                                                <td><span>{{onlyWo.ExtendedPrice}}</span></td>\r\n                                                                <td></td>\r\n                                                            </tr>\r\n                                                        </tbody>\r\n                                                    </table>\r\n                                                </div>\x3c!-- content --\x3e\r\n                                            </div>\x3c!-- block-flat --\x3e\r\n                                        </div>\x3c!-- panel body --\x3e\r\n                                    </div>\x3c!-- panel colapse --\x3e\r\n                                </div>\r\n\r\n                                <div class="panel panel-default">\r\n                                    <div class="panel-heading cursor_pointer">\r\n                                        <strong class="panel-title">\r\n                                            <a id="collapseConversionTFourToogle" data-toggle="collapse" data-parent="#accordion" data-target="#collapseConversionFour" class="collapsed" aria-expanded="false">\r\n                                                Misc &nbsp;&nbsp;\r\n                                                <span ng-if="vm.lineItems.miscLineItems.converted.length>0">{{vm.lineItems.miscLineItems.converted.length}} Converted</span>&nbsp;&nbsp;\r\n                                                \x3c!-- DE1556 : FCO - Web - Typo on quote conversion panels --\x3e\r\n                                                \x3c!-- <span ng-if="vm.lineItems.miscLineItems.avalaibleForConversion.length>0">{{vm.lineItems.miscLineItems.avalaibleForConversion.length}} Avalaible for conversion</span>&nbsp;&nbsp; --\x3e\r\n                                                <span ng-if="vm.lineItems.miscLineItems.avalaibleForConversion.length>0">{{vm.lineItems.miscLineItems.avalaibleForConversion.length}} Available for conversion</span>&nbsp;&nbsp;\r\n                                                \x3c!-- DE1556 : END --\x3e\r\n                                                <span ng-if="vm.lineItems.miscLineItems.onlyWo.length>0">{{vm.lineItems.miscLineItems.onlyWo.length}} WO only</span>\r\n                                                <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                            </a>\r\n                                        </strong>\r\n                                    </div>\x3c!-- panel heading --\x3e\r\n                                    <div id="collapseConversionFour" class="panel-collapse collapse" aria-expanded="false">\r\n                                        <div class="panel-body">\r\n                                            <div class="block-flat">\r\n                                                <div class="content">\r\n                                                    <table id="datatable-icons" class="table table-bordered table_edit dataTable no-footer" role="grid" aria-describedby="datatable-icons_info">\r\n                                                        <thead>\r\n                                                            <tr>\r\n                                                                <td>State</td>\r\n                                                                <td>Item Name</td>\r\n                                                                <td>Price</td>\r\n                                                                <td>Quantity</td>\r\n                                                                <td>Extended Price</td>\r\n                                                                <td>Convert</td>\r\n                                                            </tr>\r\n                                                        </thead>\r\n                                                        <tbody>\r\n                                                            <tr style="background-color:cornflowerblue">\r\n                                                                <td colspan="6">Converted</td>\r\n                                                            </tr>\r\n                                                            <tr ng-repeat="converted in vm.lineItems.miscLineItems.converted">\r\n                                                                <td>\r\n                                                                    <span>Quote</span>\r\n                                                                    <br />\r\n                                                                    <span>Wo</span>\r\n                                                                </td>\r\n                                                                <td>\r\n                                                                    <div ng-repeat="listItem in vm.stringToArray.splitString(converted.ItemName, \'<br>\') track by $index">\r\n                                                                        <span>{{listItem}}</span>\r\n                                                                        <br />\r\n                                                                    </div>\r\n                                                                </td>\r\n\r\n                                                                <td>\r\n                                                                    <div ng-repeat="listItem in vm.stringToArray.splitString(converted.Price, \'<br>\') track by $index">\r\n                                                                        <span>{{listItem}}</span>\r\n                                                                        <br />\r\n                                                                    </div>\r\n                                                                </td>\r\n                                                                <td>\r\n                                                                    <div ng-repeat="listItem in vm.stringToArray.splitString(converted.Quantity, \'<br>\') track by $index">\r\n                                                                        <span>{{listItem}}</span>\r\n                                                                        <br />\r\n                                                                    </div>\r\n                                                                </td>\r\n\r\n                                                                <td>\r\n                                                                    <div ng-repeat="listItem in vm.stringToArray.splitString(converted.ExtendedPrice, \'<br>\') track by $index">\r\n                                                                        <span>{{listItem}}</span>\r\n                                                                        <br />\r\n                                                                    </div>\r\n                                                                </td>\r\n                                                                <td></td>\r\n                                                            </tr>\r\n                                                            <tr style="background-color:cornflowerblue">\r\n                                                                \x3c!-- DE1556 : FCO - Web - Typo on quote conversion panels --\x3e\r\n                                                                \x3c!-- <td colspan="6">Avalaible for conversion</td> --\x3e\r\n                                                                <td colspan="6">Available for conversion</td>\r\n                                                                \x3c!-- DE1556 : END --\x3e\r\n                                                            </tr>\r\n                                                            <tr ng-repeat-start="avalaible in vm.lineItems.miscLineItems.avalaibleForConversion track by avalaible.Id">\r\n                                                                <td>\r\n                                                                    <img class="toggle-details" ng-if="vm.drilldownOpenMisc[avalaible.Id] && avalaible.Convert" src="Content/img/drill-down-arrow-up.png" ng-click="vm.toggleDrilldown(avalaible.Id, \'Misc\')" />\r\n                                                                    <img class="toggle-details" ng-if="!vm.drilldownOpenMisc[avalaible.Id] && avalaible.Convert" src="Content/img/drill-down-arrow-b.png" ng-click="vm.toggleDrilldown(avalaible.Id, \'Misc\')" />\r\n                                                                </td>\r\n                                                                <td><span>{{avalaible.ItemName}}</span></td>\r\n                                                                <td><span>{{avalaible.Price}}</span></td>\r\n                                                                <td><span>{{avalaible.Quantity}}</span></td>\r\n                                                                <td><span>{{avalaible.ExtendedPrice}}</span></td>\r\n                                                                <td>\r\n                                                                    <div class="form-group checkbox">\r\n                                                                        <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                                                            <div aria-disabled="false" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': avalaible.Convert}" fc-focusout="vm.customFocus(attribute)">\r\n                                                                                <input type="checkbox" ng-click="vm.prepareWoMisc(avalaible)" ng-model="avalaible.Convert" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                            </div>\r\n                                                                        </label>\r\n                                                                    </div>\r\n                                                                </td>\r\n                                                            </tr>\r\n                                                            <tr ng-repeat-end ng-if="avalaible.Convert" ng-show="vm.drilldownOpenMisc[avalaible.Id]">\r\n                                                                <td colspan="8">\r\n                                                                    <form class="form-horizontal">\r\n                                                                        <div class="row">\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.formValidation[vm.getMiscLineItemModel(avalaible.Id)].ItemName}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">*Item Name</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <input type="text" ng-model="vm.getMiscLineItemModel(avalaible.Id).ItemName" readonly class="form-control" style="display:inline; width:100%" />\r\n                                                                                        <span ng-show="vm.formValidation[vm.getMiscLineItemModel(avalaible.Id)].ItemName" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.formValidation[vm.getMiscLineItemModel(avalaible.Id)].WoItemName}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">*Name</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <input type="text" ng-model="vm.getMiscLineItemModel(avalaible.Id).WoItemName" tabindex="1" fc-autofocus="true" class="form-control" style="display:inline; width:100%" />\r\n                                                                                        <span ng-show="vm.formValidation[vm.getMiscLineItemModel(avalaible.Id)].WoItemName" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getMiscFormsValidation(avalaible.Id).Quantity}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">*Quantity</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <input type="text" decimal decimals="0" ng-model="vm.getMiscLineItemModel(avalaible.Id).Quantity" tabindex="2" fc-autofocus="false" required class="form-control" style="display:inline; width:100%" />\r\n                                                                                        <span ng-show="vm.getMiscFormsValidation(avalaible.Id).Quantity" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getMiscFormsValidation(avalaible.Id).Price}">\r\n                                                                                <div class="form-group">\r\n                                                                                    <label class="control-label col-sm-3 col-md-4 col-lg-3">*Unit Price</label>\r\n                                                                                    <div class="col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <input type="text" decimal decimals="2" ng-model="vm.getMiscLineItemModel(avalaible.Id).Price" tabindex="3" required class="form-control" style="display:inline; width:100%" />\r\n                                                                                        <span ng-show="vm.getMiscFormsValidation(avalaible.Id).Price" class="validation">This field is required</span>\r\n                                                                                    </div>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getMiscFormsValidation(avalaible.Id).Taxable}">\r\n                                                                                <div class="form-group checkbox">\r\n                                                                                    <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <div aria-disabled="false" tabindex="4" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': vm.getMiscLineItemModel(avalaible.Id).Taxable}">\r\n                                                                                            <input type="checkbox" ng-click="vm.taxRateMiscClick(vm.getMiscLineItemModel(avalaible.Id))" ng-model="vm.getMiscLineItemModel(avalaible.Id).Taxable" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                                        </div>\r\n                                                                                        Taxable\r\n                                                                                    </label>\r\n                                                                                    <span ng-show="vm.getMiscFormsValidation(avalaible.Id).Taxable" class="validation">This field is required</span>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6">\r\n                                                                                &nbsp;\r\n                                                                            </div>\r\n                                                                            <div class="col-sm-6 col-md-6 col-lg-6" ng-class="{\'has-error\': vm.getMiscFormsValidation(avalaible.Id).Billable}">\r\n                                                                                <div class="form-group checkbox">\r\n                                                                                    <label class="col-sm-offset-3 col-sm-9 col-md-8 col-lg-7">\r\n                                                                                        <div aria-disabled="false" tabindex="5" class="icheckbox_square-blue checkbox" ng-class="{\'checked\': vm.getMiscLineItemModel(avalaible.Id).Billable}">\r\n                                                                                            <input type="checkbox" ng-model="vm.getMiscLineItemModel(avalaible.Id).Billable" class="icheck" style="position: absolute; opacity: 0;" /><ins style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" class="iCheck-helper"></ins>\r\n                                                                                        </div>\r\n                                                                                        Billable\r\n                                                                                    </label>\r\n                                                                                    <span ng-show="vm.getMiscFormsValidation(avalaible.Id).Billable" class="validation">This field is required</span>\r\n                                                                                </div>\r\n                                                                            </div>\r\n                                                                        </div>\r\n                                                                    </form>\r\n                                                                </td>\r\n                                                            </tr>\r\n\r\n                                                            <tr>\r\n                                                                <td colspan="6" style="background-color:cornflowerblue">WO only</td>\r\n                                                            </tr>\r\n                                                            <tr ng-repeat="onlyWo in vm.lineItems.partLineItems.onlyWo">\r\n                                                                <td></td>\r\n                                                                <td><span>{{onlyWo.ItemName}}</span></td>\r\n                                                                <td><span>{{onlyWo.Price}}</span></td>\r\n                                                                <td><span>{{onlyWo.Quantity}}</span></td>\r\n                                                                <td><span>{{onlyWo.ExtendedPrice}}</span></td>\r\n                                                                <td></td>\r\n                                                            </tr>\r\n                                                        </tbody>\r\n                                                    </table>\r\n                                                </div>\x3c!-- content --\x3e\r\n                                            </div>\x3c!-- block-flat --\x3e\r\n                                        </div>\x3c!-- panel body --\x3e\r\n                                    </div>\x3c!-- panel colapse --\x3e\r\n                                </div>\r\n\r\n                            </div>\x3c!-- accordion --\x3e\r\n                        </div> \x3c!-- columns --\x3e\r\n                    </div>\x3c!-- row --\x3e\r\n                    <div class="row">\r\n                        <div class="col-sm-offset-6 col-sm-6 col-md-6">\r\n\r\n                            <div class="form-group">\r\n                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                    <button type="button" class="btn btn-default table-edit-cancel-btn" ng-click="vm.close()">{{cancelButtonText || "Cancel"}}</button>\r\n                                    <button type="button" class="btn btn-primary table-edit-submit-btn" ng-class="{\'disabled\': vm.submitBlock}" ng-disabled="vm.disableSubmit" ng-hide="vm.hideSubmit" ng-click="vm.onSubmit()" value="Submit">Convert</button>\r\n                                </div> \x3c!-- input box --\x3e\r\n                            </div> \x3c!-- form group --\x3e\r\n\r\n                        </div> \x3c!-- columns --\x3e\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop in fade"></div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/reportReadOnly.html",'<div id="myModal" class="fade signatureCan" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n        \x3c!-- Modal content--\x3e\r\n        <div class="modal-content" style="overflow-y: auto; height: 90%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h5 class="modal-title">Wo {{vm.model.AltId}}</h5>\r\n            </div>\r\n            <div class="modal-body">\r\n                <div id="cl-wrapper">\r\n                    <div id="pcont" class="container-fluid">\r\n                        <div class="cl-mcont">\r\n                            <div class="row  form-horizontal">\r\n                                <div class="col-md-12">\r\n                                    <div class="row">\r\n                                        <div class="col-md-6 col-sm-6 col-lg-6 col-sm-offset-6 col-md-offset-6 col-lg-offset-6">\r\n                                            <strong>{{vm.model.CompanyName}}</strong>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class="row no-margin-top">\r\n                                        <div class="col-md-6 col-sm-6 col-lg-6 col-sm-offset-6 col-md-offset-6 col-lg-offset-6">\r\n                                            {{vm.model.CompanyAddress}}\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class="row no-margin-top">\r\n                                        <div class="col-md-6 col-sm-6 col-lg-6 col-sm-offset-6 col-md-offset-6 col-lg-offset-6" style="padding-bottom:5px">\r\n                                            {{vm.model.CompanyCity}}\r\n                                        </div>\r\n                                    </div>\r\n\r\n                                    <table class="table hover reportTableAdress">\r\n                                        <thead>\r\n                                            <tr>\r\n                                                <th colspan="2" width="50%">Billing Address </th>\r\n                                                <th colspan="2" width="50%">Site Address</th>\r\n                                            </tr>\r\n                                        </thead>\r\n\r\n                                        <tbody>\r\n                                            <tr>\r\n                                                <td colspan="2">\r\n                                                    <ul class="AdressList clearfix">\r\n                                                        <li>Customer</li>\r\n                                                        <li>{{vm.model.CustomerName}}</li>\r\n\r\n                                                        <li>Address</li>\r\n                                                        <li>{{vm.model.BillingAddress}}</li>\r\n\r\n                                                        <li>Phone</li>\r\n                                                        <li>{{vm.model.BillingContactPhone}}</li>\r\n                                                    </ul>\r\n                                                </td>\r\n                                                <td colspan="2">\r\n                                                    <ul class="AdressList clearfix">\r\n                                                        <li>Site</li>\r\n                                                        <li>{{vm.model.SiteName}}</li>\r\n\r\n                                                        <li>Address</li>\r\n                                                        <li>{{vm.model.SiteAddress}}</li>\r\n\r\n                                                        <li>Phone</li>\r\n                                                        <li>{{vm.model.SiteContactPhone}}</li>\r\n                                                    </ul>\r\n                                                </td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td><strong>WO #: </strong>{{vm.model.AltId}}</td>\r\n                                                <td><strong>Status: </strong>{{vm.model.WoStatus}}</td>\r\n                                                <td><strong>WO Type: </strong>{{vm.model.WoType}}</td>\r\n                                                <td><strong>Technician: </strong>{{vm.model.LeadTechnician}}</td>\r\n                                            </tr>\r\n                                        </tbody>\r\n                                    </table>\r\n\r\n\r\n                                    <div class="table-responsive">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th colspan="6">Assignments</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <td>Description</td>\r\n                                                    <td>Problem</td>\r\n                                                    <td>Tech</td>\r\n                                                    <td>Status</td>\r\n                                                    <td>Resolution</td>\r\n                                                    <td>Serviceable Item</td>\r\n                                                </tr>\r\n                                                <tr ng-repeat="item in vm.model.ServiceReportAssignments">\r\n                                                    <td>{{item.Desc}}</td>\r\n                                                    <td>{{item.ProblemCode}}</td>\r\n                                                    <td>{{item.LeadTechnician}}</td>\r\n                                                    <td>{{item.Status}}</td>\r\n                                                    <td>{{item.Resolution}}</td>\r\n                                                    <td>{{item.ServiceableItemName}}</td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                                    <div class="table-responsive">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th colspan="4">Labor</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <td>Date</td>\r\n                                                    <td>Description</td>\r\n                                                    <td>Technician</td>\r\n                                                    <td>Hours</td>\r\n                                                </tr>\r\n                                                <tr ng-repeat="item in vm.model.ServiceReportLabors">\r\n                                                    <td>{{item.LaborDateString}}</td>\r\n                                                    <td>{{item.LaborCode}}</td>\r\n                                                    <td>{{item.Technician}}</td>\r\n                                                    <td>{{item.LaborHours}}</td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n\r\n                                    <div class="table-responsive">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th colspan="3">Parts</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <td>Description</td>\r\n                                                    <td>Part Num</td>\r\n                                                    <td>Qty</td>\r\n                                                </tr>\r\n                                                <tr ng-repeat="item in vm.model.ServiceReportParts">\r\n                                                    <td>{{item.Desc}}</td>\r\n                                                    <td>{{item.PartNum}}</td>\r\n                                                    <td>{{item.Quantity}}</td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                                    <div class="table-responsive">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th colspan="2">Miscellaneous</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <td>Description</td>\r\n                                                    <td>Qty</td>\r\n                                                </tr>\r\n                                                <tr ng-repeat="item in vm.model.ServiceReportMiscs">\r\n                                                    <td>{{item.Desc}}</td>\r\n                                                    <td>{{item.Quantity}}</td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                                    <div class="table-responsive">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th colspan="2">Notes</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <td>Date</td>\r\n                                                    <td>Note</td>\r\n                                                </tr>\r\n                                                <tr ng-repeat="item in vm.model.ServiceReportNotes">\r\n                                                    <td>{{item.SysModifyUTCString}}</td>\r\n                                                    <td>{{item.Note}}</td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                            \r\n                                </div> \x3c!-- columns --\x3e\r\n                            </div> \x3c!-- row --\x3e\r\n                            <h5>Service Reports</h5>\r\n                            <div class="reportTableTitle" ng-controller="WoServiceReportController as woservrpts" id="manageWO">\r\n                                \x3c!-- PBI555 : FCO - Carry over customer signature on revised service report - GroundBreakers --\x3e\r\n                                \x3c!-- <fc-table api-method="woservicereports" --\x3e\r\n                                <fc-table api-method="{{vm.serviceReportAPI}}"\r\n                                          attributes="woservrpts.attributes"\r\n                                          filter="vm.filter"\r\n                                          table-name="ServiceReports"\r\n                                          disable-custom-button="true">\r\n                                </fc-table>\r\n                            </div>\x3c!-- content --\x3e\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/reports.html",'<div id="myModal" class="fade signatureCan" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n        \x3c!-- Modal content--\x3e\r\n        <div class="modal-content" style="overflow-y: auto; height: 90%" >\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h4 class="modal-title">Report</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <div id="cl-wrapper">\r\n                    <div id="pcont" class="container-fluid">\r\n                        <div class="cl-mcont">\r\n                            <div class="row  form-horizontal">\r\n                                <div class="col-md-12">\r\n                                \x3c!--dodavanje emaila--\x3e\r\n                                    <div class="table-responsive" style="overflow-x: visible">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th>Email and Attachments</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <th>\r\n                                                        <div class="form-group">\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Send To:</label>\r\n                                                                <div class="col-sm-12 col-md-12 col-lg-12">\r\n                                                                    <input id="" type="text" required ng-model="vm.model.DefaultCompanyEmail" class="form-control ng-valid ng-valid-required">\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Customer Email:</label>\r\n\r\n                                                                    <div class="col-sm-11 col-md-11 col-lg-11" style="padding: 0;">\r\n                                                                        <input id="" type="text" ng-model="vm.model.SiteContactEmail" class="form-control ng-valid ng-valid-required">\r\n                                                                    </div>\r\n                                                                    <div class="col-sm-1 col-md-1 col-lg-1">\r\n                                                                        <input id="" type="checkbox" ng-model="vm.model.Include">\r\n                                                                        <label class="control-label">Include</label>\r\n                                                                    </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                            <div class="col-sm-11 col-md-11 col-lg-11">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Message:</label>\r\n                                                                <div class="col-sm-12 col-md-12 col-lg-12">\r\n                                                                    <textarea id="" required ng-model="vm.model.EmailMessage" class="form-control ng-valid ng-valid-required"></textarea>\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n\r\n                                                            <div class="col-sm-5 col-md-5 col-lg-5">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Select attachments to include:</label>\r\n                                                                <div class="col-sm-12 col-md-12 col-lg-12">\r\n                                                                    <select ng-model="vm.model.SelectedAttachments" class=\'form-control\' ng-options="attachments.Id as attachments.AttachmentName for attachments in vm.model.ServiceReportAttachments" multiple></select>\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n\r\n                                                            <div class="col-sm-5 col-md-5 col-lg-5">\r\n                                                                <label class="col-sm-12 col-md-12 col-lg-12 control-label">Select forms to include:</label>\r\n                                                                <div class="col-sm-12 col-md-12 col-lg-12">\r\n                                                                    <select ng-model="vm.model.SelectedForms" class=\'form-control\' ng-options="forms.Id as forms.DPSDocumentName for forms in vm.model.ServiceReportForms" multiple></select>\r\n                                                                </div>\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                        </div> \x3c!-- form group --\x3e\r\n                                                    </th>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                                    <div class="row">\r\n                                        <div class="col-md-6 col-sm-6 col-lg-6 col-sm-offset-6 col-md-offset-6 col-lg-offset-6">\r\n                                            <strong>{{vm.model.CompanyName}}</strong>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class="row no-margin-top">\r\n                                        <div class="col-md-6 col-sm-6 col-lg-6 col-sm-offset-6 col-md-offset-6 col-lg-offset-6">\r\n                                            {{vm.model.CompanyAddress}}\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class="row no-margin-top">\r\n                                        <div class="col-md-6 col-sm-6 col-lg-6 col-sm-offset-6 col-md-offset-6 col-lg-offset-6" style="padding-bottom:5px">\r\n                                            {{vm.model.CompanyCity}}\r\n                                        </div>\r\n                                    </div>\r\n\r\n                                    <table class="table hover reportTableAdress">\r\n                                        <thead>\r\n                                            <tr>\r\n                                                <th colspan="2" width="50%">Billing Address </th>\r\n                                                <th colspan="2" width="50%">Site Address</th>\r\n                                            </tr>\r\n                                        </thead>\r\n\r\n                                        <tbody>\r\n                                            <tr>\r\n                                                <td colspan="2">\r\n                                                    <ul class="AdressList clearfix">\r\n                                                        <li>Customer</li>\r\n                                                        <li>{{vm.model.CustomerName}}</li>\r\n\r\n                                                        <li>Address</li>\r\n                                                        <li>{{vm.model.BillingAddress}}</li>\r\n\r\n                                                        <li>Phone</li>\r\n                                                        <li>{{vm.model.BillingContactPhone}}</li>\r\n                                                    </ul>\r\n                                                </td>\r\n                                                <td colspan="2">\r\n                                                    <ul class="AdressList clearfix">\r\n                                                        <li>Site</li>\r\n                                                        <li>{{vm.model.SiteName}}</li>\r\n\r\n                                                        <li>Address</li>\r\n                                                        <li>{{vm.model.SiteAddress}}</li>\r\n\r\n                                                        <li>Phone</li>\r\n                                                        <li>{{vm.model.SiteContactPhone}}</li>\r\n                                                    </ul>\r\n                                                </td>\r\n                                            </tr>\r\n                                            <tr>\r\n                                                <td><strong>WO #: </strong>{{vm.model.AltId}}</td>\r\n                                                <td><strong>Status: </strong>{{vm.model.WoStatus}}</td>\r\n                                                <td><strong>WO Type: </strong>{{vm.model.WoType}}</td>\r\n                                                <td><strong>Customer PO Number: </strong>{{vm.model.CustomerPONum}}</td>\r\n                                                \x3c!--<td><strong>Technician: </strong>{{vm.model.LeadTechnician}}</td>--\x3e\r\n                                            </tr>\r\n                                        </tbody>\r\n                                    </table>\r\n\r\n\r\n                                    <div class="table-responsive">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th colspan="6">Assignments</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <td>Description</td>\r\n                                                    <td>Problem</td>\r\n                                                    <td>Tech</td>\r\n                                                    <td>Status</td>\r\n                                                    <td>Resolution</td>\r\n                                                    <td>Serviceable Item</td>\r\n                                                </tr>\r\n                                                <tr ng-repeat="item in vm.model.ServiceReportAssignments">\r\n                                                    <td>{{item.Desc}}</td>\r\n                                                    <td>{{item.ProblemCode}}</td>\r\n                                                    <td>{{item.LeadTechnician}}</td>\r\n                                                    <td>{{item.Status}}</td>\r\n                                                    <td>{{item.Resolution}}</td>\r\n                                                    <td>{{item.ServiceableItemName}}</td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                                    <div class="table-responsive">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th colspan="4">Labor</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <td>Date</td>\r\n                                                    <td>Description</td>\r\n                                                    <td>Technician</td>\r\n                                                    <td>Hours</td>\r\n                                                </tr>\r\n                                                <tr ng-repeat="item in vm.model.ServiceReportLabors">\r\n                                                    <td>{{item.LaborDateString}}</td>\r\n                                                    <td>{{item.LaborCode}}</td>\r\n                                                    <td>{{item.Technician}}</td>\r\n                                                    <td>{{item.LaborHours}}</td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n\r\n                                    <div class="table-responsive">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th colspan="3">Parts</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    \x3c!-- US2701 --\x3e\r\n                                                    \x3c!-- <td>Description</td> --\x3e\r\n                                                    \x3c!-- <td>Part Num</td> --\x3e\r\n                                                    <td>Part Num</td>\r\n                                                    <td>Item Name</td>\r\n                                                    \x3c!-- US2701 : END --\x3e\r\n                                                    <td>Qty</td>\r\n                                                </tr>\r\n                                                <tr ng-repeat="item in vm.model.ServiceReportParts">\r\n                                                    \x3c!-- US2701 --\x3e\r\n                                                    \x3c!-- <td>{{item.Desc}}</td> --\x3e\r\n                                                    \x3c!-- <td>{{item.PartNum}}</td> --\x3e\r\n                                                    <td>{{item.PartNum}}</td>\r\n                                                    <td>{{item.Desc}}</td>\r\n                                                    \x3c!-- US2701 : END --\x3e\r\n                                                    <td>{{item.Quantity}}</td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                                    <div class="table-responsive">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th colspan="2">Miscellaneous</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <td>Description</td>\r\n                                                    <td>Qty</td>\r\n                                                </tr>\r\n                                                <tr ng-repeat="item in vm.model.ServiceReportMiscs">\r\n                                                    <td>{{item.Desc}}</td>\r\n                                                    <td>{{item.Quantity}}</td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                                    <div class="table-responsive">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th colspan="2">Notes</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <td>Date</td>\r\n                                                    <td>Note</td>\r\n                                                </tr>\r\n                                                <tr ng-repeat="item in vm.model.ServiceReportNotes">\r\n                                                    <td>{{item.SysModifyUTCString}}</td>\r\n                                                    <td>{{item.Note}}</td>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                    </div>\r\n\r\n                                    \x3c!--@uttam - Ticket #DE1448\r\n                                        <div ng-if="!vm.model.CompanyName.toLowerCase().includes(\'albireo\')" class="row">\r\n                                        <div class="col-md-12">\r\n                                            <p>View Our Terms and Conditions <a href="">here</a></p>\r\n                                        </div>\r\n                                    </div>--\x3e\r\n\r\n                                    <div ng-if="vm.model.CompanyName.toLowerCase().includes(\'albireo\')" class="row">\r\n                                        <div class="col-md-12">\r\n                                            <p>All services and materials subject to contract minimums.</p>\r\n                                        </div>\r\n                                    </div>\r\n\r\n\r\n                                    <div class="table-responsive"  style="overflow-x: visible">\r\n                                        <table class="table hover reportTableTitle">\r\n                                            <thead>\r\n                                                <tr>\r\n                                                    <th>Signed by</th>\r\n                                                    <th>Signature</th>\r\n                                                    <th>Date</th>\r\n                                                </tr>\r\n                                            </thead>\r\n\r\n                                            <tbody>\r\n                                                <tr>\r\n                                                    <th>\r\n                                                        <div class="form-group">\r\n                                                            <div class="col-sm-10 col-md-9 col-lg-7">\r\n                                                                <input id="" type="text" required ng-model="vm.model.SignedBy" class="form-control ng-valid ng-valid-required">\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                        </div> \x3c!-- form group --\x3e\r\n                                                    </th>\r\n                                                    <th>\r\n                                                        <div class="form-group">\r\n                                                            <div class="col-sm-10 col-md-9 col-lg-7 ">\r\n                                                                <canvas id="signatureCanvas" required="" fc-signature width="400" height= "150" style="border: 1px  solid #000000"></canvas>\r\n                                                            </div>\x3c!-- input box --\x3e\r\n                                                        </div>\x3c!-- form group --\x3e\r\n                                                    </th>\r\n                                                    <th>\r\n                                                        <div class="form-group">\r\n                                                            <div class="col-sm-10 col-md-9 col-lg-7">\r\n                                                                <input type="text" readonly="readonly" ng-model="vm.model.DateString" class="form-control">\r\n                                                            </div> \x3c!-- input box --\x3e\r\n                                                        </div> \x3c!-- form group --\x3e\r\n                                                    </th>\r\n                                                </tr>\r\n                                            </tbody>\r\n                                        </table>\r\n                                        <button class="btn btn-default floatRight"  ng-click="vm.ok()"><i class="fa  fa-check"></i> Accept Signature</button>\r\n                                        <button class="btn btn-default floatRight" ng-click="vm.clear()"><i class="fa  fa-times-circle"></i> Clear Signature</button>\r\n                                    </div>\r\n                                </div> \x3c!-- columns --\x3e\r\n                            </div> \x3c!-- row --\x3e\r\n                        </div>\x3c!-- content --\x3e\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/serviceRequestWODetails.html",'<div id="pcont" class="container-fluid" ng-controller="SRWODetailsController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active"> Work Order Details  </li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Work Order Details</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n\r\n        <div class="row" ng-if="vm.getModulePrivilege(vm.viewName, vm.moduleName) !=0">\r\n            <div class="col-md-6" style="color: #5e94ff">\r\n                <h2>Work Order {{vm.altId}}</h2>\r\n            </div>\r\n        </div>\r\n\r\n        <div ng-class="{\'hideWODetails\':!vm.ShowSubmit}" ng-if="vm.getModulePrivilege(vm.viewName, vm.moduleName) !=0">\r\n            <fc-table-edit api-method="wodetails/getForSR"\r\n                           timezone="vm.WOdetailsTimezone"\r\n                           id="{{vm.id}}"\r\n                           attributes="vm.attributes"\r\n                           on-back="vm.goBack()"\r\n                           model="vm.model"\r\n                           view-name="{{vm.viewName}}"\r\n                           module-name="{{vm.moduleName}}">\r\n            </fc-table-edit>\r\n            <div class="row form-horizontal">\r\n                <div class="col-md-12">\r\n                    <div id="accordionAcceptWO" class="panel-group accordion">\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'assignmentsGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne" aria-expanded="false" class="collapsed">Work Performed &nbsp;&nbsp;  Count: {{vm.count}} &nbsp; &nbsp;<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseOne" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.assignmentsGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content" ng-controller="AssingmentController as va">\r\n                                            <fc-table api-method="woassignments"\r\n                                                      attributes="va.attributes"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="va.reloadTable"\r\n                                                      table-name="Assingment"\r\n                                                      rows-count="vm.count"\r\n                                                      timezone="va.assignmentsTimezone"\r\n                                                      delete-message-format="Are you sure you want to delete Assingment %Desc% ?"\r\n                                                   >\r\n\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n\r\n                        <div ng-controller="WoNoteController as wn">\r\n                            <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, wn.moduleName) !=0">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'notesGrid\')">\r\n                                    <h4 class="panel-title">\r\n                                        <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo" class="collapsed" aria-expanded="false">\r\n                                            Notes\r\n                                            <span ng-show="(wn.getWoNoteLength() && !wn.getSiteNoteLength())"> - Work Order notes exist</span>\r\n                                            <span ng-show="(!wn.getWoNoteLength()  && wn.getSiteNoteLength())"> - Site notes exist</span>\r\n                                            <span ng-show="(wn.getWoNoteLength()  && wn.getSiteNoteLength())"> - Work Order and Site notes exist</span>\r\n                                            <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                        </a>\r\n                                    </h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseTwo" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div class="panel-body" ng-if="vm.notesGrid">\r\n                                        <fc-tabs tab="wn.filterTab">\r\n                                            <div fc-tab="Work Order Notes">\r\n                                                <div ng-if="wn.filterTabWindow == false">\r\n                                                    <fc-table table-name="Work Order Note"\r\n                                                              api-method="wonotes"\r\n                                                              attributes="wn.attributesWoatt"\r\n                                                              on-edit="wn.editWoNote(id, vm.filter.filterId)"\r\n                                                              filter="vm.filterByWorkOrder"\r\n                                                              ng-if="wn.reloadTable"\r\n                                                              delete-event="wn.setNotesHeader()"\r\n                                                              delete-message-format="Are you sure you want to delete notes  %Note% ?"\r\n                                                              view-name="{{wn.viewName}}"\r\n                                                              module-name="{{wn.moduleName}}">\r\n                                                    </fc-table>\r\n                                                </div>\r\n                                            </div>\r\n                                            <div fc-tab="Site Notes">\r\n                                                <fc-table table-name="Site Note"\r\n                                                          api-method="wositenotes"\r\n                                                          attributes="wn.attributesSiatt"\r\n                                                          on-edit="wn.editSiteNote(id, vm.filter1.siteId)"\r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          ng-if="wn.reloadTable"\r\n                                                          delete-event="wn.setNotesHeader()"\r\n                                                          delete-message-format="Are you sure you want to delete notes  %Note% ?"\r\n                                                          view-name="{{wn.viewName}}"\r\n                                                          module-name="{{wn.moduleName}}">\r\n                                                </fc-table>\r\n                                            </div>\r\n                                        </fc-tabs>\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel default --\x3e\r\n                        </div>\x3c!-- controller --\x3e\r\n                        <div ng-controller="WoServiceReportController as woservrpts">\r\n                            <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, woservrpts.moduleName) !=0">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'servreportGrid\')">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseSeven" class="collapsed" aria-expanded="false">Service Reports<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseSeven" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div class="panel-body" ng-if="vm.servreportGrid">\r\n                                        <div class="block-flat">\r\n                                            <div class="content" ng-controller="WoServiceReportController as woservrpts">\r\n                                                <fc-table api-method="woservicereports"\r\n                                                          attributes="woservrpts.attributes"\r\n                                                          filter="vm.filter"\r\n                                                          table-name="ServiceReports"\r\n                                                          ng-if="woservrpts.reloadTable"\r\n                                                          view-name="{{woservrpts.viewName}}"\r\n                                                          module-name="{{woservrpts.moduleName}}">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel default --\x3e\r\n                        </div>\x3c!-- controller --\x3e\r\n                    </div>\r\n                </div>\r\n            </div>\r\n\r\n\r\n        </div>\r\n</div>\r\n</div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/subcontractorWorkOrderDetails.html",'<div id="pcont" class="container-fluid" ng-controller="SubcontractorWorkOrderDetails as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'manageWorkOrders\')">Manage Work Orders</a></li>\r\n            <li class="active"> Work Order Details  </li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Work Order Details</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row">\r\n            <div class="col-md-6" style="color: #5e94ff">\r\n                <h2>Work Order {{vm.altId}}</h2>\r\n            </div>\r\n        </div>\r\n        <div>\r\n            <div id="assignment-wo">\r\n                <fc-table-edit api-method="wodetails" timezone="vm.WOdetailsTimezone" id="{{vm.id}}" on-back="vm.$state.go(\'manageWorkOrders\')" on-submit="vm.updateStatus()" attributes="vm.attributes" model="vm.model"></fc-table-edit>\r\n            </div>\r\n\r\n            <div class="row  form-horizontal">\r\n\r\n                <div class="col-md-12">\r\n                    <div id="subcontractorWorkOrder" class="panel-group accordion">\r\n                        <div id="subcontractorWorkOrderAssignment">\r\n                            <div class="panel panel-default">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'assignmentsGrid\')">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne" aria-expanded="false" class="collapsed"> Assignment &nbsp;&nbsp;  Count: {{vm.count}} &nbsp; &nbsp; Estimated hours total: {{vm.estHoursTotal}}<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseOne" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div class="panel-body" ng-if="vm.assignmentsGrid">\r\n                                        <div class="block-flat">\r\n                                            <div class="content" ng-controller="AssingmentController as va" id="sub-assignments-table">\r\n                                                <fc-table api-method="woassignments"\r\n                                                          attributes="va.attributes"\r\n                                                          on-edit="va.editAssignmentSub(id, vm.filter.filterId, vm.site.siteId, true)"\r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          ng-if="va.reloadTable"\r\n                                                          table-name="Assingment"\r\n                                                          rows-count="vm.count"\r\n                                                          timezone="va.assignmentsTimezone"\r\n                                                          delete-message-format="Are you sure you want to delete Assingment %Desc% ?">\r\n\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel --\x3e\r\n                        </div>\r\n                        <div class="panel panel-default" ng-controller="WoNoteController as wn">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'notesGrid\')">\r\n                                <h4 class="panel-title">\r\n                                    <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo" class="collapsed" aria-expanded="false">\r\n                                        Notes\r\n                                        <span ng-show="(wn.getWoNoteLength() && !wn.getSiteNoteLength())"> - Work Order notes exist</span>\r\n                                        <span ng-show="(!wn.getWoNoteLength()  && wn.getSiteNoteLength())"> - Site notes exist</span>\r\n                                        <span ng-show="(wn.getWoNoteLength()  && wn.getSiteNoteLength())"> - Work Order and Site notes exist</span>\r\n                                        <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                    </a>\r\n\r\n                                </h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseTwo" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.notesGrid">\r\n                                    <fc-tabs tab="wn.filterTab">\r\n                                        <div fc-tab="Work Order Notes">\r\n                                            <div ng-if="wn.filterTabWindow == false">\r\n                                                <fc-table table-name="Work Order Note"\r\n                                                          api-method="wonotes"\r\n                                                          attributes="wn.attributesWoatt"\r\n                                                          on-edit="wn.editWoNote(id, vm.filter.filterId)"\r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          ng-if="wn.reloadTable"\r\n                                                          rows-count="wn.woNotesCount"\r\n                                                          delete-event="wn.setNotesHeader()"\r\n                                                          delete-message-format="Are you sure you want to delete notes  %Note% ?">\r\n                                                </fc-table>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div fc-tab="Site Notes">\r\n                                            <fc-table table-name="Site Note"\r\n                                                      api-method="wositenotes"\r\n                                                      attributes="wn.attributesSiatt"\r\n                                                      on-edit="wn.editSiteNote(id, vm.filter1.siteId)"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="wn.reloadTable"\r\n                                                      rows-count="wn.siteNotesCount"\r\n                                                      delete-event="wn.setNotesHeader()"\r\n                                                      delete-message-format="Are you sure you want to delete notes  %Note% ?">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                    </fc-tabs>\r\n\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel 1 --\x3e\r\n\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'laborGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseThree" class="collapsed" aria-expanded="false">Labor<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseThree" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.laborGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content" ng-controller="WoLaborController as vl">\r\n                                            <fc-table api-method="woLabors"\r\n                                                      attributes="vl.attributesSubcontractor"\r\n                                                      on-edit="vl.edit(id, vm.filter.filterId, vm.filter1.rateSheetId, vm.filter1.agreementId, vm.subcontractorId, vm.woCompanyId)"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="vl.reloadTable"\r\n                                                      table-name="Labor"\r\n                                                      delete-event="vl.checkInvoice()"\r\n                                                      delete-message-format="Are you sure you want to delete the labor  %FullName% ?">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel --\x3e\r\n\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'partsGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseFour" class="collapsed" aria-expanded="false">Parts<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseFour" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body">\r\n                                    <div class="block-flat" ng-if="vm.partsGrid">\r\n                                        <div id="partsFilter" class="content" ng-controller="PartsController as parts">\r\n                                            <fc-table api-method="parts"\r\n                                                      attributes="parts.attributesSubcontractor"\r\n                                                      on-edit="parts.editPart(id, vm.filter.filterId, vm.subcontractorId, vm.woCompanyId)"\r\n                                                      filter="parts.autoFilter"\r\n                                                      table-name="Parts"\r\n                                                      ng-if="parts.reloadTable"\r\n                                                      delete-event="parts.checkInvoice()"\r\n                                                      delete-message-format="Are you sure you want to delete the Parts  %ItemName% ?">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel --\x3e\r\n\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'miscGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseFive" class="collapsed" aria-expanded="false">Miscellaneous<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseFive" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body">\r\n                                    <div class="block-flat" ng-if="vm.miscGrid">\r\n                                        <div id="miscFilter" class="content" ng-controller="MiscController as misc">\r\n                                            <fc-table api-method="miscs"\r\n                                                      attributes="misc.attributesSubcontractor"\r\n                                                      on-edit="misc.editMisc(id, vm.filter.filterId, vm.subcontractorId, vm.woCompanyId)"\r\n                                                      filter="misc.autoFilter"\r\n                                                      table-name="Miscellaneous"\r\n                                                      ng-if="misc.reloadTable"\r\n                                                      delete-event="misc.checkInvoice()"\r\n                                                      delete-message-format="Are you sure you want to delete the Miscellaneous  %ItemName% ?">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel --\x3e\r\n\r\n                        <div class="panel panel-default" ng-show="vm.taskGrid">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'tasksGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseSix" class="collapsed" aria-expanded="false">Tasks<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseSix" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.tasksGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content" ng-controller="WoTaskController as wt">\r\n                                            \x3c!-- PBI1044 : FCO - Work Order Tasks --\x3e\r\n                                            <div class="form-group ">\r\n                                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right customGridButton">\r\n                                                    <button type="submit" class="btn btn-primary" ng-click="wt.completeAll(vm.filter.filterId)">Close All</button>\r\n                                                    <button type="submit" class="btn btn-primary" ng-click="wt.editTask(id, vm.filter.filterId, vm.model.SiteId, true)">Add New</button>\r\n                                                </div>\r\n                                            </div>\r\n                                            <fc-table api-method="wotasks"\r\n                                                      attributes="wt.attributes"\r\n                                                      on-edit="wt.editTask(id, vm.filter.filterId, vm.model.SiteId, true)"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="wt.reloadTable"\r\n                                                      table-name="Task"\r\n                                                      delete-message-format="Are you sure you want to delete Task %TaskName% ?"\r\n                                                      show-add-new="false"\r\n                                                      drilldown-filter="wt.drilldownFilter"\r\n                                                      drilldown="wt.drilldownSettings"\r\n                                                      list="wt.allTasks"></fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel --\x3e\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'formsGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseNine" class="collapsed" aria-expanded="false">Forms<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseNine" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div id="woForm" class="panel-body" ng-if="vm.formsGrid">\r\n                                    <div class="block-flat">\r\n                                        <button class="btn pull-right" ng-click="vm.changeForms()">{{vm.btnName}}</button>\r\n                                        <div class="content" ng-controller="WoFormController as forms">\r\n                                            <div ng-init="forms.woId = vm.id"></div>\r\n                                            <div ng-show="vm.woForm">\r\n                                                <div ng-if="vm.filter.filterId">\r\n                                                    <fc-table id="woForms"\r\n                                                              api-method="forms/getforwodetails"\r\n                                                              attributes="forms.attributes"\r\n                                                              filter="vm.filterByWorkOrder"\r\n                                                              ng-if="vm.reloadFilter"\r\n                                                              delete-message-format="Are you sure you want to delete Form %Name% ?"\r\n                                                              table-name="Forms">\r\n                                                    </fc-table>\r\n                                                </div>\r\n                                            </div>\r\n                                            <div ng-show="!vm.woForm">\r\n                                                <div id="woSiteForm" class="col-lg-6 col-sm-6">\r\n                                                    <fc-table-edit api-method="forms/getforSiteEquipmentDropdown"\r\n                                                                   attributes="vm.attributesSite"\r\n                                                                   model="vm.modelSite">\r\n                                                    </fc-table-edit>\r\n                                                </div>\r\n                                                <div ng-if="vm.filter.filterId && vm.model.SiteId && vm.modelSite.Id">\r\n                                                    <fc-table id="woForms"\r\n                                                              api-method="forms/getforSiteEquipment"\r\n                                                              attributes="forms.siteAttributes"\r\n                                                              filter="vm.filterSiteForms"\r\n                                                              delete-message-format="Are you sure you want to delete Form %Name% ?"\r\n                                                              ng-if="vm.reloadFilter"\r\n                                                              table-name="Forms">\r\n                                                    </fc-table>\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel --\x3e\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'attachmentsGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseEight" class="collapsed" aria-expanded="false">Attachments<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseEight" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.attachmentsGrid">\r\n                                    <div class="block-flat" ng-init=\'content="wo"\'>\r\n                                        \x3c!--<div class="form-group">--\x3e\r\n                                        <div class="col-sm-9">\r\n                                            <label>\r\n                                                <input type="radio" class="icheck" ng-model="content" value="wo"> Work Order&nbsp;&nbsp;\r\n                                            </label>\r\n                                            <label>\r\n                                                <input type="radio" class="icheck" ng-model="content" value="site"> Site\r\n                                            </label>\r\n                                        </div> \x3c!-- input box --\x3e\r\n                                        \x3c!--</div>--\x3e \x3c!-- form group --\x3e\r\n                                        <div class="content" ng-controller="WoAttachmentController as woatt" ng-show="content == \'wo\'">\r\n                                            <fc-table api-method="woattachments"\r\n                                                      attributes="woatt.attributesWoatt"\r\n                                                      on-edit="woatt.editWoAttachment(id, vm.filter.filterId)"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="woatt.reloadTable"\r\n                                                      table-name="Work Order Attachments"\r\n                                                      delete-message-format="Are you sure that you want to delete %AttachmentName%?">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                        <div class="content" ng-controller="WoAttachmentController as siatt" ng-show="content == \'site\'">\r\n                                            <div ng-if="vm.filter1.siteId">\r\n                                                <fc-table api-method="siteattachments"\r\n                                                          attributes="siatt.attributesSiatt"\r\n                                                          on-edit="siatt.editSiteAttachment(id, vm.filter1.siteId)"\r\n                                                          filter="vm.filterBySite"\r\n                                                          ng-if="siatt.reloadTable"\r\n                                                          table-name="Site Attachment"\r\n                                                          delete-message-format="Are you sure that you want to delete %AttachmentName%?">\r\n                                                </fc-table>\r\n                                            </div>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel --\x3e\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'servreportGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseSeven" class="collapsed" aria-expanded="false">Service Reports<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseSeven" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body">\r\n                                    <div class="block-flat" ng-if="vm.servreportGrid">\r\n                                        <div class="content" ng-controller="WoServiceReportController as woservrpts">\r\n                                            <fc-table api-method="woservicereports"\r\n                                                      attributes="woservrpts.attributes"\r\n                                                      on-edit="woservrpts.editServiceReport(id, vm.filter.filterId, true)"\r\n                                                      filter="vm.filter"\r\n                                                      table-name="ServiceReports"\r\n                                                      ng-if="woservrpts.reloadTable"\r\n                                                      delete-message-format="Are you sure you want to delete %FileName%?">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel --\x3e\r\n                    </div>\x3c!-- accordion --\x3e\r\n                </div> \x3c!-- columns --\x3e\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/woCopyEditModal.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 80%">\r\n            \x3c!-- LOADING SPINNER --\x3e\r\n            <div ng-hide="!woCopyEdit.isLoading" class="table-edit-overlay">\r\n                <div class="sk-circle">\r\n                    <div class="sk-circle1 sk-child"></div>\r\n                    <div class="sk-circle2 sk-child"></div>\r\n                    <div class="sk-circle3 sk-child"></div>\r\n                    <div class="sk-circle4 sk-child"></div>\r\n                    <div class="sk-circle5 sk-child"></div>\r\n                    <div class="sk-circle6 sk-child"></div>\r\n                    <div class="sk-circle7 sk-child"></div>\r\n                    <div class="sk-circle8 sk-child"></div>\r\n                    <div class="sk-circle9 sk-child"></div>\r\n                    <div class="sk-circle10 sk-child"></div>\r\n                    <div class="sk-circle11 sk-child"></div>\r\n                    <div class="sk-circle12 sk-child"></div>\r\n                </div>\r\n            </div>\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="woCopyEdit.close()">&times;</button>\r\n                <h4 class="modal-title">Work Order Copy - Default Assignment</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <fc-table-edit api-method="{{woCopyEdit.apiMethod}}"\r\n                               id="{{woCopyEdit.id}}"\r\n                               model="woCopyEdit.model"\r\n                               view-name="{{woCopyEdit.viewName}}"\r\n                               module-name="{{woCopyEdit.moduleName}}"\r\n                               attributes="woCopyEdit.attributes"\r\n                               on-back="woCopyEdit.close(insertData)"\r\n                               submit-button-text="Copy"\r\n                               on-submit="woCopyEdit.onSubmit()">\r\n                </fc-table-edit>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class="modal-backdrop in fade"></div>\r\n</div>'),e.put("Templates/WorkOrder/ManageWorkOrder/woDeficiencyEditModal.html",'<div id="myModal" class="fade" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 90%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h4 class="modal-title">Deficiency</h4>\r\n            </div>\r\n            \x3c!-- LOADING SPINNER --\x3e\r\n            <div ng-hide="!vm.isLoading" class="table-edit-overlay">\r\n                <div class="sk-circle">\r\n                    <div class="sk-circle1 sk-child"></div>\r\n                    <div class="sk-circle2 sk-child"></div>\r\n                    <div class="sk-circle3 sk-child"></div>\r\n                    <div class="sk-circle4 sk-child"></div>\r\n                    <div class="sk-circle5 sk-child"></div>\r\n                    <div class="sk-circle6 sk-child"></div>\r\n                    <div class="sk-circle7 sk-child"></div>\r\n                    <div class="sk-circle8 sk-child"></div>\r\n                    <div class="sk-circle9 sk-child"></div>\r\n                    <div class="sk-circle10 sk-child"></div>\r\n                    <div class="sk-circle11 sk-child"></div>\r\n                    <div class="sk-circle12 sk-child"></div>\r\n                </div>\r\n            </div>\r\n            <div class="modal-body">\r\n\r\n                <div class="form-horizontal" novalidate>\r\n                    <div class="row">\r\n                        <div class="col-md-12">\r\n                            <div class="panel-body">\r\n                                <fc-table-edit api-method="deficiency"\r\n                                               id="{{vm.id}}"\r\n                                               attributes="vm.editAttributes"\r\n                                               model="vm.model"\r\n                                               view-name="{{vm.viewName}}"\r\n                                               module-name="{{vm.moduleName}}"\r\n                                               on-back="vm.onBack(insertData)"\r\n                                               hide-submit="vm.isConverted"></fc-table-edit>\r\n                            </div>\r\n                            <div id="accordion" class="panel-group accordion">\r\n                                \x3c!-- notes --\x3e\r\n\r\n                                <div class="panel panel-default">\r\n                                    <div class="panel-heading cursor_pointer">\r\n                                        <strong class="panel-title">\r\n                                            <a id="collapseDNotesToggle" data-toggle="collapse" data-parent="#accordion" data-target="#collapseDNotes" class="collapsed" aria-expanded="false">\r\n                                                Notes<i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                            </a>\r\n                                        </strong>\r\n                                    </div>\x3c!-- panel heading --\x3e\r\n                                    <div id="collapseDNotes" class="panel-collapse collapse" aria-expanded="false">\r\n                                        <div class="panel-body">\r\n                                            <div class="block-flat">\r\n                                                <div class="content">\r\n                                                    <fc-table table-name="Deficiency Notes"\r\n                                                              api-method="deficiencyNote"\r\n                                                              attributes="vm.noteAttributesGrid"\r\n                                                              on-edit="vm.editNote(id)"\r\n                                                              filter="vm.deficiencyFilter"\r\n                                                              ng-if="vm.reloadTable"\r\n                                                              show-add-new="!vm.isReadOnly"\r\n                                                              show-delete-column="!vm.isReadOnly"\r\n                                                              delete-message-format=\'Are you sure you want to delete Note "%Note%"?\'></fc-table>\r\n                                                </div>\x3c!-- content --\x3e\r\n                                            </div>\r\n                                        </div>\x3c!-- panel body --\x3e\r\n                                    </div>\x3c!-- panel colapse --\x3e\r\n                                </div>\r\n\r\n                                \x3c!-- attachments --\x3e\r\n\r\n                                <div class="panel panel-default">\r\n                                    <div class="panel-heading cursor_pointer">\r\n                                        <strong class="panel-title">\r\n                                            <a id="collapseDAttachmentsToggle" data-toggle="collapse" data-parent="#accordion" data-target="#collapseDAttachments" class="collapsed" aria-expanded="false">\r\n                                                Attachments<i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                            </a>\r\n                                        </strong>\r\n                                    </div>\x3c!-- panel heading --\x3e\r\n                                    <div id="collapseDAttachments" class="panel-collapse collapse" aria-expanded="false">\r\n                                        <div class="panel-body">\r\n                                            <div class="block-flat">\r\n                                                <div class="content">\r\n                                                    <fc-table table-name="Deficiency Attachments"\r\n                                                              api-method="deficiencyAttachment"\r\n                                                              attributes="vm.attachmentAttributesGrid"\r\n                                                              on-edit="vm.editAttachment(id)"\r\n                                                              filter="vm.deficiencyFilter"\r\n                                                              ng-if="vm.reloadTable"\r\n                                                              show-add-new="!vm.isReadOnly"\r\n                                                              show-delete-column="!vm.isReadOnly"\r\n                                                              delete-message-format=\'Are you sure you want to delete Attachment "%AttachmentName%"?\'></fc-table>\r\n                                                </div>\x3c!-- content --\x3e\r\n                                            </div>\r\n                                        </div>\x3c!-- panel body --\x3e\r\n                                    </div>\x3c!-- panel colapse --\x3e\r\n                                </div>\r\n                            </div>\x3c!-- accordion --\x3e\r\n                        </div> \x3c!-- columns --\x3e\r\n                    </div>\x3c!-- row --\x3e\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/woPaymentEditModal.html",'<div id="myModal" class="fade" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n        \x3c!-- Modal content--\x3e\r\n        \x3c!-- EPIC1008 : FCO - FCPayments (Company Feature) --\x3e\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 80%">\r\n            \x3c!-- LOADING SPINNER --\x3e\r\n            <div ng-hide="!vm.isLoading" class="table-edit-overlay">\r\n                <div class="sk-circle">\r\n                    <div class="sk-circle1 sk-child"></div>\r\n                    <div class="sk-circle2 sk-child"></div>\r\n                    <div class="sk-circle3 sk-child"></div>\r\n                    <div class="sk-circle4 sk-child"></div>\r\n                    <div class="sk-circle5 sk-child"></div>\r\n                    <div class="sk-circle6 sk-child"></div>\r\n                    <div class="sk-circle7 sk-child"></div>\r\n                    <div class="sk-circle8 sk-child"></div>\r\n                    <div class="sk-circle9 sk-child"></div>\r\n                    <div class="sk-circle10 sk-child"></div>\r\n                    <div class="sk-circle11 sk-child"></div>\r\n                    <div class="sk-circle12 sk-child"></div>\r\n                </div>\r\n            </div>\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h4 class="modal-title">{{modalTitle}}</h4>\r\n            </div>\r\n            <div class="modal-body">\r\n                <fc-table-edit api-method="{{vm.apiMethod}}"\r\n                               view-name="{{vm.viewName}}"\r\n                               module-name="{{vm.moduleName}}"\r\n                               id="{{vm.id}}"\r\n                               model="vm.$scope.model"\r\n                               on-back="vm.onBack(insertData)"\r\n                               attributes="vm.attributes"\r\n                               timezone="vm.timezone"\r\n                               on-submit="vm.onSubmit()"\r\n                               hide-submit="vm.hideSubmit"\r\n                               custom-focus="vm.customFocus(attribute)"\r\n                               default-value="{{attribute.DefaultValue}}"\r\n                               current-list="vm.currentList"\r\n                               filter="vm.$scope.filter"></fc-table-edit>\r\n            </div>\r\n        </div>\r\n\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/woServiceableItemAdvancedModal.html",'<div id="myModal" class="fade" role="dialog" ng-class="{in: vm.modalClass, modal: !vm.modalClass, \'modal-open\': vm.modalClass}">\r\n    <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n        <div class="modal-content" style="overflow-y: auto; max-height: 90%">\r\n            <div class="modal-header">\r\n                <button type="button" class="close" data-dismiss="modal" ng-click="vm.onBack()">&times;</button>\r\n                <h4 class="modal-title">Advanced Serviceable Item</h4>\r\n            </div>\r\n            \x3c!-- LOADING SPINNER --\x3e\r\n            <div ng-hide="!vm.isLoading" class="table-edit-overlay">\r\n                <div class="sk-circle">\r\n                    <div class="sk-circle1 sk-child"></div>\r\n                    <div class="sk-circle2 sk-child"></div>\r\n                    <div class="sk-circle3 sk-child"></div>\r\n                    <div class="sk-circle4 sk-child"></div>\r\n                    <div class="sk-circle5 sk-child"></div>\r\n                    <div class="sk-circle6 sk-child"></div>\r\n                    <div class="sk-circle7 sk-child"></div>\r\n                    <div class="sk-circle8 sk-child"></div>\r\n                    <div class="sk-circle9 sk-child"></div>\r\n                    <div class="sk-circle10 sk-child"></div>\r\n                    <div class="sk-circle11 sk-child"></div>\r\n                    <div class="sk-circle12 sk-child"></div>\r\n                </div>\r\n            </div>\r\n            <div class="modal-body">\r\n\r\n                <div class="form-horizontal" novalidate>\r\n                    <div class="row">\r\n                        <div class="col-md-12">\r\n                            <div id="accordion" class="panel-group accordion">\r\n\r\n                                \x3c!-- edit serviceable item properties --\x3e\r\n\r\n                                <div class="panel panel-default">\r\n                                    <div class="panel-heading cursor_pointer">\r\n                                        <strong class="panel-title">\r\n                                            <a id="collapseOneToggle" data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne" class="collapsed" aria-expanded="false">\r\n                                                Edit Serviceable Item Properties<i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                            </a>\r\n                                        </strong>\r\n                                    </div>\x3c!-- panel heading --\x3e\r\n                                    <div id="collapseOne" class="panel-collapse collapse" aria-expanded="false">\r\n                                        <div class="panel-body">\r\n                                            <div class="content" ng-if="vm.reloadTable">\r\n                                                <fc-table-edit api-method="serviceableitems"\r\n                                                               id="{{vm.assignment.ServiceableItemId}}"\r\n                                                               attributes="vm.editAttributes"\r\n                                                               model="vm.editModel"\r\n                                                               view-name="{{vm.viewName}}"\r\n                                                               module-name="{{vm.moduleName}}"\r\n                                                               hide-cancel="!vm.assignment.ServiceableItemId"\r\n                                                               hide-submit="!vm.assignment.ServiceableItemId"\r\n                                                               on-back="vm.updateNotification(insertData)"\r\n                                                               ng-if="vm.reloadEditForm"></fc-table-edit>\r\n\r\n                                                <fc-tabs ng-if="vm.showEditTabs">\r\n                                                    <div fc-tab="Serviceable Item Notes">\r\n                                                        <fc-table table-name="ServiceableItemNotes"\r\n                                                                  api-method="serviceableitemnotes"\r\n                                                                  attributes="vm.noteAttributes"\r\n                                                                  on-edit="vm.editNote(id)"\r\n                                                                  filter="vm.serviceableItemIdFilter"\r\n                                                                  ng-if="vm.reloadNotesTable"></fc-table>\r\n                                                    </div>\r\n                                                    <div fc-tab="Serviceable Item History">\r\n                                                        <span>Last 90 days</span>\r\n                                                        <fc-table api-method="wo/getbyservicableitem"\r\n                                                                  attributes="vm.woesAttributes"\r\n                                                                  on-edit="vm.goToWo(id, item)"\r\n                                                                  filter="vm.woesFilter"\r\n                                                                  show-add-new="false"\r\n                                                                  show-delete-column="false"></fc-table>\r\n                                                    </div>\r\n                                                    <div fc-tab="Serviceable Item Attachments">\r\n                                                        <fc-table table-name="ServiceableItemAttachments"\r\n                                                                  api-method="serviceableitemattachments"\r\n                                                                  attributes="vm.attachmentAttributes"\r\n                                                                  on-edit="vm.editAttachment(id)"\r\n                                                                  show-search="false"\r\n                                                                  filter="vm.serviceableItemIdFilter"\r\n                                                                  delete-message-format="Are you sure that you want to delete %AttachmentName%?"\r\n                                                                  ng-if="vm.reloadAttachmentsTable"></fc-table>\r\n                                                    </div>\r\n                                                    <div fc-tab="XOi Dataplates" fc-hide="{{vm.hideXOi}}">\r\n                                                        <xoi-data-plate model="vm.editModel"\r\n                                                                        id="{{vm.assignment.ServiceableItemId}}"\r\n                                                                        assignment-id="{{vm.assignment.Id}}"\r\n                                                                        note-model="vm.editNoteModel"\r\n                                                                        view-name="{{vm.editViewName}}"\r\n                                                                        list="vm.dataPlateList"></xoi-data-plate>\r\n                                                    </div>\r\n                                                </fc-tabs>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- panel body --\x3e\r\n                                    </div>\x3c!-- panel colapse --\x3e\r\n                                </div>\r\n\r\n                                \x3c!-- site serviceable item list --\x3e\r\n\r\n                                <div class="panel panel-default">\r\n                                    <div class="panel-heading cursor_pointer">\r\n                                        <strong class="panel-title">\r\n                                            <a id="collapseTwoToggle" data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo" class="collapsed" aria-expanded="false">\r\n                                                Site Serviceable Item List<i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                            </a>\r\n                                        </strong>\r\n                                    </div>\x3c!-- panel heading --\x3e\r\n                                    <div id="collapseTwo" class="panel-collapse collapse" aria-expanded="false">\r\n                                        <div class="panel-body">\r\n                                            <div class="block-flat">\r\n                                                <div class="content">\r\n                                                    <fc-table api-method="serviceableitems"\r\n                                                              attributes="vm.listAttributes"\r\n                                                              on-edit="vm.assignItem(item)"\r\n                                                              filter="vm.listFilter"\r\n                                                              table-name="ServiceableItems"\r\n                                                              ng-if="vm.reloadServiceableItemTable"\r\n                                                              view-name="{{vm.viewName}}"\r\n                                                              module-name="{{vm.moduleName}}"\r\n                                                              show-add-new="false"\r\n                                                              show-delete-column="true"\r\n                                                              delete-message-format="Are you sure that you want to delete %ServiceableItemName%?"\r\n                                                              custome-delete="vm.deleteEvent(item)"></fc-table>\r\n                                                </div>\x3c!-- content --\x3e\r\n                                            </div>\x3c!-- block-flat --\x3e\r\n                                        </div>\x3c!-- panel body --\x3e\r\n                                    </div>\x3c!-- panel colapse --\x3e\r\n                                </div>\r\n\r\n                                \x3c!-- add new serviceable item --\x3e\r\n\r\n                                <div class="panel panel-default">\r\n                                    <div class="panel-heading cursor_pointer">\r\n                                        <strong class="panel-title">\r\n                                            <a id="collapseThreeToggle" data-toggle="collapse" data-parent="#accordion" data-target="#collapseThree" class="collapsed" aria-expanded="false">\r\n                                                Add New Serviceable Item<i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                            </a>\r\n                                        </strong>\r\n                                    </div>\x3c!-- panel heading --\x3e\r\n                                    <div id="collapseThree" class="panel-collapse collapse" aria-expanded="false">\r\n                                        <div class="panel-body">\r\n                                            \x3c!--<div class="block-flat">--\x3e\r\n                                            <div class="content">\r\n\r\n                                                <fc-table-edit api-method="serviceableitems"\r\n                                                               attributes="vm.newAttributes"\r\n                                                               model="vm.newModel"\r\n                                                               view-name="{{vm.viewName}}"\r\n                                                               module-name="{{vm.moduleName}}"\r\n                                                               hide-cancel="false"\r\n                                                               on-submit="vm.newSubmit()"\r\n                                                               on-back="vm.newOnBack(insertData)"\r\n                                                               ng-if="vm.reloadNewForm"></fc-table-edit>\r\n\r\n                                                <fc-tabs ng-if="vm.usingXOiIntegration">\r\n                                                    <div fc-tab="Select XOi Dataplate">\r\n                                                        <xoi-data-plate model="vm.newModel"\r\n                                                                        id="{{vm.assignment.ServiceableItemId}}"\r\n                                                                        assignment-id="{{vm.assignment.Id}}"\r\n                                                                        note-model="vm.newNoteModel"\r\n                                                                        view-name="{{vm.newViewName}}"\r\n                                                                        ng-if="vm.reloadNewDataPlateTable"\r\n                                                                        use-list="vm.dataPlateList"></xoi-data-plate>\r\n                                                    </div>\r\n                                                </fc-tabs>\r\n\r\n                                            </div>\x3c!-- content --\x3e\r\n                                            \x3c!--</div>--\x3e\x3c!-- block-flat --\x3e\r\n                                            <hr style="border-top: 1px solid #f1f1f1; padding-bottom: 20px;" ng-if="!vm.usingXOiIntegration" />\r\n                                        </div>\x3c!-- panel body --\x3e\r\n                                    </div>\x3c!-- panel colapse --\x3e\r\n                                </div>\r\n\r\n                            </div>\x3c!-- accordion --\x3e\r\n                        </div> \x3c!-- columns --\x3e\r\n                    </div>\x3c!-- row --\x3e\r\n                    <div class="row">\r\n                        <div class="col-sm-offset-6 col-sm-6 col-md-6">\r\n\r\n                            <div class="form-group">\r\n                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                    <button type="button" class="btn btn-default table-edit-cancel-btn" ng-click="vm.onBack()">{{cancelButtonText || "Close"}}</button>\r\n                                </div> \x3c!-- input box --\x3e\r\n                            </div> \x3c!-- form group --\x3e\r\n\r\n                        </div> \x3c!-- columns --\x3e\r\n                    </div>\r\n                </div>\r\n\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n<div class="modal-backdrop fade" ng-class="{in: vm.modalClass}"></div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/workOrderDetails.html",'<div id="pcont" class="container-fluid" ng-controller="WorkOrderDetailsEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li ng-if="!vm.fromProjects && !vm.fromProjectEdit"><a class="cursor_pointer" ng-click="vm.$state.go(\'manageWorkOrders\')">Manage Work Orders</a></li>\r\n            <li ng-if="vm.fromProjects"><a class="cursor_pointer" ng-click="vm.$state.go(\'projects\')">Projects</a></li>\r\n            <li ng-if="vm.fromProjectEdit"><a class="cursor_pointer" ng-click="vm.goToProject()">{{vm.projectName}}</a></li>\r\n            <li class="active"> Work Order Details  </li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Work Order Details</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n\r\n        <div class="row" ng-if="vm.getModulePrivilege(vm.viewName, vm.moduleName) !=0" style="color: #5e94ff">\r\n            <div class="col-md-6">\r\n                <h2>Work Order {{vm.altId}}</h2>\r\n            </div>\r\n            <div class="col-md-5">\r\n                \x3c!-- PBI780 : FCO - Copy work order - FC --\x3e\r\n                <button type="button" ng-if="vm.hasParent" data-dismiss="modal" class="pull-right btn btn-primary btn-flat md-close" ng-click="vm.openParent()">Parent {{vm.parentAltId}}</button>\r\n                \x3c!-- US3539 : FCO - WEB - Navigation links UI improvement (FCWO-2368) --\x3e\r\n                <button type="button" ng-if="vm.quoteId" data-dismiss="modal" class="pull-right btn btn-primary btn-flat md-close" ng-click="vm.openQuote()">Quote {{vm.quoteAltId}}</button>\r\n                \x3c!--<a class="pull-right cursor_pointer" ng-click="vm.openQuote()">Quote {{vm.quoteAltId}}</a>--\x3e\r\n                \x3c!-- end --\x3e\r\n            </div>\r\n        </div>\r\n\r\n        \x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n        <div id="assignment-wo" ng-if="vm.getModulePrivilege(vm.viewName, vm.moduleName) !=0">\r\n            <fc-table-edit api-method="{{vm.woAPI}}"\r\n                           id="{{vm.id}}"\r\n                           timezone="vm.WOdetailsTimezone"\r\n                           on-back="vm.$state.go(\'manageWorkOrders\')"\r\n                           on-submit="vm.editWo()"\r\n                           attributes="vm.attributes"\r\n                           model="vm.model"\r\n                           custom-focus="vm.focusOut(attribute)"\r\n                           view-name="{{vm.viewName}}"\r\n                           module-name="{{vm.moduleName}}"\r\n                           ng-if="vm.showForm">\r\n            </fc-table-edit>\r\n        </div>\r\n        \x3c!--\r\n        <div id="assignment-wo" ng-if="vm.getModulePrivilege(vm.viewName, vm.moduleName) !=0 && vm.showDefaultView">\r\n            <fc-table-edit api-method="wodetails"\r\n                           id="{{vm.id}}"\r\n                           timezone="vm.WOdetailsTimezone"\r\n                           on-back="vm.$state.go(\'manageWorkOrders\')"\r\n                           on-submit="vm.editWo()"\r\n                           attributes="vm.attributes"\r\n                           model="vm.model"\r\n                           custom-focus="vm.focusOut(attribute)"\r\n                           view-name="{{vm.viewName}}"\r\n                           module-name="{{vm.moduleName}}">\r\n            </fc-table-edit>\r\n        </div>\r\n        --\x3e\r\n        \x3c!-- EPIC387 : END --\x3e\r\n\r\n        <div class="row">\r\n            <div class="col-md-6 pageViewAlign" ng-if="vm.model.Id">\r\n                \x3c!-- US3539 : FCO - WEB - Navigation links UI improvement (FCWO-2368) --\x3e\r\n                <button ng-if="vm.quoteId" type="button" data-dismiss="modal" class="btn btn-primary btn-flat md-close" ng-click="vm.openConversionPopup(vm.quoteId)">Import quote items</button>\r\n                \x3c!--<span ng-click="vm.openConversionPopup(vm.quoteId)" style="cursor: pointer; text-decoration: underline; color: #5e94ff">Import quote items</span>--\x3e\r\n                \x3c!-- PBI780 : FCO - Copy work order - FC --\x3e\r\n                \x3c!-- <button type="button" ng-if="vm.hasParent" data-dismiss="modal" class="btn btn-primary btn-flat md-close" ng-click="vm.importParentItems(vm.parentWoId)">Import Parent Items</button> --\x3e\r\n                <button type="button" data-dismiss="modal" class="btn btn-primary btn-flat md-close" ng-click="vm.copyWO()">Copy</button>\r\n            </div>\r\n        </div>\r\n\r\n        <div class="row form-horizontal">\r\n            <div class="col-md-12">\r\n                <div id="accordion" class="panel-group accordion">\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'assignmentsGrid\')">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne" aria-expanded="false" class="collapsed">Assignments &nbsp;&nbsp;  Count: {{vm.count}} &nbsp; &nbsp; Estimated hours total: {{vm.estHoursTotal}}<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseOne" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.assignmentsGrid">\r\n                                <div class="block-flat">\r\n                                    \x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n                                    \x3c!-- limit work order to a single assignment --\x3e\r\n                                    \x3c!-- <div class="content" ng-controller="AssingmentController as va" > --\x3e\r\n                                    \x3c!-- BUG678 : Unable to delete assignment for DSL Company --\x3e\r\n                                    \x3c!-- <div class="content" ng-class="{\'hide-add-new-btn\' : vm.usingDSLNorthwest}" ng-controller="AssingmentController as va"> --\x3e\r\n                                    <div class="content" ng-class="{\'hide-add-new-btn\' : vm.hideAddButton}" ng-controller="AssingmentController as va">\r\n                                        \x3c!-- PBI488 : Add Posting Group to Serviceable Item Dropdown on Work Order and Assignment --\x3e\r\n                                        <fc-table api-method="woassignments"\r\n                                                  attributes="va.attributes"\r\n                                                  on-edit="va.editAssignment(id, vm.filter.filterId, vm.site.siteId)"\r\n                                                  filter="vm.filterByWorkOrder"\r\n                                                  ng-if="va.reloadTable"\r\n                                                  table-name="Assingment"\r\n                                                  timezone="va.assignmentsTimezone"\r\n                                                  rows-count="vm.count"\r\n                                                  delete-event="va.deleteEvent()"\r\n                                                  delete-message-format="Are you sure you want to delete Assingment %Desc% ?"\r\n                                                  show-delete-column="vm.count > 1">\r\n                                        </fc-table>\r\n                                        \x3c!-- BUG678 : Unable to delete assignment for DSL Company --\x3e\r\n                                        \x3c!--\r\n                                        <fc-table api-method="{{vm.woAssignmentsAPI}}"\r\n                                                  attributes="va.attributes"\r\n                                                  on-edit="va.editAssignment(id, vm.filter.filterId, vm.site.siteId)"\r\n                                                  filter="vm.filterByWorkOrder"\r\n                                                  ng-if="va.reloadTable"\r\n                                                  table-name="Assingment"\r\n                                                  timezone="va.assignmentsTimezone"\r\n                                                  rows-count="vm.count"\r\n                                                  delete-event="va.deleteEvent()"\r\n                                                  delete-message-format="Are you sure you want to delete Assingment %Desc% ?">\r\n                                        </fc-table>\r\n                                        --\x3e\r\n                                    </div>\x3c!-- content --\x3e\r\n                                </div>\x3c!-- block-flat --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel default --\x3e\r\n\r\n                    <div ng-controller="WoNoteController as wn">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, wn.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'notesGrid\')">\r\n                                <h4 class="panel-title">\r\n                                    <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo" class="collapsed" aria-expanded="false">\r\n                                        Notes\r\n                                        <span ng-show="(wn.getWoNoteLength() && !wn.getSiteNoteLength())"> - Work Order notes exist</span>\r\n                                        <span ng-show="(!wn.getWoNoteLength()  && wn.getSiteNoteLength())"> - Site notes exist</span>\r\n                                        <span ng-show="(wn.getWoNoteLength()  && wn.getSiteNoteLength())"> - Work Order and Site notes exist</span>\r\n                                        <span ng-show="(wn.header != null)"> - {{wn.header}}</span>\r\n                                        <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                    </a>\r\n                                </h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseTwo" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.notesGrid">\r\n                                    <fc-tabs tab="wn.filterTab">\r\n                                        <div fc-tab="Work Order Notes">\r\n                                            <div ng-if="wn.filterTabWindow == false">\r\n                                                <fc-table table-name="Work Order Note"\r\n                                                          custom-api-get-method="wonotes/withquote"\r\n                                                          api-method="wonotes"\r\n                                                          attributes="wn.attributesWoatt"\r\n                                                          on-edit="wn.editWoNote(id, vm.filter.filterId)"\r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          ng-if="wn.reloadTable && !vm.lineItemsConverted"\r\n                                                          delete-event="wn.checkChildItems()"\r\n                                                          compare-diff-color="redItem"\r\n                                                          custom-conditional-class="blueRow"\r\n                                                          conditional-attribute="QuNote"\r\n                                                          evaluate-comparison="vm.isFromQuote"\r\n                                                          delete-message-format="Are you sure you want to delete notes  %Note% ?"\r\n                                                          rows-count="wn.woNotesCount"\r\n                                                          view-name="{{wn.viewName}}"\r\n                                                          module-name="{{wn.moduleName}}">\r\n                                                </fc-table>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div fc-tab="Site Notes">\r\n                                            <fc-table table-name="Site Note"\r\n                                                      api-method="wositenotes"\r\n                                                      attributes="wn.attributesSiatt"\r\n                                                      on-edit="wn.editSiteNote(id, vm.filter1.siteId)"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="wn.reloadTable"\r\n                                                      delete-message-format="Are you sure you want to delete notes  %Note% ?"\r\n                                                      rows-count="wn.siteNotesCount"\r\n                                                      view-name="{{wn.viewName}}"\r\n                                                      module-name="{{wn.moduleName}}">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                    </fc-tabs>\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="WoLaborController as vl">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, vl.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'laborGrid\')">\r\n                                <h4 class="panel-title">\r\n                                    <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseThree" class="collapsed" aria-expanded="false">\r\n                                        Labor\r\n                                        <span ng-show="(vl.header != null)"> - {{vl.header}}</span>\r\n                                        <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                    </a>\r\n                                </h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseThree" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.laborGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content">\r\n                                            <div ng-if="vm.laborIsActive" style="color:red;">*In-Progress labor entries should not be modified</div>\r\n                                            \x3c!-- PBI471 : Service Zone Code to Labor Code Mapping --\x3e\r\n                                            \x3c!-- on-edit="vl.edit(id, vm.filter.filterId, vm.filter1.rateSheetId, vm.filter1.agreementId)" --\x3e\r\n                                            \x3c!-- PBI543 : DSL - Add additional fields to the Work Order and Assignment screens --\x3e\r\n                                            \x3c!-- <fc-table api-method="woLabors" --\x3e\r\n                                            <fc-table api-method="{{vl.apiMethod}}"\r\n                                                      custom-api-get-method="woLabors/withquote"\r\n                                                      attributes="vl.attributes"\r\n                                                      on-edit="vl.edit(id, vm.filter.filterId, vm.filter1.rateSheetId, vm.filter1.agreementId, 0, vm.customer)"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="vl.reloadTable && !vm.lineItemsConverted"\r\n                                                      table-name="Labor"\r\n                                                      delete-event="vl.itemDeleted()"\r\n                                                      delete-message-format="Are you sure you want to delete the labor  %FullName% ?"\r\n                                                      view-name="{{vl.viewName}}"\r\n                                                      module-name="{{vl.moduleName}}"\r\n                                                      compare-diff-color="redItem"\r\n                                                      conditional-attribute="QuoteBillHours"\r\n                                                      custom-conditional-class="blueRow"\r\n                                                      disable-select-row="true"\r\n                                                      evaluate-comparison="vm.isFromQuote">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="PartsController as parts">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, parts.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'partsGrid\')">\r\n                                <h4 class="panel-title">\r\n                                    <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseFour" class="collapsed" aria-expanded="false">\r\n                                        Parts\r\n                                        <span ng-show="(parts.header != null)"> - {{parts.header}}</span>\r\n                                        <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                    </a>\r\n                                </h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseFour" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.partsGrid">\r\n                                    <div class="block-flat">\r\n                                        <div id="partsFilter" class="content">\r\n                                            \x3c!-- US2796 : FCO - Web - Allow parts entry via barcode capture --\x3e\r\n                                            <div class="form-group ">\r\n                                                \x3c!-- BUG705 : FCO - WO Details/Assignment Details page > "Add" button is displaying in Parts section even though “Edit” Permission set in Views --\x3e\r\n                                                \x3c!-- added ng-if --\x3e\r\n                                                <div ng-if="vm.addPart" class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right">\r\n                                                    <button type="submit" class="btn btn-primary" ng-click="parts.scanPart()"><span class="glyphicon glyphicon-barcode"></span></button>\r\n                                                    <button type="submit" class="btn btn-primary" ng-click="parts.editPart(id, vm.filter.filterId)">Add New</button>\r\n                                                </div> \x3c!-- input box --\x3e\r\n                                            </div>\r\n                                            \x3c!-- US2796 : END --\x3e\r\n                                            \x3c!-- PBI543 : DSL - Add additional fields to the Work Order and Assignment screens --\x3e\r\n                                            \x3c!-- <fc-table api-method="parts" --\x3e\r\n                                            <fc-table api-method="{{parts.apiMethod}}"\r\n                                                      custom-api-get-method="parts/withquote"\r\n                                                      attributes="parts.attributes"\r\n                                                      on-edit="parts.editPart(id, vm.filter.filterId)"\r\n                                                      filter="parts.autoFilter"\r\n                                                      table-name="Parts"\r\n                                                      ng-if="parts.reloadTable && !vm.lineItemsConverted"\r\n                                                      delete-event="parts.itemDeleted()"\r\n                                                      delete-message-format="Are you sure you want to delete the Parts  %ItemName% ?"\r\n                                                      view-name="{{parts.viewName}}"\r\n                                                      module-name="{{parts.moduleName}}"\r\n                                                      disable-select-row="true"\r\n                                                      compare-diff-color="redItem"\r\n                                                      conditional-attribute="QuotePrice"\r\n                                                      custom-conditional-class="blueRow"\r\n                                                      evaluate-comparison="vm.isFromQuote"\r\n                                                      show-add-new="false">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="MiscController as misc">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, misc.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'miscGrid\')">\r\n                                <h4 class="panel-title">\r\n                                    <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseFive" class="collapsed" aria-expanded="false">\r\n                                        Miscellaneous\r\n                                        <span ng-show="(misc.header != null)"> - {{misc.header}}</span>\r\n                                        <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                    </a>\r\n                                </h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseFive" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.miscGrid">\r\n                                    <div class="block-flat">\r\n                                        <div id="miscFilter" class="content">\r\n                                            \x3c!-- PBI601 : DSL - Add additional fields to the Miscellaneous screen --\x3e\r\n                                            \x3c!-- <fc-table api-method="miscs" --\x3e\r\n                                            <fc-table api-method="{{misc.apiMethod}}"\r\n                                                      custom-api-get-method="miscs/withquote"\r\n                                                      attributes="misc.attributes"\r\n                                                      on-edit="misc.editMisc(id, vm.filter.filterId)"\r\n                                                      filter="misc.autoFilter"\r\n                                                      table-name="Miscellaneous"\r\n                                                      ng-if="misc.reloadTable && !vm.lineItemsConverted"\r\n                                                      delete-event="misc.itemDeleted()"\r\n                                                      delete-message-format="Are you sure you want to delete the Miscellaneous  %ItemName% ?"\r\n                                                      view-name="{{misc.viewName}}"\r\n                                                      module-name="{{misc.moduleName}}"\r\n                                                      disable-select-row="true"\r\n                                                      compare-diff-color="redItem"\r\n                                                      conditional-attribute="QuotePrice"\r\n                                                      custom-conditional-class="blueRow"\r\n                                                      evaluate-comparison="vm.isFromQuote">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- EPIC981 : FCO - XOi Integration --\x3e\r\n\r\n                    <div ng-controller="WoServiceableItemController as si">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, vm.serviceableItemModuleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'serviceableItemGrid\')">\r\n                                <h4 class="panel-title">\r\n                                    <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseServiceableItem" class="collapsed" aria-expanded="false">\r\n                                        Serviceable Items<i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                    </a>\r\n                                </h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseServiceableItem" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.serviceableItemGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content">\r\n                                            <fc-table api-method="serviceableitems/byWorkOrder"\r\n                                                      attributes="si.gridAttributes"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="vm.reloadSITable"\r\n                                                      table-name="Serviceable Items"\r\n                                                      show-delete-column="false"\r\n                                                      show-add-new="false"></fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="PurchaseController as pc">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, pc.moduleName) !=0" ng-show="vm.poGrid">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'poesGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTen" class="collapsed" aria-expanded="false">Purchase Orders<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseTen" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.poesGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content purchaseBtnHide purchaseDeleteHide" id="PO-table-drill">\r\n                                            <div class="form-group ">\r\n                                                <div ng-if="pc.gui.getVisibility(pc.modulePrivilege, \'Create\')" class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right" ng-init="pc.Altid = vm.model.AltId">\r\n                                                    <button type="submit" class="btn btn-primary" ng-click="pc.createPurchaseRequisition(vm.altId)">Create Purchase Requisition</button>\r\n                                                </div> \x3c!-- input box --\x3e\r\n                                            </div>\r\n                                            <fc-table api-method="purchases/getWithAmount"\r\n                                                      attributes="pc.attributes"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      drilldown="pc.drilldownSettings"\r\n                                                      drilldown-filter="pc.drilldownFilter"\r\n                                                      view-name="{{pc.viewName}}"\r\n                                                      module-name="{{pc.moduleName}}">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    <div ng-controller="WoTaskController as wt">\r\n                        <div class="panel panel-default" ng-show="vm.taskGrid" ng-if="vm.getModulePrivilege(vm.viewName, wt.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'tasksGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseSix" class="collapsed" aria-expanded="false">Tasks<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseSix" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.tasksGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content">\r\n                                            \x3c!-- PBI1044 : FCO - Work Order Tasks --\x3e\r\n                                            <div class="form-group ">\r\n                                                <div ng-if="vm.addTask" class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right customGridButton">\r\n                                                    <button type="submit" class="btn btn-primary" ng-if="vm.model.AgreementId" ng-click="wt.importAgreementTasks(vm.model.Id, vm.model.AgreementId, vm.model.SiteId)">Import Agreement Tasks</span></button>\r\n                                                    <button type="submit" class="btn btn-primary" ng-click="wt.completeAll(vm.model.Id)">Close All</button>\r\n                                                    <button type="submit" class="btn btn-primary" ng-click="wt.editTask(id, vm.model.Id, vm.model.SiteId, false)">Add New</button>\r\n                                                </div>\r\n                                            </div>\r\n                                            <fc-table api-method="wotasks"\r\n                                                      attributes="wt.attributes"\r\n                                                      on-edit="wt.editTask(id, vm.model.Id, vm.model.SiteId, false)"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="wt.reloadTable"\r\n                                                      table-name="Task"\r\n                                                      delete-event="wt.deleteEvent()"\r\n                                                      delete-message-format="Are you sure you want to delete Task %TaskName% ?"\r\n                                                      view-name="{{wt.viewName}}"\r\n                                                      module-name="{{wt.moduleName}}"\r\n                                                      show-add-new="false"\r\n                                                      drilldown-filter="wt.drilldownFilter"\r\n                                                      drilldown="wt.drilldownSettings"\r\n                                                      list="wt.allTasks"></fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="WoFormController as forms">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, forms.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'formsGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseNine" ng-click="vm.reloadForms()" class="collapsed" aria-expanded="false">Forms<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseNine" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div id="woForm" class="panel-body" ng-if="vm.formsGrid">\r\n                                    <div class="block-flat">\r\n                                        <button class="btn pull-right" ng-click="vm.changeForms()">{{vm.btnName}}</button>\r\n                                        <div class="content">\r\n                                            <div ng-init="forms.woId = vm.id"></div>\r\n                                            <div ng-show="vm.woForm">\r\n                                                <div ng-if="vm.filter.filterId">\r\n                                                    <fc-table id="woForms"\r\n                                                              api-method="forms/getforwodetails"\r\n                                                              attributes="forms.attributes"\r\n                                                              filter="vm.filterByWorkOrderForms"\r\n                                                              ng-if="vm.reloadFilter"\r\n                                                              table-name="Forms"\r\n                                                              delete-event="forms.deleteEvent()"\r\n                                                              delete-message-format="Are you sure you want to delete Form %Name% ?"\r\n                                                              view-name="{{forms.viewName}}"\r\n                                                              module-name="{{forms.moduleName}}">\r\n                                                    </fc-table>\r\n                                                </div>\r\n                                            </div>\r\n                                            <div ng-show="!vm.woForm">\r\n                                                <div id="woSiteForm" class="form-group col-lg-9 col-sm-9">\r\n                                                    <fc-table-edit api-method="forms/getforSiteEquipmentDropdown" attributes="vm.attributesSite" model="vm.modelSite"></fc-table-edit>\r\n                                                </div>\r\n                                                <div ng-if="vm.filter.filterId && vm.model.SiteId && vm.modelSite.Id">\r\n                                                    <fc-table id="woForms"\r\n                                                              api-method="forms/getforSiteEquipment"\r\n                                                              attributes="forms.siteAttributes"\r\n                                                              filter="vm.filterSiteForms"\r\n                                                              ng-if="vm.reloadFilter"\r\n                                                              table-name="Forms"\r\n                                                              delete-message-format="Are you sure you want to delete Form %Name% ?"\r\n                                                              view-name="{{forms.viewName}}"\r\n                                                              module-name="{{forms.moduleName}}">\r\n                                                    </fc-table>\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- EPIC1008 : FCO - FCPayments (Company Feature) --\x3e\r\n\r\n                    <div ng-controller="WoPaymentController as pc" ng-if="vm.showWoPayment">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, pc.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'woPaymentGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseWoPayment" class="collapsed" aria-expanded="false">Payment<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseWoPayment" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.woPaymentGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content">\r\n                                            <div class="form-group" style="display: flex;" ng-if="vm.roleUsingPayments">\r\n                                                \x3c!--<img src="./content/img/ccbanner.png" style="padding-left: 11px; width: 288px; height: 36px;"/>--\x3e\r\n                                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right customGridButton">\r\n                                                    <button type="submit" class="btn btn-primary" ng-disabled="pc.transactionCount <= 0" ng-click="pc.updateSettlementStatus()">Update Settlement Status</button>\r\n                                                    <button type="submit" class="btn btn-primary" ng-click="pc.submitTransaction()">Submit Payment</button>\r\n                                                </div>\r\n                                            </div>\r\n                                            <fc-table api-method="fcPayment/transactions"\r\n                                                      attributes="pc.gridAttributes"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="pc.reloadTable"\r\n                                                      show-delete-column=false\r\n                                                      show-add-new=false\r\n                                                      table-name="Payments"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{pc.moduleName}}"\r\n                                                      disable-select-row="true"\r\n                                                      rows-count="pc.transactionCount"\r\n                                                      list="pc.transactionList">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- updated attachements panel --\x3e\r\n\r\n                    <div ng-controller="WoAttachmentController as woatt">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,woatt.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'attachmentsGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseEight" class="collapsed" aria-expanded="false">Attachments<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseEight" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.attachmentsGrid">\r\n                                    <fc-tabs tab="woatt.filterTab">\r\n                                        <div fc-tab="Work Order Attachments">\r\n                                            <fc-table api-method="woattachments"\r\n                                                      attributes="woatt.attributesWoatt"\r\n                                                      on-edit="woatt.editWoAttachment(id, vm.filter.filterId)"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="woatt.reloadTable"\r\n                                                      table-name="Work Order Attachments"\r\n                                                      delete-message-format="Are you sure that you want to delete %AttachmentName%?"\r\n                                                      delete-event="woatt.deleteEvent()"\r\n                                                      view-name="{{woatt.viewName}}"\r\n                                                      module-name="{{woatt.moduleName}}">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                        <div fc-tab="Site Attachments">\r\n                                            <div ng-if="vm.filter1.siteId">\r\n                                                <fc-table api-method="siteattachments"\r\n                                                          attributes="woatt.attributesSiatt"\r\n                                                          on-edit="woatt.editSiteAttachment(id, vm.filter1.siteId)"\r\n                                                          filter="vm.filterBySite"\r\n                                                          ng-if="woatt.reloadTable"\r\n                                                          table-name="Site Attachment"\r\n                                                          delete-message-format="Are you sure that you want to delete %AttachmentName%?"\r\n                                                          view-name="{{woatt.viewName}}"\r\n                                                          module-name="{{woatt.moduleName}}">\r\n                                                </fc-table>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div fc-tab="Quote Attachments" fc-hide="{{vm.hideQuoteAttachments}}">\r\n                                            <fc-table api-method="quoteattachments"\r\n                                                      ng-if="vm.viewQuoteAttachments"\r\n                                                      attributes="woatt.attributesQuoteatt"\r\n                                                      filter="vm.filterByQuote"\r\n                                                      table-name="Quote Attachments"\r\n                                                      view-name="{{woatt.viewName}}"\r\n                                                      module-name="{{woatt.moduleName}}"\r\n                                                      show-delete-column=false\r\n                                                      show-add-new=false>\r\n                                            </fc-table>\r\n                                        </div>\r\n                                        \x3c!-- PBI1091 : FCO - Attach Items to Service Request in Customer Portal --\x3e\r\n                                        <div fc-tab="Service Request Attachments" fc-hide="{{vm.hideServiceRequestAttachments}}">\r\n                                            <fc-table api-method="serviceRequestAttachments"\r\n                                                      ng-if="woatt.reloadTable"\r\n                                                      attributes="woatt.attributesServiceRequestAtt"\r\n                                                      filter="vm.serviceRequestFilter"\r\n                                                      table-name="Service Request Attachments"\r\n                                                      view-name="{{woatt.viewName}}"\r\n                                                      module-name="{{woatt.moduleName}}"\r\n                                                      show-delete-column=false\r\n                                                      show-add-new=false>\r\n                                            </fc-table>\r\n                                        </div>\r\n                                    </fc-tabs>\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- PBI1098 : FCO - Deficiency loop (pull through work) --\x3e\r\n\r\n                    <div ng-if="vm.usingQuoting">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, vm.deficiencyModuleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'deficiencyGrid\')">\r\n                                <h4 class="panel-title">\r\n                                    <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseDeficiency" class="collapsed" aria-expanded="false">\r\n                                        Deficiencies<i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                    </a>\r\n                                </h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseDeficiency" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.deficiencyGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content" ng-controller="WoDeficiencyController as df">\r\n                                            <fc-table-edit api-method="deficiency"\r\n                                                           attributes="df.deficiencyEditAttributes"\r\n                                                           model="df.model"\r\n                                                           view-name="{{vm.viewName}}"\r\n                                                           module-name="{{df.moduleName}}"\r\n                                                           on-submit="df.newSubmit()"\r\n                                                           ng-if="df.showForm"></fc-table-edit>\r\n                                            <hr />\r\n                                            <fc-table api-method="deficiency"\r\n                                                      attributes="df.deficiencyGridAttributes"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="df.tableReload && df.showForm"\r\n                                                      table-name="Deficiencies"\r\n                                                      show-add-new="false"\r\n                                                      on-edit="df.edit(item)"></fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- <div ng-controller="WoServiceReportController as woservrpts"> --\x3e\r\n                    <div>\r\n                        \x3c!-- <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, woservrpts.moduleName) !=0"> --\x3e\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, \'ServiceReports\') !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'servreportGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseSeven" class="collapsed" aria-expanded="false">Service Reports<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseSeven" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.servreportGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content" ng-class="{\'hide-add-new-btn\' : vm.serviceReportCount >= vm.serviceReportMax && vm.customReport}" id="service-report" ng-controller="WoServiceReportController as woservrpts">\r\n                                            \x3c!-- PBI555 : FCO - Carry over customer signature on revised service report - GroundBreakers --\x3e\r\n                                            \x3c!-- <fc-table api-method="woservicereports" --\x3e\r\n                                            <fc-table api-method="{{vm.serviceReportAPI}}"\r\n                                                      attributes="woservrpts.attributes"\r\n                                                      on-edit="woservrpts.editServiceReport(id, vm.filter.filterId, vm.model.QuoteId)"\r\n                                                      filter="vm.filter"\r\n                                                      table-name="ServiceReports"\r\n                                                      ng-if="woservrpts.reloadTable"\r\n                                                      delete-event="woservrpts.deleteEvent()"\r\n                                                      view-name="{{woservrpts.viewName}}"\r\n                                                      module-name="{{woservrpts.moduleName}}"\r\n                                                      delete-message-format="Are you sure you want to delete %FileName%?"\r\n                                                      rows-count="vm.serviceReportCount">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                </div>\x3c!-- accordion --\x3e\r\n            </div> \x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/WorkOrder/ManageWorkOrder/workOrderDetailsReadOnly.html",'<div id="pcont" class="container-fluid" ng-controller="WODetailsReadOnlyController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active"> Work Order Details  </li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Work Order Details</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n\r\n        <div class="row" ng-if="vm.getModulePrivilege(vm.viewName, vm.moduleName) !=0">\r\n            <div class="col-md-6" style="color: #5e94ff">\r\n                <h2>Work Order {{vm.altId}}</h2>\r\n            </div>\r\n        </div>\r\n\r\n        <div ng-class="{\'hideWODetails\':!vm.ShowSubmit}" ng-if="vm.getModulePrivilege(vm.viewName, vm.moduleName) !=0">\r\n            \x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n            <fc-table-edit api-method="{{vm.woAPI}}"\r\n                           timezone="vm.WOdetailsTimezone"\r\n                           id="{{vm.id}}"\r\n                           attributes="vm.attributes"\r\n                           on-back="vm.goBack()"\r\n                           model="vm.model"\r\n                           view-name="{{vm.viewName}}"\r\n                           module-name="{{vm.moduleName}}"\r\n                           ng-if="vm.showForm">\r\n            </fc-table-edit>\r\n            \x3c!--\r\n            <fc-table-edit api-method="wodetails"\r\n                           timezone="vm.WOdetailsTimezone"\r\n                           id="{{vm.id}}"\r\n                           attributes="vm.attributes"\r\n                           on-back="vm.goBack()"\r\n                           model="vm.model"\r\n                           view-name="{{vm.viewName}}"\r\n                           module-name="{{vm.moduleName}}">\r\n            </fc-table-edit>\r\n            --\x3e\r\n            \x3c!-- PBI1015 : FCO - Copy invoiced work orders - GroundBreakers --\x3e\r\n\r\n            <div class="row">\r\n                <div class="col-md-6 pageViewAlign" ng-if="vm.model.Id">\r\n                    <button type="button" data-dismiss="modal" class="btn btn-primary btn-flat md-close" ng-click="vm.copyWO()">Copy</button>\r\n                </div>\r\n            </div>\r\n\r\n            \x3c!-- PBI1015 : FCO - Copy invoiced work orders - GroundBreakers --\x3e\r\n\r\n            <div class="row form-horizontal">\r\n                <div class="col-md-12">\r\n                    <div id="accordionAcceptWO" class="panel-group accordion">\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'assignmentsGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne" aria-expanded="false" class="collapsed">Assignments &nbsp;&nbsp;  Count: {{vm.count}} &nbsp; &nbsp; Estimated hours total: {{vm.estHoursTotal}}<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseOne" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.assignmentsGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content" ng-controller="AssingmentController as va">\r\n                                            \x3c!-- PBI488 : Add Posting Group to Serviceable Item Dropdown on Work Order and Assignment --\x3e\r\n                                            \x3c!--\r\n                                            <fc-table api-method="woassignments"\r\n                                                      attributes="va.attributes"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="va.reloadTable"\r\n                                                      table-name="Assingment"\r\n                                                      rows-count="vm.count"\r\n                                                      on-edit="va.editReadOnly()"\r\n                                                      timezone="va.assignmentsTimezone"\r\n                                                      delete-message-format="Are you sure you want to delete Assingment %Desc% ?">\r\n                                            </fc-table>\r\n                                            --\x3e\r\n                                            <fc-table api-method="{{vm.woAssignmentsAPI}}"\r\n                                                      attributes="va.attributes"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="va.reloadTable"\r\n                                                      table-name="Assingment"\r\n                                                      rows-count="vm.count"\r\n                                                      on-edit="va.editReadOnly()"\r\n                                                      timezone="va.assignmentsTimezone"\r\n                                                      delete-message-format="Are you sure you want to delete Assingment %Desc% ?">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n\r\n                        <div ng-controller="WoNoteController as wn">\r\n                            <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, wn.moduleName) !=0">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'notesGrid\')">\r\n                                    <h4 class="panel-title">\r\n                                        <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo" class="collapsed" aria-expanded="false">\r\n                                            Notes\r\n                                            <span ng-show="(wn.getWoNoteLength() && !wn.getSiteNoteLength())"> - Work Order notes exist</span>\r\n                                            <span ng-show="(!wn.getWoNoteLength()  && wn.getSiteNoteLength())"> - Site notes exist</span>\r\n                                            <span ng-show="(wn.getWoNoteLength()  && wn.getSiteNoteLength())"> - Work Order and Site notes exist</span>\r\n                                            <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                        </a>\r\n                                    </h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseTwo" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div class="panel-body" ng-if="vm.notesGrid">\r\n                                        <fc-tabs tab="wn.filterTab">\r\n                                            <div fc-tab="Work Order Notes">\r\n                                                <div ng-if="wn.filterTabWindow == false">\r\n                                                    <fc-table table-name="Work Order Note"\r\n                                                              api-method="wonotes"\r\n                                                              attributes="wn.attributesWoatt"\r\n                                                              on-edit="wn.editNoteSub()"\r\n                                                              filter="vm.filterByWorkOrder"\r\n                                                              ng-if="wn.reloadTable"\r\n                                                              delete-event="wn.setNotesHeader()"\r\n                                                              delete-message-format="Are you sure you want to delete notes  %Note% ?"\r\n                                                              view-name="{{wn.viewName}}"\r\n                                                              module-name="{{wn.moduleName}}">\r\n                                                    </fc-table>\r\n                                                </div>\r\n                                            </div>\r\n                                            <div fc-tab="Site Notes">\r\n                                                <fc-table table-name="Site Note"\r\n                                                          api-method="wositenotes"\r\n                                                          attributes="wn.attributesSiatt"\r\n                                                          on-edit="wn.editNoteSub()"\r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          ng-if="wn.reloadTable"\r\n                                                          delete-event="wn.setNotesHeader()"\r\n                                                          delete-message-format="Are you sure you want to delete notes  %Note% ?"\r\n                                                          view-name="{{wn.viewName}}"\r\n                                                          module-name="{{wn.moduleName}}">\r\n                                                </fc-table>\r\n                                            </div>\r\n                                        </fc-tabs>\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel default --\x3e\r\n                        </div>\x3c!-- controller --\x3e\r\n\r\n                        <div ng-controller="WoLaborController as vl">\r\n                            <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, vl.moduleName) !=0">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'laborGrid\')">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseThree" class="collapsed" aria-expanded="false">Labor<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseThree" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div class="panel-body" ng-if="vm.laborGrid">\r\n                                        <div class="block-flat">\r\n                                            <div class="content">\r\n                                                <fc-table api-method="woLabors"\r\n                                                          attributes="vl.attributes"\r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          ng-if="vl.reloadTable"\r\n                                                          on-edit="vl.editLaborSub()"\r\n                                                          table-name="Labor"\r\n                                                          delete-message-format="Are you sure you want to delete the labor  %FullName% ?"\r\n                                                          view-name="{{vl.viewName}}"\r\n                                                          module-name="{{vl.moduleName}}">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel default --\x3e\r\n                        </div>\x3c!-- controller --\x3e\r\n\r\n                        <div ng-controller="PartsController as parts">\r\n                            <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, parts.moduleName) !=0">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'partsGrid\')">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseFour" class="collapsed" aria-expanded="false">Parts<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseFour" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div class="panel-body" ng-if="vm.partsGrid">\r\n                                        <div class="block-flat">\r\n                                            <div id="partsFilter" class="content">\r\n                                                <fc-table api-method="parts"\r\n                                                          attributes="parts.attributes"\r\n                                                          filter="parts.autoFilter"\r\n                                                          table-name="Parts"\r\n                                                          on-edit="parts.editPartsSub()"\r\n                                                          ng-if="parts.reloadTable"\r\n                                                          delete-message-format="Are you sure you want to delete the Parts  %ItemName% ?"\r\n                                                          view-name="{{parts.viewName}}"\r\n                                                          module-name="{{parts.moduleName}}">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel default --\x3e\r\n                        </div>\x3c!-- controller --\x3e\r\n\r\n                        <div ng-controller="MiscController as misc">\r\n                            <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, misc.moduleName) !=0">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'miscGrid\')">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseFive" class="collapsed" aria-expanded="false">Miscellaneous<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseFive" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div class="panel-body" ng-if="vm.miscGrid">\r\n                                        <div class="block-flat">\r\n                                            <div id="miscFilter" class="content" ng-controller="MiscController as misc">\r\n                                                <fc-table api-method="miscs"\r\n                                                          attributes="misc.attributes"\r\n                                                          filter="misc.autoFilter"\r\n                                                          table-name="Miscellaneous"\r\n                                                          on-edit="misc.editMiscSub()"\r\n                                                          ng-if="misc.reloadTable"\r\n                                                          delete-message-format="Are you sure you want to delete the Miscellaneous  %ItemName% ?"\r\n                                                          view-name="{{misc.viewName}}"\r\n                                                          module-name="{{misc.moduleName}}">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel default --\x3e\r\n                        </div>\x3c!-- controller --\x3e\r\n                        \x3c!-- EPIC981 : FCO - XOi Integration --\x3e\r\n\r\n                        <div ng-controller="WoServiceableItemController as si">\r\n                            <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, vm.serviceableItemModuleName) !=0">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'serviceableItemGrid\')">\r\n                                    <h4 class="panel-title">\r\n                                        <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseServiceableItem" class="collapsed" aria-expanded="false">\r\n                                            Serviceable Items<i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                        </a>\r\n                                    </h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseServiceableItem" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div class="panel-body" ng-if="vm.serviceableItemGrid">\r\n                                        <div class="block-flat">\r\n                                            <div class="content">\r\n                                                <fc-table api-method="serviceableitems/byWorkOrder"\r\n                                                          attributes="si.gridAttributes"\r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          table-name="Serviceable Items"\r\n                                                          show-delete-column="false"\r\n                                                          show-add-new="false"></fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel default --\x3e\r\n                        </div>\x3c!-- controller --\x3e\r\n\r\n                        <div ng-controller="PurchaseController as pc">\r\n                            <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, pc.moduleName) !=0" ng-show="vm.poGrid && vm.isMain">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'poesGrid\')">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTen" class="collapsed" aria-expanded="false">Purchase Orders<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseTen" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div class="panel-body" ng-if="vm.poesGrid">\r\n                                        <div class="block-flat">\r\n                                            <div class="content purchaseBtnHide purchaseDeleteHide" ng-controller="PurchaseController as pc" id="PO-table-drill">\r\n                                                <div class="form-group ">\r\n                                                    <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right" ng-init="pc.Altid = vm.model.AltId; pc.hide = true;">\r\n                                                        \x3c!--<button type="submit" class="btn btn-primary" ng-click="vm.createPurchaseRequisition(vm.altId)">Create Purchase Requisition</button>--\x3e\r\n                                                    </div> \x3c!-- input box --\x3e\r\n                                                </div>\r\n                                                <fc-table api-method="purchases/getWithAmount"\r\n                                                          attributes="pc.attributes"\r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          drilldown="pc.drilldownSettings"\r\n                                                          drilldown-filter="pc.drilldownFilter"\r\n                                                          view-name="{{pc.viewName}}"\r\n                                                          module-name="{{pc.moduleName}}">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel default --\x3e\r\n                        </div>\x3c!-- controller --\x3e\r\n                        <div ng-controller="WoTaskController as wt">\r\n                            <div class="panel panel-default" ng-show="vm.taskGrid" ng-if="vm.getModulePrivilege(vm.viewName, wt.moduleName) !=0">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'tasksGrid\')">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseSix" class="collapsed" aria-expanded="false">Tasks<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseSix" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div class="panel-body" ng-if="vm.tasksGrid">\r\n                                        <div class="block-flat">\r\n                                            <div class="content">\r\n                                                <fc-table api-method="wotasks"\r\n                                                          attributes="wt.attributes"\r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          ng-if="wt.reloadTable"\r\n                                                          table-name="Task"\r\n                                                          delete-message-format="Are you sure you want to delete Task %TaskName% ?"\r\n                                                          view-name="{{wt.viewName}}"\r\n                                                          module-name="{{wt.moduleName}}">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel default --\x3e\r\n                        </div>\x3c!-- controller --\x3e\r\n                        <div ng-controller="WoFormController as forms">\r\n                            <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, forms.moduleName) !=0">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'formsGrid\')">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseNine" class="collapsed" aria-expanded="false">Forms<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseNine" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div id="woForm" class="panel-body" ng-if="vm.formsGrid">\r\n                                        <div class="block-flat">\r\n                                            <button class="btn pull-right" ng-click="vm.changeForms()">{{vm.btnName}}</button>\r\n                                            <div class="content">\r\n                                                <div ng-init="forms.woId = vm.id"></div>\r\n                                                <div ng-show="vm.woForm">\r\n                                                    <div ng-if="vm.filter.filterId">\r\n                                                        <fc-table id="woForms"\r\n                                                                  api-method="forms/getforwodetails"\r\n                                                                  attributes="forms.attributes"\r\n                                                                  filter="vm.filterByWorkOrder"\r\n                                                                  ng-if="vm.reloadFilter"\r\n                                                                  table-name="Forms"\r\n                                                                  view-name="{{forms.viewName}}"\r\n                                                                  module-name="{{vm.moduleName}}">\r\n                                                        </fc-table>\r\n                                                    </div>\r\n                                                </div>\r\n                                                <div ng-show="!vm.woForm">\r\n                                                    <div id="woSiteForm" class="col-lg-6 col-sm-6">\r\n                                                        <fc-table-edit api-method="forms/getforSiteEquipmentDropdown" attributes="vm.attributesSite" model="vm.modelSite"></fc-table-edit>\r\n\r\n                                                    </div>\r\n                                                    <div ng-if="vm.filter.filterId && vm.model.SiteId && vm.modelSite.Id">\r\n                                                        <fc-table id="woForms"\r\n                                                                  api-method="forms/getforSiteEquipment"\r\n                                                                  attributes="forms.siteAttributes"\r\n                                                                  filter="vm.filterSiteForms"\r\n                                                                  ng-if="vm.reloadFilter"\r\n                                                                  table-name="Forms"\r\n                                                                  view-name="{{forms.viewName}}"\r\n                                                                  module-name="{{vm.moduleName}}">\r\n                                                        </fc-table>\r\n                                                    </div>\r\n                                                </div>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel default --\x3e\r\n                        </div>\x3c!-- controller --\x3e\r\n                        \x3c!-- EPIC1008 : FCO - FCPayments (Company Feature) --\x3e\r\n\r\n                        <div ng-controller="WoPaymentController as pc" ng-if="vm.showWoPayment">\r\n                            <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, pc.moduleName) !=0">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'woPaymentGrid\')">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseWoPayment" class="collapsed" aria-expanded="false">Payment<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseWoPayment" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div class="panel-body" ng-if="vm.woPaymentGrid">\r\n                                        <div class="block-flat">\r\n                                            <div class="content">\r\n                                                <fc-table api-method="fcPayment/transactions"\r\n                                                          attributes="pc.gridAttributes"\r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          ng-if="pc.reloadTable"\r\n                                                          show-delete-column=false\r\n                                                          show-add-new=false\r\n                                                          table-name="Payments"\r\n                                                          view-name="{{vm.viewName}}"\r\n                                                          module-name="{{pc.moduleName}}"\r\n                                                          disable-select-row="true"\r\n                                                          rows-count="pc.transactionCount"\r\n                                                          list="pc.transactionList">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel default --\x3e\r\n                        </div>\x3c!-- controller --\x3e\r\n\r\n                        <div ng-controller="WoAttachmentController as woatt">\r\n                            <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,woatt.moduleName) !=0">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'attachmentsGrid\')">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseEight" class="collapsed" aria-expanded="false">Attachments<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseEight" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div class="panel-body" ng-if="vm.attachmentsGrid">\r\n                                        <fc-tabs tab="woatt.filterTab">\r\n                                            <div fc-tab="Work Order">\r\n                                                <fc-table api-method="woattachments"\r\n                                                          attributes="woatt.attributesWoatt"\r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          ng-if="woatt.reloadTable"\r\n                                                          table-name="Work Order Attachments"\r\n                                                          view-name="{{woatt.viewName}}"\r\n                                                          module-name="{{woatt.moduleName}}"\r\n                                                          show-delete-column=false\r\n                                                          show-add-new=false>\r\n                                                </fc-table>\r\n                                            </div>\r\n                                            <div fc-tab="Site">\r\n                                                <div ng-if="vm.filter1.siteId">\r\n                                                    <fc-table api-method="siteattachments"\r\n                                                              attributes="woatt.attributesSiatt"\r\n                                                              filter="vm.filterBySite"\r\n                                                              ng-if="woatt.reloadTable"\r\n                                                              table-name="Site Attachment"\r\n                                                              view-name="{{woatt.viewName}}"\r\n                                                              module-name="{{woatt.moduleName}}"\r\n                                                              show-delete-column=false\r\n                                                              show-add-new=false>\r\n                                                    </fc-table>\r\n                                                </div>\r\n                                            </div>\r\n                                            <div fc-tab="Quote" fc-hide="{{vm.hideQuoteAttachments}}">\r\n                                                <fc-table api-method="quoteattachments"\r\n                                                          attributes="woatt.attributesQuoteatt"\r\n                                                          filter="vm.filterByQuote"\r\n                                                          table-name="Quote Attachments"\r\n                                                          view-name="{{woatt.viewName}}"\r\n                                                          module-name="{{woatt.moduleName}}"\r\n                                                          show-delete-column=false\r\n                                                          show-add-new=false>\r\n                                                </fc-table>\r\n                                            </div>\r\n                                            \x3c!-- PBI1091 : FCO - Attach Items to Service Request in Customer Portal --\x3e\r\n                                            <div fc-tab="Service Request" fc-hide="{{vm.hideServiceRequestAttachments}}">\r\n                                                <fc-table api-method="serviceRequestAttachments"\r\n                                                          ng-if="woatt.reloadTable"\r\n                                                          attributes="woatt.attributesServiceRequestAtt"\r\n                                                          filter="vm.serviceRequestFilter"\r\n                                                          table-name="Service Request Attachments"\r\n                                                          view-name="{{woatt.viewName}}"\r\n                                                          module-name="{{woatt.moduleName}}"\r\n                                                          show-delete-column=false\r\n                                                          show-add-new=false>\r\n                                                </fc-table>\r\n                                            </div>\r\n                                        </fc-tabs>\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel default --\x3e\r\n                        </div>\x3c!-- controller --\x3e\r\n                        \x3c!-- PBI1098 : FCO - Deficiency loop (pull through work) --\x3e\r\n\r\n                        <div ng-if="vm.usingQuoting">\r\n                            <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, vm.deficiencyModuleName) !=0">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'deficiencyGrid\')">\r\n                                    <h4 class="panel-title">\r\n                                        <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseDeficiency" class="collapsed" aria-expanded="false">\r\n                                            Deficiencies<i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                        </a>\r\n                                    </h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseDeficiency" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div class="panel-body" ng-if="vm.deficiencyGrid">\r\n                                        <div class="block-flat">\r\n                                            <div class="content" ng-controller="WoDeficiencyController as df">\r\n                                                <fc-table api-method="deficiency"\r\n                                                          attributes="df.deficiencyGridAttributes"\r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          ng-if="df.tableReload && df.showForm"\r\n                                                          table-name="Deficiencies"\r\n                                                          show-add-new="false"\r\n                                                          show-delete-column="false"></fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel default --\x3e\r\n                        </div>\x3c!-- controller --\x3e\r\n\r\n                        <div ng-controller="WoServiceReportController as woservrpts">\r\n                            <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, woservrpts.moduleName) !=0">\r\n                                <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'servreportGrid\')">\r\n                                    <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseSeven" class="collapsed" aria-expanded="false">Service Reports<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                                </div>\x3c!-- panel heading --\x3e\r\n                                <div id="collapseSeven" class="panel-collapse collapse" aria-expanded="false">\r\n                                    <div class="panel-body" ng-if="vm.servreportGrid">\r\n                                        <div class="block-flat">\r\n                                            <div class="content" ng-controller="WoServiceReportController as woservrpts">\r\n                                                \x3c!-- PBI555 : FCO - Carry over customer signature on revised service report - GroundBreakers --\x3e\r\n                                                \x3c!-- <fc-table api-method="woservicereports" --\x3e\r\n                                                <fc-table api-method="{{vm.serviceReportAPI}}"\r\n                                                          attributes="woservrpts.attributes"\r\n                                                          filter="vm.filter"\r\n                                                          table-name="ServiceReports"\r\n                                                          ng-if="woservrpts.reloadTable"\r\n                                                          view-name="{{woservrpts.viewName}}"\r\n                                                          module-name="{{woservrpts.moduleName}}"\r\n                                                          disable-custom-button="true">\r\n                                                </fc-table>\r\n                                            </div>\x3c!-- content --\x3e\r\n                                        </div>\x3c!-- block-flat --\x3e\r\n                                    </div>\x3c!-- panel body --\x3e\r\n                                </div>\x3c!-- panel colapse --\x3e\r\n                            </div>\x3c!-- panel default --\x3e\r\n                        </div>\x3c!-- controller --\x3e\r\n                    </div>\x3c!-- accordion --\x3e\r\n                </div>\x3c!-- columns --\x3e\r\n            </div>\x3c!-- row --\x3e\r\n        </div>\r\n    </div>\r\n</div>'),e.put("Templates/WorkOrder/MyWorkOrder/assignmentDetails.html",'<div id="pcont" class="container-fluid" ng-controller="AssignmentDetailsEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li ng-if="!vm.fromDispatch"><a class="cursor_pointer" ng-click="vm.$state.go(\'myWorkOrders\')">My Assignments</a></li>\r\n            <li ng-if="vm.fromDispatch"><a class="cursor_pointer" ng-click="vm.$state.go(\'dispatchCalendar\')">Dispatch Calendar</a></li>\r\n            <li class="active"> Assignment Details  </li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Assignment Details</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        \x3c!-- LOADING SPINNER --\x3e\r\n        <div ng-hide="!vm.isLoading" class="table-edit-overlay">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        <div class="row form-horizontal">\r\n            <div class="col-md-12">\r\n                <div id="accordion" class="panel-group accordion">\r\n                    <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,vm.moduleName) !=0">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'woHeader\')">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseWO" class="collapsed" aria-expanded="false">Work Order<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseWO" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.woHeader">\r\n                                <div id="assignment-wo">\r\n                                    \x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n                                    <fc-table-edit api-method="{{vm.woAPI}}"\r\n                                                   id="{{vm.id}}"\r\n                                                   timezone="vm.woTimezone"\r\n                                                   attributes="vm.attributes"\r\n                                                   on-submit="vm.editWorkorder()"\r\n                                                   hide-submit="vm.showOpenWorkOrder"\r\n                                                   model="vm.model"\r\n                                                   view-name="{{vm.viewName}}"\r\n                                                   module-name="{{vm.moduleName}}"\r\n                                                   ng-if="vm.showForm">\r\n                                    </fc-table-edit>\r\n                                    \x3c!-- PBI802 : FCO - Link to the Work order detail from the Assignment details WO header section- FC --\x3e\r\n                                    <div class="col-sm-offset-6 col-sm-6 col-md-6" style="margin-top: -14px;" ng-if="vm.showOpenWorkOrder">\r\n                                        <div class="form-group">\r\n                                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-3 col-sm-9 col-md-8 col-lg-7 text-right" ">\r\n                                                <button type="button" class="btn btn-primary" ng-click="vm.openWorkOrder()">Open Work Order</button>\r\n                                                <button type="submit" class="btn btn-primary" ng-click="vm.editWorkorder()">Submit</button>\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\r\n                                    \x3c!-- PBI802 : END --\x3e\r\n                                    \x3c!--\r\n                                    <fc-table-edit api-method="wodetails"\r\n                                                   id="{{vm.id}}"\r\n                                                   timezone="vm.woTimezone"\r\n                                                   attributes="vm.attributes"\r\n                                                   on-submit="vm.editWorkorder()"\r\n                                                   model="vm.model"\r\n                                                   view-name="{{vm.viewName}}"\r\n                                                   module-name="{{vm.moduleName}}">\r\n                                    </fc-table-edit>\r\n                                    --\x3e\r\n                                </div>\x3c!-- content --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel collapse --\x3e\r\n                    </div>\x3c!-- panel default --\x3e\r\n\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'assignmentsGrid\')">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseAD" class="collapsed" aria-expanded="false">Assignment<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseAD" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.assignmentsGrid">\r\n                                <div class="block-flat">\r\n                                    <div id="assignment-wo" ng-if="vm.refresh">\r\n                                        <fc-table-edit api-method="woassignments"\r\n                                                       timezone="vm.assignmnentTimezone"\r\n                                                       id="{{vm.assid}}"\r\n                                                       on-back="vm.editAssignment(insertData)"\r\n                                                       attributes="vm.assignmentatt"\r\n                                                       model="vm.model1"\r\n                                                       on-submit="vm.update()"></fc-table-edit>\r\n                                    </div>\r\n                                </div>\x3c!-- block-flat --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel default --\x3e\r\n\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#StatusAccordion" data-target="#collapseStatus" class="collapsed" aria-expanded="false">Status<span> - {{vm.modelStatus.Status}}</span><i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseStatus" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body">\r\n                                <div id="assignment-status" ng-if="vm.refresh">\r\n                                    <div style="color:red;">{{vm.isActiveStatusMessage}}</div>\r\n                                    <fc-table-edit api-method="woassignments/status" id="{{vm.assid}}" on-submit="vm.editAssignmentStatus()" attributes="vm.assignmentStatus" model="vm.modelStatus"></fc-table-edit>\r\n                                </div>\x3c!-- content --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel default --\x3e\r\n\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'assignmentsGrid\')">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseEleven" class="collapsed" aria-expanded="false">WO Assignments  &nbsp;&nbsp;  Count: {{vm.count}} &nbsp; &nbsp; Estimated hours total: {{vm.estHoursTotal}}<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseEleven" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.assignmentsGrid">\r\n                                <div class="block-flat">\r\n                                    \x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n                                    \x3c!-- limit work order to a single assignment --\x3e\r\n                                    \x3c!-- show-add-new="!vm.hideAddButton" --\x3e\r\n                                    <div class="content" ng-controller="MyAssingmentController as va">\r\n                                        \x3c!-- PBI488 : Add Posting Group to Serviceable Item Dropdown on Work Order and Assignment --\x3e\r\n                                        <fc-table api-method="woassignments"\r\n                                                  attributes="va.attributes"\r\n                                                  on-edit="va.editAssignment(id, vm.filter.filterId, vm.site.siteId, item)"\r\n                                                  filter="vm.filterOnlyByWorkOrder"\r\n                                                  ng-if="va.reloadTable"\r\n                                                  table-name="Assingment"\r\n                                                  timezone="va.assignmentsTimezone"\r\n                                                  custome-delete="va.deleteiscurrenttech(item)"\r\n                                                  delete-message-format="Are you sure you want to delete Assingment %Desc% ?"\r\n                                                  rows-count="vm.countAssignments"\r\n                                                  show-delete-column="vm.countAssignments > 1"\r\n                                                  show-add-new="!vm.hideAddButton"></fc-table>\r\n                                    </div>\x3c!-- content --\x3e\r\n                                </div>\x3c!-- block-flat --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel default --\x3e\r\n                    <div ng-controller="WoNoteController as wn">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,wn.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'notesGrid\')">\r\n                                <h4 class="panel-title">\r\n                                    <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseFour" class="collapsed" aria-expanded="false">\r\n                                        Notes\r\n                                        <span ng-show="(vm.countWoNotes != 0 && vm.countSiteNotes==0)"> - Work Order notes exist</span>\r\n                                        <span ng-show="(vm.countWoNotes == 0  && vm.countSiteNotes!=0)"> - Site notes exist</span>\r\n                                        <span ng-show="(vm.countWoNotes != 0  && vm.countSiteNotes!=0)"> - Work Order and Site notes exist</span>\r\n                                        <i class="fa fa-chevron-circle-right pull-right"></i>\r\n                                    </a>\r\n\r\n                                </h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseFour" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.notesGrid">\r\n                                    <fc-tabs tab="wn.filterTab">\r\n                                        <div fc-tab="Work Order Notes">\r\n                                            <div ng-if="wn.filterTabWindow == false">\r\n                                                <fc-table table-name="Work Order Note"\r\n                                                          api-method="wonotes"\r\n                                                          attributes="wn.attributesWoatt"\r\n                                                          on-edit="wn.editWoNote(id, vm.filter.filterId)"\r\n                                                          filter="vm.filterOnlyByWorkOrder"\r\n                                                          ng-if="wn.reloadTable && vm.reloadNoteTable"\r\n                                                          delete-event="wn.setNotesHeader()"\r\n                                                          delete-message-format="Are you sure you want to delete notes  %Note% ?"\r\n                                                          rows-count="vm.countWoNotes"\r\n                                                          view-name="{{vm.viewName}}"\r\n                                                          module-name="{{wn.moduleName}}">\r\n                                                </fc-table>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div fc-tab="Site Notes">\r\n                                            <fc-table table-name="Site Note"\r\n                                                      api-method="wositenotes"\r\n                                                      attributes="wn.attributesSiatt"\r\n                                                      on-edit="wn.editSiteNote(id, vm.filter1.siteId)"\r\n                                                      filter="vm.filterOnlyByWorkOrder"\r\n                                                      ng-if="wn.reloadTable && vm.reloadNoteTable"\r\n                                                      delete-event="wn.setNotesHeader()"\r\n                                                      delete-message-format="Are you sure you want to delete notes  %Note% ?"\r\n                                                      rows-count="vm.countSiteNotes"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{wn.moduleName}}">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                    </fc-tabs>\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- EPIC981 : FCO - XOi Integration --\x3e\r\n\r\n                    <div class="panel panel-default" ng-show="vm.usingXOiIntegration" ng-if="vm.getModulePrivilege(vm.viewName, vm.xoiModuleName) !=0">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'xoiGrid\')">\r\n                            <h4 class="panel-title">\r\n                                <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseXOi" class="collapsed" aria-expanded="false">\r\n                                    XOi Integration\r\n                                    <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                </a>\r\n                            </h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseXOi" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.xoiGrid">\r\n                                <div class="content">\r\n                                    <fc-table-edit attributes="vm.deeplinksAttributes"\r\n                                                   hide-submit="true"\r\n                                                   hide-cancel="true"\r\n                                                   ng-if="vm.showDeepLinks"></fc-table-edit>\r\n                                </div>\x3c!-- content --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel default --\x3e\r\n                    \x3c!-- EPIC981 : FCO - XOi Integration --\x3e\r\n\r\n                    <div ng-controller="WoLaborController as vl">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, vl.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'laborGrid\')">\r\n                                <h4 class="panel-title">\r\n                                    <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseFive" class="collapsed" aria-expanded="false">\r\n                                        Labor\r\n                                        <span id="clock" ng-if="vm.serviceButton && vm.isTechnician">\r\n                                            &nbsp;&nbsp;{{timer}}\r\n                                            <i id="container-ping" style="margin-left: 5px;"><i class="dot" style="top: -15px; left: -17px;"></i><i class="pulse"></i></i>\r\n                                        </span>\r\n                                        <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                    </a>\r\n                                </h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseFive" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.laborGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content">\r\n                                            <div class="form-group">\r\n                                                <div style="color:red;">{{vm.isActiveLaborMessage}}</div>\r\n                                                <div ng-if="vm.addLabor" class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right">\r\n                                                    <buttton id="serviceButtonStart" ng-hide="vm.serviceButton" ng-if="vm.isTechnician" class="col-sm-offset-3 cursor_pointer btn" ng-class="{ \'disabled\': vm.disableServiceButton}" ng-click="vm.startTimer(null, 1)">\r\n                                                        <i class="fa fa-wrench" style="color:gray" aria-hidden="true"></i>Time\r\n                                                    </buttton>\r\n                                                    <buttton id="serviceButtonStop" ng-show="vm.serviceButton" ng-if="vm.isTechnician" class="col-sm-offset-3 cursor_pointer btn" ng-click="vm.stopTimer()">\r\n                                                        <i class="fa fa-pause" style="color:gray" aria-hidden="true"></i>Time\r\n                                                    </buttton>\r\n                                                    <button type="submit" class="col-sm-offset-3 btn btn-primary"\r\n                                                            ng-click="vl.edit(id, vm.filter.filterId, vm.filter1.rateSheetId, vm.filter3.filterAltId, 0, vm.customer)">\r\n                                                        Add New\r\n                                                    </button>\r\n                                                </div>\r\n                                            </div>\r\n                                            \x3c!-- PBI471 : Service Zone Code to Labor Code Mapping --\x3e\r\n                                            \x3c!-- on-edit="vl.edit(id, vm.filter.filterId, vm.filter1.rateSheetId, vm.filter3.filterAltId)" --\x3e\r\n                                            \x3c!-- PBI543 : DSL - Add additional fields to the Work Order and Assignment screens --\x3e\r\n                                            \x3c!-- <fc-table api-method="woLabors" --\x3e\r\n                                            <fc-table api-method="{{vl.apiMethod}}"\r\n                                                      attributes="vl.attributes"\r\n                                                      on-edit="vl.edit(id, vm.filter.filterId, vm.filter1.rateSheetId, vm.filter3.filterAltId, 0, vm.customer)"\r\n                                                      filter="vm.filterOnlyByWorkOrder"\r\n                                                      ng-if="vl.reloadTable"\r\n                                                      show-delete-column="vm.laborDeleteButton"\r\n                                                      table-name="Labor"\r\n                                                      delete-message-format="Are you sure you want to delete the labor  %FullName% ?"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{vl.moduleName}}"\r\n                                                      show-add-new="false">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="PartsController as parts">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, parts.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'partsGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseSix" class="collapsed" aria-expanded="false">Parts<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseSix" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.partsGrid">\r\n                                    <div class="block-flat">\r\n                                        \x3c!-- --\x3e\r\n                                        <div id="divPartsScan" class="content" ng-controller="PartsScanController as partsScan" ng-if="vm.showScannerPanel">\r\n                                            <fc-table-edit api-method="items"\r\n                                                           attributes="partsScan.attributes"\r\n                                                           model="partsScan.model"\r\n                                                           view-name="{{vm.viewName}}"\r\n                                                           module-name="{{partsScan.moduleName}}"\r\n                                                           on-submit="partsScan.submit()"\r\n                                                           ng-if="partsScan.showForm"\r\n                                                           hide-cancel="true"\r\n                                                           hide-submit="true"></fc-table-edit>\r\n                                        </div>\r\n                                        <div id="partsFilter" class="content">\r\n                                            \x3c!-- US2796 : FCO - Web - Allow parts entry via barcode capture --\x3e\r\n                                            <div class="form-group ">\r\n                                                \x3c!-- BUG705 : FCO - WO Details/Assignment Details page > "Add" button is displaying in Parts section even though “Edit” Permission set in Views --\x3e\r\n                                                \x3c!-- added ng-if --\x3e\r\n                                                <div ng-if="vm.addPart" class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right">\r\n                                                    <button type="submit" class="btn btn-primary" ng-click="parts.scanPart()"><span class="glyphicon glyphicon-barcode"></span></button>\r\n                                                    <button type="submit" class="btn btn-primary" ng-click="parts.editPart(id, vm.filter.filterId)">Add New</button>\r\n                                                </div> \x3c!-- input box --\x3e\r\n                                            </div>\r\n                                            \x3c!-- US2796 : END --\x3e\r\n                                            \x3c!-- PBI543 : DSL - Add additional fields to the Work Order and Assignment screens --\x3e\r\n                                            \x3c!-- <fc-table api-method="parts" --\x3e\r\n                                            <fc-table api-method="{{parts.apiMethod}}"\r\n                                                      attributes="parts.attributes"\r\n                                                      on-edit="parts.editPart(id, vm.filter.filterId)"\r\n                                                      filter="parts.autoFilter"\r\n                                                      table-name="Parts"\r\n                                                      ng-if="parts.reloadTable && vm.reloadPartsTable"\r\n                                                      delete-message-format="Are you sure you want to delete the Parts  %ItemName% ?"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{parts.moduleName}}"\r\n                                                      show-add-new="false">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="MiscController as misc">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,misc.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'miscGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseSeven" class="collapsed" aria-expanded="false">Miscellaneous<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseSeven" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.miscGrid">\r\n                                    <div class="block-flat">\r\n                                        <div id="miscFilter" class="content">\r\n                                            \x3c!-- PBI601 : DSL - Add additional fields to the Miscellaneous screen --\x3e\r\n                                            \x3c!-- <fc-table api-method="miscs" --\x3e\r\n                                            <fc-table api-method="{{misc.apiMethod}}"\r\n                                                      attributes="misc.attributes"\r\n                                                      on-edit="misc.editMisc(id, vm.filter.filterId)"\r\n                                                      filter="misc.autoFilter"\r\n                                                      table-name="Miscellaneous"\r\n                                                      ng-if="misc.reloadTable"\r\n                                                      delete-message-format="Are you sure you want to delete the Miscellaneous  %ItemName% ?"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{misc.moduleName}}">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- EPIC981 : FCO - XOi Integration --\x3e\r\n\r\n                    <div>\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, vm.serviceableItemModuleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'woServiceableItemPanel\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseServiceableItem" class="collapsed" aria-expanded="false">Serviceable Item<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseServiceableItem" class="panel-collapse collapse" aria-expanded="false" ng-controller="WoServiceableItemController as si">\r\n                                <div class="panel-body" ng-if="vm.woServiceableItemPanel">\r\n                                    \x3c!-- <div class="block-flat"> --\x3e\r\n                                    <div class="form-group" style="padding-top: 2px !important;" ng-if="vm.getObjectPrivilege(si.advancedButtonObjectName) != 0">\r\n                                        <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right">\r\n                                            <button type="submit" class="btn btn-primary" ng-click="si.showAdvanced(item)">Advanced</button>\r\n                                        </div>\r\n                                    </div>\r\n                                    <hr style="border-top: 1px solid #f1f1f1; margin-top: 0px !important;" />\r\n                                    <div class="content" ng-if="si.tableReload">\r\n                                        <fc-table-edit api-method="serviceableitems"\r\n                                                       id="{{vm.assignment.ServiceableItemId}}"\r\n                                                       attributes="si.attributes"\r\n                                                       model="si.model"\r\n                                                       view-name="{{vm.viewName}}"\r\n                                                       module-name="{{vm.moduleName}}"\r\n                                                       hide-submit="true"\r\n                                                       hide-cancel="true"\r\n                                                       ng-if="vm.assignment.ServiceableItemId"></fc-table-edit>\r\n                                        <fc-tabs ng-if="vm.assignment.ServiceableItemId">\r\n                                            <div fc-tab="Serviceable Item Notes" id="hidesearch">\r\n                                                <fc-table table-name="ServiceableItemNotes"\r\n                                                          api-method="serviceableitemnotes"\r\n                                                          attributes="si.attributesNote"\r\n                                                          on-edit="si.editNote(id)"\r\n                                                          filter="vm.serviceableItemIdFilter"\r\n                                                          ng-if="si.reloadNoteTable"></fc-table>\r\n                                            </div>\r\n\r\n                                            <div fc-tab="Serviceable Item Attachments" id="hidesearch1">\r\n                                                <fc-table table-name="ServiceableItemAttachments"\r\n                                                          api-method="serviceableitemattachments"\r\n                                                          attributes="si.attributesAttachment"\r\n                                                          on-edit="si.editAttachment(id)"\r\n                                                          ng-if="si.reloadAttachmentTable"\r\n                                                          show-search="false"\r\n                                                          filter="vm.serviceableItemIdFilter"\r\n                                                          delete-message-format="Are you sure that you want to delete %AttachmentName%?"></fc-table>\r\n                                            </div>\r\n                                        </fc-tabs>\r\n                                    </div>\x3c!-- content --\x3e\r\n                                    \x3c!-- </div> --\x3e\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="PurchaseController as pc">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,pc.moduleName) !=0" ng-show="vm.poGrid">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'poesGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseThirteen" class="collapsed" aria-expanded="false">Purchase Orders<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseThirteen" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.poesGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content purchaseBtnHide purchaseDeleteHide" ng-controller="PurchaseController as pc" id="PO-table-drill">\r\n                                            <div class="form-group ">\r\n                                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right" ng-init="pc.Altid = vm.model.AltId; pc.assignemt = true;">\r\n                                                    <button type="submit" class="btn btn-primary" ng-click="pc.createPurchaseRequisition(vm.altId)">Create Purchase Requisition</button>\r\n                                                </div> \x3c!-- input box --\x3e\r\n                                            </div>\r\n                                            <fc-table api-method="purchases/getWithAmount"\r\n                                                      attributes="pc.attributes"\r\n                                                      filter="vm.filterOnlyByWorkOrder"\r\n                                                      drilldown="pc.drilldownSettings"\r\n                                                      drilldown-filter="pc.drilldownFilter"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{pc.moduleName}}">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    <div ng-controller="WoTaskController as wt">\r\n                        <div class="panel panel-default" ng-show="vm.taskGrid" ng-if="vm.getModulePrivilege(vm.viewName,wt.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'tasksGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseEight" class="collapsed" aria-expanded="false">Tasks<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseEight" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.tasksGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content">\r\n                                            \x3c!-- PBI1044 : FCO - Work Order Tasks --\x3e\r\n                                            <div class="form-group ">\r\n                                                <div ng-if="vm.addTask" class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right customGridButton">\r\n                                                    <button type="submit" class="btn btn-primary" ng-if="vm.model.AgreementId" ng-click="wt.importAgreementTasks(vm.model.Id, vm.model.AgreementId, vm.model.SiteId)">Import Agreement Tasks</span></button>\r\n                                                    <button type="submit" class="btn btn-primary" ng-click="wt.completeAll(vm.model.Id)">Close All</button>\r\n                                                    <button type="submit" class="btn btn-primary" ng-click="wt.editTask(id, vm.model.Id, vm.model.SiteId, false)">Add New</button>\r\n                                                </div>\r\n                                            </div>\r\n                                            <fc-table api-method="wotasks"\r\n                                                      attributes="wt.attributes"\r\n                                                      on-edit="wt.editTask(id, vm.model.Id, vm.model.SiteId, false)"\r\n                                                      filter="vm.filterOnlyByWorkOrder"\r\n                                                      ng-if="wt.reloadTable"\r\n                                                      table-name="Task"\r\n                                                      delete-message-format="Are you sure you want to delete Task %TaskName% ?"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{wt.moduleName}}"\r\n                                                      show-add-new="false"\r\n                                                      drilldown-filter="wt.drilldownFilter"\r\n                                                      drilldown="wt.drilldownSettings"\r\n                                                      list="wt.allTasks"></fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- US2819 : FCO - Web - Bundles --\x3e\r\n                    <div ng-controller="WoBundleController as bundle">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, bundle.moduleName) !=0 && vm.showBundles">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'bundleGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseBundle" class="collapsed" aria-expanded="false">Bundles<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseBundle" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.bundleGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content">\r\n                                            <fc-table api-method="bundle/woGrid"\r\n                                                      attributes="bundle.gridAttributes"\r\n                                                      filter="vm.filterBundles"\r\n                                                      ng-if="bundle.reloadTable"\r\n                                                      show-delete-column=false\r\n                                                      show-add-new=false\r\n                                                      table-name="Bundles"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{bundle.moduleName}}">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- US2819 : FCO - Web - Bundles --\x3e\r\n\r\n                    <div ng-controller="WoFormController as forms">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,forms.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'formsGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwelve" class="collapsed" aria-expanded="false">Forms<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseTwelve" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div id="woForm" class="panel-body" ng-if="vm.formsGrid">\r\n                                    <div class="block-flat">\r\n                                        <button class="btn pull-right" ng-click="vm.changeForms()">{{vm.btnName}}</button>\r\n                                        <div class="content">\r\n                                            <div ng-init="forms.woId = vm.id"></div>\r\n                                            <div ng-show="vm.woForm">\r\n                                                <fc-table id="woForms"\r\n                                                          api-method="forms/getformyassignment"\r\n                                                          attributes="forms.attributes"\r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          ng-if="vm.reloadFilter"\r\n                                                          table-name="Forms"\r\n                                                          delete-message-format="Are you sure you want to delete Form %Name% ?"\r\n                                                          view-name="{{vm.viewName}}"\r\n                                                          module-name="{{form.moduleName}}">\r\n                                                </fc-table>\r\n                                            </div>\r\n                                            <div ng-show="!vm.woForm">\r\n                                                <div id="woSiteForm" class="col-lg-6 col-sm-6">\r\n                                                    <fc-table-edit api-method="forms/getforSiteEquipmentDropdown" attributes="vm.attributesSite" model="vm.modelSite"></fc-table-edit>\r\n                                                </div>\r\n                                                <fc-table id="woForms"\r\n                                                          api-method="forms/getAssignmentforSiteEquipment"\r\n                                                          attributes="forms.siteAttributes"\r\n                                                          filter="vm.filterSiteForms"\r\n                                                          ng-if="vm.reloadFilter"\r\n                                                          table-name="Forms"\r\n                                                          delete-message-format="Are you sure you want to delete Form %Name% ?"\r\n                                                          view-name="{{vm.viewName}}"\r\n                                                          module-name="{{form.moduleName}}">\r\n                                                </fc-table>\r\n                                            </div>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- EPIC1008 : FCO - FCPayments (Company Feature) --\x3e\r\n\r\n                    <div ng-controller="WoPaymentController as pc" ng-if="vm.showWoPayment">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, pc.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'woPaymentGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseWoPayment" class="collapsed" aria-expanded="false">Payment<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseWoPayment" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.woPaymentGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content">\r\n                                            <div class="form-group" style="display: flex;">\r\n                                                \x3c!--<img src="./content/img/ccbanner.png" style="padding-left: 11px; width: 288px; height: 36px;"/>--\x3e\r\n                                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right customGridButton">\r\n                                                    <button type="submit" class="btn btn-primary" ng-disabled="pc.transactionCount <= 0" ng-click="pc.updateSettlementStatus()">Update Settlement Status</button>\r\n                                                    <button type="submit" class="btn btn-primary" ng-click="pc.submitTransaction()">Submit Payment</button>\r\n                                                </div>\r\n                                            </div>\r\n                                            <fc-table api-method="fcPayment/transactions"\r\n                                                      attributes="pc.gridAttributes"\r\n                                                      filter="vm.filterOnlyByWorkOrder"\r\n                                                      ng-if="pc.reloadTable"\r\n                                                      show-delete-column=false\r\n                                                      show-add-new=false\r\n                                                      table-name="Payments"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{pc.moduleName}}"\r\n                                                      disable-select-row="true"\r\n                                                      rows-count="pc.transactionCount"\r\n                                                      list="pc.transactionList">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- updated attachements panel --\x3e\r\n\r\n                    <div ng-controller="WoAttachmentController as woatt">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,woatt.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'attachmentsGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTen" class="collapsed" aria-expanded="false">Attachments<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseTen" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.attachmentsGrid">\r\n                                    <fc-tabs tab="woatt.filterTab">\r\n                                        <div fc-tab="Work Order Attachments">\r\n                                            <fc-table api-method="woattachments"\r\n                                                      attributes="woatt.attributesWoatt"\r\n                                                      on-edit="woatt.editWoAttachment(id, vm.filter.filterId)"\r\n                                                      filter="vm.filterOnlyByWorkOrder"\r\n                                                      ng-if="woatt.reloadTable"\r\n                                                      table-name="Work Order Attachments"\r\n                                                      delete-message-format="Are you sure that you want to delete %AttachmentName%?"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{woatt.moduleName}}">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                        <div fc-tab="Site Attachments">\r\n                                            <fc-table api-method="siteattachments"\r\n                                                      attributes="woatt.attributesSiatt"\r\n                                                      on-edit="woatt.editSiteAttachment(id, vm.filter1.siteId)"\r\n                                                      filter="vm.filterBySite"\r\n                                                      ng-if="woatt.reloadTable"\r\n                                                      table-name="Site Attachment"\r\n                                                      delete-message-format="Are you sure that you want to delete %AttachmentName%?"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{woatt.moduleName}}">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                        <div fc-tab="Quote Attachments" fc-hide="{{vm.hideQuoteAttachments}}">\r\n                                            <fc-table api-method="quoteattachments"\r\n                                                      attributes="woatt.attributesQuoteatt"\r\n                                                      filter="vm.filterByQuote"\r\n                                                      table-name="Quote Attachments"\r\n                                                      view-name="{{woatt.viewName}}"\r\n                                                      module-name="{{woatt.moduleName}}"\r\n                                                      show-add-new="false"\r\n                                                      show-delete-column="false"></fc-table>\r\n                                        </div>\r\n                                        \x3c!-- PBI1091 : FCO - Attach Items to Service Request in Customer Portal --\x3e\r\n                                        <div fc-tab="Service Request Attachments" fc-hide="{{vm.hideServiceRequestAttachments}}">\r\n                                            <fc-table api-method="serviceRequestAttachments"\r\n                                                      ng-if="woatt.reloadTable"\r\n                                                      attributes="woatt.attributesServiceRequestAtt"\r\n                                                      filter="vm.serviceRequestFilter"\r\n                                                      table-name="Service Request Attachments"\r\n                                                      view-name="{{woatt.viewName}}"\r\n                                                      module-name="{{woatt.moduleName}}"\r\n                                                      show-delete-column=false\r\n                                                      show-add-new=false>\r\n                                            </fc-table>\r\n                                        </div>\r\n                                    </fc-tabs>\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- PBI1098 : FCO - Deficiency loop (pull through work) --\x3e\r\n\r\n                    <div ng-if="vm.usingQuoting">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, vm.deficiencyModuleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'deficiencyGrid\')">\r\n                                <h4 class="panel-title">\r\n                                    <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseDeficiency" class="collapsed" aria-expanded="false">\r\n                                        Deficiencies<i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                    </a>\r\n                                </h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseDeficiency" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.deficiencyGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content" ng-controller="WoDeficiencyController as df">\r\n                                            <fc-table-edit api-method="deficiency"\r\n                                                           attributes="df.deficiencyEditAttributes"\r\n                                                           model="df.model"\r\n                                                           view-name="{{vm.viewName}}"\r\n                                                           module-name="{{df.moduleName}}"\r\n                                                           on-submit="df.newSubmit()"\r\n                                                           ng-if="df.showForm"></fc-table-edit>\r\n                                            <hr />\r\n                                            <fc-table api-method="deficiency"\r\n                                                      attributes="df.deficiencyGridAttributes"\r\n                                                      filter="vm.filterOnlyByWorkOrder"\r\n                                                      ng-if="df.tableReload && df.showForm"\r\n                                                      table-name="Deficiencies"\r\n                                                      show-add-new="false"\r\n                                                      on-edit="df.edit(item)"></fc-table>\r\n\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- BUG614 : FCO - Assignment Details > Service Reports section is visible even though "No Access" permission is set for Service Reports. --\x3e\r\n                    <div ng-controller="WoServiceReportController as woservrpts">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,woservrpts.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'servreportGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseNine" class="collapsed" aria-expanded="false">Service Reports<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseNine" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.servreportGrid">\r\n                                    <div class="block-flat">\r\n                                        \x3c!-- PBI555 : FCO - Carry over customer signature on revised service report - GroundBreakers --\x3e\r\n                                        \x3c!-- <div class="content" id="service-report" iceReportController as woservrpts"> --\x3e\r\n                                        <div class="content" ng-class="{\'hide-add-new-btn\' : vm.serviceReportCount >= vm.serviceReportMax && vm.customReport}" id="service-report" ng-controller="WoServiceReportController as woservrpts">\r\n                                            \x3c!-- PBI555 : FCO - Carry over customer signature on revised service report - GroundBreakers --\x3e\r\n                                            \x3c!-- <fc-table api-method="woservicereports" --\x3e\r\n                                            <fc-table api-method="{{vm.serviceReportAPI}}"\r\n                                                      attributes="woservrpts.attributes"\r\n                                                      on-edit="woservrpts.editServiceReport(id, vm.filter.filterId)"\r\n                                                      filter="vm.filter"\r\n                                                      table-name="ServiceReports"\r\n                                                      ng-if="woservrpts.reloadTable"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{woservrpts.moduleName}}"\r\n                                                      delete-message-format="Are you sure you want to delete %FileName%?"\r\n                                                      rows-count="vm.serviceReportCount">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                </div>\x3c!-- accordion --\x3e\r\n            </div>\x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/WorkOrder/MyWorkOrder/assignmentDetailsReadOnly.html",'<div id="pcont" class="container-fluid" ng-controller="AssignmentDetailsReadOnlyController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li ng-if="!vm.fromDispatch"><a class="cursor_pointer" ng-click="vm.$state.go(\'myWorkOrders\')">My Assignments</a></li>\r\n            <li ng-if="vm.fromDispatch"><a class="cursor_pointer" ng-click="vm.$state.go(\'dispatchCalendar\')">Dispatch Calendar</a></li>\r\n            <li class="active"> Assignment Details  </li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>Assignment Details</h1>\r\n    </div>\r\n    <div class="cl-mcont" id="acceptWoDetails">\r\n        <div class="row  form-horizontal">\r\n            <div class="col-md-12">\r\n                <div id="accordion" class="panel-group accordion">\r\n                    <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,vm.moduleName) !=0">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'woesGrid\')">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseWO" class="collapsed" aria-expanded="false">Work Order<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseWO" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.woesGrid">\r\n                                <div id="assignment-wo">\r\n                                    \x3c!-- EPIC387 : DSL Northwest Implementation - TASK392 : FCO DB Custom Fields --\x3e\r\n                                    <fc-table-edit api-method="{{vm.woAPI}}"\r\n                                                   id="{{vm.id}}"\r\n                                                   timezone="vm.woTimezone"\r\n                                                   attributes="vm.attributes"\r\n                                                   on-back="vm.editWorkorder()"\r\n                                                   model="vm.model"\r\n                                                   view-name="{{vm.viewName}}"\r\n                                                   module-name="{{vm.moduleName}}"\r\n                                                   ng-if="vm.showForm">\r\n                                    </fc-table-edit>\r\n                                    \x3c!--\r\n                                    <fc-table-edit api-method="wodetails"\r\n                                                   id="{{vm.id}}"\r\n                                                   timezone="vm.woTimezone"\r\n                                                   attributes="vm.attributes"\r\n                                                   on-back="vm.editWorkorder()"\r\n                                                   model="vm.model"\r\n                                                   view-name="{{vm.viewName}}"\r\n                                                   module-name="{{vm.moduleName}}">\r\n                                    </fc-table-edit>\r\n                                    --\x3e\r\n                                </div>\x3c!-- content --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel collapse --\x3e\r\n                    </div>\x3c!-- panel default --\x3e\r\n\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'assignmentsGrid\')">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseAD" class="collapsed" aria-expanded="false">Assignment<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseAD" class="panel-collapse collapse">\r\n                            <div class="panel-body" ng-if="vm.assignmentsGrid">\r\n                                <div class="block-flat">\r\n                                    <div id="assignment-wo">\r\n                                        <fc-table-edit api-method="woassignments"\r\n                                                       id="{{vm.assid}}"\r\n                                                       timezone="vm.assignmnentTimezone"\r\n                                                       on-back="vm.editAssignment(insertData)"\r\n                                                       attributes="vm.assignmentatt"\r\n                                                       model="vm.model1">\r\n                                        </fc-table-edit>\r\n                                    </div>\x3c!-- content --\x3e\r\n                                </div>\x3c!-- block-flat --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel collapse --\x3e\r\n                    </div>\x3c!-- panel default --\x3e\r\n\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title">\r\n                                <a data-toggle="collapse" data-parent="#StatusAccordion" data-target="#collapseStatus" class="collapsed"\r\n                                   aria-expanded="false">Status<span> - {{vm.modelStatus.Status}}</span><i class="fa  fa-chevron-circle-right pull-right"></i></a>\r\n                            </h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseStatus" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div id="accordionAcceptWO" class="panel-body">\r\n                                <div id="assignment-status">\r\n                                    <fc-table-edit api-method="woassignments/status" id="{{vm.assid}}" on-back="vm.editAssignmentStatus(insertData)" attributes="vm.assignmentStatus" model="vm.modelStatus"></fc-table-edit>\r\n                                </div>\x3c!-- content --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel collapse --\x3e\r\n                    </div>\x3c!-- panel default --\x3e\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'assignmentsGrid\')">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseEleven" class="collapsed" aria-expanded="false">WO Assignments   &nbsp;&nbsp;  Count: {{vm.count}} &nbsp; &nbsp; Estimated hours total: {{vm.estHoursTotal}}<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseEleven" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.assignmentsGrid">\r\n                                <div class="block-flat">\r\n                                    <div id="accordionAcceptWO" class="content" ng-controller="MyAssingmentController as va">\r\n                                        \x3c!-- PBI488 : Add Posting Group to Serviceable Item Dropdown on Work Order and Assignment --\x3e\r\n                                        \x3c!--\r\n                                        <fc-table api-method="woassignments"\r\n                                                attributes="va.attributes"\r\n                                                filter="vm.filterOnlyByWorkOrder"\r\n                                                ng-if="va.reloadTable"\r\n                                                table-name="Assingment">\r\n                                        </fc-table>\r\n                                        --\x3e\r\n                                        <fc-table api-method="{{vm.woAssignmentsAPI}}"\r\n                                                  attributes="va.attributes"\r\n                                                  filter="vm.filterOnlyByWorkOrder"\r\n                                                  ng-if="va.reloadTable"\r\n                                                  table-name="Assingment">\r\n                                        </fc-table>\r\n                                    </div>\x3c!-- content --\x3e\r\n                                </div>\x3c!-- block-flat --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel default --\x3e\r\n                    <div ng-controller="WoNoteController as wn">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,wn.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'notesGrid\')">\r\n                                <h4 class="panel-title">\r\n                                    <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseFour" class="collapsed" aria-expanded="false">\r\n                                        Notes\r\n                                        <span ng-show="(wn.getWoNoteLength() && !wn.getSiteNoteLength())"> - Work Order notes exist</span>\r\n                                        <span ng-show="(!wn.getWoNoteLength()  && wn.getSiteNoteLength())"> - Site notes exist</span>\r\n                                        <span ng-show="(wn.getWoNoteLength()  && wn.getSiteNoteLength())"> - Work Order and Site notes exist</span>\r\n                                        <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                    </a>\r\n                                </h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseFour" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.notesGrid">\r\n                                    <fc-tabs tab="wn.filterTab">\r\n                                        <div fc-tab="Work Order Notes">\r\n                                            <div ng-if="wn.filterTabWindow == false">\r\n                                                <fc-table table-name="Work Order Note"\r\n                                                          api-method="wonotes"\r\n                                                          attributes="wn.attributesWoatt"\r\n                                                          on-edit="wn.editWoNote(id, vm.filter.filterId)"\r\n                                                          filter="vm.filterOnlyByWorkOrder"\r\n                                                          ng-if="wn.reloadTable"\r\n                                                          delete-event="wn.setNotesHeader()"\r\n                                                          delete-message-format="Are you sure you want to delete notes  %Note% ?"\r\n                                                          module-name="{{wn.moduleName}}"\r\n                                                          view-name="{{vm.viewName}}">\r\n                                                </fc-table>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div fc-tab="Site Notes">\r\n                                            <fc-table table-name="Site Note"\r\n                                                      api-method="wositenotes"\r\n                                                      attributes="wn.attributesSiatt"\r\n                                                      on-edit="wn.editSiteNote(id, vm.filter1.siteId)"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="wn.reloadTable"\r\n                                                      delete-event="wn.setNotesHeader()"\r\n                                                      delete-message-format="Are you sure you want to delete notes  %Note% ?"\r\n                                                      module-name="{{wn.moduleName}}"\r\n                                                      view-name="{{vm.viewName}}">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                    </fc-tabs>\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel collapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- EPIC981 : FCO - XOi Integration --\x3e\r\n\r\n                    <div class="panel panel-default" ng-show="vm.usingXOiIntegration" ng-if="vm.getModulePrivilege(vm.viewName, vm.xoiModuleName) !=0">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'xoiGrid\')">\r\n                            <h4 class="panel-title">\r\n                                <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseXOi" class="collapsed" aria-expanded="false">\r\n                                    XOi Integration\r\n                                    <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                </a>\r\n                            </h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseXOi" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body">\r\n                                <div class="content">\r\n                                    <div ng-if="!vm.hasXOiJob" style="color:red;">This Assignment does not have a XOi Job.  Links are disabled!</div>\r\n                                    <fc-table-edit attributes="vm.deeplinksAttributes"\r\n                                                   hide-submit="true"\r\n                                                   hide-cancel="true"></fc-table-edit>\r\n                                </div>\x3c!-- content --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel default --\x3e\r\n\r\n                    <div ng-controller="WoLaborController as vl">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,vl.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'laborGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseFive" class="collapsed" aria-expanded="false">Labor<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseFive" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.laborGrid">\r\n                                    <div class="block-flat">\r\n                                        <div id="accordionAcceptWO" class="content" ng-controller="WoLaborController as vl">\r\n                                            <fc-table api-method="woLabors"\r\n                                                      attributes="vl.attributes"\r\n                                                      filter="vm.filterOnlyByWorkOrder"\r\n                                                      ng-if="vl.reloadTable"\r\n                                                      table-name="Labor"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{vl.moduleName}}">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="PartsController as parts">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,parts.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'partsGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseSix" class="collapsed" aria-expanded="false">Parts<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseSix" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.partsGrid">\r\n                                    <div id="accordionAcceptWO" class="block-flat">\r\n                                        <div id="partsFilter" class="content">\r\n                                            <fc-table api-method="parts"\r\n                                                      attributes="parts.attributes"\r\n                                                      filter="parts.autoFilter"\r\n                                                      table-name="Parts"\r\n                                                      ng-if="parts.reloadTable"\r\n                                                      module-name="{{parts.moduleName}}"\r\n                                                      view-name="{{vm.viewName}}">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="MiscController as misc">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,misc.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'miscGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseSeven" class="collapsed" aria-expanded="false">Miscellaneous<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseSeven" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">\r\n                                <div class="panel-body" ng-if="vm.miscGrid">\r\n                                    <div id="accordionAcceptWO" class="block-flat">\r\n                                        <div id="miscFilter" class="content">\r\n                                            <fc-table api-method="miscs"\r\n                                                      attributes="misc.attributes"\r\n                                                      filter="misc.autoFilter"\r\n                                                      table-name="Miscellaneous"\r\n                                                      ng-if="misc.reloadTable"\r\n                                                      module-name="{{misc.moduleName}}"\r\n                                                      view-name="{{vm.viewName}}">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- EPIC981 : FCO - XOi Integration --\x3e\r\n\r\n                    <div>\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, vm.serviceableItemModuleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'woServiceableItemPanel\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseServiceableItem" class="collapsed" aria-expanded="false">Serviceable Item<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseServiceableItem" class="panel-collapse collapse" aria-expanded="false" ng-controller="WoServiceableItemController as si">\r\n                                <div class="panel-body" ng-if="vm.woServiceableItemPanel">\r\n                                    \x3c!-- <div class="block-flat"> --\x3e\r\n                                    <div class="content" ng-if="si.tableReload">\r\n                                        <fc-table-edit api-method="serviceableitems"\r\n                                                       id="{{vm.serviceableItemId}}"\r\n                                                       attributes="si.attributes"\r\n                                                       model="si.model"\r\n                                                       view-name="{{vm.viewName}}"\r\n                                                       module-name="{{vm.moduleName}}"\r\n                                                       hide-submit="true"\r\n                                                       hide-cancel="true"\r\n                                                       ng-if="vm.serviceableItemId"></fc-table-edit>\r\n                                        <fc-tabs ng-if="vm.serviceableItemId">\r\n                                            <div fc-tab="Serviceable Item Notes" id="hidesearch">\r\n                                                <fc-table table-name="ServiceableItemNotes"\r\n                                                          api-method="serviceableitemnotes"\r\n                                                          attributes="si.attributesNote"\r\n                                                          on-edit="si.editNote(id)"\r\n                                                          filter="vm.serviceableItemIdFilter"\r\n                                                          ng-if="si.reloadNoteTable"\r\n                                                          show-add-new="false"\r\n                                                          show-delete-column="false"></fc-table>\r\n                                            </div>\r\n\r\n                                            <div fc-tab="Serviceable Item Attachments" id="hidesearch1">\r\n                                                <fc-table table-name="ServiceableItemAttachments"\r\n                                                          api-method="serviceableitemattachments"\r\n                                                          attributes="si.attributesAttachment"\r\n                                                          on-edit="si.editAttachment(id)"\r\n                                                          ng-if="si.reloadAttachmentTable"\r\n                                                          show-search="false"\r\n                                                          filter="vm.serviceableItemIdFilter"\r\n                                                          delete-message-format="Are you sure that you want to delete %AttachmentName%?"\r\n                                                          show-add-new="false"\r\n                                                          show-delete-column="false"></fc-table>\r\n                                            </div>\r\n                                        </fc-tabs>\r\n                                    </div>\x3c!-- content --\x3e\r\n                                    \x3c!-- </div> --\x3e\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="PurchaseController as pc">\r\n                        <div class="panel panel-default" ng-show="vm.poGrid && vm.isMain" ng-if="vm.getModulePrivilege(vm.viewName,pc.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'poesGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseThirteen" class="collapsed" aria-expanded="false">Purchase Orders<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseThirteen" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.poesGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content purchaseBtnHide purchaseDeleteHide" ng-controller="PurchaseController as pc" id="PO-table-drill">\r\n                                            <div class="form-group ">\r\n                                                <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right" ng-init="pc.Altid = vm.model.AltId; pc.hide=true;  pc.assignemt = true;">\r\n                                                    \x3c!--<button type="submit" class="btn btn-primary" ng-click="vm.createPurchaseRequisition(vm.altId)">Create Purchase Requisition</button>--\x3e\r\n                                                </div> \x3c!-- input box --\x3e\r\n                                            </div>\r\n                                            <fc-table api-method="purchases/getWithAmount"\r\n                                                      attributes="pc.attributes"\r\n                                                      filter="vm.filterOnlyByWorkOrder"\r\n                                                      drilldown="pc.drilldownSettings"\r\n                                                      drilldown-filter="pc.drilldownFilter"\r\n                                                      module-name="{{pc.moduleName}}"\r\n                                                      view-name="{{vm.viewName}}">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    <div ng-controller="WoTaskController as wt">\r\n                        <div class="panel panel-default" ng-show="vm.taskGrid" ng-if="vm.getModulePrivilege(vm.viewName,wt.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'tasksGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseEight" class="collapsed" aria-expanded="false">Tasks<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseEight" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.tasksGrid">\r\n                                    <div class="block-flat">\r\n                                        <div id="accordionAcceptWO" class="content" ng-controller="WoTaskController as wt">\r\n                                            <fc-table api-method="wotasks"\r\n                                                      attributes="wt.attributes"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="wt.reloadTable"\r\n                                                      table-name="Task"\r\n                                                      module-name="{{wt.moduleName}}"\r\n                                                      view-name="{{vm.viewName}}">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="WoFormController as forms">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,forms.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'formsGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwelve" class="collapsed" aria-expanded="false">Forms<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseTwelve" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div id="woForm" class="panel-body" ng-if="vm.formsGrid">\r\n                                    <div class="block-flat">\r\n                                        <button class="btn pull-right" ng-click="vm.changeForms()">{{vm.btnName}}</button>\r\n                                        <div class="content">\r\n                                            <div ng-init="forms.woId = vm.id"></div>\r\n                                            <div ng-show="vm.woForm">\r\n                                                <fc-table id="woForms"\r\n                                                          api-method="forms/getformyassignment"\r\n                                                          attributes="forms.attributes"\r\n                                                          filter="vm.filterByWorkOrder"\r\n                                                          ng-if="vm.reloadFilter"\r\n                                                          table-name="Forms"\r\n                                                          module-name="{{form.moduleName}}"\r\n                                                          view-name="{{vm.viewName}}">\r\n                                                </fc-table>\r\n                                            </div>\r\n                                            <div ng-show="!vm.woForm">\r\n                                                <div id="woSiteForm" class="col-lg-6 col-sm-6">\r\n                                                    <fc-table-edit api-method="forms/getforSiteEquipmentDropdown" attributes="vm.attributesSite" model="vm.modelSite"></fc-table-edit>\r\n                                                </div>\r\n                                                <fc-table id="woForms"\r\n                                                          api-method="forms/getAssignmentforSiteEquipment"\r\n                                                          attributes="forms.siteAttributes"\r\n                                                          filter="vm.filterSiteForms"\r\n                                                          ng-if="vm.reloadFilter"\r\n                                                          table-name="Forms"\r\n                                                          module-name="{{form.moduleName}}"\r\n                                                          view-name="{{vm.viewName}}">\r\n                                                </fc-table>\r\n                                            </div>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- EPIC1008 : FCO - FCPayments (Company Feature) --\x3e\r\n\r\n                    <div ng-controller="WoPaymentController as pc" ng-if="vm.showWoPayment">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, pc.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'woPaymentGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseWoPayment" class="collapsed" aria-expanded="false">Payment<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseWoPayment" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.woPaymentGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content">\r\n                                            <fc-table api-method="fcPayment/transactions"\r\n                                                      attributes="pc.gridAttributes"\r\n                                                      filter="vm.filterOnlyByWorkOrder"\r\n                                                      ng-if="pc.reloadTable"\r\n                                                      show-delete-column=false\r\n                                                      show-add-new=false\r\n                                                      table-name="Payments"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      module-name="{{pc.moduleName}}"\r\n                                                      disable-select-row="true"\r\n                                                      rows-count="pc.transactionCount"\r\n                                                      list="pc.transactionList">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                    <div ng-controller="WoAttachmentController as woatt">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,woatt.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'attachmentsGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTen" class="collapsed" aria-expanded="false">Attachments<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseTen" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.attachmentsGrid">\r\n                                    <fc-tabs tab="woatt.filterTab">\r\n                                        <div fc-tab="Work Order">\r\n                                            <fc-table api-method="woattachments"\r\n                                                      attributes="woatt.attributesWoatt"\r\n                                                      on-edit="woatt.editWoAttachment(id, vm.filter.filterId)"\r\n                                                      filter="vm.filterOnlyByWorkOrder"\r\n                                                      ng-if="woatt.reloadTable"\r\n                                                      table-name="Work Order Attachments"\r\n                                                      module-name="{{woatt.moduleName}}"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      show-add-new="false"\r\n                                                      show-delete-column="false">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                        <div fc-tab="Site">\r\n                                            <fc-table api-method="siteattachments"\r\n                                                      attributes="woatt.attributesSiatt"\r\n                                                      on-edit="woatt.editSiteAttachment(id, vm.filter1.siteId)"\r\n                                                      filter="vm.filterBySite"\r\n                                                      ng-if="woatt.reloadTable"\r\n                                                      table-name="Site Attachment"\r\n                                                      module-name="{{woatt.moduleName}}"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      show-add-new="false"\r\n                                                      show-delete-column="false">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                        <div fc-tab="Quote" fc-hide="{{vm.hideQuoteAttachments}}">\r\n                                            <fc-table api-method="quoteattachments"\r\n                                                      attributes="woatt.attributesQuoteatt"\r\n                                                      filter="vm.filterByQuote"\r\n                                                      table-name="Quote Attachments"\r\n                                                      view-name="{{woatt.viewName}}"\r\n                                                      module-name="{{woatt.moduleName}}"\r\n                                                      show-add-new="false"\r\n                                                      show-delete-column="false">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                        \x3c!-- PBI1091 : FCO - Attach Items to Service Request in Customer Portal --\x3e\r\n                                        <div fc-tab="Service Request" fc-hide="{{vm.hideServiceRequestAttachments}}">\r\n                                            <fc-table api-method="serviceRequestAttachments"\r\n                                                      ng-if="woatt.reloadTable"\r\n                                                      attributes="woatt.attributesServiceRequestAtt"\r\n                                                      filter="vm.serviceRequestFilter"\r\n                                                      table-name="Service Request Attachments"\r\n                                                      view-name="{{woatt.viewName}}"\r\n                                                      module-name="{{woatt.moduleName}}"\r\n                                                      show-delete-column=false\r\n                                                      show-add-new=false>\r\n                                            </fc-table>\r\n                                        </div>\r\n                                    </fc-tabs>\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- PBI1098 : FCO - Deficiency loop (pull through work) --\x3e\r\n\r\n                    <div ng-if="vm.usingQuoting">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName, vm.deficiencyModuleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'deficiencyGrid\')">\r\n                                <h4 class="panel-title">\r\n                                    <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseDeficiency" class="collapsed" aria-expanded="false">\r\n                                        Deficiencies<i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                    </a>\r\n                                </h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseDeficiency" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.deficiencyGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content" ng-controller="WoDeficiencyController as df">\r\n                                            <fc-table api-method="deficiency"\r\n                                                      attributes="df.deficiencyGridAttributes"\r\n                                                      filter="vm.filterOnlyByWorkOrder"\r\n                                                      ng-if="df.tableReload && df.showForm"\r\n                                                      table-name="Deficiencies"\r\n                                                      show-add-new="false"\r\n                                                      show-delete-column="false"></fc-table>\r\n\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n                    \x3c!-- BUG614 : FCO - Assignment Details > Service Reports section is visible even though "No Access" permission is set for Service Reports. --\x3e\r\n                    <div ng-controller="WoServiceReportController as woservrpts">\r\n                        <div class="panel panel-default" ng-if="vm.getModulePrivilege(vm.viewName,woservrpts.moduleName) !=0">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'servreportGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseNine" class="collapsed" aria-expanded="false">Service Reports<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseNine" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.servreportGrid">\r\n                                    <div class="block-flat">\r\n                                        \x3c!-- PBI555 : FCO - Carry over customer signature on revised service report - GroundBreakers --\x3e\r\n                                        \x3c!-- <div class="content" id="service-report"> --\x3e\r\n                                        <div class="content" id="service-report" ng-controller="WoServiceReportController as woservrpts">\r\n                                            \x3c!-- <fc-table api-method="woservicereports" --\x3e\r\n                                            <fc-table api-method="{{vm.serviceReportAPI}}"\r\n                                                      attributes="woservrpts.attributes"\r\n                                                      on-edit="woservrpts.editServiceReport(id, vm.filter.filterId)"\r\n                                                      filter="vm.filter"\r\n                                                      table-name="ServiceReports"\r\n                                                      ng-if="woservrpts.reloadTable"\r\n                                                      module-name="{{woservrpts.moduleName}}"\r\n                                                      view-name="{{vm.viewName}}"\r\n                                                      disable-custom-button="true">\r\n                                            </fc-table>\r\n                                        </div>\x3c!-- content --\x3e\r\n                                    </div>\x3c!-- block-flat --\x3e\r\n                                </div>\x3c!-- panel body --\x3e\r\n                            </div>\x3c!-- panel colapse --\x3e\r\n                        </div>\x3c!-- panel default --\x3e\r\n                    </div>\x3c!-- controller --\x3e\r\n\r\n                </div>\x3c!-- accordion --\x3e\r\n            </div> \x3c!-- columns --\x3e\r\n        </div>\x3c!-- row --\x3e\r\n    </div>\r\n</div>\r\n'),e.put("Templates/WorkOrder/MyWorkOrder/assignmentSubcontractorDetails.html",'<div id="pcont" class="container-fluid" ng-controller="AssignmentSubcontractorDetailsEditController as vm">\r\n    <div class="page-head">\r\n\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li ng-if="!vm.fromDispatch"><a class="cursor_pointer" ng-click="vm.$state.go(\'myWorkOrders\')">My Assignments</a></li>\r\n            <li ng-if="vm.fromDispatch"><a class="cursor_pointer" ng-click="vm.$state.go(\'dispatchCalendar\')">Dispatch Calendar</a></li>\r\n            <li class="active"> Assignment Details  </li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n\r\n        <h1>Assignment Details</h1>\r\n    </div>\r\n    <div class="cl-mcont">\r\n        <div class="row  form-horizontal">\r\n\r\n            <div class="col-md-12">\r\n                <div id="accordion" class="panel-group accordion">\r\n                    \x3c!-- work order --\x3e\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'woesGrid\')">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#WOaccordion" data-target="#collapseWO" class="collapsed" aria-expanded="false">Work Order<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\r\n                        <div id="collapseWO" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.woesGrid">\r\n                                <div id="assignment-wo">\r\n                                    <div id="acceptWoDetails">\r\n                                        <fc-table-edit api-method="wodetails" timezone="vm.assignmnentTimezone" id="{{vm.id}}" attributes="vm.attributes" on-submit="editWorkorder()" on-back="vm.$state.go(\'myWorkOrders\')" model="vm.model"></fc-table-edit>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    \x3c!-- work order --\x3e\r\n                    \x3c!-- assignment --\x3e\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'assignmentsGrid\')">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseAD" aria-expanded="false" class="collapsed"> Assignment<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\r\n                        <div id="collapseAD" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.assignmentsGrid">\r\n                                <div class="block-flat">\r\n                                    <div class="content">\r\n                                        <div id="assignment-wo" ng-if="vm.refresh">\r\n                                            <fc-table-edit api-method="woassignments" id="{{vm.assid}}" timezone="vm.assignmnentTimezone" on-back="vm.$state.go(\'myWorkOrders\')" attributes="vm.assignmentatt" model="vm.model1" on-submit="vm.update()"></fc-table-edit>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    \x3c!-- assignment --\x3e\r\n                    \x3c!-- status --\x3e\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#StatusAccordion" data-target="#collapseStatus" class="collapsed" aria-expanded="false">Status<span> - {{vm.modelStatus.Status}}</span><i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseStatus" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body">\r\n                                <div id="assignment-status" ng-if="vm.refresh">\r\n                                    <fc-table-edit api-method="woassignments/status" id="{{vm.assid}}" on-submit="vm.editAssignmentStatus()" on-back="vm.$state.go(\'myWorkOrders\')" attributes="vm.assignmentStatus" model="vm.modelStatus"></fc-table-edit>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    \x3c!-- status --\x3e\r\n                    \x3c!-- wo assignment --\x3e\r\n                    <div id="subcontractorWorkOrderAssignment">\r\n                        <div class="panel panel-default">\r\n                            <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'assignmentsGrid\')">\r\n                                <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseEleven" aria-expanded="false" class="collapsed">WO Assignments  &nbsp;&nbsp;  Count: {{vm.count}} &nbsp; &nbsp; Estimated hours total: {{vm.estHoursTotal}}<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                            </div>\x3c!-- panel heading --\x3e\r\n                            <div id="collapseEleven" class="panel-collapse collapse" aria-expanded="false">\r\n                                <div class="panel-body" ng-if="vm.assignmentsGrid">\r\n                                    <div class="block-flat">\r\n                                        <div class="content" ng-controller="MyAssingmentController as va" id="sub-assignments-table">\r\n                                            <fc-table api-method="woassignments"\r\n                                                      attributes="va.attributes"\r\n                                                      on-edit="va.editAssignment(id, vm.filter.filterId, vm.site.siteId, item,vm.subcontractorId)"\r\n                                                      filter="vm.filterOnlyByWorkOrder"\r\n                                                      ng-if="va.reloadTable"\r\n                                                      table-name="Assingment"\r\n                                                      timezone="va.assignmentsTimezone"\r\n                                                      custome-delete="va.deleteiscurrenttech(item)"\r\n                                                      delete-message-format="Are you sure you want to delete Assingment %Desc% ?">\r\n\r\n                                            </fc-table>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    \x3c!-- wo assignment --\x3e\r\n                    \x3c!-- notes --\x3e\r\n                    <div class="panel panel-default" ng-controller="WoNoteController as wn">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'notesGrid\')">\r\n                            <h4 class="panel-title">\r\n                                <a data-toggle="collapse" data-parent="#accordion" data-target="#collapseFour" class="collapsed" aria-expanded="false">\r\n                                    Notes\r\n                                    <span ng-show="(wn.getWoNoteLength() && !wn.getSiteNoteLength())"> - Work Order notes exist</span>\r\n                                    <span ng-show="(!wn.getWoNoteLength()  && wn.getSiteNoteLength())"> - Site notes exist</span>\r\n                                    <span ng-show="(wn.getWoNoteLength()  && wn.getSiteNoteLength())"> - Work Order and Site notes exist</span>\r\n                                    <i class="fa  fa-chevron-circle-right pull-right"></i>\r\n                                </a>\r\n                            </h4>\r\n                        </div>\r\n                        <div id="collapseFour" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.notesGrid">\r\n                                <fc-tabs tab="wn.filterTab">\r\n                                    <div fc-tab="Work Order Notes">\r\n                                        <div ng-if="wn.filterTabWindow == false">\r\n                                            <fc-table table-name="Work Order Note"\r\n                                                      api-method="wonotes"\r\n                                                      attributes="wn.attributesWoatt"\r\n                                                      on-edit="wn.editWoNote(id, vm.filter.filterId)"\r\n                                                      filter="vm.filterOnlyByWorkOrder"\r\n                                                      ng-if="wn.reloadTable"\r\n                                                      delete-event="wn.setNotesHeader()"\r\n                                                      delete-message-format="Are you sure you want to delete notes  %Note% ?">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div fc-tab="Site Notes">\r\n                                        <fc-table table-name="Site Note"\r\n                                                  api-method="wositenotes"\r\n                                                  attributes="wn.attributesSiatt"\r\n                                                  on-edit="wn.editSiteNote(id, vm.filter1.siteId)"\r\n                                                  filter="vm.filterOnlyByWorkOrder"\r\n                                                  ng-if="wn.reloadTable"\r\n                                                  delete-event="wn.setNotesHeader()"\r\n                                                  delete-message-format="Are you sure you want to delete notes  %Note% ?">\r\n                                        </fc-table>\r\n                                    </div>\r\n                                </fc-tabs>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    \x3c!-- notes --\x3e\r\n                    \x3c!-- labor --\x3e\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'laborGrid\')">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseFive" class="collapsed" aria-expanded="false">Labor<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\r\n                        <div id="collapseFive" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.laborGrid">\r\n                                <div class="block-flat">\r\n                                    <div class="content" ng-controller="WoLaborController as vl">\r\n                                        <fc-table api-method="woLabors"\r\n                                                  attributes="vl.attributesSubcontractor"\r\n                                                  on-edit="vl.edit(id, vm.filter.filterId, vm.filter1.rateSheetId, vm.filter1.agreementId, vm.subcontractorId, vm.woCompanyId)"\r\n                                                  filter="vm.filterOnlyByWorkOrder"\r\n                                                  ng-if="vl.reloadTable"\r\n                                                  table-name="Labor"\r\n                                                  delete-message-format="Are you sure you want to delete the labor  %FullName% ?">\r\n                                        </fc-table>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    \x3c!-- labor --\x3e\r\n                    \x3c!-- parts --\x3e\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'partsGrid\')">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseSix" class="collapsed" aria-expanded="false">Parts<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\r\n                        <div id="collapseSix" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.partsGrid">\r\n                                <div class="block-flat">\r\n                                    <div id="partsFilter" class="content" ng-controller="PartsController as parts">\r\n                                        <fc-table api-method="parts"\r\n                                                  attributes="parts.attributesSubcontractor"\r\n                                                  on-edit="parts.editPart(id, vm.filter.filterId, vm.subcontractorId, vm.woCompanyId)"\r\n                                                  filter="parts.autoFilter"\r\n                                                  table-name="Parts"\r\n                                                  ng-if="parts.reloadTable"\r\n                                                  delete-message-format="Are you sure you want to delete the Parts  %ItemName% ?">\r\n                                        </fc-table>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    \x3c!-- parts --\x3e\r\n                    \x3c!-- miscellaneous --\x3e\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'miscGrid\')">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseSeven" class="collapsed" aria-expanded="false">Miscellaneous<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\r\n                        <div id="collapseSeven" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.miscGrid">\r\n                                <div class="block-flat">\r\n                                    <div id="miscFilter" class="content" ng-controller="MiscController as misc">\r\n                                        <fc-table api-method="miscs"\r\n                                                  attributes="misc.attributesSubcontractor"\r\n                                                  on-edit="misc.editMisc(id, vm.filter.filterId, vm.subcontractorId, vm.woCompanyId)"\r\n                                                  filter="misc.autoFilter"\r\n                                                  table-name="Miscellaneous"\r\n                                                  ng-if="misc.reloadTable"\r\n                                                  delete-message-format="Are you sure you want to delete the Miscellaneous  %ItemName% ?">\r\n                                        </fc-table>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    \x3c!-- miscellaneous --\x3e\r\n                    \x3c!-- tasks --\x3e\r\n                    <div class="panel panel-default" ng-show="vm.taskGrid" ng-click="vm.initialiseGrid(\'tasksGrid\')">\r\n                        <div class="panel-heading cursor_pointer">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseEight" class="collapsed" aria-expanded="false">Tasks<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\r\n                        <div id="collapseEight" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.taskGrid">\r\n                                <div class="block-flat">\r\n                                    <div class="content" ng-controller="WoTaskController as wt">\r\n                                        \x3c!-- PBI1044 : FCO - Work Order Tasks --\x3e\r\n                                        <div class="form-group ">\r\n                                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-8 text-right customGridButton">\r\n                                                <button type="submit" class="btn btn-primary" ng-click="wt.completeAll(vm.filter.filterId)">Close All</button>\r\n                                                <button type="submit" class="btn btn-primary" ng-click="wt.editTask(id, vm.filter.filterId, vm.model.SiteId, true)">Add New</button>\r\n                                            </div>\r\n                                        </div>\r\n                                        <fc-table api-method="wotasks"\r\n                                                  attributes="wt.attributes"\r\n                                                  on-edit="wt.editTask(id, vm.filter.filterId, vm.model.SiteId, true)"\r\n                                                  filter="vm.filterOnlyByWorkOrder"\r\n                                                  ng-if="wt.reloadTable"\r\n                                                  table-name="Task"\r\n                                                  delete-message-format="Are you sure you want to delete Task %TaskName% ?"\r\n                                                  show-add-new="false"\r\n                                                  drilldown-filter="wt.drilldownFilter"\r\n                                                  drilldown="wt.drilldownSettings"\r\n                                                  list="wt.allTasks"></fc-table>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    \x3c!-- tasks --\x3e\r\n                    \x3c!-- forms --\x3e\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'formsGrid\')">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwelve" class="collapsed" aria-expanded="false">Forms<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\r\n                        <div id="collapseTwelve" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div id="woForm" class="panel-body" ng-if="vm.formsGrid">\r\n                                <div class="block-flat">\r\n                                    <button class="btn pull-right" ng-click="vm.changeForms()">{{vm.btnName}}</button>\r\n                                    <div class="content" ng-controller="WoFormController as forms">\r\n                                        <div ng-init="forms.woId = vm.id"></div>\r\n                                        <div ng-show="vm.woForm">\r\n                                            <fc-table id="woForms"\r\n                                                      api-method="forms/getformyassignment"\r\n                                                      attributes="forms.attributes"\r\n                                                      filter="vm.filterByWorkOrder"\r\n                                                      ng-if="vm.reloadFilter"\r\n                                                      table-name="Forms"\r\n                                                      delete-message-format="Are you sure you want to delete Form %Name% ?">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                        <div ng-show="!vm.woForm">\r\n                                            <div id="woSiteForm" class="col-lg-6 col-sm-6">\r\n                                                <fc-table-edit api-method="forms/getforSiteEquipmentDropdown" attributes="vm.attributesSite" model="vm.modelSite"></fc-table-edit>\r\n                                            </div>\r\n                                            <fc-table id="woForms"\r\n                                                      api-method="forms/getAssignmentforSiteEquipment"\r\n                                                      attributes="forms.siteAttributes"\r\n                                                      filter="vm.filterSiteForms"\r\n                                                      ng-if="vm.reloadFilter"\r\n                                                      table-name="Forms"\r\n                                                      delete-message-format="Are you sure you want to delete Form %Name% ?">\r\n                                            </fc-table>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    \x3c!-- forms --\x3e\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'attachmentsGrid\')">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseTen" class="collapsed" aria-expanded="false">Attachments<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseTen" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.attachmentsGrid">\r\n                                <div class="block-flat" ng-init=\'content="wo"\'>\r\n                                    \x3c!--<div class="form-group">--\x3e\r\n                                    <div class="col-sm-9">\r\n                                        <label>\r\n                                            <input type="radio" class="icheck" ng-model="content" value="wo"> Work Order&nbsp;&nbsp;\r\n                                        </label>\r\n                                        <label>\r\n                                            <input type="radio" class="icheck" ng-model="content" value="site"> Site\r\n                                        </label>\r\n                                    </div> \x3c!-- input box --\x3e\r\n                                    \x3c!--</div>--\x3e \x3c!-- form group --\x3e\r\n                                    <div class="content" ng-controller="WoAttachmentController as woatt" ng-show="content == \'wo\'">\r\n                                        <fc-table api-method="woattachments"\r\n                                                  attributes="woatt.attributesWoatt"\r\n                                                  on-edit="woatt.editWoAttachment(id, vm.filter.filterId)"\r\n                                                  filter="vm.filterOnlyByWorkOrder"\r\n                                                  ng-if="woatt.reloadTable"\r\n                                                  table-name="Work Order Attachments"\r\n                                                  delete-message-format="Are you sure that you want to delete %AttachmentName%?">\r\n                                        </fc-table>\r\n                                    </div>\x3c!-- content --\x3e\r\n                                    <div class="content" ng-controller="WoAttachmentController as siatt" ng-show="content == \'site\'">\r\n                                        <fc-table api-method="siteattachments"\r\n                                                  attributes="siatt.attributesSiatt"\r\n                                                  on-edit="siatt.editSiteAttachment(id, vm.filter1.siteId)"\r\n                                                  filter="vm.filterBySite"\r\n                                                  ng-if="siatt.reloadTable"\r\n                                                  table-name="Site Attachment"\r\n                                                  delete-message-format="Are you sure that you want to delete %AttachmentName%?">\r\n                                        </fc-table>\r\n                                    </div>\x3c!-- content --\x3e\r\n                                </div>\x3c!-- block-flat --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel --\x3e\r\n                    <div class="panel panel-default">\r\n                        <div class="panel-heading cursor_pointer" ng-click="vm.initialiseGrid(\'servreportGrid\')">\r\n                            <h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" data-target="#collapseNine" class="collapsed" aria-expanded="false">Service Reports<i class="fa  fa-chevron-circle-right pull-right"></i></a></h4>\r\n                        </div>\x3c!-- panel heading --\x3e\r\n                        <div id="collapseNine" class="panel-collapse collapse" aria-expanded="false">\r\n                            <div class="panel-body" ng-if="vm.servreportGrid">\r\n                                <div class="block-flat">\r\n                                    <div class="content" ng-controller="WoServiceReportController as woservrpts">\r\n                                        <fc-table api-method="woservicereports"\r\n                                                  attributes="woservrpts.attributes"\r\n                                                  on-edit="woservrpts.editServiceReport(id, vm.filter.filterId, true)"\r\n                                                  filter="vm.filter"\r\n                                                  table-name="ServiceReports"\r\n                                                  ng-if="woservrpts.reloadTable"\r\n                                                  delete-message-format="Are you sure you want to delete %FileName%?">\r\n                                        </fc-table>\r\n                                    </div>\x3c!-- content --\x3e\r\n                                </div>\x3c!-- block-flat --\x3e\r\n                            </div>\x3c!-- panel body --\x3e\r\n                        </div>\x3c!-- panel colapse --\x3e\r\n                    </div>\x3c!-- panel --\x3e\r\n                </div>\x3c!-- accordion --\x3e \x3c!--DE1463 Moved Accordian end tag here--\x3e\r\n            </div> \x3c!-- columns --\x3e\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/WorkOrder/MyWorkOrder/myWorkOrder.html",'<div id="pcont" class="container-fluid" ng-controller="MyWorkOrderController as vm">\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">My Assignments</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>My Assignments</h1>\r\n    </div>\r\n\r\n    <div class="cl-mcont">\r\n        \x3c!-- LOADING SPINNER --\x3e\r\n        <div ng-hide="!vm.isLoading" class="table-edit-overlay">\r\n            <div class="sk-circle">\r\n                <div class="sk-circle1 sk-child"></div>\r\n                <div class="sk-circle2 sk-child"></div>\r\n                <div class="sk-circle3 sk-child"></div>\r\n                <div class="sk-circle4 sk-child"></div>\r\n                <div class="sk-circle5 sk-child"></div>\r\n                <div class="sk-circle6 sk-child"></div>\r\n                <div class="sk-circle7 sk-child"></div>\r\n                <div class="sk-circle8 sk-child"></div>\r\n                <div class="sk-circle9 sk-child"></div>\r\n                <div class="sk-circle10 sk-child"></div>\r\n                <div class="sk-circle11 sk-child"></div>\r\n                <div class="sk-circle12 sk-child"></div>\r\n            </div>\r\n        </div>\r\n        <div class="row  form-horizontal">\r\n            <div ng-if="vm.showConsent">\r\n                <button type="button" class="btn btn-info push-right" ng-click="vm.consent()">Office 365 Consent</button>\r\n            </div>\r\n            <div class="clearfix CollapsibleTitle">\r\n                <button id="buttonCollapsible" type="button" class="btn btn-info Collapsible collapsed pull-right" data-toggle="collapse" data-target="#Collapsible" ng-click="vm.toggleColapseSearch()"><i class="fa fa-search-minus"></i></button>\r\n            </div>\r\n\r\n            <div id="Collapsible" class="clearfix collapse">\r\n                <h4>Search</h4>\r\n                <div class="col-sm-6 col-md-6">\r\n                    <div class="form-group">\r\n                        <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">From Date</label>\r\n                        <div class="col-sm-9 col-md-8 col-lg-7">\r\n                            <div data-min-view="2" data-date-format="yyyy-mm-dd" class="input-group date datetime col-md-7 col-lg-5 col-xs-7" date-time-append>\r\n                                <input type="datetime" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" date-time ng-model="vm.filter1Tmp.fromDate" fc-enter="vm.loadAssigments()" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control" />\r\n                                <span class="input-group-addon btn btn-white">\r\n                                    <span class="glyphicon glyphicon-calendar"></span>\r\n                                </span>\r\n                            </div>\r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n                    <div class="form-group">\r\n                        <label for=" " class="col-sm-3 col-md-4 col-lg-3 control-label">To Date</label>\r\n                        <div class="col-sm-9 col-md-8 col-lg-7">\r\n                            <div data-min-view="2" data-date-format="yyyy-mm-dd" class="input-group date datetime col-md-7 col-lg-5 col-xs-7" date-time-append>\r\n                                <input type="datetime" ng-readonly="vm.deviceDetect.isMobile() || vm.deviceDetect.isTablet()" date-time ng-model="vm.filter1Tmp.toDate" fc-enter="vm.loadAssigments()" format="MM/dd/yyyy" auto-close="true" min-view="date" max-view="date" class="form-control" />\r\n                                <span class="input-group-addon btn btn-white">\r\n                                    <span class="glyphicon glyphicon-calendar"></span>\r\n                                </span>\r\n                            </div>\r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n                    <div class="form-group">\r\n                        <label class="col-sm-3 col-md-4 col-lg-3 control-label">Search <i class="fa fa-info-circle" title="Search by: Site, Address and Work Order number"></i></label>\r\n                        <div class="col-sm-9 col-md-8 col-lg-7">\r\n                            <input type="text" placeholder="Search" class="form-control" fc-enter="vm.loadAssigments()" ng-model="vm.filter.search">\r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n                </div> \x3c!-- columns --\x3e\r\n\r\n\r\n                <div class="col-sm-6 col-md-6">\r\n\r\n                    <div class="form-group">\r\n                        <label class="col-sm-3 col-md-4 col-lg-3 control-label">Status</label>\r\n                        <div class="col-sm-9 col-md-8 col-lg-7">\r\n                            <fc-multiselect api-method="assignmentstatuses" on-enter="vm.loadAssigments()" value="vm.statuses" value-prop="AssignmentStatusName" text-prop="AssignmentStatusName"></fc-multiselect>\r\n                        </div> \x3c!-- input box --\x3e\r\n                    </div> \x3c!-- form group --\x3e\r\n\r\n                </div> \x3c!-- columns --\x3e\r\n                <div class="row">\r\n                    <div class="col-sm-12 col-md-12">\r\n                        <div class="form-group">\r\n                            <div class="col-sm-offset-3 col-md-offset-4 col-lg-offset-4 col-sm-9 col-md-8 col-lg-7 text-right">\r\n                                <button type="submit" class="btn btn-primary push-left" ng-click="vm.loadAssigments()">Search</button>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div> \x3c!-- form group --\x3e\r\n                    </div>\r\n                </div>\r\n                <div class="row  form-horizontal">\r\n                    <div class="col-md-12">\r\n                        <div class="form-group">\r\n                            <label for=" " class="col-xs-3 col-sm-3 col-md-2 col-lg-1 control-label push-right"><strong>Sort</strong></label>\r\n                            <div class="col-sm-9 col-md-5 col-lg-3">\r\n                                <select class="form-control" ng-model="vm.filter.sortBy" fc-enter="vm.loadAssigments()">\r\n                                    <option value="EstStartDate" selected>Date</option>\r\n                                    <option value="AssignmentStatusName">Status</option>\r\n                                    <option value="Priority">Priority</option>\r\n                                    <option value="SiteName">Site</option>\r\n                                    <option value="AltId">WO Number</option>\x3c!-- ADDED FOR US294 --\x3e\r\n                                </select>\r\n                            </div> \x3c!-- input box --\x3e\r\n                            <div class="col-sm-9 col-md-4 col-lg-3">\r\n                                <label class="radio-inline">\r\n                                    <input id="radioAsc" type="radio" name="sortDirection" class="icheck" ng-click="vm.sortAsc()" fc-enter="vm.loadAssigments()"> Ascending\r\n                                </label>\r\n                                <label class="radio-inline" style="margin-left: 20px;">\r\n                                    <input id="radioDesc" checked type="radio" name="sortDirection" class="icheck" ng-click="vm.sortDesc()" fc-enter="vm.loadAssigments()"> Descending\r\n                                </label>\r\n                            </div> \x3c!-- input box --\x3e\r\n                        </div> \x3c!-- form group --\x3e\r\n                    </div> \x3c!-- columns --\x3e\r\n                </div>\x3c!-- row --\x3e\r\n            </div>\x3c!-- Collapsible section end --\x3e\r\n        </div>\x3c!-- row end --\x3e\r\n        <div ng-repeat="assigment in vm.assigments">\r\n            \x3c!-- | orderBy: vm.filter.sortBy : vm.sortReverse --\x3e\r\n            <div class="row form-horizontal">\r\n                <div class="col-md-12 table-responsive table-assignment-div">\r\n                    <table border="0" cellspacing="0" cellpadding="0">\r\n                        <tr>\r\n                            \x3c!-- TIMER TABLE DATA --\x3e\r\n                            <td id="fade" class="assignmentTimer" ng-if="vm.assigments[$index+\'_0\']" align="left" valign="middle" rowspan="6">\r\n                                <div class="rotate-div-90" align="center">\r\n                                    <div id="container-ping">\r\n                                        <div class="dot"></div>\r\n                                        <div class="pulse"></div>\r\n                                    </div>\r\n                                    <div id="clock" class="timer-text">\r\n                                        {{timer}}\r\n                                    </div>\r\n                                </div>\r\n                            </td>\r\n                            <td rowspan="6" align="center" valign="top" width="8%">\r\n                                <h3>\r\n                                    <a class="cursor_pointer" ng-click="vm.goToManage(assigment)">{{assigment.AltId}}</a>\r\n                                </h3>\r\n                                <br /><br />\r\n                                <div>\r\n                                    \x3c!-- TRAVEL TIME START BUTTON --\x3e\r\n                                    <div align="center">\r\n                                        \x3c!-- START --\x3e\r\n                                        <buttton ng-hide="vm.travelButton[$index +\'_0\']" id="travelButton" ng-class="{ \'disabled\': vm.disableTravelButtons[$index +\'_0\']}" class="cursor_pointer btn" ng-click="vm.startTimer($index,0, 1, assigment)">\r\n                                            <i class="fa fa-truck" style="color:gray" aria-hidden="true"></i>Time\r\n                                        </buttton>\r\n                                        \x3c!-- PAUSE --\x3e\r\n                                        <buttton id="travelButton" ng-show="vm.travelButton[$index +\'_0\']" ng-class="{ \'timer-button-active\': vm.travelButton[$index +\'_0\']}" class="cursor_pointer btn" ng-click="vm.stopTimer($index,0, 3, assigment)">\r\n                                            <i class="fa fa-pause" style="color:gray" aria-hidden="true"></i>Time\r\n                                        </buttton>\r\n                                    </div>\r\n                                </div>\r\n                                <br />\r\n                                <div>\r\n                                    \x3c!-- SERVICE TIME START BUTTON --\x3e\r\n                                    <div align="center">\r\n                                        \x3c!-- START --\x3e\r\n                                        <buttton id="serviceButton" ng-hide="vm.serviceButton[$index +\'_0\']" ng-class="{ \'disabled\': vm.disableServiceButtons[$index +\'_0\']}" class="cursor_pointer btn" ng-click="vm.startTimer($index,0, 2, assigment)">\r\n                                            <i class="fa fa-wrench" style="color:gray" aria-hidden="true"></i>Time\r\n                                        </buttton>\r\n                                        \x3c!-- PAUSE --\x3e\r\n                                        <buttton id="travelButton" ng-show="vm.serviceButton[$index +\'_0\']" ng-class="{ \'timer-button-active\': vm.serviceButton[$index +\'_0\']}" class="cursor_pointer btn" ng-click="vm.stopTimer($index,0, 4, assigment)">\r\n                                            <i class="fa fa-pause" style="color:gray" aria-hidden="true"></i>Time\r\n                                        </buttton>\r\n                                    </div>\r\n                                </div>\r\n                            </td>\r\n                            <td width="10%"><strong>Site:</strong></td>\r\n                            <td width="60%">{{assigment.SiteName}}</td>\r\n                            <td width="10%"><strong>Scheduled:</strong></td>\r\n                            <td width="10%">{{assigment.EstStartDate | date:\'MM/dd/yyyy hh:mm a\'}}&nbsp;{{vm.userTimeZone}}</td>\r\n                        </tr>\r\n                        <tr>\r\n                            <td><strong>Address:</strong></td>\r\n                            <td>\r\n                                {{assigment.FullAddress}}\r\n                                <a class="btn btn-default pull-right" style="text-decoration:none; margin-right:15px!important;" ng-href="{{assigment.googleUrl}}" target="_blank">\r\n                                    <i class="fa fa-map-marker"></i> Map\r\n                                </a>\r\n                            </td>\r\n                            <td><strong>Status:</strong></td>\r\n                            <td style="font-weight:bold;" ng-style="{\'background-color\': assigment.colorCode, \'color\': assigment.fontColor}">{{assigment.AssignmentStatusName}}</td>\r\n                        </tr>\r\n                        <tr>\r\n                            <td><strong>Contact:</strong></td>\r\n                            <td>{{assigment.ContactFullName}}</td>\r\n                            <td><strong>Priority:</strong></td>\r\n                            <td>{{assigment.Priority}}</td>\r\n                        </tr>\r\n                        <tr>\r\n                            <td><strong>Customer Name:</strong></td>\r\n                            <td>{{assigment.CustomerName}}</td>\r\n                            <td><strong></strong></td>\r\n                            <td></td>\r\n                        </tr>\r\n                        <tr>\r\n                            <td><strong>Problem:</strong></td>\r\n                            <td>{{assigment.ProblemCode}}</td>\r\n                            <td><strong>Site Time Zone:</strong></td>\r\n                            <td>{{assigment.TimeZoneName}}</td>\r\n                        </tr>\r\n                        <tr>\r\n                            <td><strong>Description:</strong></td>\r\n                            <td>{{assigment.Desc}}</td>\r\n                            <td><strong>Agreement:</strong></td>\r\n                            <td>{{assigment.AgreementDesc}}</td>\r\n                        </tr>\r\n                    </table>\r\n                </div>\r\n\r\n                \x3c!-- columns --\x3e\r\n            </div>\x3c!-- row --\x3e\r\n        </div>\x3c!-- ng-repeat --\x3e\r\n\r\n    </div>\r\n</div>\r\n\r\n'),e.put("Templates/WorkOrder/NewWorkOrder/newWorkOrder.html",'<div id="pcont" class="container-fluid" ng-controller="NewWorkOrderEditController as vm">\r\n    <div class="table-edit-overlay" ng-show="vm.submittingNewWo">\r\n        <div class="sk-circle">\r\n            <div class="sk-circle1 sk-child"></div>\r\n            <div class="sk-circle2 sk-child"></div>\r\n            <div class="sk-circle3 sk-child"></div>\r\n            <div class="sk-circle4 sk-child"></div>\r\n            <div class="sk-circle5 sk-child"></div>\r\n            <div class="sk-circle6 sk-child"></div>\r\n            <div class="sk-circle7 sk-child"></div>\r\n            <div class="sk-circle8 sk-child"></div>\r\n            <div class="sk-circle9 sk-child"></div>\r\n            <div class="sk-circle10 sk-child"></div>\r\n            <div class="sk-circle11 sk-child"></div>\r\n            <div class="sk-circle12 sk-child"></div>\r\n        </div>\r\n    </div>\r\n    <div class="page-head">\r\n        <ol class="breadcrumb">\r\n            <li><a class="cursor_pointer" ng-click="vm.$state.go(\'home\')">Home</a></li>\r\n            <li class="active">New Work Order</li>\r\n        </ol> \x3c!-- breadcrumb --\x3e\r\n        <h1>New Work Order</h1>\r\n    </div>\r\n    <div class="cl-mcont" ng-if="vm.getModulePrivilege(vm.viewName, vm.moduleName) !=0">\r\n        <div class="row">\r\n            <div class="col-md-6" style="color: #5e94ff">\r\n                <h2>Work Order</h2>\r\n            </div>\r\n            <div class="col-md-6">\r\n                \x3c!-- US3539 : FCO - WEB - Navigation links UI improvement (FCWO-2368) --\x3e\r\n                <button type="button" data-dismiss="modal" class="pull-right btn btn-primary btn-flat md-close" ng-show="vm.woAltNumber !== 0 && (vm.isAdmin || vm.isFieldConnect || vm.isDispatch || vm.isSupervisor)" ng-click="vm.$state.go(\'workOrdersDetails\',{ id: vm.woNumber })">Open Work Order {{vm.woAltNumber}}</button>\r\n                \x3c!--<a class="pull-right cursor_pointer" ng-show="vm.woAltNumber !== 0 && (vm.isAdmin || vm.isFieldConnect || vm.isDispatch || vm.isSupervisor)" ng-click="vm.$state.go(\'workOrdersDetails\',{ id: vm.woNumber })">Open Work Order {{vm.woAltNumber}}</a>--\x3e\r\n                <button type="button" data-dismiss="modal" class="pull-right btn btn-primary btn-flat md-close" ng-show="vm.woAltNumber !== 0 && (vm.isTechnician && !vm.isAdmin && !vm.isFieldConnect && !vm.isDispatch && !vm.isSupervisor)" ng-click="vm.$state.go(\'assignmentDetails\',{ id: vm.woNumber, assId: vm.woAssignmentId })">Open Work Order {{vm.woAltNumber}}</button>\r\n                \x3c!--<a class="pull-right cursor_pointer" ng-show="vm.woAltNumber !== 0 && (vm.isTechnician && !vm.isAdmin && !vm.isFieldConnect && !vm.isDispatch && !vm.isSupervisor)" ng-click="vm.$state.go(\'assignmentDetails\',{ id: vm.woNumber, assId: vm.woAssignmentId })">Open Work Order {{vm.woAltNumber}}</a>--\x3e\r\n                \x3c!-- end --\x3e\r\n            </div>\r\n        </div>\r\n        <div>\r\n            \x3c!-- <fc-table-edit disable-submit="vm.disableSubmit" custom-focus="vm.focusOut(attribute)" api-method="wo" id="{{vm.id}}"  view-name="{{vm.viewName}}" module-name="{{vm.moduleName}}" timezone="vm.WOTimezone" on-back="vm.back()" on-submit="vm.submit()" attributes="vm.attributes" model="vm.model" submit-button-text="{{vm.submitText}}"></fc-table-edit> --\x3e\r\n            <fc-table-edit disable-submit="vm.disableSubmit"\r\n                           custom-focus="vm.focusOut(attribute)"\r\n                           api-method="{{vm.woAPI}}"\r\n                           id="{{vm.id}}"\r\n                           view-name="{{vm.viewName}}"\r\n                           module-name="{{vm.moduleName}}"\r\n                           timezone="vm.WOTimezone"\r\n                           on-back="vm.back()"\r\n                           on-submit="vm.submit()"\r\n                           attributes="vm.attributes"\r\n                           model="vm.model"\r\n                           submit-button-text="{{vm.submitText}}"\r\n                           ng-if="vm.showForm">\r\n            </fc-table-edit>\r\n        </div>\r\n    </div>\r\n</div>\r\n'),e.put("Templates/WorkOrder/NewWorkOrder/selectCustomer.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n  <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n    \x3c!-- Modal content--\x3e\r\n    <div class="modal-content"  style="overflow-y: auto; height: 90%">\r\n      <div class="modal-header">\r\n        <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n      </div>\r\n        <div class="modal-body" ng-if="!vm.edit" id="newWorkOrder">\r\n            <div class="col-sm-6 col-md-6">\r\n                <div class="form-group">\r\n                    <div class="col-sm-7 col-md-6 col-lg-5">\r\n                        <input type="text" placeholder="Search" class="form-control" ng-model="vm.customerFilter.search" fc-enter="vm.search()">\r\n\r\n                    </div> \x3c!-- input box --\x3e\r\n                    <button type="submit" class="btn btn-primary" ng-click="vm.search()">Search</button>\r\n                </div> \x3c!-- form group --\x3e\r\n            </div>\r\n            <fc-table module-name="{{vm.moduleName}}" view-name="{{vm.viewName}}" table-name="Customer" on-edit="vm.edit = true" api-method="customers/active" attributes="vm.attributes" selected="vm.customerId" list="vm.customers" filter="vm.autoFilterCustomer"></fc-table>\r\n        </div>\r\n        <div class="modal-body" ng-if="vm.edit">\r\n            <fc-table-edit module-name="{{vm.moduleName}}" view-name="{{vm.viewName}}" api-method="customers" on-back="vm.edit = false" attributes="vm.attributesEdit" model="vm.model"></fc-table-edit>\r\n        </div>\r\n    </div>\r\n  </div>\r\n</div>\r\n<div class="modal-backdrop in fade" ></div>\r\n'),e.put("Templates/WorkOrder/NewWorkOrder/selectSite.html",'<div id="myModal" class="fade in modal-open" role="dialog">\r\n  <div class="modal-dialog" style="z-index: 1042; margin: 60px; position: fixed; top: 0px; left: 0px; width: auto; right: 0px; height:100%">\r\n\r\n    \x3c!-- Modal content--\x3e\r\n    <div class="modal-content" style="overflow-y: auto; height: 90%">\r\n      <div class="modal-header">\r\n        <button type="button" class="close" data-dismiss="modal" ng-click="vm.close()">&times;</button>\r\n      </div>\r\n\r\n      <div class="modal-body"  ng-if="!vm.edit" id="newWorkOrder">\r\n          <div class="col-sm-6 col-md-6">\r\n              <div class="form-group">\r\n                  <div class="col-sm-7 col-md-6 col-lg-5">\r\n                      <input type="text" placeholder="Search" class="form-control" ng-model="vm.siteFilter.search" fc-enter="vm.search()">\r\n                    \r\n                  </div> \x3c!-- input box --\x3e\r\n                  <button type="submit" class="btn btn-primary" ng-click="vm.search()">Search</button>\r\n              </div> \x3c!-- form group --\x3e\r\n          </div>\r\n          \x3c!-- DE1601 : FCO  - Web - All quote attachments are showing up under work order --\x3e\r\n          \x3c!-- <fc-table  module-name="{{vm.moduleName}}" view-name="{{vm.viewName}}" table-name="Site" api-method="sites/searchgrid" on-edit="vm.edit = true" attributes="vm.attributes" selected="vm.siteId" list="vm.sites" filter="vm.autoFilterCustomer"></fc-table> --\x3e\r\n          <fc-table module-name="{{vm.moduleName}}" \r\n                    view-name="{{vm.viewName}}" \r\n                    table-name="Site" \r\n                    api-method="sites/searchgrid" \r\n                    on-edit="vm.edit = true" \r\n                    attributes="vm.attributes" \r\n                    selected="vm.siteId" \r\n                    list="vm.sites" \r\n                    filter="vm.autoFilterCustomer"\r\n                    show-Add-New="vm.showAdd">\r\n          </fc-table>\r\n          \x3c!-- DE1601 : END --\x3e\r\n        </div>\r\n        <div class="modal-body" ng-if="vm.edit">\r\n            <fc-table-edit module-name="{{vm.moduleName}}" view-name="{{vm.viewName}}" api-method="sites" on-back="vm.edit = false" attributes="vm.attributesEdit" model="vm.model"></fc-table-edit>\r\n        </div>\r\n    </div>\r\n\r\n  </div>\r\n</div>\r\n<div class="modal-backdrop in fade" ></div>\r\n')}]);